コード例 #1
0
    public void GetPopularTagsSettings()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.CultureName = CultureName;
        PopularTagsController         ptc           = new PopularTagsController();
        List <PopularTagsSettingInfo> ptSettingInfo = ptc.GetPopularTagsSetting(aspxCommonObj);

        if (ptSettingInfo != null && ptSettingInfo.Count > 0)
        {
            foreach (var item in ptSettingInfo)
            {
                IsEnablePopularTag     = item.IsEnablePopularTag;
                PopularTagCount        = item.PopularTagCount;
                TaggedItemInARow       = item.TaggedItemInARow;
                IsEnablePopularTagRss  = item.IsEnablePopularTagRss;
                PopularTagRssCount     = item.PopularTagRssCount;
                PopularTagsRssPageName = item.PopularTagsRssPageName;
                ViewAllTagsPageName    = item.ViewAllTagsPageName;
                ViewTaggedItemPageName = item.ViewTaggedItemPageName;
            }
        }
    }
コード例 #2
0
 public void SaveUpdatePopularTagsSetting(AspxCommonInfo aspxCommonObj, PopularTagsSettingKeyPair pTSettingList)
 {
     try
     {
         PopularTagsController ptc = new PopularTagsController();
         ptc.SaveUpdatePopularTagsSetting(aspxCommonObj, pTSettingList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #3
0
 public List <ItemBasicDetailsInfo> GetUserTaggedItems(int offset, int limit, string tagIDs, int SortBy, int rowTotal, AspxCommonInfo aspxCommonObj)
 {
     try
     {
         List <ItemBasicDetailsInfo> lstItemBasic = PopularTagsController.GetUserTaggedItems(offset, limit, tagIDs, SortBy, rowTotal, aspxCommonObj);
         return(lstItemBasic);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #4
0
 public PopularTagsSettingKeyPair GetPopularTagsSettingValueByKey(AspxCommonInfo aspxCommonObj, string settingKey)
 {
     try
     {
         PopularTagsController ptc = new PopularTagsController();
         return(ptc.GetPopularTagsSettingValueByKey(aspxCommonObj, settingKey));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
 public List <PopularTagsSettingInfo> GetPopularTagsSetting(AspxCommonInfo aspxCommonObj)
 {
     try
     {
         PopularTagsController         ptc           = new PopularTagsController();
         List <PopularTagsSettingInfo> pTSettingList = ptc.GetPopularTagsSetting(aspxCommonObj);
         return(pTSettingList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
 public List <TagDetailsInfo> GetAllPopularTags(AspxCommonInfo aspxCommonObj, int count)
 {
     try
     {
         PopularTagsController ptc          = new PopularTagsController();
         List <TagDetailsInfo> lstTagDetail = ptc.GetAllPopularTags(aspxCommonObj, count);
         return(lstTagDetail);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #7
0
 public void GetPopularTagsSettings()
 {
     AspxCommonInfo aspxCommonObj = new AspxCommonInfo();
     aspxCommonObj.StoreID = StoreID;
     aspxCommonObj.PortalID = PortalID;
     aspxCommonObj.CultureName = CultureName;
     PopularTagsController ptc = new PopularTagsController();
     List<PopularTagsSettingInfo> ptSettingInfo = ptc.GetPopularTagsSetting(aspxCommonObj);
     if (ptSettingInfo != null && ptSettingInfo.Count>0)
     {
         foreach (var item in ptSettingInfo)
         {
             PopularTagRssCount = item.PopularTagRssCount;
         }          
     }
 }
コード例 #8
0
    public void GetPopularTagsSettings()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.CultureName = CultureName;
        PopularTagsController         ptc           = new PopularTagsController();
        List <PopularTagsSettingInfo> ptSettingInfo = ptc.GetPopularTagsSetting(aspxCommonObj);

        if (ptSettingInfo != null && ptSettingInfo.Count > 0)
        {
            foreach (var item in ptSettingInfo)
            {
                NoOfItemsInARow = item.TaggedItemInARow;
            }
        }
    }
コード例 #9
0
    public void GetAllPopularTags()
    {
        AspxCommonInfo aspxCommonObj = new AspxCommonInfo();

        aspxCommonObj.StoreID     = StoreID;
        aspxCommonObj.PortalID    = PortalID;
        aspxCommonObj.UserName    = UserName;
        aspxCommonObj.CultureName = CultureName;
        string modulePath             = this.AppRelativeTemplateSourceDirectory;
        string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName;
        string aspxRootPath           = ResolveUrl("~/");

        hst = AppLocalized.getLocale(modulePath);
        string pageExtension               = SageFrameSettingKeys.PageExtension;
        int?   tagCount                    = 0;
        PopularTagsController ptc          = new PopularTagsController();
        List <TagDetailsInfo> lstTagDetail = ptc.GetAllPopularTags(aspxCommonObj, PopularTagCount);

        tagCount = lstTagDetail.Count;
        if (tagCount > PopularTagCount)
        {
            lstTagDetail.RemoveAt(lstTagDetail.Count - 1);
        }
        StringBuilder popularTagContent = new StringBuilder();

        popularTagContent.Append("<div id=\"divPopularTags\" class=\"cssClassPopularTags\">");
        StringBuilder allTag = new StringBuilder();

        allTag.Append("<span id=\"divViewAllTags\" class=\"cssClassViewAllTags\"></span>");
        ltrViewAllTag.Text = allTag.ToString();
        if (lstTagDetail != null && lstTagDetail.Count > 0)
        {
            float?totalTagCount = 0;
            popularTagContent.Append("<ul id=\"tagList\">");
            for (int index = 0; index < lstTagDetail.Count; index++)
            {
                totalTagCount = lstTagDetail[index].TagCount;
                string fSize = (totalTagCount / 10 < 1) ? ((totalTagCount / 10) + 1) + "em" : (((totalTagCount / 10) > 2) ? "2em" : (totalTagCount / 10) + "em");
                if (index != lstTagDetail.Count - 1)
                {
                    popularTagContent.Append("<li><a title=\"See all items tagged with ");
                    popularTagContent.Append(lstTagDetail[index].Tag);
                    popularTagContent.Append("\" href=\"");
                    popularTagContent.Append(aspxRedirectPath + ViewTaggedItemPageName + pageExtension + "?tagsId=");
                    popularTagContent.Append(lstTagDetail[index].ItemTagIDs);
                    popularTagContent.Append("\" style=\"");
                    popularTagContent.Append("font-size: ");
                    popularTagContent.Append(fSize);
                    popularTagContent.Append(";\">");
                    popularTagContent.Append(lstTagDetail[index].Tag + " ");
                    popularTagContent.Append("</a></li>");
                }
                else
                {
                    popularTagContent.Append("<li><a title=\"See all items tagged with ");
                    popularTagContent.Append(lstTagDetail[index].Tag);
                    popularTagContent.Append("\" href=\"");
                    popularTagContent.Append(aspxRedirectPath + ViewTaggedItemPageName + pageExtension + "?tagsId=");
                    popularTagContent.Append(lstTagDetail[index].ItemTagIDs);
                    popularTagContent.Append("\" style=\"");
                    popularTagContent.Append("font-size: ");
                    popularTagContent.Append(fSize);
                    popularTagContent.Append("\">");
                    popularTagContent.Append(lstTagDetail[index].Tag);
                    popularTagContent.Append("</a></li>");
                }
            }
            popularTagContent.Append("</ul><div class=\"cssClassClear\"></div>");
            if (tagCount > PopularTagCount && tagCount > 0)
            {
                string strHtml = "<span class=\"cssClassViewMore\"><a href=\"" + aspxRedirectPath + ViewAllTagsPageName + pageExtension + "\" title =\"View all tags\">" + getLocale("View All Tags") + "</a></span>";
                popularTagContent.Append(strHtml);
                ltrViewAllTag.Visible = true;
            }
            else
            {
                ltrViewAllTag.Visible = false;
            }
        }
        else
        {
            popularTagContent.Append("<span class=\"cssClassNotFound\">");
            popularTagContent.Append(getLocale("Not any items have been tagged yet!"));
            popularTagContent.Append("</span>");
            ltrViewAllTag.Visible = false;
        }
        popularTagContent.Append("</div>");
        ltrPopularTags.Text = popularTagContent.ToString();
    }
コード例 #10
0
    private void GetPopularTagRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
    {
        try
        {
            string             noImageUrl = string.Empty;
            StoreSettingConfig ssc        = new StoreSettingConfig();
            noImageUrl = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, aspxCommonObj.StoreID,
                                                   aspxCommonObj.PortalID, aspxCommonObj.CultureName);
            string[] path      = pageURL.Split('?');
            string   pagepath  = path[0];
            string   x         = HttpContext.Current.Request.ApplicationPath;
            string   authority = HttpContext.Current.Request.Url.Authority;
            string   pageUrl   = authority + x;
            PopularTagsController         ptc           = new PopularTagsController();
            List <PopularTagsRssFeedInfo> popularTagRss = ptc.GetRssFeedContens(aspxCommonObj, pageURL, rssOption, PopularTagRssCount);

            if (popularTagRss.Count > 0)
            {
                foreach (PopularTagsRssFeedInfo rssItemData in popularTagRss)
                {
                    rssXml.WriteStartElement("item");
                    rssXml.WriteElementString("title", rssItemData.TagName);
                    rssXml.WriteElementString("link", "http://" + pageUrl + "/tagsitems/tags" + SageFrameSettingKeys.PageExtension + "?tagsId=" + rssItemData.TagIDs +
                                              "");
                    rssXml.WriteStartElement("description");

                    var description = "";

                    description += "<div><ul style=list-style-type: none><h2> Taged Items:</h2>";
                    foreach (var tagItemInfo in rssItemData.TagItemInfo)
                    {
                        string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + tagItemInfo.ImagePath;
                        if (tagItemInfo.ImagePath == "")
                        {
                            imagePath = noImageUrl;
                        }
                        description += "<li style=\"float: left;display: inline;padding-right: 50px\"><h2>" +
                                       tagItemInfo.ItemName + "</h2><a href=http://" + pageUrl + "/item/" +
                                       tagItemInfo.SKU + SageFrameSettingKeys.PageExtension + "><img alt=" +
                                       tagItemInfo.ItemName + " src=http://" + pageUrl + "/" +
                                       imagePath.Replace("uploads", "uploads/Small") + " /></a></li>";
                    }
                    description += "</ul></div>";
                    rssXml.WriteCData(description);
                    rssXml.WriteEndElement();
                    rssXml.WriteEndElement();
                }
            }
            else
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", "");
                rssXml.WriteElementString("link", "");
                rssXml.WriteStartElement("description");
                var description = "";
                description = "<div><h2><span>Not any items have been tagged yet!</span></h2></div>";
                rssXml.WriteCData(description);
                rssXml.WriteEndElement();
                rssXml.WriteEndElement();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
コード例 #11
0
    private void GetPopularTagRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
    {
        try
        {
            string noImageUrl = string.Empty;
            StoreSettingConfig ssc = new StoreSettingConfig();
            noImageUrl = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, aspxCommonObj.StoreID,
                                                   aspxCommonObj.PortalID, aspxCommonObj.CultureName);
            string[] path = pageURL.Split('?');
            string pagepath = path[0];
            string x = HttpContext.Current.Request.ApplicationPath;
            string authority = HttpContext.Current.Request.Url.Authority;
            string pageUrl = authority + x;
            PopularTagsController ptc = new PopularTagsController();
            List<PopularTagsRssFeedInfo> popularTagRss= ptc.GetRssFeedContens(aspxCommonObj, pageURL, rssOption, PopularTagRssCount);

            if (popularTagRss.Count > 0)
            {
                foreach (PopularTagsRssFeedInfo rssItemData in popularTagRss)
                {
                    rssXml.WriteStartElement("item");
                    rssXml.WriteElementString("title", rssItemData.TagName);
                    rssXml.WriteElementString("link", "http://" + pageUrl + "/tagsitems/tags" + SageFrameSettingKeys.PageExtension + "?tagsId=" + rssItemData.TagIDs +
                                              "");
                    rssXml.WriteStartElement("description");

                    var description = "";

                    description += "<div><ul style=list-style-type: none><h2> Taged Items:</h2>";
                    foreach (var tagItemInfo in rssItemData.TagItemInfo)
                    {
                        string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + tagItemInfo.ImagePath;
                        if (tagItemInfo.ImagePath == "")
                        {
                            imagePath = noImageUrl;
                        }
                        description += "<li style=\"float: left;display: inline;padding-right: 50px\"><h2>" +
                                       tagItemInfo.ItemName + "</h2><a href=http://" + pageUrl + "/item/" +
                                       tagItemInfo.SKU + SageFrameSettingKeys.PageExtension + "><img alt=" +
                                       tagItemInfo.ItemName + " src=http://" + pageUrl + "/" +
                                       imagePath.Replace("uploads", "uploads/Small") + " /></a></li>";
                    }
                    description += "</ul></div>";
                    rssXml.WriteCData(description);
                    rssXml.WriteEndElement();
                    rssXml.WriteEndElement();
                }
            }
            else
            {
                rssXml.WriteStartElement("item");
                rssXml.WriteElementString("title", "");
                rssXml.WriteElementString("link", "");
                rssXml.WriteStartElement("description");
                var description = "";
                description = "<div><h2><span>Not any items have been tagged yet!</span></h2></div>";
                rssXml.WriteCData(description);
                rssXml.WriteEndElement();
                rssXml.WriteEndElement();
            }

        }
        catch (Exception ex)
        {
            throw ex;
        }
    }