Example #1
0
        public static CommuneViewModel getCommune(int idCommune)
        {
            CommuneDAO           pDAO          = CommuneDAO.getCommune(idCommune);
            int                  idDepartement = pDAO.DepartementCommuneDAO;
            DepartementViewModel m             = DepartementORM.getDepartement(idDepartement);
            CommuneViewModel     p             = new CommuneViewModel(pDAO.idCommuneDAO, pDAO.nomCommuneDAO, pDAO.CodePostaleDAO, m);

            return(p);
        }
Example #2
0
        public static ObservableCollection <CommuneViewModel> ListeCommunes()
        {
            ObservableCollection <CommuneDAO>       lDAO = CommuneDAO.listeCommunes();
            ObservableCollection <CommuneViewModel> l    = new ObservableCollection <CommuneViewModel>();

            foreach (CommuneDAO element in lDAO)
            {
                int idDepartement      = element.DepartementCommuneDAO;
                DepartementViewModel m = DepartementORM.getDepartement(idDepartement);
                CommuneViewModel     p = new CommuneViewModel(element.idCommuneDAO, element.nomCommuneDAO, element.CodePostaleDAO, m);
                l.Add(p);
            }
            return(l);
        }