Setup basic UI and controller for authentication
<SRS> SRS01 : Authentication </SRS> <Changes> - Added basic UI structure with UserInterface and role-based menus (Admin, HR, IT, Finance, Talent, Team, TeamLead, Employee). - Created menu classes for different roles, each with run() and handleOperation() methods. </Changes> <Review> Smitha Mohan </Review>
This commit is contained in:
@@ -1 +1,52 @@
|
||||
#include <iostream>
|
||||
#include "AdminMenu.h"
|
||||
#include"InputHelper.h"
|
||||
#include"OutputHelper.h"
|
||||
|
||||
void AdminMenu::run()
|
||||
{
|
||||
bool isMenuActive = true;
|
||||
while (isMenuActive)
|
||||
{
|
||||
try
|
||||
{
|
||||
int choice;
|
||||
util::clear();
|
||||
std::cout << "Zenvy - HR Management System\n1. Create HRManager\n2. Create Employee\n3. View Employee\n4. Deactivate Employee\n5. 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 AdminMenu::handleOperation(int choice)
|
||||
{
|
||||
switch (choice)
|
||||
{
|
||||
case 1:
|
||||
m_zenvyController.createHRManager();
|
||||
break;
|
||||
case 2:
|
||||
m_zenvyController.createEmployee();
|
||||
break;
|
||||
case 3:
|
||||
m_zenvyController.viewEmployee();
|
||||
break;
|
||||
case 4:
|
||||
m_zenvyController.deactivateEmployee();
|
||||
break;
|
||||
case 5:
|
||||
return false;
|
||||
default:
|
||||
std::cout << "Enter a valid choice!" << std::endl;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user