public override void OnEnter() { if (ViewBag?.Inspection == null) { MessageBox.Show("Er is geen inspectie geselecteerd!"); _router.GoBack(); return; } _inspection = ViewBag.Inspection; var employees = _inspection.InspectionInspectors?.Select(x => x.Employee).ToList() ?? new List <Employee>(); SelectedInspectors.Clear(); UnSelectedInspectors.Clear(); _userRepository.All().ForEach(UnSelectedInspectors.Add); UnSelectedInspectors .Where(x => employees.Contains(x)).ToList() .ForEach(x => { SelectedInspectors.Add(x); UnSelectedInspectors.Remove(x); }); }
private void Add() { if (SelectedEmployee == null) { return; } SelectedInspectors.Add(SelectedEmployee); Inspectors.Remove(SelectedEmployee); SelectedEmployee = null; }
private void Add() { SelectedInspectors.Add(UnSelectedInspector); UnSelectedInspectors.Remove(UnSelectedInspector); UnSelectedInspector = null; }