Click or drag to resize

clsImportWorkItemServiceTask Class

Import headers for Service Tasks, Internal Service Tasks and Result Tasks

MS Access Table: MARIProjektImportWorkItemServiceTask. See clsImportBase.eImportMode relative tables in MS-Access.

Use MPInterface.bImportServiceTask(clsImportWorkItemServiceTask, clsImportBaseeImportMode) to import.

Use clsImportWorkItemServiceTaskPosition to import positions to the task.

Use clsImportWorkItemServiceTaskResource to import the teacher or equpiment to be used in the qualification task.

Use clsImportWorkItemServiceTaskResults to import results to a linked checklist.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportWorkItemServiceTask

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportWorkItemServiceTask : clsImportBase

The clsImportWorkItemServiceTask type exposes the following members.

Constructors
  NameDescription
Public methodclsImportWorkItemServiceTask
Initializes a new instance of the clsImportWorkItemServiceTask class
Top
Properties
  NameDescription
Public propertyAddrAddrType
NVARCHAR (100) A0AddrType
Public propertyAddrBlock
NVARCHAR (100) A0Gebaeude
Public propertyAddrBuilding
NTEXT (0) A0GebaeudeStockwerk
Public propertyAddrCardFName
NVARCHAR (100) A0CardFName
Public propertyAddrCity
NVARCHAR (100) A0Ort
Public propertyAddrContactPersonID
INT (4) A0AnsprechpartnerID
Public propertyAddrCountry
NVARCHAR (3) A0Land
Public propertyAddrCounty
NVARCHAR (100) A0Bezirk
Public propertyAddrMatchcode
NVARCHAR (100) A0Matchcode
Public propertyAddrName1
NVARCHAR (100) A0Name1
Public propertyAddrName2
NVARCHAR (50) A0Name2
Public propertyAddrName3
NVARCHAR (50) A0Zusatz
Public propertyAddrSalutation
NVARCHAR (50) A0Anrede
Public propertyAddrState
NVARCHAR (3) A0Bundesland
Public propertyAddrStreet
NVARCHAR (100) A0Strasse
Public propertyAddrStreetNo
NVARCHAR (100) A0Hausnummer
Public propertyAddrZIP
NVARCHAR (20) A0PLZ
Public propertyCardCode
Link to Customer
Public propertyCheckList
CheckList (int)
Public propertyCollectionPositions
(Optionally) Add a list of clsImportWorkItemServiceTaskPosition positions
Public propertyCollectionResources
(Optionally) Add a list of clsImportWorkItemServiceTaskResource linked resources
Public propertyCompanyId
SMALLINT (2) Link to company (SBO Database)
Public propertyContactPersonText
NVARCHAR (100) ContactPersonText
Public propertyContractID
INT (4) Link to Contract (Plan, Task)
Public propertyContractPositionID
INT (4) 0=New positions as "at cost", Link to fixed price position
Public propertyGroup1
Group1 The GroupType (GruppenArt) depends on the WorkItemType
Public propertyGroup2
Group2 The GroupType (GruppenArt) depends on the WorkItemType
Public propertyGroup3
Group3 The GroupType (GruppenArt) depends on the WorkItemType
Public propertyGroupID
Group0 The GroupType (GruppenArt) depends on the WorkItemType
Public propertyMatchcode
Name of the Service Task
Public propertyOSCLCallID
Link to SBO Service Call
Public propertyPhaseID
INT (4) Link to Phase Plan, Task)
Public propertyPMTicketID
Link to PM Support Ticket
Public propertyPriority
INT (4) Internal Priority (not used at the moment)
Public propertyProject
NVARCHAR (20) Link to Project (Plan, Task)
Public propertyReference1
Reference1
Public propertyReference2
Reference2
Public propertyReference3
Reference3
Public propertyServicePlanTemplate
INT (4) Link to Template (For Plan)
Public propertyServiceTaskID
ServiceTaskID INT (4) Unique ID (via MPTAN). In access can be <100000 to align the positiosn
Public propertyServiceTaskType
Distringuishes between different types. See eServiceTaskType for details.
Public propertySignaturePic
INT (4) Link to picture table for the signature
Public propertyStandardWarehouse
NVARCHAR (20) warehouse for new positions / vehicles warehouse
Public propertyWorkDescription
NTEXT (0) Memo What to do, You can use html
Public propertyWorkItemDocNum
Visible ID based on Number Series. Will be created automatically. Leave this blank.
Public propertyWorkItemDocSeries
INT (4) ID of the number series
Public propertyWorkItemEnd
Datetime (8) End of Task
Public propertyWorkItemStart
Datetime (8) Start of task
Public propertyWorkItemStatus
INT (4) Status (depending on type) 1:Request,2=Active,3=CloseReadyToInvoice,4=ClosedInvoiced. See eWorkItemStatus for details.
Public propertyWorkNotes
NTEXT (0) Memo for notes on site
Top
Methods
  NameDescription
