From 2b9734a76471ba1f9ab06f56c5938af5b74f781f Mon Sep 17 00:00:00 2001 From: arminribic Date: Thu, 16 May 2024 17:12:50 +0200 Subject: [PATCH] #7: (WIP) LockedTreatmentView.fxml angefangen & TreatmentDao angepasst. --- .../nhplus/fixtures/TreatmentFixture.java | 2 +- .../treatment/database/TreatmentDao.java | 5 +++-- .../de/hitec/nhplus/nurse/LockedNurseView.fxml | 6 +++++- .../nhplus/treatment/LockedTreatmentView.fxml | 18 ++++++++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/de/hitec/nhplus/treatment/LockedTreatmentView.fxml diff --git a/src/main/java/de/hitec/nhplus/fixtures/TreatmentFixture.java b/src/main/java/de/hitec/nhplus/fixtures/TreatmentFixture.java index 14d56a3..f7056ff 100644 --- a/src/main/java/de/hitec/nhplus/fixtures/TreatmentFixture.java +++ b/src/main/java/de/hitec/nhplus/fixtures/TreatmentFixture.java @@ -168,7 +168,7 @@ public class TreatmentFixture implements Fixture { convertStringToLocalTime("17:00"), "KG", "Massage der Extremitäten zur Verbesserung der Durchblutung", - false) + true) ); TreatmentDao dao = DaoFactory.getInstance().createTreatmentDao(); diff --git a/src/main/java/de/hitec/nhplus/treatment/database/TreatmentDao.java b/src/main/java/de/hitec/nhplus/treatment/database/TreatmentDao.java index ea3527e..7867bae 100644 --- a/src/main/java/de/hitec/nhplus/treatment/database/TreatmentDao.java +++ b/src/main/java/de/hitec/nhplus/treatment/database/TreatmentDao.java @@ -31,8 +31,8 @@ public class TreatmentDao extends DaoImp { protected PreparedStatement getCreateStatement(Treatment treatment) throws SQLException { final String SQL = """ INSERT INTO treatment - (patientId, nurseId, date, begin, end, description, remark) - VALUES (?, ?, ?, ?, ?, ?, ?) + (patientId, nurseId, date, begin, end, description, remark, isLocked) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) """; PreparedStatement statement = this.connection.prepareStatement(SQL); statement.setInt(1, treatment.getPatient().getId()); @@ -42,6 +42,7 @@ public class TreatmentDao extends DaoImp { statement.setString(5, treatment.getEnd()); statement.setString(6, treatment.getDescription()); statement.setString(7, treatment.getRemarks()); + statement.setBoolean(8,treatment.isLocked()); return statement; } diff --git a/src/main/resources/de/hitec/nhplus/nurse/LockedNurseView.fxml b/src/main/resources/de/hitec/nhplus/nurse/LockedNurseView.fxml index 23f2c6d..b7c1ed3 100644 --- a/src/main/resources/de/hitec/nhplus/nurse/LockedNurseView.fxml +++ b/src/main/resources/de/hitec/nhplus/nurse/LockedNurseView.fxml @@ -12,7 +12,11 @@
- + + + + + + + + + + +
+ + + + + +
+