求人事管理管理系统代码

Lemon_DB 2013-01-27 12:38:13
做完就好放假了,求人事管理管理系统。。。!!!
...全文
64 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lee_鹿游原 2013-01-27
  • 打赏
  • 举报
回复
看看CSDN有没有
lee_鹿游原 2013-01-27
  • 打赏
  • 举报
回复

#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
using namespace std;

class Person
{
protected:
	string name,ID,sex,job;
	int age;
	double Sumsalary;
public:
	Person();
	string getID(){return ID;}
	string getName(){return name;}
	string getSex(){return sex;}
	string getJob(){ return job;}
	int getAge(){return age;}
	double getSumsalary(){ return Sumsalary;}
	void InputPerson();
	virtual double getpay()=0;
	friend ostream &operator <<(ostream &os,Person &In);
};
Person::Person()
{
	ID="000000";
	name="No Name";
	age=0;
	sex="No sex";
	Sumsalary=0;
	job="Wei zhi";
}
void Person::InputPerson()
{
	cout<<"Please input ID:"<<endl;
	cin>>ID;
	cout<<"Plaese input name:"<<endl;
	cin>>name;
	cout<<"Plaese input age:"<<endl;
	cin>>age;
	cout<<"Plaese input sex:"<<endl;
	cin>>sex;
}

ostream & operator<<(ostream &os,Person &In)
{
	os<<In.ID<<" "<<In.name<<" "<<In.job<<" "<<In.age<<" "<<In.sex<<" "<<In.getpay()<<endl;
	return os;
}

class Boss:public Person
{
	double salary;
	int year;
public:
	Boss();
	void Input();
	virtual double getpay();
};
Boss::Boss()
{
	job="Boss";
	salary=150000.0;
	year=0;
}
void Boss::Input()
{
	InputPerson();
	cout<<"Please input Salary:"<<endl;
	cin>>salary;
	cout<<"Please input Year:"<<endl;
	cin>>year;
}
double Boss::getpay()
{
	return Sumsalary=salary*year;
}

class Employee:public Person
{
	double salary,bonus;
	int month;
public:
	Employee();
	void Input();
	virtual double getpay();
};
Employee::Employee()
{
	job="Employee";
	salary=2000;
	bonus=500;
	month=0;
}
void Employee::Input()
{
	InputPerson();
	cout<<"Please input Salary:"<<endl;
	cin>>salary;
	cout<<"Please input Bonus:"<<endl;
	cin>>bonus;
	cout<<"Please input Month:"<<endl;
	cin>>month;
}
double Employee::getpay()
{
	return Sumsalary=(salary+bonus)*month ;
}

class Hourly_Worker :public Person
{
	double salary;
	int hour;
public:
	Hourly_Worker();
	void Input();
	virtual double getpay();
};
Hourly_Worker::Hourly_Worker()
{
	job="Hourly_Worker";
	salary=15;
	hour=0;
}
void Hourly_Worker::Input()
{
	InputPerson();
	cout<<"Please input Salary:"<<endl;
	cin>>salary;
	cout<<"Please input Hour:"<<endl;
	cin>>hour;
}
double Hourly_Worker::getpay()
{
	return Sumsalary=salary*hour;
}

class Comm_Worker :public Person
{
	double salary,profit;
	int month;
public:
	Comm_Worker();
	void Input();
	virtual double getpay();
};
Comm_Worker::Comm_Worker()
{
	job="Comm_Worker";
	salary=1800;
	profit=20000;
	month=0;
}
void Comm_Worker::Input()
{
	InputPerson();
	cout<<"Please input Salary:"<<endl;
	cin>>salary;
	cout<<"plaese input Profit:"<<endl;
	cin>>profit;
	cout<<"plaese input Month:"<<endl;
	cin>>month;
}
double Comm_Worker::getpay()
{
	return Sumsalary=month*(salary+profit*0.05) ;
}

