use of org.hisp.dhis.dataentryform.DataEntryForm in project dhis2-core by dhis2.
the class ProgramDataEntryFormDeletionHandler method deleteProgramStage.
public void deleteProgramStage(ProgramStage programStage) {
DataEntryForm dataEntryForm = programStage.getDataEntryForm();
if (dataEntryForm != null) {
boolean flag = false;
Set<ProgramStage> programStages = programStage.getProgram().getProgramStages();
programStages.remove(programStage);
for (ProgramStage stage : programStages) {
if (stage.getDataEntryForm() != null) {
programStage.setDataEntryForm(null);
programStageService.updateProgramStage(programStage);
flag = true;
break;
}
}
if (!flag) {
dataEntryFormService.deleteDataEntryForm(dataEntryForm);
}
}
}
Aggregations