예제 #1
0
        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();
        }
예제 #2
0
        ///////////////////////////////////////////////
        //////////////////  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();
        }