Skip to content

Register GUI Controller

217317751JiayeChen edited this page Apr 1, 2024 · 1 revision

registerGUIController

Controller for managing user registration functionality.

Author: Jiaye Chen

Class Attributes:

Button_Cancel: A Button for canceling the registration process and returning to the login window.

Button_Confirm: A Button for confirming the registration and saving the account details.

selector: A ChoiceBox for selecting the gender of the user.

zapad: A ChoiceBox for selecting the account type (customer, advisor, admin).

text_field_address: A TextField for entering the user's address.

confirm_password_field: A PasswordField for confirming the password during registration.

text_field_dob: A DatePicker for selecting the user's date of birth.

text_field_lastname: A TextField for entering the user's last name.

password_field: A PasswordField for entering the user's password during registration.

text_field_phonenumber: A TextField for entering the user's phone number.

textfield_email: A TextField for entering the user's email address.

textfield_firstname: A TextField for entering the user's first name.

textfield_username: A TextField for entering the user's username.

textfield_administrative_code: A TextField for entering the administrative code during advisor or admin registration.

Initialization Method:

initialize(URL url, ResourceBundle resourceBundle): Method invoked to initialize the controller after its root element has been completely processed.

Action Methods:

onCancel(): Method invoked when the cancel button is clicked to close the registration window and return to the login window.

onConfirm(): Method invoked when the confirm button is clicked to validate the entered details, save the account, and return to the login window.

Utility Methods:

showErrorAlert(String content): Method to display an error alert with the specified content.

closeAndOpenLogin(): Method to close the current registration window and open the login window.

Usage Notes:

This class serves as the controller for managing user registration functionality. It validates the entered details, saves the account based on the selected account type, and handles the confirmation and cancellation of registration.

Clone this wiki locally