Exemple #1
0
 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);
 }
Exemple #2
0
 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);
 }