public ArrayList getCourseList() {

    ArrayList courslisttmp = null;
    try {
      FormationDto newfdto = MainFrame.myDaybyday.getFormation(new FormationBusinessPK(name, year));
      SectionDto newdto =
          MainFrame.myDaybyday.getSection(
              new SectionBusinessPK("GENERALE", newfdto.getFormationId()));

      if (sectionDto.getVersion().intValue() != newdto.getVersion().intValue()
          || formationdto.getVersion().intValue() != newfdto.getVersion().intValue()) {
        courslist = new ArrayList();
        sectionDto = newdto;
        formationdto = newfdto;
        courslist = new ArrayList();
        courslisttmp =
            MainFrame.myDaybyday.getCoursesOfSection(
                new SectionBusinessPK("GENERALE", formationdto.getFormationId()));
        for (int i = 0; i < courslisttmp.size(); ++i)
          courslist.add(new Course((CourseDto) courslisttmp.get(i)));
      }
    } catch (RemoteException e2) {

    } catch (EntityNotFoundException e2) {
      // TODO Auto-generated catch block
      e2.printStackTrace();
    }
    return courslist;
  }
  /** @return */
  public int getElementNombre() {
    try {
      // TODO Auto-generated method stub
      FormationDto dto = MainFrame.myDaybyday.getFormation(new FormationBusinessPK(name, year));
      if (formationdto.getVersion().intValue() != dto.getVersion().intValue()) {
        formationdto = dto;

        SectionBusinessPK sec = new SectionBusinessPK("GENERALE", dto.getFormationId());
        try {
          filieres = new ArrayList();

          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) {

        }

        ArrayList matieretmp = null;
        try {
          // sectionDto = MainFrame.myDaybyday.getSection(new SectionPK("GENERALE",name,year));
          matiere = new ArrayList();
          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) {

        }
      }
    } catch (RemoteException e2) {

    } catch (EntityNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return filieres.size() + matiere.size();
  }
  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();
    }
  }