Ejemplo n.º 1
0
        /// <summary>
        /// Creates upcoming shifts request
        /// </summary>
        /// <param name="startDate">Start Date</param>
        /// <param name="endDate">End Date</param>
        /// <param name="personNumber">Person number</param>
        /// <returns>Shift request string</returns>
        public string CreateUpcomingShiftsRequest(string startDate, string endDate, string personNumber)
        {
            ScheduleRequest.Request rq = new ScheduleRequest.Request()
            {
                Action   = ApiConstants.LoadAction,
                Schedule = new ScheduleRequest.Schedule()
                {
                    Employees     = new List <ScheduleRequest.PersonIdentity>(),
                    QueryDateSpan = $"{startDate} - {endDate}"
                }
            };

            rq.Schedule.Employees.Add(new ScheduleRequest.PersonIdentity()
            {
                PersonNumber = personNumber
            });

            return(rq.XmlSerialize());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates upcoming shifts request for employees
        /// </summary>
        /// <param name="startDate">Start Date</param>
        /// <param name="endDate">End Date</param>
        /// <param name="personNumber">Person Number</param>
        /// <param name="employees">Employees object</param>
        /// <returns>Shifts request string</returns>
        public string CreateUpcomingShiftsRequestEmployees(string startDate, string endDate, string personNumber, List <ResponseHyperFindResult> employees)
        {
            ScheduleRequest.Request rq = new ScheduleRequest.Request()
            {
                Action   = ApiConstants.LoadAction,
                Schedule = new ScheduleRequest.Schedule()
                {
                    Employees     = new List <ScheduleRequest.PersonIdentity>(),
                    QueryDateSpan = $"{startDate} - {endDate}"
                }
            };

            var scheduledEmployees = employees.ConvertAll(x => new ScheduleRequest.PersonIdentity {
                PersonNumber = x.PersonNumber
            });

            rq.Schedule.Employees.AddRange(scheduledEmployees);

            return(rq.XmlSerialize());
        }