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)); }
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)); }
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)); }