public MenuFormationModel GetMenuAndCourses(DateTime date) { var menuCourses = this.menuService.GetDayMenu(date); var availableCourses = this.courseService.GetCourses(); var model = new MenuFormationModel { Date = date, MenuCourses = menuCourses, AvailableCourses = availableCourses }; return(model); }
public ActionResult Index(string date) { var menuDate = this.GetMenuDate(date); if (string.IsNullOrEmpty(date)) { return(this.RedirectToAction("Index", new { date = menuDate.ToString("yyyy-MM-dd") })); } var viewModel = new MenuFormationModel { Date = menuDate }; return(this.View(viewModel)); }