public ActionResult Delete(string userId, string roleId, string masterRoleId = null, string masterUserId = null) { UserRoleItemModel userRoleItemModel = new UserRoleItemModel() { IsSecurityOperations = this.IsSecurityOperations, UserRole = new UserRoleViewModel(), ControllerAction = "Delete", MasterRoleId = masterRoleId, MasterUserId = masterUserId }; try { if (IsDelete(userRoleItemModel.OperationResult)) { UserRole userRole = Repository.GetById(new object[] { userId, roleId }); if (userRole != null) { userRoleItemModel.UserRole = new UserRoleViewModel(userRole); } } } catch (Exception exception) { userRoleItemModel.OperationResult.ParseException(exception); } return(PartialView(userRoleItemModel)); }
public ActionResult Update(UserRoleItemModel userRoleItemModel) { try { if (IsUpdate(userRoleItemModel.OperationResult)) { if (ValidateModelState(Repository)) { if (Repository.Update(userRoleItemModel.OperationResult, (UserRole)userRoleItemModel.UserRole.ToData())) { if (UnitOfWork.Save(userRoleItemModel.OperationResult)) { return(JsonResultSuccess(new { uri = ReadUrlDictionary() })); } } } } } catch (Exception exception) { userRoleItemModel.OperationResult.ParseException(exception); } return(JsonResultOperationResult(userRoleItemModel.OperationResult)); }
public ActionResult Update(UserRoleItemModel userRoleItemModel) { try { if (IsUpdate(userRoleItemModel.OperationResult)) { if (ValidateModelState(Repository)) { if (Repository.Update(userRoleItemModel.OperationResult, (UserRole)userRoleItemModel.UserRole.ToData())) { if (UnitOfWork.Save(userRoleItemModel.OperationResult)) { return(RedirectToUrlDictionary()); } } } } } catch (Exception exception) { userRoleItemModel.OperationResult.ParseException(exception); } userRoleItemModel.IsSecurityOperations = IsSecurityOperations; return(View(userRoleItemModel)); }
public ActionResult Create(string masterRoleId = null, string masterUserId = null) { UserRoleItemModel userRoleItemModel = new UserRoleItemModel() { IsSecurityOperations = this.IsSecurityOperations, UserRole = new UserRoleViewModel(), ControllerAction = "Create", MasterRoleId = masterRoleId, MasterUserId = masterUserId }; try { IsCreate(userRoleItemModel.OperationResult); } catch (Exception exception) { userRoleItemModel.OperationResult.ParseException(exception); } return(PartialView(userRoleItemModel)); }