public void ExecuteNewEmployeeCommand(Object obj) { AddEmployeeController addEmployeeController = App.Container.Resolve <AddEmployeeController>(); Employee employee = addEmployeeController.AddEmployee(socket); if (employee == null) { return; } var result = socket.AddEmployee(employee); if (result == false) { MessageBox.Show("Fehler beim Hinzufügen des Mitarbeiters!"); } parent.restartEmployeeCommand(); }
/////////////////////////////////////////////// ////////////////// EMPLOYEE ///////////////// private void ExecuteNewEmployeeCommand(Object obj) { AddEmployeeController addEmployeeController = new AddEmployeeController(); Employee employee = addEmployeeController.AddEmployee(socket); if (employee == null) { return; } socket.AddEmployee(employee); //Fetch Employees fleetManagementViewModel.ActiveViewModel = new EmployeesViewController().Initialize(); (fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).Employees = new ObservableCollection <Employee>(socket.GetAllEmployees()); (fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).BusinessUnits = socket.GetAllBusinessUnits().ToList(); //Persist Entry State Employees (fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).entryEmployees = (fleetManagementViewModel.ActiveViewModel as EmployeesViewModel).Employees.ToList(); }