|
|
@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#include "workermanager.h" //引用自定义的文件,来实例化管理对象
|
|
|
|
|
|
|
|
// 引用员工、经理和老板
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include"boss.h"
|
|
|
|
|
|
|
|
#include"employee.h"
|
|
|
|
|
|
|
|
#include"manager.h"
|
|
|
|
|
|
|
|
#include "worker.h"
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
|
|
|
// 测试代码:
|
|
|
|
|
|
|
|
/*worker* worker = NULL;
|
|
|
|
|
|
|
|
worker = new Employee(1,"张三",1);
|
|
|
|
|
|
|
|
worker->showInfo();
|
|
|
|
|
|
|
|
delete worker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
worker = new Manager(2, "李四", 2);
|
|
|
|
|
|
|
|
worker->showInfo();
|
|
|
|
|
|
|
|
delete worker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
worker = new Boss(3, "王五", 3);
|
|
|
|
|
|
|
|
worker->showInfo();
|
|
|
|
|
|
|
|
delete worker;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WorkerManager wm; // 实例化管理者对象
|
|
|
|
|
|
|
|
int choice = 0; // 用来存储用户的选项
|
|
|
|
|
|
|
|
while (true) // 死循环
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 展示菜单
|
|
|
|
|
|
|
|
wm.Show_Menu(); // 调用展示菜单成员函数
|
|
|
|
|
|
|
|
cout << "请输入您的选择:" << endl;
|
|
|
|
|
|
|
|
cin >> choice; // 接受用户的选项
|
|
|
|
|
|
|
|
switch (choice) {
|
|
|
|
|
|
|
|
case 0: // 退出系统
|
|
|
|
|
|
|
|
wm.ExitSystem();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1: // 增加员工信息
|
|
|
|
|
|
|
|
wm.Add_Emp();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: // 显示员工信息
|
|
|
|
|
|
|
|
wm.Show_Emp();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3: // 删除离职员工信息
|
|
|
|
|
|
|
|
wm.Del_Emp();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4: // 修改员工信息
|
|
|
|
|
|
|
|
wm.Mod_Emp();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5: // 查找员工信息
|
|
|
|
|
|
|
|
wm.Find_Emp();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6: // 按照编号排序
|
|
|
|
|
|
|
|
wm.Sort_Emp();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7: // 清空所有文档
|
|
|
|
|
|
|
|
wm.Clean_File();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
system("pause");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
system("pause");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|