All Classes Namespaces Functions Properties Pages
Public Member Functions | List of all members
BusinessCalendarService Class Reference

Provides methods to manipulate business calendar settings. More...

Public Member Functions

void AddTimeCategory (string sessionId, TimeCategory timeCategory)
 Please note that this function is deprecated. Please use AddTimeCategory2 instead.
Adds the specified time category. More...
 
TimeCategory AddTimeCategory2 (string sessionId, TimeCategory timeCategory)
 Adds the specified time category. More...
 
void DeleteTimeCategory (string sessionId, TimeCategoryIdentity timeCategoryIdentity)
 Deletes the specified time category. More...
 
string ExportBusinessCalendarDataAsXml (string sessionId)
 Exports the global business calendar in XML format. More...
 
string GetBusinessCalendarDataAsXml (string sessionId, short calendarYear)
 Retrieves the global business calendar for a specified year in XML format. More...
 
string GetBusinessCalendarDataAsXmlForResource (string sessionId, ResourceIdentity resourceIdentity, short calendarYear)
 Retrieves the business calendar for a specified year and a specified resource in XML format. More...
 
CalendarAuditLogEntryCollection GetCalendarAuditLog (string sessionId, Agility.Sdk.Model.Resources.CalendarAuditLogFilter calendarAuditLogFilter)
 Retrieves the calendar audit log using the specified audit log filter. More...
 
DateTime GetFutureDateUsingWorkingDays (string sessionId, DateTime fromDate, int days)
 Calculates a future date using a specified number of working days from a specified date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
string GetFutureDateUsingWorkingDays2 (string sessionId, int days)
 Calculates a future date using a specified number of working days from the current date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
DateTime GetFutureDateUsingWorkingHours (string sessionId, DateTime fromDate, int hours)
 Calculates the future date using a specified number of working hours from a specified date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
DateTime GetFutureDateUsingWorkingMinutes (string sessionId, DateTime fromDate, int minutes)
 Calculates a future date using a specified number of working minutes from a specified date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
DateTime GetFutureDateUsingWorkingSeconds (string sessionId, DateTime fromDate, int seconds)
 Calculates a future date using a specified number of working seconds from a specified date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
DateTime GetFutureDateUsingWorkingTime (string sessionId, DateTime fromDate, int days, int hours, int minutes, int seconds)
 Calculates a new data using the specified working days, hours, minutes and seconds from a specified From Date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
TimePeriod GetHoursBreakdown (string sessionId, int hours)
 Converts the specified hours into days and hours. The business calendar will NOT be used in the calculation. More...
 
TimePeriod GetMinutesBreakdown (string sessionId, int minutes)
 Converts the specified hours into days, hours and minutes. The business calendar will NOT be used in the calculation. More...
 
DateTime GetPastDateUsingWorkingDays (string sessionId, DateTime fromDate, int days)
 Calculates the past date based on the specified date and working days. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
DateTime GetPastDateUsingWorkingHours (string sessionId, DateTime fromDate, int hours)
 Calculates the past date based on the specified date and working hours. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
DateTime GetPastDateUsingWorkingMinutes (string sessionId, DateTime fromDate, int minutes)
 Calculates the past date based on the specified date and working minutes. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
DateTime GetPastDateUsingWorkingSeconds (string sessionId, DateTime fromDate, int seconds)
 Calculates the past date based on the specified date and working seconds. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
DateTime GetPastDateUsingWorkingTime (string sessionId, DateTime fromDate, int days, int hours, int minutes, int seconds)
 Calculates the past date based on the specified from date, days and working time. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
TimePeriod GetSecondsBreakdown (string sessionId, int seconds)
 Converts the specified hours into days, hours, minutes and seconds. The business calendar will NOT be used in the calculation. More...
 
TimeCategory GetTimeCategory (string sessionId, TimeCategoryIdentity timeCategoryIdentity)
 Retrieves the details of the specified time category. More...
 
bool GetUseBusinessCalendar (string sessionId)
 Determines if the Use Business Calendar server setting is on or off. More...
 
int GetWorkingDaysBetweenDates (string sessionId, DateTime fromDate, DateTime toDate)
 Calculates the working days between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
