public ActionResult Create() { var model = new WeekCreateModel(); model.Title = "Weeks Create"; return this.View(model); }
public ActionResult Create(WeekCreateModel model) { if (this.ModelState.IsValid) { WeekRepository.WeekAdd(model.StartDate, DayOfWeek.Monday, model.NumberOfPeriods, model.Year); return this.RedirectToAction("Index", new { year = model.Year }); } return this.View(model); }