private void GetCategoryMenuList(AspxCommonInfo aspxCommonObj)
    {
        List <CategoryInfo> catInfo = AspxCategoryListController.GetCategoryMenuList(aspxCommonObj);

        if (catInfo.Count > 0)
        {
            int           categoryID = 0;
            int           parentID   = 0;
            int?          categoryLevel;
            string        attributeValue = string.Empty;;
            StringBuilder catListmaker   = new StringBuilder();
            string        catList        = string.Empty;
            catListmaker.Append("<div class=\"cssClassCategoryNavHor\"><ul class='sf-menu'>");
            string css, hrefParentCategory, pageExtension = SageFrameSettingKeys.PageExtension;
            foreach (CategoryInfo eachCat in catInfo)
            {
                css = string.Empty;
                if (eachCat.ChildCount > 0)
                {
                    css = " class=\"cssClassCategoryParent\"";
                }
                else
                {
                    css = "";
                }
                categoryID     = eachCat.CategoryID;
                parentID       = eachCat.ParentID;
                categoryLevel  = eachCat.CategoryLevel;
                attributeValue = eachCat.AttributeValue;
                if (eachCat.CategoryLevel == 0)
                {
                    hrefParentCategory = string.Empty;
                    hrefParentCategory = aspxRedirectPath + "category/" + AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue) + pageExtension;
                    catListmaker.Append("<li");
                    catListmaker.Append(css);
                    catListmaker.Append("><a href=");
                    catListmaker.Append(hrefParentCategory);
                    catListmaker.Append(">");
                    catListmaker.Append(eachCat.AttributeValue);
                    catListmaker.Append("</a>");
                    if (eachCat.ChildCount > 0)
                    {
                        catListmaker.Append("<ul>");
                        itemPath += eachCat.AttributeValue;
                        catListmaker.Append(BindChildCategory(catInfo, categoryID));
                        catListmaker.Append("</ul>");
                    }
                    catListmaker.Append("</li>");
                }
                itemPath = string.Empty;
            }
            catListmaker.Append("<div class=\"cssClassclear\"></div></ul></div>");
            divCategoryListerH.InnerHtml = catListmaker.ToString();
        }
        else
        {
            string strText = ("<span class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + "</span>");//Need to add Local Text
            divCategoryListerH.InnerHtml = strText;
        }
    }
Esempio n. 2
0
    private void GetCategoryMenuListWithProduct()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = GetStoreID;
        aspxCommonObj.PortalID    = GetPortalID;
        aspxCommonObj.UserName    = GetUsername;
        aspxCommonObj.CultureName = GetCurrentCultureName;
        List <CategoryInfo> catInfo = AspxCategoryListController.GetCategoryMenuList(aspxCommonObj);

        if (catInfo != null && catInfo.Count > 0)
        {
            int           categoryID   = 0;
            StringBuilder catListmaker = new StringBuilder();
            string        catList      = string.Empty;
            catListmaker.Append("<ul class='sfSiteMap' id='primaryNav'>");
            foreach (CategoryInfo eachCat in catInfo)
            {
                categoryID = eachCat.CategoryID;
                if (eachCat.CategoryLevel == 0)
                {
                    string hrefParentCategory = string.Empty;
                    catListmaker.Append("<li><a href=");
                    catListmaker.Append(aspxRedirectPath);
                    catListmaker.Append("category/");
                    string strRet = fixedEncodeURIComponent(eachCat.AttributeValue);
                    catListmaker.Append(strRet);
                    catListmaker.Append(SageFrameSettingKeys.PageExtension);
                    catListmaker.Append(">");
                    catListmaker.Append(eachCat.AttributeValue);
                    catListmaker.Append("</a>");
                    string items = BindProductByCategory(eachCat.CategoryID);
                    if (!string.IsNullOrEmpty(items))
                    {
                        catListmaker.Append(items);
                    }
                    if (eachCat.ChildCount > 0)
                    {
                        catListmaker.Append("<ul>");
                        catListmaker.Append(BindChildCategory(catInfo, categoryID));
                        catListmaker.Append("</ul>");
                    }
                    catListmaker.Append("</li>");
                }
            }
            catListmaker.Append("</ul>");
            ltAspxSiteMap.Text = catListmaker.ToString();
        }
        else
        {
            string strText = ("<span id=\"spanCatNotFound\" class=\"cssClassNotFound\"></span>");//Need to add Local Text
            //  divCategoryVertical.InnerHtml = strText;
        }
    }
