/// <summary> /// Function to fill GroupUnderComboBox /// </summary> public void ProductGroupUnderComboFill() { try { ProductGroupSP spProductGroup = new ProductGroupSP(); DataTable dtbl = new DataTable(); dtbl = spProductGroup.ProductGroupViewForComboFillForProductGroup(); cmbUnder.DataSource = dtbl; cmbUnder.ValueMember = "GroupId"; cmbUnder.DisplayMember = "GroupName"; } catch (Exception ex) { formMDI.infoError.ErrorString = "PG1:" + ex.Message; } }
/// <summary> /// Function to fill the fields to edit or delete /// </summary> private void FillControls() { try { ProductGroupInfo infoProductGroup = new ProductGroupInfo(); ProductGroupSP spProductGroup = new ProductGroupSP(); infoProductGroup = spProductGroup.ProductGroupView(decId); txtProductGroupName.Text = infoProductGroup.GroupName; DataTable dtbl = new DataTable(); dtbl = spProductGroup.ProductGroupViewForComboFillForProductGroup(); cmbUnder.DataSource = dtbl; foreach (DataRow dr in dtbl.Rows) { if (dr["GroupName"].ToString() == txtProductGroupName.Text) { dr.Delete(); } } cmbUnder.ValueMember = "GroupId"; cmbUnder.DisplayMember = "GroupName"; cmbUnder.SelectedValue = infoProductGroup.GroupUnder; if (spProductGroup.ProductGroupCheckExistenceOfUnderGroup(decId) == false) { cmbUnder.Enabled = false; } else { cmbUnder.Enabled = true; } txtNarration.Text = infoProductGroup.Narration; } catch (Exception ex) { formMDI.infoError.ErrorString = "PG9:" + ex.Message; } }