int GetWorkingHoursBetweenDates (string sessionId, DateTime fromDate, DateTime toDate)
 Calculates the working hours between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
TimePeriod GetWorkingHoursBreakdown (string sessionId, int hours)
 Retrieves the working time break down in number of days, hours, minutes and seconds. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
int GetWorkingMinutesBetweenDates (string sessionId, DateTime fromDate, DateTime toDate)
 Calculates the working minutes between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
TimePeriod GetWorkingMinutesBreakdown (string sessionId, int minutes)
 Retrieves the working time break down in number of days, hours, minutes and seconds. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
int GetWorkingSecondsBetweenDates (string sessionId, DateTime fromDate, DateTime toDate)
 Calculates the working seconds between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
TimePeriod GetWorkingSecondsBreakdown (string sessionId, int seconds)
 Retrieves the working time break down in number of days, hours, minutes and seconds. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
TimePeriod GetWorkingTimeBetweenDates (string sessionId, DateTime fromDate, DateTime toDate)
 Retrieves the working time between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled. More...
 
WorkPatternAuditLogEntryCollection GetWorkPatternAuditLog (string sessionId, WorkPatternAuditLogFilter workPatternAuditLogFilter)
 Retrieves the work pattern audit log using the filter criteria. More...
 
WorkPatternIdentityCollection GetWorkPatternsForResource (string sessionId, ResourceIdentity resourceIdentity)
 Retrieves the work patterns for the specified resource. More...
 
string ImportBusinessCalendarDataFromXml (string sessionId, string xml)
 Imports a global business calendar described in the supplied XML. More...
 
bool IsWorkingDateTime (string sessionId, DateTime dateToCheck)
 Determines if the specified date and time is within the defined working hours of the business calendar. More...
 
bool IsWorkingDay (string sessionId, DateTime dateToCheck)
 Determines if the specified date is a working day as defined by the business calendar. The time part of the date is not checked. More...
 
string UpdateBusinessCalendarDataFromXml (string sessionId, short calendarYear, string xml)
 Update the global business calendar for the specified year with the XML being passed in the xml parameter. More...
 
DateTime UpdateBusinessCalendarDataFromXmlForResource (string sessionId, ResourceIdentity resourceIdentity, short calendarYear, bool overwrite, DateTime lastModifiedDate, string xml)
 Updates the specified resource's business calendar from the supplied XML. You can specify whether to overwrite the calendar or not, if it has been modified since you last retrieved it. More...
 
void UpdateTimeCategory (string sessionId, TimeCategory timeCategory, bool overwrite)
 Updates the specified time category. More...
 

Description

Provides methods to manipulate business calendar settings.

Member Functions

void AddTimeCategory ( string  sessionId,
TimeCategory  timeCategory 
)

Please note that this function is deprecated. Please use AddTimeCategory2 instead.
Adds the specified time category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
timeCategoryA TimeCategory object containing the time category information to add. Cannot be null
Name Type Comment Required
Id Int32 Unique identifier of time category No
Name String Name for time category (maximum 40 characters) Yes
Category Int16 Category of time category. Supply 0 (Both), 1 (Calendar) or 2 (Work Pattern). Defaults to 0 No
DebitOrCredit Int16 Indicates if debit or credit. Must have value 0 (Debit) or 1 (Credit) Yes
LastModifiedDate DateTime Last modified date time No
LastModifiedUser Identity Pass in the resource Id to be used as Last Modified By User field No
Remarks
If you have a Credit time category you will add the working hours from the resource who gets included in the time category. So your team has more time available for work allocation
Security
Resource must have at least Read Write access permission on Server ACL.
TimeCategory AddTimeCategory2 ( string  sessionId,
TimeCategory  timeCategory 
)

Adds the specified time category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
timeCategoryA TimeCategory object containing the time category information to add. Cannot be null
Name Type Comment Required
Id Int32 Unique identifier of time category No
Name String Name for time category (maximum 40 characters) Yes
Category Int16 Category of time category. Supply 0 (Both), 1 (Calendar) or 2 (Work Pattern). Defaults to 0 No
DebitOrCredit Int16 Indicates if debit or credit. Must have value 0 (Debit) or 1 (Credit) Yes
LastModifiedDate DateTime Last modified date time No
LastModifiedUser Identity Pass in the resource Id to be used as Last Modified By User field. The Id field of the identity is required, not the Name field Yes
Returns
An instance of type TimeCategory which holds the details of the time category just added.
Remarks
If you have a Credit time category you will add the working hours from the resource who gets included in the time category. So your team has more time available for work allocation
Security
Resource must have at least Read Write access permission on Server ACL.
void DeleteTimeCategory ( string  sessionId,
TimeCategoryIdentity  timeCategoryIdentity 
)

Deletes the specified time category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
timeCategoryIdentityA TimeCategoryIdentity object identifying the time category to be deleted. Cannot be null
Name Type Comment Required
Id Int32 The Id of the time category Yes
Remarks
The API will throw an exception indicating that the time category is in use if it is being used by any debits or credits in the business calendar
Security
Resource must have at least Read Write access permission on Server ACL.
string ExportBusinessCalendarDataAsXml ( string  sessionId)

Exports the global business calendar in XML format.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
Returns
The global business calendar in XML format.
Remarks
The returned XML will contain the business calendar from 5 years in the past to 5 years in the future.
Security
Resource must have at least Read access permission on Server ACL.
string GetBusinessCalendarDataAsXml ( string  sessionId,
short  calendarYear 
)

Retrieves the global business calendar for a specified year in XML format.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
calendarYearThe desired year. For example, 2013.
Returns
XML that details the global business calendar for that year.
Security
No restrictions apply.
string GetBusinessCalendarDataAsXmlForResource ( string  sessionId,
ResourceIdentity  resourceIdentity,
short  calendarYear 
)

Retrieves the business calendar for a specified year and a specified resource in XML format.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
resourceIdentityA ResourceIdentity identity object indicating the resource whose business calendar we want. Cannot be null
Name Type Comment Required
Id String The Id of the resource whose calendar we want Yes
Name String Name of resource. NOT used by this API No
ResourceType Int16 The type of resource. NOT used by this API No
calendarYearThe desired year. For example, 2013.
Returns
XML that represents a particular year's business calendar for a specified resource.
Security
No restrictions apply.
CalendarAuditLogEntryCollection GetCalendarAuditLog ( string  sessionId,
Agility.Sdk.Model.Resources.CalendarAuditLogFilter  calendarAuditLogFilter 
)

Retrieves the calendar audit log using the specified audit log filter.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
calendarAuditLogFilterA CalendarAuditLogFilter object containing the audit log filter criteria for retrieving audit log entries. Cannot be null
Name Type Comment Required
ResourceIdentity Identity Identity of the resource whose calendar audit log entries we want to retrieve Yes
FromDate DateTime Start date for entries. Can be null No
ToDate DateTime End date for entries. Can be null No
Returns
A collection of type CalendarAuditLogEntry object containing the audit log information.
Security
Resource must have at least Read access permission on Server ACL.
DateTime GetFutureDateUsingWorkingDays ( string  sessionId,
DateTime  fromDate,
int  days 
)

Calculates a future date using a specified number of working days from a specified date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateThe date to which the working days are added. Cannot be null
daysNumber of working days to add to the from date.
Returns
Future date determined by the adding the working days to the from/start date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
string GetFutureDateUsingWorkingDays2 ( string  sessionId,
int  days 
)

Calculates a future date using a specified number of working days from the current date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
daysNumber of working days to add to the current date.
Returns
The future date formatted in a string.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
DateTime GetFutureDateUsingWorkingHours ( string  sessionId,
DateTime  fromDate,
int  hours 
)

Calculates the future date using a specified number of working hours from a specified date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateThe date to which the working hours are added. Cannot be null
hoursNumber of working hours to add to the from date.
Returns
Future date determined by the adding the working hours to the specified date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
DateTime GetFutureDateUsingWorkingMinutes ( string  sessionId,
DateTime  fromDate,
int  minutes 
)

Calculates a future date using a specified number of working minutes from a specified date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateThe date to which the working minutes are added. Cannot be null
minutesNumber of working minutes to add to the from date.
Returns
Future date determined by the adding the working minutes to the from date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
DateTime GetFutureDateUsingWorkingSeconds ( string  sessionId,
DateTime  fromDate,
int  seconds 
)

