// HEADTEACHER COURSE MANAGE CONTROLLER CALL @Override public void deleteAllCoursesWithIds(Long[] IdArray) { for (Long id : IdArray) { Course current = courseDao.findById(id); current.setArchive(true); courseDao.update(current); } }
// HELP METHOD FOR TEACHER AND STUDENT SERVICE public List<Course> getCourseForGroup(Group group, Date from, Date till) { List<Course> listCourses = new ArrayList<Course>(); try { List<Course> course = courseDao.findByGroupIdAndDataRange(group.getId(), from, till); if (course != null) { listCourses.addAll(course); } } catch (Exception e) { // nothing to do here, return empty list } return listCourses; }
// HEADTEACHER CONTROLLER CALL @Override public List<CourseDTO> getAllCourses() { List<Course> courses = courseDao.findAllByArchiveFlag(COURSE_IS_NOT_ARCHIVE); return fillCourseDTO(courses, null, null); }
// HEADTEACHER GROUP CONTROLLER CALL @Override public List<CourseDTO> getCoursesForYear(int year) { List<Course> courses = courseDao.findAdditionCourseByYearAndArchiveFlag(year, COURSE_IS_NOT_ARCHIVE); return fillCourseDTO(courses, null, null); }
// HEADTEACHER COURSE MANAGE CONTROLLER CALL @Override public void saveNewCourse(Course course) { courseDao.save(course); }