Ejemplo n.º 1
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            if (_data == null)
            {
                return;
            }

            List <Link> links = ECommerceServer.DataCache.LiensRecherchesSansResultats;

            writer.Write("<ul ");

            if (!string.IsNullOrEmpty(CssClass))
            {
                writer.Write(" class='");
                writer.Write(CssClass);
                writer.Write("'");
            }


            if (Style != null && Style.Count > 0)
            {
                writer.Write(" style='");
                writer.Write(Style.ToString());
                writer.Write("'");
            }
            writer.Write(" >");


            foreach (ArticlesDocumentsDS.catalog_articles_documentsRow r in _data.catalog_articles_documents)
            {
                writer.Write("<li");
                if (!string.IsNullOrEmpty(ImageCssClass))
                {
                    writer.Write(" class='");
                    writer.Write(ImageCssClass);
                    writer.Write("'");
                }
                writer.Write(">");
                writer.Write("<a href='");
                writer.Write(ECommerceServer.ResolveResourceUrl(r.doa_url_document));
                writer.Write("'>");

                writer.Write("<img border='0' src='");
                writer.Write(ECommerceServer.ResolveResourceUrl(r.doa_url_imagette));
                writer.Write("' />");

                writer.Write("</a>");

                writer.Write("</li>");
            }

            writer.Write("</ul>");
        }
        public void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            int sit_pk = ECommerceServer.SiteId;

            ServerConfigSection config = EConfigurationManager.GetConfig(ECommerceServer.CurrentSite);


            if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                VueArticlesWebDS.ecommerce_articles_webRow r = res.Article.ecommerce_articles_web[0];
                BindTo(r);
            }
            else if (o is PromotionsLotsRepeater.ProduitLotRepeaterItemData)
            {
                PromotionsLotsRepeater.ProduitLotRepeaterItemData res = o as PromotionsLotsRepeater.ProduitLotRepeaterItemData;
                VueArticlesWebDS.ecommerce_articles_webRow        r   = res.ArticleLot;
                BindTo(r);
            }
            else if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = o as VueArticlesWebDS.ecommerce_articles_webRow;
                if (string.IsNullOrEmpty(ImageUrl))
                {
                    if (config.ECommerce.DocumentBase.ProductImages.UseDocumentBase)
                    {
                        string code = config.ECommerce.DocumentBase.ProductImages.CodeForTiny;
                        switch (_typeImage)
                        {
                        case TypeProduitImage.Petite:
                            code = config.ECommerce.DocumentBase.ProductImages.CodeForSmall;
                            break;

                        case TypeProduitImage.Intermediaire:
                            code = config.ECommerce.DocumentBase.ProductImages.CodeForIntermediate;
                            break;

                        case TypeProduitImage.Tiny:
                            code = config.ECommerce.DocumentBase.ProductImages.CodeForTiny;
                            break;

                        case TypeProduitImage.Thumb:
                            code = config.ECommerce.DocumentBase.ProductImages.CodeForThumb;
                            break;

                        case TypeProduitImage.Detail:
                            code = config.ECommerce.DocumentBase.ProductImages.CodeForDetails;
                            break;

                        case TypeProduitImage.Aucune:
                            this.ImageUrl = ECommerceServer.ResolveResourceUrl(this.ImageUrl);
                            break;
                        }

                        //if (string.IsNullOrEmpty(this.ImageUrl))
                        //{
                        //    this.ImageUrl = _GetResourceUrl(DocBaseHelper.(config.ECommerce.DocumentBase.ProductImages.MainDocumentType,
                        //                            r.art_guid,
                        //                            code));
                        //}
                    }
                    else
                    {
                        switch (_typeImage)
                        {
                        case TypeProduitImage.Petite:
                            this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_smallNull() ? null : r.arw_url_img_small);
                            break;

                        case TypeProduitImage.Intermediaire:
                            this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_intermediateNull() ? (r.Isarw_url_img_imagetteNull() ? null : r.arw_url_img_imagette) : r.arw_url_img_intermediate);
                            break;

                        case TypeProduitImage.Tiny:
                            this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_tinyNull() ? null : r.arw_url_img_tiny);
                            break;

                        case TypeProduitImage.Thumb:
                            this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_imagetteNull() ? null : r.arw_url_img_imagette);
                            break;

                        case TypeProduitImage.Detail:
                            this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_bigNull() ? null : r.arw_url_img_big);
                            break;

                        case TypeProduitImage.Aucune:
                            this.ImageUrl = ECommerceServer.ResolveResourceUrl(this.ImageUrl);
                            break;
                        }
                    }
                }

                if (string.IsNullOrEmpty(this.ImageUrl))
                {
                    this.ImageUrl = ECommerceServer.ResolveResourceUrl(ImageUrlIfNone);
                }

                this.ToolTip       = r.arw_libelle;
                this.AlternateText = r.arw_libelle;
            }
        }
 protected virtual string GetResourceUrl(string url)
 {
     return(ECommerceServer.ResolveResourceUrl(url));
 }
