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