public bool CanExecuteDeleteCommand(Object obj) { if (employeeAreaViewModel.SelectedEmployee != null) { if (socket.CanRemoveEmployee(employeeAreaViewModel.SelectedEmployee) == true) { return(false); } else { return(true); } } else { return(false); } }
public void ExecuteDeleteEmployeeCommand(Object obj) { if (employeeAreaViewModel.SelectedEmployee != null) { if ((socket.CanRemoveEmployee(employeeAreaViewModel.SelectedEmployee) == true)) { MessageBox.Show("Miterbaiter ist noch mit Fahrzeug Verknüpft!"); } } var result = socket.DeleteEmployee(employeeAreaViewModel.SelectedEmployee); if (result == false) { MessageBox.Show("Fehler beim Löschen des Mitarbeiters!"); } parent.restartEmployeeCommand(); }