常用方法
常用方法
常用方法
常用方法
public PartialViewResult AddUserRoleReturnPartialView(int RoleID, int UserID) { Role role = database.Roles.Find(RoleID); User user = database.Users.Find(UserID); bool rslt = false; if (!role.Users.Contains(user)) { rslt = _repo.AddUserRole(RoleID, UserID); } if (rslt == true) { ViewBag.IsSaved = true; } user = _repo.GetUserByID(UserID); UserViewModel uvm = MapUsertoUVM(user); return(PartialView("_UserRoleTable", uvm)); }