public static DepartementViewModel getDepartement(int idDepartement)
        {
            DepartementDAO pDAO = DepartementDAO.getDepartement(idDepartement);
            //int idMetier = pDAO.idMetierDepartementDAO;
            DepartementViewModel p = new DepartementViewModel(pDAO.idDepartementDAO, pDAO.nomDAO);

            return(p);
        }
        public static ObservableCollection <DepartementViewModel> listeDepartements()
        {
            ObservableCollection <DepartementDAO>       lDAO = DepartementDAO.listeDepartements();
            ObservableCollection <DepartementViewModel> l    = new ObservableCollection <DepartementViewModel>();

            foreach (DepartementDAO element in lDAO)
            {
                //int idMetier = element.idMetierDepartementDAO;

                DepartementViewModel p = new DepartementViewModel(element.idDepartementDAO, element.nomDAO);
                l.Add(p);
            }
            return(l);
        }
        public static PlageViewModel getPlage(int idPlage)
        {
            PlageDAO pDAO          = PlageDAO.getPlage(idPlage);
            int      idPrelevement = pDAO.prelevement_idprelevementDAO;
            int      idVille       = pDAO.Ville_idVilleDAO;
            int      iDepartement  = pDAO.Departement_idDepartementDAO;

            PrelevementViewModel pr = PrelevementORM.getPrelevement(idPrelevement);
            CommuneViewModel     c  = CommuneORM.getCommune(idVille);
            DepartementViewModel d  = DepartementORM.getDepartement(iDepartement);

            PlageViewModel p = new PlageViewModel(pDAO.idPlageDAO, pDAO.nomDAO, c, pr, d);

            return(p);
        }
        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);
        }
 public static void insertDepartement(DepartementViewModel p)
 {
     DepartementDAO.insertDepartement(new DepartementDAO(p.idDepartementProperty, p.nomProperty));
 }