Esempio n. 1
0
        /// <summary>
        /// Function to fill the grid based on the search keys
        /// </summary>
        public void GridFill()
        {
            try
            {
                string strComboText = string.Empty;
                DataTable dtbl = new DataTable();
                ProductSP spProduct = new ProductSP();
                ProductInfo infoProduct = new ProductInfo();
                if (cmbActive.Text == "Yes")
                {
                    strComboText = "True";
                }
                else if (cmbActive.Text == "No")
                {
                    strComboText = "False";
                }
                else
                {
                    cmbActive.SelectedIndex = 0;
                    strComboText = "All";
                }
                if (txtSalesRateFrom.Text == string.Empty && txtSalesRateTo.Text == string.Empty)
                {
                    txtSalesRateFrom.Text = "0";
                    txtSalesRateTo.Text = "0";
                }
                decimal decProductGroup = Convert.ToDecimal(cmbProductGroup.SelectedValue);
                string strProductName = txtProductName.Text.Trim();
                string strProductCode = txtProductCode.Text.Trim();
                decimal decSize = Convert.ToDecimal(cmbSize.SelectedValue);
                decimal decModelNo = Convert.ToDecimal(cmbModelNo.SelectedValue);
                decimal decBrand = Convert.ToDecimal(cmbBrand.SelectedValue);
                decimal decTax = Convert.ToDecimal(cmbTax.SelectedValue);
                string strTaxApplicable = cmbTaxApplicableOn.Text.Trim();
                decimal decSalesRateFrom = Convert.ToDecimal(txtSalesRateFrom.Text);
                decimal decSalesRateTo = Convert.ToDecimal(txtSalesRateTo.Text);

                dtbl = spProduct.ProductRegisterSearch(decProductGroup, strProductName, strProductCode, decSize, decModelNo, decBrand, decTax, strTaxApplicable, decSalesRateFrom, decSalesRateTo, strComboText);

                dgvProductRegister.DataSource = dtbl;
            }
            catch (Exception ex)
            {
                MessageBox.Show("PR7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }