Package com.ehealthsystem.primary
Class PrimaryController
java.lang.Object
com.ehealthsystem.primary.PrimaryController
- All Implemented Interfaces:
javafx.fxml.Initializable
Used to manage the primary scene
-
Field Summary
Modifier and TypeFieldDescription(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Button
(package private) javafx.scene.control.Button
(package private) javafx.scene.control.Label
(package private) javafx.scene.layout.GridPane
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.Label
(package private) javafx.scene.layout.GridPane
(package private) javafx.scene.control.Label
All attributes with a fx:id assigned in the view(package private) javafx.scene.control.Label
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleEditButton
(javafx.event.ActionEvent event) Switch to the edit of the users account information when button is pressedvoid
handleHealthInformation
(javafx.event.ActionEvent event) Switch the scene to the management of the health information when the menu item is pressedvoid
handleLogout
(javafx.event.ActionEvent event) Call the logout method of the Session class to log out the user when the logout menu item is pressedvoid
handleMakeAppointmentButton
(javafx.event.ActionEvent event) Method executed when one of the make appointment Buttons are pressed.void
handlepdfButton
(javafx.event.ActionEvent event) Handle the pdf generation menu item and opens the file chooser if it is pressedvoid
initialize
(URL url, ResourceBundle resourceBundle) First method called when scene is switched.private void
load the user appointments to show them in a list for managing them.private void
Call the setter methods for setting the user data to show them his user informationprivate void
setBirthdayLabel
(LocalDate birthday) set the birthday on the users profileprivate void
setEmailLabel
(String email) set the email on the users profileprivate void
setFirstNameLabel
(String firstName) set the first name on the users profileprivate void
setGenderLabel
(String gender) set the gender on the users profileprivate void
setHouseNoLabel
(String houseNo) set the houseNoLabel on the users profileprivate void
setInsuranceNameLabel
(String insuranceName) set the insurance name on the users profileprivate void
setLastNameLabel
(String lastName) set the last name on the users profileprivate void
setPrivateInsuranceLabel
(boolean privateInsurance) set the insurance type on the users profileprivate void
setStreetLabel
(String street) set the street label on the users profileprivate void
setUsernameLabel
(String username) set the username on the users profileprivate void
setZipLabel
(String zip) set the zip code on the users profile
-
Field Details
-
usernameLabel
javafx.scene.control.Label usernameLabelAll attributes with a fx:id assigned in the view -
emailLabel
javafx.scene.control.Label emailLabel -
firstNameLabel
javafx.scene.control.Label firstNameLabel -
lastNameLabel
javafx.scene.control.Label lastNameLabel -
streetLabel
javafx.scene.control.Label streetLabel -
houseNoLabel
javafx.scene.control.Label houseNoLabel -
zipLabel
javafx.scene.control.Label zipLabel -
birthdayLabel
javafx.scene.control.Label birthdayLabel -
genderLabel
javafx.scene.control.Label genderLabel -
insuranceNameLabel
javafx.scene.control.Label insuranceNameLabel -
privateInsuranceLabel
javafx.scene.control.Label privateInsuranceLabel -
makeAppointmentButton1
javafx.scene.control.Button makeAppointmentButton1 -
makeAppointmentButton2
javafx.scene.control.Button makeAppointmentButton2 -
upcomingAppointmentsGridPane
javafx.scene.layout.GridPane upcomingAppointmentsGridPane -
pastAppointmentsGridPane
javafx.scene.layout.GridPane pastAppointmentsGridPane -
upcomingAppointmentsErrorLabel
javafx.scene.control.Label upcomingAppointmentsErrorLabel -
pastAppointmentsErrorLabel
javafx.scene.control.Label pastAppointmentsErrorLabel
-
-
Constructor Details
-
PrimaryController
public PrimaryController()
-
-
Method Details
-
initialize
First method called when scene is switched. Used to set the user information form the database.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
url
-resourceBundle
-
-
loadUserAppointments
load the user appointments to show them in a list for managing them.- Throws:
SQLException
- Throws Exception during connection issues.IOException
-
loadUserDetails
private void loadUserDetails()Call the setter methods for setting the user data to show them his user information -
setUsernameLabel
set the username on the users profile- Parameters:
username
- the username of the user logged-in in the session
-
setEmailLabel
set the email on the users profile- Parameters:
email
- the email of the user logged-in in the session
-
setFirstNameLabel
set the first name on the users profile- Parameters:
firstName
- the first name of the user logged-in in the session
-
setLastNameLabel
set the last name on the users profile- Parameters:
lastName
- last name of the user logged-in in the session
-
setStreetLabel
set the street label on the users profile- Parameters:
street
- street of the user logged-in in the session
-
setHouseNoLabel
set the houseNoLabel on the users profile- Parameters:
houseNo
- house number of the user logged-in in the session
-
setZipLabel
set the zip code on the users profile- Parameters:
zip
- zip code of the user logged-in in the session
-
setBirthdayLabel
set the birthday on the users profile- Parameters:
birthday
- birthday of the user logged-in in the session
-
setGenderLabel
set the gender on the users profile- Parameters:
gender
- gender of the user logged-in in the session
-
setInsuranceNameLabel
set the insurance name on the users profile- Parameters:
insuranceName
- insurance name of the user logged-in in the session
-
setPrivateInsuranceLabel
private void setPrivateInsuranceLabel(boolean privateInsurance) set the insurance type on the users profile- Parameters:
privateInsurance
- insurance type of the user logged-in in the session
-
handleMakeAppointmentButton
Method executed when one of the make appointment Buttons are pressed. Used to switch scene to appointment form.- Parameters:
event
- Trigger to invoke this method.- Throws:
IOException
-
handleEditButton
Switch to the edit of the users account information when button is pressed- Parameters:
event
- the event that causes the execution of the method- Throws:
IOException
-
handlepdfButton
Handle the pdf generation menu item and opens the file chooser if it is pressed- Parameters:
event
- the event that causes the execution of the method- Throws:
SQLException
- Throws Exception during connection issues.IOException
- See Also:
-
handleLogout
Call the logout method of the Session class to log out the user when the logout menu item is pressed- Parameters:
event
- the event that causes the execution of the method- Throws:
IOException
-
handleHealthInformation
Switch the scene to the management of the health information when the menu item is pressed- Parameters:
event
- the event that causes the execution of the method- Throws:
IOException
-