Files
Training-Team2-Zenvy-Jan26/Trenser.Zenvy/Trenser.Zenvy/views/ITExecutiveMenu.cpp
T
Tinu Johnson 719bf5e7b3 Setup basic UI and controller for authentication
<SRS> SRS01 : Authentication </SRS>

<Changes>
- Added basic UI structure with UserInterface and role-based menus (Admin, HR, IT, Finance, Talent, Team, TeamLead, Employee).
- Created menu classes for different roles, each with run() and handleOperation() methods.
</Changes>

<Review>
 Smitha Mohan
</Review>
2026-04-06 16:46:41 +05:30

65 lines
1.3 KiB
C++

#include <iostream>
#include "ITExecutiveMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void ITExecutiveMenu::run()
{
bool isMenuActive = true;
while (isMenuActive)
{
try
{
int choice;
util::clear();
std::cout << "Zenvy - The HR Management System\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notification\n7. View Announcements\n8. Resolve Ticket\n9. Logout\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 ITExecutiveMenu::handleOperation(int choice)
{
switch (choice)
{
case 1:
m_zenvyController.applyLeave();
break;
case 2:
m_zenvyController.viewPayslip();
break;
case 3:
m_zenvyController.viewPayslipHistory();
break;
case 4:
m_zenvyController.viewEmployees();
break;
case 5:
m_zenvyController.searchEmployee();
break;
case 6:
m_zenvyController.viewNotifications();
break;
case 7:
m_zenvyController.viewAnnouncements();
break;
case 8:
m_zenvyController.resolveTicket();
break;
case 9:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}