class report 
{
public:
	void add();
	void search();
	void del();
	void print();
};
void report::print()
{
	ifstream ioFile("EmployeeInfo.txt",ios::in);
	if(ioFile.fail())
	{
		perror("ioFile");
		cout<<"Cannot open the file!\n";
		return ;
	}
	string id,Name,Sex,Job;
	int Age;
	double Salary;
	ioFile>>id;
	while(ioFile.peek()!=EOF)
	{
		ioFile>>Name>>Job>>Age>>Sex>>Salary;
		cout<<id<<"\t   "<<Name<<"\t"<<Job<<"\t"<<Age<<"\t"<<Sex<<"\t"<<Salary<<endl;
		ioFile>>id;
	}
	ioFile.close();
}
void report::add()
{
	int choice1;
	char ch;
	cout<<"要添加员工的信息吗(y):";
	cin>>ch;
	Boss p1;
	Employee p2;
	Hourly_Worker p3;
	Comm_Worker p4;
	while(ch=='y')
	{
		ofstream ioFile("EmployeeInfo.txt",ios::out|ios::app);
		if(!ioFile)
		{
			cout<<"Can not open the file!"<<endl;
			return ;
		}
		cout<<"请选择类型:"<<endl;
		cout<<"----------------------------------------------------------------"<<endl;
		cout<<"1 BOss"<<setw(6)<<"│"<<" 2 Employee"<<setw(6)<<"│"<<"3 Hourly_Worker"<<
			setw(6)<<"│"<<"4 Comm_Worker"<<"│"<<endl;
		cout<<"----------------------------------------------------------------"<<endl;
		cin>>choice1;
		switch(choice1)
		{
		case 1:

			p1.Input();
			ioFile<<p1;
			break;
		case 2:
			p2.Input();
			ioFile<<p2;
			break;
		case 3:
			p3.Input();
			ioFile<<p3;
			break;
		case 4:
			p4.Input();
			ioFile<<p4;
			break;
		}
		ioFile.close();
		cout<<"继续添加员工信息吗?(y/n):";
		cin>>ch;
	}
	cout<<"添加成功......"<<endl;
}
void report::search()
{
	string id,Name,Sex,Job;
	int Age;
	double Salary;
	string number;
	int ok=0;
	cout<<"请输入要查询的工作号:"<<endl;
	cin>>number;
	ifstream ioFile("EmployeeInfo.txt",ios::in);
	if(ioFile.fail())
	{
		perror("ioFile");
		cout<<"Cannot open the file!\n";
		return ;
	}
	cout<<"正在寻找,请等待……"<<endl;
	ioFile>>id;
	while(ioFile.peek()!=EOF)
	{
		if(id==number)
		{
			ioFile>>Name>>Job>>Age>>Sex>>Salary;
			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
		<<"* * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl
		<<"                         请选择:";
}

void Interface::displayWdb()
{
	cout<<"-----------------------------------------------------------------------"<<endl;
	cout<<"工作号"<<setw(6)<<"│"<<setw(6)<<"姓名"<<setw(6)<<"│"<<setw(6)<<"职位"<<setw(6)
		<<"│"<<setw(6)<<"年龄"<<setw(6)<<"│";
	cout<<setw(6)<<"性别"<<setw(6)<<"│"<<setw(6)<<"工资"<<setw(6)<<"│"<<endl;
	cout<<"-----------------------------------------------------------------------"<<endl;
}

int main()
{
	system("color 006");
	Interface sys;
	report cfy;
	int choice;
	sys.displayInterface();
	while (1)
	{
		cin>>choice;
		switch(choice)
		{
		case 1:	
			cfy.add();
			break;
		case 2:
			sys.displayWdb();
			cfy.print();
			break;
		case 3:
			sys.displayWdb();
			cfy.search();
			break;
		case 4:
			cfy.del();
			break;
		case 5:
			cout<<"欢迎使用本公司产品!"<<endl;
			break;
		}
		if(choice==5)
			break;
		getchar();
		getchar();
		system("cls");
		sys.displayInterface();
	}
}

Java+Oracle,包含功能: (1)用户输入用户名及密码后,进入主操作窗体。 (2)单击“人事管理”/“档案管理”菜单项,对员工档案信息进行添加、修改和查看操作。 (3)单击“系统维护”/“企业架构”菜单项,对企业架构信息进行添加、修改和删除操作。 (4)单击“用户管理”/“新增用户”菜单项,对管理员信息进行添加、删除和冻结/解冻操作。 (5)单击“待遇管理”/“账套管理”菜单项,对账套信息进行添加、修改、删除和对项目信息进行添加和删除操作同时设置金额操作。 (6)单击“待遇管理”/“人员设置”菜单项,对人员信息进行添加及删除操作。 (7)单击“人事管理”/“考勤管理”菜单项,对考勤信息进行添加操作。 (8)单击“人事管理”/“奖惩管理”菜单项,对奖惩信息进行添加操作。 (9)单击“人事管理”/“培训管理”菜单项,对培训信息进行添加、取消培训及查看操作。 (10)单击“待遇管理”/“统计报表”菜单项,对员考勤、奖惩、工资等信息进行统计操作。 (11)单击“系统维护”/“基本资料”菜单项,对基本资料信息进行添加和删除操作。 (12)单击“系统维护”/“初始化系统”菜单项,对系统进行初始化操作。 (13)通过“系统工具”树状菜单,可直接打开计算器、Word及Excel快捷方式。 (14)用户重新登录后,可以设置当前用户的登录密码。

33,321

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 新手乐园
社区管理员
  • 新手乐园社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