示例#1
0
 public ActionResult DeleteRole(Role vm)
 {
     Repository.Delete(Repository.GetRole(vm.Id));
     Repository.Save();
     return RedirectToAction("roles");
 }
示例#2
0
 public ActionResult EditRole(Role vm)
 {
     if (!ModelState.IsValid) return View(vm);
     UpdateModel(Repository.GetRole(vm.Id));
     Repository.Save();
     return RedirectToAction("roles");
 }
示例#3
0
 public ActionResult CreateRole()
 {
     var vm = new Role
     {
         SequenceIdentifier = int.MaxValue,
         ShowBookList = true
     };
     return View(vm);
 }
示例#4
0
 public ActionResult CreateRole(Role vm)
 {
     if (!ModelState.IsValid) return View(vm);
     Repository.Add(vm);
     Repository.Save();
     return RedirectToAction("roles");
 }
示例#5
0
 partial void DeleteRole(Role instance);
示例#6
0
 partial void UpdateRole(Role instance);
示例#7
0
 partial void InsertRole(Role instance);
示例#8
0
 public void Delete(Role role)
 {
     _db.Roles.DeleteOnSubmit(role);
 }
示例#9
0
 public void Add(Role role)
 {
     _db.Roles.InsertOnSubmit(role);
 }