bool EmployeeMenu::search(void) { ui::HelperForm hfForm; std::string employeeCode = hfForm.getSimpleInput("Employee Id"); if( employeeCode.empty()) return false; EmployeeInfo info; try { info = bc::HRManager::getInstance()->searchEmployee(employeeCode); }catch(GeneralException* ge) { mvprintw(15, 1, ge->getMessage().c_str()); mvprintw(20, 3, "Press any key to continue..." ); getch(); return false; } Formatter fm; fm.getFormattedOutput(info); return false; //do not quit from the menu }
bool SkillMenu::searchByName(void) { ui::HelperForm hfForm; std::string skillName = hfForm.getSimpleInput("Skill Name"); if( skillName.empty()) return false; std::vector<SkillsInformation> infoList; try { infoList = bc::HRManager::getInstance()->searchSkills(skillName); }catch(GeneralException* ge) { mvprintw(15, 1, ge->getMessage().c_str()); mvprintw(20, 3, "Press any key to continue..." ); getch(); return false; } std::vector<SkillsInformation>::iterator it; Formatter fm; SkillsInformation info; std::string out; for( it=infoList.begin(); it != infoList.end(); it++) { info = *it; out = fm.getFormattedOutput(info); } return false; //do not quit from the menu }