Examples of Vigneron


Examples of com.ledruide.druidecave.dao.Vigneron

        return resultats;
    }

    public static Vigneron getSessionRecoltantFromID() throws Exception {
        String recoltant_pk =  (String) Session.getInstance().getAttribute("RECOLTANT_ID");
        Vigneron recoltant = VigneronPeer.findByPK(recoltant_pk);
        if (recoltant == null) {
            // On repart vers la page d'accueil !
            // ERREUR
            SwapFrame.getInstance().init(Home.class);
        }
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigneron

        List<KeyValueBean> results = new ArrayList<KeyValueBean>();
        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) {
                    results.add(new KeyValueBean(vigneron.getId(), vigneron.getLastname() + ", " + vigneron.getFirstname()));
                }
            }
        }
        catch (Exception e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigneron

            fieldEmail.setText(Constants.BLANK);
        }
        else {
            String recoltant_id = (String) Session.getInstance().getAttribute("AJOUT_RECOLTANT_ID");
            Session.getInstance().removeAttribute("AJOUT_RECOLTANT_ID");
            Vigneron recoltant = VigneronPeer.findByPK(recoltant_id);
            fieldLastName.setText(recoltant.getLastname());
            fieldFirstname.setText(recoltant.getFirstname());
            fieldAddress.setText(recoltant.getAddress());
            fieldCP.setText(recoltant.getCp());
            fieldTown.setText(recoltant.getTown());
            ComponentTools.positionnerCombo(comboCountry, recoltant.getCountry_id());
            fieldWeb.setText(recoltant.getWeb());
            fieldNote.setText(recoltant.getNote());
            fieldTel.setText(recoltant.getTel());
            fieldFax.setText(recoltant.getFax());
            fieldEmail.setText(recoltant.getEmail());
        }

    }
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigneron

        }
        if (hasMessages()) {
            return false;
        }
       
        Vigneron leGars = new Vigneron();
        String recoltant_id = (String) Session.getInstance().getAttribute("AJOUT_RECOLTANT_ID");
        if (!TextTools.isNullOrEmpty(recoltant_id)) {
            leGars.setId(recoltant_id);
        }
        leGars.setAddress(fieldAddress.getText());
        leGars.setEmail(fieldEmail.getText());
        leGars.setCp(fieldCP.getText());
        leGars.setFax(fieldFax.getText());
        leGars.setLastname(fieldLastName.getText());
        leGars.setFirstname(fieldFirstname.getText());
        leGars.setNote(fieldNote.getText());
        leGars.setCountry_id(id_country);
        leGars.setWeb(fieldWeb.getText());
        leGars.setTel(fieldTel.getText());
        leGars.setTown(fieldTown.getText());

        try {
            leGars.save();
            recoltant_id = leGars.getId();
            if (!TextTools.isNullOrEmpty(recoltant_id)) {
                Session.getInstance().setAttribute("AJOUT_RECOLTANT_ID", recoltant_id);
                return true;
            }
        }
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigneron

        comboCountry.removeAllItems();
        CombosProxy.add(comboCountry, CountryProxy.getKeyValueList(), true);
        modelExiste.removeAllElements();
        modelRecoltant.removeAllElements();

        Vigneron recoltant = VigneronProxy.getSessionRecoltantFromID();
        fieldName.setText(recoltant.getFirstname() + " " + recoltant.getLastname());

        // Nous allons charger la liste des r�gion du r�coltant.
        List vignes = VigneronProxy.getRegions(recoltant.getId());
        ListsProxy.ajoutRegions(modelRecoltant, vignes);

        // On se place par d�faut sur le pays du r�coltant
        // ce qui charge automatiquement la liste des r�gions :)
        ComponentTools.positionnerCombo(comboCountry, recoltant.getCountry_id());

    }
View Full Code Here

Examples of com.ledruide.druidecave.dao.Vigneron

        }
    }

    private void enregistrer(Class sortie) {
        try {
            Vigneron recoltant = VigneronProxy.getSessionRecoltantFromID();
            if (VigneronProxy.ajoutRegions(recoltant.getId(), modelRecoltant.elements())) {
                SwapFrame.getInstance().init(sortie);
            }
            else {
                System.out.println("Impossible d'enregistrer ce r�coltant.");
            }
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.