Compare commits

..

2 commits

Author SHA1 Message Date
6e58574909 Merge pull request '#24 Bugfix' (#47) from story/sperren-und-loeschen-von-pflegern-bugfix into main
All checks were successful
Javadoc Deploy / Javadoc (push) Successful in 32s
Quality Check / Linting Check (push) Successful in 12s
Quality Check / Javadoc Check (push) Successful in 21s
Reviewed-on: #47
Reviewed-by: SZUT-Armin <arminribic@web.de>
2024-05-21 08:49:48 +00:00
Dorian Nemec
449f3ade06 #24 Bugfix
All checks were successful
Quality Check / Linting Check (push) Successful in 12s
Quality Check / Javadoc Check (push) Successful in 21s
Quality Check / Linting Check (pull_request) Successful in 12s
Quality Check / Javadoc Check (pull_request) Successful in 21s
2024-05-21 10:38:04 +02:00
2 changed files with 6 additions and 1 deletions

View file

@ -113,6 +113,11 @@ public class LockedNurseController {
@FXML @FXML
public void handleMouseClick() { public void handleMouseClick() {
Nurse nurse = tableView.getSelectionModel().getSelectedItem(); Nurse nurse = tableView.getSelectionModel().getSelectedItem();
if(nurse == null)
{
return;
}
boolean canBeDeleted = nurse.calculateDeleteDate().isBefore(LocalDate.now()); boolean canBeDeleted = nurse.calculateDeleteDate().isBefore(LocalDate.now());
buttonDelete.setDisable(!canBeDeleted); buttonDelete.setDisable(!canBeDeleted);
} }

View file

@ -10,5 +10,5 @@ CREATE TABLE treatment
remark TEXT NOT NULL, remark TEXT NOT NULL,
isLocked BOOLEAN NOT NULL DEFAULT false, isLocked BOOLEAN NOT NULL DEFAULT false,
FOREIGN KEY (patientId) REFERENCES patient (id) ON DELETE CASCADE, FOREIGN KEY (patientId) REFERENCES patient (id) ON DELETE CASCADE,
FOREIGN KEY (nurseId) REFERENCES nurse (id) ON DELETE SET NULL FOREIGN KEY (nurseId) REFERENCES nurse (id) ON DELETE CASCADE
) )