コード例 #1
0
 /// <summary>
 /// Against Sales order combofill function
 /// </summary>
 public void againstOrderComboFill()
 {
     try
     {
         SalesOrderBll bllSalesOrder = new SalesOrderBll();
         //DeliveryNoteMasterSP spDeliveryNoteMasterSp = new DeliveryNoteMasterSP();
         DeliveryNoteBll bllDeliveryNote = new DeliveryNoteBll();
         SalesQuotationBll bllSalesQuotation = new SalesQuotationBll();
         List<DataTable> Listobj = new List<DataTable>();
         if (cmbCashOrParty.SelectedValue != null)
         {
             if (cmbSalesMode.Text == "Against SalesOrder")
             {
                 Listobj = bllSalesOrder.GetSalesOrderNoIncludePendingCorrespondingtoLedgerforSI(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), decSalesInvoiceIdToEdit, Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()));
                 DataRow dr = Listobj[0].NewRow();
                 dr["invoiceNo"] = "";
                 dr["salesOrderMasterId"] = 0;
                 Listobj[0].Rows.InsertAt(dr, 0);
                 isFromEditMode = true;
                 cmbSalesModeOrderNo.DataSource = Listobj[0];
                 cmbSalesModeOrderNo.ValueMember = "salesOrderMasterId";
                 cmbSalesModeOrderNo.DisplayMember = "invoiceNo";
                 isFromEditMode = false;
             }
             if (cmbSalesMode.Text == "Against Delivery Note")
             {
                 List<DataTable> listObj = new List<DataTable>();
                 listObj = bllDeliveryNote.GetDeleveryNoteNoIncludePendingCorrespondingtoLedgerForSI(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), decSalesInvoiceIdToEdit, Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()));
                 DataRow dr = listObj[0].NewRow();
                 dr["invoiceNo"] = "";
                 dr["deliveryNoteMasterId"] = 0;
                 listObj[0].Rows.InsertAt(dr, 0);
                 isFromEditMode = true;
                 cmbSalesModeOrderNo.DataSource = listObj[0];
                 cmbSalesModeOrderNo.ValueMember = "deliveryNoteMasterId";
                 cmbSalesModeOrderNo.DisplayMember = "invoiceNo";
                 isFromEditMode = false;
             }
             if (cmbSalesMode.Text == "Against Quotation")
             {
                 List<DataTable> listObj = new List<DataTable>();
                 listObj = bllSalesQuotation.GetSalesQuotationIncludePendingCorrespondingtoLedgerForSI(Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), decSalesInvoiceIdToEdit, Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()));
                 DataRow dr = listObj[0].NewRow();
                 dr["invoiceNo"] = "";
                 dr["quotationMasterId"] = 0;
                 listObj[0].Rows.InsertAt(dr, 0);
                 isFromEditMode = true;
                 cmbSalesModeOrderNo.DataSource = listObj[0];
                 cmbSalesModeOrderNo.ValueMember = "quotationMasterId";
                 cmbSalesModeOrderNo.DisplayMember = "invoiceNo";
                 isFromEditMode = false;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SI: 13" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }