Package fr.utbm.in56.annonces.dao

Examples of fr.utbm.in56.annonces.dao.AnnonceDao


               
                if(membre != null){
                   
                    AnnonceDao anDao = new AnnonceDao();
                    DepartementDao depDao = new DepartementDao();
                    CategorieDao catDao = new CategorieDao();
                   
                    Annonce annonce = new Annonce();
                   
                    annonce.setPublicateur(membre);
                    annonce.setDateDepot(Calendar.getInstance());
                   
                    annonce.setDepartement(depDao.getById(annonceForm.getDepartement()));
                    annonce.setOffre((boolean) annonceForm.isOffre());
                   
                    annonce.setTitre(annonceForm.getTitre());
                    annonce.setDescription(annonceForm.getDescription());
                    annonce.setPrix(annonceForm.getPrix());
                   
                    annonce.setCategorie(catDao.getById(annonceForm.getCategorie()));
                   
                    Set<MotCle> motscles = new HashSet<MotCle>();
                   
                    String motcle = annonceForm.getMotsCles();
                   
View Full Code Here


       
    }
   
    private void initCategories() {
       
        CategorieDao categorieDao = new CategorieDao();
       
        if(categorieDao.getAll().isEmpty()) {
            categorieDao.save(new Categorie("Automobile"));
            categorieDao.save(new Categorie("Moto"));
            categorieDao.save(new Categorie("Immobilier"));
            categorieDao.save(new Categorie("Meubles"));
            categorieDao.save(new Categorie("Informatique"));
            categorieDao.save(new Categorie("Electoménager"));
            categorieDao.save(new Categorie("Divers"));
        }
    }
View Full Code Here

public class CategorieBeans {
   
    private static Set<Categorie> Categories;
   
    public CategorieBeans(){
        CategorieDao dao = new CategorieDao();
        Categories = dao.getAll();
    }
View Full Code Here

      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
   
        long idRegion = Long.decode(request.getParameter("id"));    
       
        DepartementDao dDao = new DepartementDao();
        RegionDao rDao = new RegionDao();
        AnnonceDao dao = new AnnonceDao();
       
        Region r = rDao.getById(idRegion);
        Set<Departement> depts = dDao.getdepartementsByRegion(r);
       
        Set<Annonce> annonces = dao.getAnnonces(depts);
       
        request.getSession().setAttribute("annonces", annonces);       
       
View Full Code Here

   
    ChercherForm chercherForm = (ChercherForm) form;
       
        HttpSession session = request.getSession();
        AnnonceDao annoncesDao = new AnnonceDao();
        DepartementDao departementDao = new DepartementDao();
        CategorieDao categorieDao = new CategorieDao();
       
        Departement departement = departementDao.getById(chercherForm.getDepartement());
        Categorie categorie = categorieDao.getById(chercherForm.getCategorie());
       
