コード例 #1
0
        public void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                VueArticlesWebDS.ecommerce_articles_webRow r = res.Article.ecommerce_articles_web[0];
                BindTo(r);
            }
            if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = (o as VueArticlesWebDS.ecommerce_articles_webRow);
                this.Text = "";

                decimal seg_pk = r.arw_seg_pk_principale;

                SegmentationWebDS.ecommerce_segmentationRow r2 = ECommerceServer.DataCache.Segmentation.ecommerce_segmentation.FindByseg_pk(seg_pk);
                if (r2 != null)
                {
                    this.Text        = r2.seg_libelle;
                    this.NavigateUrl = ECommerceServer.Contexte.GetSearchPagePath(seg_pk, Guid.Empty, -1, null, null, true);
                }
                else
                {
                    this.Text        = TextIfEmpty;
                    this.NavigateUrl = ECommerceServer.Contexte.GetSearchPagePath(-1, Guid.Empty, -1, null, null, true);
                }
            }
        }
コード例 #2
0
 void IEquihiraBindable.BindTo(object o)
 {
     if (o is ArticlesDataSourceResult)
     {
         _article = o as ArticlesDataSourceResult;
     }
 }
コード例 #3
0
 /// <summary>
 /// Effectue le binding sur l'item de données
 /// </summary>
 /// <param name="o"></param>
 public void BindTo(object o)
 {
     if (o is ArticlesDataSourceResult)
     {
         _article = o as ArticlesDataSourceResult;
     }
 }
コード例 #4
0
 /// <summary>
 /// Effectue le databinding vers l'objet de données
 /// </summary>
 public virtual void BindTo(object o)
 {
     if (o == null)
     {
         return;
     }
     if (o is MarquesDS.catalog_marquesRow)
     {
         MarquesDS.catalog_marquesRow r = o as MarquesDS.catalog_marquesRow;
         if (r.Ismar_commentaire_publicNull())
         {
             return;
         }
         if (!string.IsNullOrEmpty(TextFormat))
         {
             this.Text = string.Format(TextFormat, r.mar_commentaire_public);
         }
         else
         {
             this.Text = r.mar_commentaire_public;
         }
     }
     else if (o is RechercheMarque)
     {
         this.Visible = false;
     }
     else if (o is ArticlesDataSourceResult)
     {
         ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
         if (res.Marque != null && res.Marque.catalog_marques.Count == 1)
         {
             MarquesDS.catalog_marquesRow r = res.Marque.catalog_marques[0];
             if (r.Ismar_commentaire_publicNull())
             {
                 return;
             }
             if (!string.IsNullOrEmpty(TextFormat))
             {
                 this.Text = string.Format(TextFormat, r.mar_commentaire_public);
             }
             else
             {
                 this.Text = r.mar_commentaire_public;
             }
         }
         else
         {
             this.Visible = false;
         }
     }
     else if (o is VueArticlesWebDS.ecommerce_articles_webRow)
     {
         VueArticlesWebDS.ecommerce_articles_webRow r = o as VueArticlesWebDS.ecommerce_articles_webRow;
         MarquesDS.catalog_marquesRow mar             = ECommerceServer.DataCache.Marques.catalog_marques.FindBymar_pk(r.art_mar_pk);
         BindTo(mar);
     }
 }
