Package com.ehealthsystem.primary
Class PrimaryEditController
java.lang.Object
com.ehealthsystem.primary.PrimaryEditController
- All Implemented Interfaces:
javafx.fxml.Initializable
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) javafx.scene.control.DatePicker(package private) javafx.scene.control.Buttonjavafx.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.PasswordFieldjavafx.scene.control.Label(package private) javafx.scene.control.PasswordFieldjavafx.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangePasswordCheckboxChanged(javafx.event.ActionEvent event) voidhandleCancelButton(javafx.event.ActionEvent event) Method called when cancel button is pressed.voidhandleEmailTextField(javafx.scene.input.KeyEvent event) handle Keyboard input for Email Text Field.voidhandleNewPassword(javafx.scene.input.KeyEvent event) Checks if new password is correct while typingvoidhandleOldPassword(javafx.scene.input.KeyEvent event) Check if old password is correctvoidhandleSaveButton(javafx.event.ActionEvent event) Method called when save button is pressed.voidinitialize(URL url, ResourceBundle resourceBundle) Method called when scene is switched.private voidloadBirthday(LocalDate birthday) Set Date Picker to birthday in DBvoidloadScene(javafx.event.ActionEvent event) scene switch to primary scenevoidLoad user information when button is pressedprivate voidsetEmailTextField(String email) Set Email Text Field to user information in DBprivate voidsetFirstNameTextField(String firstName) Set First Name Text Field to user information in DBprivate voidsetGenderTextField(String gender) Set Gender Text Field to user information in DBprivate voidsetHouseNoTextField(String houseNo) Set House Number Text Field to user information in DBprivate voidsetInsuranceNameTextField(String insuranceName) private voidsetLastNameTextField(String lastName) Set Last Name Text Field to user information in DBprivate voidsetPrivateInsuranceTextField(boolean privateInsurance) Set private insurance Check Box to user information in DBprivate voidsetStreetTextField(String street) Set Street Text Field to user information in DBprivate voidsetUsernameTextField(String username) Set Username Text Field to user information in DBprivate voidsetZipTextField(String zip) Set Zip Text Field to user information in DBprivate voidupdateBirthday(LocalDate birthday) Update birthday when save button is pressedprivate voidupdateEmail(String updateEmail) update email when save button is pressedprivate voidupdateFirstName(String firstName) Update first name when save button is pressedprivate voidupdateGender(String gender) Update gender when save button is pressedprivate voidupdateInsuranceName(String text) Update private insurance name when save button is pressedprivate voidupdateLastName(String lastName) Update last name when save button is pressedprivate voidupdateNumber(String houseNo) Update house number when save button is pressedprivate voidupdatePassword(String oldPassword, String newPassword) Update password when save button is pressedprivate voidupdatePrivateInsurance(boolean privateInsurance) Update private insurance when save button is pressedprivate voidupdateStreet(String street) Update street when save button is pressedprivate voidupdate user information when save button is pressedprivate voidupdateUsername(String username) update username when save button is pressedprivate voidUpdate 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:
initializein 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:
IOExceptionSQLException- 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.
-