18afdc4189
<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>
74 lines
1.6 KiB
C++
74 lines
1.6 KiB
C++
#include <iostream>
|
|
#include "HRManagerMenu.h"
|
|
#include"InputHelper.h"
|
|
#include"OutputHelper.h"
|
|
|
|
void HRManagerMenu::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 Employee\n9. Regularize Attendance\n10. Update Leave Request\n11. Register CandidateAsEmployee\n12. 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 HRManagerMenu::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.createEmployee();
|
|
// break;
|
|
//case 9:
|
|
// m_zenvyController.regularizeAttenance();
|
|
// break;
|
|
//case 10:
|
|
// m_zenvyController.updateLeaveRequest();
|
|
// break;
|
|
//case 11:
|
|
// m_zenvyController.registercandidateAsEmployee();
|
|
// break;
|
|
case 12:
|
|
return false;
|
|
default:
|
|
std::cout << "Enter a valid choice!" << std::endl;
|
|
}
|
|
return true;
|
|
}
|