Click or drag to resize

clsImportProject Class

Data holder to import the project master data into the MARIProject database.

Use MPInterface.bImportProject(clsImportProject, clsImportBaseeImportMode) to import.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportProject

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportProject : clsImportBase

The clsImportProject type exposes the following members.

Constructors
  NameDescription
Public methodclsImportProject
Initializes a new instance of the clsImportProject class
Top
Properties
  NameDescription
Public propertyActiveType
Public propertyAssessmentMode
0=no attendance, 1=attendance on the valuation from unready operations V2.2
Public propertyBookableUntilPeriod
period for posting block (YYYYMMM)
Public propertyBusinessUnit
INT Business Unit identifier. Mandatory link indirectly for the profitcenter/costcenter. See dimension clsImportSetupBusinessUnits for details.
Public propertyCostObjektive Obsolete.
Property will be replaces by ProjectCodeFinance. Logical link to the finance project code.
Public propertyCustomerCode1
Customer reference of the project. 1 = Main customer
Public propertyCustomerCode2
Customer reference of project. 2=second customer
Public propertyDegreeOfCompleation
0 to 0.99 as Integer 1 = 100% is as the same time with completionist (automatic in class)
Public propertyEndDate
planned enddate fom the project
Public propertyGroup1
Link to MPProjektGruppen WHERE GruppenArt=1 ProjectGroup1
Public propertyGroup10
Link to MPProjektGruppen WHERE GruppenArt=10 ProjectGroup10
Public propertyGroup2
Link to MPProjektGruppen WHERE GruppenArt=10000 ProjectGroup2
Public propertyGroup3
Link to MPProjektGruppen WHERE GruppenArt=10003 ProjectGroup3
Public propertyGroup4
Link to MPProjektGruppen WHERE GruppenArt=3 ProjectGroup4
Public propertyGroup5
Link to MPProjektGruppen WHERE GruppenArt=2 ProjectGroup5
Public propertyGroup6
Link to MPProjektGruppen WHERE GruppenArt=6 ProjectGroup6
Public propertyGroup7
Link to MPProjektGruppen WHERE GruppenArt=7 ProjectGroup7
Public propertyGroup8
Link to MPProjektGruppen WHERE GruppenArt=8 ProjectGroup8
Public propertyGroup9
Link to MPProjektGruppen WHERE GruppenArt=9 ProjectGroup9
Public propertyGroupAssigment Obsolete.
not used
Public propertyMatchcode
NVARCHAR(50) search and order name of the project. This field is mostly used for internal users. The field ProjectName is used to be viewed by the customer.
Public propertyOcrCode1
OcrCode1. Can be set on project level, when company setting modified to use profit center from project master
Public propertyOcrCode2
OcrCode2. Can be set on project level, when company setting modified to use profit center from project master
Public propertyOcrCode3
OcrCode3. Can be set on project level, when company setting modified to use profit center from project master
Public propertyOcrCode4
OcrCode4. Can be set on project level, when company setting modified to use profit center from project master
Public propertyOcrCode5
OcrCode5. Can be set on project level, when company setting modified to use profit center from project master
Public propertyOrderProbarbility
Declaration form the Order Probability in percent 0.5 = 50%. Use only 0.1, 0.2, 0.3 ... (as this is only supported in the FrontEnd)
Public propertyPlanningCalendar
ID form the calendar for the planning. The planning calendar is used to calculate from a planning demand x days and the resource quantity y the plan dates. The calendar defines the working days and hours. If empty, the planning calendar from the basic settings (by project business unit) is used.
Public propertyPlanningMethod
Default 0=Fixed planning versions, 1=special delta planning mechanism, 2: project linked to MSProject(or Primavera)
Public propertyPlanningVersion

This fields stores the current planning Version.

  • 0: Preplanning not confirmed
  • 1: Primary planning version
  • 2: Initial planning version
  • 3: (default) Current planing version. All transactions (time booking, etc) are only made against the current planning.

