Files
Training-Team2-Zenvy-Jan26/Trenser.Zenvy/Trenser.Zenvy/views/TalentExecutiveMenu.cpp
T
Tinu Johnson 18afdc4189 Error fixes and added main method function and objects
<SRS> SRS01 : Authentication </SRS>

 <Changes>
  - Fixed polymorphism errors in Employee base class by adding virtual destructor.
  - Corrected constructor mismatch in GeneralEmployee to properly call Employee constructor with EmployeeType.
  - Created UserInterface object in main() and invoked run() to start role-based menus.
 </Changes>

 <Review>
   Smitha Mohan
 </Review>
2026-04-06 17:39:09 +05:30

77 lines
1.7 KiB
C++

#include <iostream>
#include "TalentExecutiveMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
void TalentExecutiveMenu::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. Create New Job\n9. View Job Opening\n10. Add Candidate\n11. UpdateCandidate Status\n12. View Shortlisted Candidate\n13. 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 TalentExecutiveMenu::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.createNewJob();
// break;
//case 9:
// m_zenvyController.viewJobOpenings();
// break;
//case 10:
// m_zenvyController.addCandidate();
// break;
//case 11:
// m_zenvyController.updateCandidateStatus();
// break;
//case 12:
// m_zenvyController.viewShortlistedCandidates();
// break;
case 13:
return false;
default:
std::cout << "Enter a valid choice!" << std::endl;
}
return true;
}