From dd1486ad5cf2618292dd09307d4f369f0a3bb74b Mon Sep 17 00:00:00 2001 From: Ileana Krontsi Date: Sun, 15 Nov 2015 18:19:25 +0100 Subject: [PATCH] StationsHistorieController bearbeitet. --- .../controller/StationsHistorieController.java | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java b/src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java index b3cd9b0..86c3c10 100644 --- a/src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java +++ b/src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java @@ -1,5 +1,8 @@ package de.uniluebeck.mi.projmi6.controller; +import de.uniluebeck.mi.projmi6.model.Fall; +import de.uniluebeck.mi.projmi6.model.StationsHistorie; +import de.uniluebeck.mi.projmi6.model.Untersuchung; import de.uniluebeck.mi.projmi6.view.DateTimePicker; import javafx.fxml.FXML; import javafx.scene.control.Button; @@ -11,6 +14,12 @@ import javafx.scene.control.TableView; * Created by 631806 on 12.11.15. */ public class StationsHistorieController { + + /** + * The station history that is shown in the edit window, or null if a new station history should be created. + */ + private StationsHistorie stationsHistorie = null; + private MainController mainController; @FXML @@ -47,5 +56,57 @@ public class StationsHistorieController { } + public void setStationsHistorie(StationsHistorie stationsHistorie){ + this.stationsHistorie = stationsHistorie; + if(stationsHistorie==null){ + clearFields(); + }else { + copyStationsHistorieDataIntoFields(); + } + + } + + private void copyStationsHistorieDataIntoFields(){ + // colStatHistAbteilung.setText(stationsHistorie.get()); + // colStatHistStation.setText(stationsHistorie.getStation()); + // colStatHistAufnahmeDatum.setDateTime(stationsHistorie.getAufnahmeDatum()); + // colStatHistEntlassungsDatum.setDateTime(stationsHistorie.getEntlassungsDatum()); + // dtTmAufnahme=setDateTime(stationsHistorie.getAufnahmeDatum()); + // dtTmEntlassung=setDateTime(stationsHistorie.getEntlassungsDatum()); + + statHistCreator.setText(Integer.toString(stationsHistorie.getErsteller())); + statHistCreatTime.setText(stationsHistorie.getErstellDatumZeit().toString()); + statHistEditor.setText(Integer.toString(stationsHistorie.getBearbeiter())); + statHistEditTime.setText(stationsHistorie.getBearbeitetDatumZeit().toString()); + } + + private void copyFieldDataIntoStationsHistorie(StationsHistorie stationsHistorie){ + if(stationsHistorie==null){ + clearFields(); + return; + } + // stationsHistorie.set(colStatHistAbteilung.getText()); + // stationsHistorie.setStation(colStatHistStation.getText()); + // stationsHistorie.setAufnahmeDatum(colStatHistAufnahmeDatum.getDateTime()); + // stationsHistorie.getEntlassungsDatum(colStatHistEntlassungsDatum.getDateTime()); + stationsHistorie.setAufnahmeDatum(dtTmAufnahme.getDateTime()); + // stationsHistorie.getEntlassungsDatum(dtTmEntlassung.getDateTime()); + + } + + private void clearFields(){ + + //statHistCreateTime.setText(""); + //statHistCreator.setText(""); + //statHistEditTime.setText(""); + // statHistEditor.setText(""); + + colStatHistAbteilung.setText(""); + colStatHistStation.setText(""); + // colStatHistAufnahmeDatum.setDateTime(null); + // colStatHistEntlassungsDatum.setDateTime(null); + dtTmAufnahme.setDateTime(null); + dtTmEntlassung.setDateTime(null); + } }