예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Session.IsClient())
        {
            Response.Redirect(SessionManager.RedirectConnexionLink);
        }

        Client client = Session.GetClient();

        PPCommandes        commandes        = new PPCommandes();
        PPDetailsCommandes detailsCommandes = new PPDetailsCommandes();
        PPVendeurs         vendeurs         = new PPVendeurs();
        PPTypesLivraison   typesLivraison   = new PPTypesLivraison();

        var listeCommandes = from commande in commandes.Values
                             join vendeur in vendeurs.Values on commande.NoVendeur equals vendeur.NoVendeur
                             join typeLivraison in typesLivraison.Values on commande.TypeLivraison equals typeLivraison.CodeLivraison
                             where commande.NoClient == client.NoClient
                             let listeDetails = detailsCommandes.Values.Where(x => x.NoCommande == commande.NoCommande)
                                                select new { Commande = commande, TypeLivraison = typeLivraison, Vendeur = vendeur, Details = listeDetails };

        pnlContent.CardDyn(
            "", "mb-3",
            lbl => lbl.Text = "Historique des commandes",
            body =>
        {
            Table table         = body.TableDyn("", "table table-padding");
            TableHeaderRow hrow = table.ThrDyn();
            hrow.ThdDyn("No Commande");
            hrow.ThdDyn("Nom du vendeur");
            hrow.ThdDyn("Date de la commande");
            hrow.ThdDyn("Prix total avant taxes");

            foreach (var commande in listeCommandes)
            {
                TableRow row = table.TrDyn();

                TableCell cellBtnCommande = row.TdDyn();
                string path = $"Factures/{commande.Commande.NoCommande}.pdf";
                if (File.Exists(Server.MapPath($"~/{path}")))
                {
                    cellBtnCommande.BtnClientDyn("", commande.Commande.NoCommande.ToString(), $"window.open('/{path}'); return false;", "btn btn-outline-secondary btn-block");
                }
                else
                {
                    cellBtnCommande.BtnClientDyn("", commande.Commande.NoCommande.ToString(), $"window.open('/Factures/defaut.pdf'); return false", "btn btn-outline-secondary btn-block");
                }

                TableCell cellLinkVendeur = row.TdDyn();
                cellLinkVendeur.HlinkDYN("", $"~/Pages/Client/Catalogue.aspx?NoVendeur={commande.Vendeur.NoVendeur}", commande.Vendeur.NomAffaires);

                row.TdDyn(commande.Commande.DateCommande.ToString());
                row.TdDyn(commande.Commande.MontantTotAvantTaxes.Value.ToString("N2") + "$");
            }
        });
    }
