Examples of Vigne


Examples of com.ledruide.druidecave.dao.Vigne

     *
     * @throws Exception si une erreur survient
     */
    private void lesVignes() throws Exception {
        for (int i = 0; i < vignes.size(); i++) {
            Vigne orig = (Vigne) vignes.get(i);
            // Trouvons les caract�ristiques suivantes :

            // Pays
//            String ancien_pays = orig.getCountry_id();
//            String pays_id = Finder.pays(ancien_pays, pays);
//            if (pays_id != null) orig.setCountry_id(pays_id);
//            //else /* Demander � l'utilisateur */ continue;
//
//            // R�gion si pays non null
//            String ancien_region = orig.getRegion_id();
//            String region_id = Finder.region(ancien_region, ancien_pays, pays_id, regions);
//            if (region_id != null) orig.setRegion_id(region_id);
//            //else /* Demander � l'utilisateur */ continue;
//
//            // Appellation si region non nulle
//            String appellation_id = Finder.appellation(orig.getDenomination_id(), ancien_region, region_id, appellations);
//            if (appellation_id != null) orig.setDenomination_id(appellation_id);
            //else /* Demander � l'utilisateur */ continue;

            orig.save();
        }
    }
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigne

     */
    public static boolean ajoutRegions(String recoltant_id, Enumeration<?> regions) {

        try {
            // on supprime les vigne existantes de ce viticulteur.
            Vigne lavigne = new Vigne();
            lavigne.setVigneron_id(recoltant_id);
            // on ne commit pas les donn�e maintenant....
            VignePeer.deleteSome(VignePeer.find(lavigne), false);

            while (regions.hasMoreElements()) {
                KeyValueBean countryRegion = (KeyValueBean) regions.nextElement();
                // kloug avoir une clef en 2 (pays,region) et l'extraire.
                String countryKey = CountryProxy.extract(countryRegion.getKey());
                String regionKey  = RegionProxy.extract(countryRegion.getKey());
                //Region region = RegionPeer.findByPK(countryRegion.getKey(),"");
                Vigne vigne = new Vigne();
                vigne.setVigneron_id(recoltant_id);
                vigne.setCountry_id(countryKey);
                vigne.setRegion_id(regionKey);
                if (regions.hasMoreElements()) {
                    vigne.save(false);
                }
                else {
                    // On commit sur le dernier �l�ment pour tout enregistrer d'un coup...
                    vigne.save(true);
                }
            }
        }
        catch (Exception e) {
            e.printStackTrace();
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigne

     */
    public static List getRegions(String recoltant_id) {
        List vignes = null;
        try {
            // On r�cupere les r�gion de vigne qu'ils travaillent
            Vigne vigne = new Vigne();
            vigne.setVigneron_id(recoltant_id);
            vignes = VignePeer.find(vigne);
        }
        catch (Exception e) {
            System.out.println("Impossible de trouver les vignes de ce r�coltant : ");
            e.printStackTrace();
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigne

                    // On r�cup�re leur ID
                    String recoltant_id = recoltant1.getId();
                    // On v�rifie que leurs vignes sont dans le bon pays region.
                    if (!TextTools.isNullOrEmpty(pays_id)) {
                        // On r�cupere les r�gion de vigne qu'ils travaillent
                        Vigne vigne = new Vigne();
                        vigne.setVigneron_id(recoltant_id);
                        vigne.setCountry_id(pays_id);
                        if (!TextTools.isNullOrEmpty(region_id)) vigne.setRegion_id(region_id);
                        List vignes = VignePeer.find(vigne);
                        if (vignes != null && vignes.size() > 0) {
                            resultats.add(recoltant1);
                        }
                        else {
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigne

        try {
            List<Vigneron> vignerons = VigneronPeer.findAll();
            // For each Vigneron  we're going to filter with the country/region
            for (int i = 0; i < vignerons.size(); i++) {
                Vigneron vigneron = vignerons.get(i);
                Vigne vigne = new Vigne();
                vigne.setVigneron_id(vigneron.getId());
                if (! TextTools.isNullOrEmpty(country)) {
                    vigne.setCountry_id(country);
                    if (TextTools.isNullOrEmpty(region)) {
                        vigne.setVigneron_id(region);
                        if (TextTools.isNullOrEmpty(denomination)) {
                            vigne.setVigneron_id(denomination);
                        }
                    }
                }
                List vignes = VignePeer.find(vigne);
                if (vignes != null && vignes.size() > 0) {
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigne

     */
    public static void ajoutRegions(DefaultListModel modelRecoltant, List liste) {
        if (liste != null) {
            for (int i = 0; i < liste.size(); i++) {
                try {
                    Vigne vigne = (Vigne) liste.get(i);
                    // On r�cup�re la r�gion et le pays :
                    String countryLabel = CountryProxy.get(vigne.getCountry_id());
                    String regionLabel = RegionProxy.get(vigne.getCountry_id(), vigne.getRegion_id());
                    // Ici on concatene le pays devant le nom de la r�gion
                    modelRecoltant.addElement(new KeyValueBean(vigne.getCountry_id() + "." + vigne.getRegion_id(), countryLabel + " : " + regionLabel));
                }
                catch (Exception e) {
                    // On passe � la suivante
                    e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                }
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.