clsImportWorkItemServicePlanTemplate Class |
MS-Access table: MARIProjektImportWorkItemServicePlanTemplate. See clsImportBase.eImportMode relative tables in MS-Access.
Use MPInterface.bImportServicePlanTemplate(clsImportWorkItemServicePlanTemplate, clsImportBaseeImportMode) to import.
Use clsImportWorkItemServicePlanTemplatePosition to import positions to the service template (Spare parts, services and template for).
Namespace: MARIInterface
The clsImportWorkItemServicePlanTemplate type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportWorkItemServicePlanTemplate | Initializes a new instance of the clsImportWorkItemServicePlanTemplate class |
| Name | Description | |
|---|---|---|
| GetListUserDefinedFields |
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).) |
| Name | Description | |
|---|---|---|
| CheckList | CheckList (int) | |
| CompanyID | Company ID. Link to the logical link to the SBO Database(Schema) | |
| Currency | Currency (NVARCHAR 3) | |
| CycleType | Cycle Type | |
| CycleValue | Cycle Value = Number of month. For standard CycleType this value is set automatically | |
| ExchangeRate | Exchange Rate (decimal) | |
| Matchcode | Matchcode | |
| ResetStatusOnReturnEquipment |
Then this is true, the linked service tasks will be reset, by rescheduling, that a hew due date will be used on return. This setting in the template will be copied to new created service plans.
| |
| ScheduleType | Handling definition to create the plan dates for a service plan. See eScheduleType. | |
| ServiceplanID | Serviceplan ID Internal ID (not visible). Can be 0. For access this number should be <100000 to link the positions | |
| TemplateSource | Template Source | |
| TemplateValue | Template Value (NVARCHAR 20). Reference to item group, item, equipment category |
string sErrordetails; try { clsImportWorkItemServicePlanTemplate NewServicePlanTemplate = new clsImportWorkItemServicePlanTemplate(); NewServicePlanTemplate.Matchcode = "DTW Service Plan Template. Annualy"; NewServicePlanTemplate.CycleType = clsImportWorkItemServicePlanTemplate.ePlanTemplateCycleType.Yearly; NewServicePlanTemplate.CompanyID = 1; //Add first link "Used By". This is equipvilant to add clsImportWorkItemServicePlanTemplatePosition.ePosType.BaseLineEquipment Positions. NewServicePlanTemplate.TemplateSource = clsImportWorkItemServicePlanTemplate.eTemplateSource.EquipmentCategory; NewServicePlanTemplate.TemplateValue = "100001"; // In this case the Id of the EquipmentCategory Master: SELECT EquipmentCategory FROM MARIEquipmentCategory if (oMPInterface.bImportServicePlanTemplate(NewServicePlanTemplate, clsImportBase.eImportMode.ValidateAndImport)) { // Add some service and spare parts clsImportWorkItemServicePlanTemplatePosition oPos; oPos = new clsImportWorkItemServicePlanTemplatePosition(); oPos.ServicePlanID = NewServicePlanTemplate.ServiceplanID; oPos.PosType = clsImportWorkItemServicePlanTemplatePosition.ePlanTemplatePosType.Service; oPos.PosValue = "1080";//SELECT ServiceNumber FROM [TEMPLATE_FILM_US_PM]..MARIServices oPos.Quantity = 0.5m; // hours to perform this service oPos.Quantity = 0.5m; oPos.UnitPrice = 80m; oPos.ContractPosType = clsImportWorkItemServicePlanTemplatePosition.ePlanTemplateContractPosType.AtCost; oPos.Matchcode = "Repair Work"; if (oMPInterface.bImportServicePlanTemplatePosition(oPos, clsImportBase.eImportMode.ValidateAndImport)) { sErrordetails = ""; } else { sErrordetails = oMPInterface.oErrors.PrintErrors(true); LogFail(sErrordetails); return; } sErrordetails = ""; return; } sErrordetails = oMPInterface.oErrors.PrintErrors(true); LogFail(sErrordetails); return; } catch (Exception ex) { sErrordetails = ex.Message; LogFail(sErrordetails); return; }