예제 #2
0
    /*
     * Init
     */

    /// <summary>
    /// Génerer les paniers
    /// </summary>
    private void GenerePaniers()
    {
        Client client = Session.GetClient();

        var panierArticlesParVendeurs = from article in db.articlesEnPanier.Values
                                        join produit in db.produits.Values on article.NoProduit equals produit.NoProduit
                                        where article.NoClient == client.NoClient
                                        select new
        {
            Article = article,
            Produit = produit
        } into articleProduit
        group articleProduit by articleProduit.Article.NoVendeur into g
        join vendeur in db.vendeurs.Values on g.Key equals vendeur.NoVendeur
            select new
        {
            Vendeur  = vendeur,
            Articles = g.ToList()
        };

        foreach (var group in panierArticlesParVendeurs)
        {
            // Ajouter les vendeurs au DropDownList
            string pnlVendeurId = $"pnlVendeur{group.Vendeur.NoVendeur}";
            dictVendeurs.Add(group.Vendeur, pnlVendeurId);
            // Faire les paniers
            pnlPaniersGeneres.CardDyn(
                pnlVendeurId, "mb-3",
                lbl => lbl.HlinkDYN("", $"~/Pages/Client/Catalogue.aspx?NoVendeur={group.Vendeur.NoVendeur}", group.Vendeur.NomAffaires, "text-white"),
                pnlBody =>
            {
                Table tablePanier        = pnlBody.TableDyn("", "table table-hover fake-button");
                TableHeaderRow headerRow = tablePanier.ThrDyn();

                headerRow.ThdDyn("Image");
                headerRow.ThdDyn("Nom");
                headerRow.ThdDyn("Description");
                headerRow.ThdDyn("Poids<br/>(Livre)");
                headerRow.ThdDyn("Quantité commandée");
                headerRow.ThdDyn("Prix individuel");
                headerRow.ThdDyn("Prix");

                TableHeaderCell cellHeaderSupprimerTout = headerRow.ThdDyn();
                cellHeaderSupprimerTout.BtnClientDyn("", "Vider le panier", $"supprimerPanier({client.NoClient}, {group.Vendeur.NoVendeur}); return false;", "btn btn-dark btn-block");

                List <decimal> lstPrixPanier      = new List <decimal>();
                List <decimal> lstPrixPanierAvant = new List <decimal>();
                List <decimal> lstPoidsPanier     = new List <decimal>();

                foreach (var article in group.Articles)
                {
                    decimal prixIndividuel = 0;

                    bool prixIndividuelVente = false;
                    if ((article.Produit.PrixVente.HasValue && article.Produit.PrixVente != article.Produit.PrixDemande) &&
                        (!article.Produit.DateVente.HasValue || article.Produit.DateVente >= DateTime.Now))
                    {
                        prixIndividuel      = article.Produit.PrixVente.Value;
                        prixIndividuelVente = true;
                    }
                    else
                    {
                        prixIndividuel = article.Produit.PrixDemande.Value;
                    }

                    short nbItems           = article.Produit.NombreItems.Value;
                    short nbItemsDansPanier = article.Article.NbItems.Value;

                    TableRow row = tablePanier.TrDyn();

                    string windowLocation = $"window.location.href = '/Pages/Client/InfoProduit.aspx?ID={article.Produit.NoProduit}'";

                    TableCell cellImage = row.TdDyn();
                    cellImage.ImgDyn("", "~/Pictures/" + article.Produit.Photo, "image-panier");
                    cellImage.Attributes.Add("onclick", windowLocation);

                    TableCell cellNom = row.TdDyn(article.Produit.Nom);
                    cellNom.Attributes.Add("onclick", windowLocation);
                    TableCell cellDescription = row.TdDyn(article.Produit.Description);
                    cellDescription.Attributes.Add("onclick", windowLocation);
                    TableCell cellPoids = row.TdDyn(article.Produit.Poids.ToString());
                    cellPoids.Attributes.Add("onclick", windowLocation);

                    TableCell cellQuantite   = row.TdDyn();
                    DropDownList ddlQuantite = cellQuantite.DdlDyn("", $"quantiteArticle({article.Article.NoPanier}, this);", "form-control");
                    // Make sure the label doesn't have values (happens when reloading even though it should be replaced)
                    ddlQuantite.Items.Clear();
                    for (int i = 1; i <= nbItems; i++)
                    {
                        ddlQuantite.Items.Add(i.ToString());
                    }
                    ddlQuantite.SelectedIndex = nbItemsDansPanier - 1;

                    // Prix individuel
                    if (prixIndividuelVente)
                    {
                        TableCell cellPrix = row.TdDyn();
                        cellPrix.CssClass  = "text-right";
                        cellPrix.Attributes.Add("onclick", windowLocation);
                        decimal prixDemande = article.Produit.PrixDemande.Value;
                        cellPrix.LblDyn("", prixDemande.ToString("N2") + "$<br/>", "text-secondary");
                        decimal pourcent = ((prixIndividuel / article.Produit.PrixDemande.Value) * 100) - 100;
                        cellPrix.LblDyn("", $"{pourcent.ToString("N2")}%<br/>", "text-success");
                        cellPrix.LblDyn("", prixIndividuel.ToString("N2") + "$", "text-success");
                        decimal prixNbAvant = prixDemande * nbItemsDansPanier;
                        lstPrixPanierAvant.Add(prixDemande * nbItemsDansPanier);

                        TableCell cellPrixNb = row.TdDyn();
                        cellPrixNb.CssClass  = "text-right";
                        cellPrixNb.Attributes.Add("onclick", windowLocation);
                        cellPrixNb.LblDyn("", prixNbAvant.ToString("N2") + "$<br/>", "text-secondary");
                        decimal prixNb = prixIndividuel * nbItemsDansPanier;
                        lstPrixPanier.Add(prixNb);
                        cellPrixNb.LblDyn("", prixNb.ToString("N2") + "$", "text-success");
                    }
                    else
                    {
                        TableCell cellPrixIndividuel = row.TdDyn(prixIndividuel.ToString("N2") + "$");
                        cellPrixIndividuel.CssClass  = "text-right";
                        cellPrixIndividuel.Attributes.Add("onclick", windowLocation);
                        // Prix
                        decimal prixNb     = prixIndividuel * nbItemsDansPanier;
                        TableCell cellPrix = row.TdDyn(prixNb.ToString("N2") + "$");
                        cellPrix.CssClass  = "text-right";
                        cellPrix.Attributes.Add("onclick", windowLocation);
                        lstPrixPanier.Add(prixNb);
                    }

                    TableCell cellSupprimerArticle = row.TdDyn();
                    cellSupprimerArticle.BtnClientDyn("", "Supprimer l'article", $"supprimerArticle({article.Article.NoPanier}); return false;", "btn btn-dark btn-block");
                }

                if (lstPrixPanier.Count > 0)
                {
                    TableRow rowEnd = tablePanier.TrDyn();
                    rowEnd.TdDyn();
                    rowEnd.TdDyn();
                    rowEnd.TdDyn();
                    rowEnd.TdDyn();
                    rowEnd.TdDyn();
                    rowEnd.TdDyn();
                    TableCell cellPrixTotal = rowEnd.TdDyn();
                    cellPrixTotal.CssClass  = "text-right";
                    cellPrixTotal.LblDyn("", lstPrixPanier.Sum().ToString("N2") + "$");
                    rowEnd.TdDyn();
                }

                decimal poidsMax      = group.Vendeur.PoidsMaxLivraison.Value;
                decimal poidsCommande = group.Articles.Sum(x => x.Produit.Poids * x.Article.NbItems).Value;

                Panel pnlPoids = pnlBody.DivDyn("", "w-100 text-right");
                pnlPoids.LblDyn("", $"Poids de la livraison: {poidsCommande} Livre<br/>", "text-secondary");
                pnlPoids.LblDyn("", $"Poids maximal du vendeur: {group.Vendeur.PoidsMaxLivraison} Livre", "text-secondary");

                if (poidsMax < poidsCommande)
                {
                    pnlBody.BtnDyn("", "Le panier est trop lourd de " + (poidsCommande - poidsMax), null, "btn btn-danger btn-block").Enabled = false;
                }
                else
                {
                    Button btn = pnlBody.BtnDyn("", "Commander le panier", btnCommander_OnClick, "btn btn-secondary btn-block mt-3");
                    btn.Attributes.Add("data-vendeur", group.Vendeur.NoVendeur.ToString());
                }
            });
        }
    }
