#10 story/pfleger-modul-sperren-und-loschen-von-pflegern #37

Merged
SZUT-Dorian merged 11 commits from story/pfleger-modul-sperren-und-loschen-von-pflegern into main 2024-05-16 11:57:12 +00:00
4 changed files with 21 additions and 9 deletions
Showing only changes of commit 917aa8275f - Show all commits

View file

@ -114,7 +114,6 @@ public class MainWindowController {
} }
private void loadActiveNursePage() { private void loadActiveNursePage() {
SZUT-Dominik marked this conversation as resolved
Review
  • Missing Javadoc
- [x] Missing Javadoc
System.out.println("TODO: Active Nurse");
try { try {
BorderPane activeNursePane = FXMLLoader.load( BorderPane activeNursePane = FXMLLoader.load(
Objects.requireNonNull(Main.class.getResource("/de/hitec/nhplus/nurse/AllNurseView.fxml")) Objects.requireNonNull(Main.class.getResource("/de/hitec/nhplus/nurse/AllNurseView.fxml"))
@ -130,7 +129,6 @@ public class MainWindowController {
} }
private void loadLockedNursePage() { private void loadLockedNursePage() {
SZUT-Dominik marked this conversation as resolved
Review
  • Missing Javadoc
- [x] Missing Javadoc
System.out.println("TODO: Locked Nurse");
try { try {
BorderPane lockedNursePane = FXMLLoader.load( BorderPane lockedNursePane = FXMLLoader.load(
Objects.requireNonNull(Main.class.getResource("/de/hitec/nhplus/nurse/LockedNurseView.fxml")) Objects.requireNonNull(Main.class.getResource("/de/hitec/nhplus/nurse/LockedNurseView.fxml"))

View file

@ -2,18 +2,15 @@ package de.hitec.nhplus.nurse;
import de.hitec.nhplus.datastorage.DaoFactory; import de.hitec.nhplus.datastorage.DaoFactory;
import de.hitec.nhplus.nurse.database.NurseDao; import de.hitec.nhplus.nurse.database.NurseDao;
import javafx.application.Application; import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.Tab;
import javafx.scene.control.TableColumn; import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView; import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.control.cell.TextFieldTableCell; import javafx.scene.control.cell.TextFieldTableCell;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.sql.SQLException; import java.sql.SQLException;
@ -31,6 +28,8 @@ public class LockedNurseController {
@FXML @FXML
public TableColumn<Nurse, String> columnSurName; public TableColumn<Nurse, String> columnSurName;
@FXML @FXML
public TableColumn<Nurse, String> columnPhoneNumber;
@FXML
public TableColumn<Nurse, String> columnDeleteDate; public TableColumn<Nurse, String> columnDeleteDate;
private final ObservableList<Nurse> nurses = FXCollections.observableArrayList(); private final ObservableList<Nurse> nurses = FXCollections.observableArrayList();
@ -47,8 +46,14 @@ public class LockedNurseController {
this.columnSurName.setCellValueFactory(new PropertyValueFactory<>("surName")); this.columnSurName.setCellValueFactory(new PropertyValueFactory<>("surName"));
SZUT-Dominik marked this conversation as resolved Outdated
  • Missing Javadoc
- [x] Missing Javadoc
  • Ist technisch falsch, technisch korrekt wäre:

    Initialization method that is called after the binding of all the fields.

    Weil Initalize & Instanciate nicht dasselbe sind.

    Initalize ist eine Methode, die im Hintergrund von JavaFx, nach dem Instaciating & Binding aufgerufen wird.

- [x] Ist technisch falsch, technisch korrekt wäre: > Initialization method that is called after the binding of all the fields. Weil **Initalize** & **Instanciate** nicht dasselbe sind. **Initalize** ist eine Methode, die im Hintergrund von **JavaFx**, nach dem **Instaciating** & **Binding** aufgerufen wird.
this.columnSurName.setCellFactory(TextFieldTableCell.forTableColumn()); this.columnSurName.setCellFactory(TextFieldTableCell.forTableColumn());
this.columnDeleteDate.setCellValueFactory(new PropertyValueFactory<>("date")); this.columnPhoneNumber.setCellValueFactory(new PropertyValueFactory<>("phoneNumber"));
this.columnDeleteDate.setCellFactory(TextFieldTableCell.forTableColumn()); this.columnPhoneNumber.setCellFactory(TextFieldTableCell.forTableColumn());
this.columnDeleteDate.setCellValueFactory(cellData -> {
return new SimpleStringProperty(cellData.getValue().calculateDeleteDate());
});
//this.columnDeleteDate.setCellFactory(TextFieldTableCell.forTableColumn());
this.tableView.setItems(this.nurses); this.tableView.setItems(this.nurses);
} }

View file

@ -17,7 +17,6 @@ public class Nurse extends Person {
private final SimpleStringProperty phoneNumber; private final SimpleStringProperty phoneNumber;
private final SimpleBooleanProperty locked; private final SimpleBooleanProperty locked;
/** /**
* This constructor allows instantiating a {@link Nurse} object, * This constructor allows instantiating a {@link Nurse} object,
* before it is stored in the database, by omitting the {@link Nurse#id ID} value. * before it is stored in the database, by omitting the {@link Nurse#id ID} value.
SZUT-Dominik marked this conversation as resolved Outdated
  • Missing @author Tag
    fügt euch bitte, sobald ihr was anpasst in einer Klasse selber als Autoren Hinzu
- [x] Missing `@author` Tag fügt euch bitte, sobald ihr was anpasst in einer Klasse selber als Autoren Hinzu
@ -61,6 +60,11 @@ public class Nurse extends Person {
this.locked = new SimpleBooleanProperty(isLocked); this.locked = new SimpleBooleanProperty(isLocked);
} }
public String calculateDeleteDate() {
//TODO: Lese alle Behandlungen die Dieser Pfleger Durchgefürt hat & brechene mit ihnen das Datum
return "Comming soon";
}
public void setPhoneNumber(String phoneNumber) { public void setPhoneNumber(String phoneNumber) {
this.phoneNumber.set(phoneNumber); this.phoneNumber.set(phoneNumber);
} }

View file

@ -29,6 +29,11 @@
minWidth="140.0" minWidth="140.0"
text="Vorname" text="Vorname"
/> />
<TableColumn
fx:id="columnPhoneNumber"
minWidth="140.0"
text="Telefonnummer"
/>
<TableColumn <TableColumn
fx:id="columnDeleteDate" fx:id="columnDeleteDate"
minWidth="140.0" minWidth="140.0"