dd834ded44
Changes: - Added stub implementations for Controller.cpp methods - Fixed const issue in UserInterface methods (run, login, registerCustomer, handleOperation) - Changed return types to use const pointers for read-only objects - Updated maps and vectors to return const object pointers - Fixed some function parameter names and signatures for consistency
58 lines
918 B
C++
58 lines
918 B
C++
#include "UserInterface.h"
|
|
#include "InputHelper.h"
|
|
#include "OutputHelper.h"
|
|
|
|
void UserInterface::run()
|
|
{
|
|
bool isMenuActive = true;
|
|
while (isMenuActive)
|
|
{
|
|
try
|
|
{
|
|
int choice;
|
|
util::clear();
|
|
std::cout << "Vehicle Service System\n1. Login\n2. Register Customer\n3. Exit\nEnter your Choice: ";
|
|
util::read(choice);
|
|
if (!handleOperation(choice))
|
|
{
|
|
isMenuActive = false;
|
|
}
|
|
}
|
|
catch (const std::exception& e)
|
|
{
|
|
std::cout << "Exception: " << e.what() << std::endl;
|
|
util::pressEnter();
|
|
}
|
|
}
|
|
}
|
|
|
|
bool UserInterface::handleOperation(int choice)
|
|
{
|
|
switch (choice)
|
|
{
|
|
case 1:
|
|
login();
|
|
break;
|
|
case 2:
|
|
registerCustomer();
|
|
break;
|
|
case 3:
|
|
std::cout << "Exiting..." << std::endl;
|
|
return false;
|
|
default:
|
|
std::cout << "Enter a valid choice!" << std::endl;
|
|
util::pressEnter();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void UserInterface::login()
|
|
{
|
|
|
|
}
|
|
|
|
void UserInterface::registerCustomer()
|
|
{
|
|
|
|
}
|