Example #1
0
 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);
 }
Example #2
0
 public ActionResult New(NewEventPostModel model = null)
 {
     if (model == null) model = new NewEventPostModel();
     return View(model);
 }