/// <summary> /// Create XML to submit time off request which is in draft. /// </summary> /// <param name="personNumber">Person Number.</param> /// <param name="reqId">RequestId of the time off request.</param> /// <param name="querySpan">Query Span.</param> /// <returns>Submit time off request.</returns> private string CreateSubmitTimeOffRequest(string personNumber, string reqId, string querySpan) { TimeOffSubmitRequest.Request rq = new TimeOffSubmitRequest.Request() { Action = ApiConstants.SubmitRequests, EmployeeRequestMgm = new TimeOffSubmitRequest.EmployeeRequestMgmt() { Employees = new TimeOffSubmitRequest.Employee() { PersonIdentity = new TimeOffSubmitRequest.PersonIdentity() { PersonNumber = personNumber } }, QueryDateSpan = querySpan, RequestIds = new TimeOffSubmitRequest.RequestIds() { RequestId = new TimeOffSubmitRequest.RequestId[] { new TimeOffSubmitRequest.RequestId() { Id = reqId } } }, }, }; return(rq.XmlSerialize()); }
/// <summary> /// Create XML to submit time off request which is in draft. /// </summary> /// <param name="personNumber">Person Number.</param> /// <param name="reqId">RequestId of the time off request.</param> /// <param name="querySpan">Query Span.</param> /// <returns>Submit time off request.</returns> private string CreateSubmitTimeOffRequest(string personNumber, string reqId, string querySpan) { var monthStartDt = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); var monthEndDt = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.DaysInMonth(monthStartDt.Year, monthStartDt.Month)); TimeOffSubmitRequest.Request rq = new TimeOffSubmitRequest.Request() { Action = ApiConstants.SubmitRequests, EmployeeRequestMgm = new TimeOffSubmitRequest.EmployeeRequestMgmt() { Employees = new TimeOffSubmitRequest.Employee() { PersonIdentity = new TimeOffSubmitRequest.PersonIdentity() { PersonNumber = personNumber } }, QueryDateSpan = querySpan, RequestIds = new TimeOffSubmitRequest.RequestIds() { RequestId = new TimeOffSubmitRequest.RequestId[] { new TimeOffSubmitRequest.RequestId() { Id = reqId } } }, }, }; return(rq.XmlSerialize()); }