clsImportWorkItemServicePlanTemplatePosition Class |
Access table MARIProjektImportWorkItemServicePlanTemplatePos
Use MPInterface.bImportServicePlanTemplatePosition(clsImportWorkItemServicePlanTemplatePosition, clsImportBaseeImportMode) to import.
Namespace: MARIInterface
The clsImportWorkItemServicePlanTemplatePosition type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportWorkItemServicePlanTemplatePosition | Initializes a new instance of the clsImportWorkItemServicePlanTemplatePosition class |
| Name | Description | |
|---|---|---|
| ContractPosType | Contract Position Type | |
| Description1 |
NVARCHAR (100) Description1
| |
| Description2 |
NVARCHAR (100) Description2
| |
| Matchcode |
NVARCHAR (100) Matchcode
| |
| PosID | Position ID: Internal position ID: can be <100000. will be created | |
| PosType | Position Type. See ePosType. | |
| PosValue | Position Value (ItemCode,ServiceCode, Equipment Category, ItemGroup). This defines that the template is linked to the selected dimension. | |
| Quantity | Quantity | |
| QuantityInv | Quantity Invoicable | |
| ServicePlanID | ServicePlanID Link to service plan or service plan template. (in access must be in synch with the header table) | |
| UnitPrice | Unit Price |
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; }