Esempio n. 1
0
        // TODO #1 - Create a Results action method to process
        // search request and display results
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Dictionary <string, string> > jobs = new List <Dictionary <string, string> >();

            ViewBag.columns = ListController.columnChoices;
            if (searchType.Equals("all"))
            {
                jobs = JobData.FindByValue(searchTerm);
            }
            else
            {
                jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
            }

            ViewBag.jobs = jobs;
            return(View("Index"));
        }
Esempio n. 2
0
        // Process search submission and display search results
        public IActionResult Results(SearchJobsViewModel jobsViewModel)
        {
            if (ModelState.IsValid)
            {
                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));
        }
Esempio n. 3
0
        // TODO #1 - Create a Results action method to process
        // search request and display results

        public IActionResult Results(string searchType, string searchTerm)
        {
            ViewBag.columns = ListController.columnChoices;

            if (searchType == "all")
            {
                List <Dictionary <string, string> > AllJobs = JobData.FindByValue(searchTerm);
                ViewBag.jobs = AllJobs;
            }
            else
            {
                List <Dictionary <string, string> > AllJobs = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.jobs = AllJobs;
            }

            return(View("Index"));
        }
Esempio n. 4
0
        // TODO #3: Create an action method to process a search request and render the updated search view.
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> jobs = new List <Job>();

            if (searchTerm == null)
            {
                jobs = JobData.FindAll();
            }
            else
            {
                jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
            }

            ViewBag.searchResults = jobs;
            ViewBag.columns       = ListController.ColumnChoices;
            return(View("Index"));
        }
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> jobs;

            if (searchType.ToLower().Equals("all"))
            {
                jobs            = JobData.FindByValue(searchTerm);
                ViewBag.results = "Job Search Results";
            }
            else
            {
                jobs            = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.results = "Job Search Results";
            }
            ViewBag.jobs = jobs;
            return(View());
        }
        public IActionResult Results(string searchType, string searchTerm)
        {
            if (searchType == null || searchType == "")
            {
                searchType = "all";
            }
            if (searchTerm == null || searchTerm == "")
            {
                searchTerm = "all";
            }

            ViewBag.columns    = ListController.ColumnChoices;
            ViewBag.jobs       = JobData.FindByColumnAndValue(searchType, searchTerm);
            ViewBag.radioCheck = searchType;

            return(View("index"));
        }
        // TODO #3: Create an action method to process a search request and render the updated search view.
        public IActionResult Results(string searchType, string searchTerm)
        {
            ViewBag.Type = searchType;
            List <Job> jobs;

            if (string.IsNullOrEmpty(searchTerm))
            {
                jobs = JobData.FindAll();
            }
            else
            {
                jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
            }
            ViewBag.columns = ListController.ColumnChoices;
            ViewBag.jobs    = jobs;
            return(View("Index"));
        }
Esempio n. 8
0
        // list jobs by column and value
        public IActionResult Jobs(string column, string value)
        {
            List <Job> jobs;

            if (column.ToLower().Equals("all"))
            {
                jobs          = JobData.FindAll();
                ViewBag.title = "All Jobs";
            }
            else
            {
                jobs          = JobData.FindByColumnAndValue(column, value);
                ViewBag.title = "Jobs with " + ColumnChoices[column] + ": " + value;
            }
            ViewBag.jobs = jobs;
            return(View());
        }
Esempio n. 9
0
        // TODO #3: Create an action method to process a search request and render the updated search view.
        public IActionResult Results(String searchType, String searchTerm)
        {
            List <Job> jobs;

            if (searchTerm == "" || searchTerm == null)
            {
                jobs = JobData.FindAll();
            }
            else
            {
                jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
            }
            ViewBag.title   = "Jobs with " + ListController.ColumnChoices[searchType] + ": " + searchTerm;
            ViewBag.jobs    = jobs;
            ViewBag.columns = ListController.ColumnChoices;
            return(View("Index"));
        }
Esempio n. 10
0
        // TODO #1 - Create a Results action method to process
        // search request and display results

        public IActionResult Results(string searchType, string searchTerm)
        {
            if (searchType == "all" && searchTerm != null)
            {
                ViewBag.jobs = JobData.FindByValue(searchTerm);
            }
            else if (searchType == "all" && searchTerm == null)
            {
                ViewBag.jobs = JobData.FindAll();
            }
            else
            {
                ViewBag.jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
            }
            ViewBag.columns = ListController.columnChoices;
            return(View("Views/Search/Index.cshtml"));
        }
Esempio n. 11
0
 public IActionResult Values(string column)
 {
     if (column.Equals("all"))
     {
         List <Dictionary <string, string> > jobs = JobData.FindByColumnAndValue();
         ViewBag.title = "All Jobs";
         ViewBag.jobs  = jobs;
         return(View("Jobs"));
     }
     else
     {
         List <string> items = JobData.FindAll(column);
         ViewBag.title  = "All " + columnChoices[column] + " Values";
         ViewBag.column = column;
         ViewBag.items  = items;
         return(View());
     }
 }
