예제 #1
0
        // Lists Jobs with a given field matching a given value
        public IActionResult Cosmetics(CosmeticFieldType column, string value)
        {
            SearchCosmeticsViewModel searchVM = new SearchCosmeticsViewModel();

            searchVM.Cosmetics = context.FindByColumnAndValue(column, value);
            searchVM.Title     = "Cosmetics with " + column + ": " + value;

            return(View(searchVM));
        }
예제 #2
0
        public IActionResult Results(SearchCosmeticsViewModel searchCVM)
        {
            // searchCVM.Column = CosmeticFieldType.All;

            //   if (ModelState.IsValid)
            if (searchCVM.Value == null)
            {
                searchCVM.Value = "";
            }
            if (searchCVM.Column.Equals(CosmeticFieldType.All) || searchCVM.Value.Equals(""))
            {
                searchCVM.Cosmetics = context.FindByValue(searchCVM.Value);
            }
            else
            {
                searchCVM.Cosmetics = context.FindByColumnAndValue(searchCVM.Column, searchCVM.Value);
            }

            // searchCVM.Title = "Search";

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