public void LoadAllCounter() { try { DGVCounter.DataSource = objCounterServicel.GetAllCounters(); DGVCounter.Columns[2].Visible = false; DGVCounter.Columns[3].ReadOnly = true; } catch (Exception exp) { MessageBox.Show(exp.Message, "Exception Error"); } }
private void AddMenuItems_Load(object sender, EventArgs e) { try { LoadAllTables(); ComboBoxCategory.DataSource = objMenuCatogeryServicel.GetAllMenuCatogery(); ComboBoxCategory.ValueMember = "id"; ComboBoxCategory.DisplayMember = "name"; catogeryName = ComboBoxCategory.SelectedText; ComboBoxSection.DataSource = objCounterServicel.GetAllCounters(); ComboBoxSection.ValueMember = "id"; ComboBoxSection.DisplayMember = "sectionname"; sectionName = ComboBoxSection.SelectedText; } catch (Exception exp) { MessageBox.Show(exp.Message, "Exception Error In Loading Form"); } }