public ActionResult ListItems(int year, int weekNumber = 1)
        {
            var dateA   = FDIUtils.WeekDays(year, weekNumber);
            var toDate  = dateA[0];
            var endDate = dateA[6];
            var dates   = toDate.TotalSeconds();
            var datee   = endDate.TotalSeconds();
            var model   = new ModelDNUserCalendarItem
            {
                ListItems           = _userApi.GetListCalendar(UserItem.AgencyID, dates, datee),
                WeeklyScheduleItems = GetListCalendar(toDate, endDate),
                DateStart           = toDate
            };

            return(View(model));
        }
Example #2
0
        public ActionResult ListItems(int year = 0, int month = 0)
        {
            var date = DateTime.Now;

            if (year == 0 || month == 0)
            {
                date = new DateTime(date.Year, date.Month, 1);
            }
            else
            {
                date = new DateTime(year, month, 1);
            }
            var model = new ModelDNUserCalendarItem
            {
                ListItems   = _userApi.GetListTotalMonth(UserItem.AgencyID, date.TotalSeconds(), date.AddMonths(1).TotalSeconds()),
                DayOffItems = _dnDayOffApi.GetAll(UserItem.AgencyID),
                DateStart   = date
            };

            return(View(model));
        }