private void EditStaff() { var staffEditForm = new StaffEditForm(SelectedStaff); staffEditForm.ShowDialog(); staffService.UpdateStaff(SelectedStaff); UpdateTableRows(staffs); }
private void addButton_Click(object sender, EventArgs e) { if (staffs == null) { staffs = new List <Staff>(); } StaffEditForm staffEditForm = new StaffEditForm(); staffEditForm.ShowDialog(); if (staffEditForm.staff != null) { var staff = staffService.AddStaff(staffEditForm.staff); staffs.Add(staff); UpdateTableRows(staffs); } }