示例#1
0
  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
  }
示例#2
0
  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
  }