Переглянути джерело

Rumgefuscht damit ich das Anlegen von Faellen testen kann.

testBranch
Nils Dittberner 10 роки тому
джерело
коміт
1e7613a49a
1 змінених файлів з 23 додано та 0 видалено
  1. +23
    -0
      src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java

+ 23
- 0
src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java Переглянути файл

@@ -3,6 +3,7 @@ package de.uniluebeck.mi.projmi6.controller;
/**
* Created by 631806 on 12.11.15.
*/

import de.uniluebeck.mi.projmi6.db.DBHandler;
import de.uniluebeck.mi.projmi6.model.Diagnose;
import de.uniluebeck.mi.projmi6.model.Fall;
@@ -20,6 +21,8 @@ import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;

import java.sql.SQLException;

public class FallController {

private MainController mainController;
@@ -152,6 +155,21 @@ public class FallController {

@FXML
void clickedFallSave(ActionEvent event) {
copyFieldDataIntoFall(fallProperty.get());
if (this.state.get() == State.CREATE) {
try {
DBHandler.setFall(fallProperty.get(), mainController.currentMitarbeiterProperty().get().getMitarbID());
} catch (SQLException e) {
e.printStackTrace();
}
} else {
try {
DBHandler.setFall(fallProperty.get(), mainController.currentMitarbeiterProperty().get().getMitarbID(), true);
} catch (SQLException e) {
e.printStackTrace();
}
}

mainController.fallCreationComplete();
this.state.set(State.VIEW);
//TODO Update/create in db
@@ -160,6 +178,9 @@ public class FallController {
public void createNewFall() {
clearFields();
this.state.set(State.CREATE);
// TODO: Jojo: Kannst Du das wieder heile machen? :D
fallProperty.unbind();
fallProperty.set(new Fall());
}


@@ -196,6 +217,8 @@ public class FallController {

private void copyFieldDataIntoFall(Fall fall){

// TODO: Jojo: Soll man das so machen?
fall.setPatient(mainController.getPatientTablesController().getSelectedPatient());

fall.setAufnahmeDatum(dtTmAufnahme.getDateTime());
fall.setEntlassungsDatum(dtTmEntlassung.getDateTime());


Завантаження…
Відмінити
Зберегти