private void e_EditBtn_Click(object sender, EventArgs e) { CEmployee tmpEmployee = e_EmployeesList.SelectedItem as CEmployee; employeeForm newForm = new employeeForm(); newForm.Text = "Editing " + tmpEmployee.name + " " + tmpEmployee.lastName; newForm.employee = tmpEmployee; newForm.edit = true; if (newForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { e_employees[e_EmployeesList.SelectedIndex] = newForm.employee; fillE_EmployeesList(); e_EmployeesList.SelectedItem = newForm.employee; } }
private void e_AddBtn_Click(object sender, EventArgs e) { employeeForm newForm = new employeeForm(); newForm.Text = "Add New Employee"; newForm.edit = false; if (newForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { e_employees.Add(newForm.employee); fillE_EmployeesList(); e_EmployeesList.SelectedItem = newForm.employee; } }