Examples of GestionCompteClient


Examples of com.netflox.form.GestionCompteClient

    request.setAttribute("user", user);
   
    String inPath = this.getServletContext().getRealPath(IN_PATH);
    FilmsManager films = new FilmsManager(inPath);
   
    GestionCompteClient gcc = new GestionCompteClient(user);
    //récupération film loué
    ArrayList<String[]> filmLoue = new ArrayList<String[]>();
    ArrayList<Streaming> stream = gcc.filmLoue();
    for(Streaming s : stream){
      String titre = films.getFilm(s.getFilm().getId()).getTitre();
      String[] t = {titre , Long.toString(s.getDateFin()) , Long.toString(s.tempsRestantH()) , Long.toString(s.tempsRestantM()) };
      filmLoue.add(t);
    }
    request.setAttribute("filmLoue", filmLoue);
    //récupération historique achat
    ArrayList<String[]> ventesUser = new ArrayList<String[]>();
    ArrayList<Vente> histo = gcc.histoAchat();
    for(Vente v: histo){
      String type;
      if(v.getType().equals('a')){type="Achat";}else if(v.getType().equals('l')){type="Location";}else{type="Bon";}
      Date d = new Date(v.getDate());
      String prix = Integer.toString(v.getPrix());
View Full Code Here

Examples of com.netflox.form.GestionCompteClient

    request.setAttribute("user", user);
   
    String inPath = this.getServletContext().getRealPath(IN_PATH);
    FilmsManager films = new FilmsManager(inPath);
   
    GestionCompteClient gcc = new GestionCompteClient(user);
    //récupération film loué
    ArrayList<String[]> filmLoue = new ArrayList<String[]>();
    ArrayList<Streaming> stream = gcc.filmLoue();
    for(Streaming s : stream){
      String titre = films.getFilm(s.getFilm().getId()).getTitre();
      String[] t = {titre , Long.toString(s.tempsRestantH()) , Long.toString(s.tempsRestantM()) };
      filmLoue.add(t);
    }
    request.setAttribute("filmLoue", filmLoue);
    //récupération historique achat
    ArrayList<String[]> ventesUser = new ArrayList<String[]>();
    ArrayList<Vente> histo = gcc.histoAchat();
    for(Vente v: histo){
      String type;
      if(v.getType().equals('a')){type="Achat";}else if(v.getType().equals('l')){type="Location";}else{type="Bon";}
      Date d = new Date(v.getDate());
      String prix = Integer.toString(v.getPrix());
      String titre = "";
      if(!type.equals("Bon")){
        titre = films.getFilm(v.getIdFilm()).getTitre();
      }
      String[] tab = {type,d.toString(),prix,titre};
      ventesUser.add(tab);
    }
    request.setAttribute("ventesUser", ventesUser);
    //rechargement compte
    //récupération du montant
    int montant = Integer.parseInt(request.getParameter("montant"));
    int newSolde = gcc.rechargerCompte(montant);
    user.setSolde(newSolde);
   
    this.getServletContext().getRequestDispatcher(VUE).forward(request, response);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.