Dovico.TrackITAPI.CTimeAndAttendance.Save(System.String,Dovico.TrackITAPI.CStateInfo)
Function Overview:
Saves time and attendance information specified in the format timeandattendance.xsd. See the example for more information about defining individual accrual rules within the time and attendance.
Parameter List:
sXml - string - string of xml to save time and attendance information for in the format timeandattendance.xsd
siState - CStateInfo - State information needed to process the transaction
Returns
A string of xml containing the IDs of inserted and updated items.
Example:
// build up xml to save a time and attendance rule with one accrual
// each time and attendance rule can have many accruals, and each
// accrual is defined individually within the TIMATTACCS tag
// the one defined here accrues time to task 107 at 1 hour per
// 1 day worked with no maximum. The TYPE attribute specifies the
// type of time to be included in calculation. See CONSTANTS.TA_ACCRUE*
// for a list of valid values
string sXml = "<TimeAndAttendance:TIMATTS xmlns:TimeAndAttendance=\"http://www.dovico.com/schemas/timeandattendance.xsd\">";
sXml += "<TIMATT ID=\"-1\" NAME=\"Example\" DESC=\"Example time and attendance\" ARCHIVE=\"F\" OUTSIDE=\"\" HIDE=\"F\">";
sXml += "<TIMATTACCS><TIMATTACC TASK=\"107\" ACCAMOUNT=\"1\" ACCUNIT=\"H\" MAXAMOUNT=\"0\" MAXUNIT=\"H\" ";
sXml += "WORAMOUNT=\"1\" WORUNIT=\"D\" TYPE=\"B\"/></TIMATTACCS></TIMATT></TimeAndAttendance:TIMATTS>";
// call the method to insert the new time and attendance rule
wsapi.MethodInvoke("TimeAndAttendanceSave", sXml, stToken);