Search in sources :

Example 1 with CandidatCursusExterneWindow

use of fr.univlorraine.ecandidat.views.windows.CandidatCursusExterneWindow in project esup-ecandidat by EsupPortail.

the class CandidatParcoursController method editCursusPostBac.

/**
 * Edition d'un cursus
 */
public void editCursusPostBac(final Candidat candidat, CandidatCursusPostBac cursus, final CandidatCursusExterneListener listener) {
    /* Verrou --> normalement le lock est géré en amont mais on vérifie qd même */
    final String lockError = candidatController.getLockError(candidat.getCompteMinima(), ConstanteUtils.LOCK_CURSUS_EXTERNE);
    if (lockError != null) {
        Notification.show(lockError, Type.ERROR_MESSAGE);
        return;
    }
    Boolean nouveau = false;
    if (cursus == null) {
        cursus = new CandidatCursusPostBac();
        cursus.setCandidat(candidat);
        nouveau = true;
    }
    final CandidatCursusExterneWindow window = new CandidatCursusExterneWindow(cursus, nouveau);
    window.addCursusPostBacWindowListener(e -> {
        candidat.addCursusPostBac(e);
        listener.cursusModified(candidat.getCandidatCursusPostBacs());
    });
    UI.getCurrent().addWindow(window);
}
Also used : CandidatCursusExterneWindow(fr.univlorraine.ecandidat.views.windows.CandidatCursusExterneWindow) CandidatCursusPostBac(fr.univlorraine.ecandidat.entities.ecandidat.CandidatCursusPostBac)

Aggregations

CandidatCursusPostBac (fr.univlorraine.ecandidat.entities.ecandidat.CandidatCursusPostBac)1 CandidatCursusExterneWindow (fr.univlorraine.ecandidat.views.windows.CandidatCursusExterneWindow)1