private void AddSubordinatedSection(DataGridView parentGrid, HierarchyLevel level) { frmAddSection addSection = new frmAddSection(Convert.ToInt32(parentGrid.SelectedRows[0].Cells[0].Value), level); addSection.ShowDialog(); RefreshGrids(); }
private void btnAddCompany_Click(object sender, EventArgs e) { frmAddSection addSection = new frmAddSection(null, HierarchyLevel.Company); addSection.ShowDialog(); GridContent(dgwCompany, _sectionManagerViewModel.GetCompanies()); RefreshGrids(); }
private void EditCompany(DataGridView gridToEdit) { ModelSection sectionForEdit = new ModelSection(); sectionForEdit.Id = Convert.ToInt32(gridToEdit.SelectedRows[0].Cells[0].Value); sectionForEdit.Name = (gridToEdit.SelectedRows[0].Cells[1].Value).ToString(); sectionForEdit.Code = (gridToEdit.SelectedRows[0].Cells[2].Value).ToString(); frmAddSection addSection = new frmAddSection(sectionForEdit); addSection.ShowDialog(); RefreshGrids(); }