#10: Add Base for Delete Date Functionality
All checks were successful
Quality Check / Qualty Check (push) Successful in 9s
All checks were successful
Quality Check / Qualty Check (push) Successful in 9s
This commit is contained in:
parent
d8a7c9a59c
commit
da40c4aeb7
4 changed files with 20 additions and 9 deletions
|
@ -94,7 +94,6 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadActiveNursePage() {
|
private void loadActiveNursePage() {
|
||||||
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"))
|
||||||
|
@ -110,7 +109,6 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadLockedNursePage() {
|
private void loadLockedNursePage() {
|
||||||
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"))
|
||||||
|
|
|
@ -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"));
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ public class Nurse extends Person {
|
||||||
private final SimpleStringProperty phoneNumber;
|
private final SimpleStringProperty phoneNumber;
|
||||||
private final SimpleBooleanProperty locked;
|
private final SimpleBooleanProperty locked;
|
||||||
|
|
||||||
|
|
||||||
public Nurse(
|
public Nurse(
|
||||||
String firstName,
|
String firstName,
|
||||||
String surName,
|
String surName,
|
||||||
|
@ -45,6 +44,10 @@ public class Nurse extends Person {
|
||||||
this.phoneNumber = new SimpleStringProperty(phoneNumber);
|
this.phoneNumber = new SimpleStringProperty(phoneNumber);
|
||||||
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);
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue