Line 242... |
Line 242... |
242 |
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
|
242 |
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
|
243 |
@Override
|
243 |
@Override
|
244 |
public void componentSelected(ButtonEvent ce) {
|
244 |
public void componentSelected(ButtonEvent ce) {
|
245 |
String code = ((Button) ce.getComponent()).getData("code");
|
245 |
String code = ((Button) ce.getComponent()).getData("code");
|
246 |
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
|
246 |
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
|
247 |
soumettreFormulaire(renvoyerStructureForm());
|
247 |
soumettreFormulaire();
|
248 |
clicBoutonvalidation = true;
|
248 |
clicBoutonvalidation = true;
|
249 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
|
249 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
|
250 |
soumettreFormulaire(renvoyerStructureForm());
|
250 |
soumettreFormulaire();
|
251 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
|
251 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
|
252 |
mediateur.clicMenu(menuIdCourant);
|
252 |
mediateur.clicMenu(menuIdCourant);
|
253 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_REINITIALISER)) {
|
253 |
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_REINITIALISER)) {
|
254 |
if (mode.equals(StructureForm.MODE_MODIFIER)) {
|
254 |
if (mode.equals(StructureForm.MODE_MODIFIER)) {
|
255 |
mediateur.afficherFormStructure(identification.getId());
|
255 |
mediateur.afficherFormStructure(identification.getId());
|
Line 261... |
Line 261... |
261 |
};
|
261 |
};
|
Line 262... |
Line 262... |
262 |
|
262 |
|
263 |
return ecouteur;
|
263 |
return ecouteur;
|
Line 264... |
Line -... |
264 |
}
|
- |
|
265 |
|
- |
|
266 |
private StructureForm renvoyerStructureForm() {
|
- |
|
267 |
return this;
|
- |
|
268 |
}
|
264 |
}
|
269 |
|
265 |
|
270 |
protected void soumettreFormulaire(Rafraichissable vueARafraichir) {
|
266 |
protected void soumettreFormulaire() {
|
271 |
// Vérification de la validité des champs du formulaire
|
267 |
// Vérification de la validité des champs du formulaire
|
272 |
if (verifierFormulaire()) {
|
268 |
if (verifierFormulaire()) {
|
273 |
// Collecte des données du formulaire
|
269 |
// Collecte des données du formulaire
|
274 |
Structure structure = collecterStructureIdentification();
|
270 |
Structure structure = collecterStructureIdentification();
|
275 |
StructureConservation conservation = collecterStructureConservation();
|
271 |
StructureConservation conservation = collecterStructureConservation();
|
Line 276... |
Line 272... |
276 |
StructureValorisation valorisation = collecterStructureValorisation();
|
272 |
StructureValorisation valorisation = collecterStructureValorisation();
|
277 |
collecterStructurePersonnel();
|
273 |
collecterStructurePersonnel();
|
278 |
|
274 |
|
279 |
if (mode.equals(MODE_AJOUTER)) {
|
275 |
if (mode.equals(MODE_AJOUTER)) {
|
280 |
// Ajout des informations sur la Structure
|
276 |
// Ajout des informations sur la Structure
|
281 |
mediateur.ajouterStructure(vueARafraichir, structure, conservation, valorisation);
|
277 |
mediateur.ajouterStructure(this, structure, conservation, valorisation);
|
282 |
// L'ajout des relations StructureAPersonne se fait quand la structure a été ajoutée
|
278 |
// L'ajout des relations StructureAPersonne se fait quand la structure a été ajoutée
|
283 |
// Voir la méthode rafraichir().
|
279 |
// Voir la méthode rafraichir().
|
Line 291... |
Line 287... |
291 |
if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
|
287 |
if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) {
|
292 |
Info.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
|
288 |
Info.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
|
293 |
} else {
|
289 |
} else {
|
294 |
if (personnelModifie.size() != 0) {
|
290 |
if (personnelModifie.size() != 0) {
|
295 |
decompteRafraichissementPersonnel++;
|
291 |
decompteRafraichissementPersonnel++;
|
296 |
mediateur.modifierStructureAPersonne(vueARafraichir, personnelModifie);
|
292 |
mediateur.modifierStructureAPersonne(this, personnelModifie);
|
297 |
}
|
293 |
}
|
298 |
// Ajout des relations StructureAPersonne
|
294 |
// Ajout des relations StructureAPersonne
|
299 |
if (personnelAjoute.size() != 0) {
|
295 |
if (personnelAjoute.size() != 0) {
|
300 |
decompteRafraichissementPersonnel++;
|
296 |
decompteRafraichissementPersonnel++;
|
301 |
mediateur.ajouterStructureAPersonne(vueARafraichir, identification.getId(), personnelAjoute);
|
297 |
mediateur.ajouterStructureAPersonne(this, identification.getId(), personnelAjoute);
|
302 |
}
|
298 |
}
|
303 |
// Suppression des relations StructureAPersonne
|
299 |
// Suppression des relations StructureAPersonne
|
304 |
if (personnelSupprime.size() != 0) {
|
300 |
if (personnelSupprime.size() != 0) {
|
305 |
decompteRafraichissementPersonnel++;
|
301 |
decompteRafraichissementPersonnel++;
|
306 |
mediateur.supprimerStructureAPersonne(vueARafraichir, personnelSupprime);
|
302 |
mediateur.supprimerStructureAPersonne(this, personnelSupprime);
|
307 |
}
|
303 |
}
|
308 |
}
|
304 |
}
|
309 |
}
|
305 |
}
|
310 |
}
|
306 |
}
|
311 |
}
|
307 |
}
|
Line 1856... |
Line 1852... |
1856 |
}
|
1852 |
}
|
1857 |
} catch (Exception e) {
|
1853 |
} catch (Exception e) {
|
1858 |
GWT.log("rafraichir()", e);
|
1854 |
GWT.log("rafraichir()", e);
|
1859 |
}
|
1855 |
}
|
Line 1860... |
Line 1856... |
1860 |
|
1856 |
|
1861 |
verifierApresRafraichissement();
|
1857 |
controlerFermetureApresRafraichissement();
|
Line 1862... |
Line 1858... |
1862 |
}
|
1858 |
}
|
1863 |
|
1859 |
|
1864 |
public void rafraichirInformation(Information info) {
|
1860 |
public void rafraichirInformation(Information info) {
|