Package fr.utbm.in56.annonces.dao

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


                    int nbMessage = mDao.getNbUnReadMessageByMember(membre);
                   
                    session.setAttribute("membre", membre);
                    session.setAttribute("unread", nbMessage);

                    AnnonceDao aDao = new AnnonceDao();
                  
                   
                    session.setAttribute("annonces",  aDao.getLastAnnonces(10));
                   
                    return mapping.findForward("success");
                }else{
                    request.setAttribute("erreur", "Le couple identifiant/mot de passe est inconnu.");
                    return mapping.findForward("error");
View Full Code Here


    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        AnnonceDao dao = new AnnonceDao();
        Set<Annonce> annonces = dao.getLastAnnonces(10);

        request.setAttribute("annonces", annonces);

        return mapping.findForward("default");
    }
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);
       
        Message message = new Message();
       
        message.setAnnonce(annonce);
        message.setDestinataire(repondeur);
View Full Code Here

   
        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);       
       
    return mapping.findForward("default");
  }
View Full Code Here

      throws Exception {
   
    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(),
                chercherForm.getRecherche(),
                chercherForm.isOffre(),
                departement,
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());
                   
                    annonce.setCategorie(catDao.getById(annonceForm.getCategorie()));
                   
                    Set<MotCle> motscles = new HashSet<MotCle>();
                   
                    String motcle = annonceForm.getMotsCles();
                   
                    String[] tabMotcle = motcle.split(";");
                   
                    MotCle m;
                    MotCleDao motDao = new MotCleDao();
                   
                    for(int i=0; i<tabMotcle.length; i++){
                        m = motDao.getAndCreateByLibelle(tabMotcle[i]);
                        motscles.add(m);
                       
                    }
                   
                    annonce.setMotsCles(motscles);
                   
                    StatutDao sDao = new StatutDao();
                   
                    annonce.setStatut(sDao.getById(1));
                   
                    anDao.save(annonce);
                   
                    MessageDao messageDao = new MessageDao();
                   
                    request.getSession().setAttribute("unread",messageDao.getNbUnReadMessageByMember(membre));
                    request.setAttribute("monannonce", annonce.getId());
View Full Code Here

        HttpSession session = request.getSession();
       
        Membre m = (Membre) session.getAttribute("membre");
       

        AnnonceDao dao = new AnnonceDao();
       
        Set<Annonce> annonces = dao.getByIdMembre(m);
       
        request.getSession().setAttribute("annonces", annonces);       
       
    return mapping.findForward("default");
  }
View Full Code Here

      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
   
        long idAnnonce = Long.decode(request.getParameter("id"));

        AnnonceDao dao = new AnnonceDao();

        Annonce annonce = dao.getById(idAnnonce);

        SimpleDateFormat dateformatMMDDYYYY = new SimpleDateFormat("MM/dd/yyyy");
        String stDate = dateformatMMDDYYYY.format(annonce.getDateDepot().getTime());

        request.getSession().setAttribute("date", stDate);       
View Full Code Here

            throws Exception {

       
        long idAnnonce = Long.decode(request.getParameter("id"));
       
        AnnonceDao dao = new AnnonceDao();
        StatutDao sDao = new StatutDao();
       
       
        Annonce annonce = dao.getById(idAnnonce);
       
        annonce.setStatut(sDao.getById(2));
       
        dao.update(annonce);
       
        return mapping.findForward("default");

    }
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(),
                chercherForm.getRecherche(),
View Full Code Here

TOP

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

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.