예제 #3
0
    private void PageVendeur(Panel panel, Vendeur vendeur = null, String categorie = null, int nbArticleParPage = 15, int page = 1, int TypeRecherche = 0, string rechercher = "", Boolean effectuerRecherche = false)
    {
        lblProduits.Text = vendeur == null? "Produits de tous les vendeurs": "Produits du vendeur " + vendeur.NomAffaires;
        PPProduits            produits  = new PPProduits();
        IEnumerable <Produit> enumProds = produits.Values.Where(p => p.NombreItems != -1 || p.Disponibilité == true);

        enumProds = vendeur == null ? enumProds : enumProds.Where(c => c.NoVendeur == vendeur.NoVendeur);
        enumProds = categorie == null ? enumProds : enumProds.Where(c => c.NoCategorie.ToString().Equals(categorie));
        if (effectuerRecherche)
        {
            switch (TypeRecherche)
            {
            case 0:
                enumProds = enumProds.Where(p => p.DateCreation.ToString().Contains(rechercher));
                break;

            case 1:
                enumProds = enumProds.Where(p => p.NoProduit.ToString().Contains(rechercher));
                break;

            case 2:
                //la recherche s'effectue sur seulement 1 catégorie.
                List <Categorie> cat = categories.Values.Where(c => c.Description.Contains(rechercher)).ToList();
                if (cat.Count == 1)
                {
                    enumProds = enumProds.Where(p => p.NoCategorie.Equals(cat.First().NoCategorie));
                }
                break;

            case 3:
                enumProds = enumProds.Where(p => p.Description.Contains(rechercher));
                break;
            }
        }
        if (int.TryParse(Request.QueryString["Tri"], out int noTri))
        {
            ddlTri.SelectedIndex = noTri;
        }
        switch (ddlTri.SelectedIndex)
        {
        case 0:
            enumProds = enumProds.OrderBy(c => c.NoCategorie).ThenBy(c => c.Description);
            break;

        case 1:
            enumProds = enumProds.OrderBy(c => c.NoProduit);
            break;

        case 2:
            enumProds = enumProds.OrderBy(c => c.NoCategorie);
            break;

        case 3:
            enumProds = enumProds.OrderBy(c => c.DateCreation);
            break;
        }
        List <Produit> nouvelleListe = enumProds.ToList();

        int    index2     = 0;
        Panel  rows       = panelTable.DivDyn("", "");
        Double nbPagesMax = 1;

        if (nbArticleParPage != 0)
        {
            nbPagesMax = Math.Ceiling(Double.Parse((nouvelleListe.Count() / nbArticleParPage).ToString())) + 1;
        }
        ddlNbItemPage.SelectedValue = nbArticleParPage.ToString();
        if (vendeur != null)
        {
            ddlNomVendeur.SelectedValue = vendeur.NoVendeur.ToString();
            string image = "";

            if (vendeur.Configuration != null)
            {
                if (vendeur.Configuration.Contains(";"))
                {
                    string[] liste = vendeur.Configuration.Split(';');

                    if (liste.Length == 2)
                    {
                        if (liste[0] != "")
                        {
                            image = "~/Logos/" + liste[0];
                        }
                    }
                    else if (liste.Length == 3)
                    {
                        if (liste[0] != "")
                        {
                            image = "~/Logos/" + liste[0];
                        }
                    }
                }
                else
                {
                    image = "~/Logos/" + vendeur.Configuration;
                }
            }

            if (image != "")
            {
                imgLogo.ImageUrl = image;
                imgLogo.Visible  = true;
            }
        }
        else
        {
            ddlNomVendeur.SelectedValue = "";
        }

        for (int nbPage = 1; nbPage <= nbPagesMax; nbPage++)
        {
            HtmlGenericControl li = new HtmlGenericControl("li");
            li.Attributes["class"] = "page-item " + ((nbPage == page) ? "disabled" : "");
            pagination.Controls.Add(li);

            HtmlGenericControl anchor = new HtmlGenericControl("a");
            anchor.Attributes["class"] = "page-link";
            string strUrl = "/Pages/Client/Catalogue.aspx?";
            if (vendeur != null)
            {
                strUrl += "NoVendeur=" + vendeur.NoVendeur + "&";
            }
            if (categorie != null)
            {
                strUrl += "NoCategorie=" + categorie + "&";
            }
            strUrl += "NbArticles=" + nbArticleParPage.ToString() + "&Page=" + nbPage.ToString();
            if (effectuerRecherche)
            {
                strUrl += "&TypeRecherche=" + Request.QueryString["TypeRecherche"] + "&Recherche=" + Request.QueryString["Recherche"];
            }
            anchor.Attributes.Add("href", strUrl + "&Tri=" + ddlTri.SelectedIndex);
            anchor.InnerText = nbPage.ToString();
            li.Controls.Add(anchor);
        }
        int nbArticleAffiche = 0;

        for (int indexItem = 0; indexItem < nouvelleListe.Count(); indexItem++)
        {
            if (nbArticleParPage == 0 || (indexItem >= ((page - 1) * nbArticleParPage) && indexItem < (page * nbArticleParPage)))
            {
                if (nbArticleAffiche % 3 == 0)
                {
                    rows = panelTable.DivDyn("", "row");
                    index2++;
                }
                string strCategorie = "";
                foreach (Categorie cat in categories.Values)
                {
                    if (cat.NoCategorie.Equals(nouvelleListe[indexItem].NoCategorie))
                    {
                        strCategorie = cat.Description;
                        break;
                    }
                }
                Panel     panelCard            = rows.DivDyn("", "col-fhd-4 mb-3");
                Panel     card                 = panelCard.DivDyn("", "card");
                Panel     panelTitreCategories = card.DivDyn("", "card-header fake-button");
                Table     tableT               = panelTitreCategories.TableDyn("", "");
                TableRow  rowt                 = tableT.TrDyn();
                TableCell cell1                = rowt.TdDyn();
                cell1.ImgDyn("", "~/Pictures/" + nouvelleListe[indexItem].Photo, "imgResize");
                TableCell cell2 = rowt.TdDyn();
                cell2.LblDyn("", " " + nouvelleListe[indexItem].Nom, "card-title h6");
                cell2.LblDyn("", " (#" + nouvelleListe[indexItem].NoProduit.ToString() + ")  <br/>Catégorie: " + strCategorie, "card-title h6");
                if (couleurTexte != "")
                {
                    cell2.ForeColor = System.Drawing.ColorTranslator.FromHtml(couleurTexte);
                }
                bool EstEnRupture = nouvelleListe[indexItem].NombreItems == 0 ? true : false;
                if (EstEnRupture)
                {
                    cell2.LblDyn("", " Rupture de stock!", "card-title h6 text-uppercase font-weight-bold text-danger");
                }
                panelTitreCategories.Attributes.Add("data-toggle", "collapse");
                panelTitreCategories.Attributes.Add("data-target", "#Contenu_ContenuPrincipal_collapsePanier" + indexItem.ToString() + index2.ToString());
                panelTitreCategories.Attributes.Add("aria-expanded", "false");
                panelTitreCategories.Attributes.Add("aria-controls", "Contenu_ContenuPrincipal_collapsePanier" + indexItem.ToString() + index2.ToString());

                Panel collapsable;
                //body des categories

                collapsable = card.DivDyn("collapsePanier" + indexItem.ToString() + index2.ToString(), "collapse collapse");

                //colones header
                Panel panelBodyCat = collapsable.DivDyn("", "card-body");

                HyperLink hlink = new HyperLink();
                hlink.NavigateUrl = "/Pages/Client/InfoProduit.aspx?ID=" + nouvelleListe[indexItem].NoProduit;
                hlink.Text        = "Détails du produit";
                hlink.Attributes.Add("role", "button");
                hlink.CssClass = "btn btn-info w-100";
                panelBodyCat.Controls.Add(hlink);
                //panelBodyCat.LblDyn("", "Catégorie: " + strCategorie);
                Table          table    = panelBodyCat.TableDyn("", "table");
                TableHeaderRow rowTable = table.ThrDyn();


                rowTable.ThdDyn("Date de parution");
                rowTable.ThdDyn("Poids");
                rowTable.ThdDyn("Prix");
                rowTable.ThdDyn("Qte");

                TableRow rowTableB = table.TrDyn();

                rowTableB.TdDyn(nouvelleListe[indexItem].DateCreation.GetValueOrDefault().Date.ToShortDateString());
                rowTableB.TdDyn(nouvelleListe[indexItem].Poids.Value.ToString("N2") + " Lbs");
                rowTableB.TdDyn(nouvelleListe[indexItem].PrixDemande.Value.ToString("N2") + " $");
                rowTableB.TdDyn(nouvelleListe[indexItem].NombreItems.Value.ToString());

                if (!EstEnRupture)
                {
                    TableRow rowTableC = table.TrDyn();

                    TableCell tbcell1 = rowTableC.TdDyn();
                    tbcell1.LblDyn("", "Quantité à commander: ");
                    TableCell    tbcell2 = rowTableC.TdDyn();
                    DropDownList ddl     = new DropDownList();
                    for (int i = 0; i < nouvelleListe[indexItem].NombreItems.Value; i++)
                    {
                        ddl.Items.Add((i + 1).ToString());
                    }
                    ddl.SelectedIndex = 0;
                    ddl.CssClass      = "form-control";
                    tbcell2.Controls.Add(ddl);
                    TableCell tbcell3 = rowTableC.TdDyn();

                    Button btn = tbcell3.BtnClientDyn("", "Ajouter au panier", $"ajouterArticle({Session.GetClient().NoClient},{nouvelleListe[indexItem].NoProduit},'{ddl.ClientID}');return false;", "btn btn-success");
                    btn.Attributes.Add("data-toggle", "modal");
                    btn.Attributes.Add("data-target", "#Contenu_ContenuPrincipal_myModal" + indexItem.ToString() + index2.ToString());
                }
                nbArticleAffiche++;
            }
        }
        if (nouvelleListe.Count() == 0)
        {
            panelTable.TbDyn("", "Il n'y a pas de produit qui correspond aux critères de recherche", 100, "w-100 text-center");
        }
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Session.IsClient())
        {
            Response.Redirect(SessionManager.RedirectConnexionLink);
        }
        if (!IsPostBack)
        {
            var url = Request.UrlReferrer;
            if (url != null)
            {
                ViewState["PreviousPageUrl"] = url.ToString();
            }
        }
        long produitARG;

        // se faire passer la valeur du produit par ce tag [ID] i.e : ?ID=noProduit
        if (long.TryParse(Request.QueryString["ID"], out produitARG))
        {
            //long produitARG = 1200001;
            PPProduits produits   = new PPProduits();
            Produit    monProduit = new Produit(null);
            foreach (Produit prod in produits.Values.Where(x => x.NoProduit == (long?)produitARG))
            {
                monProduit = produits.Values.Where(x => x.NoProduit == (long?)produitARG).ToList().First();
            }

            if (monProduit.NoProduit != null)
            {
                panelImage.Visible = true;
                Image img = panelImage.ImgDyn("", "~/Pictures/" + monProduit.Photo, "img-fluid");


                Table     table   = panelDetails.TableDyn("", "table table-striped");
                TableRow  rowDet  = table.TrDyn();
                TableCell colDet1 = rowDet.TdDyn();
                TableCell colDet2 = rowDet.TdDyn();

                //nom
                colDet1.LblDyn("", "Nom du produit", "text-info h3");
                colDet2.LblDyn("", monProduit.Nom, "h3 text-success");

                PPCategories categos = new PPCategories();
                Categorie    categ   = new Categorie(null);
                foreach (Categorie cat in categos.Values.Where(x => x.NoCategorie == monProduit.NoCategorie))
                {
                    categ = cat;
                }
                if (categ.NoCategorie != null)
                {
                    //Catégorie
                    rowDet  = table.TrDyn();
                    colDet1 = rowDet.TdDyn();
                    colDet2 = rowDet.TdDyn();

                    colDet1.LblDyn("", "Catégorie", "text-info h5");
                    colDet2.LblDyn("", categ.Description, "h5");

                    //Description
                    rowDet  = table.TrDyn();
                    colDet1 = rowDet.TdDyn();
                    colDet2 = rowDet.TdDyn();

                    colDet1.LblDyn("", "Description du produit", "text-info h5");
                    colDet2.LblDyn("", monProduit.Description, "h5");

                    //Prix demandé
                    rowDet  = table.TrDyn();
                    colDet1 = rowDet.TdDyn();
                    colDet2 = rowDet.TdDyn();

                    colDet1.LblDyn("", "Prix demandé", "text-info h5");
                    colDet2.LblDyn("", monProduit.PrixDemande.Value.ToString("N2") + " $", "h5");

                    //Prix Vente
                    rowDet  = table.TrDyn();
                    colDet1 = rowDet.TdDyn();
                    colDet2 = rowDet.TdDyn();

                    colDet1.LblDyn("", "Prix de vente", "text-info h5");
                    if (monProduit.PrixVente.Value != monProduit.PrixDemande.Value)
                    {
                        colDet2.LblDyn("", monProduit.PrixVente.Value.ToString("N2") + " $", "h5");
                    }
                    else
                    {
                        colDet2.LblDyn("", "Pas en vente", "h5");
                    }

                    //qte
                    rowDet  = table.TrDyn();
                    colDet1 = rowDet.TdDyn();
                    colDet2 = rowDet.TdDyn();

                    colDet1.LblDyn("", "Quantité disponible", "text-info h5");
                    if (monProduit.NombreItems == 0)
                    {
                        colDet2.LblDyn("", "Aucun article disponible", "h5");
                    }
                    else
                    {
                        colDet2.LblDyn("", monProduit.NombreItems.ToString(), "h5");
                    }


                    //Poids
                    rowDet  = table.TrDyn();
                    colDet1 = rowDet.TdDyn();
                    colDet2 = rowDet.TdDyn();

                    colDet1.LblDyn("", "Poids du produit", "text-info h5");
                    colDet2.LblDyn("", monProduit.Poids.Value.ToString("N2") + " Lbs", "h5");

                    //Date de vente
                    rowDet  = table.TrDyn();
                    colDet1 = rowDet.TdDyn();
                    colDet2 = rowDet.TdDyn();

                    string dateVente = "indéfénie";
                    if (monProduit.DateVente.HasValue)
                    {
                        dateVente = monProduit.DateVente.Value.ToString("yyyy/MM/dd");
                    }

                    colDet1.LblDyn("", "Fin de la vente", "text-info h5");
                    colDet2.LblDyn("", dateVente, "h5");

                    if (monProduit.NombreItems != 0)
                    {
                        rowDet = table.TrDyn();

                        colDet1 = rowDet.TdDyn();
                        colDet1.LblDyn("", "Quantité à commander: ", "text-info h5");
                        colDet2 = rowDet.TdDyn();
                        DropDownList ddl = new DropDownList();
                        for (int i = 0; i < monProduit.NombreItems.Value; i++)
                        {
                            ddl.Items.Add((i + 1).ToString());
                        }
                        ddl.SelectedIndex = 0;
                        ddl.CssClass      = "form-control w-25 d-inline align-middle mr-3";
                        colDet2.Controls.Add(ddl);
                        TableCell colDet3 = rowDet.TdDyn();
                        Button    btn     = colDet2.BtnClientDyn("", "Ajouter au panier", $"ajouterArticle({Session.GetClient().NoClient},{monProduit.NoProduit},'{ddl.ClientID}');return false;", "btn btn-success d-inline");
                    }
                    panelDetails.BtnDyn("", "Retour", retour, "btn  btn-outline-dark classBoutonsMargins100");


                    Button btnContactV = panelDetails.BtnDyn("", "Contacter le vendeur", btnCourrielVendeur_Click, "btn btn-secondary classBoutonsMargins100");
                    btnContactV.CommandArgument = monProduit.NoVendeur.ToString();
                    btnContactV.CommandName     = monProduit.Nom;
                }
            }
        }
    }