In guidArrayList i have the two Guids. I need to check the user is leave or not from work hours by using the following Code,
List<Guid> LeaveUsers = new List<Guid>();
QueryMultipleSchedulesRequest scheduleRequest = new QueryMultipleSchedulesRequest();
scheduleRequest.ResourceIds = new Guid[users.Entities.Count];
int indexValue = 0;
foreach (var value in guidArrayList)
{
scheduleRequest.ResourceIds[indexValue] = new Guid(value.ToString());
indexValue++;
}
scheduleRequest.Start = DateTime.Now;
scheduleRequest.End = DateTime.Today.AddDays(1);
scheduleRequest.TimeCodes = new TimeCode[] { TimeCode.Available };
QueryMultipleSchedulesResponse scheduleResponse = (QueryMultipleSchedulesResponse)service.Execute(scheduleRequest);
I got the response in scheduleResponse , now I need to iterate the response and capture the leave users in Leaveusers list from response?
(i.e)
Iterate the response like,
if (scheduleResponse.TimeInfos.Length <= 0)
{
LeaveUsers .Add(//If the ResourceId value is leave then we can add the list here);
}