clsImportPhase Class |
Please concider the correct planning version. See PlanningVersion. The standard planning version is 3.
MS Access table: MARIProjektImportProjectPhases. See clsImportBase.eImportMode for tables in MS Access updated, when a phase is stored.
Use MPInterface.bImportPhase(clsImportPhase, clsImportBaseeImportMode) to import.
Namespace: MARIInterface
The clsImportPhase type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportPhase | Initializes a new instance of the clsImportPhase class |
| Name | Description | |
|---|---|---|
| AutoPlanningMode | Auto Planning Mode for automatic moving based on dependencies (works with V5.4). See clsImportPhaseeAutoPlanningMode. | |
| ChangeDate |
Date from the last change
| |
| ChangeUserID |
User from the last change NVARCHAR(4)
| |
| DegreeDate |
Date when the user change status to complete
| |
| DegreeMemo |
Special Text stored, when the phase status is changed to complete. Can be used only starting with version 5.4
| |
| DegreeOfCompletion |
Degree of completion. Manually estimated. 0 to 0,99 as Integer 1 = 100% is in the same time with completion (automatic in class)
| |
| DegreeUser |
User who did the phase completion
| |
| GroupID |
Phase group ID. Used to link project individual phases to global groups for planning and analyzing features.
| |
| Indent |
Insertion deepness standard=1 (Using ParentID defines the position. Using Indent>Parent.Indent makes new phase to sub phase)
| |
| MileStone | MileStone | |
| Parent | Link to phases above in the hirarchy. When the Parent phase is found and the Indent is > the Indent of the parent, a child is created. The parent may change from Leave to Branch. When you like to add a phase 'A.3' under A (A.1, A.2) use the PhaseId of A.2 as the Parent and the same Indent. Then A.3 will be under A.2. In the database the field Parent will after the import point to A one Indent higher | |
| PhaseID |
Identification of a phase. Can be used in the MS Access database as a reference (< 100000). Will get an internal number as a unique phase id.
| |
| PhaseIdentifier |
Identifier of one phase over the several planning versions. When phases are copied from on planning version to another, the phase identifier stays the same. When empty, the phase will use the PhaseID.
| |
| PhasesEndDate |
End date of the phase (branch or leave). When PhaseStartDate and PhaseEndDate are the same. It will be considered as a milestone
| |
| PhasesMemo |
Extra informations for phases
| |
| PhasesStartDate |
Start Date of the phase (branch or leave).
| |
| PhaseStatus |
Status of a phase for data entry and billing. 0=not started, 1=active phase,2=finished phase, 3=partial finished (for branches). See ePhaseStatus.
| |
| PhaseText |
Visible Text of the phase, NVARCHAR(100)
| |
| PhaseType |
Type of the phase in the hierarchy. 1=leave, 2=brach. See ePhaseType for details. Only leaves can be used for transactions.
| |
| PlanningVersion |
Reference for the planning version. Standard=3. When property is 0 the current phase planning version from the project will be used. See clsImportProject.PlanningVersion for the current planning version of the project.
Standard planning versions are:
| |
| Position |
Order from the phases (coactive). Is not used in the import. The imnport only attaches phases to the end. Starts with 1.
| |
| PrimalCreation |
Date from the primal cration
| |
| ProjectNumber |
Reference for the project. Mandatory
| |
| SourcePhasesID |
Link a source phase, the phase is copied from another planning versions. Not used in the import.
|
| Name | Description | |
|---|---|---|
| bReadFromDB |
Reads the project phase data from the database and copies the values to the class
Only for internal use! To load data use your own SQL.
(Overrides clsImportBasebReadFromDB(MPInterface, String).) | |
| bSaveRSToMDB | (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).) | |
| GetListUserDefinedFields |
Returns the user defined field definition for the dimension "Phase Master". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).) |
private string CreateProjectWithPhasesSimple() { Log($"CreateProjectWithPhasesSimple"); string sNewProjectNumber; //Let MARIProject create a new project number int iBusinessUnit = 1; // SELECT BusinessUnitID FROM MARIBusinessUnitMaster //MARIProject will suggest the next free project number: sNewProjectNumber = oMPInterface.sGetNewProjectNumber(iBusinessUnit); clsImportProject oProject = new clsImportProject(); oProject.ProjectNumber = sNewProjectNumber; oProject.ProjectName = "DTW New Project With Phases"; oProject.Matchcode = oProject.ProjectName; oProject.BusinessUnit = iBusinessUnit; oProject.ProjectType = clsImportProject.eProjectType.CustomerProjects; oProject.ActiveType = clsImportProject.eProjektActiveType.OpenForBoocking; oProject.ProjectStatus = clsImportProject.eProjectStatus.ProjectRunning; //Project Code can be created automatically with the project, depending on the settings. DI-API will be used. Make sure hat DI-API 32 or 64 bit is installed, where MARIInterface is running. oProject.ProjectCodeFinance = ""; if (oMPInterface.bImportProject(oProject, clsImportBase.eImportMode.ValidateAndImport)) { int lParentPhase, lPhaseA1, lPhaseA2; lParentPhase = CreateParentPhaseSimple("Phase A", sNewProjectNumber); lPhaseA1 = CreatePhaseSimple("Phase A.1", lParentPhase, sNewProjectNumber); lPhaseA2 = CreatePhaseSimple("Phase A.2", lParentPhase, sNewProjectNumber); CreatePhaseSimple("Phase A.3", lParentPhase, sNewProjectNumber); lParentPhase = CreateParentPhaseSimple("Phase B", sNewProjectNumber); CreatePhaseSimple("Phase B.1", lParentPhase, sNewProjectNumber); return sNewProjectNumber; } else { LogFail(oMPInterface.oErrors.PrintErrors(true)); return ""; } } public int CreatePhaseSimple(string Phase, int Parent, string ProjectNumber) { Log($"CreatePhaseSimple(Phase=\"{Phase}\", Parent={Parent}, ProjectNumber=\"{ProjectNumber}\")"); clsImportPhase oPhase = new clsImportPhase(); oPhase.ProjectNumber = ProjectNumber; oPhase.PhaseText = Phase; oPhase.Indent = 2; oPhase.Parent = Parent; oPhase.PhaseType = clsImportPhase.ePhaseType.Leave; if (oMPInterface.bImportPhase(oPhase, clsImportBase.eImportMode.ValidateAndImport)) { Log($"CreatePhaseSimple: PhaseID={oPhase.PhaseID}"); return oPhase.PhaseID; } else { LogFail( oMPInterface.oErrors.PrintErrors(true)); return 0; } } public int CreateParentPhaseSimple(string PhaseText, string ProjectNumber) { Log($"CreateParentPhaseSimple(PhaseText=\"{PhaseText}\", ProjectNumber=\"{ProjectNumber}\")"); clsImportPhase oPhase = new clsImportPhase(); oPhase.ProjectNumber = ProjectNumber; oPhase.PhaseText = PhaseText; oPhase.Indent = 1; //oPhase.PhaseType = clsImportPhase.ePhaseType.Branch; // The type branch will be defined by its children. Only when adding Indent=2 chilfs will make the phase to a branch if (oMPInterface.bImportPhase(oPhase, clsImportBase.eImportMode.ValidateAndImport)) { Log($"CreateParentPhaseSimple: PhaseID={oPhase.PhaseID}"); return oPhase.PhaseID; } else { LogFail(oMPInterface.oErrors.PrintErrors(true)); return 0; } }