Public methodbReadFromDB (Overrides clsImportBasebReadFromDB(MPInterface, String).)
Public methodGetListUserDefinedFields
Returns the user defined field definition for all dimension "WorkItem: Service Plan Template, Service Plan, Service Task, etc.". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).)
Top
Remarks
Examples
Create a service task with positions and store result of a check list.
public bool CreateServiceTaskAndResult(string sEquipmentCode, int lCheckList, int lServiceplanID) {
    string sErrordetails = "";
    //Create Service Task
    clsImportWorkItemServiceTask oServiceTask = new clsImportWorkItemServiceTask();
    oServiceTask.Matchcode = "DTW Result Task";
    oServiceTask.ServiceTaskType = clsImportWorkItemServiceTask.eServiceTaskType.ResultTask;
    oServiceTask.WorkItemStart = new DateTime(2016, 12, 12, 07, 30, 00);
    oServiceTask.WorkItemEnd = new DateTime(2016, 12, 12, 15, 30, 00);
    oServiceTask.CompanyId = 1;
    oServiceTask.WorkItemStatus = clsImportWorkItemServiceTask.eWorkItemStatus.ServiceActive;
    oServiceTask.CardCode = "10000";

    if (oMPInterface.bImportServiceTask(oServiceTask, clsImportBase.eImportMode.ValidateAndImport)) {

        //Create Service Task Position
        clsImportWorkItemServiceTaskPosition oLinkPos = new clsImportWorkItemServiceTaskPosition();
        oLinkPos.ServiceTaskID = oServiceTask.ServiceTaskID;
        oLinkPos.PosType = clsImportWorkItemServiceTaskPosition.ePositionTyp.EquipmentServiceIsFor;
        oLinkPos.LineKeyValue = sEquipmentCode;
        oLinkPos.QualityProcess = lCheckList;
        //Store Reference to the scheduled date
        oLinkPos.ReferenceServicePlan = lServiceplanID;
        oLinkPos.QualityResult = 100000; // Result Status: SELECT QualityStatus FROM MARIQualityStatus WHERE ClassID=378

        if (oMPInterface.bImportServiceTasksPositions(oLinkPos, clsImportBase.eImportMode.ValidateAndImport)) {

            //Create Result to the check list
            clsImportWorkItemServiceTaskResults oResult = new clsImportWorkItemServiceTaskResults();
            oResult.QualityProcess = oLinkPos.QualityProcess;
            oResult.ServiceTaskPosID = oLinkPos.ServiceTaskPosID;
            oResult.ServiceTaskId = oLinkPos.ServiceTaskID;
            oResult.QualityProcessQuestion = 100009; //one selected question  SELECT QualityProcessQuestion FROM MARIQualityProcessQuestions
            oResult.ResultValue = 88.881m;

            if (oMPInterface.bImportServiceTaskResults(oResult, clsImportBase.eImportMode.ValidateAndImport)) {
                return true;
            } else {
                sErrordetails = oMPInterface.oErrors.PrintErrors(true);
                LogFail(sErrordetails);
                return false;
            }

        } else {
            sErrordetails = oMPInterface.oErrors.PrintErrors(true);
            LogFail(sErrordetails);
            return false;
        }
    } else {
        return false;
    }
}
See Also