Line 20... |
Line 20... |
20 |
import org.openconcerto.sql.model.SQLBase;
|
20 |
import org.openconcerto.sql.model.SQLBase;
|
21 |
import org.openconcerto.sql.model.SQLRow;
|
21 |
import org.openconcerto.sql.model.SQLRow;
|
22 |
import org.openconcerto.sql.model.SQLRowAccessor;
|
22 |
import org.openconcerto.sql.model.SQLRowAccessor;
|
23 |
import org.openconcerto.sql.model.SQLRowValues;
|
23 |
import org.openconcerto.sql.model.SQLRowValues;
|
24 |
import org.openconcerto.sql.model.SQLTable;
|
24 |
import org.openconcerto.sql.model.SQLTable;
|
- |
|
25 |
import org.openconcerto.sql.request.SQLFieldTranslator;
|
25 |
import org.openconcerto.ui.DefaultGridBagConstraints;
|
26 |
import org.openconcerto.ui.DefaultGridBagConstraints;
|
26 |
import org.openconcerto.ui.TitledSeparator;
|
27 |
import org.openconcerto.ui.TitledSeparator;
|
27 |
import org.openconcerto.ui.preferences.DefaultPreferencePanel;
|
28 |
import org.openconcerto.ui.preferences.DefaultPreferencePanel;
|
28 |
|
29 |
|
29 |
import java.awt.GridBagConstraints;
|
30 |
import java.awt.GridBagConstraints;
|
30 |
import java.awt.GridBagLayout;
|
31 |
import java.awt.GridBagLayout;
|
31 |
import java.awt.Insets;
|
32 |
import java.awt.Insets;
|
32 |
import java.sql.SQLException;
|
33 |
import java.sql.SQLException;
|
33 |
|
34 |
|
34 |
import javax.swing.JLabel;
|
35 |
import javax.swing.JLabel;
|
- |
|
36 |
import javax.swing.JOptionPane;
|
35 |
import javax.swing.JPanel;
|
37 |
import javax.swing.JPanel;
|
- |
|
38 |
import javax.swing.SwingUtilities;
|
36 |
|
39 |
|
37 |
public class ComptePayePreferencePanel extends DefaultPreferencePanel {
|
40 |
public class ComptePayePreferencePanel extends DefaultPreferencePanel {
|
38 |
private ISQLCompteSelector selCompteAcompte, selCompteAcompteReglement, selCompteRemunPers;
|
41 |
private ISQLCompteSelector selCompteAcompte, selCompteAcompteReglement, selCompteRemunPers;
|
39 |
private final static SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
|
42 |
private final static SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
|
40 |
private static final SQLTable tablePrefCompte = base.getTable("PREFS_COMPTE");
|
43 |
private static final SQLTable tablePrefCompte = base.getTable("PREFS_COMPTE");
|
Line 122... |
Line 125... |
122 |
this.rowPrefCompteVals.put("ID_COMPTE_PCE_ACOMPTE", this.selCompteAcompte.getValue());
|
125 |
this.rowPrefCompteVals.put("ID_COMPTE_PCE_ACOMPTE", this.selCompteAcompte.getValue());
|
123 |
this.rowPrefCompteVals.put("ID_COMPTE_PCE_ACOMPTE_REGL", this.selCompteAcompteReglement.getValue());
|
126 |
this.rowPrefCompteVals.put("ID_COMPTE_PCE_ACOMPTE_REGL", this.selCompteAcompteReglement.getValue());
|
124 |
this.rowPrefCompteVals.put("ID_COMPTE_PCE_PAYE", this.selCompteRemunPers.getValue());
|
127 |
this.rowPrefCompteVals.put("ID_COMPTE_PCE_PAYE", this.selCompteRemunPers.getValue());
|
125 |
|
128 |
|
126 |
try {
|
129 |
try {
|
- |
|
130 |
final Object[] pb = this.rowPrefCompteVals.getInvalid();
|
- |
|
131 |
if (pb != null) {
|
- |
|
132 |
final SQLFieldTranslator trans = Configuration.getInstance().getTranslator();
|
- |
|
133 |
JOptionPane.showMessageDialog(SwingUtilities.getRoot(this), "Impossible de valider les modifications! Le champ <"
|
- |
|
134 |
+ trans.getLabelFor(this.rowPrefCompteVals.getTable().getField(pb[0].toString())) + "> pointe sur un compte invalide!(" + pb[1] + ")");
|
- |
|
135 |
} else {
|
127 |
this.rowPrefCompteVals.update();
|
136 |
this.rowPrefCompteVals.update();
|
- |
|
137 |
}
|
128 |
} catch (SQLException e) {
|
138 |
} catch (SQLException e) {
|
129 |
e.printStackTrace();
|
139 |
e.printStackTrace();
|
130 |
}
|
140 |
}
|
131 |
}
|
141 |
}
|
132 |
|
142 |
|