Пример #1
0
        // //删除权限(一个或者多个)
        public int Rights_Delete(RightsDeleteViewModel rightsDeleteViewModel)
        {
            int DeleteRowsNum = _IUserRightsRepository
                                .DeleteByRightsidList(rightsDeleteViewModel.DeleleIdList);

            if (DeleteRowsNum == rightsDeleteViewModel.DeleleIdList.Count)
            {
                return(DeleteRowsNum);
            }
            else
            {
                return(-1);
            }
        }
Пример #2
0
        public ActionResult <RightsDeleteResModel> Manage_Rights_Delete(RightsDeleteViewModel rightsDeleteViewModel)
        {
            RightsDeleteResModel rightsDeleteResModel = new RightsDeleteResModel();
            int DeleteResult = _rightsService.Rights_Delete(rightsDeleteViewModel);

            if (DeleteResult > 0)
            {
                rightsDeleteResModel.AddCount                   = DeleteResult;
                rightsDeleteResModel.IsSuccess                  = true;
                rightsDeleteResModel.baseViewModel.Message      = "删除成功";
                rightsDeleteResModel.baseViewModel.ResponseCode = 200;
                //_ILogger.Information("删除权限信息(直接删除),删除成功");
                return(Ok(rightsDeleteResModel));
            }
            else
            {
                rightsDeleteResModel.AddCount                   = -1;
                rightsDeleteResModel.IsSuccess                  = false;
                rightsDeleteResModel.baseViewModel.Message      = "删除失败";
                rightsDeleteResModel.baseViewModel.ResponseCode = 400;
                //_ILogger.Information("删除权限信息(直接删除),删除失败");
                return(BadRequest(rightsDeleteResModel));
            }
        }