public ActionResult DeleteRole(Role vm) { Repository.Delete(Repository.GetRole(vm.Id)); Repository.Save(); return RedirectToAction("roles"); }
public ActionResult EditRole(Role vm) { if (!ModelState.IsValid) return View(vm); UpdateModel(Repository.GetRole(vm.Id)); Repository.Save(); return RedirectToAction("roles"); }
public ActionResult CreateRole() { var vm = new Role { SequenceIdentifier = int.MaxValue, ShowBookList = true }; return View(vm); }
public ActionResult CreateRole(Role vm) { if (!ModelState.IsValid) return View(vm); Repository.Add(vm); Repository.Save(); return RedirectToAction("roles"); }
partial void DeleteRole(Role instance);
partial void UpdateRole(Role instance);
partial void InsertRole(Role instance);
public void Delete(Role role) { _db.Roles.DeleteOnSubmit(role); }
public void Add(Role role) { _db.Roles.InsertOnSubmit(role); }