コード例 #1
0
        public static string GetSellInvoiceCode()
        {
            SelInvoiceDT sellInvoiceDT = new SelInvoiceDT();
            string       mmyy          = getMMyy();
            DataTable    invoiceTable  = sellInvoiceDT.GetByCond("Code like 'SI" + mmyy + "%'", " Code DESC");
            string       prefix        = "SI" + mmyy;
            string       suffix        = "0001";

            if (invoiceTable != null && invoiceTable.Rows.Count > 0)
            {
                suffix = getSuffix(invoiceTable.Rows[0]["Code"].ToString());
            }
            return(prefix + suffix);
        }
コード例 #2
0
ファイル: StoreModel.cs プロジェクト: nhatlbh/MinhTin
 public static void ReceiveProduct(SelReceiveproductContract receiveProductDTO, SelReceiveproductDetailContract receiveProductDetailDTO, SqlTransaction tran)
 {
     try
     {
         SelInvoiceDT invoiceDT = new SelInvoiceDT();
         DataTable    dtInvoice = invoiceDT.GetByID(receiveProductDTO.Invoiceid.ToString());
         if (dtInvoice != null && dtInvoice.Rows.Count > 0)
         {
             string invoiceCode = dtInvoice.Rows[0]["Code"].ToString();
             returnStore(invoiceCode, (int)receiveProductDTO.Storeid, (int)receiveProductDetailDTO.Productid, receiveProductDetailDTO.Quantity, tran);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
コード例 #3
0
 void SaveInvReceipt(int receiptId, string invReceiptJson, SqlTransaction tran)
 {
     try
     {
         SelInvoiceDT invDT = new SelInvoiceDT();
         List <SelInvoiceReceiptContract> invReceipts = JsonConvert.DeserializeObject <List <SelInvoiceReceiptContract> >(invReceiptJson);
         foreach (SelInvoiceReceiptContract invReceipt in invReceipts)
         {
             invReceipt.Receiptid = receiptId;
             invDT.Update(new string[] { " TotalDebt" }, new string[] { " TotalDebt-" + invReceipt.Total }, " ID=" + invReceipt.Invoiceid);
             invReceiptDT.Insert(invReceipt, tran);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }