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;
  }
  public void upDateDto(Object dto) {
    ArrayList courslisttmp = new ArrayList();
    ;

    try {
      //	if (sectionDto.getVersion().intValue() != dto.getVersion().intValue()){
      courslist = new ArrayList();
      // formationdto = (FormationDto)dto;
      courslisttmp =
          MainFrame.myDaybyday.getCoursesOfSection(
              new SectionBusinessPK(sectionDto.getName(), sectionDto.getFormationId()));
      for (int i = 0; i < courslisttmp.size(); ++i)
        courslist.add(new Course((CourseDto) courslisttmp.get(i)));
      //	}
    } catch (RemoteException e1) {

    } catch (EntityNotFoundException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
  }
  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();
    }
  }