Class PrimaryController

java.lang.Object
com.ehealthsystem.primary.PrimaryController
All Implemented Interfaces:
javafx.fxml.Initializable

public class PrimaryController extends Object implements javafx.fxml.Initializable
Used to manage the primary scene
  • Field Details

    • usernameLabel

      javafx.scene.control.Label usernameLabel
      All 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

      public void initialize(URL url, ResourceBundle resourceBundle)
      First method called when scene is switched. Used to set the user information form the database.
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      url -
      resourceBundle -
    • loadUserAppointments

      private void loadUserAppointments() throws SQLException, IOException
      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

      private void setUsernameLabel(String username)
      set the username on the users profile
      Parameters:
      username - the username of the user logged-in in the session
    • setEmailLabel

      private void setEmailLabel(String email)
      set the email on the users profile
      Parameters:
      email - the email of the user logged-in in the session
    • setFirstNameLabel

      private void setFirstNameLabel(String firstName)
      set the first name on the users profile
      Parameters:
      firstName - the first name of the user logged-in in the session
    • setLastNameLabel

      private void setLastNameLabel(String lastName)
      set the last name on the users profile
      Parameters:
      lastName - last name of the user logged-in in the session
    • setStreetLabel

      private void setStreetLabel(String street)
      set the street label on the users profile
      Parameters:
      street - street of the user logged-in in the session
    • setHouseNoLabel

      private void setHouseNoLabel(String houseNo)
      set the houseNoLabel on the users profile
      Parameters:
      houseNo - house number of the user logged-in in the session
    • setZipLabel

      private void setZipLabel(String zip)
      set the zip code on the users profile
      Parameters:
      zip - zip code of the user logged-in in the session
    • setBirthdayLabel

      private void setBirthdayLabel(LocalDate birthday)
      set the birthday on the users profile
      Parameters:
      birthday - birthday of the user logged-in in the session
    • setGenderLabel

      private void setGenderLabel(String gender)
      set the gender on the users profile
      Parameters:
      gender - gender of the user logged-in in the session
    • setInsuranceNameLabel

      private void setInsuranceNameLabel(String insuranceName)
      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

      public void handleMakeAppointmentButton(javafx.event.ActionEvent event) throws IOException
      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

      public void handleEditButton(javafx.event.ActionEvent event) throws IOException
      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

      public void handlepdfButton(javafx.event.ActionEvent event) throws SQLException, IOException
      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

      public void handleLogout(javafx.event.ActionEvent event) throws IOException
      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

      public void handleHealthInformation(javafx.event.ActionEvent event) throws IOException
      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