Esempio n. 1
0
        public FullIngredientVM GetFullIngredientVM(int pageId, string category, int ingredientsPerPage)
        {
            List <IngredientWithCategoriesDTO> loadedIngredients = ingredientProcessor.GetAllInCategory((pageId - 1) * ingredientsPerPage, ingredientsPerPage, category);
            List <CategoryVM> Categories = categoryProcessor.GetAll().DTOToViewModelList(MapCategory);
            int ingredientCount          = ingredientProcessor.Count(category);

            return(new FullIngredientVM()
            {
                Ingredients = loadedIngredients,
                PaginationInfo = new PaginationInfo()
                {
                    Current = pageId,
                    ItemsPerPage = ingredientsPerPage,
                    ItemsCount = ingredientCount
                },
                Categories = Categories,
                SelectedCategoryName = category
            });
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            List <CategoryVM> model = categoryProcessor.GetAll().DTOToViewModelList(MapCategory);

            return(View(model));
        }