Example #1
0
 /// <summary>
 /// Function to fill AgainstOrder combobox
 /// </summary>
 public void AgainstOrderComboFill()
 {
     try
     {
         bool isEveryComboFill = false;
         SalesOrderMasterSP     spSalesOrder      = new SalesOrderMasterSP();
         SalesQuotationMasterSP spQuotationMaster = new SalesQuotationMasterSP();
         DataTable dtblOrderFill = new DataTable();
         if (cmbCashOrParty.SelectedValue.ToString() != null && cmbDeliveryMode.SelectedValue.ToString() != "System.Data.DataRowView")
         {
             cmbOrderNo.Text = string.Empty;
             if (strTypeOfVoucher == "Sales Order")
             {
                 dtblOrderFill = spSalesOrderMaster.GetSalesOrderInvoiceNumberCorrespondingToLedgerId(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), Convert.ToDecimal(cmbDeliveryMode.SelectedValue.ToString()));
                 DataRow dr = dtblOrderFill.NewRow();
                 dr[0] = "0";
                 dr[1] = string.Empty;
                 dtblOrderFill.Rows.InsertAt(dr, 0);
                 cmbOrderNo.DataSource = dtblOrderFill;
                 if (dtblOrderFill.Rows.Count > 0)
                 {
                     cmbOrderNo.DisplayMember = "invoiceNo";
                     cmbOrderNo.ValueMember   = "salesOrderMasterId";
                     cmbOrderNo.SelectedIndex = 0;
                 }
             }
             else if (strTypeOfVoucher == "Sales Quotation")
             {
                 dtblOrderFill = spQuotationMaster.GetSalesQuotationNumberCorrespondingToLedger(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), Convert.ToDecimal(cmbDeliveryMode.SelectedValue.ToString()));
                 DataRow dr = dtblOrderFill.NewRow();
                 dr[0] = "0";
                 dr[1] = string.Empty;
                 dtblOrderFill.Rows.InsertAt(dr, 0);
                 cmbOrderNo.DataSource = dtblOrderFill;
                 if (dtblOrderFill.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);
     }
 }
Example #2
0
 /// <summary>
 /// Function to fill QuotationNo combobox
 /// </summary>
 public void QuotationNoComboFill()
 {
     try
     {
         DataTable dtbl = new DataTable();
         SalesQuotationMasterSP SPSalesQuotationMaster = new SalesQuotationMasterSP();
         dtbl = SPSalesQuotationMaster.GetQuotationNoCorrespondingtoLedgerForSalesOrderRpt(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()));
         if (dtbl != null)
         {
             cmbQuotationNo.DataSource    = dtbl;
             cmbQuotationNo.DisplayMember = "invoiceNo";
             cmbQuotationNo.ValueMember   = "quotationMasterId";
             DataRow dr = dtbl.NewRow();
             dr["invoiceNo"]         = "All";
             dr["quotationMasterId"] = 0;
             dtbl.Rows.InsertAt(dr, 0);
             cmbQuotationNo.SelectedIndex = 0;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SORP8" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }