private void addEmployeeButton_Click(object sender, EventArgs e) { EmployeeBox employeeBox = new EmployeeBox(employees); employeeBox.LoadEmployeePositions(positions); employeeBox.ShowDialog(); dataGridView.Refresh(); }
private void editEmployeeToolStripMenuItem_Click(object sender, EventArgs e) { if (dataGridView.SelectedRows.Count != 0) { DataGridViewRow currentRow = dataGridView.CurrentRow; string firstName = currentRow.Cells[1].Value.ToString(); string lastName = currentRow.Cells[2].Value.ToString(); EmployeeBox employeeBox = new EmployeeBox(employees, firstName, lastName); employeeBox.LoadEmployeePositions(positions); employeeBox.ShowDialog(); return; } MessageBox.Show("You must have an employee selected"); }