Logik des AllTreatmentController angepasst(Treatments werden automatisch gelöscht wenn Sie 10+ Jahre alt sind und man auf 'sperren' drückt)
This commit is contained in:
parent
bf86f9fc84
commit
ac170c6bf0
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue