职工信息管理系统.docx
- 文档编号:6023978
- 上传时间:2023-01-03
- 格式:DOCX
- 页数:22
- 大小:1,009.76KB
职工信息管理系统.docx
《职工信息管理系统.docx》由会员分享,可在线阅读,更多相关《职工信息管理系统.docx(22页珍藏版)》请在冰豆网上搜索。
职工信息管理系统
河南城建学院
《可视化编程技术》课程设计报告
题目:
职工信息管理系统
******
学号:
*********
班级:
0614081班
指导老师:
张娜张妍琰
专业:
计算机科学与技术
2011年2月21日-24日
前言
在当今社会,互联网空的发展,给人们的工作和生活带来了极大的便利和高效,信息化,电子化已经成为节约运营成本,提高工作效率的首选。
当前大量企业的员工管理尚处于手工作业阶段,不但效率低下,还常常因为管理的不慎而出现纰漏。
因此部分企业需求,设计企业员工信息管理系统,以帮助企业达到员工管理办公自动化、节约管理成本、提高企业工作效率的目的。
随着计算机的飞速发展,它的应用已经十分广泛,它在人们的生产、生活、工作和学习中发挥着重要的作用。
例如一个现代化的公司,拥有数千名的员工,那么如何管理这么庞大的职工信息档案呢?
这时,开发一个功能完善的职工信息管理系统就必不可少了。
本系统在.net框架下采用“自上而下地总体规划,自下而上地应用开发”的策略开发,提出了实现职工信息、部门信息查询、管理、更新的基本目标并阐述系统结构设计和功能设计从软件工程的角度进行了科学而严谨的阐述。
从职工信息的查询到管理实现了自动化的模式,从而提高了工作效率。
职工管理是现代企业管理工作不可缺少的一部分,是推动企业走向科学化、规范化的必要条件。
员工是企业生存的主要元素,员工的增减、变动将直接影响到企业的整体运作。
员工越多,分工越细,联系越密切,所要做的统计工作就越多,人事管理的难度就越大。
随着企业的不断壮大,自动化的企业人事管理系统就显得非常有必要。
本系统是运用c#和SQLsever技术开发的一个企业人事管理系统。
一、设计目的
1、通过设计达到熟练掌握.NET基本结构以及C#语言的基本知识和技能;
2、掌握ADO.NET数据库开发基本知识;
3、能够利用所学的基本知识和技能,进行简单数据库应用程序设计
4、根据题目的要求,给出解决问题的方案,通过分析问题、分解问题来解决问题,最终达到熟练掌握C#语言的运用和VisualStudio2005工具的使用。
二、需求分析
基于其他企业人事管理软件的不足,要求制作一个全新的企业人事管理系统,通过该系统可以方便、快捷地对职工信息进行添加、修改及删除操作,并且可以在数据库中存储相应职工的照片。
设计的职工管理系统必须具备以下几点功能:
1、把职工的信息(包括姓名、性别、生日、学历、职务、住址、电话、性别、年龄、民族、婚姻、政治面貌、身份证号、入职日期、工龄、转正日期、部门、籍贯、照片、月薪、银行账号)输入并储存起来;
(1)、联系信息
姓名、性别、住址、部门、电话、手机
(2)、个人信息
工号、民族、生日、照片、年龄、学历、政治面貌、身份证号、银行账号
(3)、状态
婚姻、入职日期、工龄、职务、月薪
2、具有职工信息查询和排序功能(可以按工号、姓名、年龄、民族性别等查找,查找到的信息以工号排序);
3、能对职工信息进行修改;
4、可以插入新的职工信息;
5、可以任意删除一名职工的信息;
三、模块分析及设计
设计的各功能模块及代码
1、主界面
publicMain()
{InitializeComponent();}
privatevoid部门信息查询ToolStripMenuItem_Click(objectsender,EventArgse)
{DepartInfoaed=newDepartInfo();
aed.Show();
MessageBox.Show("该模块正在维护中,给您带来的不便敬请谅解!
","系统提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
aed.Close();
}
privatevoid员工信息查询ToolStripMenuItem_Click(objectsender,EventArgse)
{if(PerForm.Login.pope==1)
{
EmpInfoempInfo=newEmpInfo();
empInfo.Show();
}
else
{Detailsde=newDetails();de.Show();}
}
privatevoid记事本_Click(objectsender,EventArgse)
{System.Diagnostics.Process.Start(@"notepad.exe");}
privatevoid计算器_Click(objectsender,EventArgse){System.Diagnostics.Process.Start(@"calc.exe");}
privatevoid画图工具_Click(objectsender,EventArgse){System.Diagnostics.Process.Start(@"MSPaint.exe");}
privatevoidtoolStripButton3_Click(objectsender,EventArgse){
System.Diagnostics.Process.Start(@"
}
privatevoid系统帮助ToolStripMenuItem_Click(objectsender,EventArgse){
PerForm.Helphelp=newWIMS_1.PerForm.Help();
help.Show();
}
privatevoid联系管理员ToolStripMenuItem_Click(objectsender,EventArgse)
{
System.Diagnostics.Process.Start(@"
}
privatevoid关于ToolStripMenuItem_Click(objectsender,EventArgse){
PerForm.Aboutabout=newWIMS_1.PerForm.About();
about.Show();
}
privatevoid退出ToolStripMenuItem_Click(objectsender,EventArgse){this.Close();}
2.登陆界面
用户通过填写自己的工号和密码可以进入主界面,当输入密码错误或填写信息不完整时系统会给出相应的错误提示。
publicstaticSqlDataReadertemDR;
privatevoidbutton1_Click_1(objectsender,EventArgse)
{
stringconnectionString=@"DataSource=.;InitialCatalog=WIMS;IntegratedSecurity=True";//@"server=localhost;database=WIMS;uid=sa;pwd=";
SqlConnectionmySqlConnection=newSqlConnection(connectionString);
SqlCommandmySqlCommand=mySqlConnection.CreateCommand();
stringDeleteString="select*fromtb_LoginwhereID='"+textBox1.Text.Trim()+"'andpass='"+textBox2.Text.Trim()+"'";
mySqlCommand.CommandText=DeleteString;
mySqlConnection.Open();
temDR=mySqlCommand.ExecuteReader();
if(textBox1.Text!
=""&&textBox2.Text!
="")
{
boolifcom=temDR.Read();
if(ifcom)
{
id=textBox1.Text.Trim();
pope=Convert.ToInt32(temDR["pope"]);
Mainmain=newMain();
main.Show();
this.Hide();
}
else{
MessageBox.Show("用户名或密码错误!
","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
textBox1.Text="";
textBox2.Text="";
}
mySqlConnection.Close();
}
else
MessageBox.Show("请将登录信息添写完整!
","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
privatevoidbutton2_Click(objectsender,EventArgse){this.Close();
Application.Exit();
}
3.管理界面
(只有权限pope==1的用户才能对此模块进行操作,pope==0的用户只能显示自己的信息)
备注:
按工号查询,按姓名查询,按性别查询,按部门查询,按民族查询,按政治面貌查询。
添加、修改模块代码:
publicpartialclassEmpInfo:
Form
{
publicstaticstringid;
publicstaticobjectpic;
publicEmpInfo()
{
InitializeComponent();
}
privatevoidEmpInfo_Load(objectsender,EventArgse)
{
//TODO:
这行代码将数据加载到表“wIMSDataSet.tb_Basic”中。
您可以根据需要移动或移除它。
this.tb_BasicTableAdapter.Fill(this.wIMSDataSet.tb_Basic);
}
privatevoidbutton5_Click(objectsender,EventArgse)//添加
{
AddEditEmpaddEditEmp=newAddEditEmp();
addEditEmp.Text="添加职工信息";
addEditEmp.Show();
}
privatevoidbutton2_Click(objectsender,EventArgse)//编辑/修改
{
stringstrSql="select*fromtb_Basic";
stringstr=@"DataSource=.;InitialCatalog=WIMS;IntegratedSecurity=True";//@"server=localhost;database=WIMS;uid=sa;pwd=";
SqlConnectionconn=newSqlConnection(str);
SqlDataAdapterda=newSqlDataAdapter(strSql,conn);
DataSetds=newDataSet();
da.Fill(ds,"tb_Basic");
conn.Close();
AddEditEmpaddEditEmp=newAddEditEmp();
addEditEmp.Text="编辑职工信息";
addEditEmp.Show();
}
privatevoidbutton6_Click(objectsender,EventArgse)//详细
{
Detailsdetails=newDetails();
details.Show();
}
privatevoidbutton4_Click(objectsender,EventArgse)
{
this.Close();
}
privatevoidbutton1_Click(objectsender,EventArgse)//查询
{
dataBind();
Sql="select*fromtb_BasicorderbyID";
comboBox1.Text=keyWord.Text="";
}
stringSql;
publicvoiddataBind()
{
select();
stringstr=@"DataSource=.;InitialCatalog=WIMS;IntegratedSecurity=True";//@"server=localhost;database=WIMS;uid=sa;pwd=";
SqlConnectionconn=newSqlConnection(str);
SqlDataAdapterda=newSqlDataAdapter(Sql,conn);
DataSetds=newDataSet();
da.Fill(ds,"tb_Basic");
dataGridView1.DataSource=ds.Tables["tb_Basic"].DefaultView;
conn.Close();
}
publicvoidselect()
{
strings=keyWord.Text.Trim();
switch(boBox1.Text)
{
case"显示全部记录":
Sql="select*fromtb_BasicorderbyID";break;
case"按工号查询":
Sql="select*fromtb_BasicwhereIDlike'"+s+"%'";break;
case"按姓名查询":
Sql="select*fromtb_Basicwherenamelike'%"+s+"%'";break;
case"按性别查询":
Sql="select*fromtb_Basicwheresex='"+s+"'";break;
case"按部门查询":
Sql="select*fromtb_Basicwherebranch='%"+s+"%'orderbyID";break;
case"按民族查询":
Sql="select*fromtb_Basicwherefolklike'%"+s+"%'orderbyID";break;
case"按政治面貌查询":
Sql="select*fromtb_Basicwherevisagelike'%"+s+"%'orderbyID";break;
}
}
privatevoidbutton3_Click(objectsender,EventArgse)//删除
{
stringstr=@"DataSource=.;InitialCatalog=WIMS;IntegratedSecurity=True";//@"server=localhost;database=WIMS;uid=sa;pwd=";
SqlConnectionconn=newSqlConnection(str);
SqlDataAdapterda=newSqlDataAdapter("deletefromtb_BasicwhereID='"+dataGridView1.CurrentRow.Cells[0].Value.ToString()+"'",conn);
DataSetds=newDataSet("tb_Basic");
da.Fill(ds,"tb_Basic");
conn.Close();
}
privatevoiddataGridView1_SelectionChanged(objectsender,EventArgse)//获取选中行返回值
{
try
{
id=this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
//pic=this.dataGridView1.CurrentRow.Cells[17];
}
catch(NullReferenceException){}
}
privatevoidcomboBox1_KeyPress(objectsender,KeyPressEventArgse)
{
if(comboBox1.Text=="显示全部记录")
button1.Focus();
else
keyWord.Focus();
}
privatevoidkeyWord_KeyPress(objectsender,KeyPressEventArgse)
{
if(e.KeyChar=='\r')
button1.Focus();
}
privatevoidbutton7_Click(objectsender,EventArgse)//刷新页面
{
dataBind();
}
}
4、导出world文档
privatevoidbutton2_Click_1(objectsender,EventArgse){
objectNothing=System.Reflection.Missing.Value;
objectmissing=System.Reflection.Missing.Value;
//创建Word文档
Microsoft.Office.Interop.Word.ApplicationwordApp=newMicrosoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word.DocumentwordDoc=wordApp.Documents.Add(refNothing,refNothing,refNothing,refNothing);
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"));
Objectstart=Type.Missing;
Objectend=Type.Missing;
PictureBoxpp=newPictureBox();//新建一个PictureBox控件
intp1=0;
try
{
byte[]pic=(byte[])((object)picEmployee.Image);//picEmployee.Image.Tag);//将数据库中的图片转换成二进制流
MemoryStreamms=newMemoryStream(pic);//将字节数组存入到二进制流中
pp.Image=Image.FromStream(ms);//二进制流Image控件中显示
pp.Image.Save(@"F:
\照片\22.bmp");//将图片存入到指定的路径
}
catch
{
p1=1;
}
objectrng=Type.Missing;
stringstrInfo="职工基本信息表"+"("+txtName.Text+")";
start=0;
end=0;
wordDoc.Range(refstart,refend).InsertBefore(strInfo);//插入文本
wordDoc.Range(refstart,refend).Font.Name="Verdana";//设置字体
wordDoc.Range(refstart,refend).Font.Size=20;//设置字体大小
wordDoc.Range(refstart,refend).ParagraphFormat.Alignment=Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;//设置字体居中
start=strInfo.Length;
end=strInfo.Length;
wordDoc.Range(refstart,refend).InsertParagraphAfter();//插入回车
objectmissingValue=Type.Missing;
objectlocation=strInfo.Length;//如果location超过已有字符的长度将会出错。
一定要比"明细表"串多一个字符
Microsoft.Office.Interop.Word.Rangerng2=wordDoc.Range(reflocation,reflocation);
wordDoc.Tables.Add(rng2,11,5,refmissingValue,refmissingValue);
Microsoft.Office.Interop.Word.Tabletable=wordDoc.Tables[1];
objectbeforeRow=table.Rows[1];
table.Rows.Add
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 职工 信息管理 系统
![提示](https://static.bdocx.com/images/bang_tan.gif)