private void addEmployee_Click(object sender, EventArgs e) { AddEditEmployeeForm f = new AddEditEmployeeForm(trainingGroupsManager); if (f.ShowDialog() == DialogResult.OK) { UpdateEmployeeDataGrid(); } }
private void editEmployeeButton_Click(object sender, EventArgs e) { if (employeesDataGrid.SelectedRows.Count == 0) { MessageBox.Show("Сотрудник не выбран."); return; } AddEditEmployeeForm f = new AddEditEmployeeForm(trainingGroupsManager, trainingGroupsManager.GetEmpById( Convert.ToInt32(employeesDataGrid.SelectedRows[0].Cells[0].Value))); if (f.ShowDialog() == DialogResult.OK) { UpdateEmployeeDataGrid(); } }