Ejemplo n.º 1
0
        public PeopleViewModel() : this(new EfCoreContext())
        {
            _authorService   = new ListAuthorService(_context);
            _editorService   = new ListEditorService(_context);
            _reviewerService = new ListReviewerService(_context);

            var authors   = _authorService.GetAuthorList().ToList();
            var editors   = _editorService.GetEditorList().ToList();
            var reviewers = _reviewerService.GetReviewerList().ToList();

            AuthorList   = new ObservableCollection <AuthorListDto>(authors);
            EditorList   = new ObservableCollection <EditorListDto>(editors);
            ReviewerList = new ObservableCollection <ReviewerListDto>(reviewers);
        }
Ejemplo n.º 2
0
        private void GoToCreateReviewerWindow()
        {
            _createReviewerWindow             = new CreateReviewerWindow();
            _createReviewerWindow.Owner       = Application.Current.MainWindow;
            _createReviewerWindow.DataContext = new AddReviewerViewModel(new AddReviewerService(_context), new ListAreaOfInterestService(_context));
            _createReviewerWindow.ShowDialog();
            //Refresh DB
            _authorService   = new ListAuthorService(_context);
            _editorService   = new ListEditorService(_context);
            _reviewerService = new ListReviewerService(_context);

            var authors   = _authorService.GetAuthorList().ToList();
            var editors   = _editorService.GetEditorList().ToList();
            var reviewers = _reviewerService.GetReviewerList().ToList();

            AuthorList   = new ObservableCollection <AuthorListDto>(authors);
            EditorList   = new ObservableCollection <EditorListDto>(editors);
            ReviewerList = new ObservableCollection <ReviewerListDto>(reviewers);
        }