a3e622ff8e
<UserStory> EMP006 : Search Employee </UserStory> <Changes> - Updated MenuHelper.h helper file for input validation - Updated search employee logic in employee management service - Removed comments in Enums.h and EmployeeManagementService.h - Included MenuHelper.h in all User Menu files </Changes> <Review> Smitha Mohan </Review>
66 lines
1.3 KiB
C++
66 lines
1.3 KiB
C++
#include <iostream>
|
|
#include "ITExecutiveMenu.h"
|
|
#include"InputHelper.h"
|
|
#include"OutputHelper.h"
|
|
#include "MenuHelper.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:
|
|
searchEmployee(m_zenvyController);
|
|
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;
|
|
}
|