Skip to content

Advisor Edit Controller

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

AdvisorEditController

Controller for the advisor edit view.

Author: Jiaye Chen

Fields:

  • acc_btn: Label for displaying the advisor's full name.
  • cancel_btn: Button for canceling edit operation.
  • delete_btn: Button for deleting the advisor's account.
  • dob_field: TextField for entering the advisor's date of birth.
  • dob_lbl: Label for displaying the advisor's date of birth.
  • edit_btn: Button for saving edits.
  • email_field: TextField for entering the advisor's email.
  • email_lbl: Label for displaying the advisor's email.
  • firstname_field: TextField for entering the advisor's first name.
  • gender_field: TextField for entering the advisor's gender.
  • gender_lbl: Label for displaying the advisor's gender.
  • lastname_field: TextField for entering the advisor's last name.
  • name_lbl: Label for displaying the advisor's name.
  • phone_field: TextField for entering the advisor's phone number.
  • phone_lbl: Label for displaying the advisor's phone number.
  • save_btn: Button for saving changes.
  • today_lbl: Label for displaying the current date.
  • username_lbl: Text for displaying the advisor's username.

Methods:

initialize(): Method invoked to initialize the controller. It sets up listeners for buttons and initializes the displayed information with the advisor's data.

addListeners(): Method to add event listeners to buttons.

init(): Method to initialize the displayed information with the advisor's data.

onCancel(): Event handler method for cancel button. Redirects to the home view for the advisor.

onDelete(): Event handler method for delete button. Deletes the advisor's account.

deleteAccount(): Method to delete the advisor's account.

onSave(): Event handler method for save button. Prompts the user for confirmation before saving changes.

updateAccount(): Method to update the advisor's account information based on the user input.

Usage Notes:

This class controls the functionality of the advisor edit view, allowing the advisor to edit their personal information and save or delete their account.

Clone this wiki locally