clsImportEmployeeMaster Class |
This class contains several sub tables. In real data many of the tables are 1:n to the employee master. For the initial import, the subtables can be created in one go.
Namespace: MARIInterface
The clsImportEmployeeMaster type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportEmployeeMaster | Initializes a new instance of the clsImportEmployeeMaster class |
| Name | Description | |
|---|---|---|
| AddressName3 | AddressName3 | |
| AdressMemo | AdressMemo Private Address | |
| AvatarPictureID | AvatarPictureID | |
| BirthCity | BirthCity | |
| BirthPlace | BirthPlace | |
| BirthState | BirthState | |
| ChangeDate | ChangeDate | |
| ChangeUser | ChangeUser | |
| CreateDate | CreateDate | |
| CreateUser | CreateUser | |
| DateOfBirth | DateOfBirth | |
| DateOfEntry | DateOfEntry | |
| EmailPrivate | EmailPrivate | |
| EmployeeName | EmployeeName FirstName, Lastname | |
| EmployeeNumber | EmployeeNumber | |
| ExchangeSyncMode | Synchronizing appointments with the exchange calendar. Setting which side will be master. See clsImportEmployeeMastereEmployeeExchangeSyncMode | |
| FirstName | FirstName | |
| ImageID | PictureID (for the import only existing key in table MPBilder supported. | |
| Inactive | Inactive Hide dataset | |
| LeavingDate | LeavingDate | |
| ListOfEmployeeAnnualVacation |
Optional collection annual vacation settings. Settings are stored in clsImportEmployeeAnnualVacation.
| |
| ListOfEmployeeValidFrom |
Mandatory collection of general settings of the employee based on the "valid from" settings. Settings are stored in clsImportEmployeePeriod and clsImportEmployeeOrganisation.
One element in this list is mandatory for a new employees. Give a ValidFrom to the period the employee starts in the enterprise.
| |
| ListOfProjectLinks |
Optional collection link special use projects fo the employee. See clsImportEmployeeProjectLink.
| |
| ListOfServiceLinks |
Collection link the prefered services to the employee master. They are used to simplify the data entry. See clsImportEmployeeServiceLink.
| |
| ListOfSkillLinks |
Optional collection of skills liked to the employee. See clsImportEmployeeSkillLink.
| |
| LocationID | LocationID | |
| Matchcode | Matchcode for search of employees: Lastname, Firstname | |
| Memo | Memo | |
| MiddleName | MiddleName | |
| NameInitials | NameInitials | |
| OfficeAddrAddressMemo | A1AddressMemo Business Address | |
| OfficeAddrBlock | A1Block Business Address | |
| OfficeAddrBuilding | A1Building Business Address | |
| OfficeAddrCity | A1City Business Address | |
| OfficeAddrCountry | A1Country Business Address two letter code | |
| OfficeAddrCounty | A1County Business Address | |
| OfficeAddrState | A1State Business Address | |
| OfficeAddrStreet | A1Street Business Address | |
| OfficeAddrStreetNum | A1StreetNum Business Address | |
| OfficeAddrZIP | A1ZIP Business Address | |
| OfficeEmail | Email Business Email Address | |
| OfficeFax | Fax Business Fax | |
| OfficeMobile | Mobile Business Mobile/Celular | |
| OfficePhone | Phone Business Phone | |
| OutOfOfficeStatus | Flag to foreward internal messages. See clsImportEmployeeMastereOutOfOfficeStatus | |
| OutOfOfficeSubstitute | eMail to forward internal notifications based on the OutOfOfficeStatus. | |
| OutOfOfficeText | text as information, why the employee is out of office. | |
| PDAKey | PDAKey Key for external HP Systems for the employee | |
| PictureArrayOfBytes |
The picture can be transfered via a byte array instead of a PictureFileName.
| |
| PictureFileName | Linking a file name, will load this file into the database. The file content has to be accessable from the import process.
The picture content is stored in: View: MARIPictures : : Table: MPBilder | |
| Position | Position | |
| PrivateAddrBlock | AddressBlock Private Address | |
| PrivateAddrBuilding | AddressBuilding Private Address | |
| PrivateAddrCity | AddressCity Private Address | |
| PrivateAddrCountry | Country Private Address (two letter code) | |
| PrivateAddrCounty | AddressCounty Private Address | |
| PrivateAddrState | AddressState Private Address | |
| PrivateAddrStreet | AddressStreet Private Address | |
| PrivateAddrStreetNo | AddressStreetNo Private Address | |
| PrivateAddrZIP | AddressZIP Private Address | |
| PrivateFax | PrivateFax | |
| PrivateMobile | PrivateMobile | |
| PrivatePhone | PrivatePhone | |
| Profession | Profession | |
| Salutation | Mr. Mrs. Ms. Herr, Frau | |
| Salutation2 | newsletter address of the employee. "Dear Carlos" | |
| ServiceHandling | ServiceHandling select behaviour in data entry | |
| SignaturePictureID | SignaturePictureID Picture for the signature | |
| Surname | Surname | |
| SysMasterProperties |
Optional: Link this employee to one or many SysMaster Properties. Having the ID in the list means, that the property is true.
See the clsImportSysMasterProperties description to create new properites. All selected properties must have a UsageFlag of ClassID033Employee. | |
| UpdateStamp | UpdateStamp | |
| UserCode | Link to the user. Create first a user via clsImportMARIUser and link the returned user code. |
| Name | Description | |
|---|---|---|
| bReadFromDB |
Reads employee master and all its sub tables
(Overrides clsImportBasebReadFromDB(MPInterface, String).) | |
| bSaveRSToMDB | (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).) | |
| GetListUserDefinedFields |
Returns the user defined field definition for the dimension "Employee Master". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).) | |
| SetUserDefinedFieldValue |
Fill user defined field with value
(Overrides clsImportBaseSetUserDefinedFieldValue(String, Object).) |
private string CreateEmployee(bool IncludeSubClasses = true) { string EmployeeNumber = oMPInterface.sGetNewEmployeeNumber(); //next free number based on the given Format E100*.. string EmployeeName = "Marc Import"; string SurName = "Import"; Log($"EmployeeNumber={EmployeeNumber}, EmployeeName={EmployeeName}, SurName={SurName}"); string UserCode; MARIInterface.clsImportMARIUser NewUser = CreateUser(SurName); if (!oMPInterface.bImportMARIUser(NewUser, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) { LogFail(oMPInterface.oErrors.PrintErrors()); return null; } else { UserCode = NewUser.UserCode; Log($"UserCode={UserCode}"); } MARIInterface.clsImportEmployeeMaster NewEmployee = CreateEmployeeMaster(EmployeeNumber, EmployeeName, SurName, UserCode, IncludeSubClasses); if (!oMPInterface.bImportEmployeeMaster(NewEmployee, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) { LogFail(oMPInterface.oErrors.PrintErrors()); return null; } else { return NewEmployee.EmployeeNumber; } } private MARIInterface.clsImportEmployeeMaster CreateEmployeeMaster(string EmployeeNumber, string EmployeeName, string SurName, string UserCode, bool IncludeSubClasses = true) { Log($"CreateEmployeeMaster(EmployeeNumber={EmployeeNumber}, EmployeeName={EmployeeName}, SurName={SurName}, UserCode={UserCode})"); MARIInterface.clsImportEmployeeMaster NewEmployee = new MARIInterface.clsImportEmployeeMaster(); // MARIEmployeeMaster NewEmployee.EmployeeNumber = EmployeeNumber; // oMPInterface.sGetNewEmployeeNumber(); NewEmployee.EmployeeName = EmployeeName; NewEmployee.Matchcode = EmployeeName; //Field for search and display NewEmployee.Salutation2 = $"Dear Mr. {SurName}"; NewEmployee.Salutation = "Mr."; NewEmployee.FirstName = "Marc"; NewEmployee.Surname = SurName; NewEmployee.OfficeAddrStreet = "Cupertino Drive"; NewEmployee.OfficeAddrStreetNum = "1"; NewEmployee.OfficeAddrZIP = "59000"; NewEmployee.OfficeAddrCountry = "US"; NewEmployee.OfficeAddrCounty = "Cupertino"; NewEmployee.OfficeAddrCity = "Cupertino"; NewEmployee.OfficePhone = "+1 212 456 798"; NewEmployee.DateOfBirth = new DateTime(1985, 8, 12); NewEmployee.PDAKey = "98654631"; // Code of the RFID Chip NewEmployee.UserCode = UserCode; //MARIEmployeesPeriod MARIInterface.clsImportEmployeePeriod EmployeePeriod = new clsImportEmployeePeriod(); NewEmployee.ListOfEmployeeValidFrom.Add(EmployeePeriod); EmployeePeriod.ValidFrom = 2020001; //SELECT Period FROM MARIPeriods EmployeePeriod.PoliticalCostRateType = clsImportEmployeePeriod.eEmployeeCostRateType.OneCostRate; EmployeePeriod.PoliticalCostRateOne4All = 50m; EmployeePeriod.AccountingCostRate1 = 45.46m; //MARIEmployeesCostRates >MARIEmployeesPeriod EmployeePeriod.EmployeeStatus = clsImportEmployeePeriod.eEmployeeMasterStatus.FixedEmployee; // 1 EmployeePeriod.OvertimeInitialValue = 0m; EmployeePeriod.CalendarID = 100000; //SELECT CalendarID FROM MARICalendar EmployeePeriod.PlanningCapacity = 100; //100% //MARIEmployeesOrganisation >MARIEmployeesPeriod MARIInterface.clsImportEmployeeOrganisation NewOrga = new clsImportEmployeeOrganisation(); EmployeePeriod.ListOfOrganisationSettings.Add(NewOrga); NewOrga.BusinessUnitID = 1; // SELECT BusinessUnitID FROM MARIBusinessUnitMaster NewOrga.Creditor = "71004"; // travel expense creditor SELECT CardCode FROM OCRD WHERE CardType='S' NewOrga.EmployeeSuperior = "0001"; //SELECT EmployeeNumber FROM MARIEmployeeMaster if (IncludeSubClasses) { //MARIEmployeeAnnualVacation MARIInterface.clsImportEmployeeAnnualVacation VacationSettings = new clsImportEmployeeAnnualVacation(); NewEmployee.ListOfEmployeeAnnualVacation.Add(VacationSettings); VacationSettings.CalendarYear = 2020; VacationSettings.EntitlementCurrYear = 25; //MARIEmployeesService NewEmployee.ServiceHandling = clsImportEmployeeMaster.eServiceHandling.AllServicesSelectFirst; NewEmployee.ListOfServiceLinks.Add(new clsImportEmployeeServiceLink() { ServiceNumber = "1000", Prio = 1 }); NewEmployee.ListOfServiceLinks.Add(new clsImportEmployeeServiceLink() { ServiceNumber = "1010", Prio = 2 }); //MARIEmployeesPool clsImportEmployeePoolLink PoolLink = new clsImportEmployeePoolLink(); EmployeePeriod.ListOfPoolLinks.Add(PoolLink); PoolLink.EmployeeNumber = EmployeeNumber; PoolLink.ResourcePool = "00001"; PoolLink.ValidPeriodFrom = 2020001; PoolLink.PlanningType = clsImportEmployeePoolLink.ePoolLinkPlanningType.PlanningInvolvement; PoolLink.Priority = 1; PoolLink.Capacity = 30; //MARIEmployeesProjectLinks NewEmployee.ListOfProjectLinks.Add(new clsImportEmployeeProjectLink() { ProjectTemplateType = clsImportEmployeeProjectLink.eProjectTemplateType.VacationProject, ProjectNumber = "P100001" //SELECT [Projectnumber] FROM MARIProjectMaster WHERE ProjectType=3 clsImportProject.eProjectType.VacationProjects }); NewEmployee.ListOfProjectLinks.Add(new clsImportEmployeeProjectLink() { ProjectTemplateType = clsImportEmployeeProjectLink.eProjectTemplateType.SickLeaveProject, ProjectNumber = "P100003"//SELECT [Projectnumber] FROM MARIProjectMaster WHERE ProjectType=8 clsImportProject.eProjectType.AbsenseProjects }); //MARIEmployeeSkills clsImportEmployeeSkillLink SkillLink = new clsImportEmployeeSkillLink(); NewEmployee.ListOfSkillLinks.Add(SkillLink); SkillLink.EmployeeNumber = EmployeeNumber; SkillLink.SkillID = 100001; SkillLink.Priority = 100; } return NewEmployee; } private clsImportMARIUser CreateUser(string UserName) { Log($"CreateUser(UserName=\"{UserName}\")"); //MARIUser MARIInterface.clsImportMARIUser NewUser = new clsImportMARIUser(); NewUser.UserType = clsImportMARIUser.eMPUserType.InternalMARIProjectUser; NewUser.UserName = UserName; NewUser.Password = string.Empty; // Interface will create a new pasword. NewUser.LoginActive = true; NewUser.UserLevel = clsImportMARIUser.eAuthUserLevel.ProjectManager; NewUser.Groups = 2052; //SELECT Groups FROM MARIUser. Flags depending on the defined user groups NewUser.AccountingMode = 1; //See only hours NewUser.Modules = clsImportMARIUser.eLicenseModule.Professional; return NewUser; }
public string CreateEmployeeFreeLancer() { LogStart("EmployeeMaster", "CreateEmployeeFreeLancer", eLogLevel.AllActions, @"ProjectManagementMobileUnitTest\UT_MARIInterface\UT_MARIInterface_EmployeeMaster.cs"); string EmployeeNumber = oMPInterface.sGetNewEmployeeNumber(); //next free number based on the given Format E100*.. string EmployeeName = "Marc Free"; string SurName = "Free"; Log($"EmployeeNumber={EmployeeNumber}, EmployeeName={EmployeeName}, SurName={SurName}"); string UserCode = string.Empty; MARIInterface.clsImportEmployeeMaster NewEmployee = CreateEmployeeFreeLancer(EmployeeNumber, EmployeeName, SurName, UserCode); if (!oMPInterface.bImportEmployeeMaster(NewEmployee, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) { LogFail(oMPInterface.oErrors.PrintErrors()); return null; } else { string sMessage = NewEmployee.EmployeeNumber; return sMessage; } } private MARIInterface.clsImportEmployeeMaster CreateEmployeeFreeLancer(string EmployeeNumber, string EmployeeName, string SurName, string UserCode) { Log($"CreateEmployeeFreeLancer(EmployeeNumber={EmployeeNumber}, EmployeeName={EmployeeName}, SurName={SurName}, UserCode={UserCode})"); MARIInterface.clsImportEmployeeMaster NewEmployee = new MARIInterface.clsImportEmployeeMaster(); // MARIEmployeeMaster NewEmployee.EmployeeNumber = EmployeeNumber; // oMPInterface.sGetNewEmployeeNumber(); NewEmployee.EmployeeName = EmployeeName; NewEmployee.Matchcode = EmployeeName; //Field for search and display NewEmployee.Salutation2 = $"Dear Mr. {SurName}"; NewEmployee.Salutation = "Mr."; NewEmployee.FirstName = "Marc"; NewEmployee.Surname = SurName; NewEmployee.OfficeAddrStreet = "Cupertino Drive"; NewEmployee.OfficeAddrStreetNum = "1"; NewEmployee.OfficeAddrZIP = "59000"; NewEmployee.OfficeAddrCountry = "US"; NewEmployee.OfficeAddrCounty = "Cupertino"; NewEmployee.OfficeAddrCity = "Cupertino"; NewEmployee.OfficePhone = "+1 212 456 798"; NewEmployee.DateOfBirth = new DateTime(1985, 8, 12); NewEmployee.PDAKey = "98654631"; // Code of the RFID Chip NewEmployee.UserCode = UserCode; //MARIEmployeesPeriod MARIInterface.clsImportEmployeePeriod EmployeePeriod = new clsImportEmployeePeriod(); NewEmployee.ListOfEmployeeValidFrom.Add(EmployeePeriod); EmployeePeriod.ValidFrom = 2020001; //SELECT Period FROM MARIPeriods EmployeePeriod.PoliticalCostRateType = clsImportEmployeePeriod.eEmployeeCostRateType.PricePerProject; EmployeePeriod.EmployeeStatus = clsImportEmployeePeriod.eEmployeeMasterStatus.FreeLancer; // 10 EmployeePeriod.OvertimeInitialValue = 0m; EmployeePeriod.CalendarID = 100000; //SELECT CalendarID FROM MARICalendar EmployeePeriod.PlanningCapacity = 100; //100% EmployeePeriod.ListOfCostRatesProjects.Add(new clsImportEmployeeCostRatesProject() { ProjectNumber = "P100006", ISCRateHour = 33.60m }); EmployeePeriod.ListOfCostRatesProjects.Add(new clsImportEmployeeCostRatesProject() { ProjectNumber = "P100007", ISCRateHour = 36.450m }); //MARIEmployeesOrganisation MARIInterface.clsImportEmployeeOrganisation NewOrga = new clsImportEmployeeOrganisation(); EmployeePeriod.ListOfOrganisationSettings.Add(NewOrga); NewOrga.EmployeeNumber = EmployeeNumber; NewOrga.BusinessUnitID = 1; // SELECT BusinessUnitID FROM MARIBusinessUnitMaster NewOrga.Creditor = "71004"; // travel expense creditor SELECT CardCode FROM OCRD WHERE CardType='S' NewOrga.EmployeeSuperior = "0001"; //SELECT EmployeeNumber FROM MARIEmployeeMaster NewOrga.MainBusinessUnit = true; //Link to a second business unit NewOrga = new clsImportEmployeeOrganisation(); EmployeePeriod.ListOfOrganisationSettings.Add(NewOrga); NewOrga.EmployeeNumber = EmployeeNumber; NewOrga.BusinessUnitID = 2; // SELECT BusinessUnitID FROM MARIBusinessUnitMaster NewOrga.Creditor = "71004"; // travel expense creditor SELECT CardCode FROM OCRD WHERE CardType='S' NewOrga.EmployeeSuperior = "0001"; //SELECT EmployeeNumber FROM MARIEmployeeMaster return NewEmployee; }