コード例 #5
0
        public void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                VueArticlesWebDS.ecommerce_articles_webRow r = res.Article.ecommerce_articles_web[0];

                MarquesDS.catalog_marquesRow r2 = null;
                if (!r.Isart_mar_pkNull())
                {
                    r2 = ECommerceServer.DataCache.Marques.catalog_marques.FindBymar_pk(r.art_mar_pk);
                }
                if (r2 != null)
                {
                    this.Text = r2.mar_libelle;

                    if (r2.Table.Columns.Contains("mar_url_redirection") && !r2.IsNull("mar_url_redirection"))
                    {
                        this.NavigateUrl = ResolveUrl(r2["mar_url_redirection"] as string);
                    }
                    else
                    {
                        this.NavigateUrl = ECommerceServer.Contexte.GetSearchPagePath(-1, Guid.Empty, r2.mar_pk, null, null, true);
                    }
                }
                else
                {
                    this.Text = "";
                }
            }
            if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = (o as VueArticlesWebDS.ecommerce_articles_webRow);
                this.Text = "";

                if (!r.Isart_mar_pkNull())
                {
                    MarquesDS.catalog_marquesRow r2 = ECommerceServer.DataCache.Marques.catalog_marques.FindBymar_pk(r.art_mar_pk);
                    if (r2 != null)
                    {
                        this.Text        = r2.mar_libelle;
                        this.NavigateUrl = ECommerceServer.Contexte.GetSearchPagePath(-1, Guid.Empty, r2.mar_pk, null, null, true);
                    }
                }
                else
                {
                    this.Text = "";
                }
            }
        }
コード例 #6
0
        /// <summary>
        /// Effectue le databinding vers l'objet de données
        /// </summary>
        public void BindTo(object o)
        {
            this.Visible = false;
            foreach (Control c in Controls)
            {
                if (c is IEquihiraBindable)
                {
                    (c as IEquihiraBindable).BindTo(o);
                }
            }
            if (o == null)
            {
                return;
            }

            if (o is MarquesDS.catalog_marquesRow)
            {
                MarquesDS.catalog_marquesRow r = o as MarquesDS.catalog_marquesRow;
                if (!r.Ismar_commentaire_publicNull())
                {
                    this.Visible = true;
                }
                else if (!r.Ismar_url_imageNull())
                {
                    this.Visible = true;
                }
                else if (!r.Ismar_url_site_marqueNull())
                {
                    this.Visible = true;
                }
            }
            else if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                if (res.Marque != null && res.Marque.catalog_marques.Count == 1)
                {
                    BindTo(res.Marque.catalog_marques[0]);
                }
            }
            else if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = o as VueArticlesWebDS.ecommerce_articles_webRow;
                MarquesDS.catalog_marquesRow mar             = ECommerceServer.DataCache.Marques.catalog_marques.FindBymar_pk(r.art_mar_pk);
                BindTo(mar);
            }
        }
コード例 #7
0
        public virtual void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }

            foreach (Control c in Controls)
            {
                if (c is IEquihiraBindable)
                {
                    (c as IEquihiraBindable).BindTo(o);
                }
            }

            if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                VueArticlesWebDS.ecommerce_articles_webRow r = res.Article.ecommerce_articles_web[0];
                string url = ECommerceServer.Contexte.GetProductPage(r.arw_sit_pk, r.art_guid, r.art_pk,
                                                                     r.art_ref,
                                                                     r.arw_url_perso,
                                                                     (int)r.arw_seg_pk_principale);
                if (PourPageAmp)
                {
                    url = System.IO.Path.ChangeExtension(url, ".amp");
                }
                this.NavigateUrl = url;
                this.ToolTip     = r.arw_libelle;
            }
            if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = o as VueArticlesWebDS.ecommerce_articles_webRow;
                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);
                if (PourPageAmp)
                {
                    url = System.IO.Path.ChangeExtension(url, ".amp");
                }
                this.NavigateUrl = url;
                this.ToolTip     = r.arw_libelle;
            }
        }
