Package com.ehealthsystem.primary
Class PrimaryEditController
java.lang.Object
com.ehealthsystem.primary.PrimaryEditController
- All Implemented Interfaces:
javafx.fxml.Initializable
-
Field Summary
Modifier and TypeFieldDescription(package private) javafx.scene.control.DatePicker
(package private) javafx.scene.control.Button
javafx.scene.control.CheckBox
(package private) javafx.scene.control.TextField
(package private) javafx.scene.control.Label
(package private) javafx.scene.control.TextField
(package private) javafx.scene.control.ChoiceBox
(package private) javafx.scene.control.TextField
(package private) javafx.scene.control.TextField
(package private) javafx.scene.control.TextField
(package private) javafx.scene.control.PasswordField
javafx.scene.control.Label
(package private) javafx.scene.control.PasswordField
javafx.scene.control.Label
(package private) javafx.scene.control.CheckBox
(package private) javafx.scene.control.Button
(package private) javafx.scene.control.TextField
(package private) javafx.scene.control.TextField
(package private) javafx.scene.control.TextField
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changePasswordCheckboxChanged
(javafx.event.ActionEvent event) void
handleCancelButton
(javafx.event.ActionEvent event) Method called when cancel button is pressed.void
handleEmailTextField
(javafx.scene.input.KeyEvent event) handle Keyboard input for Email Text Field.void
handleNewPassword
(javafx.scene.input.KeyEvent event) Checks if new password is correct while typingvoid
handleOldPassword
(javafx.scene.input.KeyEvent event) Check if old password is correctvoid
handleSaveButton
(javafx.event.ActionEvent event) Method called when save button is pressed.void
initialize
(URL url, ResourceBundle resourceBundle) Method called when scene is switched.private void
loadBirthday
(LocalDate birthday) Set Date Picker to birthday in DBvoid
loadScene
(javafx.event.ActionEvent event) scene switch to primary scenevoid
Load user information when button is pressedprivate void
setEmailTextField
(String email) Set Email Text Field to user information in DBprivate void
setFirstNameTextField
(String firstName) Set First Name Text Field to user information in DBprivate void
setGenderTextField
(String gender) Set Gender Text Field to user information in DBprivate void
setHouseNoTextField
(String houseNo) Set House Number Text Field to user information in DBprivate void
setInsuranceNameTextField
(String insuranceName) private void
setLastNameTextField
(String lastName) Set Last Name Text Field to user information in DBprivate void
setPrivateInsuranceTextField
(boolean privateInsurance) Set private insurance Check Box to user information in DBprivate void
setStreetTextField
(String street) Set Street Text Field to user information in DBprivate void
setUsernameTextField
(String username) Set Username Text Field to user information in DBprivate void
setZipTextField
(String zip) Set Zip Text Field to user information in DBprivate void
updateBirthday
(LocalDate birthday) Update birthday when save button is pressedprivate void
updateEmail
(String updateEmail) update email when save button is pressedprivate void
updateFirstName
(String firstName) Update first name when save button is pressedprivate void
updateGender
(String gender) Update gender when save button is pressedprivate void
updateInsuranceName
(String text) Update private insurance name when save button is pressedprivate void
updateLastName
(String lastName) Update last name when save button is pressedprivate void
updateNumber
(String houseNo) Update house number when save button is pressedprivate void
updatePassword
(String oldPassword, String newPassword) Update password when save button is pressedprivate void
updatePrivateInsurance
(boolean privateInsurance) Update private insurance when save button is pressedprivate void
updateStreet
(String street) Update street when save button is pressedprivate void
update user information when save button is pressedprivate void
updateUsername
(String username) update username when save button is pressedprivate void
Update zip when save button is pressed
-
Field Details
-
changePasswordCheckbox
public javafx.scene.control.CheckBox changePasswordCheckbox -
oldPasswordLabel
public javafx.scene.control.Label oldPasswordLabel -
newPasswordLabel
public javafx.scene.control.Label newPasswordLabel -
usernameTextField
javafx.scene.control.TextField usernameTextField -
emailTextField
javafx.scene.control.TextField emailTextField -
firstNameTextField
javafx.scene.control.TextField firstNameTextField -
lastNameTextField
javafx.scene.control.TextField lastNameTextField -
streetTextField
javafx.scene.control.TextField streetTextField -
houseNoTextField
javafx.scene.control.TextField houseNoTextField -
zipTextField
javafx.scene.control.TextField zipTextField -
birthdayPicker
javafx.scene.control.DatePicker birthdayPicker -
genderBox
javafx.scene.control.ChoiceBox genderBox -
insuranceNameTextField
javafx.scene.control.TextField insuranceNameTextField -
privateInsuranceCheckBox
javafx.scene.control.CheckBox privateInsuranceCheckBox -
oldPasswordField
javafx.scene.control.PasswordField oldPasswordField -
newPasswordField
javafx.scene.control.PasswordField newPasswordField -
errorLabel
javafx.scene.control.Label errorLabel -
cancelButton
javafx.scene.control.Button cancelButton -
saveButton
javafx.scene.control.Button saveButton
-
-
Constructor Details
-
PrimaryEditController
public PrimaryEditController()
-
-
Method Details
-
initialize
Method called when scene is switched. Used to set the ChoiceBox choices and to load the user information- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
url
-resourceBundle
-
-
handleCancelButton
Method called when cancel button is pressed. Return to the primary window without saving edited user information- Parameters:
event
- Trigger to invoke this method.- Throws:
IOException
-
handleSaveButton
Method called when save button is pressed. Updates the edited user information in the DB- Parameters:
event
- Trigger to invoke this method.- Throws:
IOException
SQLException
- Throws Exception during connection issues with the Database.
-
loadScene
scene switch to primary scene- Parameters:
event
- Trigger to invoke this method.- Throws:
IOException
-
updateUserInformation
private void updateUserInformation() throws SQLException, javax.activation.UnsupportedDataTypeExceptionupdate user information when save button is pressed- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateUsername
private void updateUsername(String username) throws SQLException, javax.activation.UnsupportedDataTypeException update username when save button is pressed- Parameters:
username
- The username of the user.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateEmail
private void updateEmail(String updateEmail) throws SQLException, javax.activation.UnsupportedDataTypeException update email when save button is pressed- Parameters:
updateEmail
- The E-mail address of the user.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateFirstName
private void updateFirstName(String firstName) throws SQLException, javax.activation.UnsupportedDataTypeException Update first name when save button is pressed- Parameters:
firstName
- The first name of the user.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateLastName
private void updateLastName(String lastName) throws SQLException, javax.activation.UnsupportedDataTypeException Update last name when save button is pressed- Parameters:
lastName
- The last name of the user.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateStreet
private void updateStreet(String street) throws SQLException, javax.activation.UnsupportedDataTypeException Update street when save button is pressed- Parameters:
street
- The street where the user lives.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateNumber
private void updateNumber(String houseNo) throws SQLException, javax.activation.UnsupportedDataTypeException Update house number when save button is pressed- Parameters:
houseNo
- The house no. of the street.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateZip
private void updateZip(String zip) throws SQLException, javax.activation.UnsupportedDataTypeException Update zip when save button is pressed- Parameters:
zip
- The zip code where the user lives.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateBirthday
private void updateBirthday(LocalDate birthday) throws SQLException, javax.activation.UnsupportedDataTypeException Update birthday when save button is pressed- Parameters:
birthday
- The birthday of the user.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateGender
private void updateGender(String gender) throws SQLException, javax.activation.UnsupportedDataTypeException Update gender when save button is pressed- Parameters:
gender
- The gender of the user.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updateInsuranceName
private void updateInsuranceName(String text) throws SQLException, javax.activation.UnsupportedDataTypeException Update private insurance name when save button is pressed- Parameters:
text
- The name of the insurance.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updatePrivateInsurance
private void updatePrivateInsurance(boolean privateInsurance) throws SQLException, javax.activation.UnsupportedDataTypeException Update private insurance when save button is pressed- Parameters:
privateInsurance
- The type of the insurance.- Throws:
SQLException
- Throws Exception during connection issues with the Database.javax.activation.UnsupportedDataTypeException
-
updatePassword
Update password when save button is pressed- Parameters:
oldPassword
- The old password of the user.newPassword
- The new password of the user.- Throws:
SQLException
- Throws Exception during connection issues with the Database.
-
loadUserDetails
public void loadUserDetails()Load user information when button is pressed -
setUsernameTextField
Set Username Text Field to user information in DB- Parameters:
username
- The username of the user.
-
setEmailTextField
Set Email Text Field to user information in DB- Parameters:
email
- The e-mail address of the user.
-
setFirstNameTextField
Set First Name Text Field to user information in DB- Parameters:
firstName
- The first name of the user.
-
setLastNameTextField
Set Last Name Text Field to user information in DB- Parameters:
lastName
- The last name of the user.
-
setStreetTextField
Set Street Text Field to user information in DB- Parameters:
street
- The street where the user lives.
-
setHouseNoTextField
Set House Number Text Field to user information in DB- Parameters:
houseNo
- The house no. of the street.
-
setZipTextField
Set Zip Text Field to user information in DB- Parameters:
zip
- The zip code where the user lives.
-
loadBirthday
Set Date Picker to birthday in DB- Parameters:
birthday
- The birthday of the user.
-
setGenderTextField
Set Gender Text Field to user information in DB- Parameters:
gender
- The gender of the user.
-
setInsuranceNameTextField
-
setPrivateInsuranceTextField
private void setPrivateInsuranceTextField(boolean privateInsurance) Set private insurance Check Box to user information in DB- Parameters:
privateInsurance
- The type of the insurance.
-
handleOldPassword
Check if old password is correct- Parameters:
event
- Trigger to invoke this method.- Throws:
SQLException
- Throws Exception during connection issues with the Database.
-
handleNewPassword
Checks if new password is correct while typing- Parameters:
event
- Trigger to invoke this method.- Throws:
SQLException
- Throws Exception during connection issues with the Database.
-
handleEmailTextField
public void handleEmailTextField(javafx.scene.input.KeyEvent event) handle Keyboard input for Email Text Field. Check if Email format matches- Parameters:
event
- Trigger to invoke this method.
-
changePasswordCheckboxChanged
public void changePasswordCheckboxChanged(javafx.event.ActionEvent event) - Parameters:
event
- Trigger to invoke this method.
-