Esempio n. 1
0
        private void GetCategoryRssFeedContent(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;
                List <RssFeedCategory> categoryRss = AspxRssFeedProvider.GetCategoryRssContent(aspxCommonObj, rssOption, count);
                if (categoryRss.Count > 0)
                {
                    foreach (RssFeedCategory rssItemData in categoryRss)
                    {
                        string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + rssItemData.ImagePath;
                        rssXml.WriteStartElement("item");
                        rssXml.WriteElementString("title", rssItemData.CategoryName);
                        rssXml.WriteElementString("link",
                                                  "http://" + pageUrl + "/service/" + rssItemData.CategoryName +
                                                  SageFrameSettingKeys.PageExtension);
                        rssXml.WriteStartElement("description");
                        if (rssItemData.ImagePath == "")
                        {
                            imagePath = noImageUrl;
                        }
                        var description = "";
                        description = "<div><a href=http://" + pageUrl + "/service/" + rssItemData.CategoryName +
                                      SageFrameSettingKeys.PageExtension + "><img alt=" +
                                      rssItemData.CategoryName + " src=http://" + pageUrl + "/" +
                                      imagePath.Replace("uploads/Small", "uploads/Small") + " /> </a></div>";
                        description += "</br>" + HttpUtility.HtmlDecode(rssItemData.ShortDescription);
                        rssXml.WriteCData(description);
                        rssXml.WriteEndElement();

                        rssXml.WriteElementString("pubDate", rssItemData.AddedOn);
                        rssXml.WriteEndElement();
                    }
                }
                else
                {
                    rssXml.WriteStartElement("item");
                    rssXml.WriteElementString("title", "");
                    rssXml.WriteElementString("link", "");
                    rssXml.WriteStartElement("description");
                    var description = "";
                    description = "<div><h2><span>This store has no category found!</span></h2></div>";
                    rssXml.WriteCData(description);
                    rssXml.WriteEndElement();
                    rssXml.WriteEndElement();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        private void GetNewOrderRssFeedContent(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;
                List <RssFeedNewOrders> popularTagRss = AspxRssFeedProvider.GetNewOrdersRssContent(aspxCommonObj,
                                                                                                   rssOption, count);
                foreach (RssFeedNewOrders rssItemData in popularTagRss)
                {
                    rssXml.WriteStartElement("item");
                    rssXml.WriteElementString("title", "");
                    rssXml.WriteElementString("link", " ");
                    rssXml.WriteStartElement("description");

                    var description = "";

                    description += "<div><table width=\"100%\"><tr><td colspan=\"2\">OrderID:" + rssItemData.OrderID + "</td></tr>";
                    description += "<tr><td>Order Date: " + rssItemData.AddedOn + "</td><td>Order Status: " + rssItemData.OrderStatus + "</td></tr>";
                    description += "<tr><td>Store Name: " + rssItemData.StoreName + "</td><td>Customer Name: " + rssItemData.CustomerName + "</td></tr>";
                    description += "<tr><td>Grand Total: " + rssItemData.GrandTotal + "</td><td>Payment Method Name: " + rssItemData.PaymentMethodName + "</td></tr>";
                    description += "</table></div>";
                    description += "<div><ul style=list-style-type: none><h2> Ordered Items:</h2>";
                    foreach (var orderItemInfo in rssItemData.OrderItemInfo)
                    {
                        if (orderItemInfo.ImagePath == "")
                        {
                            orderItemInfo.ImagePath = noImageUrl;
                        }
                        description += "<li style=\"float: left;display: inline;padding-right: 50px\"><h2>" +
                                       orderItemInfo.ItemName + "</h2><a href=http://" + pageUrl + "/item/" +
                                       orderItemInfo.SKU + SageFrameSettingKeys.PageExtension + "><img alt=" +
                                       orderItemInfo.ItemName + " src=http://" + pageUrl + "/" +
                                       orderItemInfo.ImagePath.Replace("uploads", "uploads/Small") + " /></a></li>";
                    }
                    description += "</ul></div>";

                    rssXml.WriteCData(description);
                    rssXml.WriteEndElement();

                    // rssXml.WriteElementString("pubDate", rssItemData.AddedOn);
                    rssXml.WriteElementString("pubDate", "");
                    rssXml.WriteEndElement();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
        private void GetNewItemTagRssFeedContent(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;
                List <RssFeedNewTag> popularTagRss = AspxRssFeedProvider.GetNewTagsRssContent(aspxCommonObj, rssOption, count);
                foreach (RssFeedNewTag 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><h2>Tag Name: " + rssItemData.TagName + "</h2></br><h2><span>Tag Status: " +
                                   rssItemData.TagStatus +
                                   "</span></h2><ul style=list-style-type: none><h2> Taged Item:</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.WriteElementString("pubDate", rssItemData.AddedOn);
                    rssXml.WriteEndElement();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
        private void GetLowStockItemRssFeedContent(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;
                List <RssFeedLowStock> bestSellItemRss = AspxRssFeedProvider.GetLowStockItemRssContent(aspxCommonObj, rssOption, count);
                foreach (RssFeedLowStock rssItemData in bestSellItemRss)
                {
                    rssXml.WriteStartElement("item");
                    rssXml.WriteElementString("title", rssItemData.ItemName);
                    rssXml.WriteElementString("link",
                                              "http://" + pageUrl + "/item/" + rssItemData.SKU +
                                              SageFrameSettingKeys.PageExtension);
                    rssXml.WriteStartElement("description");
                    string imagePath = "Modules/AspxCommerce/AspxItemsManagement/uploads/" + rssItemData.ImagePath;
                    if (rssItemData.ImagePath == "")
                    {
                        imagePath = noImageUrl;
                    }
                    var description = "";
                    description = "<div><a href=http://" + pageUrl + "/item/" + rssItemData.SKU +
                                  SageFrameSettingKeys.PageExtension + "><img alt=" +
                                  rssItemData.ItemName + " src=http://" + pageUrl + "/" +
                                  imagePath.Replace("uploads", "uploads/Small") + " /> </a>";

                    description += "<div class=\"itemTable\"><table width=\"20%\">";
                    description += "<tr><td><h2>Price: </h2>" + rssItemData.Price + "</td><td><h2>Quantity: </h2>" +
                                   rssItemData.Quantity + "</td></tr>";
                    description += "<tr><td><h2>Status: </h2>" + rssItemData.Status + "</td><td></td></tr>";
                    description += "</table></div>";
                    description += "</div>";
                    rssXml.WriteCData(description);
                    rssXml.WriteEndElement();
                    rssXml.WriteElementString("pubDate", "");
                    rssXml.WriteEndElement();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
        private void GetBrandRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
        {
            try
            {
                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;
                List <RssFeedBrand> brandRssContent = AspxRssFeedProvider.GetBrandRssContent(aspxCommonObj, rssOption, count);
                foreach (RssFeedBrand rssFeedBrand in brandRssContent)
                {
                    rssXml.WriteStartElement("item");
                    rssXml.WriteElementString("title", rssFeedBrand.BrandName);
                    rssXml.WriteElementString("link",
                                              "http://" + pageUrl + "/brand/" + rssFeedBrand.BrandName + SageFrameSettingKeys.PageExtension);
                    rssXml.WriteStartElement("description");
                    string description = "";
                    description += "<div>";
                    description += "<div><a href=http://" + pageUrl + "/brand/" + rssFeedBrand.BrandName + SageFrameSettingKeys.PageExtension + ">";
                    description += "<img src=http://" + pageUrl + "/" + rssFeedBrand.BrandImageUrl.Replace("uploads", "uploads/Small") + "  />";
                    description += "</a></div>";
                    description += "<p>" + HttpUtility.HtmlDecode(rssFeedBrand.BrandDescription) + "</p>";

                    description += "</div>";
                    rssXml.WriteCData(description);
                    rssXml.WriteEndElement();
                    rssXml.WriteElementString("pubDate", rssFeedBrand.AddedOn);
                    rssXml.WriteEndElement();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 6
0
        private void GetNewCustomerRssFeedContent(AspxCommonInfo aspxCommonObj, XmlTextWriter rssXml, string pageURL, string rssOption, int count)
        {
            try
            {
                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;
                List <RssFeedNewCustomer> categoryRss = AspxRssFeedProvider.GetNewCustomerRssFeedContent(aspxCommonObj, rssOption, count);
                foreach (RssFeedNewCustomer rssItemData in categoryRss)
                {
                    rssXml.WriteStartElement("item");
                    rssXml.WriteElementString("title", rssItemData.UserName);
                    rssXml.WriteElementString("link", "");
                    rssXml.WriteStartElement("description");

                    var description = "<div><ul>";
                    description += "<li><h2>UserName: "******"</h2></li>";
                    description += "<li><h2>Customer Name: " + rssItemData.CustomerName + "</h2></li>";
                    description += "<li><h2>Customer Email: " + rssItemData.Email + "</h2></li>";
                    description += "<li><h2>Registered On: " + rssItemData.AddedOn + "</h2></li>";
                    description += "</ul></div>";

                    rssXml.WriteCData(description);
                    rssXml.WriteEndElement();

                    rssXml.WriteElementString("pubDate", " ");
                    rssXml.WriteEndElement();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }