职工信息管理系统文档格式.docx

上传人:b****5 文档编号:19019183 上传时间:2023-01-03 格式:DOCX 页数:22 大小:1,009.76KB
下载 相关 举报
职工信息管理系统文档格式.docx_第1页
第1页 / 共22页
职工信息管理系统文档格式.docx_第2页
第2页 / 共22页
职工信息管理系统文档格式.docx_第3页
第3页 / 共22页
职工信息管理系统文档格式.docx_第4页
第4页 / 共22页
职工信息管理系统文档格式.docx_第5页
第5页 / 共22页
点击查看更多>>
下载资源
资源描述

职工信息管理系统文档格式.docx

《职工信息管理系统文档格式.docx》由会员分享,可在线阅读,更多相关《职工信息管理系统文档格式.docx(22页珍藏版)》请在冰豆网上搜索。

职工信息管理系统文档格式.docx

一、设计目的

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)

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{

用户名或密码错误!

"

提示"

MessageBoxButtons.OK,MessageBoxIcon.Information);

textBox1.Text="

textBox2.Text="

mySqlConnection.Close();

请将登录信息添写完整!

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=@"

SqlConnectionconn=newSqlConnection(str);

SqlDataAdapterda=newSqlDataAdapter(strSql,conn);

DataSetds=newDataSet();

da.Fill(ds,"

tb_Basic"

conn.Close();

编辑职工信息"

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();

SqlDataAdapterda=newSqlDataAdapter(Sql,conn);

dataGridView1.DataSource=ds.Tables["

].DefaultView;

publicvoidselect()

strings=keyWord.Text.Trim();

switch(boBox1.Text)

case"

显示全部记录"

:

break;

按工号查询"

select*fromtb_BasicwhereIDlike'

+s+"

%'

按姓名查询"

select*fromtb_Basicwherenamelike'

%"

按性别查询"

select*fromtb_Basicwheresex='

按部门查询"

select*fromtb_Basicwherebranch='

orderbyID"

按民族查询"

select*fromtb_Basicwherefolklike'

按政治面貌查询"

select*fromtb_Basicwherevisagelike'

privatevoidbutton3_Click(objectsender,EventArgse)//删除

//@"

SqlDataAdapterda=newSqlDataAdapter("

deletefromtb_BasicwhereID='

+dataGridView1.CurrentRow.Cells[0].Value.ToString()+"

conn);

DataSetds=newDataSet("

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();

keyWord.Focus();

privatevoidkeyWord_KeyPress(objectsender,KeyPressEventArgse)

if(e.KeyChar=='

\r'

privatevoidbutton7_Click(objectsender,EventArgse)//刷新页面

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("

Objectstart=Type.Missing;

Objectend=Type.Missing;

PictureBoxpp=newPictureBox();

//新建一个PictureBox控件

intp1=0;

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模板 > 国外设计风格

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1