clsImportWorkItemServicePlanPosition Class |
Use MPInterface.bImportServicePlanPosition(clsImportWorkItemServicePlanPosition, clsImportBaseeImportMode) to import.
Namespace: MARIInterface
The clsImportWorkItemServicePlanPosition type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportWorkItemServicePlanPosition | Initializes a new instance of the clsImportWorkItemServicePlanPosition class |
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; }