Ejemplo n.º 1
0
        private void OnAddPersonExecute()
        {
            Person personToAdd = SelectedAvailablePerson;

            Meeting.Model.Persons.Add(personToAdd);
            AddedPersons.Add(personToAdd);
            AvailablePersons.Remove(personToAdd);
            HasChanges = _meetingRepository.HasChanges();
            ((DelegateCommand)SaveCommand).RaiseCanExecuteChanged();
        }
Ejemplo n.º 2
0
        private void SetupPicklist()
        {
            List <int> meetingPersonIds = Meeting.Model.Persons.Select(p => p.Id).ToList();
            var        addedPersons     = _allPersons.Where(x => meetingPersonIds.Contains(x.Id)).OrderBy(p => p.FirstName);
            var        availablePersons = _allPersons.Except(addedPersons).OrderBy(p => p.FirstName);

            AddedPersons.Clear();
            AvailablePersons.Clear();
            foreach (var addedPerson in addedPersons)
            {
                AddedPersons.Add(addedPerson);
            }
            foreach (var availablePerson in availablePersons)
            {
                AvailablePersons.Add(availablePerson);
            }
        }