Package models

Examples of models.Agenda


        User user = getLoggedUser();
        if (!user.admin && !user.hasEvent(getEvent())) {
            return forbidden();
        }

        Agenda agenda = Agenda.findById(id);
        if (agenda != null && getEvent().getAgenda() != null && getEvent().getAgenda().equals(agenda)) {
            agenda.delete();
        }
        // HTTP 204 en cas de succès (NO CONTENT)
        return noContent();
    }
View Full Code Here


        if (agendaForm.hasErrors()) {
            return badRequest(toJson(TransformValidationErrors.transform(agendaForm.errors())));
        }

        Agenda formAgenda = agendaForm.get();

        if (getEvent().getAgenda() == null) {
            formAgenda.save();
            getEvent().setAgenda(formAgenda);
            getEvent().update();
        } else {
            // Mise à jour d'un agenda
            Agenda dbAgenda = Agenda.find.byId(getEvent().getAgenda().getId());
            dbAgenda.setDebutCfp(formAgenda.getDebutCfp());
            dbAgenda.setFinCfp(formAgenda.getFinCfp());
            dbAgenda.setFinVote(formAgenda.getFinVote());
            dbAgenda.update();
        }

        // HTTP 204 en cas de succès (NO CONTENT)
        return noContent();
    }
View Full Code Here

TOP

Related Classes of models.Agenda

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.