/********************************************************************************
/*功能:实现公司员工信息管理系统主界面功能,实现密码输入的登录,提高了界面的友好性
/* 以及有如下的功能1.将员工信息写入文件,2.从文件中读取员工的信息,3.基本的信
/* 息管理功能添加、删除、查询、修改,4.增加了程序的健壮性,可以判别多种错误的
/* 输入..........
/********************************************************************************/
#include<string>
#include<iostream>
#include <conio.h>
#include <fstream>
#include <stdlib.h>
#include <iomanip>
using namespace std;
class Employee//定义员工类
{
protected:
char m_strName[256]; //姓名
int m_level;//级别
double m_month_pay;//月薪
int m_year,m_month,m_day;//员工的出生日期
long m_nType; //员工类型:1:管理人员 2:销售人员 3:技术人员 ....
public:
long m_nID; //编号
Employee(long nType,char* strName,double month_pay,int m_year,int m_month,int m_day,int level=1);
Employee(){}
int Get_Year();
int Get_Month();
int Get_Day();
char* Get_Name();
long Get_ID();
double Get_month_pay();
int Get_level();
long Get_Type();
void Set_ID();
void Set_Level(int level);
void Set_Type(long nType);
void Set_Pay(double month_pay);
void Set_Name(char* strName);
void Set_Birthday(int year,int month,int day);
virtual void Print()
{
cout<<"员工类:"<<endl;
cout<<"姓名:"<<this->m_strName<<" "<<"编号:"<<this->m_nID<<" 月底薪:"<<this->m_month_pay<<" 级别:"<<this->m_level;
cout<<"出生日期: "<<this->m_year<<"-"<<this->m_month<<"-"<<this->m_day<<endl<<endl;
}
~Employee(){}
};
class Manager:virtual public Employee//定义管理类
{
protected:
double m_fTeleAllowance;
public:
static int m_nCount_Manager; //经理类人员的总数
Manager(long nType,char* strName, double fTeleAllowance,double month_pay,int m_year,int m_month,int m_day,int level=1);
Manager(){}
double Get_TeleAllowance();
void Set_FTeleAllowance(double fTeleAllowance);
void Modify_Manager(char* strName, double fTeleAllowance,double month_pay,int level,int year,int month,int day);//修改管理类信息
void Print();//输出基类和派生类中的属性信息
~Manager(){}
};
class Technology:virtual public Employee//定义技术类
{
protected:
char m_Technology[256];
public:
static int m_nCount_Technology;//技术类人员的总数
Technology(long nType,char* strName, char *Technology,double month_pay,int m_year,int m_month,int m_day,int level=1);
Technology(){}
char *Get_Technology();
void Set_Technology(char *Technology);
void Modify_Technology(char* strName,char *Technology,double month_pay,int level,int year,int month,int day);//修改技术类信息
void Print();//输出基类和派生类中的属性信息
~Technology(){}
};
class Sell:virtual public Employee//定义销售类
{
protected:
double m_Deductions;//提成比率
public:
static int m_nCount_Sell;//销售类人员总数
Sell(long nType,char* strName, double Deductions,double month_pay,int m_year,int m_month,int m_day,int level=1);
Sell(){}
double Get_Deductions();
void Set_Deductions(double Deductions);
void Modify_Sell(char* strName, double Deductions,double month_pay,int level,int year,int month,int day);//修改销售类信息
void Print();//输出基和派生类的属性信息
~Sell(){}
};
//初始化各个类的静态元素以及全局变量
int Class_Count = 1001;//员工编号自动生成
int Manager::m_nCount_Manager=0;
int Technology::m_nCount_Technology=0;
int Sell::m_nCount_Sell=0;
Employee::Employee(long nType,char* strName,double month_pay,int year,int month,int day,int level)
{
m_nID = Class_Count++;
m_level=level;
m_nType = nType;
m_year=year;
m_month=month;
m_day=day;
m_month_pay=month_pay;
strcpy(m_strName, strName);
}
//定义类Employee中的Public函数
int Employee::Get_Year() { return m_year; }
int Employee::Get_Month(){ return m_month; }
int Employee::Get_Day() { return m_day; }
char* Employee::Get_Name() { return m_strName; }
long Employee::Get_ID() { return m_nID; }
double Employee::Get_month_pay() { return m_month_pay; }
int Employee::Get_level(){ return m_level; }
long Employee::Get_Type() { return m_nType; }
void Employee::Set_ID(){ m_nID = Class_Count++; }
void Employee::Set_Level(int level){ m_level = level; }
void Employee::Set_Type(long nType){ m_nType = nType; }
void Employee::Set_Pay(double month_pay){ m_month_pay=month_pay; }
void Employee::Set_Name(char* strName){ strcpy(m_strName, strName); }
void Employee::Set_Birthday(int year,int month,int day){ m_year=year;m_month=month;m_day=day; }
//定义类Manager中的函数
void Manager::Set_FTeleAllowance(double fTeleAllowance){ m_fTeleAllowance=fTeleAllowance; }
double Manager::Get_TeleAllowance() { return m_fTeleAllowance; }
void Manager::Modify_Manager(char* strName, double fTeleAllowance,double month_pay,int level,int year,int month,int day)//修改管理类信息
{
m_year=year;
m_month=month;
m_day=day;
m_level=level;
m_month_pay=month_pay;
strcpy(m_strName, strName);
m_fTeleAllowance = fTeleAllowance;
}
void Manager::Print()//输出基类和派生类中的属性信息
{
cout<<"\t├—————┼—————┼—————┼—————┼—————┼—————┼——————┤"<<endl;
cout<<"\t│"<<setw(10)<<this->m_nID<<"│"<<setw(10)<<this->m_strName<<"│"<<setw(10)<<"管理人员"<<"│"<<setw(10)<<Get_TeleAllowance()<<"│"<<setw(10)<<this->m_month_pay<<"│"<<setw(10)<<this->m_level<<"│"<<this->m_year<<"-"<<this->m_month<<"-"<<this->m_day<<" │"<<endl;
}
Manager::Manager(long nType,char* strName, double fTeleAllowance,double month_pay,int year,int month,int day,int level):Employee(nType,strName,month_pay, year, month, day,level)
{
m_nCount_Manager++;
m_fTeleAllowance = fTeleAllowance;
}
//定义类Technology中的函数
char* Technology::Get_Technology() { return m_Technology; }
void Technology::Set_Technology(char *Technology){strcpy(m_Technology,Technology);}
void Technology::Modify_Technology(char* strName, char *Technology,double month_pay,int level,int year,int month,int day)//修改技术类信息
{
m_year=year;
m_month=month;
m_day=day;
m_level=level;
m_month_pay=month_pay;
strcpy(m_strName, strName);
strcpy(m_Technology,Technology);
}
void Technology::Print()//输出基类和派生类中的属性信息
{
cout<<"\t├—————┼—————┼—————┼—————┼—————┼—————┼——————┤"<<endl;
cout<<"\t│"<<setw(10)<<this->m_nID<<"│"<<setw(10)<<this->m_strName<<"│"<<setw(10)<<"技术人员"<<"│"<<setw(10)<<Get_Technology()<<"│"<<setw(10)<<this->m_month_pay<<"│"<<setw(10)<<this->m_level<<"│"<<this->m_year<<"-"<<this->m_month<<"-"<<this->m_day<<" │"<<endl;
}
Technology::Technology(long nType,char* strName, char *Technology,double month_pay,int year,int month,int day,int level):Employee(nType,strName,month_pay, year, month, day,level)
{
m_nCount_Technology++;
strcpy(m_Technology,Technology);
}
//定义类Sell中的函数
double Sell::Get_Deductions() { return m_Deductions; }
void Sell::Set_Deductions(double Deductions){ m_Deductions = Deductions; }
void Sell::Modify_Sell(char* strName, double Deductions,double month_pay,int level,int year,int month,int day)//修改销售类信息
{
m_year=year;
m_month=month;
m_day=day;
m_level=level;
m_month_pay=month_pay;
m_Deductions = Deductions;
strcpy(m_strName, strName);
}
void Sell::Print()//输出基和派生类的属性信息
{
cout<<"\t├—————┼—————┼—————┼—————┼—————┼—————┼——————┤"<<endl;
cout<<"\t│"<<setw(10)<<this->m_nID<<"│"<<setw(10)<<this->m_strName<<"│"<<setw(10)<<"销售人员"<<"│"<<setw(10)<<Get_Deductions()<<"│"<<setw(10)<<this->m_month_pay<<"│"<<setw(10)<<this->m_level<<"│"<<this->m_year<<"-"<<this->m_month<<"-"<<this->m_day<<" │"<<endl;
}
Sell::Sell(long nType,char* strName, double Deductions,double month_pay,int year,int month,int day,int level):Employee(nType,strName,mont
没有合适的资源?快使用搜索试试~ 我知道了~
公司人员管理系统(Chinese)
共15个文件
pdb:2个
dat:2个
plg:1个
需积分: 16 37 下载量 16 浏览量
2010-01-03
21:07:59
上传
评论
收藏 1.22MB ZIP 举报
温馨提示
功能:实现公司员工信息管理系统主界面功能,实现密码输入的登录,提高了界面的友好性 /* 以及有如下的功能1.将员工信息写入文件,2.从文件中读取员工的信息,3.基本的信 /* 息管理功能添加、删除、查询、修改,4.增加了程序的健壮性,可以判别多种错误的 /* 输入..........
资源推荐
资源详情
资源评论
收起资源包目录
Chinese).zip (15个子文件)
公司人员管理系统(Chinese)
Employee_Information.dat 7KB
公司人员管理系统(Chinese).ncb 49KB
公司人员管理系统(Chinese).plg 288B
公司人员管理系统(Chinese).dsp 4KB
Password.dat 11B
公司人员管理系统(Chinese).opt 48KB
公司人员管理系统(Chinese).cpp 42KB
Debug
vc60.pdb 116KB
vc60.idb 73KB
公司人员管理系统(Chinese).pdb 1.17MB
公司人员管理系统(Chinese).ilk 879KB
公司人员管理系统(Chinese).pch 2.08MB
公司人员管理系统(Chinese).obj 515KB
公司人员管理系统(Chinese).exe 628KB
公司人员管理系统(Chinese).dsw 579B
共 15 条
- 1
资源评论
xianxueyun
- 粉丝: 5
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功