From d194e5381b25a02ff788ed265725ab590a09e74b Mon Sep 17 00:00:00 2001 From: codeurzebs Date: Fri, 3 Nov 2023 11:51:09 +0100 Subject: [PATCH] Add package view and fxml file for busReservation --- .../controllers/LoginView.java | 14 +++++++ .../model/MainReservationBus.java | 2 + .../DAO/DAOfactoryICT/ConnexionMySQL.java | 38 ------------------- .../busmanagement-view.fxml | 14 +++++++ .../busreservationjavafx/dashboard-view.fxml | 14 +++++++ .../drivermanagement-view.fxml | 14 +++++++ .../busreservationjavafx/map-view.fxml | 14 +++++++ .../routemanagement-view.fxml | 14 +++++++ .../busreservationjavafx/statistics-view.fxml | 14 +++++++ .../studentreservation-view.fxml | 14 +++++++ 10 files changed, 114 insertions(+), 38 deletions(-) create mode 100644 src/main/java/com/codeurzebs/busreservationjavafx/controllers/LoginView.java delete mode 100644 src/main/java/com/codeurzebs/busreservationjavafx/model/database/DAO/DAOfactoryICT/ConnexionMySQL.java create mode 100644 src/main/resources/com/codeurzebs/busreservationjavafx/busmanagement-view.fxml create mode 100644 src/main/resources/com/codeurzebs/busreservationjavafx/dashboard-view.fxml create mode 100644 src/main/resources/com/codeurzebs/busreservationjavafx/drivermanagement-view.fxml create mode 100644 src/main/resources/com/codeurzebs/busreservationjavafx/map-view.fxml create mode 100644 src/main/resources/com/codeurzebs/busreservationjavafx/routemanagement-view.fxml create mode 100644 src/main/resources/com/codeurzebs/busreservationjavafx/statistics-view.fxml create mode 100644 src/main/resources/com/codeurzebs/busreservationjavafx/studentreservation-view.fxml diff --git a/src/main/java/com/codeurzebs/busreservationjavafx/controllers/LoginView.java b/src/main/java/com/codeurzebs/busreservationjavafx/controllers/LoginView.java new file mode 100644 index 0000000..e3603e8 --- /dev/null +++ b/src/main/java/com/codeurzebs/busreservationjavafx/controllers/LoginView.java @@ -0,0 +1,14 @@ +package com.codeurzebs.busreservationjavafx.controllers; + +import javafx.fxml.FXML; +import javafx.scene.control.Label; + +public class LoginView { + @FXML + private Label welcomeText; + + @FXML + protected void onHelloButtonClick() { + welcomeText.setText("Welcome to JavaFX Application!"); + } +} diff --git a/src/main/java/com/codeurzebs/busreservationjavafx/model/MainReservationBus.java b/src/main/java/com/codeurzebs/busreservationjavafx/model/MainReservationBus.java index bd49e9f..bf13132 100644 --- a/src/main/java/com/codeurzebs/busreservationjavafx/model/MainReservationBus.java +++ b/src/main/java/com/codeurzebs/busreservationjavafx/model/MainReservationBus.java @@ -14,6 +14,8 @@ public class MainReservationBus { public static void main(String[] args) { + // print hello world + System.out.println("Hello World!"); Scanner lire = new Scanner(System.in); Map> manifestes = new HashMap<>(); List reservations = new ArrayList<>(); diff --git a/src/main/java/com/codeurzebs/busreservationjavafx/model/database/DAO/DAOfactoryICT/ConnexionMySQL.java b/src/main/java/com/codeurzebs/busreservationjavafx/model/database/DAO/DAOfactoryICT/ConnexionMySQL.java deleted file mode 100644 index b5e4dad..0000000 --- a/src/main/java/com/codeurzebs/busreservationjavafx/model/database/DAO/DAOfactoryICT/ConnexionMySQL.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.codeurzebs.busreservationjavafx.model.database.DAO.DAOfactoryICT; - - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; - -public class ConnexionMySQL { - private static final String DB_URL = "jdbc:mysql://localhost:3306/ictbus"; - private static final String USER = "root"; - private static final String PASSWORD = "*******"; - private Connection connection; - public ConnexionMySQL() { - try { - Class.forName("com.mysql.cj.jdbc.Driver"); - connection = DriverManager.getConnection(DB_URL, USER, PASSWORD); - System.out.println("Connexion à MySQL réussie !"); - } catch (ClassNotFoundException | SQLException e) { - e.printStackTrace(); - System.err.println("Erreur lors de la connexion à MySQL : " + e.getMessage()); - } - } - public Connection getConnection() { - return connection; - } - public void closeConnection() { - try { - if (connection != null && !connection.isClosed()) { - connection.close(); - System.out.println("Connexion à MySQL fermée !"); - } - } catch (SQLException e) { - e.printStackTrace(); - System.err.println("Erreur lors de la fermeture de la connexion à MySQL : " + e.getMessage()); - } - } - -} diff --git a/src/main/resources/com/codeurzebs/busreservationjavafx/busmanagement-view.fxml b/src/main/resources/com/codeurzebs/busreservationjavafx/busmanagement-view.fxml new file mode 100644 index 0000000..689c8bc --- /dev/null +++ b/src/main/resources/com/codeurzebs/busreservationjavafx/busmanagement-view.fxml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/main/resources/com/codeurzebs/busreservationjavafx/dashboard-view.fxml b/src/main/resources/com/codeurzebs/busreservationjavafx/dashboard-view.fxml new file mode 100644 index 0000000..fd12719 --- /dev/null +++ b/src/main/resources/com/codeurzebs/busreservationjavafx/dashboard-view.fxml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/main/resources/com/codeurzebs/busreservationjavafx/drivermanagement-view.fxml b/src/main/resources/com/codeurzebs/busreservationjavafx/drivermanagement-view.fxml new file mode 100644 index 0000000..aa52871 --- /dev/null +++ b/src/main/resources/com/codeurzebs/busreservationjavafx/drivermanagement-view.fxml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/main/resources/com/codeurzebs/busreservationjavafx/map-view.fxml b/src/main/resources/com/codeurzebs/busreservationjavafx/map-view.fxml new file mode 100644 index 0000000..1027425 --- /dev/null +++ b/src/main/resources/com/codeurzebs/busreservationjavafx/map-view.fxml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/main/resources/com/codeurzebs/busreservationjavafx/routemanagement-view.fxml b/src/main/resources/com/codeurzebs/busreservationjavafx/routemanagement-view.fxml new file mode 100644 index 0000000..92f8a8f --- /dev/null +++ b/src/main/resources/com/codeurzebs/busreservationjavafx/routemanagement-view.fxml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/main/resources/com/codeurzebs/busreservationjavafx/statistics-view.fxml b/src/main/resources/com/codeurzebs/busreservationjavafx/statistics-view.fxml new file mode 100644 index 0000000..3119e5c --- /dev/null +++ b/src/main/resources/com/codeurzebs/busreservationjavafx/statistics-view.fxml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/main/resources/com/codeurzebs/busreservationjavafx/studentreservation-view.fxml b/src/main/resources/com/codeurzebs/busreservationjavafx/studentreservation-view.fxml new file mode 100644 index 0000000..658d5a4 --- /dev/null +++ b/src/main/resources/com/codeurzebs/busreservationjavafx/studentreservation-view.fxml @@ -0,0 +1,14 @@ + + + + + + + + + + +