Compare commits
2 commits
efea16e5b1
...
97373930ec
Author | SHA1 | Date | |
---|---|---|---|
97373930ec | |||
a437b00921 |
1 changed files with 9 additions and 0 deletions
|
@ -312,6 +312,8 @@ public class AllTreatmentController {
|
||||||
@FXML
|
@FXML
|
||||||
public void handleLock(){
|
public void handleLock(){
|
||||||
Treatment selectedItem = this.tableView.getSelectionModel().getSelectedItem();
|
Treatment selectedItem = this.tableView.getSelectionModel().getSelectedItem();
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
|
||||||
if (selectedItem == null){
|
if (selectedItem == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -322,6 +324,13 @@ public class AllTreatmentController {
|
||||||
}catch (SQLException exception){
|
}catch (SQLException exception){
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if (selectedItem.calculateDeleteDate().isBefore(today) || selectedItem.calculateDeleteDate().equals(today)){
|
||||||
|
try {
|
||||||
|
dao.delete(selectedItem.getId());
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
readAllAndShowInTableView();
|
readAllAndShowInTableView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue