Package Common
Class AppManager
java.lang.Object
Common.AppManager
- Direct Known Subclasses:
AdminAppMgr
,DoctorAppMgr
,PatientAppMgr
,PharmaAppMgr
The
AppManager
class serves as an abstract base class for managing
application-level functionalities. It provides methods for user login/logout,
database management, and common settings across different roles.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Account
protected AccountDatabase
protected AccountManager
protected AppointmentOutcomeDatabase
protected DoctorSchedule
protected InventoryDatabase
protected InventoryRequestDatabase
protected MedicalRecordDatabase
protected Role
protected UpdateDetailsPage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Creates instances of managers specific to the application context.protected abstract void
Creates instances of pages specific to the application context.abstract void
Displays the main page of the application, providing access to various functionalities.getRole()
Returns the role of the currently logged-in user.protected abstract void
Loads necessary databases for managing application data.void
Logs in the specified account and initializes the application state.void
logOut()
Logs out the current user and saves any changes made to the databases.protected abstract void
Saves changes made to databases back to their respective CSV files.protected void
settings()
Displays settings options for updating user details.
-
Field Details
-
accountDatabase
-
appointmentOutcomeDatabase
-
inventoryDatabase
-
inventoryRequestDatabase
-
medicalRecordDatabase
-
doctorSchedule
-
account
-
role
-
accountManager
-
updateDetailsPage
-
-
Constructor Details
-
AppManager
public AppManager()
-
-
Method Details
-
logIn
Logs in the specified account and initializes the application state.- Parameters:
account
- theAccount
object representing the user logging in
-
logOut
public void logOut()Logs out the current user and saves any changes made to the databases. -
getRole
Returns the role of the currently logged-in user.- Returns:
- the
Role
of the current user
-
settings
protected void settings()Displays settings options for updating user details. -
createManagers
protected abstract void createManagers()Creates instances of managers specific to the application context. This method must be implemented by subclasses to define manager creation. -
createPages
protected abstract void createPages()Creates instances of pages specific to the application context. This method must be implemented by subclasses to define page creation. -
loadDatabases
protected abstract void loadDatabases()Loads necessary databases for managing application data. This method must be implemented by subclasses to define database loading. -
saveDatabases
protected abstract void saveDatabases()Saves changes made to databases back to their respective CSV files. This method must be implemented by subclasses to define database saving. -
displayMainPage
public abstract void displayMainPage()Displays the main page of the application, providing access to various functionalities.
-