예제 #1
0
        public static DepartementViewModel getDepartement(int idDepartement)
        {
            DepartementDAO       pDAO = DepartementDAO.getDepartement(idDepartement);
            DepartementViewModel p    = new DepartementViewModel(pDAO.idDepartementDAO, pDAO.nomDepartementDAO);

            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 idPrelevement = element.prelevement_idprelevementDAO;
                int idVille       = element.Ville_idVilleDAO;
                int iDepartement  = element.Departement_idDepartementDAO;

                PrelevementDAO m = PrelevementDAO.getPrelevement(idPrelevement);
                CommuneDAO     c = CommuneDAO.getCommune(idVille);
                DepartementDAO d = DepartementDAO.getDepartement(iDepartement);

                PrelevementViewModel prelevement = new PrelevementViewModel(m.idprelevementDAO, m.PositionGPSDAO, m.TypeDAO);
                CommuneViewModel     commune     = new CommuneViewModel(c.idVilleDAO, c.nomSpecialisteDAO, c.nomVilleDAO);
                DepartementViewModel departement = new DepartementViewModel(d.idDepartementDAO, d.nomDAO);
                PlageViewModel       p           = new PlageViewModel(element.idPlageDAO, element.nomDAO, commune, prelevement, departement);
                l.Add(p);
            }
            return(l);
        }