コード例 #1
0
        public ActionResult <ActivityUpdateResViewModel> Manage_OpinionInfo_Update(ActivityUpdateViewModel activityUpdateViewModel)
        {
            int Activity_Update_Count;

            Activity_Update_Count = _activityService.Activity_Update(activityUpdateViewModel);
            var opinionInfoUpdateResModel = _activityFactory.GetActivityUpdateResViewModel();

            //添加附件中的FormId
            foreach (FileUpload fileUpload in activityUpdateViewModel.Files)
            {
                fileUpload.FormId = activityUpdateViewModel.Id;
                _activityUploadService.UpdateFile(fileUpload);
            }


            if (Activity_Update_Count > 0)
            {
                opinionInfoUpdateResModel.baseViewModel.IsSuccess = true;
                opinionInfoUpdateResModel.AddCount = Activity_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));
            }
        }