Esempio n. 12
0
 public IActionResult Results(string searchType, string searchTerm)
 {
     if (ListController.columnChoices.ContainsKey(searchType))
     {
         if (searchType == "all")
         {
             ViewBag.jobs = JobData.FindByValue(searchTerm);
         }
         else
         {
             ViewBag.jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
         }
     }
     ViewBag.columns    = ListController.columnChoices;
     ViewBag.title      = "Search";
     ViewBag.searchType = searchType;
     return(View("Index"));
 }
        // TODO #1 - Create a Results action method to process
        // search request and display results

        public IActionResult Results(string searchTerm, string searchType)
        {
            ViewBag.columns = ListController.columnChoices;
            ViewBag.title   = "Results";

            if (searchType.Equals("all"))
            {
                List <Dictionary <string, string> > jobs = JobData.FindByValue(searchTerm);
                ViewBag.jobs = jobs;
            }
            else
            {
                List <Dictionary <string, string> > jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.jobs = jobs;
            }

            return(View("Views/Search/Index.cshtml"));
        }
Esempio n. 14
0
        public IActionResult Jobs(string column, string value)
        {
            List <Dictionary <String, String> > jobs;

            if (column == "" || column == "name")
            {
                jobs          = JobData.FindByValue(value);
                ViewBag.title = "All jobs: " + value;
            }
            else
            {
                jobs          = JobData.FindByColumnAndValue(column, value);
                ViewBag.title = "Jobs with " + columnChoices[column] + ": " + value;
            }
            ViewBag.jobs   = jobs;
            ViewBag.column = column;
            return(View());
        }
Esempio n. 15
0
        // TODO #1 - Create a Results action method to process
        // search request and display results

        public IActionResult Results(string searchTerm, string searchType)
        {
            ViewBag.columns = ListController.columnChoices;
            if (searchType == "all")
            {
                List <Dictionary <String, String> > jobs = JobData.FindByValue(searchTerm);
                ViewBag.jobs = jobs;
            }
            else
            {
                List <Dictionary <String, String> > jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.jobs = jobs;
            }

            ViewBag.title = "Jobs with " + searchType + ": " + searchTerm;

            return(View("Views/Search/Index.cshtml"));
        }
Esempio n. 16
0
        // TODO #3: Create an action method to process a search request and render the updated search view.
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> floopSearch;

            if (string.IsNullOrEmpty(searchTerm))
            {
                floopSearch = JobData.FindAll();
            }
            else
            {
                floopSearch = JobData.FindByColumnAndValue(searchType, searchTerm);
            }

            ViewBag.Columns = ListController.ColumnChoices;

            ViewBag.Jobs = floopSearch;
            return(View("Index"));
        }
Esempio n. 17
0
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> jobs;

            if (searchTerm == "" || searchTerm == null)
            {
                jobs          = JobData.FindAll();
                ViewBag.title = "All Jobs";
            }
            else
            {
                jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
            }

            ViewBag.jobs    = jobs;
            ViewBag.columns = ListController.ColumnChoices;
            return(View("/Views/Search/Index.cshtml"));
        }
Esempio n. 18
0
        // TODO #1 - Create a Results action method to process
        // search request and display results

        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Dictionary <string, string> > results = new List <Dictionary <string, string> >();

            if (searchType.Equals("all"))
            {
                results = JobData.FindByValue(searchTerm);
            }
            else
            {
                results = JobData.FindByColumnAndValue(searchType, searchTerm);
            }

            ViewBag.jobs       = results;
            ViewBag.searchType = searchType;

            return(View("Index"));
        }
Esempio n. 19
0
        // TODO #3: Create an action method to process a search request and render the updated search view.
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> gigs;

            if (String.IsNullOrEmpty(searchTerm))
            {
                gigs = JobData.FindAll();
            }

            else
            {
                gigs = JobData.FindByColumnAndValue(searchType, searchTerm);
            }
            ViewBag.jobs    = gigs;
            ViewBag.title   = "Jobs with " + searchTerm;
            ViewBag.columns = ListController.ColumnChoices;
            return(View("Index"));
        }
Esempio n. 20
0
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> jobs;

            if (searchTerm == "")
            {
                jobs          = JobData.FindAll();
                ViewBag.title = "All Jobs";
            }
            else
            {
                jobs          = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.title = "Jobs with " + ListController.ColumnChoices[searchType] + ": " + searchTerm;
            }
            ViewBag.jobs = jobs;

            return(View());
        }
Esempio n. 21
0
 // TODO #1 - Create a Results action method to process
 // search request and display results
 public IActionResult Results(string searchType, string searchTerm)
 {
     ViewBag.columns = ListController.columnChoices;
     if (searchType != "all")
     {
         List <Dictionary <string, string> > jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
         ViewBag.jobs  = jobs;
         ViewBag.title = "Results for '" + searchTerm + "' in " + searchType;
         return(View("Index", jobs));
     }
     else
     {
         List <Dictionary <string, string> > jobs = JobData.FindByValue(searchTerm);
         ViewBag.jobs  = jobs;
         ViewBag.title = "Results for '" + searchTerm + "' in All jobs";
         return(View("Index", jobs));
     }
 }
