//更新权限信息 public int Rights_Update(RightsUpdateViewModel rightsUpdateViewModel) { var user_Rights = _IUserRightsRepository.GetInfoByRightId(rightsUpdateViewModel.Id); var user_Rights_Update = _IMapper.Map <RightsUpdateViewModel, User_Rights>(rightsUpdateViewModel, user_Rights); _IUserRightsRepository.Update(user_Rights_Update); return(_IUserRightsRepository.SaveChanges()); }
public ActionResult <RightsUpdateResModel> Manage_Rights_Update(RightsUpdateViewModel rightsUpdateViewModel) { RightsUpdateResModel rightsValideResRepeat = new RightsUpdateResModel(); int UpdateRowNum = _rightsService.Rights_Update(rightsUpdateViewModel); if (UpdateRowNum > 0) { rightsValideResRepeat.IsSuccess = true; rightsValideResRepeat.AddCount = UpdateRowNum; rightsValideResRepeat.baseViewModel.Message = "更新成功"; rightsValideResRepeat.baseViewModel.ResponseCode = 200; //_ILogger.Information("更新权限信息,更新成功"); return(Ok(rightsValideResRepeat)); } else { rightsValideResRepeat.IsSuccess = false; rightsValideResRepeat.AddCount = 0; rightsValideResRepeat.baseViewModel.Message = "更新失败"; rightsValideResRepeat.baseViewModel.ResponseCode = 400; //_ILogger.Information("更新权限信息,更新失败"); return(BadRequest(rightsValideResRepeat)); } }