コード例 #1
0
        public ActionResult <IdentityAddResViewModel> Manage_OpinionIdentity_Add(IdentityAddViewModel identityAddViewModel)
        {
            int Identity_add_Count;

            Identity_add_Count = _identityService.AddIdentity(identityAddViewModel);
            var opinionIdentityAddResModel = _inhabitantFactory.GetIdentityAddResViewModel();

            if (Identity_add_Count > 0)
            {
                opinionIdentityAddResModel.baseViewModel.IsSuccess = true;
                opinionIdentityAddResModel.AddCount = Identity_add_Count;
                opinionIdentityAddResModel.baseViewModel.Message      = "添加成功";
                opinionIdentityAddResModel.baseViewModel.ResponseCode = 200;
                _ILogger.Information("增添居民信息成功");
                return(Ok(opinionIdentityAddResModel));
            }
            else
            {
                opinionIdentityAddResModel.baseViewModel.IsSuccess = false;
                opinionIdentityAddResModel.AddCount = 0;
                opinionIdentityAddResModel.baseViewModel.Message      = "添加失败";
                opinionIdentityAddResModel.baseViewModel.ResponseCode = 400;
                _ILogger.Information("增添居民信息失败");
                return(BadRequest(opinionIdentityAddResModel));
            }
        }