예제 #1
0
        public static string GetImportInvoiceCode()
        {
            BuyImportinvoiceDT importInvoiceDT = new BuyImportinvoiceDT();
            string             mmyy            = getMMyy();
            DataTable          invoiceTable    = importInvoiceDT.GetByCond("Code like 'PN" + mmyy + "%'", " Code DESC");
            string             prefix          = "PN" + mmyy;
            string             suffix          = "0001";

            if (invoiceTable != null && invoiceTable.Rows.Count > 0)
            {
                suffix = getSuffix(invoiceTable.Rows[0]["Code"].ToString());
            }
            return(prefix + suffix);
        }
예제 #2
0
 void SaveImportPayment(int moneyslipId, string invPaymentJson, SqlTransaction tran)
 {
     try
     {
         BuyImportinvoiceDT imporInvDT = new BuyImportinvoiceDT();
         List <FinImportpaymentContract> invPayments = JsonConvert.DeserializeObject <List <FinImportpaymentContract> >(invPaymentJson);
         foreach (FinImportpaymentContract invPayment in invPayments)
         {
             invPayment.Moneyslipid = moneyslipId;
             imporInvDT.Update(new string[] { " TotalDebt" }, new string[] { " TotalDebt-" + invPayment.Total }, " ID=" + invPayment.Importinvoiceid, tran);
             impPaymentDT.Insert(invPayment, tran);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }