Esempio n. 1
0
    private void GetProductList()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        int    offset     = 1;
        int    rowTotal   = 0;
        string modulePath = this.AppRelativeTemplateSourceDirectory;

        hst = AppLocalized.getLocale(modulePath);
        List <ProductListInfo> productListInfo = AspxProductListerController.GetProductLists(aspxCommonObj, count, offset);
        string        pageExtension            = SageFrameSettingKeys.PageExtension;
        StringBuilder ProductListContents      = new StringBuilder();

        if (productListInfo != null && productListInfo.Count > 0)
        {
            ProductListContents.Append("<div class=\"cssClassProductLists\"><ul>");
            foreach (ProductListInfo item in productListInfo)
            {
                string name = item.Name;
                rowTotal = item.RowTotal;
                string hrefItem = aspxRedirectPath + "item/" + fixedEncodeURIComponent(item.SKU) + pageExtension;
                ProductListContents.Append("<li><a href='" + hrefItem + "'>" + name + "</a></li>");
            }
            ProductListContents.Append("</ul>");
            if (rowTotal > count)
            {
                string href = aspxRedirectPath + CategoriesWiseItemUrl + pageExtension;
                ProductListContents.Append("<div id=\"productViewMore\" class=\"cssClassViewMore\">");
                ProductListContents.Append("<a href='" + href + "'>");
                ProductListContents.Append("<span>");
                ProductListContents.Append(getLocale("View More"));
                ProductListContents.Append("</span></a></div>");
            }
            ProductListContents.Append("</div>");
            divProductLists.InnerHtml = ProductListContents.ToString();
        }
        else
        {
            ProductListContents.Append("<span class=\"cssClassNotFound\">");
            ProductListContents.Append(getLocale("There are no products!"));
            ProductListContents.Append("</span>");
            divProductLists.InnerHtml = ProductListContents.ToString();
        }
    }
Esempio n. 2
0
    private void GetProductListSetting()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.CultureName = CultureName;
        List <ProductListSettingInfo> productListSetting =
            AspxProductListerController.GetProductListSetting(aspxCommonObj);

        if (productListSetting != null && productListSetting.Count > 0)
        {
            foreach (ProductListSettingInfo item in productListSetting)
            {
                count = item.ProductCount;
            }
        }
    }