#10: Add Base for Delete Date Functionality
All checks were successful
Quality Check / Qualty Check (push) Successful in 9s

This commit is contained in:
arminribic 2024-05-14 16:34:33 +02:00
parent d8a7c9a59c
commit da40c4aeb7
4 changed files with 20 additions and 9 deletions

View file

@ -94,7 +94,6 @@ public class MainWindowController {
}
private void loadActiveNursePage() {
System.out.println("TODO: Active Nurse");
try {
BorderPane activeNursePane = FXMLLoader.load(
Objects.requireNonNull(Main.class.getResource("/de/hitec/nhplus/nurse/AllNurseView.fxml"))
@ -110,7 +109,6 @@ public class MainWindowController {
}
private void loadLockedNursePage() {
System.out.println("TODO: Locked Nurse");
try {
BorderPane lockedNursePane = FXMLLoader.load(
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.nurse.database.NurseDao;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Tab;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.control.cell.TextFieldTableCell;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.sql.SQLException;
@ -31,6 +28,8 @@ public class LockedNurseController {
@FXML
public TableColumn<Nurse, String> columnSurName;
@FXML
public TableColumn<Nurse, String> columnPhoneNumber;
@FXML
public TableColumn<Nurse, String> columnDeleteDate;
private final ObservableList<Nurse> nurses = FXCollections.observableArrayList();
@ -47,8 +46,14 @@ public class LockedNurseController {
this.columnSurName.setCellValueFactory(new PropertyValueFactory<>("surName"));
this.columnSurName.setCellFactory(TextFieldTableCell.forTableColumn());
this.columnDeleteDate.setCellValueFactory(new PropertyValueFactory<>("date"));
this.columnDeleteDate.setCellFactory(TextFieldTableCell.forTableColumn());
this.columnPhoneNumber.setCellValueFactory(new PropertyValueFactory<>("phoneNumber"));
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);
}

View file

@ -12,7 +12,6 @@ public class Nurse extends Person {
private final SimpleStringProperty phoneNumber;
private final SimpleBooleanProperty locked;
public Nurse(
String firstName,
String surName,
@ -45,6 +44,10 @@ public class Nurse extends Person {
this.phoneNumber = new SimpleStringProperty(phoneNumber);
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) {
this.phoneNumber.set(phoneNumber);

View file

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