From bf86f9fc84ef06c7e69890aebc773b87907172e7 Mon Sep 17 00:00:00 2001 From: arminribic Date: Tue, 21 May 2024 13:56:22 +0200 Subject: [PATCH] Logik des AllTreatmentController angepasst --- .../de/hitec/nhplus/treatment/AllTreatmentController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/de/hitec/nhplus/treatment/AllTreatmentController.java b/src/main/java/de/hitec/nhplus/treatment/AllTreatmentController.java index 055c4be..4d97ff0 100644 --- a/src/main/java/de/hitec/nhplus/treatment/AllTreatmentController.java +++ b/src/main/java/de/hitec/nhplus/treatment/AllTreatmentController.java @@ -322,6 +322,13 @@ public class AllTreatmentController { }catch (SQLException exception){ exception.printStackTrace(); } + if (selectedItem.calculateDeleteDate().isBefore(LocalDate.now())){ + try { + dao.delete(selectedItem.getId()); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } readAllAndShowInTableView(); }