private void GetSupplierDetails() { string query = "SELECT Ledgers.*,LadgerMain.GSTIN,GSTRegistrationType FROM LadgerMain " + "inner join Ledgers on LadgerMain.LadgerID=Ledgers.LedgerID " + "where LedgerID='" + mSupplierLadgerID + "' and Category='Supplier'"; DataTable dt = SQLHelper.GetInstance().ExcuteNonQuery(query, out msg); if (dt.IsValidDataTable()) { string supplierName = dt.Rows[0]["LedgerName"].ToString(); string address = dt.Rows[0]["Address"].ToString(); string town = dt.Rows[0]["City_Town"].ToString(); string dist = dt.Rows[0]["Dist"].ToString(); string state = dt.Rows[0]["State"].ToString(); string statecode = StateTool._DicState.FirstOrDefault(x => x.Value == state).Key.ToString(); string pin = dt.Rows[0]["PinCode"].ToString(); string gsttype = dt.Rows[0]["GSTRegistrationType"].ToString(); string gstin = dt.Rows[0]["GSTIN"].ToString(); string bilingtermname = ""; int day = BillingTermTools.GetBillingTermsAndDueDay(mSupplierLadgerID, out bilingtermname); mGstType = gsttype; if (mGstType == "Unregister") { mIsRcm = "Yes"; } } }
///Billing Terms /// private void BillingTermAndDueDate(string ledgerID) { string terms = ""; int dueDays = BillingTermTools.GetBillingTermsAndDueDay(ledgerID, out terms); cmbBillingTerms.Text = terms; dtpDueDate.Value = dtpInvoiceDate.Value.Date.AddDays(dueDays); }
private void Datasave() { string termname = txtTermName.Text.GetDBFormatString(); string days = txtDays.Text.GetDBFormatString(); string query = "Insert into BillingTerms(TermsName,Days) values('" + termname + "'," + days + ") "; if (!SQLHelper.GetInstance().ExcuteQuery(query, out msg)) { MessageBox.Show("Internally problem", "problem", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { BillingTermTools.GetBillingTerms(); this.Close(); } }