职工工资管理系统设计与源代码_第1页
职工工资管理系统设计与源代码_第2页
职工工资管理系统设计与源代码_第3页
职工工资管理系统设计与源代码_第4页
职工工资管理系统设计与源代码_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、职工工资管理系统一、 设计目标:按照软件工程的规范,以sql server或access为后台数据库,以delphi 或visual c+为前端开发工具,设计并实现一个简化的工资管理系统。二、 需求描述该系统存储了某单位全体职工和工资信息。职工的基本信息包括:职工编号、姓名、性别、出生年月、职称、最后学历、工资和婚否。每一个职工的工资信息包括:月份、职工编号、职工姓名、基本工资、津贴、岗贴、补贴、房贴、交通补贴、应发数、房租、储蓄、会费、个人所得税、应扣数、实发数、其他收入。个人所得税计算方法设为:应发数少于800元为0;8001000元的部分为5%;10005000元的部分为10%;5000

2、元以上的部分为20%。系统功能如下:1 职工信息管理:a. 增加职工信息。增加新职工时输入新职工的基本信息;b. 删除某职工的基本信息。如,职工死亡或离职时;c. 修改某职工(指定职工编号)的某些信息(如,加工资、获得新学位、晋升职称、结婚或离婚)。2 工资管理:a. 增加工资信息。当增加新职工时,添加某职工的工资信息;b. 职工离职或死亡时,删除某职工的工资信息;c. 修改工资信息。当月开始增加或减少某些项工资或扣款数变化时,修改某职工的部分工资信息;3 查询与统计:a. 查询职工信息,如查询全体职工信息,或按职称、学历、出生年月、出生年月之前/ 之后、已婚/ 未婚等条件或多个条件的组合来查

