// Lists Jobs with a given field matching a given value public IActionResult Jobs(JobFieldType column, string value) { SearchJobsViewModel jobsViewModel = new SearchJobsViewModel(); jobsViewModel.Jobs = jobData.FindByColumnAndValue(column, value); jobsViewModel.Title = "Jobs with " + column + ": " + value; return(View(jobsViewModel)); }
// Process search submission and display search results public IActionResult Results(SearchJobsViewModel jobsViewModel) { // if (ModelState.IsValid) if (jobsViewModel.Value == null) { jobsViewModel.Value = " "; } if (jobsViewModel.Column.Equals(JobFieldType.All) || jobsViewModel.Value.Equals("")) { jobsViewModel.Jobs = jobData.FindByValue(jobsViewModel.Value); } else { jobsViewModel.Jobs = jobData.FindByColumnAndValue(jobsViewModel.Column, jobsViewModel.Value); } jobsViewModel.Title = "Search"; return(View("Index", jobsViewModel)); }