Exemplo n.º 1
0
        private ArrayList GetPopularProducts(int categoryID, ArrayList products)
        {
            CategoryController categoryController = new CategoryController();
            ProductController productController = new ProductController();

            CategoryInfo category = categoryController.GetCategory(categoryID);

            foreach (ProductInfo product in productController.GetPopularProducts(PortalId, categoryID, false))
            {
                products.Add(product);
            }

            foreach (CategoryInfo childCategory in categoryController.GetCategories(PortalId, false, categoryID))
            {
                if (childCategory.CategoryID != Null.NullInteger)
                {
                    GetPopularProducts(childCategory.CategoryID, products);
                }
            }

            return products;
        }