Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }