diff --git a/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/CustomerMenu.cpp b/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/CustomerMenu.cpp index 2914cd6..0a97c6a 100644 --- a/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/CustomerMenu.cpp +++ b/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/CustomerMenu.cpp @@ -13,31 +13,77 @@ void CustomerMenu::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(); - } - } + while (true) + { + try + { + int choice; + util::clear(); + std::cout << "Customer Menu" + << "\n1. Select a service" + << "\n2. Select a combo package" + << "\n3. Update Profile" + << "\n4. Change Password" + << "\n5. View Service History" + << "\n6. Complete Payments" + << "\n7. View Invoices" + << "\n8. View Notifications" + << "\n9. Configure Notifications" + << "\n10. Logout" + << "\nEnter a choice: "; + util::read(choice); + if (!handleOperation(choice)) + { + break; + } + } + catch (const std::exception& e) + { + std::cout << "Exception: " << e.what() << std::endl; + util::pressEnter(); + } + } } bool CustomerMenu::handleOperation(int choice) { - return false; + switch (choice) + { + case 1: + selectService(); + break; + case 2: + selectComboPackage(); + break; + case 3: + updateDetails(); + break; + case 4: + changePassword(); + break; + case 5: + viewServiceHistory(); + break; + case 6: + completePayments(); + break; + case 7: + viewInvoices(); + break; + case 8: + viewNotifications(); + break; + case 9: + configureNotifications(); + break; + case 10: + logout(); + return false; + default: + std::cout << "Enter a valid choice!" << std::endl; + util::pressEnter(); + } + return true; } void CustomerMenu::logout() @@ -240,4 +286,4 @@ void CustomerMenu::viewNotifications() void CustomerMenu::configureNotifications() { -} +} \ No newline at end of file