Package model

Examples of model.Client


    if(request.getParameter("action") != null && request.getParameter("action").equals("connect")){
      try{
        /*
         * construction et execution de la requ�te de recherche de l'utilisateur avec les param�tres pass�s
         */
        Client client = (Client) hsession.createQuery("from model.Client where login = :login and password = :password").setParameter("login", login).setParameter("password", password).getSingleResult();
        /*
         * Si un utilisateur a �t� trouv�, on l'enregistre dans la session HTTP
         */
        session.setAttribute("user", client);

View Full Code Here


    fi = new FileInputStream(f);
    fi.read(photo);
    book.setPhoto(photo);
    entityManager.persist(book);

    Client user = new Client();
    user.setLogin("galland");
    user.setPassword("dauphine");
    entityManager.persist(user);
   

    entityManager.getTransaction().commit();
  }
View Full Code Here

   * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    System.out.println("LostPassServlet");
   
    Client client = null ;
    String pass = null ;
    EntityManager em = JpaFilter.getEntityManager();
   
    //On extrait les param�tres, donc l'adresse mail de l'utilisateur
    String paramMail = request.getParameter("lostPassMailValue") ; System.out.println(paramMail);
View Full Code Here

       
        /*
         * V�rification de la non-existence du login du nouvel utilisateur
         */
        try{
          Client client = (Client) hsession.createQuery("from model.Client where login = :login").setParameter("login", login).getSingleResult();
          if(client.getLogin().equals(login)){
            request.setAttribute("registerMessage", "register.alreadyExists");
            getServletContext().getRequestDispatcher("/register.jsp").forward(request, response);
          }
       
        }catch(NoResultException e){
          /*
           * Aucune information remont�e de base, le login n'existe pas
           */
        }
       
        /*
         * V�rification du mot de passe de confirmation
         */
        if(password.equals(passwordConfirmed)){
          Client newClient = new Client();
          /*
           * Enregistrement des infos de connexion
           */
         
          newClient.setFirstName(firstName);
          newClient.setName(name);
          newClient.setLogin(login);
          newClient.setPassword(password);
          newClient.setMail(mail);
         
          /*
           * Enregistrement des infos de livraison
           */
         
          newClient.setAdresse(adresse);
          if(adresseLivraison != null && !adresseLivraison.isEmpty()){
            newClient.setAdresseLivraison(adresseLivraison);
          }else{
            newClient.setAdresseLivraison(adresse);
          }
          newClient.setNumTel(numTel);
          /*
           * Commit BDD des donn�es sett�es dans l'objet user
           */
         
          entityManager.persist(newClient);
 
View Full Code Here

TOP

Related Classes of model.Client

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.