Click or drag to resize

clsImportWorkItemServiceTaskPosition Class

Info for table MPWorkItemPosition: Positions for Service Task, internal Service Task and result task.

For additional properties review the base class clsImportWorkItemPosBase

Use MPInterface.bImportServiceTasksPositions(clsImportWorkItemServiceTaskPosition, clsImportBaseeImportMode) to import.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportWorkItemPosBase
      MARIInterfaceclsImportWorkItemServiceTaskPosition

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportWorkItemServiceTaskPosition : clsImportWorkItemPosBase

The clsImportWorkItemServiceTaskPosition type exposes the following members.

Constructors
  NameDescription
Public methodclsImportWorkItemServiceTaskPosition
Initializes a new instance of the clsImportWorkItemServiceTaskPosition class
Top
Properties
  NameDescription
Public propertyPosType
Public propertyReferenceServicePlan
Search for the service plan and reference the Service Task / Result Task Position to the selected date. If ReferenceServicePlanDate is null, the first open date is referenced. With a given date, this will be referenced. The MPWorkItemScheduleDates.FullFillSource and MPWorkItemScheduleDates.FullFillReference will be set in the referenced plan date of the service plan.
Public propertyReferenceServicePlanDate
When a ReferenceServicePlan is linked, this date allows to select a date from the cylce to link the result. Can be DateTime.MinValue.
Public propertyServiceTaskID
INT (4) WorkItemID, Link to head line
Public propertyServiceTaskPosID
INT (4) WorkItemPosID, flled by import
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