コード例 #8
0
        //protected override void OnPreRender(EventArgs e)
        //{
        //    if (this.Parent is ProductItemTemplate)
        //    {
        //        this.Text = (this.Parent as ProductItemTemplate)._parent.Libelle;
        //    }
        //    base.OnPreRender(e);
        //}

        public override void BindTo(object o)
        {
            base.BindTo(o);

            foreach (Control c in Controls)
            {
                if (c is IEquihiraBindable)
                {
                    (c as IEquihiraBindable).BindTo(o);
                }
            }

            if (o == null)
            {
                return;
            }
            if (o != null && o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                VueArticlesWebDS.ecommerce_articles_webRow r = res.Article.ecommerce_articles_web[0];
                BindTo(o);
            }
            if (o is PromotionsLotsRepeater.ProduitLotRepeaterItemData)
            {
                PromotionsLotsRepeater.ProduitLotRepeaterItemData res = o as PromotionsLotsRepeater.ProduitLotRepeaterItemData;
                VueArticlesWebDS.ecommerce_articles_webRow        r   = res.ArticleLot;
                BindTo(r);
            }
            if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = o as VueArticlesWebDS.ecommerce_articles_webRow;
                if (r.arw_libelle.Length > MaxLength)
                {
                    string t = r.arw_libelle.Substring(0, MaxLength);
                    t        += "...";
                    this.Text = string.Format(Format, t);
                }
                else
                {
                    this.Text = string.Format(Format, r.arw_libelle);
                }
                this.ToolTip = this.Text;
            }
        }
コード例 #9
0
        public void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                VueArticlesWebDS.ecommerce_articles_webRow r = res.Article.ecommerce_articles_web[0];

                Afficher(r);
            }
            if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = (o as VueArticlesWebDS.ecommerce_articles_webRow);
                Afficher(r);
            }
        }
コード例 #10
0
        /// <summary>
        /// Effectue le databinding de contrôle
        /// </summary>
        /// <param name="o"></param>
        public virtual void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            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 VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = o as VueArticlesWebDS.ecommerce_articles_webRow;

                ArticleGuid      = r.art_guid;
                ArticleReference = r.art_ref;
                ArticleLibelle   = r.arw_libelle;
            }
        }
コード例 #11
0
        public virtual void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                VueArticlesWebDS.ecommerce_articles_webRow r = res.Article.ecommerce_articles_web[0];
                BindTo(r);
            }
            if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                VueArticlesWebDS.ecommerce_articles_webRow r = o as VueArticlesWebDS.ecommerce_articles_webRow;
                string url = ECommerceServer.Contexte.GetProductPage(r.arw_sit_pk, r.art_guid, r.art_pk,
                                                                     r.art_ref,
                                                                     r.Isarw_url_persoNull() ? "" : r.arw_url_perso,
                                                                     (int)r.arw_seg_pk_principale);

                StringBuilder blr = new StringBuilder();
                blr.Append(Page.Request.Url.Scheme);
                blr.Append("://");
                blr.Append(Page.Request.Url.Host);
                blr.Append(VirtualPathUtility.ToAbsolute(url));
                url = blr.ToString();

                blr = new StringBuilder();
                blr.Append("mailto:");
                blr.Append("?subject=");
                blr.Append(Prepare(Subject, r, url));
                blr.Append("&");
                blr.Append("body=");
                blr.Append(Prepare(Content, r, url));

                this.NavigateUrl = blr.ToString();
            }
        }
