public void DeletedEmployeeExecute() { try { if (Employed != null) { Service.Service s = new Service.Service(); int employeeID = AllEmployeeV.EmployeeID; string message = "Deleted employee: " + AllEmployeeV.Surname; bool isEmployee = s.IsEmployeeID(employeeID); if (isEmployee == true) { s.DeleteEmployee(employeeID); Employed = s.GetAllEmployee().ToList(); } else { MessageBox.Show("Unable to delete employee"); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }