Ejemplo n.º 1
0
        /// <summary>
        /// 获得所有的品牌
        /// 如果一级分类下没有任何品牌则此一级分类不显示
        /// 如果一级分类下的所有品牌都没有LOGO图片则不显示
        /// </summary>
        /// <returns></returns>
        public static List <CategoryBrand> QueryCategoryBrandInfos()
        {
            var categories = QueryCategoryInfos();
            var cates      = QueryCategoryInfosForHomePage();
            var brands     = ProductDA.GetAllBrands();

            var result = new List <CategoryBrand>();

            categories.ForEach(p =>
            {
                if (p.CategoryType == CategoryType.TabStore)
                {
                    var item        = new CategoryBrand();
                    item.Category   = p;
                    item.BrandInfos = GetBrands(p.CategoryID, cates, brands);
                    if (item.BrandInfos.Count > 0)
                    {
                        result.Add(item);
                    }
                }
            });
            return(result);
        }