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."));; } }
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); } }
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); } }