Package org.fenixedu.academic.dto.administrativeOffice.studentEnrolment

Examples of org.fenixedu.academic.dto.administrativeOffice.studentEnrolment.StudentOptionalEnrolmentBean


public class DegreesByDegreeType implements DataProvider {

    @Override
    public Object provide(Object source, Object currentValue) {

        StudentOptionalEnrolmentBean optionalEnrolmentBean = (StudentOptionalEnrolmentBean) source;

        if (optionalEnrolmentBean.getDegreeType() != null) {
            List<Degree> result = Degree.readAllByDegreeType(optionalEnrolmentBean.getDegreeType());
            Collections.sort(result, Degree.COMPARATOR_BY_NAME);
            return result;
        } else {
            optionalEnrolmentBean.setDegreeCurricularPlan(null);
            return Collections.emptyList();
        }

    }
View Full Code Here


public class DegreeCurricularPlansForDegree implements DataProvider {

    @Override
    public Object provide(Object source, Object currentValue) {

        final StudentOptionalEnrolmentBean optionalEnrolmentBean = (StudentOptionalEnrolmentBean) source;
        final List<DegreeCurricularPlan> result = new ArrayList<DegreeCurricularPlan>();
        if (optionalEnrolmentBean.getDegree() != null && optionalEnrolmentBean.getDegreeType() != null) {
            if (optionalEnrolmentBean.getDegree().getDegreeType().equals(optionalEnrolmentBean.getDegreeType())) {
                result.addAll(optionalEnrolmentBean.getDegree().getDegreeCurricularPlansSet());
                if (optionalEnrolmentBean.getDegreeCurricularPlan() != null
                        && !optionalEnrolmentBean.getDegree().getDegreeCurricularPlansSet()
                                .contains(optionalEnrolmentBean.getDegreeCurricularPlan())) {
                    optionalEnrolmentBean.setDegreeCurricularPlan(null);
                }
            } else {
                optionalEnrolmentBean.setDegree(null);
                optionalEnrolmentBean.setDegreeCurricularPlan(null);
            }
        }

        Collections.sort(result, DegreeCurricularPlan.COMPARATOR_BY_NAME);
        return result;
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.dto.administrativeOffice.studentEnrolment.StudentOptionalEnrolmentBean

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.