Compare commits

..

No commits in common. "69f89c8783a9d2e64260bf2b430106caca82e9dd" and "0c3c1ec9df33fca9bed26c703a59c9e214a63d48" have entirely different histories.

View file

@ -77,10 +77,11 @@ 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.setAll(dao.readAll()); this.treatments.addAll(dao.readAll());
} catch (SQLException exception) { } catch (SQLException exception) {
exception.printStackTrace(); exception.printStackTrace();
} }
@ -108,7 +109,7 @@ public class AllTreatmentController {
if (selectedPatient.equals("alle")) { if (selectedPatient.equals("alle")) {
try { try {
this.treatments.setAll(this.dao.readAll()); this.treatments.addAll(this.dao.readAll());
} catch (SQLException exception) { } catch (SQLException exception) {
exception.printStackTrace(); exception.printStackTrace();
} }
@ -117,7 +118,7 @@ public class AllTreatmentController {
Patient patient = searchInList(selectedPatient); Patient patient = searchInList(selectedPatient);
if (patient != null) { if (patient != null) {
try { try {
this.treatments.setAll(this.dao.readTreatmentsByPid(patient.getId())); this.treatments.addAll(this.dao.readTreatmentsByPid(patient.getId()));
} catch (SQLException exception) { } catch (SQLException exception) {
exception.printStackTrace(); exception.printStackTrace();
} }