示例#1
0
        // 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));
        }
示例#2
0
        // 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));
        }