コード例 #1
0
        public ActionResult Filter()
        {
            var model = new FilterViewModel()
            {
                FreeIngredients = service.GetFreeIngredients(),
                UsedIngredients = service.GetUsedIngredients(),
                PizzaGroups = service.GetFilteredPizzaGroups()
            };

            return View(model);
        }
コード例 #2
0
        public ActionResult ClearFilter()
        {
            service.ResetSession();

            var model = new FilterViewModel()
            {
                FreeIngredients = service.GetFreeIngredients(),
                UsedIngredients = service.GetUsedIngredients(),
                PizzaGroups = service.GetFilteredPizzaGroups()
            };

            return RedirectToAction("Filter", model);
        }
コード例 #3
0
        public ActionResult Filter(string ingredient)
        {
            if (!string.IsNullOrWhiteSpace(ingredient))
            {
                service.AddUsedIngredient(ingredient);
            }

            var model = new FilterViewModel()
            {
                FreeIngredients = service.GetFreeIngredients(),
                UsedIngredients = service.GetUsedIngredients(),
                PizzaGroups = service.GetFilteredPizzaGroups()
            };

            return View(model);
        }
コード例 #4
0
        public ActionResult RemoveFilter(string ingredient)
        {
            service.RemoveUsedIngredient(ingredient);

            var model = new FilterViewModel()
            {
                FreeIngredients = service.GetFreeIngredients(),
                UsedIngredients = service.GetUsedIngredients(),
                PizzaGroups = service.GetFilteredPizzaGroups()
            };

            return RedirectToAction("Filter", model);
        }