69 lines
1.4 KiB
C++
69 lines
1.4 KiB
C++
/*
|
||
File: TechnicianMenu.cpp
|
||
Description: Implements the TechnicianMenu class which provides the technician’s console interface
|
||
in the Vehicle Service Management System. Handles menu display, user input, and
|
||
technician-specific operations such as completing jobs and viewing notifications.
|
||
Author: Trenser
|
||
Date: 19-May-2026
|
||
*/
|
||
|
||
#include "TechnicianMenu.h"
|
||
#include "InputHelper.h"
|
||
#include "OutputHelper.h"
|
||
#include "MenuHelper.h"
|
||
|
||
/*
|
||
Function: showMenu
|
||
Description: Displays the technician menu in a loop until the user chooses to logout.
|
||
Handles exceptions and ensures smooth user interaction.
|
||
Parameters:
|
||
- None
|
||
Returns:
|
||
- void
|
||
*/
|
||
void TechnicianMenu::showMenu()
|
||
{
|
||
bool isMenuActive = true;
|
||
while (isMenuActive)
|
||
{
|
||
try
|
||
{
|
||
int choice;
|
||
util::clear();
|
||
std::cout << "" << std::endl;
|
||
util::read(choice);
|
||
if (!handleOperation(choice))
|
||
{
|
||
isMenuActive = false;
|
||
}
|
||
}
|
||
catch (const std::exception& e)
|
||
{
|
||
std::cout << "Exception: " << e.what() << std::endl;
|
||
util::pressEnter();
|
||
}
|
||
}
|
||
}
|
||
|
||
bool TechnicianMenu::handleOperation(int choice)
|
||
{
|
||
return false;
|
||
}
|
||
|
||
void TechnicianMenu::completeJob()
|
||
{
|
||
}
|
||
|
||
/*
|
||
Function: viewNotifications
|
||
Description: Displays notifications for the technician and allows deletion of notifications.
|
||
Parameters:
|
||
- None
|
||
Returns:
|
||
- void
|
||
*/
|
||
void TechnicianMenu::viewNotifications()
|
||
{
|
||
viewAndDeleteNotification(m_controller);
|
||
}
|