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
FieldsModifier 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.LabelAll attributes with a fx:id assigned in the view(package private) javafx.scene.control.Label -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleEditButton(javafx.event.ActionEvent event) Switch to the edit of the users account information when button is pressedvoidhandleHealthInformation(javafx.event.ActionEvent event) Switch the scene to the management of the health information when the menu item is pressedvoidhandleLogout(javafx.event.ActionEvent event) Call the logout method of the Session class to log out the user when the logout menu item is pressedvoidhandleMakeAppointmentButton(javafx.event.ActionEvent event) Method executed when one of the make appointment Buttons are pressed.voidhandlepdfButton(javafx.event.ActionEvent event) Handle the pdf generation menu item and opens the file chooser if it is pressedvoidinitialize(URL url, ResourceBundle resourceBundle) First method called when scene is switched.private voidload the user appointments to show them in a list for managing them.private voidCall the setter methods for setting the user data to show them his user informationprivate voidsetBirthdayLabel(LocalDate birthday) set the birthday on the users profileprivate voidsetEmailLabel(String email) set the email on the users profileprivate voidsetFirstNameLabel(String firstName) set the first name on the users profileprivate voidsetGenderLabel(String gender) set the gender on the users profileprivate voidsetHouseNoLabel(String houseNo) set the houseNoLabel on the users profileprivate voidsetInsuranceNameLabel(String insuranceName) set the insurance name on the users profileprivate voidsetLastNameLabel(String lastName) set the last name on the users profileprivate voidsetPrivateInsuranceLabel(boolean privateInsurance) set the insurance type on the users profileprivate voidsetStreetLabel(String street) set the street label on the users profileprivate voidsetUsernameLabel(String username) set the username on the users profileprivate voidsetZipLabel(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:
initializein 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
-