Ejemplo n.º 1
0
  @Override
  public CourseBean getCourse(Integer id) throws GenericBusinessException {

    CourseService courseService = new CourseService();
    Course newCourse = courseService.getCourse(id);
    return new CourseBean(newCourse);
  }
Ejemplo n.º 2
0
  @Override
  public int getCourseListSize() throws GenericBusinessException {

    CourseService courseService = new CourseService();
    int courseSize = courseService.getCourseListSize();
    return courseSize;
  }
Ejemplo n.º 3
0
  @Override
  public void saveCourse(CourseBean model) throws GenericBusinessException {

    Course course = new CourseBean().toEntity(model);
    CourseService courseService = new CourseService();
    courseService.saveCourse(course);
  }
Ejemplo n.º 4
0
  @Override
  public CourseBean addCourse(CourseBean model) throws GenericBusinessException {

    Course course = new CourseBean().toEntity(model);
    CourseService courseService = new CourseService();
    courseService.addCourse(course);
    return getCourse(course.getPrimaryKey());
  }
Ejemplo n.º 5
0
  @Override
  public List<CourseBean> getCourseList() throws GenericBusinessException {

    CourseService courseService = new CourseService();
    List list = courseService.getCourseList();
    List<CourseBean> list1 = new ArrayList<>();
    for (int i = 0; i < list.size(); i++) {
      list1.add(new CourseBean((Course) list.get(i)));
    }
    return list1;
  }
Ejemplo n.º 6
0
  @Override
  public List<CourseBean> findCourseBySemester(Integer semester) throws GenericBusinessException {
    CourseService courseService = new CourseService();
    List list = courseService.findCourseBySemester(semester);

    List<CourseBean> list1 = new ArrayList<>();
    for (int i = 0; i < list.size(); i++) {
      list1.add(new CourseBean((Course) list.get(i)));
    }
    return list1;
  }
Ejemplo n.º 7
0
  @Override
  public List<CourseBean> findCourseByAcceptingDept(String acceptingDept)
      throws GenericBusinessException {

    CourseService courseService = new CourseService();
    List list = courseService.findCourseByAcceptingDept(acceptingDept);
    List<CourseBean> list1 = new ArrayList<>();
    for (int i = 0; i < list.size(); i++) {
      list1.add(new CourseBean((Course) list.get(i)));
    }
    return list1;
  }
Ejemplo n.º 8
0
  @Override
  public List<CourseBean> getCourseList(int startIndex, int endIndex)
      throws GenericBusinessException {
    if (startIndex < 1) {
      startIndex = 1;
    }
    if ((endIndex - startIndex) < 0) {
      // Just return an empty list.
      return new ArrayList();
    }
    CourseService courseService = new CourseService();
    List list = courseService.getCourseList(startIndex, endIndex);

    List<CourseBean> list1 = new ArrayList<>();
    for (int i = 0; i < list.size(); i++) {

      list1.add(new CourseBean((Course) list.get(i)));
    }

    return list1;
  }
Ejemplo n.º 9
0
  @Override
  public void deleteCourse(Integer id) throws GenericBusinessException {

    CourseService courseService = new CourseService();
    courseService.deleteCourse(id);
  }