Ejemplo n.º 1
0
        public string GetEntryImageLink(string sku)
        {
            Log.Debug("Entering Uitlity.GetEntryImageLink");

            var imgSection = FeedUtils.GetImageFileSectionName(_reader);

            decimal salePrice = GetSalePrice();
            decimal listPrice = GetListPrice();

            var imageUrl = string.Format("{0}/{1}/{2}.jpg{3}", ImgBaseUrl, imgSection, sku, ImagePathSuffix);

            if (listPrice > 0 && (listPrice - salePrice) > 0)
            {
                var hasDollarDiscount = GetAttributeValue("hasDollarDiscount");

                if (hasDollarDiscount != DBNull.Value && (bool)hasDollarDiscount)
                {
                    imageUrl += string.Format("?sale={0:#}&saleType=d", listPrice - salePrice);
                }
                else
                {
                    imageUrl += string.Format("?sale={0:###}", Decimal.Multiply((listPrice - salePrice) / listPrice, 100M));
                }
            }

            Log.Debug("Exiting Uitlity.GetEntryImageLink");

            return(imageUrl);
        }
Ejemplo n.º 2
0
        private static XE EntryImageLink(IDataRecord reader, string sku)
        {
            var imgSection = FeedUtils.GetImageFileSectionName(reader);
            var imgUrl     = string.Format("{0}/{1}/{2}.jpg{3}", ImgBaseUrl, imgSection, sku, ImagePathSuffix);

            return(new XE("imageurl", imgUrl));
        }