コード例 #1
0
  public Formation(FormationDto formationDto) {

    this.name = formationDto.getName();
    TeacherDto teacher = null;
    RoomDto room = null;
    try {
      teacher = MainFrame.myDaybyday.getTeacher(formationDto.getTeacherId());
      room = MainFrame.myDaybyday.getRoom(formationDto.getRoomId());
    } catch (RemoteException e3) {
      // TODO Auto-generated catch block
      e3.printStackTrace();
    } catch (EntityNotFoundException e3) {
      // TODO Auto-generated catch block
      e3.printStackTrace();
    }
    this.responsable = teacher.getName();
    this.room = room.getName();
    this.year = formationDto.getFormationYear();
    this.formationdto = formationDto;

    filieres = new ArrayList();
    courslist = new ArrayList();
    matiere = new ArrayList();

    try {

      SectionBusinessPK sec = new SectionBusinessPK("GENERALE", formationDto.getFormationId());
      SectionDto defaults = MainFrame.myDaybyday.getSection(sec);
      ArrayList filieretmp = MainFrame.myDaybyday.getChildrenOfSection(sec);

      for (int i = 0; i < filieretmp.size(); ++i)
        filieres.add(new Section((SectionDto) filieretmp.get(i), this));

    } catch (RemoteException e) {
      e.printStackTrace();

    } catch (EntityNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    ArrayList matieretmp = null;
    try {

      SectionBusinessPK sec = new SectionBusinessPK("GENERALE", formationDto.getFormationId());
      sectionDto = MainFrame.myDaybyday.getSection(sec);
      matieretmp = MainFrame.myDaybyday.getSubjectsOfSection(sec);
      for (int i = 0; i < matieretmp.size(); ++i)
        matiere.add(new Subject((SubjectDto) matieretmp.get(i), this));
    } catch (RemoteException e1) {
      e1.printStackTrace();
    } catch (EntityNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    ArrayList courslisttmp = null;
    try {

      SectionDto sec =
          MainFrame.myDaybyday.getSection(
              new SectionBusinessPK("GENERALE", formationDto.getFormationId()));

      courslisttmp = MainFrame.myDaybyday.getCoursesOfSection(sec.getSectionId());

      for (int i = 0; i < courslisttmp.size(); ++i)
        courslist.add(new Course((CourseDto) courslisttmp.get(i)));

    } catch (RemoteException e2) {
      e2.printStackTrace();
    } catch (EntityNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }