| @@ -5,6 +5,7 @@ package de.uniluebeck.mi.projmi6.controller; | |||||
| */ | */ | ||||
| import de.uniluebeck.mi.projmi6.Main; | import de.uniluebeck.mi.projmi6.Main; | ||||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||||
| import de.uniluebeck.mi.projmi6.model.*; | import de.uniluebeck.mi.projmi6.model.*; | ||||
| import de.uniluebeck.mi.projmi6.view.DateTimePicker; | import de.uniluebeck.mi.projmi6.view.DateTimePicker; | ||||
| import javafx.beans.property.SimpleObjectProperty; | import javafx.beans.property.SimpleObjectProperty; | ||||
| @@ -13,6 +14,8 @@ import javafx.event.ActionEvent; | |||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||
| import javafx.scene.control.*; | import javafx.scene.control.*; | ||||
| import java.sql.SQLException; | |||||
| public class UntersuchungenController { | public class UntersuchungenController { | ||||
| /** | /** | ||||
| @@ -79,12 +82,14 @@ public class UntersuchungenController { | |||||
| public void initialize(){ | public void initialize(){ | ||||
| untsOpsCode.itemsProperty().bind(mainController.getStammdaten().opsCodesProperty()); | untsOpsCode.itemsProperty().bind(mainController.getStammdaten().opsCodesProperty()); | ||||
| untsList.itemsProperty().bind(untersuchungen); | untsList.itemsProperty().bind(untersuchungen); | ||||
| untsArzt.setItems(mainController.getStammdaten().getMitarbeiter()); | |||||
| } | } | ||||
| @FXML | @FXML | ||||
| void clickedUntsCreate(ActionEvent event) { | void clickedUntsCreate(ActionEvent event) { | ||||
| clearFields(); | |||||
| untsArzt.getSelectionModel().select(mainController.getCurrentMitarbeiter()); | |||||
| untersuchung = null; | |||||
| } | } | ||||
| @FXML | @FXML | ||||
| @@ -94,7 +99,17 @@ public class UntersuchungenController { | |||||
| @FXML | @FXML | ||||
| void clickedUntsSave(ActionEvent event) { | void clickedUntsSave(ActionEvent event) { | ||||
| // TODO: Jopo: ??? | |||||
| if (untersuchung == null) { | |||||
| untersuchung = new Untersuchung(); | |||||
| untersuchung.setFall(mainController.getFallController().getFallProperty()); | |||||
| copyFieldDataIntoUntersuchung(untersuchung); | |||||
| try { | |||||
| DBHandler.setUntersuchung(untersuchung, mainController.getCurrentMitarbeiter().getMitarbID(), false); | |||||
| } catch (SQLException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| public void setUntersuchung(Untersuchung untersuchung){ | public void setUntersuchung(Untersuchung untersuchung){ | ||||