Exemplo n.º 1
0
        public ViewResult Index(IndexViewModel model)
        {
            model.Languages = this.languageRepository.All.ToSelectListItems("<All languages>");
            model.Disciplines = this.subjectRepository.All.ToSelectListItems("<All disciplines>");
            model.Journals = this.journalRepository.Search(model.ToFilter());

            return this.View(model);
        }
Exemplo n.º 2
0
        public ActionResult Index(IndexViewModel model)
        {
            try
            {
                model.Disciplines = NormalizeSearchStrings(model.Disciplines);
                model.Languages = NormalizeSearchStrings(model.Languages);
                model.Journals = _userJournalRepository.Search(model.ToFilter(Authentication.CurrentUserId));
            }
            catch (Exception exception)
            {
                ModelState.AddModelError("", exception);
            }

            return View("JournalsIndex", model);
        }