コード例 #1
0
 public HttpResponseMessage GetDetail(string moneyslipId)
 {
     try
     {
         MoneySlipDetailDT mslDetailDT = new MoneySlipDetailDT();
         DataTable         dtReceipt   = moneyslipDT.GetByCond("ID=" + moneyslipId);
         DataTable         dtDetail    = new DataTable();
         if (dtReceipt != null)
         {
             if (dtReceipt.Rows[0]["Type"].ToString() == "1")
             {
                 dtDetail = mslDetailDT.GetImportPayment(moneyslipId);
             }
             else if (dtReceipt.Rows[0]["Type"].ToString() == "2")
             {
                 dtDetail = mslDetailDT.GetReceivePayment(moneyslipId);
             }
         }
         return(Request.CreateResponse <string>(HttpStatusCode.OK, JsonConvert.SerializeObject(dtDetail)));
     }
     catch (Exception e)
     {
         ExceptionHandler.Log(e);
         return(Request.CreateResponse <string>(HttpStatusCode.OK, "Lỗi: Không đọc được chi tiết phiếu thu."));;
     }
 }
コード例 #2
0
 public HttpResponseMessage GetImportInvoice(string supplierId)
 {
     try
     {
         MoneySlipDetailDT mslDetailDT = new MoneySlipDetailDT();
         DataTable         dt          = mslDetailDT.GetImportInvoice("Cat_SupplierID=" + supplierId);
         return(Request.CreateResponse <string>(HttpStatusCode.OK, JsonConvert.SerializeObject(dt)));
     }
     catch (Exception e)
     {
         ExceptionHandler.Log(e);
         return(null);
     }
 }
コード例 #3
0
 public HttpResponseMessage GetReceiveProduct(string customerId)
 {
     try
     {
         MoneySlipDetailDT mslDetailDT = new MoneySlipDetailDT();
         DataTable         dt          = mslDetailDT.GetReceiveProduct("CustomerId=" + customerId);
         return(Request.CreateResponse <string>(HttpStatusCode.OK, JsonConvert.SerializeObject(dt)));
     }
     catch (Exception e)
     {
         ExceptionHandler.Log(e);
         return(null);
     }
 }