if (isOnlySetParcels) {
persistentRegistration.setParcels(parcels);
} else {
for (String idCourse : this.courseIdList) {
if (system.getCourses().containsKey(idCourse)) {
persistentRegistration.addRegistrationItem(new RegistrationItem(system.getCourses().get(idCourse),system.getCourses().get(idCourse).getValue()));
}
}
persistentRegistration.setParcels(parcels);
persistentRegistration.setRegistrationAdditionValue(addition);
persistentRegistration.setRegistrationDiscountValue(discount);
persistentRegistration.setRegistrationValue(registrationValue);
persistentRegistration.setRegistrationDate(date);
persistentRegistration.setDuration(duration);
persistentRegistration.setPontualityDiscount(pontualityDiscount);
}
} else {
List<RegistrationItem> registrationItens = new ArrayList<RegistrationItem>();
for (String idCourse : this.courseIdList) {
if (system.getCourses().containsKey(idCourse)) {
registrationItens.add(new RegistrationItem(system.getCourses()
.get(idCourse), system.getCourses().get(idCourse)
.getValue()));
}
}