Esempio n. 22
0
        // TODO #3: Create an action method to process a search request and render the updated search view.

        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> jobs;

            if (searchTerm == null || searchTerm.Equals(""))
            {
                jobs          = JobData.FindAll();
                ViewBag.title = "Find all jobs.";
            }
            else
            {
                jobs          = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.title = " Find Jobs with " + searchType + ": " + searchTerm;
            }
            ViewBag.jobs    = jobs;
            ViewBag.columns = ListController.ColumnChoices;
            return(View("Index", ViewBag));
        }
Esempio n. 23
0
        // TODO #1 - Create a Results action method to process
        // search request and display results

        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Dictionary <string, string> > jobs = new List <Dictionary <string, string> >();

            ViewBag.Columns = ListController.columnChoices;
            ViewBag.title   = "Search";

            if (searchType != "all")
            {
                jobs             = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.somejobs = jobs;
                return(View("Index"));
            }

            jobs             = JobData.FindByValue(searchTerm);
            ViewBag.somejobs = jobs;
            return(View("Index"));
        }
Esempio n. 24
0
        // list jobs by column and value
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> jobs;

            if (string.IsNullOrEmpty(searchTerm))
            {
                jobs          = JobData.FindAll();
                ViewBag.title = "All Jobs";
            }
            else
            {
                jobs          = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.title = "Jobs with " + searchType + ": " + searchTerm;
            }
            ViewBag.jobs = jobs;

            return(View());
        }
Esempio n. 25
0
        // TODO #1 - Create a Results action method to process
        // search request and display results
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Dictionary <string, string> > results;

            if (searchType == "all")
            {
                results = JobData.FindByValue(searchTerm);
            }
            else
            {
                results = JobData.FindByColumnAndValue(searchType, searchTerm);
            }

            ViewBag.jobs    = results;
            ViewBag.columns = ListController.columnChoices;
            ViewBag.title   = "Results";
            return(View("/Views/Search/Index.cshtml"));
        }
Esempio n. 26
0
        // TODO #1 - Create a Results action method to process
        // search request and display results

        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Dictionary <string, string> > matches = new List <Dictionary <string, string> >();

            if (searchType.Equals("all"))
            {
                matches = JobData.FindByValue(searchTerm);
            }
            else
            {
                matches = JobData.FindByColumnAndValue(searchType, searchTerm);
            }
            ViewBag.jobs         = matches;
            ViewBag.columns      = ListController.columnChoices;
            ViewBag.searchType   = searchType;
            ViewBag.checkYesOrNo = false;
            return(View("Index"));
        }
        public IActionResult Results(string searchType, string searchTerm)
        {
            List <Job> jobs;

            if (searchType.ToLower().Equals("all"))
            {
                jobs          = JobData.FindAll();
                ViewBag.title = "All Jobs";
            }
            else
            {
                jobs          = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.title = "Jobs with " + ListController.ColumnChoices[searchType] + ": " + searchTerm;
            }
            ViewBag.jobs    = jobs;
            ViewBag.columns = ListController.ColumnChoices;
            return(View("Index"));
        }
Esempio n. 28
0
        public IActionResult Results(string searchType, string searchTerm)
        {
            string termHandler = searchTerm;
            string typeHandler = searchType;

            ViewBag.columns = ListController.columnChoices;
            ViewBag.title   = "search/results";
            if (typeHandler.Equals("all"))
            {
                ViewBag.jobs = JobData.FindByValue(termHandler);
                return(View("Results"));
            }
            else
            {
                ViewBag.jobs = JobData.FindByColumnAndValue(typeHandler, termHandler);
                return(View("Results"));
            }
        }
Esempio n. 29
0
        public IActionResult Results(string searchType, string searchTerm)
        {
            ViewBag.columns = ListController.columnChoices;
            ViewBag.title   = "Search";

            // search when search type is all
            if (searchType == "all")
            {
                ViewBag.jobs = JobData.FindByValue(searchTerm);
            }
            else
            {
                // only when you are not searching for all
                ViewBag.jobs = JobData.FindByColumnAndValue(searchType, searchTerm);
            }

            return(View("Index"));
        }
Esempio n. 30
0
        public IActionResult Results(string searchType, string searchTerm)
        {
            if (searchType.Equals("all"))
            {
                List <Dictionary <string, string> > searchResults = JobData.FindByValue(searchTerm);
                ViewBag.jobs = searchResults;
            }

            else
            {
                List <Dictionary <string, string> > searchResults = JobData.FindByColumnAndValue(searchType, searchTerm);
                ViewBag.jobs = searchResults;
            }

            ViewBag.columns = ListController.columnChoices;
            ViewBag.title   = "Search By ";
            return(View("Index"));
        }