Beispiel #1
0
        /// <summary>
        /// Function to fill VoucherNo combobox
        /// </summary>
        public void VoucherNoComboFill()
        {
            decimal   decVoucherTypeId = 0;
            DataTable dtbl             = new DataTable();

            try
            {
                if (cmbVoucherType.SelectedIndex > -1)
                {
                    if (cmbVoucherType.SelectedValue.ToString() != "System.Data.DataRowView" && cmbVoucherType.Text != "System.Data.DataRowView")
                    {
                        decVoucherTypeId = Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString());
                        dtbl             = spSalesDetails.voucherNoViewAllByVoucherTypeIdForSi(decVoucherTypeId);
                        DataRow drow = dtbl.NewRow();
                        drow["invoiceNo"] = "All";
                        dtbl.Rows.InsertAt(drow, 0);
                        cmbVoucherNo.DataSource    = dtbl;
                        cmbVoucherNo.DisplayMember = "invoiceNo";
                    }
                }
            }
            catch (Exception ex)
            {
                formMDI.infoError.ErrorString = "SIREG5:" + ex.Message;
            }
        }
        /// <summary>
        /// Function to fill VoucherNo combobox
        /// </summary>
        public void VoucherNoComboFill()
        {
            decimal   decVoucherTypeId = 0;
            DataTable dtbl             = new DataTable();

            try
            {
                if (cmbVoucherType.SelectedIndex > -1)
                {
                    if (cmbVoucherType.SelectedValue.ToString() != "System.Data.DataRowView" && cmbVoucherType.Text != "System.Data.DataRowView")
                    {
                        decVoucherTypeId = Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString());
                        dtbl             = spSalesDetails.voucherNoViewAllByVoucherTypeIdForSi(decVoucherTypeId);
                        DataRow drow = dtbl.NewRow();
                        drow["invoiceNo"] = "All";
                        dtbl.Rows.InsertAt(drow, 0);
                        cmbVoucherNo.DataSource    = dtbl;
                        cmbVoucherNo.DisplayMember = "invoiceNo";
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("SIR :5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }