Package org.fenixedu.academic.dto.SummariesCalendarBean

Examples of org.fenixedu.academic.dto.SummariesCalendarBean.LessonCalendarViewType


        SummariesCalendarBean bean = (SummariesCalendarBean) viewState.getMetaObject().getObject();

        ExecutionCourse executionCourse = bean.getExecutionCourse();
        Shift shift = bean.getShift();
        ShiftType shiftType = bean.getShiftType();
        LessonCalendarViewType calendarViewType = bean.getCalendarViewType();

        Set<NextPossibleSummaryLessonsAndDatesBean> summariesCalendar =
                new TreeSet<NextPossibleSummaryLessonsAndDatesBean>(
                        NextPossibleSummaryLessonsAndDatesBean.COMPARATOR_BY_DATE_AND_HOUR);

        for (Lesson lesson : executionCourse.getLessons()) {

            boolean insert = true;
            if ((shift != null && !shift.getAssociatedLessonsSet().contains(lesson))
                    || (shiftType != null && !lesson.getShift().containsType(shiftType))) {
                insert = false;
            }

            if (insert) {
                for (YearMonthDay lessonDate : lesson.getAllLessonDates()) {
                    if ((calendarViewType.equals(LessonCalendarViewType.ALL_LESSONS))
                            || (calendarViewType.equals(LessonCalendarViewType.PAST_LESSON) && lesson.isTimeValidToInsertSummary(
                                    new HourMinuteSecond(), lessonDate))
                            || (calendarViewType.equals(LessonCalendarViewType.PAST_LESSON_WITHOUT_SUMMARY) && lesson
                                    .getSummaryByDate(lessonDate) == null)
                            && lesson.isTimeValidToInsertSummary(new HourMinuteSecond(), lessonDate)) {

                        summariesCalendar.add(new NextPossibleSummaryLessonsAndDatesBean(lesson, lessonDate));
                    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.dto.SummariesCalendarBean.LessonCalendarViewType

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.