public static string GetReceiveProductCode() { SelReceiveproductDT receiveProductDT = new SelReceiveproductDT(); string mmyy = getMMyy(); DataTable invoiceTable = receiveProductDT.GetByCond("Code like 'KT" + mmyy + "%'", " Code DESC"); string prefix = "KT" + mmyy; string suffix = "0001"; if (invoiceTable != null && invoiceTable.Rows.Count > 0) { suffix = getSuffix(invoiceTable.Rows[0]["Code"].ToString()); } return(prefix + suffix); }
void SaveSuppReceipt(int moneyslipId, string invPaymentJson, SqlTransaction tran) { try { SelReceiveproductDT rcvProductDT = new SelReceiveproductDT(); List <FinReceivepaymentContract> rcvPayments = JsonConvert.DeserializeObject <List <FinReceivepaymentContract> >(invPaymentJson); foreach (FinReceivepaymentContract rcvPayment in rcvPayments) { rcvPayment.Moneyslipid = moneyslipId; rcvProductDT.Update(new string[] { " TotalReturn" }, new string[] { " TotalReturn-" + rcvPayment.Total }, " ID=" + rcvPayment.Receiveproductid); revPaymentDT.Insert(rcvPayment, tran); } } catch (Exception e) { throw e; } }