Example #1
0
        private void AjoutClient()
        {
            Output.WriteLine("Saisissez les informations du client :");

            //Creation nouveau client
            Client c1 = new Client();

            c1.Civilite = Input.Read <string>("Civilite :");
            c1.Nom      = Input.Read <string>("Nom :");
            c1.Prenom   = Input.Read <string>("Prenom :");

            Contexte.AjouterClient(c1);
            Output.WriteLine(ConsoleColor.Green, "Client créé avec succès");
            Output.WriteLine("");


            //Methode permettant d'aller chercher le dernier numero identifiant créé
            int num = Contexte.NumeroClient();


            // Creation nouvelle adresse
            Adresse a1 = new Adresse();

            a1.IdClient   = num;
            a1.Rue        = Input.Read <string>("Rue :");
            a1.CodePostal = Input.Read <string>("Code Postal :");
            a1.Ville      = Input.Read <string>("Ville :");

            Contexte.AjouterAdresse(a1);
            Output.WriteLine(ConsoleColor.Green, "Adresse crée avec succès");
            Output.WriteLine("");
        }