Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public static void main()
        {
            bool quitter = true;

            while (quitter == true)
            {
                Console.WriteLine("Projet VeloMax");
                Console.WriteLine("MENU");
                Console.WriteLine("1: Gestion des pieces de rechange\n" +
                                  "2: Gestions des Velos\n" +
                                  "3: Gestion des clients\n" +
                                  "4: Gestion des fournisseurs \n" +
                                  "5: Gestion des commandes\n" +
                                  "6: Gestion du stock\n" +
                                  "7: Module statistique\n" +
                                  "8: Exports");

                int choix = Convert.ToInt32(Console.ReadLine());
                Console.Clear();
                switch (choix)
                {
                case 1:
                    Console.WriteLine("Gestion pièces de rechange");
                    Console.WriteLine("1: Creation pieces\n" +
                                      "2: Modification pièce\n" +
                                      "3: Suppression pieces\n");
                    int choix2 = Convert.ToInt32(Console.ReadLine());
                    switch (choix2)
                    {
                    case 1:
                        Piece.AjouterPiece();
                        break;

                    case 2:
                        Piece.ModifierPiece();
                        break;

                    case 3:
                        Piece.SupprimerPiece();
                        break;

                    default:
                        break;
                    }
                    break;

                case 2:
                    Console.WriteLine("Gestion des velos");
                    Console.WriteLine("1: Creation velo\n" +
                                      "2: Suppression velo\n" +
                                      "3: Mise a jour velo\n" +
                                      "4: Lire data velos");
                    choix2 = Convert.ToInt32(Console.ReadLine());
                    switch (choix2)
                    {
                    case 1:
                        Velo.CreerVelo();
                        break;

                    case 2:
                        Velo.SupprimerVelo();
                        break;

                    case 3:
                        Velo.ModifierVelo();
                        break;

                    case 4:
                        Velo.LireDataVelo();
                        break;

                    default:
                        break;
                    }
                    break;


                case 3:
                    Console.WriteLine("Gestion des clients");
                    Console.WriteLine("1: Creation client\n" +
                                      "2: Suppression client\n" +
                                      "3: Mise a jour client\n" +
                                      "4: Lecture clients");
                    choix2 = Convert.ToInt32(Console.ReadLine());
                    switch (choix2)
                    {
                    case 1:
                        Client.CreerClient();
                        break;

                    case 2:
                        Client.SupprimerClient();
                        break;

                    case 3:
                        Client.ModifierClient();
                        break;

                    case 4:
                        Client.LireDataClient();
                        break;

                    default:
                        break;
                    }
                    break;

                case 4:
                    Console.WriteLine("Gestion des fournisseurs");
                    Console.WriteLine("1: Creation fournisseur\n" +
                                      "2: Suppression fournisseur\n" +
                                      "3: Mise a jour fournisseur\n" +
                                      "4: Lire Data fournisseur\n");
                    choix2 = Convert.ToInt32(Console.ReadLine());
                    switch (choix2)
                    {
                    case 1:
                        Fournisseur.CreerFournisseur();
                        break;

                    case 2:
                        Fournisseur.SupprimerFournisseur();
                        break;

                    case 3:
                        Fournisseur.ModifDataFournisseur();
                        break;

                    case 4:
                        Fournisseur.LireDataFournisseur();
                        break;

                    default:
                        break;
                    }
                    break;

                case 5:
                    Console.WriteLine("Gestion des commandes");
                    Console.WriteLine("1: Creation commande\n" +
                                      "2: Lire data commande");
                    choix2 = Convert.ToInt32(Console.ReadLine());
                    switch (choix2)
                    {
                    case 1:
                        Commande.Commander();
                        break;

                    case 2:
                        Commande.LireDataCommmande();
                        break;

                    default:
                        break;
                    }
                    break;

                case 6:
                    Console.WriteLine("Gestion du stock");
                    Console.WriteLine("1: par pièce\n" +
                                      "2: par fournisseur\n" +
                                      "3: par velo\n" +
                                      "4: par categorie de velo\n");
                    choix2 = Convert.ToInt32(Console.ReadLine());
                    switch (choix2)
                    {
                    case 1:
                        Stock.StockPieces();
                        break;

                    case 2:
                        Stock.StockPiecesFournisseur();
                        break;

                    case 3:
                        Stock.StockVelos();
                        break;

                    case 4:
                        Stock.StockVeloCategorie();
                        break;

                    default:
                        break;
                    }
                    break;

                case 7:

                    Console.WriteLine("Module statistique");
                    Console.WriteLine("1: rapport statistique sur pieces et velos vendus\n" +
                                      "2: Liste des membres pour chaque programme d'adhesion\n" +
                                      "3: Date d'expiration des adhesions\n" +
                                      "4: Meilleur(s) client(s)\n" +
                                      "5: Analyse des commandes\n");
                    choix2 = Convert.ToInt32(Console.ReadLine());
                    switch (choix2)
                    {
                    case 1:
                        Statistique.QtesVendues();
                        break;

                    case 2:
                        Statistique.ListeMembreProgrammeAdhesion();
                        break;

                    case 3:
                        Statistique.DateExpirationProgrammesFideliteParClient();
                        break;

                    case 4:
                        Statistique.MeilleurClientEuros();
                        break;

                    case 5:
                        Statistique.MoyenneMontantCommande();
                        Statistique.MoyenneNombrePiecesParCommande();
                        Statistique.MoyenneNombreVelosParCommande();
                        break;

                    default:
                        break;
                    }
                    break;

                case 8:
                    Console.WriteLine("Exports:");
                    Console.WriteLine("1: Export en XML\n" +
                                      "2: Export en JSON\n");
                    choix2 = Convert.ToInt32(Console.ReadLine());
                    switch (choix2)
                    {
                    case 1:
                        Export.ExportXML();
                        break;

                    case 2:
                        Export.ExportJSON();
                        break;

                    default:
                        break;
                    }
                    break;

                default:
                    Console.WriteLine("Numero invalide");
                    break;
                }

                string reponse = "";
                while (reponse != "oui" && reponse != "non")
                {
                    Console.WriteLine("Souhaitez vous quitter l'application ? oui ou non");
                    reponse = Console.ReadLine();
                    if (reponse == "oui")
                    {
                        quitter = false;
                    }
                    Console.Clear();
                }
            }
            Console.WriteLine("Merci d'avoir utilisé le projet VeloMax");
            Console.WriteLine("Aurevoir");
        }
