Click or drag to resize

clsImportEmployee Class

Data holder to import the employee data into the MARIProject database (ClassID.Employees=33). The import will store the master data and the first details (valid from) to the employee. Use MPInterface.bImportEmployee(clsImportEmployee, clsImportBaseeImportMode) to import.

This class contains several 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.

User the newer class clsImportEmployeeMaster with objects for the 1:n tables.
Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportEmployee

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

The clsImportEmployee type exposes the following members.

Constructors
  NameDescription
Public methodclsImportEmployee
Create a new instance to store data for the new employee
Top
Properties
  NameDescription
Public propertyAbsenceInternalProject
Public propertyAbsenceProject
Public propertyAccCostRate
Accounting Cost Rate: First cost rate for the internal service charge modul
Public propertyAccCostRate2
Accounting Cost Rate: Second cost rate for the internal service charge modul
Public propertyAccCostRate3
Accounting Cost Rate: Third cost rate for the internal service charge modul
Public propertyAccCostRate4
Accounting Cost Rate: Fourth cost rate for the internal service charge modul
Public propertyAccCurrency
Accounting Cost Rate: Currency for the internal service charge rates. Use ISO Currency code
Public propertyAccMode
AccMode of the User
Public propertyAddressBlock
Company Address Block
Public propertyAddressBuilding
Company Address Building
Public propertyAddressName3
AddressName3
Public propertyAdress
Salutation Like "Dear Sir John Doe"
Public propertyAdressMemo
AdressMemo
Public propertyBusinessUnit
[Mandatory] Business Unit of the employee (1:1 for fixed employees, 1:n for freelancers). See dimension clsImportSetupBusinessUnits for details.
Public propertyCalendarID
Link to employee calendar. Link to the Calendar Table
Public propertyChangeDate
Last change date. Filled automatically
Public propertyChangeUserID
NVARCHAR(4) Last change user ID. Filled automatically
Public propertyCity
Company Address City
Public propertyCostCenter
Responsible Cost Centre (Company Business Unit) (Cost Centre)
Public propertyCostCenter2
Responsible Cost Center dimenson 2
Public propertyCostCenter3
Responsible Cost Center dimenson 3
Public propertyCostCenter4
Responsible Cost Center dimenson 4
Public propertyCostCenter5
Responsible Cost Center dimenson 5
Public propertyCostObjektive
Responsible Cost Objektive (Company Business Unit) (field not used)
Public propertyCostRatePolitical
Costprice per hour for project planning and internal service charges. (Sales prices is defined in the sales contract position)
Public propertyCostRatePolitical2
Second cost rate. Is only used when CostRateType = MainBusinessUnitOtherThanOthers
Public propertyCostRateType Obsolete.
Please use PoliticalCostRatesType instead. Normaly an employee will have only one cost rate for all business units he/she is working for.
Public propertyCountry
Company Address Country
Public propertyCounty
Company AddressCounty
Public propertyCreateUser
Check to create automatically a user in MARIProject
Public propertyCreditor
Cerditor (BusinessPartner) for travel expense processing (CompanyID from Business Unit)
Public propertyCreditorCreditCard
Business Partner for the Company Credit Card used by the employee
Public propertyCreditorCreditCard2
Business Partner for the second Company Credit Card used by the employee
Public propertyCreditorCreditCard3
Business Partner for the third Company Credit Card used by the employee
Public propertyDateOfBirth
Date of birth
Public propertyDateOfEntry
Beginning date in the company
Public propertyDebitor
Linked Business Partner for Debitor processes
Public propertyEmail
Email
Public propertyEmployeeManager
Responsible manager for this employee. Link to an existing employee in the database
Public propertyEmployeeMemo
Memo field for the employee
Public propertyEmployeeName
NVARCHAR(50) Copount Name: FirstName LastName. When this field is empty, it is calculated based on "FirstNameFamilyName".
Public propertyEmployeeNumber
Unique Employee ID to be formatted based on the settings of MARIProject Example "E200".

You can generate a new employee number using the function sGetNewEmployeeNumber.

Public propertyEmployeeSecondManager
2nd Responsible manager for this employee. Link to an existing employee in the database
Public propertyEmployeeStatus
[Mandatory] Each employee can be either a regular employee or a free lancer. See clsImportEmployeeeEmployeeStatus.
Public propertyExchangeSyncMode
ExchangeSyncMode
Public propertyExternalKey
NVARCHAR(50) External Key of the employee. used by MARITimeTouch and RFID Reader. PDA Key
Public propertyFamilyName
Employee Surname
Public propertyFax
Company Fax
Public propertyFirstName
Employees First Name
Public propertyFlextime
Public propertyFunktion
Functiontext e.g. Groupleader
Public propertyGroupID
Reference to the Employee Group 1. Link to MPGruppen WHERE GruppenArt=10001 EmployeeGroup
Public propertyGroupID2
Reference to the Employee Group 2. Link to MPGruppen WHERE GruppenArt=10006 EmployeeGroup2
Public propertyGroupID3
Reference to the Employee Group 3. Link to MPGruppen WHERE GruppenArt=10007 EmployeeGroup3
Public propertyIllnessProject
Public propertyLeavingDate
Leaving Date
Public propertyLocationID
LocationID
Public propertyMatchcode
NVARCHAR(50) Name for assortment. User "Name, Surname" or "Surname, Name". When this field is empty it is calculated based on "FamilyName, FirstName.
Public propertyMobile
Mobile
Public propertyOutOfOfficeStatus
OutOfOfficeStatus
Public propertyOutOfOfficeSubstitute
OutOfOfficeSubstitute eMail address
Public propertyOutOfOfficeText
OutOfOfficeText information for the approval
Public propertyOvertimeStart
re- /set the overtime start value in hours for the given ValidFrom period.
Public propertyPayrollCompany
internal company id for payroll export
Public propertyPayrollEmplNo
Active employee number in the payroll accounting export
Public propertyPayrollEmployeeNumber Obsolete.
Please use PayrollEmplNo instead. Active employee number in the payroll accounting export.
Public propertyPersonalType Obsolete.
Public propertyPhone
Company Phone
Public propertyPictureArrayOfBytes
The picture can be transfered via a byte array instead of a PictureFileName.
Public propertyPictureFileName
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

Public propertyPictureID
PictureID (for the import only existing key in table MPBilder supported.
Public propertyPlanningCapacity
0 to 100 (if aplicable over 100).How far may this employee be taken into account (Planned working time * Planning capacity/100) = Planable hours
Public propertyPoliticalCostRatesType
Normaly an employee will have only one cost rate for all business units he/she is working for. See clsImportEmployeeeCostRateType.
Public propertyPrimaryCreationDate
Date of the createn of the dataset. Filled automatically
Public propertyPrivateFax
PrivateFax
Public propertyPrivatePhone
Private Phone
Public propertyRoundingProject
Public propertySalutation
Title like "Mr., Mrs..."
Public propertySpecialLeave
Public propertyStandardProject
Public propertyStandardService
Can be used to store the first standard service to the employee
Public propertyState
Company Address State Code (NY=New York State)
Public propertyStreet
Company AddressStreet
Public propertyStreetNo
Company Street Number
Public propertyTitle Obsolete.
Please use Salutation instead. Title like "Mr., Mrs..."
Public propertyTravelExpensesRule
TravelExpensesRule specially set, overwriting employee business unit setting.
Public propertyUnpaidAbsenceProject
Public propertyUserCode
NVARCHAR(4)4 character user initials. This field is used for the link between employee and user. It will be created automatically

Used, whenn CreateUser is true

Public propertyUserGroup
The selected user groups of the user (flag set)
Public propertyUserID
NVARCHAR(4) Identification code of the user. Internal ID, created automatically
Public propertyUserLevel
Public propertyUserName
UserName for the newley created user

Used, whenn CreateUser is true

Public propertyUserNameShort Obsolete.
Please use UserCode instead. 4 character user initials. This field is used for the link between employee and user. It will be created automatically.

Used, whenn CreateUser is true

Public propertyVacationCalendarPeriod
Vacation Periode 2016001 (not necessary. Filled by the VacationCalendarYear
Public propertyVacationCalendarYear
The year of the vacation 2016
Public propertyVacationCompensation Obsolete.
Please use VacationCompensationCurrYear. Vacation compensation for special vacations. Property will stay for compatibility only.
Public propertyVacationCompensationCurrYear
Vacation compensation for special vacations
Public propertyVacationEntitlement Obsolete.
Please use VacationEntitlementCurrYear instead. Entry of Vacation Entitlment. Property will stay for compatibility only.
Public propertyVacationEntitlementCurrYear
Entry of Vacation Entitlment
Public propertyVacationForward Obsolete.
Please use VacationSpecialLeave. Carry over from the previous year.
Public propertyVacationPreviousYear
Remaining Vacation Days
Public propertyVacationProject
Public propertyVacationSpecialLeave
Carry over from the previous year. (Property name is wrong, but used for the carry over).
Public propertyValidFrom
Period in the time organisation of MARIProject employee master (Period+Organisation). Format: 2016012 YYYYMMM
Public propertyValidPeriodeFrom Obsolete.
Please use property ValidFrom instead. Period in the time organisation of MARIProject 2016012 YYYYMMM
Public propertyZIPCode
Company Address Zip-Code
Top
Methods
  NameDescription
Public methodbLoadEmployeeCurrentValidFrom
Loads data for existing employee master data and sub tables, based on the current date with the matching "valid from" period.

Use bImportEmployee(clsImportEmployee, clsImportBaseeImportMode) with the option Update to save the changes.

Public methodbLoadEmployeeValidFrom
Loads data for existing employee master data and sub tables, based on the current date with the matching "valid from" period.

To Create a new valid from period. Simply change the lValidFromPeriod to the new requested period.

Use bImportEmployee(clsImportEmployee, clsImportBaseeImportMode) with the option Update to save the changes.

Public methodbReadFromDB
Reads the employee 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
Internal Use Only (write example data to the access mdb)
(Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).)
Public methodGetListUserDefinedFields
Returns the user defined field definition for the dimension "Employee Master". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).)
Top
Fields
  NameDescription
