- java.lang.Object
-
- controllers.UserController
-
- controllers.StudentController
-
- Direct Known Subclasses:
CommitteeController
public class StudentController extends UserController
TheStudentController
class is responsible for handling the student-specific user interface and user interactions. It extends theUserController
class and provides functionality for students to view available camps, register and withdraw from camps, and make enquires. This class utilizesICampStudentService
to interact with underlying data and perform operations
-
-
Field Summary
Fields Modifier and Type Field Description private static ICampStudentService
campStudentService
This class has-aICampStudentService
object which the StudentController object is able to access all the services given.private static IEnquiryStudentService
enquiryStudentService
This class has-aIEnquiryStudentService
object which the StudentController object can access all the services that the enquiry class gives.protected static java.util.Scanner
sc
Scanner
object to get input
-
Constructor Summary
Constructors Constructor Description StudentController()
Default constructor for StudentController
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
deleteEnquiry()
Allows the student to delete an existing enquiry.private void
editEnquiry()
Allows the student to edit an existing enquiry.private void
register()
Allows the current student to register for a camp, choosing between attendee and camp committee member roles.void
start()
Starts the student controller, provides access to various functionalities based on the user's choice.private void
submitEnquiry()
Allows the student to submit a new enquiry for a specific camp.private void
viewAvailableCamps(ICampView campView)
Displays available camps to the student based on their school and visibility.private void
viewEnquiries(IEnquiryView enquiryView)
Allows the student to view their own enquiries.private void
viewRegisteredCamps(ICampView campView)
Displays camps that the student is registered for and allows them to view detailed information.private void
withdraw()
Allows the current student to withdraw from a camp they are registered for.-
Methods inherited from class controllers.UserController
changePassword
-
-
-
-
Field Detail
-
sc
protected static final java.util.Scanner sc
Scanner
object to get input
-
campStudentService
private static final ICampStudentService campStudentService
This class has-aICampStudentService
object which the StudentController object is able to access all the services given.
-
enquiryStudentService
private static final IEnquiryStudentService enquiryStudentService
This class has-aIEnquiryStudentService
object which the StudentController object can access all the services that the enquiry class gives.
-
-
Method Detail
-
start
public void start()
Starts the student controller, provides access to various functionalities based on the user's choice. Functions such as view available/registered camps, register camps, submit/edit/delete enquiries.
-
viewAvailableCamps
private void viewAvailableCamps(ICampView campView)
Displays available camps to the student based on their school and visibility. It allows student to view detailed information.- Parameters:
campView
- The view interface for displaying camp details.
-
viewRegisteredCamps
private void viewRegisteredCamps(ICampView campView)
Displays camps that the student is registered for and allows them to view detailed information.- Parameters:
campView
- The view interface for displaying camp details.
-
register
private void register()
Allows the current student to register for a camp, choosing between attendee and camp committee member roles.
-
withdraw
private void withdraw()
Allows the current student to withdraw from a camp they are registered for.
-
viewEnquiries
private void viewEnquiries(IEnquiryView enquiryView)
Allows the student to view their own enquiries.- Parameters:
enquiryView
- The view interface for displaying enquiry details.
-
submitEnquiry
private void submitEnquiry()
Allows the student to submit a new enquiry for a specific camp.
-
editEnquiry
private void editEnquiry()
Allows the student to edit an existing enquiry.
-
deleteEnquiry
private void deleteEnquiry()
Allows the student to delete an existing enquiry.
-
-