1、系统管理模块:对人事工资管理系统的维护、升级和对用户的管理:用户信息添加、用户信息修改、用户信息删除和用户权限分配。2、 参与者列表 人事部门:对员工信息的管理,包括对员工信息的输入、查询、修改。对于转出、辞职、辞退、退休员工信息的删除。对人事调动的管理,包括对员工岗位和部门的查询与修改。财务部门:根据员工的考勤和工作评价,完成工资的核算并发放工资。系统管理员:员工: 系统的主要使用者,登陆系统后,对自己的基本信息的查询和对自己工资的查询。考勤部门:对员工的出勤情况进行记录,对员工的工作进行评价。3、用例图 图1 财务部门用例 图2 人事部门用例图6 人事工资管理系统用例图一、 分析1、 类图
2、2、 状态图图1 系统状态图3、活动图 图1 用户注册活动图图2 登录活动图 图3员工信息查询活动图图4 对员工信息删除、添加、修改的活动图图5 考勤管理活动图4、顺序图 图1 用户注册顺序图 图2 登录顺序图图3 添加员工信息顺序图图4 人事调动顺序图图5 考勤管理顺序图5、协作图 图1 用户注册协作图图2 登录协作图图3 添加员工信息协作图图4 考勤管理协作图三、设计1、流程图2、实体E-R图3、数据字典(1)、员工档案信息表:PERSONNEL.DBF字段 字段名类型 宽度说明 1 员工号字符型3数字 2员工姓名10小于等于5个汉字 3员工性别 2“男”或“女” 4 员工学历 5 婚姻状
3、况4“已婚”或“未婚” 6 工 龄数值型199之间7 岗位编号 8 部门编号(2)、工资设置表:COURSE.DBF字段名宽度1员工号工资年月20_年_月_日应发工资51-99999之间奖励金额 1-9999之间扣除工资 19999之间6实发工资(3)、岗位设置表:RANK.DBF岗位编号岗位名称14小于等于7个汉字部门编号(4)、部门设置表:APARTMENT.DBF 1-99之间部门名称 部门负责人部门人数19999之间(5)、考勤设置表:KAOQIN.DBF正常出勤天数1999之间异常出勤天数加班天数评价情况优秀、良好、中等、差4、数据库E-R图四、实现1、源代码(1)登录界面代码设计本
4、代码实现Form1,作用是对登录用户审核,将登录用户信息与数据库中用户表相比对,存在此用户且信息正确则进入,否则登录失败。using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.OleDb;namespace 工资管理系统 public partial class F
5、orm1 : Form public static string password; public static string username; public Form1() InitializeComponent(); public int CheckUsers()/连接数据库进行查询 username = textBox1.Text.ToString(); password = textBox2.Text.ToString(); string Afile = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:UserslenovoDesktop
6、C#db.mdb;Persist Security Info=True; /access文件 OleDbConnection AconnStr = new OleDbConnection(Afile); OleDbCommand Acmd=new OleDbCommand(select * from user where userName=+username+ and password=+password+,AconnStr); OleDbDataReader odr=null; AconnStr.Open(); try odr=Acmd.ExecuteReader(); catch (Exc
7、eption ex) if (ex != null) return 0; while (odr.Read() return 1; odr.Close(); AconnStr.Close(); return 0; private void button1_Click(object sender, EventArgs e) /对登录信息进行审核,正确则进入,否则登录失败 if(textBox1.Text=|textBox2.Text=) MessageBox.Show(请输入信息,信息提示); else if (CheckUsers()=1) this.Hide(); Form6 form6 =
8、new Form6(); form6.Show(); else你输入的用户名或口令不正确! private void button2_Click(object sender, EventArgs e) textBox1.Text = textBox2.Text = (2)员工信息更新界面本代码实现Form3,作用是对员工信息进行更新,可以员工信息作查找,添加,删除,修改等操作,还可以查询工资信息,并能计算总工资。 public partial class Form3 : public static int string1, string2, string3, day; public Form3
9、() private void Form3_Load(object sender, EventArgs e) loadUsers(); private void loadUsers() /连接数据库 string connectionString = /access文件连接 string OleDbString = select * from MessageOleDbConnection connection = new OleDbConnection(connectionString); DataSet ds = new DataSet(); connection.Open(); OleDb
10、DataAdapter command = new OleDbDataAdapter(OleDbString, connection); command.Fill(ds, Message catch (OleDbException ex) throw new Exception(ex.Message); /将表绑定到dataGridView1控件 this.dataGridView1.DataSource = ds.Tables0; this.dataGridView1.Columns0.ReadOnly = true;/先0列,即用户名列为关键定不许修改 connection.Close()
11、; private void pictureBox1_Click(object sender, EventArgs e) private void btnDelete_Click(object sender, EventArgs e) string SQLString = delete from Message where sno= + this.dataGridView1.CurrentRow.CellsSno.Value+ OleDbConnection connection = new OleDbConnection(connectionString); OleDbCommand com
12、mand = new OleDbCommand(SQLString, connection); if (command.ExecuteNonQuery()=1)删除成功! if (connection != null) private void Addbutton_Click(object sender, EventArgs e) /连接数据库实现添加操作。 if (textBox1.Text = | textBox2.Text = 请输入要添加的信息!, 提示信息insert into Message(Sno,员工姓名) values( + this.textBox2.Text + , +
13、this.textBox1.Text + ) if (command.ExecuteNonQuery() = 1)添加成功! private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) /当前修改过的值 string updateValue = dataGridView1.Rowse.RowIndex.Cellse.ColumnIndex.Value.ToString(); /当前修改行的用户名(关键字) string username = dataGridView1.Rowse.RowI
14、ndex.Cells.Value.ToString(); string colName = dataGridView1.Columnse.ColumnIndex.Name;/修改值对应的列名update Message set + colName + = + updateValue + where Sno= + username + OleDbCommand command = new OleDbCommand(OleDbString, connection); private void button4_Click(object sender, EventArgs e) /实现操作信息 if
15、(MessageBox.Show(确定退出?确认信息, MessageBoxButtons.YesNo) = DialogResult.Yes) Application.Exit(); private void button5_Click(object sender, EventArgs e) Form4 form4 = new Form4(); form4.Show();更新成功请输入要查找的信息!string OleDbString = select * from Message where Sno= private void Form3_FormClosing(object sender
16、, FormClosingEventArgs e) public string Findstring1() OleDbCommand Acmd = new OleDbCommand(select 基本工资 from Message,工资 where Sno=+ textBox2.Text + and Message.员工工种=工资.员工工种 and Message.工资等级=工资.工资等级, AconnStr); OleDbDataReader odr = null; odr = Acmd.ExecuteReader();= null) return null; if (odr ! return odr0.ToString(); return null; public string Findday()select 考勤天数 from Message where Sno= + textBox2.Text +
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1