Example #1
0
        public List <CalendarItemType> GetDepartmentCalendarItemTypes()
        {
            var jsonItems = new List <CalendarItemType>();
            var items     = _calendarService.GetAllCalendarItemTypesForDepartment(DepartmentId);

            jsonItems.Add(new CalendarItemType()
            {
                CalendarItemTypeId = "0",
                Color = "#EEE",
                Name  = "None"
            });

            foreach (var item in items)
            {
                var calendarItemType = new CalendarItemType();
                calendarItemType.CalendarItemTypeId = item.CalendarItemTypeId.ToString();
                calendarItemType.Name  = item.Name;
                calendarItemType.Color = item.Color;

                jsonItems.Add(calendarItemType);
            }

            return(jsonItems);
        }
Example #2
0
        public async Task <ActionResult <List <CalendarItemType> > > GetDepartmentCalendarItemTypes()
        {
            var jsonItems = new List <CalendarItemType>();
            var items     = await _calendarService.GetAllCalendarItemTypesForDepartmentAsync(DepartmentId);

            jsonItems.Add(new CalendarItemType()
            {
                CalendarItemTypeId = "0",
                Color = "#EEE",
                Name  = "None"
            });

            foreach (var item in items)
            {
                var calendarItemType = new CalendarItemType();
                calendarItemType.CalendarItemTypeId = item.CalendarItemTypeId.ToString();
                calendarItemType.Name  = item.Name;
                calendarItemType.Color = item.Color;

                jsonItems.Add(calendarItemType);
            }

            return(Ok(jsonItems));
        }