Files
Training-VehicleService-May26/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/TechnicianMenu.cpp
T
2026-05-22 12:49:14 +05:30

69 lines
1.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
File: TechnicianMenu.cpp
Description: Implements the TechnicianMenu class which provides the technicians 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);
}