




免费预览已结束,剩余19页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
河南城建学院可视化编程技术课程设计报告题目:职工信息管理系统姓 名: 李 同 猛 学 号: 061408129 班 级: 0614081班 指导老师: 张娜 张妍琰 专 业: 计算机科学与技术 2011年 2 月 21日-24 日前言 在当今社会,互联网空的发展,给人们的工作和生活带来了极大的便利和高效,信息化,电子化已经成为节约运营成本,提高工作效率的首选。当前大量企业的员工管理尚处于手工作业阶段,不但效率低下,还常常因为管理的不慎而出现纰漏。因此部分企业需求,设计企业员工信息管理系统,以帮助企业达到员工管理办公自动化、节约管理成本、提高企业工作效率的目的。 随着计算机的飞速发展,它的应用已经十分广泛,它在人们的生产、生活、工作和学习中发挥着重要的作用。例如一个现代化的公司,拥有数千名的员工,那么如何管理这么庞大的职工信息档案呢?这时,开发一个功能完善的职工信息管理系统就必不可少了。本系统在.net框架下采用“自上而下地总体规划,自下而上地应用开发”的策略开发,提出了实现职工信息、部门信息查询、管理、更新的基本目标并阐述系统结构设计和功能设计从软件工程的角度进行了科学而严谨的阐述。从职工信息的查询到管理实现了自动化的模式,从而提高了工作效率。职工管理是现代企业管理工作不可缺少的一部分,是推动企业走向科学化、规范化的必要条件。员工是企业生存的主要元素,员工的增减、变动将直接影响到企业的整体运作。员工越多,分工越细,联系越密切,所要做的统计工作就越多,人事管理的难度就越大。随着企业的不断壮大,自动化的企业人事管理系统就显得非常有必要。本系统是运用c#和SQL sever技术开发的一个企业人事管理系统。目录一、设计目的- 2 -二、需求分析- 3 -三、模块分析及设计- 4 -1、主界面- 4 -2.登陆界面- 5 -3.管理界面- 7 -4、导出world文档- 10 -四、数据库设计- 14 -1、E-R图- 14 -2、建立数据库(WIMS)- 15 -六、制作过程及要点- 21 -七、设计总结- 22 -八、参考资料- 23 -一、设计目的1、 通过设计达到熟练掌握.NET基本结构以及C#语言的基本知识和技能;2、 掌握ADO.NET数据库开发基本知识;3、 能够利用所学的基本知识和技能,进行简单数据库应用程序设计 4、 根据题目的要求,给出解决问题的方案,通过分析问题、分解问题来解决问题,最终达到熟练掌握C#语言的运用和Visual Studio2005工具的使用。二、需求分析基于其他企业人事管理软件的不足,要求制作一个全新的企业人事管理系统,通过该系统可以方便、快捷地对职工信息进行添加、修改及删除操作,并且可以在数据库中存储相应职工的照片。设计的职工管理系统必须具备以下几点功能:1、把职工的信息(包括姓名、性别、生日、学历、职务、住址、电话、性别、年龄、民族、婚姻、政治面貌、身份证号、入职日期、工龄、转正日期、部门、籍贯、照片、月薪、银行账号)输入并储存起来;(1)、联系信息姓名、性别、住址、部门、电话、手机(2)、个人信息工号、民族、生日、照片、年龄、学历、政治面貌、身份证号、银行账号(3)、状态婚姻、入职日期、工龄、职务、月薪2、具有职工信息查询和排序功能(可以按工号、姓名、年龄、民族性别等查找,查找到的信息以工号排序);3、能对职工信息进行修改;4、可以插入新的职工信息;5、可以任意删除一名职工的信息; 三、模块分析及设计 设计的各功能模块及代码1、主界面部门信息员工信息基本信息管理记事本计算器画图工具常用工具系统帮助联系管理员帮助public Main() InitializeComponent(); private void 部门信息查询ToolStripMenuItem_Click(object sender, EventArgs e) DepartInfo aed = new DepartInfo(); aed.Show(); MessageBox.Show(该模块正在维护中,给您带来的不便敬请谅解!,系统提示,MessageBoxButtons.OK,MessageBoxIcon.Information); aed.Close(); private void 员工信息查询ToolStripMenuItem_Click(object sender, EventArgs e) if(PerForm.Login.pope=1) EmpInfo empInfo = new EmpInfo(); empInfo.Show(); else Details de=new Details(); de.Show(); private void 记事本_Click(object sender, EventArgs e) System.Diagnostics.Process.Start(notepad.exe); private void 计算器_Click(object sender, EventArgs e) System.Diagnostics.Process.Start(calc.exe); private void 画图工具_Click(object sender, EventArgs e) System.Diagnostics.Process.Start(MSPaint.exe); private void toolStripButton3_Click(object sender, EventArgs e) System.Diagnostics.Process.Start(/index.htm); private void 系统帮助ToolStripMenuItem_Click(object sender, EventArgs e) PerForm.Help help = new WIMS_1.PerForm.Help(); help.Show(); private void 联系管理员ToolStripMenuItem_Click(object sender, EventArgs e) System.Diagnostics.Process.Start(/1209179402/infocenter); private void 关于ToolStripMenuItem_Click(object sender, EventArgs e) PerForm.About about = new WIMS_1.PerForm.About(); about.Show(); private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) this.Close(); 2.登陆界面用户通过填写自己的工号和密码可以进入主界面,当输入密码错误或填写信息不完整时系统会给出相应的错误提示。public static SqlDataReader temDR; private void button1_Click_1(object sender, EventArgs e) string connectionString = Data Source=.;Initial Catalog=WIMS;Integrated Security=True;/ server=localhost;database=WIMS;uid=sa;pwd=; SqlConnection mySqlConnection = new SqlConnection(connectionString); SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); string DeleteString = select * from tb_Login where ID= + textBox1.Text.Trim() + and pass= + textBox2.Text.Trim() + ; mySqlCommand.CommandText = DeleteString; mySqlConnection.Open(); temDR = mySqlCommand.ExecuteReader(); if (textBox1.Text != & textBox2.Text != ) bool ifcom = temDR.Read(); if (ifcom) id = textBox1.Text.Trim(); pope = Convert.ToInt32(temDRpope); Main main = new Main(); main.Show(); this.Hide(); else MessageBox.Show(用户名或密码错误!, 提示, MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Text = ; textBox2.Text = ; mySqlConnection.Close(); else MessageBox.Show(请将登录信息添写完整!, 提示, MessageBoxButtons.OK, MessageBoxIcon.Information); private void button2_Click(object sender, EventArgs e) this.Close(); Application.Exit(); 3.管理界面 (只有权限pope=1的用户才能对此模块进行操作,pope=0的用户只能显示自己的信息)修改职工信息插入职工信息删除职工信息显示,查询职工信息管理界面备注:按工号查询,按姓名查询,按性别查询,按部门查询,按民族查询,按政治面貌查询。 添加、修改模块代码:public partial class EmpInfo : Form public static string id ; public static object pic; public EmpInfo() InitializeComponent(); private void EmpInfo_Load(object sender, EventArgs e) / TODO: 这行代码将数据加载到表“wIMSDataSet.tb_Basic”中。您可以根据需要移动或移除它。 this.tb_BasicTableAdapter.Fill(this.wIMSDataSet.tb_Basic); private void button5_Click(object sender, EventArgs e)/添加 AddEditEmp addEditEmp = new AddEditEmp(); addEditEmp.Text = 添加职工信息; addEditEmp.Show(); private void button2_Click(object sender, EventArgs e)/编辑/修改 string strSql = select * from tb_Basic; string str = Data Source=.;Initial Catalog=WIMS;Integrated Security=True;/ server=localhost;database=WIMS;uid=sa;pwd=; SqlConnection conn = new SqlConnection(str); SqlDataAdapter da = new SqlDataAdapter(strSql, conn); DataSet ds = new DataSet(); da.Fill(ds, tb_Basic); conn.Close(); AddEditEmp addEditEmp = new AddEditEmp(); addEditEmp.Text = 编辑职工信息; addEditEmp.Show(); private void button6_Click(object sender, EventArgs e)/详细 Details details = new Details(); details.Show(); private void button4_Click(object sender, EventArgs e) this.Close(); private void button1_Click(object sender, EventArgs e)/查询 dataBind(); Sql = select * from tb_Basic order by ID; comboBox1.Text = keyWord.Text = ; string Sql; public void dataBind() select(); string str = Data Source=.;Initial Catalog=WIMS;Integrated Security=True;/ server=localhost;database=WIMS;uid=sa;pwd=; SqlConnection conn = new SqlConnection(str); SqlDataAdapter da = new SqlDataAdapter(Sql, conn); DataSet ds = new DataSet(); da.Fill(ds, tb_Basic); dataGridView1.DataSource = ds.Tablestb_Basic.DefaultView; conn.Close(); public void select() string s = keyWord.Text.Trim(); switch (boBox1.Text) case 显示全部记录: Sql = select * from tb_Basic order by ID; break; case 按工号查询: Sql = select * from tb_Basic where ID like + s + %; break; case 按姓名查询: Sql = select * from tb_Basic where name like % + s + %; break; case 按性别查询: Sql = select * from tb_Basic where sex = + s + ; break; case 按部门查询: Sql = select * from tb_Basic where branch =% + s + % order by ID; break; case 按民族查询: Sql = select * from tb_Basic where folk like % + s + % order by ID; break; case 按政治面貌查询: Sql = select * from tb_Basic where visage like % + s + % order by ID; break; private void button3_Click(object sender, EventArgs e)/删除 string str = Data Source=.;Initial Catalog=WIMS;Integrated Security=True; /server=localhost;database=WIMS;uid=sa;pwd=; SqlConnection conn = new SqlConnection(str); SqlDataAdapter da = new SqlDataAdapter(delete from tb_Basic where ID= + dataGridView1.CurrentRow.Cells0.Value.ToString() + , conn); DataSet ds = new DataSet(tb_Basic); da.Fill(ds, tb_Basic); conn.Close(); private void dataGridView1_SelectionChanged(object sender, EventArgs e)/获取选中行返回值 try id = this.dataGridView1.CurrentRow.Cells0.Value.ToString(); / pic = this.dataGridView1.CurrentRow.Cells17; catch (NullReferenceException) private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) if (comboBox1.Text = 显示全部记录) button1.Focus(); else keyWord.Focus(); private void keyWord_KeyPress(object sender, KeyPressEventArgs e) if (e.KeyChar=r) button1.Focus(); private void button7_Click(object sender, EventArgs e)/刷新页面 dataBind(); 4、导出world文档private void button2_Click_1(object sender, EventArgs e) object Nothing = System.Reflection.Missing.Value; object missing = System.Reflection.Missing.Value; /创建Word文档 Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.ApplicationClass(); Microsoft.Office.Interop.Word.Document wordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing); wordApp.Visible = true; /设置文档宽度 wordApp.Selection.PageSetup.LeftMargin = wordApp.CentimetersToPoints(float.Parse(2); wordApp.ActiveWindow.ActivePane.HorizontalPercentScrolled = 15; wordApp.Selection.PageSetup.RightMargin = wordApp.CentimetersToPoints(float.Parse(2); Object start = Type.Missing; Object end = Type.Missing; PictureBox pp = new PictureBox(); /新建一个PictureBox控件 int p1 = 0; try byte pic = (byte)(object)picEmployee.Image);/picEmployee.Image.Tag); /将数据库中的图片转换成二进制流 MemoryStream ms = new MemoryStream(pic);/将字节数组存入到二进制流中 pp.Image = Image.FromStream(ms); /二进制流Image控件中显示 pp.Image.Save(F:照片22.bmp); /将图片存入到指定的路径 catch p1 = 1; object rng = Type.Missing; string strInfo = 职工基本信息表 + ( + txtName.Text + ); start = 0; end = 0; wordDoc.Range(ref start, ref end).InsertBefore(strInfo); /插入文本 wordDoc.Range(ref start, ref end).Font.Name = Verdana; /设置字体 wordDoc.Range(ref start, ref end).Font.Size = 20; /设置字体大小 wordDoc.Range(ref start, ref end).ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter; /设置字体居中 start = strInfo.Length; end = strInfo.Length; wordDoc.Range(ref start, ref end).InsertParagraphAfter();/插入回车 object missingValue = Type.Missing; object location = strInfo.Length; /如果location超过已有字符的长度将会出错。一定要比明细表串多一个字符 Microsoft.Office.Interop.Word.Range rng2 = wordDoc.Range(ref location, ref location); wordDoc.Tables.Add(rng2, 11, 5, ref missingValue, ref missingValue); Microsoft.Office.Interop.Word.Table table = wordDoc.Tables1; object beforeRow = table.Rows1; table.Rows.Add(ref beforeRow); /单元格合并 Microsoft.Office.Interop.Word.Cell cell = table.Cell(1,1); cell.Merge(table.Cell(2,1); cell.Merge(table.Cell(3, 1); cell.Merge(table.Cell(4, 1); Microsoft.Office.Interop.Word.Cell cell2 = table.Cell(4, 3); cell2.Merge(table.Cell(4, 4); cell2.Merge(table.Cell(4, 4); /设置字体样式 table.Rows.HeightRule = Microsoft.Office.Interop.Word.WdRowHeightRule.wdRowHeightAtLeast; table.Rows.Height = wordApp.CentimetersToPoints(float.Parse(0.8); table.Range.Font.Size = 10; table.Range.Font.Name = 宋体; /设置表格样式 table.Range.Cells.Borders.InsideLineStyle= Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleSingle; wordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphRight;/设置右对齐 /插入图片 /if (p1 = 0) string FileName = Environment.CurrentDirectory.ToString() + img22.bmp;/图片所在路径 object LinkToFile = false; object SaveWithDocument = true; object Anchor =table.Cell(1, 1).Range; /指定图片插入的区域 /将图片插入到单元格中 table.Cell(1, 1).Range.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor); p1 = 0; table.Cell(1, 2).Range.Text = 工号; table.Cell(1, 3).Range.Text = txtID.Text; table.Cell(2,2 ).Range.Text=姓名; table.Cell(2,3 ).Range.Text=txtName.Text; table.Cell(3,2 ).Range.Text=电话; table.Cell(3,3 ).Range.Text=txtPhone.Text; table.Cell(4,2 ).Range.Text=住址; table.Cell(4,3).Range.Text=txtAddress.Text; table.Cell(1,4 ).Range.Text=部门; table.Cell(1,5 ).Range.Text=txtBranch.Text; table.Cell(2,4 ).Range.Text=性别; table.Cell(2,5 ).Range.Text=txtSex.Text; table.Cell(3,4 ).Range.Text=手机; table.Cell(3,5 ).Range.Text=txtHandset.Text; table.Cell(5,2 ).Range.Text=婚姻状况; table.Cell(5,3 ).Range.Text=txtMarr.Text; table.Cell(6,2 ).Range.Text=学历; table.Cell(6,3 ).Range.Text=txtKultur.Text; table.Cell(7,2 ).Range.Text=政治面貌; table.Cell(7,3 ).Range.Text=txtVisage.Text; table.Cell(8,2 ).Range.Text=职位; table.Cell(8,3 ).Range.Text=txtBusiness.Text; table.Cell(9,2 ).Range.Text=入职日期; table.Cell(9,3 ).Range.Text=txtWorkDate.Text; table.Cell(10,2 ).Range.Text=月薪; table.Cell(10,3).Range.Text=txtPay.Text; table.Cell(5,4 ).Range.Text=出生日期; table.Cell(5,5 ).Range.Text=txtBirthday.Text; table.Cell(6,4 ).Range.Text=年龄; table.Cell(6,5 ).Range.Text=txtAge.Text; table.Cell(7,4 ).Range.Text=民族; table.Cell(7,5 ).Range.Text=txtFolk.Text; table.Cell(8,4 ).Range.Text=身份证号; table.Cell(8,5 ).Range.Text=txtIdcard.Text; table.Cell(9,4 ).Range.Text=工龄; table.Cell(9,5 ).Range.Text=txtWorkLength.Text; table.Cell(10,4 ).Range.Text=银行账号; table.Cell(10, 5).Range.Text = txtBank.Text; wordDoc.Range(ref start, ref end).InsertParagraphAfter();/插入回车 wordDoc.Range(ref start, ref end).ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter; /设置字体居中 四、数据库设计1、E-R图本实例根据上面的设计规划出的实体有员工和部门。实体具体的描述E-R图如下:职工IDmarriagesexnamekultur
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 安徽省皖江名校联盟2025-2026学年高三上学期8月联考暨开学考 化学试卷(含答案)
- 抗洪电视摄像培训课件
- 2025年市政工程项目发展计划
- 抗5羟色胺课件
- 2025年哲学考研考试题目及答案
- 2025年会计实操考试试题及答案
- 2025年动物医学函授考试试题及答案
- 房产中介培训课件
- 慢性肾脏疾病课件
- 情景表演课件
- 合作代建合同协议书
- 送养协议书范本
- 三星手机市场定位、营销策略及消费者行为研究
- 中国石化考试题及答案
- 2025-2030中国抗癫痫药行业市场发展趋势与前景展望战略研究报告
- 香港佣金合同协议
- 水土保持试题多选及答案
- 八年级下册英语2025电子版人教版单词表
- DB32-T 5082-2025 建筑工程消防施工质量验收标准
- 幼儿园点点爱上幼儿园-(绘本)课件
- 《数字经济背景下企业财务管理的数字化转型》论文
评论
0/150
提交评论