Calculates a future date using a specified number of working seconds from a specified date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateThe date onto which the working seconds are added. Cannot be null
secondsNumber of working seconds to add to the from date.
Returns
Future date determined by the adding the working seconds to the from date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
DateTime GetFutureDateUsingWorkingTime ( string  sessionId,
DateTime  fromDate,
int  days,
int  hours,
int  minutes,
int  seconds 
)

Calculates a new data using the specified working days, hours, minutes and seconds from a specified From Date. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateThe start date from which future date should be calculated. Cannot be null
daysThe number of working days to add to the from/start date.
hoursThe number of working hours to add to the from/start date.
minutesThe number of working minutes to add to the from/start date.
secondsThe number of working seconds to add to the from/start date.
Returns
Future date determined by adding the working time to the from/start date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
TimePeriod GetHoursBreakdown ( string  sessionId,
int  hours 
)

Converts the specified hours into days and hours. The business calendar will NOT be used in the calculation.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
hoursNumber of hours to break down.
Returns
An object of type TimePeriod containing the time period in days and hours.
Security
No restrictions apply.
TimePeriod GetMinutesBreakdown ( string  sessionId,
int  minutes 
)

Converts the specified hours into days, hours and minutes. The business calendar will NOT be used in the calculation.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
minutesNumber of minutes to break down.
Returns
An object of type TimePeriod containing the time period in days, hours and minutes.
Security
No restrictions apply.
DateTime GetPastDateUsingWorkingDays ( string  sessionId,
DateTime  fromDate,
int  days 
)

Calculates the past date based on the specified date and working days. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateDate from which the working days are subtracted. Cannot be null
daysNumber of working days to subtract from the specified date.
Returns
Past date determined by subtracting the working days from the specified date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
DateTime GetPastDateUsingWorkingHours ( string  sessionId,
DateTime  fromDate,
int  hours 
)

Calculates the past date based on the specified date and working hours. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateDate from which the working hours are subtracted. Cannot be null
hoursNumber of working hours to subtract from the specified date.
Returns
Past date determined by subtracting the working hours from the specified date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
DateTime GetPastDateUsingWorkingMinutes ( string  sessionId,
DateTime  fromDate,
int  minutes 
)

Calculates the past date based on the specified date and working minutes. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateDate from which the working minutes are subtracted. Cannot be null
minutesNumber of working minutes to subtract from the specified date.
Returns
Past date determined by subtracting the working minutes from the specified date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
DateTime GetPastDateUsingWorkingSeconds ( string  sessionId,
DateTime  fromDate,
int  seconds 
)

Calculates the past date based on the specified date and working seconds. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateDate from which the working seconds are subtracted. Cannot be null
secondsNumber of working seconds to subtract from the specified date.
Returns
Past date determined by subtracting the working seconds from the specified date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
DateTime GetPastDateUsingWorkingTime ( string  sessionId,
DateTime  fromDate,
int  days,
int  hours,
int  minutes,
int  seconds 
)

Calculates the past date based on the specified from date, days and working time. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateDate from which the working time is subtracted. Cannot be null
daysThe number of working days to subtract from the specified date.
hoursThe number of working hours to subtract from the specified date.
minutesThe number of working minutes to subtract from the specified date.
secondsThe number of working seconds to subtract from the specified date.
Returns
Past date determined by subtracting the working time from the specified date.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
TimePeriod GetSecondsBreakdown ( string  sessionId,
int  seconds 
)

Converts the specified hours into days, hours, minutes and seconds. The business calendar will NOT be used in the calculation.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
secondsNumber of seconds to break down
Returns
An object of type TimePeriod containing the time period in days, hours, minutes and seconds.
Security
No restrictions apply.
TimeCategory GetTimeCategory ( string  sessionId,
TimeCategoryIdentity  timeCategoryIdentity 
)

Retrieves the details of the specified time category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
timeCategoryIdentityA TimeCategoryIdentity object identifying the time category whose detils we need to obtain. Cannot be null
Name Type Comment Required
Id Int32 The Id of the time category Yes
Returns
An object of type TimeCategory containing all the details for the time category.
Security
No restrictions apply.
bool GetUseBusinessCalendar ( string  sessionId)

