コード例 #1
0
        public ActionResult <BuildingUpdateResViewModel> Manage_OpinionInfo_Update(BuildingUpdateViewModel buildingUpdateViewModel)
        {
            int Building_Update_Count;

            Building_Update_Count = _buildingService.Building_Update(buildingUpdateViewModel);
            var opinionInfoUpdateResModel = _buildingFactory.GetBuildingUpdateResViewModel();

            if (Building_Update_Count > 0)
            {
                opinionInfoUpdateResModel.baseViewModel.IsSuccess = true;
                opinionInfoUpdateResModel.AddCount = Building_Update_Count;
                opinionInfoUpdateResModel.baseViewModel.Message      = "更改成功";
                opinionInfoUpdateResModel.baseViewModel.ResponseCode = 200;
                _ILogger.Information("更改楼宇信息成功");
                return(Ok(opinionInfoUpdateResModel));
            }
            else
            {
                opinionInfoUpdateResModel.baseViewModel.IsSuccess = false;
                opinionInfoUpdateResModel.AddCount = 0;
                opinionInfoUpdateResModel.baseViewModel.Message      = "更改失败";
                opinionInfoUpdateResModel.baseViewModel.ResponseCode = 400;
                _ILogger.Information("更改楼宇信息失败");
                return(BadRequest(opinionInfoUpdateResModel));
            }
        }