Package com.ehealthsystem.admin
Class AdminController
java.lang.Object
com.ehealthsystem.admin.AdminController
- All Implemented Interfaces:
javafx.fxml.Initializable
Controller class for admin-view.fxml.
Used to handle the interaction between user and program for the scene
-
Field Summary
Modifier and TypeFieldDescription(package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.Button
(package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableColumn<UserTableView,
Boolean> (package private) UserTableView
The selected row to determine if and which row is currently selected(package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableColumn<UserTableView,
String> (package private) javafx.scene.control.TableView<UserTableView>
The defined with fx:id defined components of the admin-view(package private) javafx.scene.control.TableColumn<UserTableView,
String> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleDeleteButton
(javafx.event.ActionEvent event) Deltes a selected user from the database if the delete button is clickedprivate void
Add the Event Handler for dynamically for the columnsvoid
handleLogout
(javafx.event.ActionEvent event) logs the admin outvoid
initialize
(URL url, ResourceBundle resourceBundle) First method when scene is switches used to call the needed function for loading user inforamtionprivate void
Load the users from the data base and store them in an observable.
-
Field Details
-
userTableView
javafx.scene.control.TableView<UserTableView> userTableViewThe defined with fx:id defined components of the admin-view -
username
javafx.scene.control.TableColumn<UserTableView,String> username -
email
javafx.scene.control.TableColumn<UserTableView,String> email -
firstName
javafx.scene.control.TableColumn<UserTableView,String> firstName -
lastName
javafx.scene.control.TableColumn<UserTableView,String> lastName -
birthday
javafx.scene.control.TableColumn<UserTableView,String> birthday -
gender
javafx.scene.control.TableColumn<UserTableView,String> gender -
street
javafx.scene.control.TableColumn<UserTableView,String> street -
houseNo
javafx.scene.control.TableColumn<UserTableView,String> houseNo -
zip
javafx.scene.control.TableColumn<UserTableView,String> zip -
insuranceName
javafx.scene.control.TableColumn<UserTableView,String> insuranceName -
privateInsurance
javafx.scene.control.TableColumn<UserTableView,Boolean> privateInsurance -
password
javafx.scene.control.TableColumn<UserTableView,String> password -
deleteButton
javafx.scene.control.Button deleteButton -
selectedRow
UserTableView selectedRowThe selected row to determine if and which row is currently selected
-
-
Constructor Details
-
AdminController
public AdminController()
-
-
Method Details
-
initialize
First method when scene is switches used to call the needed function for loading user inforamtion- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
url
-resourceBundle
-
-
loadUsersFromDatabase
Load the users from the data base and store them in an observable. Define which Column of the Tableview corresponds to which value of the attributes of the UserTableView class and fill the table- Throws:
SQLException
- throws sql exception if the method of causes one
-
handleEdit
private void handleEdit()Add the Event Handler for dynamically for the columns -
handleDeleteButton
Deltes a selected user from the database if the delete button is clicked- Parameters:
event
-- Throws:
IOException
SQLException
-
handleLogout
logs the admin out- Parameters:
event
-- Throws:
IOException
-