Determines if the Use Business Calendar server setting is on or off.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
Returns
Returns true if the Business Calendar setting is ON, false otherwise.
Security
Resource must have at least Read access permission on Server ACL.
int GetWorkingDaysBetweenDates ( string  sessionId,
DateTime  fromDate,
DateTime  toDate 
)

Calculates the working days between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateStart Date. Cannot be null
toDateEnd date. Cannot be null
Returns
Number of working days between the dates.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
int GetWorkingHoursBetweenDates ( string  sessionId,
DateTime  fromDate,
DateTime  toDate 
)

Calculates the working hours between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateStart date. Cannot be null
toDateEnd date. Cannot be null
Returns
Number of working hours between the dates.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
TimePeriod GetWorkingHoursBreakdown ( string  sessionId,
int  hours 
)

Retrieves the working time break down in number of days, hours, minutes and seconds. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
hoursNumber of working hours to break down into days, hours, minutes and seconds.
Returns
A object of type TimePeriod containing the working time in days, hours, minutes and seconds.
Security
No restrictions apply.
int GetWorkingMinutesBetweenDates ( string  sessionId,
DateTime  fromDate,
DateTime  toDate 
)

Calculates the working minutes between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateFrom date. Cannot be null
toDateEnd date. Cannot be null
Returns
Number of working minutes between the dates.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
TimePeriod GetWorkingMinutesBreakdown ( string  sessionId,
int  minutes 
)

Retrieves the working time break down in number of days, hours, minutes and seconds. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
minutesNumber of working minutes to break down into days, hours, minutes and seconds.
Returns
A object of type TimePeriod containing the working time in days, hours, minutes and seconds.
Security
No restrictions apply.
int GetWorkingSecondsBetweenDates ( string  sessionId,
DateTime  fromDate,
DateTime  toDate 
)

Calculates the working seconds between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateStart date. Cannot be null
toDateEnd date. Cannot be null
Returns
Number of working seconds between the dates.
Remarks
If supplied parameter values give a working time span of zero, then the API will return the from date supplied. If date is going to be more than 5 years before or 5 years after the current year (as this is all that is stored at runtime in the business calendar), then an invalid date range exception will be thrown
Security
No restrictions apply.
TimePeriod GetWorkingSecondsBreakdown ( string  sessionId,
int  seconds 
)

Retrieves the working time break down in number of days, hours, minutes and seconds. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
secondsNumber of working seconds to break down into days, hours, minutes and seconds.
Returns
A object of type TimePeriod containing the working time in days, hours, minutes and seconds.
Security
No restrictions apply.
TimePeriod GetWorkingTimeBetweenDates ( string  sessionId,
DateTime  fromDate,
DateTime  toDate 
)

Retrieves the working time between the two specified dates. The business calendar will be used in the calculation, if the Use Business Calendar system setting is enabled.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
fromDateStart date. Cannot be null
toDateEnd date. Cannot be null
Returns
An object of type TimePeriod that contains the working time in days, hours, minutes and seconds.
Security
No restrictions apply.
WorkPatternAuditLogEntryCollection GetWorkPatternAuditLog ( string  sessionId,
WorkPatternAuditLogFilter  workPatternAuditLogFilter 
)

Retrieves the work pattern audit log using the filter criteria.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
workPatternAuditLogFilterA WorkPatternAuditLogFilter object containing the work pattern details for which the audit entries need to be retrieved. If work pattern information is not passed then it retrieves the audit log for all the work patterns in the system. Cannot be null
Name Type Comment Required
ResourceIdentity Identity Identity of the resource whose work patterns we want to retrieve Yes
WorkPatternIdentity Identity If supplied, we get the specified work pattern, otherwise we use the ResourceIdentity value No
FromDate DateTime Start date for entries. Can be null No
ToDate DateTime End date for entries. Can be null No
Returns
A collection of type WorkPatternAuditLogEntry which contains the audit log information.
Security
Resource must have at least Read access permission on Server ACL.
WorkPatternIdentityCollection GetWorkPatternsForResource ( string  sessionId,
ResourceIdentity  resourceIdentity 
)

