Class RegistrationValidationController

java.lang.Object
com.ehealthsystem.registration.RegistrationValidationController

public class RegistrationValidationController extends Object
  • Field Details

    • validation

      static String 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 codeTextField
      all 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

      public void start(User user, String password)
      The first method called when switching scenes
      Parameters:
      user - the user that wants to create a new account
      password - 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

      public void handleBackButton(javafx.event.ActionEvent event) throws IOException
      switch to the registration
      Parameters:
      event - the event that triggered the method
      Throws:
      IOException
    • setValidation

      public static void setValidation(String validation)
      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