Пример #1
0
        public static PlageViewModel getPlage(int idPlage)
        {
            PlageDAO         pDAO      = PlageDAO.getPlage(idPlage);
            int              idCommune = pDAO.CommuneDAO;
            CommuneViewModel m         = CommuneORM.getCommune(idCommune);
            PlageViewModel   p         = new PlageViewModel(pDAO.idPlageDAO, pDAO.nomPlageDAO, pDAO.superficEtudePlageDAO, m);

            return(p);
        }
Пример #2
0
        public static ObservableCollection <PlageViewModel> listePlages()
        {
            ObservableCollection <PlageDAO>       lDAO = PlageDAO.listePlages();
            ObservableCollection <PlageViewModel> l    = new ObservableCollection <PlageViewModel>();

            foreach (PlageDAO element in lDAO)
            {
                int idCommune      = element.CommuneDAO;
                CommuneViewModel m = CommuneORM.getCommune(idCommune);
                PlageViewModel   p = new PlageViewModel(element.idPlageDAO, element.nomPlageDAO, element.superficEtudePlageDAO, m);
                l.Add(p);
            }
            return(l);
        }