人事工资管理系统设计.docx

上传人:b****8 文档编号:10718064 上传时间:2023-02-22 格式:DOCX 页数:35 大小:91.81KB
下载 相关 举报
人事工资管理系统设计.docx_第1页
第1页 / 共35页
人事工资管理系统设计.docx_第2页
第2页 / 共35页
人事工资管理系统设计.docx_第3页
第3页 / 共35页
人事工资管理系统设计.docx_第4页
第4页 / 共35页
人事工资管理系统设计.docx_第5页
第5页 / 共35页
点击查看更多>>
下载资源
资源描述

人事工资管理系统设计.docx

《人事工资管理系统设计.docx》由会员分享,可在线阅读,更多相关《人事工资管理系统设计.docx(35页珍藏版)》请在冰豆网上搜索。

人事工资管理系统设计.docx

人事工资管理系统设计

*************

人事工资管理系统

09地理信息系统

1.开发背景

企业在发展中不断地壮大,员工也随之增加。

对于人事管理部门来说,迫切地需要一个操作方便、功能简单实用,可以满足企业对员工的档案及工资信息进行管理系统。

在企业选择人事工资管理系统时,主要存在以下几个方面的要求:

(1)对企业员工的档案进行管理

(2)系统的功能要符合本企业的基本情况

(3)系统的功能操作要简单、实用、操作方便,不要出现复杂的操作。

(4)可以方便地对工资信息进行打印。

2.需求分析

通过实际调查,要求本系统具有以下功能:

良好的人机界面。

方便的添加和修改数据功能。

方便的数据查询功能。

方便的数据打印功能。

在相应的窗体中,可方便地删除数据。

3.系统设计

1•系统目标

(1)界面友好、操作方便

(2)可以对员工档案进行管理,包括增、删、改、查。

(3)实现奖罚管理。

(4)可以使用操作员管理修改口令和更改操作员。

(5)系统运行稳定、安全可靠。

2•系统预览

 

 

■轉-*

7T

 

』i^二小;■二■八矿忑竺氐二二Lr

4^-4K^^S393333ti

眄■»M

•工■■

anif

TWiU

zaiin

srtq.imijidfiVH工目即tJKv■><坐•璋卜mi屮刖测峯呻“炽■■w

_扌工備丄ij「了_罚二口

-4-

>fcr.na

-IX3DBJ-xs-xn+lPMXB>rBIXL-XsXnILILl-i4环劑30L血3OL3L3OLJJL机

«I«J*I卿刑A卜丄

£虫&W*亍一

n>j£»

Utt;

j

3•业务流程图

人事工资管理系统的业务流程如图:

 

4.数据库概念设计

应用程序开发过程中,对数据库的操作时必不可少的,数据库设计师根据程序的需求及其实现功能所制定的,数据库设计得是否合理将直接影响程序的开发进程。

(1)数据库设计在系统开发中占有非常重要的比重,它是通过管理系统的整体需求而制定的,数据库设计的好坏直接影响到系统的后期开发。

下面对本系统中具有代表性的数据库设计做详细说明。

在本系统中,为了提高系统的安全性,每一个用户都要使用正确的用户名和密码才能进入主窗体,而且还需要根据指定的用户名提供相应的权限,为了能够验证正确的用户名和密码得到相应的权限,应在数据库中创建登录表。

登录用户信息表的实体E-R图:

员工档案信息表的实体E-R图:

|员工铲Vife佶亦衣F

员工工资信息表的实体E-R图:

:

灵H伽竜>

Ct離h诲二n_厂头发工盏

(2)数据库逻辑结构设计

根据上面设计好的E-R图,可以在数据库中创建相应的数据表

db_User(登录表)

字段名

数据类型

长度

主键

用户编号

Int

4

UserName

varchar

20

UserPwd

varchar

15

权限

varchar

10

強表中的Sfcffi-位置是-db_PISw

中、u(local!

用户编号

权限

LLJ

超级用户

超级用户

~3

趟级用户

_4

-般用户

~5

一般用户

6

-般用户

_7

一般用户

 

dbemployee(员工档案信息表)

字段名

数据类型

长度

主键

员工编号

Int

4

Char

10

性别

Char

10

年龄

Int

4

民族

Varchar

10

职务

Char

10

dbpay(员工工资信息表)

字段名

数据类型

长度

主键

员工编号

Int

4

工资月份

Varchar

50

基本工资

decimal

9

职务津贴

decimal

9

奖励金额

decimal

9

罚款金额

decimal

9

应发工资

decimal

9

实发工资

decimal

9

四.公共类设计

项目开发过程中,通常会以类的形式来组织、封装一些常用的方法和事件,这样做不仅可以提高代码的重用率,也大大方便了用户对代码的管理。

在本系统中,主要建立了两个公共类,分别为

DBConnection类和DBOperate类。

DBConnection类主要用于连接数据库;在DBOperate类中则定义了一些操作数据库的公用方法,分别用于实现各种功能,下面详细介绍这两个类。

1.DBConnection公共类

DBConnection类是数据库连接类,此类主要用于连接SQLServer数据库,在连接数据库时,只需调用此类中的MYConnection即可,其实现代码如下:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Data.SqlClient;namespacePMSClass

{

classDBConnetion

{

publicstaticSqlConnectionMYConnection()

{returnnewSqlConnection("server=.;database=db_PMS;user=sa;pwd=123");}

}

}

2.DBOperate公共类

DBOperate类中建立了多个方法用于执行不同的SQL语句

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlClient;

usingSystem.Data;namespaceWindowsFormsApplication1

{

classDBOperate

{

SqlConnectionconn=PMSClass.DBConnetion.MYConnection();

publicintOperateData(stringstrSql)

{

conn.Open();

SqlCommandcmd=newSqlCommand(strSql,conn);

inti=(int)cmd.ExecuteNonQuery();

conn.Close();

returni;

}

publicDataSetgettable(stringsql)

{

DataSetds=newDataSet();

SqlDataAdaptersda=newSqlDataAdapter(sql,conn);sda.Fill(ds);

ds.Dispose();

returnds;

}

publicvoidBindDataGridView(DataGridViewdgv,stringsql){

DataSetds=newDataSet();

SqlDataAdaptersda=newSqlDataAdapter(sql,conn);sda.Fill(ds);

dgv.DataSource=ds.Tables[0];ds.Dispose();

}

}

}下面对该类中的方法进行讲解

(1)OperateData()方法用于对数据库执行SQL语句

publicintOperateData(stringstrSql)

{conn.Open();

SqlCommandcmd=newSqlCommand(strSql,conn);inti=(int)cmd.ExecuteNonQuery();

conn.Close();returni;

}

(2)gettable()方法用于根据指定的SQL查询语句返回相应的dataset对象

publicDataSetgettable(stringsql)

{

DataSetds=newDataSet();

SqlDataAdaptersda=newSqlDataAdapter(sql,conn);sda.Fill(ds);

ds.Dispose();returnds;

}

(3)BindDataGridView()方法用于将数据库中的数据绑定到datagridview控件publicvoidBindDataGridView(DataGridViewdgv,stringsql)

{

DataSetds=newDataSet();

SqlDataAdaptersda=newSqlDataAdapter(sql,conn);sda.Fill(ds);

dgv.DataSource=ds.Tables[0];ds.Dispose();

}

五.登录模块设计

Fix

用户容

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlClient;

namespaceWindowsFormsApplication1

{

publicpartialclassForm1:

Form

{

publicForm1()

{

InitializeComponent();

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

try

{

if(textBox1.Text==""||textBox2.Text=="")

{MessageBox.Show(”用户名或密码不能为空!

","提示",MessageBoxButtons.OK,

MessageBoxIcon」nformation);return;}

else

{

SqlConnectionconn=PMSClass.DBConnetion.MYConnection();

conn.Open();

strings="select*fromdb_UserwhereUserName='"+

textBox1.Text.ToString().Trim()+"'andUserPwd='"+textBox2.Text.Trim()+""';

SqlCommandcmd=newSqlCommand(s,conn);

SqlDataReadersdr=cmd.ExecuteReader();

sdr.Read();

if(sdr.HasRows){this.Hide();conn.Close();Form2main=newForm2();main.User=textBox1.Text.ToString().Trim();main.Show();

}

else

{

textBox1.Text="";

textBox2.Text="";

MessageBox.Show(”用户名或密码错误!

",”提示",MessageBoxButtons.OK,

MessageBoxIcon.Information);

}

}

}

catch(Exceptionex)

{

MessageBox.Show(ex.Message);

}

}

privatevoidbutton2_Click(objectsender,EventArgse)

{

this.Close();

}

}

}

在登录窗体中,单击登录按钮,程序调用DBConnection类中的MYCconnection()方法连接数据库,然后通过sqldatareader对象的hasrows属性判断用户输入的用户名和密码是否正确,如果正确,则登录系统,并将用户名传到下个窗体中,否则,弹出用户名或密码错误信息提示,登录按钮事件代码如下:

privatevoidbutton1_Click(objectsender,EventArgse)

{

try

{

if(textBox1.Text==""||textBox2.Text=="")

{MessageBox.Show(”用户名或密码不能为空!

","提示",MessageBoxButtons.OK,

MessageBoxIcon.Information);return;}

else

{

SqlConnectionconn=PMSClass.DBConnetion.MYConnection();conn.Open();

strings="select*fromdb_UserwhereUserName="'+

textBoxl.Text.ToString().Trim()+"'andUserPwd='"+textBox2.Text.Trim()+""';

SqlCommandcmd=newSqlCommand(s,conn);

SqlDataReadersdr=cmd.ExecuteReader();

sdr.Read();

if(sdr.HasRows)

{

this.Hide();

conn.Close();

Form2main=newForm2();

main.User=textBox1.Text.ToString().Trim();

main.Show();

}

else

{

textBox1.Text="";

textBox2.Text="";

MessageBox.Show(”用户名或密码错误!

",”提示",MessageBoxButtons.OK,

MessageBoxIcon」nformation);

}

}

}

catch(Exceptionex)

{

MessageBox.Show(ex.Message);

}

r-ts

弭23

UH

|E

宝£2

3

4

TA

5

11

A.

|r

TA

}

六.员工信息模块设计

m

遲岀

ffl员匸信息

貝工漏号

甥」

■IM

0(

3

20

空剧

4

IA

&

IA

6

工人

r

22.

工人

即犬3

退出

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlClient;

namespaceWindowsFormsApplication1{

publicpartialclassForm2:

Form

{

publicForm2()

{

InitializeComponent();

}

publicstringUser;

DBOperateoperate=newDBOperate();

privatevoidForm2_Load(objectsender,EventArgse)

{

IITODO:

这行代码将数据加载到表"db_PMSDataSet.db_employee”中。

您可以根据

需要移动或移除它。

this.db_employeeTableAdapter.Fill(this.db_PMSDataSet.db_employee);stringsql="select*fromdb_UserwhereUserName='"+User+""';DataSetds=operate.gettable(sql);

stringpower=ds.Tables[0].Rows[0][3].ToString();if(power=="一般用户")

{button2.Hide();}

privatevoidbutton1_Click(objectsender.EventArgse){

Form3f3=newForm3();

f3.User=User;

f3.Show();

}

privatevoidbutton3_Click(objectsender,EventArgse){

this.Close();

}

privatevoidbutton2_Click(objectsender,EventArgse){

Form4f4=newForm4();

f4.User=User;

f4.Show();

}

privatevoidbutton4_Click(objectsender,EventArgse){

stringsql="select*fromdb_employee";operate.BindDataGridView(dataGridView1,sql);

}

}

}

根据员工登录名的不同,分给员工不同的权限,如果只是工人那只能查看工资信息如果你是监制那么可以修改员工的信息及打入工资

编辑模块设计

七.

乘I

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

usingSystem.Data.SqlClient;

namespaceWindowsFormsApplication1

{

publicpartialclassForm4:

Form

{

publicForm4()

{

InitializeComponent();

}

publicstringUser;

DBOperatedbop=newDBOperate();

SqlConnectionconn=PMSClass.DBConnetion.MYConnection();

privatevoidForm4_Load(objectsender,EventArgse)

{

IITODO:

这行代码将数据加载到表"db_PMSDataSet1.db_employee”中。

您可以根据需要移动或移除它。

this.db_employeeTableAdapter.Fill(this.db_PMSDataSet1.db_employee);

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

if(textBoxI.Text=="")

{

MessageBox.Show("请输入","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);

}

else

{

conn.Open();

strings="select*fromdb_employeewhere='"+textBox1.Text.ToString().Trim()+

nin.

j

SqlCommandcmd=newSqlCommand(s,conn);

SqlDataReadersdr=cmd.ExecuteReader();

sdr.Read();

if(sdr.HasRows)

{

stringsql="select*fromdb_employeewhere='"+textBox1.Text.ToString().Trim()+"'";

dbop.BindDataGridView(dataGridView1,sql);

textBox2.Text=Convert.ToString(dataGridView1[0,dataGridView1.CurrentCell.RowIndex].Value);

textBox3.Text=Convert.ToString(dataGridView1[1,dataGridView1.CurrentCell.RowIndex].Value);

textBox4.Text=Convert.ToString(dataGridView1[2,dataGridView1.CurrentCell.RowIndex].Value);

textBox5.Text=Convert.ToString(dataGridView1[3,dataGridView1.CurrentCell.RowIndex].Value);

textBox6.Text=Convert.ToString(dataGridView1[4,dataGridView1.Cur

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育 > 唐诗宋词

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

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