Logik des AllTreatmentController angepasst(Treatments werden automatisch gelöscht wenn Sie 10+ Jahre alt sind und man auf 'sperren' drückt)
All checks were successful
Quality Check / Linting Check (push) Successful in 13s
Quality Check / Javadoc Check (push) Successful in 21s
Quality Check / Linting Check (pull_request) Successful in 13s
Quality Check / Javadoc Check (pull_request) Successful in 22s

This commit is contained in:
arminribic 2024-05-22 08:22:14 +02:00
parent bf86f9fc84
commit ac170c6bf0

View file

@ -312,6 +312,8 @@ public class AllTreatmentController {
@FXML
public void handleLock(){
Treatment selectedItem = this.tableView.getSelectionModel().getSelectedItem();
LocalDate today = LocalDate.now();
if (selectedItem == null){
return;
}
@ -322,7 +324,7 @@ public class AllTreatmentController {
}catch (SQLException exception){
exception.printStackTrace();
}
if (selectedItem.calculateDeleteDate().isBefore(LocalDate.now())){
if (selectedItem.calculateDeleteDate().isBefore(today) || selectedItem.calculateDeleteDate().equals(today)){
try {
dao.delete(selectedItem.getId());
} catch (SQLException e) {