private void btnEdit_Click(object sender, EventArgs e) { if (lbEmployees.SelectedIndex == -1) { return; } var newEmployee = EditEmployee((Employee)lbEmployees.SelectedItem); if (newEmployee == null) { return; } _employeeFacade.Edit(newEmployee); RebuildList(); }