public ActionResult Create(NewEventPostModel model) { var obj = new Event(model.Name,model.Slug,model.StartTime,model.EndTime); var checkCreds = obj.Validate(); if (checkCreds.Succeeded) { Repo.Save(obj); return RedirectToAction("Edit", new { id = obj.ID }); } TempData.Add("ErrorMessage", checkCreds.Message); return RedirectToAction("New", model); }
public ActionResult New(NewEventPostModel model = null) { if (model == null) model = new NewEventPostModel(); return View(model); }