Refaktoring #21

Merged
SZUT-Dominik merged 12 commits from refactor into main 2024-04-30 12:21:17 +00:00
9 changed files with 16 additions and 23 deletions
Showing only changes of commit 8302543c30 - Show all commits

Binary file not shown.

View file

@ -1,5 +1,6 @@
package de.hitec.nhplus.datastorage; package de.hitec.nhplus.datastorage;
import de.hitec.nhplus.nurse.NurseDao;
import de.hitec.nhplus.patient.PatientDao; import de.hitec.nhplus.patient.PatientDao;
import de.hitec.nhplus.treatment.TreatmentDao; import de.hitec.nhplus.treatment.TreatmentDao;

View file

@ -1,8 +1,8 @@
package de.hitec.nhplus.fixtures; package de.hitec.nhplus.fixtures;
import de.hitec.nhplus.datastorage.DaoFactory; import de.hitec.nhplus.datastorage.DaoFactory;
import de.hitec.nhplus.datastorage.NurseDao; import de.hitec.nhplus.nurse.NurseDao;
import de.hitec.nhplus.model.Nurse; import de.hitec.nhplus.nurse.Nurse;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;

View file

@ -57,14 +57,4 @@ public class MainWindowController {
exception.printStackTrace(); exception.printStackTrace();
} }
} }
@FXML
private void handleShowAllNurses(ActionEvent event){
FXMLLoader loader = new FXMLLoader(Main.class.getResource("/de/hitec/nhplus/AllNurseView.fxml"));
try {
mainBorderPane.setCenter(loader.load());
}catch (IOException exception){
exception.printStackTrace();
}
}
} }

View file

@ -1,8 +1,6 @@
package de.hitec.nhplus.controller; package de.hitec.nhplus.nurse;
import de.hitec.nhplus.datastorage.DaoFactory; import de.hitec.nhplus.datastorage.DaoFactory;
import de.hitec.nhplus.datastorage.NurseDao;
import de.hitec.nhplus.model.Nurse;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.fxml.FXML; import javafx.fxml.FXML;

View file

@ -1,5 +1,6 @@
package de.hitec.nhplus.model; package de.hitec.nhplus.nurse;
import de.hitec.nhplus.main.Person;
import javafx.beans.property.SimpleLongProperty; import javafx.beans.property.SimpleLongProperty;
import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.SimpleStringProperty;

View file

@ -1,6 +1,6 @@
package de.hitec.nhplus.datastorage; package de.hitec.nhplus.nurse;
import de.hitec.nhplus.model.Nurse; import de.hitec.nhplus.datastorage.DaoImp;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
@ -30,12 +30,12 @@ public class NurseDao extends DaoImp<Nurse> {
} }
@Override @Override
protected PreparedStatement getReadByIDStatement(long nid) { protected PreparedStatement getReadByIDStatement(int nid) {
PreparedStatement preparedStatement = null; PreparedStatement preparedStatement = null;
try { try {
final String SQL = "SELECT * FROM nurse WHERE nid = ?"; final String SQL = "SELECT * FROM nurse WHERE nid = ?";
preparedStatement = this.connection.prepareStatement(SQL); preparedStatement = this.connection.prepareStatement(SQL);
preparedStatement.setLong(1, nid); preparedStatement.setInt(1, nid);
} catch (SQLException exception) { } catch (SQLException exception) {
exception.printStackTrace(); exception.printStackTrace();
} }
@ -101,12 +101,12 @@ public class NurseDao extends DaoImp<Nurse> {
} }
@Override @Override
protected PreparedStatement getDeleteStatement(long nid) { protected PreparedStatement getDeleteStatement(int nid) {
PreparedStatement preparedStatement = null; PreparedStatement preparedStatement = null;
try { try {
final String SQL = "DELETE FROM nurse WHERE nid = ?"; final String SQL = "DELETE FROM nurse WHERE nid = ?";
preparedStatement = this.connection.prepareStatement(SQL); preparedStatement = this.connection.prepareStatement(SQL);
preparedStatement.setLong(1, nid); preparedStatement.setInt(1, nid);
} catch (SQLException exception) { } catch (SQLException exception) {
exception.printStackTrace(); exception.printStackTrace();
} }

View file

@ -15,4 +15,7 @@ module de.hitec.nhplus {
exports de.hitec.nhplus.treatment; exports de.hitec.nhplus.treatment;
opens de.hitec.nhplus.treatment to javafx.base, javafx.fxml; opens de.hitec.nhplus.treatment to javafx.base, javafx.fxml;
exports de.hitec.nhplus.nurse;
opens de.hitec.nhplus.nurse to javafx.base, javafx.fxml;
} }

View file

@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<AnchorPane prefHeight="500.0" prefWidth="855.0" xmlns="http://javafx.com/javafx/10.0.2-internal" <AnchorPane prefHeight="500.0" prefWidth="855.0" xmlns="http://javafx.com/javafx/10.0.2-internal"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hitec.nhplus.controller.AllNurseController"> xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hitec.nhplus.nurse.AllNurseController">
<children> <children>
<TableView fx:id="tableView" editable="true" layoutX="31.0" layoutY="40.0" AnchorPane.bottomAnchor="70.0" <TableView fx:id="tableView" editable="true" layoutX="31.0" layoutY="40.0" AnchorPane.bottomAnchor="70.0"
AnchorPane.leftAnchor="15.0" AnchorPane.rightAnchor="15.0" AnchorPane.topAnchor="80.0"> AnchorPane.leftAnchor="15.0" AnchorPane.rightAnchor="15.0" AnchorPane.topAnchor="80.0">