コード例 #12
0
        internal static List <ContexteBreadCrumbItem> GetContenuBreadCrumb(ECommercePage pg, ArticlesDataSourceResult article)
        {
            List <ContexteBreadCrumbItem> cur = new List <ContexteBreadCrumbItem>();

            var rArt = article.Article.ecommerce_articles_web.FirstOrDefault();

            if (rArt == null)
            {
                return(cur);
            }

            if (!rArt.Isarw_seg_pk_principaleNull())
            {
                var segDS = ECommerceServer.DataCache.ToutesLesSegmentations;
                var seg   = segDS.catalog_segmentations.FindByseg_pk(rArt.arw_seg_pk_principale);
                while (true)
                {
                    if (seg == null)
                    {
                        break;
                    }
                    var url = ECommerceServer.Contexte.GetSearchPagePath(seg.seg_pk, Guid.Empty, -1, null, null, true);
                    cur.Insert(0, new ContexteBreadCrumbItem()
                    {
                        Url = url, Label = seg.seg_libelle
                    });
                    if (!seg.Isseg_parent_seg_pkNull())
                    {
                        seg = segDS.catalog_segmentations.FindByseg_pk(seg.seg_parent_seg_pk);
                        if (seg == null)
                        {
                            break;
                        }
                        if (ECommerceServer.CurrentSite.SegmentRacineId == seg.seg_pk)
                        {
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
            cur.Add(new ContexteBreadCrumbItem()
            {
                Url = pg.Request.RawUrl, Label = rArt.arw_libelle
            });
            return(cur);
        }
コード例 #13
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;
            }
        }
コード例 #14
0
        public void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                this.Text = "";
                foreach (ArticlesAttributsDS.catalog_articles_attributsRow r in res.Attributs.catalog_articles_attributs)
                {
                    if (r.att_atd_pk.Equals(AttributeGuid))
                    {
                        AttributsValeursDS.catalog_attributsvaleursRow rAtt = null;

                        if (!r.Isatt_valeur_texteNull())
                        {
                            this.Text = r.att_valeur_texte;
                        }
                        else if (!r.Isatt_valeur_texte_longNull())
                        {
                            this.Text = r.att_valeur_texte_long;
                        }
                        else if (!r.Isatt_valeur_numNull())
                        {
                            this.Text = r.att_valeur_num.ToString(Format);
                        }
                        else if (!r.Isatt_valeur_dateNull())
                        {
                            this.Text = r.att_valeur_date.ToString(Format);
                        }

                        if (!r.Isatt_atv_valeurNull())
                        {
                            rAtt = ECommerceServer.DataCache.GetAttributsValeurs(r.att_atd_pk).catalog_attributsvaleurs.FindByatv_atd_pkatv_valeur(r.att_atd_pk, r.att_atv_valeur);
                            if (rAtt != null)
                            {
                                if (rAtt.Table.Columns.Contains("atv_url_redirection") && !rAtt.IsNull("atv_url_redirection"))
                                {
                                    this.NavigateUrl = ResolveUrl(rAtt["atv_url_redirection"] as string);
                                    return;
                                }
                            }
                        }

                        CriteresDS.catalog_criteresRow crit;
                        crit = ECommerceServer.DataCache.Criteres.catalog_criteres.FindBycri_guidcri_rjs_id(r.att_atd_pk, ECommerceServer.RjsId);

                        if (crit == null)
                        {
                            this.Visible = false;
                            return;
                        }



                        foreach (CriteresDS.catalog_criteresvaleursRow v in crit.Getcatalog_criteresvaleursRows())
                        {
                            if (!r.Isatt_valeur_texteNull() &&
                                v.crv_label.Equals(r.att_valeur_texte))
                            {
                                RechercheCritereValeur rec = new RechercheCritereValeur();
                                rec.CritereGuid = AttributeGuid;
                                rec.ValueText   = r.Isatt_valeur_texteNull() ? "" : r.att_valeur_texte;
                                rec.ValueGuid   = v.crv_guid;

                                this.NavigateUrl = ECommerceServer.Contexte.GetSearchPagePath(-1, Guid.Empty, -1, null, new RechercheCritereValeur[]
                                {
                                    rec
                                }, true);
                                break;
                            }
                        }
                    }
                }
            }
        }
