public static PlageViewModel getPlage(int idPlage) { PlageDAO pDAO = PlageDAO.getPlage(idPlage); int id = pDAO.idCommunePlageDAO; CommuneViewModel m = CommuneORM.getCommune(id); PlageViewModel p = new PlageViewModel(pDAO.idPlageDAO, pDAO.nomPlageDAO, m); return(p); }
public static ObservableCollection <PlageViewModel> listePlage() { ObservableCollection <PlageDAO> lDAO = PlageDAO.listePlage(); ObservableCollection <PlageViewModel> l = new ObservableCollection <PlageViewModel>(); foreach (PlageDAO element in lDAO) { int id = element.idCommunePlageDAO; CommuneViewModel m = CommuneORM.getCommune(id); PlageViewModel p = new PlageViewModel(element.idPlageDAO, element.nomPlageDAO, m); l.Add(p); } return(l); }