3、询相应的职工信息。b. 查询指定编号职工的工资信息;c. 按时间段统计职工收入或单位的工资支出。三、 概要设计四、 详细设计void cworkermgr6view:onexit()onexit();void cworkermgr6view:onrecordfirst()if(m_pset-isbof()m_pset-setfieldnull(null);elsem_pset-movefirst();updatedata(false);/更新对话框窗口void cworkermgr6view:onrecordlast()m_pset-movelast();updatedata(false);/

4、更新对话框窗口void cworkermgr6view:onrecordnext()if(m_pset-isbof()m_pset-setfieldnull(null);/判断是否溢出if(m_pset-iseof()afxmessagebox(已经到达最后记录);elsem_pset-movenext();updatedata(false);void cworkermgr6view:onrecordpre()if(m_pset-isbof()afxmessagebox(已经到达第一个记录);m_pset-movefirst();m_pset-moveprev();updatedata(fal

5、se);void cworkermgr6view:onaddworker()hresult hr;tryhr =m_pconnection.createinstance(adodb.connection);/创建connection对象if(succeeded(hr)hr=m_pconnection-open(provider=microsoft.jet.oledb.4.0;data source=worker.mdb,admodeunknown);/连接数据库/上面一句中连接字串中的provider是针对access2000环境的,对于access97,需要改为:provider=micro

6、soft.jet.oledb.3.51;catch(_com_error e)/捕捉异常cstring errormessage;errormessage.format(连接数据库失败!rn错误信息:%s,e.errormessage();afxmessagebox(errormessage);/显示错误信息caddworker dl;if(dl.domodal()=idok)m_pset-addnew();m_pset-m_name=dl.m_nm;m_pset-m_id=dl.m_ids;m_pset-m_sex=dl.m_sx;m_pset-m_born=dl.m_bn;m_pset-m

7、_zhichen=dl.m_zhch;m_pset-m_xueli=dl.m_xli;m_pset-m_salary=dl.m_sala;m_pset-m_marry=dl.m_marr;m_pset-update();m_pset-movelast();updatedata(false);onaddmoney();void cworkermgr6view:ondeleteworker()hresult hr;tryhr =m_pconnection.createinstance(adodb.connection);/创建connection对象if(succeeded(hr)hr=m_pco

8、nnection-open(provider=microsoft.jet.oledb.4.0;data source=worker.mdb,admodeunknown);/连接数据库/上面一句中连接字串中的provider是针对access2000环境的,对于access97,需要改为:provider=microsoft.jet.oledb.3.51;catch(_com_error e)/捕捉异常cstring errormessage;errormessage.format(连接数据库失败!rn错误信息:%s,e.errormessage();afxmessagebox(errormes

9、sage);/显示错误信息cdelworker dl;if(dl.domodal()=idok)updatedata(true);trylong id=dl.m_idid;cstring str;str.format(delete from worker where id=%d,id);_variant_t recordsaffected;m_pconnection-execute(_bstr_t)str,&recordsaffected,adcmdtext);afxmessagebox(删除成功!);catch(_com_error*e)afxmessagebox(e-errormessag

10、e();m_pset-movenext();if(m_pset-iseof()m_pset-movelast();updatedata(false);void cworkermgr6view:onchangworker()hresult hr;tryhr =m_pconnection.createinstance(adodb.connection);/创建connection对象if(succeeded(hr)hr=m_pconnection-open(provider=microsoft.jet.oledb.4.0;data source=worker.mdb,admodeunknown);

11、/连接数据库/上面一句中连接字串中的provider是针对access2000环境的,对于access97,需要改为:provider=microsoft.jet.oledb.3.51;catch(_com_error e)/捕捉异常cstring errormessage;errormessage.format(连接数据库失败!rn错误信息:%s,e.errormessage();afxmessagebox(errormessage);/显示错误信息cchangework dl2;if(dl2.domodal()=idok)updatedata(true);long id=dl2.m_wid

12、;m_pset-movefirst();while(m_pset-m_id!=dl2.m_wid)m_pset-movenext();cchangeone dl1;dl1.m_name1=m_pset-m_name;dl1.m_id1=m_pset-m_id;dl1.m_sex1=m_pset-m_sex;dl1.m_born1=m_pset-m_born;dl1.m_zhichen1=m_pset-m_zhichen;dl1.m_xueli=m_pset-m_xueli;dl1.m_salary1=m_pset-m_salary;dl1.m_marry1=m_pset-m_marry;if(

13、dl1.domodal()=idok)m_pset-edit();m_pset-m_name=dl1.m_name1;m_pset-m_id=dl1.m_id1;m_pset-m_sex=dl1.m_sex1;m_pset-m_born=dl1.m_born1;m_pset-m_zhichen=dl1.m_zhichen1;m_pset-m_xueli=dl1.m_xueli;m_pset-m_salary=dl1.m_salary1;m_pset-m_marry=dl1.m_marry1;m_pset-update();/m_pset-movenext();updatedata(false)

14、;void cworkermgr6view:onmshowdetail()cmshowdetail dl;long id=m_pset-m_id;m_pset-movefirst();while(m_pset-m_id!=id)m_pset-movenext();dl.m_month=m_pset-m_month;dl.m_id=m_pset-m_id;dl.m_name=m_pset-m_name;dl.m_base=m_pset-m_base;dl.m_jintie=m_pset-m_jintie;dl.m_gangtie=m_pset-m_gangtie;dl.m_butie=m_pse

15、t-m_butie;dl.m_fangtie=m_pset-m_fangtie;dl.m_jiaotong=m_pset-m_jiaotong;dl.m_yingfa=dl.m_base+dl.m_jintie+dl.m_gangtie+dl.m_butie+dl.m_fangtie+dl.m_jiaotong;dl.m_fangzu=m_pset-m_fangzu;dl.m_chuxu=m_pset-m_chuxu;dl.m_huifei=m_pset-m_huifei;if(dl.m_yingfa=800&dl.m_yingfa1000&dl.m_yingfa5000)dl.m_geren

16、tax=dl.m_yingfa*0.2f;dl.m_yingkou=dl.m_fangzu+dl.m_chuxu+dl.m_huifei+dl.m_gerentax;dl.m_shifa=dl.m_yingfa-dl.m_yingkou;dl.m_other=m_pset-m_other;dl.domodal();void cworkermgr6view:onaddmoney()caddmoney dl;dl.m_id=m_pset-m_id;dl.m_name=m_pset-m_name;if(dl.domodal()=idok)m_pset-edit();m_pset-m_base=dl.

17、m_base;m_pset-m_month=dl.m_month;m_pset-m_jintie=dl.m_jintie;m_pset-m_gangtie=dl.m_gangtie;m_pset-m_butie=dl.m_butie;m_pset-m_fangtie=dl.m_fangtie;m_pset-m_jiaotong=dl.m_jiaotong;dl.m_yingfa=dl.m_base+dl.m_jintie+dl.m_gangtie+dl.m_butie+dl.m_fangtie+dl.m_jiaotong;m_pset-m_yingfa=dl.m_yingfa;m_pset-m

18、_fangzu=dl.m_fangzu;m_pset-m_chuxu=dl.m_chuxu;m_pset-m_huifei=dl.m_huifei;if(dl.m_yingfa=800&dl.m_yingfa1000&dl.m_yingfa5000)dl.m_gerentax=dl.m_yingfa*0.2f;m_pset-m_gerentax=dl.m_gerentax;dl.m_yingkou=dl.m_fangtie+dl.m_chuxu+dl.m_huifei+dl.m_gerentax;m_pset-m_yingkou=dl.m_yingkou;dl.m_shifa=dl.m_yin

19、gfa-dl.m_yingkou;m_pset-m_shifa=dl.m_shifa;m_pset-m_other=dl.m_other;m_pset-update();/m_pset-movelast();updatedata(false);void cworkermgr6view:ondeletemoney()hresult hr;tryhr =m_pconnection.createinstance(adodb.connection);/创建connection对象if(succeeded(hr)hr=m_pconnection-open(provider=microsoft.jet.o

20、ledb.4.0;data source=worker.mdb,admodeunknown);/连接数据库/上面一句中连接字串中的provider是针对access2000环境的,对于access97,需要改为:provider=microsoft.jet.oledb.3.51;catch(_com_error e)/捕捉异常cstring errormessage;errormessage.format(连接数据库失败!rn错误信息:%s,e.errormessage();afxmessagebox(errormessage);/显示错误信息cdeletemoney dl;if(dl.dom

21、odal()=idok)updatedata(true);trylong id=dl.m_id;cstring str;str.format(delete from worker where id=%d,id);_variant_t recordsaffected;m_pconnection-execute(_bstr_t)str,&recordsaffected,adcmdtext);afxmessagebox(删除成功!);catch(_com_error*e)afxmessagebox(e-errormessage();m_pset-movenext();if(m_pset-iseof(

22、)m_pset-movelast();updatedata(false);void cworkermgr6view:onchangemoney()hresult hr;tryhr =m_pconnection.createinstance(adodb.connection);/创建connection对象if(succeeded(hr)hr=m_pconnection-open(provider=microsoft.jet.oledb.4.0;data source=worker.mdb,admodeunknown);catch(_com_error e) /捕捉异常cstring error

23、message;errormessage.format(连接数据库失败!rn错误信息:%s,e.errormessage();afxmessagebox(errormessage); /显示错误信息cchangework dl2;if(dl2.domodal()=idok)updatedata(true);long id=dl2.m_wid;m_pset-movefirst();while(m_pset-m_id!=dl2.m_wid)m_pset-movenext();cchangemoney dl1;dl1.m_month=m_pset-m_month;dl1.m_name=m_pset-

24、m_name;dl1.m_id=m_pset-m_id;dl1.m_base=m_pset-m_base;dl1.m_jintie=m_pset-m_jintie;dl1.m_gangtie=m_pset-m_gangtie;dl1.m_butie=m_pset-m_butie;dl1.m_fangtie=m_pset-m_fangtie;dl1.m_jiaotong=m_pset-m_jiaotong;dl1.m_yingfa=dl1.m_base+dl1.m_jintie+dl1.m_gangtie+dl1.m_butie+dl1.m_fangtie+dl1.m_jiaotong;dl1.

25、m_fangzu=m_pset-m_fangzu;dl1.m_chuxu=m_pset-m_chuxu;dl1.m_huifei=m_pset-m_huifei;if(dl1.m_yingfa=800&dl1.m_yingfa1000&dl1.m_yingfa5000)dl1.m_gerentax=dl1.m_yingfa*0.2f;dl1.m_yingkou=dl1.m_gerentax+dl1.m_fangzu+dl1.m_chuxu+dl1.m_huifei;dl1.m_shifa=dl1.m_yingfa-dl1.m_yingkou;dl1.m_other=dl1.m_other;if

26、(dl1.domodal()=idok)m_pset-edit();m_pset-m_name=dl1.m_name;m_pset-m_id=dl1.m_id;m_pset-m_month=dl1.m_month;m_pset-m_base=dl1.m_base;m_pset-m_jintie=dl1.m_jintie;m_pset-m_gangtie=dl1.m_gangtie;m_pset-m_butie=dl1.m_butie;m_pset-m_fangtie=dl1.m_fangtie;m_pset-m_jiaotong=dl1.m_jiaotong;m_pset-m_yingfa=d

27、l1.m_base+dl1.m_jintie+dl1.m_gangtie+dl1.m_butie+dl1.m_fangtie+dl1.m_jiaotong;m_pset-m_fangzu=dl1.m_fangzu;m_pset-m_chuxu=dl1.m_chuxu;m_pset-m_huifei=dl1.m_huifei;if(m_pset-m_yingfam_gerentax=0;else if(m_pset-m_yingfa=800&m_pset-m_yingfam_gerentax=m_pset-m_yingfa*0.05f;else if(m_pset-m_yingfa1000&m_

28、pset-m_yingfam_gerentax=m_pset-m_yingfa*0.1f;else if(m_pset-m_yingfa5000)m_pset-m_gerentax=m_pset-m_yingfa*0.2f;m_pset-m_yingkou=dl1.m_fangzu+dl1.m_chuxu+dl1.m_huifei+m_pset-m_gerentax;m_pset-m_shifa=m_pset-m_yingfa-m_pset-m_yingkou;m_pset-m_other=dl1.m_other;m_pset-update();/m_pset-movenext();updat

29、edata(false);void cworkermgr6view:onfindmoney()hresult hr;tryhr =m_pconnection.createinstance(adodb.connection);/创建connection对象if(succeeded(hr)hr=m_pconnection-open(provider=microsoft.jet.oledb.4.0;data source=worker.mdb,admodeunknown);catch(_com_error e) /捕捉异常cstring errormessage;errormessage.forma

30、t(连接数据库失败!rn错误信息:%s,e.errormessage();afxmessagebox(errormessage); /显示错误信息cfindno dl2;if(dl2.domodal()=idok)updatedata(true);long id=dl2.m_id;m_pset-movefirst();while(m_pset-m_id!=dl2.m_id)m_pset-movenext();cmshowdetail dl1;dl1.m_month=m_pset-m_month;dl1.m_name=m_pset-m_name;dl1.m_id=m_pset-m_id;dl1.

31、m_base=m_pset-m_base;dl1.m_jintie=m_pset-m_jintie;dl1.m_gangtie=m_pset-m_gangtie;dl1.m_butie=m_pset-m_butie;dl1.m_fangtie=m_pset-m_fangtie;dl1.m_jiaotong=m_pset-m_jiaotong;dl1.m_yingfa=dl1.m_base+dl1.m_jintie+dl1.m_gangtie+dl1.m_butie+dl1.m_fangtie+dl1.m_jiaotong;dl1.m_fangzu=m_pset-m_fangzu;dl1.m_c

32、huxu=m_pset-m_chuxu;dl1.m_huifei=m_pset-m_huifei;if(dl1.m_yingfa=800&dl1.m_yingfa1000&dl1.m_yingfa5000)dl1.m_gerentax=dl1.m_yingfa*0.2f;dl1.m_yingkou=dl1.m_gerentax+dl1.m_fangzu+dl1.m_chuxu+dl1.m_huifei;dl1.m_shifa=dl1.m_yingfa-dl1.m_yingkou;dl1.m_other=dl1.m_other;dl1.domodal();void cworkermgr6view

33、:onstaticsmoney()hresult hr;tryhr =m_pconnection.createinstance(adodb.connection);/创建connection对象if(succeeded(hr)hr=m_pconnection-open(provider=microsoft.jet.oledb.4.0;data source=worker.mdb,admodeunknown);catch(_com_error e) /捕捉异常cstring errormessage;errormessage.format(连接数据库失败!rn错误信息:%s,e.errormessage();afxmessagebox(error

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论