Esempio n. 1
0
        public ActionResult Create(Permission permission)
        {
            if (ModelState.IsValid)
            {
                db.Permissions.Add(permission);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(permission);
        }
Esempio n. 2
0
 public ActionResult Edit(Permission permission)
 {
     if (ModelState.IsValid)
     {
         db.Entry(permission).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(permission);
 }