




已阅读5页,还剩38页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
基于c#+oracle的考勤管理系统的设计与开发基于c#+oracle的考勤管理系统的设计与开发年 级: * 学 号: * 姓 名: * 院 系: * 专 业: * 基于c#+oracle的考勤管理系统的设计与开发一、系统设计基本情况1 系统设计目标利用计算机管理考勤信息,在很大程度上减轻了统计的工作量,实现企业员工考勤管理的规范化,考勤数据统计的自动化。2 设计思想除了能够手工录入员工的考勤记录外,还能与考勤机相配合,实现考勤信息录入自动化;考勤类型灵活设定,以便用户随时调整应具有报表功能,查询统计时能够直接生成相关员工的考勤报表,报表能导出系统应采用模块程序设计,便于组合和修改综合考虑,确定本系统采用c/s工作模式,以oracle作为后台数据库,c#为前台程序开发语言。3 系统功能模块划分3.1 员工信息管理模块3.2 考勤类型的设定模块3.3 员工考勤信息手工录入模块3.4 员工考勤情况统计报表生成模块二、数据库设计1 数据库需求分析与用户结合,调查用户需求操作的资料,弄清用户怎样处理各种数据资料,理清数据库中各数据之间的关系。通过分析,设计数据集和数据项如下:1.1 员工信息数据集,数据项为员工号,员工姓名,员工性别,员工所属部门。1.2 考勤类型数据集:数据项为类型号,类型名称1.3 员工考勤情况数据集:数据项为考勤日期,员工号,考勤类型号,备注。2 数据库结构设计2.1 员工信息实体e-r图2.2 考勤类型实体e-r图2.3 员工考勤实体e-r图2.4 实体与实体间的关系e-r图3 各表格数据库设计代码(oracle平台)3.1 考勤类型表格create table kqlxb(bh varchar(4) not null primary key,lx varchar(20) null);3.2 员工信息表格create table ygb(bh varchar(8) not null primary key,xm varchar(12) not null,xb varchar(2) not null,bm varchar(20);3.3 考勤情况管理表格create table kqglb(kqrq date not null,ygbh varchar(8) not null,lxbh varchar(4) not null,bz varchar(60) ,constraint kqglbpri primary key(kqrq,ygbh); 3.4 外键设计alter table kqglb add(constraint kqgl_bh_fk foreign key(lxbh) references kqlxb(bh),constraint yg_bh_fk foreign key(ygbh) references ygb(bh); 3.5 触发器create or replace trigger delete_ygbafter delete on ygb for each rowbegindelete from kqglb where kqglb.ygbh=:old.bh;end delete_ygb;create or replace trigger update_ygbbefore update on ygb for each rowbeginupdate kqglb set kqglb.ygbh=:new.bh where kqglb.ygbh=:old.bh;end update_ygb;create or replace trigger delete_kqlxbafter delete on kqlxb for each rowbegindelete from kqglb where kqglb.lxbh=:old.bh;end delete_kqlxb;create or replace trigger update_kqlxbbefore update on kqlxb for each rowbeginupdate kqglb set kqglb.lxbh=:new.bh where kqglb.lxbh=:old.bh;end update_kqlxb;三、系统设计页面1. 主界面:2. 员工信息管理界面:3. 考勤类型管理界面:4. 考勤信息录入界面:5. 考勤统计报表界面:四、系统编程的实现1. 主界面模块功能:打开各个操作界面。/ 自定义变量public frm_ygxx ygxx = null;/ 员工信息窗体变量public frm_kqlx kqlx = null; / 考勤类型窗体变量public frm_kqgl kqgl = null; / 考勤管理窗体变量public frm_kqtj kqtj = null; / 考勤统计窗体变量/ / 窗体加载事件/ private void frm_kqglxt_load(object sender, eventargs e)pbtn.left = (width - pbtn.width) / 2;/ / 各子窗体状态处理事件/ private void closefrm()if (ygxx != null) ygxx.windowstate = formwindowstate.minimized;if (kqlx != null) kqlx.windowstate = formwindowstate.minimized;if (kqgl != null) kqgl.windowstate = formwindowstate.minimized;if (kqtj != null) kqtj.windowstate = formwindowstate.minimized;/ / 员工信息按钮事件/ private void btnygxx_click(object sender, eventargs e)closefrm();if (ygxx = null)ygxx = new frm_ygxx();ygxx.mdiparent = this;ygxx.show();elseygxx.windowstate = formwindowstate.normal;ygxx.activate();ygxx.location = new point(0, 30);/ / 考勤类型按钮事件/ private void btnkqlx_click(object sender, eventargs e)closefrm();if (kqlx = null)kqlx = new frm_kqlx();kqlx.mdiparent = this;kqlx.show();elsekqlx.windowstate = formwindowstate.normal;kqlx.activate();kqlx.location = new point(0, 30);/ / 考勤管理按钮事件/ private void btnkqgl_click(object sender, eventargs e)closefrm();if (kqgl = null)kqgl = new frm_kqgl();kqgl.mdiparent = this;kqgl.show();elsekqgl.windowstate = formwindowstate.normal;kqgl.activate();kqgl.location = new point(0, 30);/ / 考勤统计按钮事件/ private void btnkqtj_click(object sender, eventargs e)closefrm();if (kqtj = null)kqtj = new frm_kqtj();kqtj.mdiparent = this;kqtj.show();elsekqtj.windowstate = formwindowstate.normal;kqtj.activate();kqtj.location = new point(0, 30);2. 员工信息管理模块功能:操作当前员工信息表,并可以进行员工信息增、改、删的操作。/ 自定义变量private string type = ;/ 按钮禁用判断标记private datatable table = null;/ 封装数据private bool isbj = false;/ 状态标记/ / 窗体加载事件/ private void frm_ygxx_load(object sender, eventargs e)table = program.connread(select * from ygb);dgvyg.datasource = table;changebutton(jz); / / 数据表行选择更改事件/ private void dgvyg_selectionchanged(object sender, eventargs e)trytbbh.text = dgvyg.selectedrows0.cells0.value.tostring();tbxm.text = dgvyg.selectedrows0.cells1.value.tostring();cbxb.text = dgvyg.selectedrows0.cells2.value.tostring();tbbm.text = dgvyg.selectedrows0.cells3.value.tostring();catch / / 窗体按钮是否禁用处理事件/ private void changebutton(string type)if (type = xg)tbbh.enabled = !isbj;elsetbbh.enabled = isbj;tbxm.enabled = isbj;cbxb.enabled = isbj;tbbm.enabled = isbj;dgvyg.enabled = !isbj;btnzj.enabled = !isbj;if (dgvyg.rows.count = 0)btnxg.enabled = false;btnsc.enabled = false;elsebtnxg.enabled = !isbj;btnsc.enabled = !isbj;btntc.enabled = !isbj;btnbc.enabled = isbj;btnqx.enabled = isbj; / / 编号文本框输入格式检查事件/ private void tbbh_textchanged(object sender, eventargs e)if (tbbh.text.length = 0) return;if (!char.isnumber(tbbh.text, tbbh.text.length - 1)tbbh.text = tbbh.text.substring(0, tbbh.text.length - 1);if (tbbh.text.length 0)tbbh.select(tbbh.text.length, 0);/ / 判断是否清空文本框数据事件/ private void btnzj_click(object sender, eventargs e)type = zj;isbj = true;tbbh.text = ;tbxm.text = ;cbxb.text = 男;tbbm.text = ;changebutton(zj);/ / 修改数据事件/ private void btnxg_click(object sender, eventargs e)if (tbbh.text = ) return;type = xg;isbj = true;changebutton(xg);/ / 保存数据事件/ private void btnbc_click(object sender, eventargs e)tbbh.text = tbbh.text.trim();tbxm.text = tbxm.text.trim();tbbm.text = tbbm.text.trim();if (tbbh.text = )messagebox.show(编号不能为空。, 提示, messageboxbuttons.ok, messageboxicon.error);tbbh.focus();return;else if (tbbh.text.length 8)messagebox.show(编号长度不能少于位。, 提示, messageboxbuttons.ok, messageboxicon.error);tbbh.focus();return;elseif (type != xg)for (int i = 0; i 0)if (type = zj)table.rows.add(tbbh.text, tbxm.text, cbxb.text, tbbm.text);dgvyg.datasource = table;dgvyg.rowsdgvyg.rows.count - 1.selected = true;messagebox.show(添加成功。, 提示, messageboxbuttons.ok, messageboxicon.information);elsefor (int i = 0; i table.rows.count; +i)if (table.rowsi0.tostring() = dgvyg.selectedrows0.cells0.value.tostring()table.rowsi1 = tbxm.text;table.rowsi2 = cbxb.text;table.rowsi3 = tbbm.text;dgvyg.datasource = table;break;messagebox.show(修改成功。, 提示, messageboxbuttons.ok, messageboxicon.information);type = ;isbj = false;changebutton(bc);elseif (type = zj)messagebox.show(添加失败,请重新添加。, 提示, messageboxbuttons.ok, messageboxicon.information);elsemessagebox.show(修改失败,请重新修改。, 提示, messageboxbuttons.ok, messageboxicon.information);/ / 取消事件/ private void btnqx_click(object sender, eventargs e)trytbbh.text = dgvyg.selectedrows0.cells0.value.tostring();tbxm.text = dgvyg.selectedrows0.cells1.value.tostring();cbxb.text = dgvyg.selectedrows0.cells2.value.tostring();tbbm.text = dgvyg.selectedrows0.cells3.value.tostring(); catch type = ;isbj = false;changebutton(qx);/ / 删除数据事件/ private void btnsc_click(object sender, eventargs e)if (messagebox.show(确定要删除?, 提示, messageboxbuttons.yesno, messageboxicon.asterisk).tostring() = yes)string sql = delete from ygb where bh = + tbbh.text + ;if (program.connnonread(sql) 0)for (int i = 0; i 0)if (dgvyg.selectedrows.count = 0)dgvyg.rowsdgvyg.rows.count - 1.selected = true;tbbh.text = dgvyg.selectedrows0.cells0.value.tostring();tbxm.text = dgvyg.selectedrows0.cells1.value.tostring();cbxb.text = dgvyg.selectedrows0.cells2.value.tostring();tbbm.text = dgvyg.selectedrows0.cells3.value.tostring();changebutton(sc);messagebox.show(删除成功。, 提示, messageboxbuttons.ok, messageboxicon.information);elsemessagebox.show(删除失败,请重新修改。, 提示, messageboxbuttons.ok, messageboxicon.information);/ / 退出事件/ private void btntc_click(object sender, eventargs e)close();/ / 退出判断事件/ private void frm_ygxx_formclosing(object sender, formclosingeventargs e)if (isbj)messagebox.show(请先关闭编辑。, 提示, messageboxbuttons.ok, messageboxicon.asterisk);e.cancel = true;/ / 退出后处理主界面变量事件/ private void frm_ygxx_formclosed(object sender, formclosedeventargs e)program.kqglxt.ygxx = null;3. 考勤类型管理模块功能:操作当前考勤类型表,并可以进行考勤类型增、改、删的操作。/ 自定义变量private string type = ;/ 按钮禁用判断标记private datatable table = null;/ 封装数据private bool isbj = false;/ 状态标记/ / 窗体加载事件/ private void frm_kqlx_load(object sender, eventargs e)table = program.connread(select * from kqlxb);dgvkq.datasource = table;changebutton(jz);/ / 数据表行选择更改事件/ private void dgvkq_selectionchanged(object sender, eventargs e)trytbbh.text = dgvkq.selectedrows0.cells0.value.tostring();tblx.text = dgvkq.selectedrows0.cells1.value.tostring();catch / / 编号文本框输入格式检查事件/ private void tbbh_textchanged(object sender, eventargs e)if (tbbh.text.length = 0) return;if (!char.isnumber(tbbh.text, tbbh.text.length - 1)tbbh.text = tbbh.text.substring(0, tbbh.text.length - 1);if (tbbh.text.length 0)tbbh.select(tbbh.text.length, 0);/ / 窗体按钮是否禁用处理事件/ private void changebutton(string type)if (type = xg)tbbh.enabled = !isbj;elsetbbh.enabled = isbj;tblx.enabled = isbj;dgvkq.enabled = !isbj;btnzj.enabled = !isbj;if (dgvkq.rows.count = 0)btnxg.enabled = false;btnsc.enabled = false;elsebtnxg.enabled = !isbj;btnsc.enabled = !isbj;btntc.enabled = !isbj;btnbc.enabled = isbj;btnqx.enabled = isbj;/ / 增加数据事件/ private void btnzj_click(object sender, eventargs e)type = zj;isbj = true;tbbh.text = ;tblx.text = ;changebutton(zj);/ / 修改数据事件/ private void btnxg_click(object sender, eventargs e)if (tbbh.text = ) return;type = xg;isbj = true;changebutton(xg);/ / 保存数据事件/ private void btnbc_click(object sender, eventargs e)tbbh.text = tbbh.text.trim();tblx.text = tblx.text.trim();if (tbbh.text = )messagebox.show(编号不能为空。, 提示, messageboxbuttons.ok, messageboxicon.error);tbbh.focus();return;elseif (type != xg)for (int i = 0; i 0)if (type = zj)table.rows.add(tbbh.text, tblx.text);dgvkq.datasource = table;dgvkq.rowsdgvkq.rows.count - 1.selected = true;messagebox.show(添加成功。, 提示, messageboxbuttons.ok, messageboxicon.information);elsefor (int i = 0; i table.rows.count; +i)if (table.rowsi0.tostring() = dgvkq.selectedrows0.cells0.value.tostring()table.rowsi1 = tblx.text;dgvkq.datasource = table;break;messagebox.show(修改成功。, 提示, messageboxbuttons.ok, messageboxicon.information);type = ;isbj = false;changebutton(bc);elseif (type = zj)messagebox.show(添加失败,请重新添加。, 提示, messageboxbuttons.ok, messageboxicon.information);elsemessagebox.show(修改失败,请重新修改。, 提示, messageboxbuttons.ok, messageboxicon.information);/ / 取消事件/ private void btnqx_click(object sender, eventargs e)trytbbh.text = dgvkq.selectedrows0.cells0.value.tostring();tblx.text = dgvkq.selectedrows0.cells1.value.tostring();catch type = ;isbj = false;changebutton(qx);/ / 删除数据事件/ private void btnsc_click(object sender, eventargs e)if (messagebox.show(确定要删除?, 提示, messageboxbuttons.yesno, messageboxicon.asterisk).tostring() = yes)string sql = delete from kqlxb where bh = + tbbh.text + ;if (program.connnonread(sql) 0)for (int i = 0; i 0)if (dgvkq.selectedrows.count = 0)dgvkq.rowsdgvkq.rows.count - 1.selected = true;tbbh.text = dgvkq.selectedrows0.cells0.value.tostring();tblx.text = dgvkq.selectedrows0.cells1.value.tostring();changebutton(sc);messagebox.show(删除成功。, 提示, messageboxbuttons.ok, messageboxicon.information);elsemessagebox.show(删除失败,请重新修改。, 提示, messageboxbuttons.ok, messageboxicon.information);/ / 退出事件/ private void btntc_click(object sender, eventargs e)close();/ / 退出判断事件/ private void frm_yglx_formclosing(object sender, formclosingeventargs e)if (isbj)messagebox.show(请先关闭编辑。, 提示, messageboxbuttons.ok, messageboxicon.asterisk);e.cancel = true;/ / 退出后处理主界面变量事件/ private void frm_kqlx_formclosed(object sender, formclosedeventargs e)program.kqglxt.kqlx = null;4. 员工考勤信息录入模块功能:操作当前考勤信息表,并可以进行考勤信息增、改、删的操作。/ 自定义变量private string type = ;/ 按钮禁用判断标记private datatable table1 = null; / 封装数据private datatable table2 = null; / 封装数据private datatable table3 = null; / 封装数据private bool isbj = false; / 状态标记/ / 窗体加载事件/ private void frm_kqgl_load(object sender, eventargs e)type = jz;table2 = program.connread(select bh, xm from ygb);foreach (datarow row in table2.rows)cbyg.items.add(rowbh.tostring() + + rowxm.tostring();table3 = program.connread(select * from kqlxb);foreach (datarow row in table3.rows)cbcqqk.items.add(rowbh.tostring() + + rowlx.tostring();string time = dtptime.value.day + - + dtptime.value.month + 月- + dtptime.value.year;table1 = program.connread(select kqrq, ygbh, xm, lxbh, lx, bz from kqlxb, ygb, kqglb where ygbh=ygb.bh and lxbh=kqlxb.bh and kqrq= + time + );binddata();type = ;changeinfo();/ / 绑定数据/ private void binddata()int count = dgvkqgl.rows.count;for (int i = 0; i count; +i)dgvkqgl.rows.removeat(0);foreach (datarow row in table1.rows)dgvkqgl.rows.add();dgvkqgl.rowsdgvkqgl.rows.count - 1.cells0.value = convert.todatetime(rowkqrq.tostring().tolongdatestring();dgvkqgl.rowsdgvkqgl.rows.count - 1.cells1.value = rowygbh.tostring() + + rowxm.tostring();dgvkqgl.rowsdgvkqgl.rows.count - 1.cells2.value = rowlxbh.tostring() + + rowlx.tostring();dgvkqgl.rowsdgvkqgl.rows.count - 1.cells3.value = rowbz.tostring();changeenabled();/ / 窗体按钮是否禁用处理事件/ private void changeenabled()if (dgvkqgl.rows.count = 0)btnxg.enabled = false;elsebtnxg.enabled = !isbj;btnzj.enabled = !isbj;btntc.enabled = !isbj;btnbc.enabled = isbj;btnqx.enabled = isbj;dtptime.enabled = !isbj;dgvkqgl.enabled = !isbj;gbxx.enabled = isbj;/ / 改变显示数据事件/ private void changeinfo()if (type != jz & dgvkqgl.rows.count 0 & dgvkqgl.selectedrows.count 0)string temp = dgvkqgl.selectedrows0.cells1.value.tostring(), dgvkqgl.selectedrows0.cells2.value.tostring() ;string ygbh = temp0.substring(0, temp
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 短期租房合同模板
- 电子商务协议书范文二零二五年
- 公厕结账合同标准文本
- 二零二五版房地产代理销售的合同范例
- 蓄电池爆炸事故应急救援预案
- 设计定金协议范本
- 2025年地震数据采集系统合作协议书
- 人事中介合同正式合同范例
- 买树林合同样本
- 2024年苏教版三年级下册数学全册教案及教学反思
- GB/T 13452.2-2008色漆和清漆漆膜厚度的测定
- 2023年中国工商银行天津分行校园招聘考试录用公告
- 班组工程量结算书
- 生产件批准申请书
- 环境监测考试知识点总结
- 爵士音乐 完整版课件
- 嘉兴华雯化工 - 201604
- 冀教版七年级下册数学课件 第8章 8.2.1 幂的乘方
- XX公司“十四五”战略发展规划及年度评价报告(模板)
- 计算机辅助设计(Protel平台)绘图员级试卷1
- 除法口诀表(完整高清打印版)
评论
0/150
提交评论