Line 125... |
Line 125... |
125 |
c.weightx = 1;
|
125 |
c.weightx = 1;
|
126 |
JDate dateButoire = new JDate(false);
|
126 |
JDate dateButoire = new JDate(false);
|
127 |
this.add(dateButoire, c);
|
127 |
this.add(dateButoire, c);
|
128 |
|
128 |
|
129 |
this.addView(dateButoire, "DATE_BUTOIRE");
|
129 |
this.addView(dateButoire, "DATE_BUTOIRE");
|
- |
|
130 |
|
130 |
//
|
131 |
//
|
131 |
// c.gridx++;
|
132 |
// c.gridx++;
|
132 |
// c.weightx = 0;
|
133 |
// c.weightx = 0;
|
133 |
// this.add(new JLabel(getLabelFor("DATE_DISPOSITION"), SwingConstants.RIGHT), c);
|
134 |
// this.add(new JLabel(getLabelFor("DATE_DISPOSITION"), SwingConstants.RIGHT), c);
|
134 |
// c.gridx++;
|
135 |
// c.gridx++;
|
Line 545... |
Line 546... |
545 |
@Override
|
546 |
@Override
|
546 |
protected SQLRowValues createDefaults() {
|
547 |
protected SQLRowValues createDefaults() {
|
547 |
SQLRowValues rowVals = new SQLRowValues(getTable());
|
548 |
SQLRowValues rowVals = new SQLRowValues(getTable());
|
548 |
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(DemandePrixSQLElement.class));
|
549 |
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(DemandePrixSQLElement.class));
|
549 |
SQLElement eltComm = getElement().getForeignElement("ID_COMMERCIAL");
|
550 |
SQLElement eltComm = getElement().getForeignElement("ID_COMMERCIAL");
|
550 |
int idUser = UserManager.getInstance().getCurrentUserID();
|
551 |
int idUser = UserManager.getInstance().getCurrentUser().getId();
|
551 |
|
552 |
|
552 |
SQLRow rowsComm = SQLBackgroundTableCache.getInstance().getCacheForTable(eltComm.getTable()).getFirstRowContains(idUser, eltComm.getTable().getField("ID_USER_COMMON"));
|
553 |
SQLRow rowsComm = SQLBackgroundTableCache.getInstance().getCacheForTable(eltComm.getTable()).getFirstRowContains(idUser, eltComm.getTable().getField("ID_USER_COMMON"));
|
553 |
|
554 |
|
554 |
if (rowsComm != null) {
|
555 |
if (rowsComm != null) {
|
555 |
rowVals.put("ID_COMMERCIAL", rowsComm.getID());
|
556 |
rowVals.put("ID_COMMERCIAL", rowsComm.getID());
|
Line 578... |
Line 579... |
578 |
* @param idDemande
|
579 |
* @param idDemande
|
579 |
*
|
580 |
*
|
580 |
*/
|
581 |
*/
|
581 |
public void loadDemandeExistant(final int idDemande) {
|
582 |
public void loadDemandeExistant(final int idDemande) {
|
582 |
|
583 |
|
583 |
final SQLElement demande = Configuration.getInstance().getDirectory().getElement("DEMANDE_PRIX");
|
584 |
final SQLElement demande = getElement();
|
584 |
final SQLElement demandeElt = Configuration.getInstance().getDirectory().getElement("DEMANDE_PRIX_ELEMENT");
|
585 |
final SQLElement demandeElt = getElement().getDirectory().getElement("DEMANDE_PRIX_ELEMENT");
|
585 |
|
586 |
|
586 |
// On duplique la demande
|
587 |
// On duplique la demande
|
587 |
if (idDemande > 1) {
|
588 |
if (idDemande > 1) {
|
588 |
final SQLRow row = demande.getTable().getRow(idDemande);
|
589 |
final SQLRow row = demande.getTable().getRow(idDemande);
|
589 |
final SQLRowValues rowVals = new SQLRowValues(demande.getTable());
|
590 |
final SQLRowValues rowVals = new SQLRowValues(demande.getTable());
|
- |
|
591 |
if (demande.getTable().contains("ID_AFFAIRE")) {
|
590 |
rowVals.put("ID_AFFAIRE", row.getInt("ID_AFFAIRE"));
|
592 |
rowVals.put("ID_AFFAIRE", row.getForeignIDNumber("ID_AFFAIRE"));
|
- |
|
593 |
}
|
591 |
// rowVals.put("DATE_BUTOIRE", row.getObject("DATE_BUTOIRE"));
|
594 |
// rowVals.put("DATE_BUTOIRE", row.getObject("DATE_BUTOIRE"));
|
592 |
// rowVals.put("DATE_DISPOSITION", row.getObject("DATE_DISPOSITION"));
|
595 |
// rowVals.put("DATE_DISPOSITION", row.getObject("DATE_DISPOSITION"));
|
593 |
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(DemandePrixSQLElement.class));
|
596 |
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(DemandePrixSQLElement.class));
|
594 |
rowVals.put("ID_ETAT_DEMANDE_PRIX", EtatDemandePrixSQLElement.EN_ATTENTE);
|
597 |
rowVals.put("ID_ETAT_DEMANDE_PRIX", EtatDemandePrixSQLElement.EN_ATTENTE);
|
595 |
rowVals.put("OBJET", row.getObject("OBJET"));
|
598 |
rowVals.put("OBJET", row.getObject("OBJET"));
|