clsImportPlanning Class |
Namespace: MARIInterface
The clsImportPlanning type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportPlanning | Initializes a new instance of the clsImportPlanning class |
| Name | Description | |
|---|---|---|
| Activity |
Planning text for additional information.
| |
| CalendarMode |
Change the handling type, when a planning bar is moved in the GANNT. See clsImportPlanningeCalendarMode for details.
| |
| ContractID |
Contract ID. Link to the sales contract. This field can be a mandatory field, based on a basic setting by project business unit.
| |
| ContractNumberWithDescription | Informational Property for the OutLook AddIn | |
| ContractPos |
Contract Position. Link to the sales contract position. This field can be a mandatory field, based on a basic setting by project business unit.
The position type of the contract position must correspond to the ressource type.
| |
| ContractPosName | Informational Property for the OutLook AddIn | |
| Costs | ||
| DateFrom |
Start date of this planning line
| |
| DateTo | End data of this planning element | |
| OnlyOnWorkingDays |
Flag: Create only on working days. Stored with other flags in SpreadMode
| |
| PhaseID |
Phase ID. Link to the phase for his planning line. Mandatory, if project/planningversion does have phases.
| |
| PhaseName | Informational Property for the OutLook AddIn | |
| PlanningJobDayID | Informational Property for the OutLook AddIn | |
| PlanningJobDaysID | Informational Property for the OutLook AddIn | |
| PlanningMemo |
Additional text for a planning line
| |
| PlanningResourceType |
Type of ressource used in planning. Default=Employee Planning. See clsImportPlanningePlanningResourceType for details.
| |
| PlanningType |
Type of planning in the database. Default is ePlanningType.DayPlanning. | |
| PlanningVersion | Planning Version for this planning line (3=actual planning). Must be aligned with the phase id (if used). If Empty(0), the current project standard is used. | |
| ProjectName | Informational Property for the OutLook AddIn | |
| ProjectNumber |
Project number for the planning. The project must exist. See clsImportProject.
| |
| QuantityResources |
Quantity of resources for the planning. This can be the number of employees in a pool planning,
the number of equipments when planning an equipment category or the number of items in an item plannning.
In all other cases this value will be ignored.
| |
| QuantityTime |
Quantity days or hours for planning depending on TimeUnit. Default is eTimeUnit.Hours".
| |
| ResourceID |
Resource Key, depending on clsImportPlanningePlanningResourceType. Default = Employee
| |
| TargetedRevenues | ||
| TimeUnit |
Time Unit used for planning. Default is eTimeUnit.Hours". Only used in this object. In the database, all planning is stored in hours (and fractions of hours)
|
| Name | Description | |
|---|---|---|
| bDelete |
Deletes the planning entry for one day.
| |
| bDeletePlanJob |
Deletes the planning.
| |
| bDoProjectBooking |
Create a Timesheet entry based on a planning entry.
Copied ProjectNumber,ContractID,PhaseID and ContractPositionID from the planning
| |
| bUpdate |
Update an existing planning
|
private int CreatePlanningEmployee(string sEmployee, DateTime dtPlanDate) { Log($"CreatePlanningEmployee({sEmployee}, {dtPlanDate.ToShortDateString()})"); //Create one day planning for one employee clsImportPlanning NewPlanning = new clsImportPlanning(); NewPlanning.ProjectNumber = "P100005"; NewPlanning.ContractID = 100008; // SELECT ContractID FROM MARIContract WHERE ProjectNumber=N'P100005' NewPlanning.ContractPos = 100031; // SELECT ContractPositionId FROM MARIContractPositions WHERE ContractID=100008 AND PositionType=4 --(ServiceAtCost) NewPlanning.PhaseID = 100018; // SELECT PhaseID FROM MARIProjectPhases WHERE ProjectNumber=N'P100005' NewPlanning.DateFrom = dtPlanDate; NewPlanning.Activity = "Plantext"; NewPlanning.PlanningType = clsImportPlanning.ePlanningType.DayPlanning; //default NewPlanning.PlanningResourceType = clsImportPlanning.ePlanningResourceType.Employee; //default NewPlanning.ResourceID = sEmployee; //NewPlanning.QuantityTime = ... When no time is given, the planning will use the standard calendar for the full day planning. //Costs / TargetedRevenues are calculated from the employees political cost and the sales position if (oMPInterface.bImportPlanning(NewPlanning, clsImportBase.eImportMode.ValidateAndImport)) { return NewPlanning.PlanningJobDayID; } else { throw new Exception(oMPInterface.oErrors.PrintErrors()); } }
private int CreatePlanningPoolPeriodPlanning(DateTime dtPlanDate) { Log($"CreatePlanningPoolPeriodPlanning({dtPlanDate.ToShortDateString()})"); clsImportPlanning NewPlanning = new clsImportPlanning(); NewPlanning.ProjectNumber = "P100024"; NewPlanning.ContractID = 102036; //sales contract. Can be mandatory for planning, depending on settnig NewPlanning.ContractPos = 102304; // sales contract position NewPlanning.PhaseID = 100032; //Erdarbeiten NewPlanning.DateFrom = dtPlanDate; NewPlanning.PlanningResourceType = clsImportPlanning.ePlanningResourceType.Pool; NewPlanning.ResourceID = "00002"; // Ressource pool id: CAD-Designer NewPlanning.PlanningType = clsImportPlanning.ePlanningType.PeriodPlanning; NewPlanning.TimeUnit = clsImportPlanning.eTimeUnit.Days; NewPlanning.QuantityTime = 10; //hours NewPlanning.QuantityResources = 2; //two employees are expected to work together on this task NewPlanning.Activity = "Pool Planning"; if (oMPInterface.bImportPlanning(NewPlanning, clsImportBase.eImportMode.ValidateAndImport)) { return NewPlanning.PlanningJobDayID; } else { throw new Exception(oMPInterface.oErrors.PrintErrors()); } } private int CreatePlanningStandardPool(DateTime dtPlanDate) { Log($"CreatePlanningStandardPool({dtPlanDate.ToShortDateString()})"); clsImportPlanning NewPlanning = new clsImportPlanning(); NewPlanning.ProjectNumber = "P100024"; NewPlanning.ContractID = 102036; // can be mandatory, depending on settnig NewPlanning.ContractPos = 102304; NewPlanning.PhaseID = 100032; //Erdarbeiten NewPlanning.DateFrom = dtPlanDate; NewPlanning.ResourceID = ""; // will be the standard pool NewPlanning.PlanningResourceType = clsImportPlanning.ePlanningResourceType.StandardPool; NewPlanning.PlanningType = clsImportPlanning.ePlanningType.PeriodPlanning; NewPlanning.QuantityTime = 8; NewPlanning.QuantityResources = 2; NewPlanning.Activity = "StandardPool Planning"; if (oMPInterface.bImportPlanning(NewPlanning, clsImportBase.eImportMode.ValidateAndImport)) { return NewPlanning.PlanningJobDayID; } else { throw new Exception(oMPInterface.oErrors.PrintErrors()); } }
private int CreatePlanningEquipmentCatDay(DateTime dtPlanDate) { Log($"CreatePlanningEquipmentCatDay({dtPlanDate.ToShortDateString()})"); clsImportPlanning NewPlanning = new clsImportPlanning(); NewPlanning.ProjectNumber = "P100024"; NewPlanning.ContractID = 102036; // sales contract for the rental of the digger NewPlanning.ContractPos = 102285; //sales contract position for the duration of the digger rental NewPlanning.PhaseID = 100031; //selected phase NewPlanning.DateFrom = dtPlanDate; NewPlanning.DateTo = dtPlanDate.AddDays(5); NewPlanning.PlanningResourceType = clsImportPlanning.ePlanningResourceType.EquipmentCategoryDays; NewPlanning.ResourceID = "100001"; // digger equipment category NewPlanning.PlanningType = clsImportPlanning.ePlanningType.DayPlanning; NewPlanning.TimeUnit = clsImportPlanning.eTimeUnit.Days; NewPlanning.QuantityResources = 2; //two digger at the same time NewPlanning.Activity = "EqCat Planning"; if (oMPInterface.bImportPlanning(NewPlanning, clsImportBase.eImportMode.ValidateAndImport)) { return NewPlanning.PlanningJobDayID; } else { throw new Exception(oMPInterface.oErrors.PrintErrors()); } } private int CreatePlanningEquipmentCat(DateTime dtPlanDate) { Log($"CreatePlanningEquipmentCat({dtPlanDate.ToShortDateString()})"); clsImportPlanning NewPlanning = new clsImportPlanning(); NewPlanning.ProjectNumber = "P100024"; NewPlanning.ContractID = 102036; // sales contract for the rental of the digger NewPlanning.ContractPos = 102285; //sales contract position for the duration of the digger rental NewPlanning.PhaseID = 100031; //selected phase for the plan NewPlanning.DateFrom = dtPlanDate; NewPlanning.DateTo = dtPlanDate.AddDays(5); NewPlanning.PlanningResourceType = clsImportPlanning.ePlanningResourceType.EquipmentMasterDays; NewPlanning.ResourceID = "E110000"; // specific digger NewPlanning.PlanningType = clsImportPlanning.ePlanningType.DayPlanning; NewPlanning.TimeUnit = clsImportPlanning.eTimeUnit.Days; //NewPlanning.QuantityTime = 10; NewPlanning.QuantityResources = 2; NewPlanning.Activity = "Equipment Planning"; if (oMPInterface.bImportPlanning(NewPlanning, clsImportBase.eImportMode.ValidateAndImport)) { return NewPlanning.PlanningJobDayID; } else { throw new Exception(oMPInterface.oErrors.PrintErrors()); } }
private int CreatePlanningItem(string ItemCode, DateTime FirstDayOfPeriod) { Log($"CreatePlanningItem({ItemCode}, {FirstDayOfPeriod.ToShortDateString()})"); //Create one day planning for one employee clsImportPlanning NewPlanning = new clsImportPlanning(); NewPlanning.ProjectNumber = "P100011"; NewPlanning.ContractID = 100015; // SELECT ContractID FROM MARIContract WHERE ProjectNumber=N'P100011' NewPlanning.ContractPos = 100054; // SELECT ContractPositionId FROM MARIContractPositions WHERE ContractID=100008 AND WHERE PositionType=1 and ItemCode='230001' --(ItemAtCost) NewPlanning.PhaseID = 0; //(no phase on this project) SELECT PhaseID FROM MARIProjectPhases WHERE ProjectNumber=N'P100011' NewPlanning.DateFrom = FirstDayOfPeriod; NewPlanning.Activity = "material plan"; NewPlanning.PlanningType = clsImportPlanning.ePlanningType.PeriodPlanning; //cost is planned in the month NewPlanning.PlanningResourceType = clsImportPlanning.ePlanningResourceType.Item; NewPlanning.ResourceID = ItemCode; NewPlanning.Costs = 800m; NewPlanning.TargetedRevenues = 1000m; NewPlanning.QuantityResources = 10; if (oMPInterface.bImportPlanning(NewPlanning, clsImportBase.eImportMode.ValidateAndImport)) { return NewPlanning.PlanningJobDayID; } else { throw new Exception(oMPInterface.oErrors.PrintErrors()); } }