Ejemplo n.º 4
0
        void IEquihiraBindable.BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            int sit_pk = ECommerceServer.SiteId;

            ServerConfigSection config = EConfigurationManager.GetConfig(ECommerceServer.CurrentSite);


            if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                VueArticlesWebDS.ecommerce_articles_webRow r = res.Article.ecommerce_articles_web[0];
                (this as IEquihiraBindable).BindTo(r);
            }
            else if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = o as VueArticlesWebDS.ecommerce_articles_webRow;

                if (config.ECommerce.DocumentBase.ProductImages.UseDocumentBase)
                {
                    string code = config.ECommerce.DocumentBase.ProductImages.CodeForTiny;
                    switch (_typeImage)
                    {
                    case TypeProduitImage.Petite:
                        code = config.ECommerce.DocumentBase.ProductImages.CodeForSmall;
                        break;

                    case TypeProduitImage.Intermediaire:
                        code = config.ECommerce.DocumentBase.ProductImages.CodeForIntermediate;
                        break;

                    case TypeProduitImage.Tiny:
                        code = config.ECommerce.DocumentBase.ProductImages.CodeForTiny;
                        break;

                    case TypeProduitImage.Thumb:
                        code = config.ECommerce.DocumentBase.ProductImages.CodeForThumb;
                        break;

                    case TypeProduitImage.Detail:
                        code = config.ECommerce.DocumentBase.ProductImages.CodeForDetails;
                        break;
                    }
                }
                else
                {
                    switch (_typeImage)
                    {
                    case TypeProduitImage.Petite:
                        this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_smallNull() ? null : r.arw_url_img_small);
                        break;

                    case TypeProduitImage.Intermediaire:
                        this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_intermediateNull() ? (r.Isarw_url_img_imagetteNull() ? null : r.arw_url_img_imagette) : r.arw_url_img_intermediate);
                        break;

                    case TypeProduitImage.Tiny:
                        this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_tinyNull() ? null : r.arw_url_img_tiny);
                        break;

                    case TypeProduitImage.Thumb:
                        this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_imagetteNull() ? null : r.arw_url_img_imagette);
                        break;

                    case TypeProduitImage.Detail:
                        this.ImageUrl = ECommerceServer.ResolveResourceUrl(r.Isarw_url_img_bigNull() ? null : r.arw_url_img_big);
                        break;

                    case TypeProduitImage.Aucune:
                        this.ImageUrl = ECommerceServer.ResolveResourceUrl(this.ImageUrl);
                        break;
                    }
                }

                string url = ECommerceServer.Contexte.GetProductPage(r.arw_sit_pk, r.art_guid, r.art_pk,
                                                                     r.art_ref,
                                                                     r.Isarw_url_persoNull()?null:r.arw_url_perso,
                                                                     (int)r.arw_seg_pk_principale);
                url        = System.IO.Path.ChangeExtension(url, ".amp");
                ProductUrl = Page.ResolveUrl(url);

                if (string.IsNullOrEmpty(this.ImageUrl))
                {
                    this.ImageUrl = ECommerceServer.ResolveResourceUrl(ImageUrlIfNone);
                }

                this.ToolTip = r.arw_libelle;
            }
        }