Esempio n. 3
0
    private void GetCategoryMenuList()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = GetStoreID;
        aspxCommonObj.PortalID    = GetPortalID;
        aspxCommonObj.UserName    = GetUsername;
        aspxCommonObj.CultureName = GetCurrentCultureName;
        List <CategoryInfo> catInfo = AspxCategoryListController.GetCategoryMenuList(aspxCommonObj);

        if (catInfo != null && catInfo.Count > 0)
        {
            int           categoryID   = 0;
            StringBuilder catListmaker = new StringBuilder();
            string        catList      = string.Empty;
            catListmaker.Append("<ul class='mega-menu' id='divMegaMenu'>");
            foreach (CategoryInfo eachCat in catInfo)
            {
                categoryID = eachCat.CategoryID;
                if (eachCat.CategoryLevel == 0)
                {
                    string hrefParentCategory = string.Empty;
                    catListmaker.Append("<li><a href=\"");
                    catListmaker.Append(aspxRedirectPath);
                    catListmaker.Append("category/");
                    string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue);
                    catListmaker.Append(strRet);
                    catListmaker.Append(SageFrameSettingKeys.PageExtension);
                    catListmaker.Append("\">");
                    catListmaker.Append(eachCat.AttributeValue);
                    catListmaker.Append("</a>");
                    if (eachCat.ChildCount > 0)
                    {
                        catListmaker.Append("<ul>");
                        catListmaker.Append(BindChildCategory(catInfo, categoryID));
                        catListmaker.Append("</ul>");
                    }
                    catListmaker.Append("</li>");
                }
            }
            catListmaker.Append("</ul>");
            divCategoryVertical.InnerHtml = ("<div class=\"cssClassCategoryNav\">" + catListmaker + "</div>");
        }
        else
        {
            string strText = ("<span id=\"spanCatNotFound\" class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + " </span>");//Need to add Local Text
            divCategoryVertical.InnerHtml = strText;
        }
    }
    private void GetCategoryMenuList()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = GetStoreID;
        aspxCommonObj.PortalID    = GetPortalID;
        aspxCommonObj.UserName    = GetUsername;
        aspxCommonObj.CultureName = GetCurrentCultureName;
        List <CategoryInfo> catInfo = AspxCategoryListController.GetCategoryMenuList(aspxCommonObj);

        if (catInfo.Count > 0)
        {
            int           categoryID = 0;
            int           parentID   = 0;
            int?          categoryLevel;
            string        attributeValue = string.Empty;;
            StringBuilder catListmaker   = new StringBuilder();
            string        catList        = string.Empty;
            catListmaker.Append("<div class=\"cssClassCategoryNavHor\"><ul class='sf-menu'>");
            foreach (CategoryInfo eachCat in catInfo)
            {
                string css = string.Empty;
                if (eachCat.ChildCount > 0)
                {
                    css = "class=cssClassCategoryParent";
                }
                else
                {
                    css = "";
                }
                categoryID     = eachCat.CategoryID;
                parentID       = eachCat.ParentID;
                categoryLevel  = eachCat.CategoryLevel;
                attributeValue = eachCat.AttributeValue;
                if (eachCat.CategoryLevel == 0)
                {
                    string hrefParentCategory = string.Empty;
                    hrefParentCategory = aspxRedirectPath + "category/" + AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue) + SageFrameSettingKeys.PageExtension;
                    catListmaker.Append("<li " + css + "><a href=" + hrefParentCategory + ">");
                    catListmaker.Append(eachCat.AttributeValue);
                    catListmaker.Append("</a>");

                    if (eachCat.ChildCount > 0)
                    {
                        catListmaker.Append("<ul>");
                        itemPath += eachCat.AttributeValue;
                        catListmaker.Append(BindChildCategory(catInfo, categoryID));
                        catListmaker.Append("</ul>");
                    }
                    catListmaker.Append("</li>");
                }
                itemPath = string.Empty;
            }

            catListmaker.Append("<div class=\"cssClassclear\"></div></ul></div>");
            divCategoryListerH.InnerHtml = catListmaker.ToString();
        }
        else
        {
            string strText = ("<span class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + "</span>");//Need to add Local Text
            divCategoryListerH.InnerHtml = strText;
        }
        //if ($('.cssClassCategoryNav>ul>li').length > 4) {
        //    $('.cssClassCategoryNav>ul>li:last').addClass('cssClassLastMenu');
        //}
    }