/// <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);
     }
 }
        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 = "";
                }
            }
        }
        /// <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);
            }
        }
        /// <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;
            }
        }