/// <summary> /// Function to fill AgainstOrder combobox /// </summary> public void AgainstOrderComboFill() { try { bool isEveryComboFill = false; SalesOrderBll bllSalesOrder = new SalesOrderBll(); SalesQuotationBll bllQuotation = new SalesQuotationBll(); List <DataTable> ListObj = new List <DataTable>(); if (cmbCashOrParty.SelectedValue.ToString() != null && cmbDeliveryMode.SelectedValue.ToString() != "System.Data.DataRowView") { cmbOrderNo.Text = string.Empty; if (strTypeOfVoucher == "Sales Order") { ListObj = bllSalesOrder.GetSalesOrderInvoiceNumberCorrespondingToLedgerId(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), Convert.ToDecimal(cmbDeliveryMode.SelectedValue.ToString())); DataRow dr = ListObj[0].NewRow(); dr[0] = "0"; dr[1] = string.Empty; ListObj[0].Rows.InsertAt(dr, 0); cmbOrderNo.DataSource = ListObj[0]; if (ListObj[0].Rows.Count > 0) { cmbOrderNo.DisplayMember = "invoiceNo"; cmbOrderNo.ValueMember = "salesOrderMasterId"; cmbOrderNo.SelectedIndex = 0; } } else if (strTypeOfVoucher == "Sales Quotation") { ListObj = bllQuotation.GetSalesQuotationNumberCorrespondingToLedger(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), Convert.ToDecimal(cmbDeliveryMode.SelectedValue.ToString())); DataRow dr = ListObj[0].NewRow(); dr[0] = "0"; dr[1] = string.Empty; ListObj[0].Rows.InsertAt(dr, 0); cmbOrderNo.DataSource = ListObj[0]; if (ListObj[0].Rows.Count > 0) { cmbOrderNo.DisplayMember = "invoiceNo"; cmbOrderNo.ValueMember = "quotationMasterId"; } } else { GridFill(); } } isEveryComboFill = true; } catch (Exception ex) { MessageBox.Show("DNREP06: " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill QuotationNo combobox /// </summary> public void QuotationNoComboFill() { try { List <DataTable> ListObj = new List <DataTable>(); SalesQuotationBll bllSalesQuotation = new SalesQuotationBll(); ListObj = bllSalesQuotation.GetQuotationNoCorrespondingtoLedgerForSalesOrderRpt(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString())); if (ListObj != null) { cmbQuotationNo.DataSource = ListObj[0]; cmbQuotationNo.DisplayMember = "invoiceNo"; cmbQuotationNo.ValueMember = "quotationMasterId"; DataRow dr = ListObj[0].NewRow(); dr["invoiceNo"] = "All"; dr["quotationMasterId"] = 0; ListObj[0].Rows.InsertAt(dr, 0); cmbQuotationNo.SelectedIndex = 0; } } catch (Exception ex) { MessageBox.Show("SORP8" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }