summary.edit(infoSummary.getTitle(), infoSummary.getSummaryText(), infoSummary .getStudentsNumber(), infoSummary.getIsExtraLesson(), teacher); return;
if (!executionCourse.teacherLecturesExecutionCourse(teacher)) { summary.edit(infoSummary.getTitle(), infoSummary.getSummaryText(), infoSummary .getStudentsNumber(), infoSummary.getIsExtraLesson(), teacher); return; } else{ throw new FenixServiceException("error.summary.teacher.invalid"); }
    public void run(Integer executionCourseId, InfoSummary infoSummary) throws FenixServiceException,            ExcepcaoPersistencia {        if (infoSummary == null || infoSummary.getInfoShift() == null                || infoSummary.getInfoShift().getIdInternal() == null                || infoSummary.getIsExtraLesson() == null || infoSummary.getSummaryDate() == null) {            throw new FenixServiceException("error.summary.impossible.edit");        }        final ISuportePersistente persistentSupport = PersistenceSupportFactory                .getDefaultPersistenceSupport();        final IPersistentSummary persistentSummary = persistentSupport.getIPersistentSummary();        final ISummary summary = (ISummary) persistentSummary.readByOID(Summary.class, infoSummary                .getIdInternal());        final IShift shift = SummaryUtils.getShift(persistentSupport, summary, infoSummary);        final IRoom room = SummaryUtils.getRoom(persistentSupport, summary, shift, infoSummary);        shift.transferSummary(summary, infoSummary.getSummaryDate().getTime(), infoSummary                .getSummaryHour().getTime(), room);        final IProfessorship professorship = SummaryUtils.getProfessorship(persistentSupport, infoSummary);        if (professorship != null) {            summary.edit(infoSummary.getTitle(), infoSummary.getSummaryText(), infoSummary                    .getStudentsNumber(), infoSummary.getIsExtraLesson(), professorship);            return;        }        final ITeacher teacher = SummaryUtils.getTeacher(persistentSupport, infoSummary);        if (teacher != null) {            summary.edit(infoSummary.getTitle(), infoSummary.getSummaryText(), infoSummary                    .getStudentsNumber(), infoSummary.getIsExtraLesson(), teacher);            return;        }        String teacherName = infoSummary.getTeacherName();        if (teacherName != null) {            summary.edit(infoSummary.getTitle(), infoSummary.getSummaryText(), infoSummary                    .getStudentsNumber(), infoSummary.getIsExtraLesson(), teacherName);            return;        }                throw new FenixServiceException("error.summary.no.teacher");    }