Пример #2
0
        /// <summary>
        /// Permet de remplir un panier de produits contenant aussi bien des pieces que des velos puis de remplir la base de données avec ces informations
        /// </summary>
        public static void Commander()
        {
            bool            finCommande  = false;
            List <string>   panierPieces = new List <string>();
            List <string[]> panierVelos  = new List <string[]>(); // [0] pour le modèle, [1] pour la grandeur
            int             maxDelai     = 0;
            decimal         prixTotal    = 0;

            while (!finCommande)
            {
                //Affichage panier
                if (panierVelos.Count() > 0)
                {
                    Console.WriteLine("Vélos commandés :");
                    for (int i = 0; i < panierVelos.Count(); i++)
                    {
                        Console.WriteLine($"Modèle : {panierVelos[i][0]} , grandeur : {panierVelos[i][1]}");
                    }
                }
                if (panierPieces.Count() > 0)
                {
                    Console.WriteLine("\nPièces commandées :");
                    for (int i = 0; i < panierPieces.Count(); i++)
                    {
                        Console.WriteLine($"Modèle commandé : {panierPieces[i]}");
                    }
                }
                Console.WriteLine($"\nPrix total : {prixTotal} euros");
                Console.WriteLine($"Délai de {maxDelai} jours avant expédition");
                // Choix action
                string choix = "0";
                while (choix != "1" && choix != "2" && choix != "3")
                {
                    Console.WriteLine("\nQue souhaitez vous commander ?\n(1) Un vélo\n(2) Une pièce\n(3) Conclure commande");
                    choix = Console.ReadLine();
                    if (choix != "1" && choix != "2" && choix != "3")
                    {
                        Console.WriteLine("Veuillez entrer une valeur correcte");
                    }
                }
                string          connexionString;
                MySqlConnection maConnexion;
                switch (choix)
                {
                case "1":     // Commande vélo
                    // Connection
                    connexionString = "SERVER=localhost;PORT=3306;" +
                                      "DATABASE=VeloMax;" +
                                      "UID=root;PASSWORD=root";
                    maConnexion = new MySqlConnection(connexionString);
                    maConnexion.Open();
                    string          requete;
                    MySqlCommand    command;
                    MySqlDataReader reader;
                    // Liste Code Modele velo + nom Modele
                    requete             = "SELECT numeroModele, nom, prixUnitaire FROM VeloMax.modelevelo WHERE dateDiscontinuation is null or numeroModele in (select numeroModele FROM Velomax.Velo where vendu = false);";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    List <string> codeModeleVeloList = new List <string>();
                    List <string> nomModeleVeloList  = new List <string>();
                    List <string> prixVeloList       = new List <string>();
                    while (reader.Read())
                    {
                        codeModeleVeloList.Add(reader.GetValue(0).ToString());
                        nomModeleVeloList.Add(reader.GetValue(1).ToString());
                        prixVeloList.Add(reader.GetValue(2).ToString());
                    }
                    reader.Close();
                    command.Dispose();
                    // Liste Grandeurs
                    List <string>         enStockList         = new List <string>();
                    List <List <string> > grandeursModeleList = new List <List <string> >();
                    for (int i = 0; i < codeModeleVeloList.Count(); i++)
                    {
                        requete             = $"select distinct mv.grandeur from modelevelo mv join velo v on mv.numeroModele = v.numeroModele where mv.numeroModele = {codeModeleVeloList[i]};";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        List <string> grandeurList = new List <string>();
                        while (reader.Read())
                        {
                            grandeurList.Add(reader.GetValue(0).ToString());
                        }
                        reader.Close();
                        command.Dispose();
                        grandeursModeleList.Add(grandeurList);
                        // Vérification en Stock / Date de livraison
                        for (int j = 0; j < grandeurList.Count(); j++)
                        {
                            requete             = $"select count(*) from Velomax.velo where numeroModele = '{codeModeleVeloList[i]}' and grandeur = '{grandeurList[j]}' and vendu = false;";
                            command             = maConnexion.CreateCommand();
                            command.CommandText = requete;
                            reader = command.ExecuteReader();
                            reader.Read();
                            int nbEnStock = Convert.ToInt32(reader.GetValue(0).ToString());
                            reader.Close();
                            command.Dispose();
                            if (nbEnStock > 0)
                            {
                                enStockList.Add($"Modèle {codeModeleVeloList[i]} - {nomModeleVeloList[i]}, Grandeur {grandeurList[j]}, Prix {prixVeloList[i]} euros : En stock, expédition dans les 24h");
                            }
                            else
                            {
                                bool assemblage = Velo.PossibilititéAssemblerVelo(codeModeleVeloList[i], grandeurList[j]);
                                if (assemblage)
                                {
                                    enStockList.Add($"Modèle {codeModeleVeloList[i]} - {nomModeleVeloList[i]}, Grandeur {grandeurList[j]}, Prix {prixVeloList[i]} euros : En stock, expédition dans les 24h");
                                }
                                else
                                {
                                    string delai = Velo.TempsNecessairePieceManquanteAssemblageVelo(codeModeleVeloList[i], grandeurList[j]);
                                    enStockList.Add($"Modèle {codeModeleVeloList[i]} - {nomModeleVeloList[i]}, Grandeur {grandeurList[j]}, Prix {prixVeloList[i]} euros : Expedition possible au plus tôt dans {delai} jours");
                                }
                            }
                        }
                    }
                    // Selection
                    Console.WriteLine("\n Liste des modèles et grandeurs disponibles :");
                    for (int i = 0; i < enStockList.Count(); i++)
                    {
                        Console.WriteLine(enStockList[i]);
                    }
                    string selectionModele = "";
                    while (!codeModeleVeloList.Contains(selectionModele))
                    {
                        Console.WriteLine("\n Veuillez entrer le code du modèle que vous souhaitez commander");
                        selectionModele = Console.ReadLine();
                        if (!codeModeleVeloList.Contains(selectionModele))
                        {
                            Console.WriteLine("Le modèle n'est pas disponible");
                        }
                    }
                    string selectionGrandeur = "";
                    while (!grandeursModeleList[codeModeleVeloList.IndexOf(selectionModele)].Contains(selectionGrandeur))
                    {
                        Console.WriteLine("\n Veuillez entrer la grandeur que vous souhaitez commander pour ce modèle");
                        selectionGrandeur = Console.ReadLine();
                        if (!grandeursModeleList[codeModeleVeloList.IndexOf(selectionModele)].Contains(selectionGrandeur))
                        {
                            Console.WriteLine("Cette grandeur n'est pas disponible pour ce modèle");
                        }
                    }
                    // Enregistrement du changement
                    string[] selectionVelo = new string[2] {
                        selectionModele, selectionGrandeur
                    };
                    panierVelos.Add(selectionVelo);
                    requete             = $"select prixUnitaire from Velomax.modelevelo where numeroModele = '{selectionModele}' and grandeur = '{selectionGrandeur}'";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    reader.Read();
                    prixTotal += Convert.ToDecimal(reader.GetValue(0).ToString());
                    reader.Close();
                    command.Dispose();
                    //Appliquer changement dans la base de donnée
                    requete             = $"select count(*) from Velomax.velo where numeroModele = '{selectionModele}' and grandeur = '{selectionGrandeur}' and vendu = false;";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    reader.Read();
                    int nbEnStock2 = Convert.ToInt32(reader.GetValue(0).ToString());
                    reader.Close();
                    command.Dispose();
                    if (nbEnStock2 > 0)
                    {
                        requete             = $"select numeroVelo from VeloMax.velo where numeroModele = '{selectionModele}' and grandeur = '{selectionGrandeur}' and vendu = false limit 1;";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        reader.Read();
                        string numeroVelo = reader.GetValue(0).ToString();
                        reader.Close();
                        command.Dispose();
                        requete             = $"update velomax.velo set vendu = true where numeroVelo = {numeroVelo};";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        reader.Close();
                        command.Dispose();
                        Velo.VendrePiecesVelo(numeroVelo, selectionModele, selectionGrandeur);
                    }
                    else
                    {
                        bool assemblage = Velo.PossibilititéAssemblerVelo(selectionModele, selectionGrandeur);
                        if (assemblage)
                        {
                            Velo.AssemblerVelo(selectionModele, selectionGrandeur);
                        }
                        else
                        {
                            int delai = Convert.ToInt32(Velo.TempsNecessairePieceManquanteAssemblageVelo(selectionModele, selectionGrandeur));
                            if (delai > maxDelai)
                            {
                                maxDelai = delai;
                            }
                        }
                    }
                    maConnexion.Close();
                    Console.WriteLine("\n");
                    break;

                case "2":     // Commande pièce
                    // Connection
                    connexionString = "SERVER=localhost;PORT=3306;" +
                                      "DATABASE=VeloMax;" +
                                      "UID=root;PASSWORD=root";
                    maConnexion = new MySqlConnection(connexionString);
                    maConnexion.Open();
                    // Liste Modeles pièces + description
                    requete             = "SELECT distinct mp.codeModelePiece, mp.description, mp.prixVenteUnitaire FROM VeloMax.fournisseur_modelepiece fmp join Velomax.modelepiece mp on mp.codeModelePiece = fmp.codeModelePiece WHERE fmp.dateDiscontinuation is null or mp.codeModelePiece in (select codeModelePiece FROM Velomax.Piece where vendu = false and numeroVelo is null);";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    List <string> codeModelePieceList = new List <string>();
                    List <string> descriptionList     = new List <string>();
                    List <string> prixPieceList       = new List <string>();
                    while (reader.Read())
                    {
                        codeModelePieceList.Add(reader.GetValue(0).ToString());
                        descriptionList.Add(reader.GetValue(1).ToString());
                        prixPieceList.Add(reader.GetValue(2).ToString());
                    }
                    reader.Close();
                    command.Dispose();
                    // stock list
                    List <string> pieceEnStockList = new List <string>();
                    for (int i = 0; i < codeModelePieceList.Count(); i++)
                    {
                        requete             = $"select count(*) from Velomax.piece where codeModelePiece = '{codeModelePieceList[i]}' and vendu = false and numeroVelo is null;";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        reader.Read();
                        int nbPiecesEnStock = Convert.ToInt32(reader.GetValue(0).ToString());
                        reader.Close();
                        command.Dispose();
                        if (nbPiecesEnStock > 0)
                        {
                            pieceEnStockList.Add($"Modèle : {codeModelePieceList[i]} {descriptionList[i]}, Prix : {prixPieceList[i]} euros : En stock, expédition dans les 24h");
                        }
                        else
                        {
                            maConnexion = new MySqlConnection(connexionString);
                            maConnexion.Open();
                            requete             = $"SELECT min(delaiJoursApprovisionnement) from velomax.fournisseur_modelepiece where codeModelePiece='{codeModelePieceList[i]}';";
                            command             = maConnexion.CreateCommand();
                            command.CommandText = requete;
                            reader = command.ExecuteReader();
                            reader.Read();
                            string delai = reader.GetValue(0).ToString();
                            reader.Close();
                            command.Dispose();
                            pieceEnStockList.Add($"Modèle : {codeModelePieceList[i]} {descriptionList[i]}, Prix : {prixPieceList[i]} euros : Expedition possible au plus tôt dans {delai} jours");
                        }
                    }
                    // Selection
                    Console.WriteLine("\n Liste des modèles de pièces disponibles :");
                    for (int i = 0; i < pieceEnStockList.Count(); i++)
                    {
                        Console.WriteLine(pieceEnStockList[i]);
                    }
                    string selectionModelePiece = "";
                    while (!codeModelePieceList.Contains(selectionModelePiece))
                    {
                        Console.WriteLine("\n Veuillez entrer le code du modèle de pièce que vous souhaitez commander");
                        selectionModelePiece = Console.ReadLine();
                        if (!codeModelePieceList.Contains(selectionModelePiece))
                        {
                            Console.WriteLine("Le modèle n'est pas disponible");
                        }
                    }
                    // Enregistrement du changement
                    panierPieces.Add(selectionModelePiece);
                    requete             = $"select prixVenteUnitaire from Velomax.modelePiece where codeModelePiece = '{selectionModelePiece}';";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    reader.Read();
                    prixTotal += Convert.ToDecimal(reader.GetValue(0).ToString());
                    reader.Close();
                    command.Dispose();
                    //Appliquer changement dans la base de donnée
                    requete             = $"select count(*) from Velomax.piece where codeModelePiece = '{selectionModelePiece}' and vendu = false and numeroVelo is null;";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    reader.Read();
                    int nbPiecesEnStock2 = Convert.ToInt32(reader.GetValue(0).ToString());
                    reader.Close();
                    command.Dispose();
                    if (nbPiecesEnStock2 > 0)     //En stock
                    {
                        requete             = $"select numeroSerie, numeroSiretFournisseur from VeloMax.piece where codeModelePiece = '{selectionModelePiece}' and vendu = false and numeroVelo is null limit 1;";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        reader.Read();
                        string[] piece = new string[3] {
                            reader.GetValue(0).ToString(), selectionModelePiece, reader.GetValue(1).ToString()
                        };
                        reader.Close();
                        command.Dispose();
                        requete             = $"update velomax.piece set vendu = true where numeroSerie = '{piece[0]}' and codeModelePiece = '{piece[1]}' and numeroSiretFournisseur = '{piece[2]}';";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        reader.Close();
                        command.Dispose();
                    }
                    else     // Pas en stock
                    {
                        maConnexion = new MySqlConnection(connexionString);
                        maConnexion.Open();
                        requete             = $"SELECT min(delaiJoursApprovisionnement) from velomax.fournisseur_modelepiece where codeModelePiece='{selectionModelePiece}';";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        reader.Read();
                        int delai = Convert.ToInt32(reader.GetValue(0).ToString());
                        reader.Close();
                        command.Dispose();
                        if (delai > maxDelai)
                        {
                            maxDelai = delai;
                        }
                    }
                    maConnexion.Close();
                    Console.WriteLine("\n");
                    break;

                case "3":     //Conclure commande
                    // Liste numéro client
                    connexionString = "SERVER=localhost;PORT=3306;" +
                                      "DATABASE=VeloMax;" +
                                      "UID=root;PASSWORD=root";
                    maConnexion = new MySqlConnection(connexionString);
                    maConnexion.Open();
                    requete             = "SELECT numeroClient from velomax.client order by numeroClient;";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    List <string> numeroClientList = new List <string>();
                    while (reader.Read())
                    {
                        numeroClientList.Add(reader.GetValue(0).ToString());
                    }
                    reader.Close();
                    command.Dispose();
                    // Selection numéro client
                    Console.WriteLine("\nListe des numéros clients");
                    for (int i = 0; i < numeroClientList.Count(); i++)
                    {
                        Console.WriteLine(numeroClientList[i]);
                    }
                    string numeroClient = "";
                    while (!numeroClientList.Contains(numeroClient))
                    {
                        Console.WriteLine("\n (Entrez le numéro du client)");
                        numeroClient = Console.ReadLine();
                        if (!numeroClientList.Contains(numeroClient))
                        {
                            Console.WriteLine("Erreur dans le numéro client");
                        }
                    }
                    Console.WriteLine("\n Entrez votre adresse (rue et numéro de rue)");
                    string rue = Console.ReadLine();
                    Console.WriteLine("\n Entrez votre code Postal");
                    string codePostal = Console.ReadLine();
                    Console.WriteLine("\n Entrez votre ville");
                    string   ville = Console.ReadLine();
                    DateTime _date = DateTime.Now;
                    string   date  = _date.ToString("yyyy-MM-dd");
                    _date.AddDays(maxDelai);
                    string dateExpedition = _date.ToString("yyyy-MM-dd");
                    requete             = $"INSERT INTO velomax.commande (date, dateLivraison, rue, ville, codePostal, numeroClient) VALUES ('{date}','{dateExpedition}','{rue}','{ville}','{codePostal}','{numeroClient}');";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    reader.Close();
                    command.Dispose();
                    // Ajout des vélos et des pièces dans les tables entité-association
                    requete             = $"select max(numeroCommande) from velomax.commande;";
                    command             = maConnexion.CreateCommand();
                    command.CommandText = requete;
                    reader = command.ExecuteReader();
                    reader.Read();
                    string numeroCommande = reader.GetValue(0).ToString();
                    reader.Close();
                    command.Dispose();
                    for (int i = 0; i < panierVelos.Count(); i++)
                    {
                        requete             = $"INSERT INTO velomax.commande_modeleVelo (numeroCommande, numeroModele, grandeur) VALUES ('{numeroCommande}','{panierVelos[i][0]}','{panierVelos[i][1]}');";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        reader.Close();
                        command.Dispose();
                    }
                    for (int i = 0; i < panierPieces.Count(); i++)
                    {
                        requete             = $"INSERT INTO velomax.commande_piece (numeroCommande, codeModelePiece) VALUES ('{numeroCommande}','{panierPieces[i]}');";
                        command             = maConnexion.CreateCommand();
                        command.CommandText = requete;
                        reader = command.ExecuteReader();
                        reader.Close();
                        command.Dispose();
                    }

                    finCommande = true;
                    maConnexion.Close();
                    Console.WriteLine("Commande réussie\n\n");
                    break;
                }
            }
        }