Esempio n. 1
0
        public static void ListerClients(List <Client> clients = null)
        {
            if (clients == null)
            {
                clients = gestionClientService.RecupererTousLesClients();
            }

            Console.WriteLine("Voici la liste des clients");
            Console.ForegroundColor = ConsoleColor.Yellow;

            OutilsConsole.AfficherChamp("IDENTIFIANT", 20);
            OutilsConsole.AfficherChamp("NOM", 10);
            OutilsConsole.AfficherChamp("PRENOM", 10);
            OutilsConsole.AfficherChamp("DATE DE NAISSANCE", 20);
            OutilsConsole.AfficherChamp("TELEPHONE", 10);
            OutilsConsole.AfficherChamp("EMAIL", 20);

            Console.WriteLine();
            Console.WriteLine(new string('_', 120));

            Console.ResetColor();

            foreach (var client in clients)
            {
                OutilsConsole.AfficherChamp(client.Id, 20);
                OutilsConsole.AfficherChamp(client.Nom, 10);
                OutilsConsole.AfficherChamp(client.Prenom, 10);
                OutilsConsole.AfficherChamp(client.DateNaissance.ToShortDateString(), 20);
                OutilsConsole.AfficherChamp(client.Telephone, 10);
                OutilsConsole.AfficherChamp(client.Email, 20);

                Console.WriteLine();
            }
        }
Esempio n. 2
0
        static void ListeOffres()
        {
            OutilsConsole.AfficherChamp("DESTINATION", 10);
            OutilsConsole.AfficherChamp("DATE DEBUT", 10);
            OutilsConsole.AfficherChamp("DATE RETOUR", 20);
            Console.WriteLine();
            Console.WriteLine(new string('-', 75));
            Console.Clear();
            Console.WriteLine("Liste des offres\n");
            OffreAgenceVoyage voyage1 = new OffreAgenceVoyage("Barcelone", 123, new DateTime(2018, 08, 20, 08, 45, 00), new DateTime(2018, 08, 26, 08, 15, 00));
            OffreAgenceVoyage voyage2 = new OffreAgenceVoyage("Vienne", 123, new DateTime(2018, 08, 20, 08, 45, 00), new DateTime(2018, 08, 26, 08, 15, 00));
            OffreAgenceVoyage voyage3 = new OffreAgenceVoyage("Bangkok", 123, new DateTime(2018, 08, 20, 08, 45, 00), new DateTime(2018, 08, 26, 08, 15, 00));
            OffreAgenceVoyage voyage4 = new OffreAgenceVoyage("Rio", 123, new DateTime(2018, 08, 20, 08, 45, 00), new DateTime(2018, 08, 26, 08, 15, 00));

            offreA.Add(voyage1);
            offreA.Add(voyage2);
            offreA.Add(voyage3);
            offreA.Add(voyage4);

            for (int i = 0; i < offreA.Count; i++)
            {
                Console.WriteLine($"({i})-{ offreA[i]} ");
            }
            Console.WriteLine("\nSelectionnez le numero de l'offre à ajouter");
            var index = int.Parse(Console.ReadLine());

            //offreA[index] =
            //offreA.RemoveAt(index);

            Console.ReadKey();
        }
Esempio n. 3
0
        public static void ListerVoyages()
        {
            Console.WriteLine("Voici la liste des destinations disponibles");
            Console.ForegroundColor = ConsoleColor.Yellow;


            OutilsConsole.AfficherChamp("CONTINENT", 10);
            OutilsConsole.AfficherChamp("PAYS", 10);
            OutilsConsole.AfficherChamp("REGION", 10);
            OutilsConsole.AfficherChamp("DESCRIPTION", 20);
            OutilsConsole.AfficherChamp("DATE ALLER", 10);
            OutilsConsole.AfficherChamp("DATE RETOUR", 10);
            OutilsConsole.AfficherChamp("TARIF PAR PERSONNE", 10);

            Console.WriteLine();
            Console.WriteLine(new string('_', 100));

            Console.ResetColor();

            foreach (var voyage in gestionVoyageService.RecupererTousLesVoyages())
            {
                OutilsConsole.AfficherChamp(voyage.Destination.Continent, 10);
                OutilsConsole.AfficherChamp(voyage.Destination.Pays, 10);
                OutilsConsole.AfficherChamp(voyage.Destination.Region, 10);
                OutilsConsole.AfficherChamp(voyage.Destination.Description, 20);
                OutilsConsole.AfficherChamp(voyage.DateAller.ToShortDateString(), 10);
                OutilsConsole.AfficherChamp(voyage.DateRetour.ToShortDateString(), 10);
                OutilsConsole.AfficherChamp(voyage.Tarif.ToString(), 10);
                Console.WriteLine();
            }
            AfficherRetourMenu();
        }
Esempio n. 4
0
        static void AfficherListeContacts(IEnumerable <Contact> listeContacts)
        {
            OutilsConsole.AfficherChamp("NOM", 10);
            OutilsConsole.AfficherChamp("PRENOM", 10);
            OutilsConsole.AfficherChamp("EMAIL", 20);
            OutilsConsole.AfficherChamp("TELEPHONE", 10);
            OutilsConsole.AfficherChamp("DATE NAISSANCE", 10);
            Console.WriteLine();
            Console.WriteLine(new string('-', 75));

            Console.ForegroundColor = ConsoleColor.Yellow;
            foreach (var contact in listeContacts)
            {
                OutilsConsole.AfficherChamp(contact.Nom, 10);
                OutilsConsole.AfficherChamp(contact.Prenom, 10);
                OutilsConsole.AfficherChamp(contact.Email, 20);
                OutilsConsole.AfficherChamp(contact.Telephone, 10);
                OutilsConsole.AfficherChamp(contact.DateNaissance?.ToShortDateString(), 10);
                Console.WriteLine();
            }
            Console.ResetColor();
        }