private void InsertOrUpdateTransection(string tranid, string date, string no, string totalamount, string drledgerid, string crledgerid, string transectiontype, string Mode, string BankName, string ChequeNo, string ChequeDate) { string transectionid = tranid; if (mReceiptNoForEdit.ISNullOrWhiteSpace()) { mquery = "Insert into Transection(TransectionID, Date, No, TransectionType, LedgerIdFrom, " + "LedgerIdTo, Amount_Dr,Mode,BankName, ChequeNo, ChequeDate) values('" + transectionid + "','" + date + "','" + no + "','" + transectiontype + "','" + drledgerid + "','" + crledgerid + "'," + totalamount + "," + Mode + "," + BankName + "," + ChequeNo + "," + ChequeDate + ")"; mlistquery.Add(mquery); transectionid = Guid.NewGuid().ToString(); mquery = "Insert into Transection(TransectionID, Date, No, TransectionType, LedgerIdFrom, " + "LedgerIdTo, Amount_Cr,Mode,BankName, ChequeNo, ChequeDate) values('" + transectionid + "','" + date + "','" + no + "','" + transectiontype + "','" + crledgerid + "','" + drledgerid + "'," + totalamount + "," + Mode + "," + BankName + "," + ChequeNo + "," + ChequeDate + ")"; mlistquery.Add(mquery); } else { TransectionTools.GetTransectionId(no, transectiontype); mquery = "Update Transection Set Date='" + date + "',LedgerIdFrom='" + drledgerid + "', " + "LedgerIdTo='" + crledgerid + "', Amount_Dr=" + totalamount + ",Mode=" + Mode + ",bankname=" + BankName + ",ChequeNo=" + ChequeNo + ",ChequeDate=" + ChequeDate + " where TransectionID='" + TransectionTools._mTransectionIdList[0] + "'"; mlistquery.Add(mquery); mquery = "Update Transection Set Date='" + date + "',LedgerIdFrom='" + crledgerid + "', " + "LedgerIdTo='" + drledgerid + "', Amount_Cr=" + totalamount + ",Mode=" + Mode + ",bankname=" + BankName + ",ChequeNo=" + ChequeNo + ",ChequeDate=" + ChequeDate + " where TransectionID='" + TransectionTools._mTransectionIdList[1] + "'"; mlistquery.Add(mquery); } }
private void InsertOrUpdateTransection(string date, string no, double totalamount, string drledgerid, string crledgerid, string transectiontype, string chequeNo, string chequeDate, string transectionMode, string narration) { string transectionid = Guid.NewGuid().ToString(); string query = ""; if (mSlNoEdit.ISNullOrWhiteSpace()) { query = "Insert into Transection(TransectionID, Date, No, TransectionType, LedgerIdFrom, " + "LedgerIdTo, Amount_Dr, Mode, ChequeNo, ChequeDate,Narration) values('" + transectionid + "','" + date + "','" + no + "','" + transectiontype + "','" + drledgerid + "','" + crledgerid + "'," + totalamount + ",'" + transectionMode + "','" + chequeNo + "','" + chequeDate + "','" + narration + "')"; mLstQuery.Add(query); transectionid = Guid.NewGuid().ToString(); query = "Insert into Transection(TransectionID, Date, No, TransectionType, LedgerIdFrom, " + "LedgerIdTo, Amount_Cr, Mode, ChequeNo, ChequeDate,Narration) values('" + transectionid + "','" + date + "','" + no + "','" + transectiontype + "','" + crledgerid + "','" + drledgerid + "'," + totalamount + ",'" + transectionMode + "','" + chequeNo + "','" + chequeDate + "','" + narration + "')"; mLstQuery.Add(query); } else { TransectionTools.GetTransectionId(mSlNoEdit, transectiontype); query = "Update Transection Set Date='" + date + "',LedgerIdFrom='" + drledgerid + "', " + "LedgerIdTo='" + crledgerid + "', Amount_Dr=" + totalamount + ",Mode='" + transectionMode + "',ChequeNo='" + chequeNo + "',ChequeDate='" + chequeDate + "',Narration='" + narration + "' where TransectionID='" + TransectionTools._mTransectionIdList[0] + "'"; mLstQuery.Add(query); query = "Update Transection Set Date='" + date + "',LedgerIdFrom='" + crledgerid + "', " + "LedgerIdTo='" + drledgerid + "', Amount_Cr=" + totalamount + ",Mode='" + transectionMode + "',ChequeNo='" + chequeNo + "',ChequeDate='" + chequeDate + "',Narration='" + narration + "' where TransectionID='" + TransectionTools._mTransectionIdList[1] + "'"; mLstQuery.Add(query); } }
private void AdvancePaymentDataRetrive() { string query = "select * from AdvancePayment where PaymentNo='" + mReceiptNoForEdit + "'"; DataTable dt = SQLHelper.GetInstance().ExcuteNonQuery(query, out msg); if (dt.IsValidDataTable()) { lblreceiptNo.Text = mReceiptNoForEdit; string ledgerid = dt.Rows[0]["LedgerId"].ToString(); mLedgerId = ledgerid; string suppliername = ""; Supplier._DicSuppliers.TryGetValue(ledgerid, out suppliername); lblSupplierName.Text = suppliername; dtpAdvPaymentDate.Text = dt.Rows[0]["PaymentDate"].ToString(); string orderno = dt.Rows[0]["OrderNo"].ToString(); lblOrderNo.Text = orderno; mOrderNofromAdvReceipt = orderno; string orderDate = dt.Rows[0]["OrderDate"].ToString(); lblOrderate.Text = orderDate.ISNullOrWhiteSpace() ? "" : DateTime.Parse(orderDate).ToString("dd-MMM-yyyy"); string itemId = dt.Rows[0]["ItemId"].ToString(); string itemName = dt.Rows[0]["ItemName"].ToString(); string comodityCode = dt.Rows[0]["ComodityCode"].ToString(); string qty = dt.Rows[0]["Qty"].ToString(); string unit = dt.Rows[0]["Unit"].ToString(); string rate = dt.Rows[0]["Rate"].ToString(); string taxValue = dt.Rows[0]["TaxValue"].ToString(); mcgstrate = dt.Rows[0]["CGSTRate"].ToString(); string cGSTAmount = dt.Rows[0]["CGSTAmount"].ToString(); msgstrate = dt.Rows[0]["SGSTRate"].ToString(); string sGSTAmount = dt.Rows[0]["SGSTAmount"].ToString(); migstrate = dt.Rows[0]["IGSTRate"].ToString(); string iGSTAmount = dt.Rows[0]["IGSTAmount"].ToString(); mcessrate = dt.Rows[0]["CessRate"].ToString(); string cessAmount = dt.Rows[0]["CessAmount"].ToString(); string totalGst = dt.Rows[0]["TotalGst"].ToString(); txtDescription.Text = dt.Rows[0]["Description"].ToString(); string total = dt.Rows[0]["Total"].ToString(); if (orderno.ISNullOrWhiteSpace()) { pnlorder.Hide(); pnlGst.Show(); double cgstrate = 0, sgstrate = 0; double.TryParse(mcgstrate, out cgstrate); double.TryParse(msgstrate, out sgstrate); cmbGstRate.Text = !migstrate.ISNullOrWhiteSpace() ? migstrate : (cgstrate + sgstrate).ToString(); } lblTotaltaxbleValue.Text = taxValue; lblTotalGstValue.Text = totalGst; lblTotalReceiptVoucherValue.Text = total; txtAdvanceAmount.Text = total; GetCustomerAddressDetails(ledgerid); GetCustomerShippedDetails(ledgerid); mTransectionID = dt.Rows[0]["LastTransecetionID"].ToString(); mTotalPreviousPayment = double.Parse(dt.Rows[0]["Total"].ToString()); TransectionTools.GetPaymentDetailsId(mTransectionID); cmbPaymentMethod.Text = TransectionTools._PaymentMethod; cmbPaymentAccount.Text = TransectionTools._CRAccountTemplateName; txtChequeNo.Text = TransectionTools._ChequeNo; dtpDateCheque.Text = TransectionTools._ChequeDate; cmbPaymentAccount_SelectedIndexChanged(null, null); dgvItemList.Rows.Clear(); dgvItemList.Rows.Add(1, itemId, itemName, comodityCode, qty, unit, rate, "", "", "", taxValue, mcgstrate, cGSTAmount, msgstrate, sGSTAmount, migstrate, iGSTAmount , mcessrate, cessAmount, total); } }