Public fieldSysMasterProperties
Link this employee master 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.

Alle selected properties must have a UsageFlag of ClassID033Employee.

Top
Remarks

Import from the MS Access table MARIProjektImportEmployee.

Examples
Import a new employee and create a user
private string CreateEmployee() {
    MARIInterface.clsImportEmployee NewEmployee = new MARIInterface.clsImportEmployee();
    // MARIEmployeeMaster
    NewEmployee.EmployeeNumber = oMPInterface.sGetNewEmployeeNumber(); // creates a new free number based on the number sValue (ex. M0001)
    NewEmployee.EmployeeName = "Marc Import";
    NewEmployee.Matchcode = "Marc Import"; //Field for search and display
    NewEmployee.Adress = "Dear Mr. Import";
    NewEmployee.Salutation = "Mr.";
    NewEmployee.FirstName = "Marc";
    NewEmployee.FamilyName = "Import";
    NewEmployee.Street = "Cupertino Drive";
    NewEmployee.StreetNo = "1";
    NewEmployee.ZIPCode = "59000";
    NewEmployee.Country = "US";
    NewEmployee.County = "Cupertino";
    NewEmployee.City = "Cupertino";
    NewEmployee.Phone = "+1 212 456 798";
    NewEmployee.DateOfBirth = new DateTime(1985, 8, 12);
    NewEmployee.ExternalKey = "98654631"; // Code of the RFID Chip
    //MARIEmployeesPeriod
    NewEmployee.EmployeeStatus = clsImportEmployee.eEmployeeStatus.FixedEmployee; // 1
    NewEmployee.BusinessUnit = 1; // SELECT BusinessUnitID FROM MARIBusinessUnitMaster
    NewEmployee.ValidFrom = 2016005; //SELECT Period FROM MARIPeriods
    NewEmployee.Creditor = "71004"; // SELECT CardCode FROM OCRD WHERE CardType='S'
    NewEmployee.EmployeeManager = "0001"; //SELECT EmployeeNumber FROM MARIEmployeeMaster
    NewEmployee.PoliticalCostRatesType = clsImportEmployee.eCostRateType.OneCostRate;
    NewEmployee.CostRatePolitical = 50m;
    NewEmployee.AccCostRate = 45.46m;
    NewEmployee.OvertimeStart = 0m;
    NewEmployee.CalendarID = 100000; //SELECT CalendarID FROM MARICalendar
    NewEmployee.PlanningCapacity = 100; //100%
    //MARIEmployeeAnnualVacation
    NewEmployee.VacationCalendarYear = 2016;
    NewEmployee.VacationEntitlementCurrYear = 25;
    //MARIUser
    NewEmployee.CreateUser = true;
    NewEmployee.UserName = NewEmployee.FamilyName;
    Random rnd = new Random();
    int n = rnd.Next(0, 999);
    NewEmployee.UserName += $"{n:000}"; //IN20250522 Benutzer ist schon da gewesen, also Zufall dran
    NewEmployee.UserLevel = clsImportEmployee.eUserLevel.ProjectManager;
    NewEmployee.UserGroup = 2052; //SELECT Groups FROM MARIUser. Flags depending on the defined user groups
    NewEmployee.AccMode = 1; //SELECT AccountingMode FROM MARIUser

    if (!oMPInterface.bImportEmployee(NewEmployee, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) {
        throw new Exception(oMPInterface.oErrors.PrintErrors());
    } else {
        string sMessage = "New employee created. EmployeeNumber = " + NewEmployee.EmployeeNumber;
        return NewEmployee.EmployeeNumber;
    }
}
See Also