Beispiel #1
0
        public ActionResult WeekEdit(DateTime start)
        {
            ViewBag.Section = ActiveSection.Week;

            if (start.DayOfWeek != DayOfWeek.Monday)
            {
                start = GetMonday(start, false);
            }

            var week = EntitiesHelper.GetWeek(start, 5);

            return(View("WeekEditView", week));
        }
Beispiel #2
0
        public ActionResult DayEdit(DateTime day)
        {
            day = day.Date;
            DateTime start = day.Date;

            ViewBag.Section = ActiveSection.Week;

            if (start.DayOfWeek != DayOfWeek.Monday)
            {
                start = GetMonday(start, false);
            }

            var week   = EntitiesHelper.GetWeek(start, 5);
            var daylog = from d in week where d.Date == day select d;

            return(View("WeekEditView", daylog));
        }
Beispiel #3
0
        public ActionResult Week(DateTime start, bool skipAheadIfWeekend)
        {
            ViewBag.Section = ActiveSection.Week;

            DayOfWeek activeDay = start.DayOfWeek;
            bool      weekend   = activeDay == DayOfWeek.Saturday || activeDay == DayOfWeek.Sunday;

            if (start.DayOfWeek != DayOfWeek.Monday)
            {
                start = GetMonday(start, skipAheadIfWeekend);
            }
            if (weekend)
            {
                activeDay = skipAheadIfWeekend ? DayOfWeek.Monday : DayOfWeek.Friday;
            }

            var week = EntitiesHelper.GetWeek(start, 5);

            ViewBag.ActiveDay = activeDay;
            return(View("WeekView", week));
        }