employee.cpp 464 B

1234567891011121314151617181920212223242526272829
  1. #include "employee.h"
  2. //构造函数
  3. Employee::Employee(int id, std::string name, int dept_id)
  4. {
  5. this->m_ID = id;
  6. this->m_Name = name;
  7. this->m_DeptID = dept_id;
  8. }
  9. //显示个人信息
  10. void Employee::showInfo()
  11. {
  12. std::cout << "职工编号" << this->m_ID
  13. << "\t职工姓名" << this->m_Name
  14. << "\t岗位:" << this->getDeptName()
  15. << "\t岗位职责:完成经理交给的任务"
  16. << std::endl;
  17. }
  18. //获取岗位名称
  19. std::string Employee::getDeptName()
  20. {
  21. return std::string("员工");
  22. }