public ActionResult Edit(Activity model) { if (this.ModelState.IsValid) { dc.Entry(model).State = System.Data.Entity.EntityState.Modified; dc.SaveChanges(); return this.RedirectToAction("Index"); } ViewBag.Title = "Editace aktivity"; ViewBag.CancelAction = "Index"; return View("~/Views/Shared/UniversalEditor.cshtml", model); }
public ActionResult Create(Activity model) { if (this.ModelState.IsValid) { dc.Activities.Add(model); dc.SaveChanges(); return this.RedirectToAction("Index"); } ViewBag.Title = "Nová aktivita"; ViewBag.CancelAction = "Index"; return View("~/Views/Shared/UniversalEditor.cshtml", model); }