cout<<id<<"\t "<<Name<<"\t"<<Job<<"\t"<<Age<<"\t"<<Sex<<"\t"<<Salary<<endl;
ok=1;
break;
}
else
ioFile>>id;
}
if(ok)
cout<<number<<"已经成功找到"<<endl;
else
cout<<number<<"不存在,寻找失败!"<<endl;
ioFile.close();
}
void report::del()
{
string id,Name,Sex,Job,number;
int Age;
double Salary;
cout<<"请输入您要删除员工的编号:"<<endl;
cin>>number;
ifstream ioFile("EmployeeInfo.txt",ios::in);
ofstream temp("TempEmployeeInfo.txt",ios::trunc);
ioFile>>id;
while(ioFile.peek()!=EOF)
{
ioFile>>Name>>Job>>Age>>Sex>>Salary;
if(id!=number)
temp<<id<<" "<<Name<<" "<<Job<<" "<<Age<<" "<<Sex<<" "<<Salary<<endl;
ioFile>>id;
}
ioFile.close();
ofstream ioFile1("EmployeeInfo.txt",ios::trunc);
temp.close();
ifstream temp1("TempEmployeeInfo.txt",ios::in);
temp1>>id;
while(temp1.peek()!=EOF)
{
temp1>>Name>>Job>>Age>>Sex>>Salary;
ioFile1<<id<<" "<<Name<<" "<<Job<<" "<<Age<<" "<<Sex<<" "<<Salary<<endl;
temp1>>id;
}
temp1.close();
ioFile1.close();
cout<<"正在删除,请等待……"<<endl;
cout<<number<<"已经成功删除"<<endl;
}
class Interface
{
public:
void displayInterface();
void displayWdb();
};
void Interface::displayInterface()
{
cout<<" ☆☆☆☆人事管理管理系统☆☆☆☆" <<endl;
cout<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl
<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl
<<"* * 1: 录入员工信息 * *"<<endl
<<"* * 2: 显示员工信息 * *"<<endl
<<"* * 3: 查找员工信息 * *"<<endl
<<"* * 4: 删除员工信息 * *"<<endl
<<"* * 5: 退出系统 * *"<<endl
<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl