this.attendanceRegisterId = attendenceRegisterId;
}
@Override
protected void execute(PrevalentSystem system) throws BusinessException {
Person person = system.getPeople().get(idPerson);
int i;
for ( i = 0; i < system.getHowDoYouKnowVisualmidia().size(); i++) {
if(system.getHowDoYouKnowVisualmidia().get(i).equals(howDoYouKnowVisualMidia)){
break;
}
}
int j;
for ( j = 0; j < system.getSchoolLevel().size(); j++) {
if(system.getSchoolLevel().get(j).equals(schoolLevel)){
break;
}
}
int k;
for ( k = 0; k < system.getStudentsSchools().size(); k++) {
if(system.getStudentsSchools().get(k).equals(school)){
break;
}
}
String school = (k != system.getStudentsSchools().size())?system.getStudentsSchools().get(k):"";
String schoolLevel = (j != system.getSchoolLevel().size())?system.getSchoolLevel().get(j):"";
String howDoYouKnowVM = (i != system.getHowDoYouKnowVisualmidia().size())?system.getHowDoYouKnowVisualmidia().get(i):"";
if(person.getPersonType("student") != null){
Student student = (Student) person.getPersonType("student");
student.setSchool(school);
student.setSchoolLevel(schoolLevel);
student.setHowDoYouKnowVisualMidia(howDoYouKnowVisualMidia);
student.setReasonToDoTheCurse(reasonToDoTheCurse);
student.setCompany(company);
student.setCompanyPhone(companyPhone);
student.setResponsableName(responsableName);
student.setResponsableRelation(responsableRelation);
student.setResponsableCPF(responsableCPF);
student.setResponsableRG(responsableRG);
student.setResponsablePhone(responsablePhone);
student.setAttendanceResponsable(attendanceResponsable);
student.setAttendanceDate(attendanceDate);
student.setAttendanceObservation(attendanceObservation);
student.setAttendanceRegister( system.getPeople().get(attendanceRegisterId));
}else{
person.setPersonType("student", new Student(school, schoolLevel,howDoYouKnowVM,reasonToDoTheCurse,
company, companyPhone, responsableName, responsableRelation, responsableCPF,
responsableRG, responsablePhone, attendanceResponsable, attendanceDate,
attendanceObservation, system.getPeople().get(attendanceRegisterId)));
}