Files
Training-Team2-Zenvy-Jan26/Trenser.Zenvy/Trenser.Zenvy/views/HRManagerMenu.cpp
T
2026-04-08 17:29:21 +05:30

98 lines
2.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* File: HRManagerMenu.cpp
* Description: Implements the HRManagerMenu class functions including menu loop and operation handling.
* Author: Trenser
* Created: 02-Apr-2026
*/
#include <iostream>
#include "HRManagerMenu.h"
#include"InputHelper.h"
#include"OutputHelper.h"
/*
* Function: HRManagerMenu::run
* Description: Starts the HR manager menu loop and displays available options until logout is selected
* Parameters:
* None
* Returns:
* None
*/
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();
}
}
}
/*
* Function: HRManagerMenu::handleOperation
* Description: Handles the HR managers 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 HR manager chooses to logout
*/
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;
}