Example #1
0
        public ActionResult Create()
        {
            var model = new WeekCreateModel();

            model.Title = "Weeks Create";

            return this.View(model);
        }
Example #2
0
        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);
        }