private void DoBind(VueArticlesWebDS.ecommerce_articles_webRow r, ArticlesReferencesDS references) { var dt = ArticleDataDetails.FromDataRow <ArticleDataDetails>(r); var segDS = ECommerceServer.DataCache.Segmentation; var rSeg = segDS.ecommerce_segmentation.FindByseg_pk(r.arw_seg_pk_principale); if (rSeg != null) { dt.Segmentation = rSeg.seg_libelle; } if (!r.Isart_mar_pkNull()) { var marDS = ECommerceServer.DataCache.Marques; var rMar = marDS.catalog_marques.FindBymar_pk(r.art_mar_pk); if (rMar != null) { dt.Marque = rMar.mar_libelle; } } if (references != null) { var ean13 = (from z in references.catalog_articles_references where z.rar_type.Equals("EAN13") && z.rar_est_principal select z).FirstOrDefault(); if (ean13 != null) { dt.Ean13 = ean13.rar_reference; } } this.Value = JsonHelper.Serialize(dt); }
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 = ""; } } }