欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOC文档下载  

    基于C#+Oracle的考勤管理系统的设计与开发.doc

    • 资源ID:2385261       资源大小:1.32MB        全文页数:43页
    • 资源格式: DOC        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    基于C#+Oracle的考勤管理系统的设计与开发.doc

    基于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; / 考勤统计窗体变量/ <summary>/ 窗体加载事件/ </summary>private void frm_kqglxt_Load(object sender, EventArgs e)pBtn.Left = (Width - pBtn.Width) / 2;/ <summary>/ 各子窗体状态处理事件/ </summary>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;/ <summary>/ 员工信息按钮事件/ </summary>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);/ <summary>/ 考勤类型按钮事件/ </summary>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);/ <summary>/ 考勤管理按钮事件/ </summary>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);/ <summary>/ 考勤统计按钮事件/ </summary>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;/ 状态标记/ <summary>/ 窗体加载事件/ </summary>private void frm_ygxx_Load(object sender, EventArgs e)table = Program.ConnRead("select * from YGB");dgvYG.DataSource = table;ChangeButton("JZ"); / <summary>/ 数据表行选择更改事件/ </summary>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 / <summary>/ 窗体按钮是否禁用处理事件/ </summary>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; / <summary>/ 编号文本框输入格式检查事件/ </summary>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);/ <summary>/ 判断是否清空文本框数据事件/ </summary>private void btnZJ_Click(object sender, EventArgs e)type = "ZJ"isbj = true;tbBH.Text = ""tbXM.Text = ""cbXB.Text = "男"tbBM.Text = ""ChangeButton("ZJ");/ <summary>/ 修改数据事件/ </summary>private void btnXG_Click(object sender, EventArgs e)if (tbBH.Text = "") return;type = "XG"isbj = true;ChangeButton("XG");/ <summary>/ 保存数据事件/ </summary>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 < table.Rows.Count; +i)if (table.Rowsi0.ToString() = tbBH.Text)MessageBox.Show("该编号已存在。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);tbBH.Focus();return;if (tbXM.Text = "")MessageBox.Show("姓名不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);tbXM.Focus();return;string sql = ""if (type = "ZJ")sql = "insert into YGB values('" + tbBH.Text + "', '" + tbXM.Text + "', '" + cbXB.Text + "', '" + tbBM.Text + "')"else if (type = "XG")sql = "update YGB set XM = '" + tbXM.Text + "', XB = '" + cbXB.Text + "', BM = '" + tbBM.Text + "' where BH = '" + tbBH.Text + "'"elsereturn;if (Program.ConnNonRead(sql) > 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);/ <summary>/ 取消事件/ </summary>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");/ <summary>/ 删除数据事件/ </summary>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 < table.Rows.Count; +i)if (table.Rowsi0.ToString() = dgvYG.SelectedRows0.Cells0.Value.ToString()table.Rows.RemoveAt(i);dgvYG.DataSource = table;break;if (dgvYG.Rows.Count > 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);/ <summary>/ 退出事件/ </summary>private void btnTC_Click(object sender, EventArgs e)Close();/ <summary>/ 退出判断事件/ </summary>private void frm_ygxx_FormClosing(object sender, FormClosingEventArgs e)if (isbj)MessageBox.Show("请先关闭编辑。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);e.Cancel = true;/ <summary>/ 退出后处理主界面变量事件/ </summary>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;/ 状态标记/ <summary>/ 窗体加载事件/ </summary>private void frm_kqlx_Load(object sender, EventArgs e)table = Program.ConnRead("select * from KQLXB");dgvKQ.DataSource = table;ChangeButton("JZ");/ <summary>/ 数据表行选择更改事件/ </summary>private void dgvKQ_SelectionChanged(object sender, EventArgs e)trytbBH.Text = dgvKQ.SelectedRows0.Cells0.Value.ToString();tbLX.Text = dgvKQ.SelectedRows0.Cells1.Value.ToString();catch / <summary>/ 编号文本框输入格式检查事件/ </summary>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);/ <summary>/ 窗体按钮是否禁用处理事件/ </summary>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;/ <summary>/ 增加数据事件/ </summary>private void btnZJ_Click(object sender, EventArgs e)type = "ZJ"isbj = true;tbBH.Text = ""tbLX.Text = ""ChangeButton("ZJ");/ <summary>/ 修改数据事件/ </summary>private void btnXG_Click(object sender, EventArgs e)if (tbBH.Text = "") return;type = "XG"isbj = true;ChangeButton("XG");/ <summary>/ 保存数据事件/ </summary>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 < table.Rows.Count; +i)if (table.Rowsi0.ToString() = tbBH.Text)MessageBox.Show("该编号已存在。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);tbBH.Focus();return;if (tbLX.Text = "")MessageBox.Show("类型不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);tbLX.Focus();return;string sql = ""if (type = "ZJ")sql = "insert into KQLXB values('" + tbBH.Text + "', '" + tbLX.Text + "')"else if (type = "XG")sql = "update KQLXB set LX = '" + tbLX.Text + "' where BH = '" + tbBH.Text + "'"elsereturn;if (Program.ConnNonRead(sql) > 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);/ <summary>/ 取消事件/ </summary>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");/ <summary>/ 删除数据事件/ </summary>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 < table.Rows.Count; +i)if (table.Rowsi0.ToString() = dgvKQ.SelectedRows0.Cells0.Value.ToString()table.Rows.RemoveAt(i);dgvKQ.DataSource = table;break;if (dgvKQ.Rows.Count > 0)if (dgvKQ.SelectedRows.Count <= 0)dgvKQ.RowsdgvKQ.Rows.Count - 1.Selected = true;tbBH.Text = dgvKQ.SelectedRows0.Cells0.Value.ToString();tbLX.Text = dgvKQ.Select

    注意事项

    本文(基于C#+Oracle的考勤管理系统的设计与开发.doc)为本站会员(文库蛋蛋多)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开