83 lines
2.1 KiB
C++
83 lines
2.1 KiB
C++
/*
|
||
* File: TalentExecutiveMenu.cpp
|
||
* Description: Implements the TalentExecutiveMenu class functions including menu loop and operation handling.
|
||
* Author: Trenser
|
||
* Created: 02-Apr-2026
|
||
*/
|
||
#include <iostream>
|
||
#include "TalentExecutiveMenu.h"
|
||
#include "InputHelper.h"
|
||
#include "OutputHelper.h"
|
||
#include "MenuHelper.h"
|
||
|
||
/*
|
||
* Function: TalentExecutiveMenu::run
|
||
* Description: Starts the talent executive menu loop and displays available options until logout is selected
|
||
* Parameters:
|
||
* None
|
||
* Returns:
|
||
* None
|
||
*/
|
||
void TalentExecutiveMenu::run()
|
||
{
|
||
bool isMenuActive = true;
|
||
while (isMenuActive)
|
||
{
|
||
try
|
||
{
|
||
int choice;
|
||
util::clear();
|
||
std::cout << "Talent Executive Menu\n1. Apply Leave\n2. View Payslip\n3. View Payslip History\n4. View Employees\n5. Search Employee\n6. View Notifications\n7. View Announcements\n8. Create New Job\n9. View Job Opening\n10. Add Candidate\n11. Update Candidate Status\n12. View Shortlisted Candidate\n13. Update Profile\n14. View Profile\n15. 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();
|
||
}
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Function: TalentExecutiveMenu::handleOperation
|
||
* Description: Handles the talent executive’s menu choice and executes the corresponding action
|
||
* Parameters:
|
||
* choice - integer representing the selected menu option
|
||
* Returns:
|
||
* true - if the menu should remain active
|
||
* false - if the talent executive chooses to logout
|
||
*/
|
||
bool TalentExecutiveMenu::handleOperation(int choice)
|
||
{
|
||
switch (choice)
|
||
{
|
||
case 2:
|
||
viewPayslip(m_zenvyController);
|
||
break;
|
||
case 3:
|
||
viewPayslipHistory(m_zenvyController);
|
||
break;
|
||
case 4:
|
||
viewEmployees(m_zenvyController);
|
||
break;
|
||
case 5:
|
||
searchEmployee(m_zenvyController);
|
||
break;
|
||
case 13:
|
||
updateProfile(m_zenvyController);
|
||
break;
|
||
case 14:
|
||
viewProfile(m_zenvyController);
|
||
break;
|
||
case 15:
|
||
return false;
|
||
default:
|
||
std::cout << "Enter a valid choice!" << std::endl;
|
||
util::pressEnter();
|
||
}
|
||
return true;
|
||
} |