The phase structure can vary between the planning versions. See clsImportPhase for an import of phases.
Public propertyProjectAbsenseType
Only used for ProjectType=VacationProjects. See eProjectAbsenseType for details.
Public propertyProjectCodeFinance

SAP Business One Projectcode (OPRJ.PrjCode) will be created by basic settings defintion:

  • Manual creation of project code: You have to set an existing code here.
  • Automatic creation of project code = project number
  • Automatic creation by prefix

When the interface is creating the project code, make sure, that SAP Business One DI-API is installed in 32 or 64 bit version, where MARIInterfase is running or that MARIInterface can reach Service Layer Service

Public propertyProjectManager1
NVARCHAR(20)EmployeeID of the first project manager
Public propertyProjectManager2
NVARCHAR(50)EmployeeID of the second project manager
Public propertyProjectMemo
references to the project
Public propertyProjectName
NVARCHAR(50) official name of the project (visible to the customer). See also Matchcode for the internal name of the project.
Public propertyProjectNumber
NVARCHAR(20), Primarys Key: Project identifier "P12345". The format and length is defined in the setting.

You can use the function sGetNewProjectNumber(Int32) to generate a new project number based on the busienss unit

Public propertyProjectStatus
Public propertyProjectType
Type of project. See eProjectType for details.
Public propertyReferencePhase
Link to a phase in the Internal Preliminary Project
Public propertyStartDate
Startdate form the project
Public propertyWorkGroupFilter
Manages who can use the project for booking: 0 = not filter, all employees can book hours; 1= filter employees on workgroup
Top
Methods
  NameDescription
Public methodbReadFromDB
Reads the project 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).)
Public methodbSaveRSToMDB (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).)
Public methodGetListUserDefinedFields
Returns the user defined field definition for the dimension "Project Master". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).)
Top
Fields
  NameDescription
Public fieldProjectTemplate
Template Projectnumber
Public fieldProjectTemplateSetting
Flagg of eProjectTemplateSettings for example 1 = Phases 3 = Phases + ProjectTeams 7 = Phases + ProjectTeams + Folder 8 = Project Manager
Top
Remarks

View: MARIProjectMaster: :Table: MPProjektstamm

Used by MS Access table: MARIProjektImportProjects.
Examples
Create new project for business unit 1
private bool CreateNewProject(string sNewProjectNumber, string sProjectName) {
    Log($"CreateNewProject(\"{sNewProjectNumber}\",\"{sProjectName}\")");

    try {

        clsImportProject oProject = new clsImportProject();
        /*
         * For example the interface can create a new project number by business unit
         * sNewProjectNumber = oMPInterface.sGetNewProjectNumber(nBusinessUnit);
         */
        oProject.ProjectNumber = sNewProjectNumber;
        oProject.ProjectName = sProjectName;
        oProject.Matchcode = oProject.ProjectName;
        oProject.BusinessUnit = 1; // SELECT BusinessUnitID FROM MARIBusinessUnitMaster.
        oProject.ProjectType = clsImportProject.eProjectType.CustomerProjects;
        oProject.ActiveType = clsImportProject.eProjektActiveType.OpenForBoocking;
        oProject.ProjectStatus = clsImportProject.eProjectStatus.ProjectRunning;
        oProject.CustomerCode1 = "10006"; // Main Customer linked to the project (CompanyID from Project Business unit)
        oProject.PlanningVersion = 3; // Start with the current planning
        //Project Code can be created automatically with the project, depending on the settings. SBO DI-API or ServiceLevel will be used.
        oProject.ProjectCodeFinance = "";
        oProject.ProjectManager1 = "0001"; // employee code for the project manager SELECT EmployeeNumber FROM MARIEmployeeMaster 

        if (oMPInterface.bImportProject(oProject, clsImportBase.eImportMode.ValidateAndImport)) {
            return true;
        }
        LogFail(oMPInterface.oErrors.PrintErrors(true));
        return false;

    } catch (Exception ex) {
        Log(ex);
        return false;
    }
}
See Also