/// <summary> /// Function to fill the Product combobox /// </summary> public void ProductNameComboFill() { try { ProductSP spproduct = new ProductSP(); DataTable dtblProductName = new DataTable(); dtblProductName = spproduct.ProductViewAllForComboBox(); DataRow dr = dtblProductName.NewRow(); dr["ProductName"] = "All"; dr["ProductId"] = 0; dtblProductName.Rows.InsertAt(dr, 0); cmbProductName.DataSource = dtblProductName; cmbProductName.ValueMember = "productId"; cmbProductName.DisplayMember = "productName"; } catch (Exception ex) { MessageBox.Show("SER:2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Funtion to fill produdct combobox /// </summary> public void ProductComboFill() { try { ProductSP spProduct = new ProductSP(); DataTable dtblProduct = new DataTable(); dtblProduct = spProduct.ProductViewAllForComboBox(); cmbProduct.DataSource = dtblProduct; cmbProduct.ValueMember = "productId"; cmbProduct.DisplayMember = "productName"; } catch (Exception ex) { MessageBox.Show("B4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }