예제 #1
0
        public ActionResult AjaxView()
        {
            var calendar = _weeklyScheduleApi.GetAll(UserItem.AgencyID, ArrId.FirstOrDefault());

            ViewBag.ID = ArrId.FirstOrDefault();
            return(View(calendar));
        }
예제 #2
0
        public List <WeeklyScheduleItem> GetListCalendar(DateTime toDate, DateTime endDate)
        {
            var datestart = toDate.TotalSeconds();
            var code      = CodeLogin();
            var listWeeklyScheduleItem = _weeklyScheduleApi.GetAll(UserItem.AgencyID, 0);
            var listdayoff             = GetListDayOffItem(toDate, endDate, code);

            foreach (var dayOffItem in listdayoff)
            {
                foreach (var weeklyScheduleItem in listWeeklyScheduleItem.Where(m => dayOffItem.Date <= (datestart + (m.WeeklyID - 1) * 86400) && dayOffItem.DateEnd >= (datestart + (m.WeeklyID - 1) * 86400) && !m.IsDayOff))
                {
                    weeklyScheduleItem.IsDayOff   = true;
                    weeklyScheduleItem.NameDayOff = dayOffItem.Name;
                }
            }
            return(listWeeklyScheduleItem);
        }