|
|
|
@@ -76,6 +76,9 @@ public class StationsHistorieController { |
|
|
|
} |
|
|
|
|
|
|
|
@FXML |
|
|
|
private Button btnStatHistCreate; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private void initialize() { |
|
|
|
initColumns(); |
|
|
|
|
|
|
|
@@ -84,10 +87,12 @@ public class StationsHistorieController { |
|
|
|
|
|
|
|
fields.disableProperty().bind(stateProperty().isEqualTo(State.VIEW)); |
|
|
|
|
|
|
|
btnStatHistCreate.disableProperty().bind(mainController.fallProperty().isNull()); |
|
|
|
|
|
|
|
state.addListener((observable, oldValue, newValue) -> { |
|
|
|
if(newValue == State.CREATE || newValue == State.EDIT){ |
|
|
|
if (newValue == State.CREATE || newValue == State.EDIT) { |
|
|
|
mainController.lockForEdit(MainController.TabName.STATIONSHISTORIE); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
mainController.unlockFromEdit(); |
|
|
|
} |
|
|
|
}); |
|
|
|
@@ -148,6 +153,14 @@ public class StationsHistorieController { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
mainController.refreshCaseData(); |
|
|
|
}else{ |
|
|
|
copyFieldDataIntoStationsHistorie(stationsHistorieSelected); |
|
|
|
try { |
|
|
|
DBHandler.setStationsHistorie(stationsHistorieSelected, true); |
|
|
|
} catch (SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
mainController.refreshCaseData(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -186,11 +199,9 @@ public class StationsHistorieController { |
|
|
|
} |
|
|
|
|
|
|
|
private void initColumns(){ |
|
|
|
// colStatHistStation.setCellValueFactory(new PropertyValueFactory<StationsHistorie, String>()); |
|
|
|
colStatHistStation.setCellValueFactory(new PropertyValueFactory<StationsHistorie, String>("stationKey")); |
|
|
|
colStatHistAufnahmeDatum.setCellValueFactory(new PropertyValueFactory<StationsHistorie, LocalDate>("aufnahmeDatum")); |
|
|
|
colStatHistEntlassungsDatum.setCellValueFactory(new PropertyValueFactory<StationsHistorie, LocalDate>("entlassungsDatum")); |
|
|
|
//colStatHistStation.setCellValueFactory(new PropertyValueFactory<StationsHistorie, LocalDate>()); |
|
|
|
// |
|
|
|
} |
|
|
|
|
|
|
|
private void copyStationsHistorieDataIntoFields(){ |
|
|
|
@@ -200,7 +211,17 @@ public class StationsHistorieController { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//TODO cmbStation.setValue |
|
|
|
//Setze Station im Dropdownfeld |
|
|
|
for (Station station : cmbStation.getItems()) { |
|
|
|
if(station.getStation().equals(stationsHistorieSelected.getStationKey())){ |
|
|
|
cmbStation.getSelectionModel().select(station); |
|
|
|
cmbAbteilung.getSelectionModel().select(station.getAbteilung()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dtTmAufnahme.setDateTime(stationsHistorieSelected.getAufnahmeDatum()); |
|
|
|
dtTmEntlassung.setDateTime(stationsHistorieSelected.getEntlassungsDatum()); |
|
|
|
|