Exemple #1
0
        // Lists Studies with a given field matching a given value
        public IActionResult Studies(StudyFieldType column, string value)
        {
            SearchStudiesViewModel studiesViewModel = new SearchStudiesViewModel();

            studiesViewModel.Studies = studyData.FindByColumnAndValue(column, value);
            studiesViewModel.Title   = "Studies with " + column + ": " + value;

            return(View(studiesViewModel));
        }
Exemple #2
0
        // Process search submission and display search results
        public IActionResult Results(SearchStudiesViewModel studiesViewModel)
        {
            if (studiesViewModel.Column.Equals(StudyFieldType.All) || studiesViewModel.Value.Equals(""))
            {
                studiesViewModel.Studies = studyData.FindByValue(studiesViewModel.Value);
            }
            else
            {
                studiesViewModel.Studies = studyData.FindByColumnAndValue(studiesViewModel.Column, studiesViewModel.Value);
            }

            studiesViewModel.Title = "Search";

            return(View("Index", studiesViewModel));
        }