Retrieves the work patterns for the specified resource.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
resourceIdentityA ResourceIdentity identity object indicating the resource whose work patterns we want to retrieve. Cannot be null
Name Type Comment Required
Id String The Id of the resource whose work patterns we want Yes
Name String Name of resource. NOT used by this API No
ResourceType Int16 The type of resource. NOT used by this API No
Returns
A collection of type WorkPatternIdentity object containing the Id's of the work patterns for the resource.
Security
No restrictions apply.
string ImportBusinessCalendarDataFromXml ( string  sessionId,
string  xml 
)

Imports a global business calendar described in the supplied XML.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
xmlXML that represents the business calendar we are importing. Cannot be null or empty
Returns
Any warning messages raised.
Security
Resource must have at least Read Write access permission on Server ACL.
bool IsWorkingDateTime ( string  sessionId,
DateTime  dateToCheck 
)

Determines if the specified date and time is within the defined working hours of the business calendar.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
dateToCheckDate to check whether it occurs during working time. Cannot be null
Returns
True if it is a working time, false otherwise.
Security
No restrictions apply.
bool IsWorkingDay ( string  sessionId,
DateTime  dateToCheck 
)

Determines if the specified date is a working day as defined by the business calendar. The time part of the date is not checked.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
dateToCheckDate to check whether it occurs on a working day.
Returns
True, if it is a working day; false, otherwise.
Security
No restrictions apply.
string UpdateBusinessCalendarDataFromXml ( string  sessionId,
short  calendarYear,
string  xml 
)

Update the global business calendar for the specified year with the XML being passed in the xml parameter.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
calendarYearThe calendar year.
xmlXML that represents the new business calendar. Cannot be null or empty
Returns
Any warning messages.
Security
Resource must have at least Read Write access permission on Server ACL.
DateTime UpdateBusinessCalendarDataFromXmlForResource ( string  sessionId,
ResourceIdentity  resourceIdentity,
short  calendarYear,
bool  overwrite,
DateTime  lastModifiedDate,
string  xml 
)

Updates the specified resource's business calendar from the supplied XML. You can specify whether to overwrite the calendar or not, if it has been modified since you last retrieved it.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
resourceIdentityA ResourceIdentity identity object indicating the resource whose business calendar we want to update. Cannot be null
Name Type Comment Required
Id String The Id of the resource whose calendar we want Yes
Name String Name of resource. NOT used by this API No
ResourceType Int16 The type of resource. NOT used by this API No
calendarYearThe calendar year to update.
overwriteIf overwrite is true, then we update even if it has been modified by someone else since we last retrieved the calendar. If false, do not update if it has been modified by someone else since we last retrieved the calendar.
lastModifiedDateLast modified date of calendar. The date/time of when you last read/loaded the calendar. Cannot be null
xmlXML that details the new business calendar. Cannot be null or empty
Returns
The datetime that was used as the last modified datetime for the updated business calendar.
Remarks
If the global calendar is being updated it will fails unless either of the following 2 conditions is met.
  1. the sessionId parameter is the system session Id
  2. the Id member of the resourceIdentity parameter is the system resource Id and either the system resource Id or the logged on user's resource Id are configured to be in the Server Access Control list and the resource has either Maintain Server or Read/Write access
Security
Resource must have at least Read Write access permission on Server ACL.
void UpdateTimeCategory ( string  sessionId,
TimeCategory  timeCategory,
bool  overwrite 
)

Updates the specified time category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
timeCategoryA TimeCategory object containing the time category information to update. Cannot be null
Name Type Comment Required
Id Int32 Unique identifier of time category No
Name String Name for time category (maximum 40 characters) Yes
Category Int16 Category of time category. Supply 0 (Both), 1 (Calendar) or 2 (Work Pattern). Defaults to 0 No
DebitOrCredit Int16 Indicates if debit or credit. Must have value 0 (Debit) or 1 (Credit) Yes
LastModifiedDate DateTime Last modified date time No
LastModifiedUser Identity Pass in the resource Id to be used as Last Modified By User field. The Id field of the identity is required, not the Name field Yes
overwriteIf set to true, updates even if someone else has updated since we retrieved the details of the time category. If set to false, then only update if noone else has modified since we got details of the time category.
Security
Resource must have at least Read Write access permission on Server ACL.