Exemple #1
0
        public ActionResult Result()
        {
            string subName = Session["subName"] as string;
            int    id      = -1;

            if (subName == null)
            {
                string sub = Session["sub"] as string;
                id = int.Parse(sub);
            }
            else
            {
                id = filterService.getSubCatgoryIDFromName(subName);
            }

            string category    = filterService.GetCategoryNameFromSub(id);
            string subcategory = filterService.GetSubCateogryName(id);

            ViewBag.Categories = filterService.GetCategoryNames();
            ViewBag.SpecList   = resultsService.getSpecListForSubCategory(id);

            var model = new ResultsVM();

            model.SubCategoryID   = id;
            model.SpecList        = resultsService.getSpecListForSubCategory(id);
            model.SpecFilterList  = resultsService.getSpecFilters(id);
            model.Category        = category;
            model.SubCategory     = subcategory;
            model.Products        = resultsService.getAllProductsBySubCategory(id);
            model.IndividualSpecs = resultsService.getIndividualProperties(id);
            model.isFiltered      = false;

            return(View("Results", model));
        }