Exemple #1
0
        public ResponseFixedAssetsGet FixedAssetsGet(RequestFixedAssetsGet request)
        {
            ResponseFixedAssetsGet response = new ResponseFixedAssetsGet();

            using (cnn = GetConnection())
            {
                var ts = cnn.BeginTransaction();

                try
                {
                    var           user    = UserInfoGet(request.Token, ts);
                    AccountSetBLL account = new AccountSetBLL(cnn);
                    var           period  = account.GetActivePeriod(user.AccountId, ts);
                    var           data    = cnn.QuerySingle <TKS_FAS_FixedAssets>("select * from TKS_FAS_FixedAssets where id=@Id", new
                    {
                        Id = request.Id
                    }, ts);

                    ts.Commit();
                    response.IsSuccess = true;
                    response.Message   = "加载完毕";
                    response.Data      = data;
                    response.NowPeriod = period.Id;

                    return(response);
                }
                catch (Exception ex)
                {
                    ts.Rollback();
                    return(this.DealException(response, ex) as ResponseFixedAssetsGet);
                }
            }
        }
 public ResponseFixedAssetsGet FixedAssetsGet([FromBody] RequestFixedAssetsGet request)
 {
     try
     {
         FixedAssetsBLL bll = new FixedAssetsBLL();
         return(bll.FixedAssetsGet(request));
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(
                   Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }