Click or drag to resize

MPInterfacebImportTimeKeepingLine Method

Import one time booking object clsImportLine

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public bool bImportTimeKeepingLine(
	clsImportLine oLine,
	clsImportBaseeImportMode nImportMode
)

Parameters

oLine
Type: MARIInterfaceclsImportLine
Handle one clsImportLine object
nImportMode
Type: MARIInterfaceclsImportBaseeImportMode
Type of validation. See eImportMode for details.

Return Value

Type: Boolean
Examples
Time Keeping Example
MARIInterface.clsImportLine oTimeKeepingLine;
oTimeKeepingLine = new MARIInterface.clsImportLine();

// Mandantory Entries
oTimeKeepingLine.Hours = 8;
oTimeKeepingLine.HoursBillable = 8;
oTimeKeepingLine.EmployeeNumber = "0001"; //SELECT EmployeeNumber FROM MARIEmployeeMaster WHERE Matchcode='Manager, Marc'
oTimeKeepingLine.ProjectNumber = "P100005";
oTimeKeepingLine.PhaseID = 100018; // SELECT PhaseID FROM MARIProjectPhases WHERE ProjectNumber=N'P100005' AND PlanningVersion=3
oTimeKeepingLine.DayOfService = new DateTime(2020, 3, 3); // The BookingPeriod will be set automatically by the date

// Mandatory for project types: customer project or iternal project with contract 
oTimeKeepingLine.ContractID = 100008; // SELECT ContractID FROM MARIContract WHERE ProjectNumber=N'P100005'
oTimeKeepingLine.ContractPositionID = 100031; // SELECT ContractPositionId FROM MARIContractPositions WHERE ContractID=100008 AND PositionType=4 --(ServiceAtCost)

//Additional Information
oTimeKeepingLine.Activity = "This is the activity";
oTimeKeepingLine.MemoText = "This is the memo";

if (!oMPInterface.bImportTimeKeepingLine(oTimeKeepingLine, clsImportBase.eImportMode.ValidateAndImport)) {
    //oTimeKeepingLine.oErrors contains all Errors
    throw new Exception(oMPInterface.oErrors.PrintErrors());
} else {
    string sMessage = "The time keeping entry has succesfully been saved ! ID=" + oTimeKeepingLine.LineID;
}
See Also