private void btnAdd_Click(object sender, EventArgs e) { var addEditEmployee = new AddEditEmployee(); addEditEmployee.FormClosing += AddEditEmployee_FormClosing; addEditEmployee.ShowDialog(); }
private void DismissalEmployee(int id) { var employees = _fileHelper.DeserializeFromFile(); AddEditEmployee employee = new AddEditEmployee(); employee.AddNewEmployeeToList(employees, id); }
private void btnEdit_Click(object sender, EventArgs e) { if (dvgEmployes.SelectedRows.Count == 0) { MessageBox.Show("Proszę zaznacz pracownika, którego dane chcesz edytować"); } var addEditEmployee = new AddEditEmployee( Convert.ToInt32(dvgEmployes.SelectedRows[0].Cells[0].Value)); addEditEmployee.FormClosing += AddEditEmployee_FormClosing; addEditEmployee.ShowDialog(); }