public ResponseFixedAssetsIsGenPZ IsGenPZ(RequestFixedAssetsIsGenPZ request) { var res = new ResponseFixedAssetsIsGenPZ(); using (cnn = this.GetConnection()) { var ts = cnn.BeginTransaction(); try { var user = UserInfoGet(request.Token, ts); var data = cnn.Query <TKS_FAS_FixedAssets>( "select * from TKS_FAS_FixedAssets where AccountId=@AccountId and isGenPZ=0 and AddType<>'期初'", new { AccountId = user.AccountId }, ts); if (data.Count() > 0) { res.IsSuccess = false; res.Message = "存在未生成凭证的固定资产"; } else { res.IsSuccess = true; res.Message = "ok"; } return(res); } catch (Exception ex) { ts.Rollback(); return(this.DealException(res, ex) as ResponseFixedAssetsIsGenPZ); } } }
public ResponseFixedAssetsIsGenPZ IsGenPZ([FromBody] RequestFixedAssetsIsGenPZ request) { try { FixedAssetsBLL bll = new FixedAssetsBLL(); return(bll.IsGenPZ(request)); } catch (Exception ex) { throw new HttpResponseException( Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }