Exemplo n.º 1
0
 public ResponseCalHelperGet CalHelperGet([FromBody] RequestCalHelperGet request)
 {
     try
     {
         CalHelperBLL bll = new CalHelperBLL();
         return(bll.CalHelperGet(request));
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(
                   Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Exemplo n.º 2
0
        public ResponseCalHelperGet CalHelperGet(RequestCalHelperGet request)
        {
            ResponseCalHelperGet response = new ResponseCalHelperGet();

            using (cnn = GetConnection())
            {
                var ts = cnn.BeginTransaction();
                try
                {
                    //辅助核算类别是否被使用
                    var ass = cnn.Query("select * from TKS_FAS_SubjectAss where code=@Code",
                                        new { Code = request.Data.Id }, ts).ToList();
                    if (ass.Count() > 0)
                    {
                        response.IsUse = 1;
                    }
                    else
                    {
                        response.IsUse = 0;
                    }
                    var head = cnn.QuerySingle <TKS_FAS_CaculateHelperItem>("select * from TKS_FAS_CaculateHelperItem where id=@Id", new
                    {
                        Id = request.Data.Id
                    }, ts);

                    var customDes = cnn.Query <TKS_FAS_CustomColDes>("select * from TKS_FAS_CustomColDes where parentId=@ParentId", new
                    {
                        ParentId = request.Data.Id
                    }, ts).ToList();
                    ts.Commit();
                    response.IsSuccess = true;
                    response.Message   = "加载完毕";
                    response.Head      = head;
                    response.CustomDes = customDes;
                    return(response);
                }
                catch (Exception ex)
                {
                    ts.Rollback();
                    return(this.DealException(response, ex) as ResponseCalHelperGet);
                }
            }
        }