Beispiel #1
0
        //
        // GET: /Catalogue/

        public ActionResult Index(string id)
        {
            using (var context = new SiteContainer())
            {
                var model = new CatalogueViewModel(context, id);
                this.SetSeoContent(model);

                if (WebSession.Categories.ContainsKey(model.Category.Id))
                    model.ApplyFilterForProducts(WebSession.Categories[model.Category.Id]);

                return View(model);
            }
        }
Beispiel #2
0
        public ActionResult Index(string id, FormCollection form)
        {
            using (var context = new SiteContainer())
            {
                var model = new CatalogueViewModel(context, id);
                this.SetSeoContent(model);

                List<ProductAttribute> checkedAttributes = (from attribute in model.Attributes where form["attr_" + attribute.Id] == "true,false" select attribute).ToList();
                WebSession.Categories[model.Category.Id] = checkedAttributes;

                if (WebSession.Categories.ContainsKey(model.Category.Id))
                    model.ApplyFilterForProducts(WebSession.Categories[model.Category.Id]);

                return View(model);
            }
        }