Click or drag to resize

clsImportWorkItemServicePlanPosition Class

Info for table MPWorkItemPosition: Positions for Service Plans. The positions can contain standard spare parts and standard services. Access table: MARIProjektImportWorkItemServicePlanPositions

Use MPInterface.bImportServicePlanPosition(clsImportWorkItemServicePlanPosition, clsImportBaseeImportMode) to import.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportWorkItemServicePlanTemplatePosition
      MARIInterfaceclsImportWorkItemServicePlanPosition

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportWorkItemServicePlanPosition : clsImportWorkItemServicePlanTemplatePosition

The clsImportWorkItemServicePlanPosition type exposes the following members.

Constructors
  NameDescription
Public methodclsImportWorkItemServicePlanPosition
Initializes a new instance of the clsImportWorkItemServicePlanPosition class
Top
Remarks
Examples
Create a service plan for one given equiment
string sErrordetails;

try {
    //Create a service plan for one equipment
    clsImportWorkItemServicePlan NewServicePlan = new clsImportWorkItemServicePlan();
    NewServicePlan.Matchcode = "DTW Service Plan for Equpment";
    NewServicePlan.ServiceObjectType = clsImportWorkItemServicePlan.eServiceObjectType.Equipment;
    NewServicePlan.ServiceObject = "E110000"; // In this case the Id of the EquipmentMaster: SELECT EquipmentCode FROM MARIEquipmentMaster
    NewServicePlan.StartDate = new DateTime(2015, 1, 1);
    NewServicePlan.EndDate = new DateTime(2018, 12, 31);
    NewServicePlan.ServicePlanTemplate = 102055; // SELECT WorkItemID FROM MARIWorkItem WHERE WorkItemType=378 ... Additional conditions based on the "Used In" definition of the template
    NewServicePlan.CompanyID = 1;

    //Optional orverwrite the cycle type for this specific plan
    NewServicePlan.CycleType = clsImportWorkItemServicePlan.eCycleType.Quarterly;

    //Optional Link to a service project with contract and an internal contract
    NewServicePlan.Project = "P100028";
    NewServicePlan.ContractID = 102056; //SELECT ContractID FROM MARIContract WHERE ProjectNumber='P100028'
    NewServicePlan.ContractPosition = 0; // New positions in the sevice plan will be default to item at cost.

    if (oMPInterface.bImportServicePlan(NewServicePlan, clsImportBase.eImportMode.ValidateAndImport)) {
        sErrordetails = "";
        return;
    }

    sErrordetails = oMPInterface.oErrors.PrintErrors(true);
    LogFail(sErrordetails);
    return;

} catch (Exception ex) {
    sErrordetails = ex.Message;
    LogFail(sErrordetails);
    return;
}
See Also