        session.setAttribute("annonces", annoncesDao.getAnnonces(
                chercherForm.getPrixMin(),
                chercherForm.getPrixMax(),
View Full Code Here

                Membre membre = (Membre)request.getSession().getAttribute("membre");
               
                if(membre != null){
                   
                    AnnonceDao anDao = new AnnonceDao();
                    DepartementDao depDao = new DepartementDao();
                    CategorieDao catDao = new CategorieDao();
                   
                    Annonce annonce = new Annonce();
                   
                    annonce.setPublicateur(membre);
                    annonce.setDateDepot(Calendar.getInstance());
                   
                    annonce.setDepartement(depDao.getById(annonceForm.getDepartement()));
                    annonce.setOffre((boolean) annonceForm.isOffre());
                   
                    annonce.setTitre(annonceForm.getTitre());
                    annonce.setDescription(annonceForm.getDescription());
                    annonce.setPrix(annonceForm.getPrix());
View Full Code Here

    }
   
    private void initRegionsDepartements() {
       
        RegionDao regionDao = new RegionDao();
        DepartementDao departementDao = new DepartementDao();
       
        if(regionDao.getAll().isEmpty() || departementDao.getAll().isEmpty()) {
           
            ArrayList<Region> regions = new ArrayList<Region>();
            ArrayList<Departement> departements = new ArrayList<Departement>();

            regions.add(new Region("Alsace"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Bas-Rhin"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Haut-Rhin"));

            regions.add(new Region("Aquitaine"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Dordogne"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Gironde"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Landes"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Lot-et-Garonne"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Pyrénées-Atlantiques"));

            regions.add(new Region("Auvergne"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Allier"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Cantal"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Haute-Loire"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Puy-de-Dôme"));

            regions.add(new Region("Basse-Normandie"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Calvados"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Manche"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Orne"));

            regions.add(new Region("Bourgogne"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Côte-d'Or"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Nièvre"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Saône-et-Loire"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Yonne"));

            regions.add(new Region("Bretagne"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Côtes-d'Armor"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Finistère"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Ile-et-Vilaine"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Morbihan"));

            regions.add(new Region("Centre"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Cher"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Eure-et-Loir"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Indre"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Indre-et-Loir"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Loir-et-Cher"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Loiret"));

            regions.add(new Region("Champagne-Ardenne"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Ardennes"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Aube"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Marne"));
            departements.add(new Departement(regions.get(regions.size() - 1), "haute-Marne"));

            regions.add(new Region("Corse"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Haute-Corse"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Basse-corse"));

            regions.add(new Region("Franche-Comté"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Doubs"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Jura"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Haute-Saône"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Territoire de Belfort"));

            regions.add(new Region("Haute-Normandie"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Seine-Maritime"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Eure"));

            regions.add(new Region("Île-de-France"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Paris"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Seine-et-Marne"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Yvelines"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Essone"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Hauts-de-Seine"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Seine-Saint-Denis"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Val-de-Marne"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Val-d'Oise"));

            regions.add(new Region("Languedoc-Roussillon"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Aude"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Gard"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Hérault"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Lozère"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Pyrénées-Orientales"));

            regions.add(new Region("Limousin"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Corrèze"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Creuse"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Haute-Vienne"));

            regions.add(new Region("Lorraine"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Meurthe-et-Moselle"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Meuse"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Moselle"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Vosges"));

            regions.add(new Region("Midi-Pyrénées"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Ariège"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Aveyron"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Haute-Garonne"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Gers"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Lot"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Hautes-Pyrénées"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Tarn"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Tarn-et-Garonne"));

            regions.add(new Region("Nord-Pas-de-Calais"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Nord"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Pas-de-Calais"));

            regions.add(new Region("Pays de la Loire"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Loire-Atlantique"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Maine-et-Loire"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Mayenne"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Sarthe"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Vendée"));

            regions.add(new Region("Picardie"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Laon"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Beauvais"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Amiens"));

            regions.add(new Region("Poitou-Charentes"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Charente"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Charente-Maritime"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Deux-Sèvres"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Vienne"));

            regions.add(new Region("PACA"));

            departements.add(new Departement(regions.get(regions.size() - 1), "Alpes-de-Haute-Provence"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Hautes-Alpes"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Alpes-Maritimes"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Bouches-du-Rhone"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Var"));
            departements.add(new Departement(regions.get(regions.size() - 1), "Vaucluse"));
           
            for(Region region : regions) {
                regionDao.save(region);
            }
           
            for(Departement departement : departements) {
                departementDao.save(departement);
            }
        }
    }
View Full Code Here

public class DepartementBeans {
   
    private static Set<Departement> departements;
   
    public DepartementBeans(){
        DepartementDao dao = new DepartementDao();
        departements = dao.getAll();
    }
View Full Code Here

            Membre m = new Membre();
            m.setIdentifiant(loginForm.getLogin());
            m.setMotDePasse(loginForm.getPassword());

            MembreDao dao = new MembreDao();
            try{
                Membre membre = dao.isRegister(m);
                if(membre != null){
                    HttpSession session = request.getSession();

                    MessageDao mDao = new MessageDao();
                    //Plante, mais je sais pas pkoi.
View Full Code Here

        long idAnnonce = Long.decode(request.getParameter("id"));
        long idRepondeur = Long.decode(request.getParameter("repondeur"));
       
        AnnonceDao dao = new AnnonceDao();
        StatutDao sDao = new StatutDao();
        MembreDao mDao = new MembreDao();
        MessageDao msgDao = new MessageDao();
       
        Annonce annonce = dao.getById(idAnnonce);
        Membre repondeur = mDao.getById(idRepondeur);
       
        annonce.setRepondeur(repondeur);
        annonce.setStatut(sDao.getById(3));
       
        dao.update(annonce);
View Full Code Here

TOP

Related Classes of fr.utbm.in56.annonces.dao.AnnonceDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.