#7 Visible UI for locked treatments #2 all visible UIs
Some checks failed
Quality Check / Linting Check (push) Failing after 12s
Quality Check / Javadoc Check (push) Successful in 20s

This commit is contained in:
Dorian Nemec 2024-05-17 08:53:58 +02:00
parent d69c738641
commit 9ac68941e9
3 changed files with 41 additions and 0 deletions

Binary file not shown.

View file

@ -4,6 +4,7 @@ import de.hitec.nhplus.datastorage.DaoFactory;
import de.hitec.nhplus.nurse.LockedNurseController; import de.hitec.nhplus.nurse.LockedNurseController;
import de.hitec.nhplus.nurse.Nurse; import de.hitec.nhplus.nurse.Nurse;
import de.hitec.nhplus.nurse.database.NurseDao; import de.hitec.nhplus.nurse.database.NurseDao;
import de.hitec.nhplus.patient.Patient;
import de.hitec.nhplus.patient.database.PatientDao; import de.hitec.nhplus.patient.database.PatientDao;
import de.hitec.nhplus.treatment.database.TreatmentDao; import de.hitec.nhplus.treatment.database.TreatmentDao;
import de.hitec.nhplus.utils.DateConverter; import de.hitec.nhplus.utils.DateConverter;
@ -32,6 +33,12 @@ public class LockedTreatmentController {
public TableView<Treatment> tableView; public TableView<Treatment> tableView;
@FXML @FXML
public TableColumn<Treatment, Long> columnId; public TableColumn<Treatment, Long> columnId;
@FXML
private TableColumn<Treatment, String> columnPatient;
@FXML
private TableColumn<Treatment, String> columnNurse;
@FXML
private TableColumn<Treatment, String> columnDeleteDate;
private final ObservableList<Treatment> treatments = FXCollections.observableArrayList(); private final ObservableList<Treatment> treatments = FXCollections.observableArrayList();
private NurseDao nurseDao; private NurseDao nurseDao;
@ -47,6 +54,21 @@ public class LockedTreatmentController {
this.columnId.setCellValueFactory(new PropertyValueFactory<>("id")); this.columnId.setCellValueFactory(new PropertyValueFactory<>("id"));
this.columnPatient.setCellValueFactory(
cellData -> {
Patient patient = cellData.getValue().getPatient();
return new SimpleStringProperty(patient.getSurName() + ", " + patient.getFirstName());
}
);
this.columnNurse.setCellValueFactory(
cellData -> {
Nurse nurse = cellData.getValue().getNurse();
return new SimpleStringProperty(nurse.getSurName() + ", " + nurse.getFirstName());
}
);
this.columnDeleteDate.setCellValueFactory(new PropertyValueFactory<>("coming soon"));
this.tableView.setItems(this.treatments); this.tableView.setItems(this.treatments);
} }

View file

@ -24,6 +24,25 @@
prefWidth="102.0" prefWidth="102.0"
text="ID" text="ID"
/> />
<TableColumn
fx:id="columnPatient"
minWidth="40.0"
prefWidth="102.0"
text="Patient"
/>
<TableColumn
fx:id="columnNurse"
minWidth="40.0"
prefWidth="102.0"
text="Pflegekraft"
/>
<TableColumn
fx:id="columnDeleteDate"
minWidth="40.0"
prefWidth="102.0"
text="Geloescht am"
/>
</columns> </columns>
<columnResizePolicy> <columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/> <TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>