OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 96 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 96 Rev 152
Line 1... Line 1...
1
package org.openconcerto.modules.subscription;
1
package org.openconcerto.modules.subscription;
2
 
2
 
3
import java.awt.event.ActionEvent;
3
import java.awt.event.ActionEvent;
4
import java.io.IOException;
4
import java.io.IOException;
-
 
5
import java.sql.SQLException;
5
import java.util.Calendar;
6
import java.util.Calendar;
6
 
7
 
7
import javax.swing.AbstractAction;
8
import javax.swing.AbstractAction;
8
import javax.swing.JFrame;
9
import javax.swing.JFrame;
9
import javax.swing.JOptionPane;
10
import javax.swing.JOptionPane;
Line 47... Line 48...
47
        super(f);
48
        super(f);
48
 
49
 
49
    }
50
    }
50
 
51
 
51
    @Override
52
    @Override
52
    protected void install(DBContext ctxt) {
53
    protected void install(DBContext ctxt) throws SQLException, IOException {
53
        super.install(ctxt);
54
        super.install(ctxt);
54
 
55
 
55
        if (ctxt.getLastInstalledVersion() == null) {
56
        if (ctxt.getLastInstalledVersion() == null) {
56
 
57
 
57
            if (ctxt.getRoot().getTable("ABONNEMENT") == null) {
58
            if (ctxt.getRoot().getTable("ABONNEMENT") == null) {
Line 80... Line 81...
80
                createTable.addColumn("DATE_DEBUT_COMMANDE", "date");
81
                createTable.addColumn("DATE_DEBUT_COMMANDE", "date");
81
                createTable.addColumn("DATE_FIN_COMMANDE", "date");
82
                createTable.addColumn("DATE_FIN_COMMANDE", "date");
82
                createTable.addColumn("NB_MOIS_COMMANDE", "int DEFAULT 3");
83
                createTable.addColumn("NB_MOIS_COMMANDE", "int DEFAULT 3");
83
                createTable.addColumn("CREATE_COMMANDE", "boolean DEFAULT false");
84
                createTable.addColumn("CREATE_COMMANDE", "boolean DEFAULT false");
84
 
85
 
85
                // ctxt.manipulateData(new IClosure<DBRoot>() {
-
 
86
                // @Override
-
 
87
                // public void executeChecked(DBRoot input) {
-
 
88
                // // Undefined Affaire
-
 
89
                // SQLRowValues rowVals = new SQLRowValues(input.getTable("ABONNEMENT"));
-
 
90
                // try {
-
 
91
                // rowVals.insert();
-
 
92
                // } catch (SQLException exn) {
-
 
93
                // // TODO Bloc catch auto-généré
-
 
94
                // exn.printStackTrace();
-
 
95
                // }
-
 
96
                //
-
 
97
                // }
-
 
98
                // });
-
 
99
 
-
 
100
                AlterTableRestricted alterNumero = ctxt.getAlterTable("NUMEROTATION_AUTO");
86
                AlterTableRestricted alterNumero = ctxt.getAlterTable("NUMEROTATION_AUTO");
101
                alterNumero.addVarCharColumn("ABONNEMENT_FORMAT", 128);
87
                alterNumero.addVarCharColumn("ABONNEMENT_FORMAT", 128);
102
                alterNumero.addIntegerColumn("ABONNEMENT_START", 1);
88
                alterNumero.addIntegerColumn("ABONNEMENT_START", 1);
103
 
89
 
104
                AlterTableRestricted alterFact = ctxt.getAlterTable("SAISIE_VENTE_FACTURE");
90
                AlterTableRestricted alterFact = ctxt.getAlterTable("SAISIE_VENTE_FACTURE");
Line 111... Line 97...
111
 
97
 
112
                AlterTableRestricted alterCmd = ctxt.getAlterTable("DEVIS");
98
                AlterTableRestricted alterCmd = ctxt.getAlterTable("DEVIS");
113
                alterCmd.addForeignColumn("ID_ABONNEMENT", createTable);
99
                alterCmd.addForeignColumn("ID_ABONNEMENT", createTable);
114
                alterCmd.addColumn("CREATION_AUTO_VALIDER", "boolean DEFAULT false");
100
                alterCmd.addColumn("CREATION_AUTO_VALIDER", "boolean DEFAULT false");
115
 
101
 
-
 
102
                ctxt.executeSQL();
-
 
103
                SQLRowValues rowVals = new SQLRowValues(ctxt.getRoot().getTable("ABONNEMENT"));
-
 
104
                rowVals.insert();
116
            }
105
            }
117
 
106
 
118
        }
107
        }
119
    }
108
    }
120
 
109