예제 #1
0
 public ActionResult RoleEdit(RoleViewModel model)
 {
     if(ModelState.IsValid)
     {
      RolesManager.ChangeRole(model.RoleId, model.PermissionBrowse, model.PermissionEdit, model.PermissionDelete);
      return RedirectToAction("Roles");
     }
     else
         return View();
 }
예제 #2
0
        public ActionResult RoleEdit(int id)
        {
            RoleViewModel roleViewModel = new RoleViewModel();
            Role role = RolesManager.GetRole(id);
            if (role != null)
            {
                roleViewModel.RoleId = id;
                roleViewModel.PermissionBrowse = role.Permission.PermissionBrowse;
                roleViewModel.PermissionEdit = role.Permission.PermissionEdit;
                roleViewModel.PermissionDelete = role.Permission.PermissionDelete;
                roleViewModel.PermissionPaths = role.Permission.PermissionPaths;

                return View(roleViewModel);
            }
            else
            {
                return RedirectToAction("Index", "Error");
            }
        }
예제 #3
0
 public ActionResult Roles(RoleViewModel model)
 {
     return View(RolesManager.GetAllRoles());
 }