public void ExecuteDeleteEmployeeCommand(Object obj) { var emp = employeeAreaViewModel.SelectedEmployee; var result = socket.DeleteEmployee(employeeAreaViewModel.SelectedEmployee); if (result == false) { MessageBox.Show("Fehler beim Löschen des Mitarbeiters!"); } parent.restartEmployeeCommand(); }
private void ExecuteDeleteEmployeeCommand(Object obj) { if ((fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).SelectedEmployee != null) { socket.DeleteEmployee((fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).SelectedEmployee); //Fetch new BusinessAreas fleetManagementViewModel.ActiveViewModel = new BusinessAreasViewController().Initialize(); (fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).Employees = new ObservableCollection <Employee>(socket.GetAllEmployees()); (fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).BusinessUnits = socket.GetAllBusinessUnits().ToList(); //Persist Entry State BusinessAreas (fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).entryEmployees = (fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).Employees.ToList(); } }
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(); }