Package com.ehealthsystem.registration
Class RegistrationValidationController
java.lang.Object
com.ehealthsystem.registration.RegistrationValidationController
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleBackButton
(javafx.event.ActionEvent event) switch to the registrationvoid
handleRegistrationButton
(javafx.event.ActionEvent event) Scene switch, if validation was successful, to the primary scenevoid
handleResendLabel
(javafx.scene.input.MouseEvent event) If the Label is pressed a new code is sent to the userstatic void
setValidation
(String validation) set the generated validation code for comparing them to the user input.void
The first method called when switching scenesboolean
Compare the generated code with the user input.
-
Field Details
-
validation
the generated validation code. Used to compare the generated validation code with the validation code entered by the user -
codeTextField
javafx.scene.control.TextField codeTextFieldall attributes with a fx:id set -
errorLabel
javafx.scene.control.Label errorLabel -
newUser
User newUser -
password
String password
-
-
Constructor Details
-
RegistrationValidationController
public RegistrationValidationController()
-
-
Method Details
-
start
The first method called when switching scenes- Parameters:
user
- the user that wants to create a new accountpassword
- the new user's password (used to insert them later into the database)
-
handleRegistrationButton
public void handleRegistrationButton(javafx.event.ActionEvent event) throws SQLException, IOException Scene switch, if validation was successful, to the primary scene- Parameters:
event
- the event that triggered the method- Throws:
SQLException
- Throws Exception during connection issues.IOException
-
validateCode
public boolean validateCode()Compare the generated code with the user input. If they are equal the validation is successful.- Returns:
- True if the user input matches with the generated code that was sent to them.
-
handleResendLabel
public void handleResendLabel(javafx.scene.input.MouseEvent event) throws javax.mail.MessagingException, IOException, SQLException If the Label is pressed a new code is sent to the user- Parameters:
event
- the event that triggered the method- Throws:
javax.mail.MessagingException
IOException
SQLException
- Throws Exception during connection issues.
-
handleBackButton
switch to the registration- Parameters:
event
- the event that triggered the method- Throws:
IOException
-
setValidation
set the generated validation code for comparing them to the user input.- Parameters:
validation
- the generated validation code of the passed from the email class
-