clsImportEquipmentBookings Class |
Use MPInterface.bImportEquipmentBooking(clsImportEquipmentBookings, clsImportBaseeImportMode) to import.
Namespace: MARIInterface
The clsImportEquipmentBookings type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportEquipmentBookings | Initializes a new instance of the clsImportEquipmentBookings class |
| Name | Description | |
|---|---|---|
| Activity | ActivityText: Free Text | |
| ApprovalFlag |
The import can directly set the approval flag. This only works, if the user loged into the interface is allowed in the project to approve equipment bookings.
| |
| ApprovalText | ApprovalText | |
| ContractID | ContractID: Contract Identifier. This is the internal identifier (INT) not the official contract number (char20). | |
| ContractParentPositionID | Identifier of the contract position (INT).This is the main (parent) category contract position. Computed, if 0 | |
| CostTypePositionID | ContractPositionID: Contract position ID for the required cost type in the contract. If 0, then the HelpCostType is used | |
| EmployeeNumber | Employee: User who is responsible for the transaction. Mostly the project manager. See clsImportEmployee for the employee dimension. | |
| EndTime | EndTime: End Time (0:01 to 23:59). StartTime=NULL and EndTime=NULL means full day | |
| EndTimeBillable | EndTimeBillable: End Time (0:01 to 23:59) for billing. StartTimeBillable=NULL and EndTimeBillable=NULL means full day | |
| EquipmentCode | EquipmentCode Used equipment Code | |
| EquipmentFrom | EquipmentFrom Equipment Start Date | |
| EquipmentTo | Equipment End Date for repeating bookings | |
| HelpContractNumber | If ContractID is 0 the Contract is searched by the visible contract ID | |
| HelpCostType | HelpCostType: Used cost type. if CostTypePositionID=0 the first contract position with this CostType is used | |
| HelpPhaseName | For projects with phases, the phase ID can be searched by the phase name, if PhaseID is 0: The first matching phase with the given name will be used. | |
| LineID | EquipmentBookingID Line ID: Given by the system. Filled after import | |
| MemoText | Memo: The Memo field can store 2 Million caracters (TEXT). | |
| NumberOfEquipments | NumberOfEquipments: default=1, other numbers only for Equipment of the EquipmentType=eEquipmentMasterType.EquipmentMasterQtyNoSN = 451 | |
| PhaseID | PhaseID: Phase Identifier (INT). Only leaves of phases can be used, not branches. | |
| ProjectNumber | ProjectNumber | |
| Quantity | Quantity: Number of hours used. Put 24 for one day: | |
| QuantityBillable | QuantityBillable: Number of hours used for billing (please fill this field 1:1 with the Quanity | |
| StartTime | StartTime Time start (0:00 to 23:59) | |
| StartTimeBillable | StartTimeBillable: Time start (0:00 to 23:59) for billing |
View: MARIProjectTimeKeepingLines: :Table: MPProjektBuchungserfassung
View: MARIEquipmentSubjectBooking : :Table: MPEquipmentSubjectBooking
View: MARIProjectTimeKeepingHeader: :Table: MPProjektBuchungskopf (one line per employee and Month)
Import table: MARIProjektImportEquipmentBooking.private void CreateEquipmentBooking(string sProject, int lContract, int lContractPositionEquipment, string sEquipmentMasterCode) { Log($"CreateEquipmentBooking(\"{sProject}\", lContract={lContract}, lContractPositionEquipment={lContractPositionEquipment}, \"{sEquipmentMasterCode}\")"); clsImportEquipmentBookings NewLine = new clsImportEquipmentBookings(); NewLine.EquipmentCode = sEquipmentMasterCode; NewLine.EquipmentFrom = new DateTime(2015, 1, 1); NewLine.EquipmentTo = new DateTime(2015, 1, 31); // start and end date have to be in the same period. SELECT PeriodStart, PeriodEnd, Period FROM MARIPeriods NewLine.ProjectNumber = sProject; NewLine.ContractID = lContract; //SELECT ContractID FROM MARIContract WHERE ProjectNumber='P100032' NewLine.CostTypePositionID = lContractPositionEquipment; //SELECT ContractPositionID FROM MARIContractPositions where PositionType=47 AND ContractID=102080 NewLine.EmployeeNumber = "0001"; //Employee using the equipment (Can be the project manager, but mandatory) NewLine.Activity = "Imported Line from MARIInterface"; NewLine.Quantity = 1; //day NewLine.QuantityBillable = 1; //day //NewLine.ApprovalFlag = true;//directly approve this booking //NewLine.ApprovalText = "Approved by import"; if (oMPInterface.bImportEquipmentBooking(NewLine, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) { Log($"Equipment Booking is created = LindID = {NewLine.LineID}"); } else { LogFail(oMPInterface.oErrors.PrintErrors()); } }