Пример #1
0
        public static string GetFullCategory(int categoryId)
        {
            CategoryInfo category = SubsiteCatalogHelper.GetCategory(categoryId);
            string       result;

            if (category == null)
            {
                result = null;
            }
            else
            {
                string text = category.Name;
                while (category != null && category.ParentCategoryId.HasValue)
                {
                    category = SubsiteCatalogHelper.GetCategory(category.ParentCategoryId.Value);
                    if (category != null)
                    {
                        text = category.Name + " >> " + text;
                    }
                }
                result = text;
            }
            return(result);
        }
Пример #2
0
        public static bool UpdateProductCategory(int productId, int newCategoryId)
        {
            bool result;

            if (newCategoryId != 0)
            {
                result = SubsiteProductProvider.Instance().UpdateProductCategory(productId, newCategoryId, SubsiteCatalogHelper.GetCategory(newCategoryId).Path + "|");
            }
            else
            {
                result = SubsiteProductProvider.Instance().UpdateProductCategory(productId, newCategoryId, null);
            }
            return(result);
        }