Package com.ledruide.druidecave.dao

Examples of com.ledruide.druidecave.dao.Tasting


        columnNames = TableDegustations.LES_TITRES;
        dataVector = new Vector();
    }

    public Object getValueAt(int row, int col) {
        Tasting objet = (Tasting) dataVector.get(row);
        if (objet != null) {
            try {
                switch (col) {
                    case TableDegustations.INDEX_DATE:
                        return objet.getDate();
                    case TableDegustations.INDEX_NOTE:
                        return objet.getNote();
                    case TableDegustations.INDEX_TYPE:
                        if (objet.getType() != null) {
                            return objet.getType();
                        }
                        return "";
                    case TableDegustations.INDEX_DEBUT:
                        return objet.getComment().substring(0, 20);
                }
            }
            catch (Exception e) {
                System.out.println("Une erreur est survenue durant l'affichage : " + e.getMessage());
            }
View Full Code Here


        fieldYear.setText(bouteille.getYear());

        resultats.getSelectionModel().clearSelection();
        tableModel.vider();

        Tasting degust = new Tasting();
        degust.setBoltle_id(bouteille.getId());
        List results = TastingPeer.find(degust);
        tableModel.addRows(results);

        fieldDate.setText("");
        fieldNote.setText("");
View Full Code Here

    }

    public void valueChanged(ListSelectionEvent e) {
        if (e.getSource().equals(resultats.getSelectionModel())) {
            if (!e.getValueIsAdjusting()) {
                Tasting degust = (Tasting) tableModel.getSelection(resultats.getSelectedRow());
                if (degust != null) {
                    fieldDate.setText(degust.getDate());
                    fieldNote.setText(degust.getNote());
                    fieldComment.setText(degust.getComment());
                }
            }
        }
    }
View Full Code Here

     *
     * @throws Exception si une erreur survient
     */
    private void lesDegustations() throws Exception {
        for (int i = 0; i < degustations.size(); i++) {
            Tasting orig = (Tasting) degustations.get(i);
            // Pas de transfert particulier � effectuer donc on prend tout...
            orig.save();
        }
    }
View Full Code Here

        else if (e.getSource().equals(buttonSave)) {
            try {
                // SI le commentaire est vide on enregistre rien
                if (!TextTools.isNullOrEmpty(fieldComment.getText())) {
                    Bottle bouteille =  BottlesProxy.getSessionBouteilleFromID();
                    Tasting degust = new Tasting();
                    degust.setBoltle_id(bouteille.getId());
                    degust.setDate(fieldDate.getText());
                    degust.setNote(fieldNote.getText());
                    degust.setComment(fieldComment.getText());
                    degust.setType("Simple");
                    degust.save();

                    SwapFrame.getInstance().init(BottleTastingList.class);
                }
            }
            catch (Exception e1) {
View Full Code Here

TOP

Related Classes of com.ledruide.druidecave.dao.Tasting

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.