コード例 #15
0
        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) && !RenderAsText)
                {
                    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 = _GetResourceUrl(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 = _GetResourceUrl(r.Isarw_url_img_smallNull() ? null : r.arw_url_img_small);
                            break;

                        case TypeProduitImage.Intermediaire:
                            this.ImageUrl = _GetResourceUrl(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 = _GetResourceUrl(r.Isarw_url_img_tinyNull() ? null : r.arw_url_img_tiny);
                            break;

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

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

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

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

                switch (LinkType)
                {
                case TypeLienProduit.Detail:
                    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);
                    if (PourPageAmp)
                    {
                        url = System.IO.Path.ChangeExtension(url, ".amp");
                    }
                    this.NavigateUrl = url;
                    break;

                case TypeLienProduit.Image:
                    this.NavigateUrl = _GetResourceUrl(r.Isarw_url_img_bigNull() ? null : r.arw_url_img_big);
                    if (this.NavigateUrl.Equals(this.ImageUrl, StringComparison.InvariantCultureIgnoreCase))
                    {
                        if (CacherSiAucunZoom)
                        {
                            this.Visible = false;
                        }
                    }
                    if (!IsZoomable())
                    {
                        break;
                    }
                    this.ToolTip = r.arw_libelle;
                    break;
                }

                this.ToolTip = r.arw_libelle;
                this.Text    = r.arw_libelle;
            }
        }
コード例 #16
0
        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;
            }
        }
コード例 #17
0
        /// <summary>
        /// Effectue le databinding vers l'objet de données
        /// </summary>
        public virtual void BindTo(object o)
        {
            if (o == null)
            {
                return;
            }
            if (o is MarquesDS.catalog_marquesRow)
            {
                MarquesDS.catalog_marquesRow r = o as MarquesDS.catalog_marquesRow;
                if (!string.IsNullOrEmpty(TextFormat))
                {
                    this.Text = string.Format(TextFormat, r.mar_libelle);
                }
                else
                {
                    this.Text = r.mar_libelle;
                }
                switch (TypeLien)
                {
                case TypeMarqueLink.PagePersoOuMoteur:
                    try
                    {
                        if (r.Table.Columns.Contains("mar_url_redirection") && !r.IsNull("mar_url_redirection"))
                        {
                            this.NavigateUrl = ResolveUrl(r["mar_url_redirection"] as string);
                        }
                    }
                    catch
                    {
                        goto case TypeMarqueLink.MoteurDeRecherche;
                    }
                    break;

                case TypeMarqueLink.MoteurDeRecherche:
                    this.NavigateUrl = ECommerceServer.Contexte.GetSearchPagePath(-1,
                                                                                  Guid.Empty,
                                                                                  r.mar_pk,
                                                                                  null,
                                                                                  null,
                                                                                  true);
                    break;

                case TypeMarqueLink.SiteWeb:
                    break;
                }
            }
            else if (o is RechercheMarque)
            {
                RechercheMarque r = o as RechercheMarque;
                if (!string.IsNullOrEmpty(TextFormat))
                {
                    this.Text = string.Format(TextFormat, r.Label);
                }
                else
                {
                    this.Text = r.Label;
                }
                this.NavigateUrl = ECommerceServer.Contexte.GetSearchPagePath(-1,
                                                                              Guid.Empty,
                                                                              r.Id,
                                                                              null,
                                                                              null,
                                                                              true);
            }
            else if (o is ArticlesDataSourceResult)
            {
                ArticlesDataSourceResult res = o as ArticlesDataSourceResult;
                if (res.Marque != null && res.Marque.catalog_marques.Count == 1)
                {
                    MarquesDS.catalog_marquesRow r = res.Marque.catalog_marques[0];
                    if (!string.IsNullOrEmpty(TextFormat))
                    {
                        this.Text = string.Format(TextFormat, r.mar_libelle);
                    }
                    else
                    {
                        this.Text = r.mar_libelle;
                    }
                    this.NavigateUrl = ECommerceServer.Contexte.GetSearchPagePath(-1,
                                                                                  Guid.Empty,
                                                                                  r.mar_pk,
                                                                                  null, null, true);
                }
                else
                {
                    this.Visible = false;
                }
            }
            if (o is VueArticlesWebDS.ecommerce_articles_webRow)
            {
                ContexteProvider prv = ECommerceServer.Contexte;
            }
        }