Compare commits

...

3 commits

Author SHA1 Message Date
69f89c8783 Merge branch 'main' into story/pfleger-modul-pfleger-anlegen
All checks were successful
Quality Check / Qualty Check (push) Successful in 12s
Quality Check / Qualty Check (pull_request) Successful in 12s
2024-05-03 10:06:27 +00:00
4b13bf6fe3 Merge pull request '#29: SetAll instead of AddAll to avoid Duplication' (#30) from bug/treatments-are-shown-duplicate into main
All checks were successful
Quality Check / Qualty Check (push) Successful in 14s
Javadoc Deploy / Javadoc (push) Successful in 26s
Reviewed-on: #30
Reviewed-by: SZUT-Ole <ole.kueck@hmmh.de>
2024-05-03 10:01:34 +00:00
fcebe01f1e
#29: SetAll instead of AddAll to avoid Duplication
All checks were successful
Quality Check / Qualty Check (push) Successful in 8s
Quality Check / Qualty Check (pull_request) Successful in 9s
Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
2024-05-02 15:07:09 +02:00

View file

@ -77,11 +77,10 @@ public class AllTreatmentController {
}
public void readAllAndShowInTableView() {
this.treatments.clear();
comboBoxPatientSelection.getSelectionModel().select(0);
this.dao = DaoFactory.getDaoFactory().createTreatmentDao();
try {
this.treatments.addAll(dao.readAll());
this.treatments.setAll(dao.readAll());
} catch (SQLException exception) {
exception.printStackTrace();
}
@ -109,7 +108,7 @@ public class AllTreatmentController {
if (selectedPatient.equals("alle")) {
try {
this.treatments.addAll(this.dao.readAll());
this.treatments.setAll(this.dao.readAll());
} catch (SQLException exception) {
exception.printStackTrace();
}
@ -118,7 +117,7 @@ public class AllTreatmentController {
Patient patient = searchInList(selectedPatient);
if (patient != null) {
try {
this.treatments.addAll(this.dao.readTreatmentsByPid(patient.getId()));
this.treatments.setAll(this.dao.readTreatmentsByPid(patient.getId()));
} catch (SQLException exception) {
exception.printStackTrace();
}