Example #1
0
        private List <JsonEmployeeTask> GetTaskModel(int employeeId)
        {
            var dow = new[] { 1, 2, 3, 4, 5 };// Monday - Friday
            var employeeCalendarSearchmodel = new UserTaskSearchModel {
                UserId = employeeId, PageSize = int.MaxValue, SortColumn = "Id"
            };

            employeeCalendarSearchmodel = _employeeFacadeApiClient.GetUserTasks(employeeCalendarSearchmodel).Result;
            var result = (from calendarTask in employeeCalendarSearchmodel.UserTaskSearchResult
                          select new JsonEmployeeTask
            {
                id = calendarTask.Id,
                title = calendarTask.TaskType?.Name,
                description = calendarTask.Description,
                start = calendarTask.ScheduleStartTime.ToString("s"),
                end = calendarTask.ScheduleEndTime.ToString("s"),
                className = calendarTask.TaskType?.CssClass.ToLower(),
                styleName = calendarTask.TaskType?.CssStyle.ToLower(),
                businessHours = new JsonBusinessHours {
                    dow = dow, start = "08:00", end = "17:00"
                }
            }).ToList();

            return(result);
        }