Examples of FProduits


Examples of factories.FProduits

  public ArrayList<Produit> listerCatalogue(String libelleCategorie) throws MetierException,
      RemoteException {
   
    // recuperation de la liste des references des produits:
    List<String> listRefs = null;   
    FProduits fp = FProduits.getInstance();
   
    if(! fp.hasConnection()){
      try{           
        fp.setConnection(GestionConnection.getInstance().getConnection());
      }catch(SQLException se){
        throw new MetierException(MetierException.CONNEXION_IMPOSSIBLE);
      }
    }
   
   
    try{     
      listRefs = fp.getListeProduits(libelleCategorie);
    }catch(Exception e){
      throw new MetierException(MetierException.LISTE_NON_RECUPERABLE);
    }
   
    // TODO: a reflechir sur cette verification
    // POURQUOI EXCEPTION SI CATALOGUE VIDE ?
    if(listRefs.size() == 0){
      throw new MetierException(MetierException.CATALOGUE_VIDE);
      // return new ArrayList<Produit>;
    }
   
    // remplissage de la liste des produits a partir des references.
    ArrayList<Produit> listProduits = new ArrayList<Produit>();
    for(Iterator<String> it = listRefs.iterator(); it.hasNext();){
      String ref = (String)it.next();
      try {
        // recuperation du produit a partir de sa reference.
        Produit p = fp.rechercherProduit(ref);
        // ajout du produit dans la liste
        listProduits.add(p);
       
      } catch (SQLException se) {
        //  en cas de coupure reseau.
View Full Code Here

Examples of factories.FProduits

   * @see interfaces.catalogue.IMetierCatalogue#rechercherProduit(java.lang.String)
   */
  public Produit rechercherProduit(String reference) throws MetierException,
      RemoteException {

    FProduits fp = FProduits.getInstance();
   
   
      try{
        if(! fp.hasConnection())
          fp.setConnection(GestionConnection.getInstance().getConnection());
        return fp.rechercherProduit(reference);
      }catch(SQLException se){
        throw new MetierException(MetierException.CONNEXION_IMPOSSIBLE);
      }
  }
View Full Code Here

Examples of factories.FProduits

      }
  }
 
 
  public ArrayList<String> getListeCategories() throws RemoteException, MetierException {
    FProduits fp = FProduits.getInstance();
    ArrayList<String> listeCats = new ArrayList<String>();
    try{
      if(! fp.hasConnection())
        fp.setConnection(GestionConnection.getInstance().getConnection());
      listeCats.addAll(fp.getListeCategorie());
      return listeCats;
    }catch(SQLException se){
      throw new MetierException(MetierException.CONNEXION_IMPOSSIBLE);
    }
  }
View Full Code Here

Examples of factories.FProduits

  public ArrayList<Produit> listerCatalogue(String libelleCategorie) throws MetierException,
      RemoteException {
   
    // recuperation de la liste des references des produits:
    List<String> listRefs = null;   
    FProduits fp = FProduits.getInstance();
   
    if(! fp.hasConnection()){
      try{           
        fp.setConnection(GestionConnection.getInstance().getConnection());
      }catch(SQLException se){
        throw new MetierException(MetierException.CONNEXION_IMPOSSIBLE);
      }
    }
   
   
    try{     
      listRefs = fp.getListeProduits(libelleCategorie);
    }catch(Exception e){
      throw new MetierException(MetierException.LISTE_NON_RECUPERABLE);
    }
   
    // TODO: a reflechir sur cette verification
    // POURQUOI EXCEPTION SI CATALOGUE VIDE ?
    if(listRefs.size() == 0){
      throw new MetierException(MetierException.CATALOGUE_VIDE);
      // return new ArrayList<Produit>;
    }
   
    // remplissage de la liste des produits a partir des references.
    ArrayList<Produit> listProduits = new ArrayList<Produit>();
    for(Iterator<String> it = listRefs.iterator(); it.hasNext();){
      String ref = (String)it.next();
      try {
        // recuperation du produit a partir de sa reference.
        Produit p = fp.rechercherProduit(ref);
        // ajout du produit dans la liste
        listProduits.add(p);
       
      } catch (SQLException se) {
        //  en cas de coupure reseau.
View Full Code Here

Examples of factories.FProduits

   * @see interfaces.catalogue.IMetierCatalogue#rechercherProduit(java.lang.String)
   */
  public Produit rechercherProduit(String reference) throws MetierException,
      RemoteException {

    FProduits fp = FProduits.getInstance();
   
   
      try{
        if(! fp.hasConnection())
          fp.setConnection(GestionConnection.getInstance().getConnection());
        return fp.rechercherProduit(reference);
      }catch(SQLException se){
        throw new MetierException(MetierException.CONNEXION_IMPOSSIBLE);
      }
  }
View Full Code Here

Examples of factories.FProduits

      }
  }
 
 
  public ArrayList<String> getListeCategories() throws RemoteException, MetierException {
    FProduits fp = FProduits.getInstance();
    ArrayList<String> listeCats = new ArrayList<String>();
    try{
      if(! fp.hasConnection())
        fp.setConnection(GestionConnection.getInstance().getConnection());
      listeCats.addAll(fp.getListeCategorie());
      return listeCats;
    }catch(SQLException se){
      throw new MetierException(MetierException.CONNEXION_IMPOSSIBLE);
    }
  }
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.