Exemplo n.º 1
0
        /// <summary>
        /// Function to fill InvoiceNo combobox
        /// </summary>
        public void InvoiceNoComboFill()
        {
            decimal decLedgerId  = 0;
            decimal decVoucherId = 0;

            try
            {
                DataTable dtbl = new DataTable();
                decLedgerId  = (cmbCashOrParty.SelectedIndex == 0 || cmbCashOrParty.SelectedIndex == -1) ? -1 : Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString());
                decVoucherId = (cmbVoucherType.SelectedIndex == 0 || cmbVoucherType.SelectedIndex == -1) ? -1 : Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString());
                dtbl         = spPurchaseReturnMaster.GetInvoiceNoCorrespondingtoLedgerForPurchaseReturnReport(decLedgerId, decVoucherId);
                if (dtbl != null)
                {
                    cmbInvoiceNo.DataSource    = dtbl;
                    cmbInvoiceNo.DisplayMember = "invoiceNo";
                    cmbInvoiceNo.ValueMember   = "purchaseMasterId";
                    DataRow dr = dtbl.NewRow();
                    dr["purchaseMasterId"] = 0;
                    dr["invoiceNo"]        = "All";
                    dtbl.Rows.InsertAt(dr, 0);
                    cmbInvoiceNo.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PRRT:03" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }