Package metier.clients

Examples of metier.clients.MetierClients


    public void run(){
      try{
        System.out.println("coucou 1");
//            registration du metier Clients.
            String name = "MetierClients";
            IMetierClients metierClients = new MetierClients();
           
            System.out.println("coucou 2");           
            IMetierClients stubClient =
                (IMetierClients) UnicastRemoteObject.exportObject(metierClients, port);
            System.out.println("Registration de "+name);
View Full Code Here


  /**
   *
   */
  public String execute(HttpServletRequest req) throws Exception {

    MetierClients mc = new MetierClients();
    String actionLogin = req.getParameter(Message.ACTION_LOGIN);
    String actionValidation = req.getParameter(Message.ACTION_VALIDATION);
   
    // On est sur une validation panier
    if(actionValidation != null){
      // Si erreur on revient avec le bon message
      req.setAttribute(Message.ACTION_VALIDATION, Message.VALIDATION);
      req.setAttribute(Message.ACTION_VALIDATION, Message.AFF_VALIDATION);
     
      //suite =  suiteValidationPanier;
    }
   
   
    if(actionLogin != null){
      String id = req.getParameter("id");
      if (!verifierChaine(id)) {
        req.setAttribute(Message.MESSAGE_ERREUR, Message.SAISIE_ID);
        return erreur;
      }

      String mdp = req.getParameter("mdp");

      try {
       
        System.out.println("ID = "+id);
        System.out.println("MDP = "+mdp);
       
        Client client = mc.rechercherClient(id);
        System.out.println("Client = "+client);
        if(!client.getMdp().equals(mdp)){
          req.setAttribute(Message.MESSAGE_ERREUR, Message.MDP_INCORRECTE);
          return erreur;
        }     
View Full Code Here

    /**
     *
     */
    public String execute(HttpServletRequest req) throws Exception {
      String actionCreation = req.getParameter(Message.ACTION_CREATION);
      MetierClients mc = new MetierClients();
     
      String actionValidation = req.getParameter(Message.ACTION_VALIDATION);
      // On est sur une validation panier
      if(actionValidation != null){
        System.out.println("Creation ACTION VAL Ok :");
        // Si erreur on revient avec le bon message
        req.setAttribute(Message.ACTION_VALIDATION, Message.VALIDATION);
        req.setAttribute(Message.ACTION_VALIDATION, Message.AFF_VALIDATION);
       
      }
     
     
      if(actionCreation != null){
        if(actionCreation.equals(Message.VERIF_CREATION)){       
          String id = req.getParameter("id");
          if(!verifierChaine(id)){         
            req.setAttribute(Message.MESSAGE_ERREUR, Message.SAISIE_ID);         
            return erreur;
          }
          String nom = req.getParameter("nom");
          if(!verifierChaine(nom)){
            req.setAttribute(Message.MESSAGE_ERREUR, Message.SAISIE_NOM);         
            return erreur;
          }
          String prenom = req.getParameter("prenom");
          if(!verifierChaine(prenom)){
            req.setAttribute(Message.MESSAGE_ERREUR, Message.SAISIE_PRENOM);         
            return erreur;
          }
          String adresse = req.getParameter("adresse");
          if(!verifierChaine(adresse)){
            req.setAttribute(Message.MESSAGE_ERREUR, Message.SAISIE_ADRESSE);         
            return erreur;
          }       
          String mdp = req.getParameter("mdp");
          String mdp2 = req.getParameter("mdp2");
          if(!verifierChaine(mdp) || !verifierChaine(mdp2) || !mdp.equals(mdp2)){           
            req.setAttribute(Message.MESSAGE_ERREUR, Message.SAISIE_MDP);         
            return erreur;
          }
                   
         
          try{           
            Client client = new Client();
            client.setId(id);
            client.setNom(nom);
            client.setPrenom(prenom);
            client.setAdresse(adresse);
            client.setMdp(mdp);
            mc.creerClient(client);
            HttpSession session = req.getSession(true);
            session.setAttribute("client", client);
           
            // Tout est Ok
            return suiteSiCreationOk;
View Full Code Here

    /**
     *
     */
    public String execute(HttpServletRequest req) throws Exception {
      String actionModif = req.getParameter(Message.ACTION_MODIF_ADRESSE);
      MetierClients mc = new MetierClients();
     
     
     
      if(actionModif != null){           
         
          String adresse = req.getParameter("adresse");
          if(!verifierChaine(adresse)){
            req.setAttribute(Message.MESSAGE_ERREUR, Message.SAISIE_ADRESSE);         
            return erreur;
          }       
                             
         
          try{         
            HttpSession session = req.getSession(false);
            if(session != null){
              Client client = (Client)session.getAttribute("client");
              if(client == null){
                throw new MetierException();
              }
              System.out.println("Adresse : "+adresse);
              // On modifie l'adresse du client
              client.setAdresse(adresse);
              mc.modifierAdresse(client);
             
              // On remet l'adresse dans la session
              session.setAttribute("client", client);
             
              // Tout est ok
View Full Code Here

TOP

Related Classes of metier.clients.MetierClients

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.