Пример #1
0
        private void Save()
        {
            var iiList = new List <InspectionInspector>();

            foreach (var e in SelectedInspectors)
            {
                var ii = new InspectionInspector
                {
                    Employee    = _userRepository.Find(e.ID),
                    Inspection  = _inspectionRepository.Find(_inspection.ID),
                    LastUpdated = DateTime.Now
                };
                e.InspectionInspectors.Add(ii);
                _userRepository.Update(e);
                iiList.Add(ii);
            }
            _inspection.InspectionInspectors = iiList;

            _inspectionRepository.Update(_inspection);

            MessageBox.Show("De wijzigingen zijn opgeslagen!");
            _router.GoBack();
        }