/// <summary> /// Function to fill the grid based on the search keys /// </summary> public void GridFill() { try { string strComboText = string.Empty; List<DataTable> listObj = new List<DataTable>(); ProductCreationBll BllProductCreation = new ProductCreationBll(); 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); listObj = BllProductCreation.ProductRegisterSearch(decProductGroup, strProductName, strProductCode, decSize, decModelNo, decBrand, decTax, strTaxApplicable, decSalesRateFrom, decSalesRateTo, strComboText); dgvProductRegister.DataSource = listObj[0]; } catch (Exception ex) { MessageBox.Show("PR7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }