コード例 #1
0
        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();
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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();
        }