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

This commit is contained in:
SZUT-Ole 2024-05-03 10:06:27 +00:00
commit 69f89c8783

View file

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