コード例 #1
0
        static void Main(string[] args)
        {
            DemandeAutilisateur _demandeAutilisateur = new DemandeAutilisateur();
            DepartementService  _departementService  = new DepartementService(_demandeAutilisateur);

            CommuneService  _communeService  = new CommuneService(_demandeAutilisateur, _departementService);
            HabitantService _habitantService = new HabitantService(_demandeAutilisateur, _communeService);
            List <Commune>  communes         = new List <Commune>();


            while (true)
            {
                int choix = MenuUtilisateur();

                if (choix == 1)
                {
                    _habitantService.CreatHabitants();
                }
                else if (choix == 2)
                {
                    _habitantService.AfficheHabitans();
                }
                else if (choix == 3)
                {
                    _communeService.CreeCommune();
                }
                else if (choix == 4)
                {
                    _communeService.AfficheCommune();
                }
                else if (choix == 5)
                {
                    _departementService.CreeDepartement();
                }
                else if (choix == 6)
                {
                    _departementService.DemandeDepartements();
                }
                else if (choix == 7)
                {
                    _communeService.calculNbtotalHabs(Communes);
                }
            }
        }