




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、数据库课程设计设计题目: 工资管理系统 班 级: 学 号: 姓 名: 任务分配表第 一 组学号姓名负责部分成绩组长数据库的建表与连接组员实验报告完善与界面设计目录一 绪论····································
2、;······3二 需求分析·······································3三 概要设计··
3、83;····································4四 物理设计············
4、183;··························5五 详细设计······················&
5、#183;················6六 调试分析································
6、·······9七 小结··········································1
7、6八 附件············································16 一、绪论随着计算机技术的飞速发展和经济体制改革的不断深入
8、,传统企业管理方法、手段以及工作效率已不能适应新的发展需要,无法很好地完成员工工资管理工作。提高公司企业管理水平的主要途径是更新管理者的思想,增强对管理活动的科学认识。基于C#与SQL server数据库技术建立一个通用工资管理系统,该系统为提供了查询、增加记录、删除等功能,功能比较的齐全,并对工资进行了统计如津贴管理、报表统计等。基本上能满足管理员和公司的要求。此次数据库课程设计的主要设计如下:原理分析、程序设计过程、程序实现和程序调试以及数据库的设计。需求分析、概要结构设计、逻辑结构设计、物理结构设计和数据库的实施和维护。主要包括两大大功能模块:1 管理员管理界面设计。2 员工管理界面设计
9、。二、 需求分析 功能需求分析:该通用工资管理系统具备下列功能:管理员通过输入用户名和密码进下该系统后,可以进行一些基本查询(员工信息查询、工资奖金信息查询)、工资管理(计算总工资、奖金管理);通过输入密码,可以进行查询员工的数据(工资,奖金,税收等)。具体功能的详细描述如下1、 在首页进行选择,员工与管理员通道2、 点击管理员登陆3、用户名和密码即可进入 工资管理功能窗体,在此可以选择功能,添加,查询,人员列表4、点击添加功能窗体,添加员工工资信息。5、点击查询功能窗体,输入员工号即可查询员工信息。6、点击人员列表功能窗体,可查看所有员工的列表,这界面内可以进行删除操作。7、点击员工登陆8、
10、用户名和密码即可进入 员工工资查询功能窗体,在此可以选择查询基本信息,查询工资信息。9、在查询基本信息,员工可自己查看自己的信息。10、在查询工作信息,员工可自己查看自己的工作信息。数据流需求分析: 登陆信息 返回信息 用 户登 录操 作数据库 错误信息 寻找信息 数据库需求分析数据流图三、概要设计根据需求分析阶段得到的功能需求,管理员、员工通过输入用户名号和密码进下该系统后,可以进行一些基本查询(员工工资信息查询、信息查询)、还可以进行员工删除和添加员工的操作,员工通过登录并输入密码,可以进行查询自己的数据(工资,基本信息)。 模块功能大概可以分为如图下几个个方面:图如下图所示 四、物理设计
11、1. 选择登陆 则会进入相应登陆界面。 2. 选择员工登陆 管理员登陆 按钮命令3. 选择管理员登陆按钮命令即可进入 管理功能窗体。4. 选择员工登陆 按钮命令即可进入 员工查询功能窗体。5. 在添加,管理员对员工的信息进行添加。6. 在查询,可以对员工查询并进行修改。7. 在列表,可以查看所有员工的列表。五、详细设计 (1) 数据库的E-R图及合并部分视图生成E-R 图员工信息E-R图:病假天数工作天数Empinfotale姓名工龄银行卡 年龄 工种名称用户名性别员工工资信息E-R图:银行卡号退休工资国家税收 Salaryinfo工作天数基本工资奖金 员号总工资实际工作管理员用户E-R图:
12、admin 用户 用户号 密码(2) 数据库结构设计根据上面概念结构设计阶段得到的E-R图,下一步应该将它转化为关系模型。可以得到对应的关系模式为:Empinfotale(cin,name,year,sex,workyear,position,creditcard,workday,illday)Salaryinfo(cin,bonus,salary,individual,individual2,workout,workday,Reality,creditcar)admin(id,cin,password)数据库表的建立:(sql语句及截图) 语句如下:CREATE TABLE dbo.Admi
13、n(id int IDENTITY(1,1) NOT NULL,cin int NULL,password char(20) NULL,);CREATE TABLE dbo.Empinfotale(cin int NOT NULL,name char(8) NULL,year int NULL,sex char(4) NULL,workyear int NULL,position char(18) NULL,creditcard char(19) NULL,workday int NULL,illday int NULL,);CREATE TABLE dbo.Admin(id int IDEN
14、TITY(1,1) NOT NULL,cin int NULL,password char(20) NULL,);六、调试分析(1)数据库的表的建立与实现admin表的建立:Salaryinfo表的建立:Empinfotale表的建立:1. 数据库的运行和截图:选择登录界面截图:管理员登录后:查询界面:添加界面:显示所有信息:(2)调试与运行程序分析及存在的主要问题在此次课程设计中的主要数据库部分为数据库的连接部分,该部分直接影响到数据库与应用程序的接口实现,而且必须注意数据库的名称与连接数据库是取的名称一致。 七、小结该工资管理系统总体说来功能不是很齐全齐全,只具备管理员和员工的一些基本的功
15、能;数据库的设计方面,建有员工信息表、个人信息表、工资表。数据库中存在一些问题,如数据冗余,不够完善。但在做课程设计的过程中也遇到很多问题,一开始时其中最大的问题是不知道用哪种编译工具,后来选择了Microsoft Visual Studio,在编写程序时,编写程序起来也有点困难,但是也越来越顺利了。经过调试后终于把自已想到实现的功能一步步实现了,通过这次课程设计使我收获了好多,熟悉了C#的运用,还复习了数据库相关语句的编写。 此次课程设计让我感受颇多:做一个数据库其实是一件很有趣的事情。想到自己可以创建一个小型的数据库系统,有点学习后的满足感。数据库的建立并非难事,难点在于数据库的连接和编程
16、语言的选择。C#的功能很强大,这也是我以后需要学习的课程,于是我毅然选择了它。再就是建立数据库系统的步骤,我的经验就是要先总体规划,再局部整理。先做好总的界面,再通过该界面的布置一步一步实现其功能!同时我体会到:熟练的编程能力,对知识运用的强烈渴望及其创新和团队的合作精神设做好一个大型数据库的基础。因此通过此次课程设计我明显感觉到自身的不足,并希望以后能更加用心地运用所学知识和学习新的知识。 在这个系统中我主要负责了数据库的建立和管理员管理的页面设计,虽然做的不是很好的,但是让我们学到了很多关于数据库连接方面的知识。我会继续完善下去的。 八、附件一、程序代码选择登陆页面using System
17、;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.Configuration;namespace GZMS public partial class index : Form public index() InitializeComponent(); private void button1_C
18、lick(object sender, EventArgs e) Form1 indexform = new Form1(); indexform.Owner = this; indexform.Show(); this.Hide(); private void button2_Click(object sender, EventArgs e) Form11 indexform = new Form11(); indexform.Owner = this; indexform.Show(); this.Hide(); 验证用户名登陆页面using System;using System.Col
19、lections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;using System.Configuration;namespace GZMS public partial class Form1 : Form public Form1() InitializeComponent(); protected o
20、verride void OnClosed(EventArgs e) Application.Exit(); private void index_Click(object sender, EventArgs e) string username = txusername.Text; string usrepaw = txuserpaw.Text; if (username = "" | usrepaw = "") MessageBox.Show("请输入用户名或密码", "提示"); return; SqlCon
21、nection sqlCon = new SqlConnection(ConfigurationManager.ConnectionStrings"GZB.Properties.Settings.ConnectionString".ConnectionString); /string ConnectionString = "Data Source=(local);Initial Catalog=GZB;User=sa;Password=admin;Integrated Security=True" /SqlConnection sqlCon = new
22、SqlConnection(ConnectionString); /创建Connection对象 /Data Source=.;Initial Catalog=数据库名;Integrated Security=True id = 用户名 password = 密码 try sqlCon.Open(); string sql = String.Format("select cin,password from Admin where cin='0'and password = '1' ", username, usrepaw); SqlComma
23、nd comm = new SqlCommand(sql,sqlCon); SqlDataReader c = comm.ExecuteReader(); if (c.Read() this.DialogResult = DialogResult.OK; /触发确定¨ /MessageBox.Show("成功|", "登陆成功|", MessageBoxButtons.OK); search add = new search(); add.Owner = this; add.Show(); this.Hide(); else MessageBo
24、x.Show("成功", "登陆成功|", MessageBoxButtons.OK); catch (SqlException ex) MessageBox.Show("数据库错误","错误"); finally sqlCon.Close(); private void quet_Click(object sender, EventArgs e) Application.Exit(); 功能选择页面using System;using System.Collections.Generic;using System
25、.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;using System.Configuration;namespace GZMS public partial class Form1 : Form public Form1() InitializeComponent(); protected override void OnClosed(EventAr
26、gs e) Application.Exit(); private void index_Click(object sender, EventArgs e) string username = txusername.Text; string usrepaw = txuserpaw.Text; if (username = "" | usrepaw = "") MessageBox.Show("请输入用户名或密码", "提示"); return; SqlConnection sqlCon = new SqlConne
27、ction(ConfigurationManager.ConnectionStrings"GZB.Properties.Settings.ConnectionString".ConnectionString); /string ConnectionString = "Data Source=(local);Initial Catalog=GZB;User=sa;Password=admin;Integrated Security=True" /SqlConnection sqlCon = new SqlConnection(ConnectionStrin
28、g); /创建Connection对象 /Data Source=.;Initial Catalog=数据库名;Integrated Security=True id = 用户名 password = 密码 try sqlCon.Open(); string sql = String.Format("select cin,password from Admin where cin='0'and password = '1' ", username, usrepaw); SqlCommand comm = new SqlCommand(sql,
29、sqlCon); SqlDataReader c = comm.ExecuteReader(); if (c.Read() this.DialogResult = DialogResult.OK; /触发确定 /MessageBox.Show("成功", "登陆成功", MessageBoxButtons.OK); search add = new search(); add.Owner = this; add.Show(); this.Hide(); else MessageBox.Show("no成功|", "登陆no成
30、功|", MessageBoxButtons.OK); catch (SqlException ex) MessageBox.Show("数据库错误","错误"); finally sqlCon.Close(); private void quet_Click(object sender, EventArgs e) Application.Exit(); 添加员工信息页面using System;using System.Collections.Generic;using System.ComponentModel;using System.D
31、ata;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;using System.Configuration;namespace GZMS public partial class add : Form public add() InitializeComponent(); protected override void OnClosed(EventArgs e) Application.Exit(); private
32、void button2_Click(object sender, EventArgs e) this.Close(); private void button1_Click(object sender, EventArgs e) try string name = tbname.Text; string num = tbnum.Text; string sex = "" if (rbboy.Checked) sex = rbboy.Text; else sex = rdgirl.Text; int year = Convert.ToInt32(tbyear.Text);
33、int workyear = Convert.ToInt32(tbworkyear.Text); string position = cbposition.SelectedItem.ToString(); int workday = Convert.ToInt32(tbworkday.Text); int illday = Convert.ToInt32(tbillday1.Text); string credit = tbcredit.Text; / string constring = "server = (local); database = GZB;UID=sa;Passwo
34、rd=admin; integrated security=True" / SqlConnection conn = new SqlConnection(constring); SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings"GZB.Properties.Settings.ConnectionString".ConnectionString); conn.Open(); string sql = string.Format("insert into
35、 Empinfotale(cin,name,year,sex,workyear,position,creditcard,workday,illday)VALUES('0','1','2','3','4','5','6','7',8)", num, name, year, sex, workyear, position, credit, workday, illday); SqlCommand com = new SqlCommand(sql, conn);
36、int i = com.ExecuteNonQuery(); if (i != 0) MessageBox.Show("成功", "插入成功|", MessageBoxButtons.OK, MessageBoxIcon.None); catch (FormatException ex) MessageBox.Show("请重新输入空白地方", "输入错误", MessageBoxButtons.OK); catch (SqlException ex) MessageBox.Show("错误",
37、 "数据库连接异常", MessageBoxButtons.OK); private void tbworkday_TextChanged(object sender, EventArgs e) try int workday = Convert.ToInt32(tbworkday.Text); if (workday >= 30 && workday <= 1) MessageBox.Show("输入有误", "请重新输入", MessageBoxButtons.OK); return; int illd
38、ay = 30 - workday; tbillday1.Text = illday.ToString(); catch (Exception ex) return; 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.SqlClient;using System
39、.Configuration;namespace GZMS public partial class add1 : Form public add1() InitializeComponent(); /* int bonus = Convert.ToInt32(tbbonus.Text); int salary = Convert.ToInt32(tbsalary.Text); int individual = Convert.ToInt32(tbindividual.Text); int individual1 = Convert.ToInt32(tbindividual1.Text); i
40、nt workout = Convert.ToInt32(tbworkout.Text); int toworkout = individual1 + individual; tbtotal.Text = Convert.ToString(toworkout); int total = Convert.ToInt32(tbtotal.Text); int toreality = salary + bonus - toworkout + workout; tbreality.Text = Convert.ToString(toreality); int reality = Convert.ToI
41、nt32(tbreality.Text); string credit = tbcredit.Text;*/ private void button1_Click(object sender, EventArgs e) int num = Convert.ToInt32(tbnum.Text); int bonus = Convert.ToInt32(tbbonus.Text); int salary = Convert.ToInt32(tbsalary.Text); int individual = Convert.ToInt32(tbindividual.Text); int indivi
42、dual1 = Convert.ToInt32(tbindividual1.Text); int workout = Convert.ToInt32(tbworkout.Text); int total = Convert.ToInt32(tbtotal.Text); string credit = tbcredit.Text; int reality = Convert.ToInt32(tbreality.Text); SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings"GZB.
43、Properties.Settings.ConnectionString".ConnectionString); try conn.Open(); string sql = string.Format("insert into Salaryinfo(cin,bonus,salary,individual,individual2,workout,workday,Reality,creditcard)VALUES('0','1','2','3','4','5','6'
44、,'7',8)", num, bonus, salary, individual, individual1, workout, total, reality, credit); SqlCommand com = new SqlCommand(sql, conn); int i = com.ExecuteNonQuery(); if (i != 0) MessageBox.Show("成功", "插入成功", MessageBoxButtons.OK, MessageBoxIcon.None); catch (Exception
45、ex) MessageBox.Show("出错了", "错误", MessageBoxButtons.RetryCancel); private void tbworkout_TextChanged(object sender, EventArgs e) try int bonus = Convert.ToInt32(tbbonus.Text); int salary = Convert.ToInt32(tbsalary.Text); int individual = Convert.ToInt32(tbindividual.Text); int ind
46、ividual1 = Convert.ToInt32(tbindividual1.Text); int workout = Convert.ToInt32(tbworkout.Text); int toworkout = individual1 + individual; tbtotal.Text = Convert.ToString(toworkout); int total = Convert.ToInt32(tbtotal.Text); int toreality = salary + bonus - toworkout + workout; tbreality.Text = Conve
47、rt.ToString(toreality); int reality = Convert.ToInt32(tbreality.Text); string credit = tbcredit.Text; catch (Exception ex) return; private void button2_Click(object sender, EventArgs e) this.Close(); 查询页面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.SqlClient;using System.Configuration;namespace GZMS public
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 长治市人民医院超声引导穿刺考核
- 朔州市中医院补体检测临床意义考核
- 2025年中国球型氧化铝项目商业计划书
- 承德市中医院脊柱术后并发症处理考核
- 北京市人民医院骨皮瓣移植技术考核
- 北京市人民医院造血干细胞计数与活力检测考核
- 邯郸市中医院血液检验危急值报告流程考核
- 呼和浩特市中医院科室学术影响力建设考核
- 石家庄市人民医院胃底静脉曲张治疗考核
- 2025妇幼保健院儿童颅内肿瘤手术专项技能考核
- 邮轮客舱服务管理全套教学课件
- 教师培训:人际关系与团队协作
- 蓬莱19-3油田溢油事故案例分析工程伦理
- 处方前置审核系统
- 牛津自然拼读ABC
- 清代园林圆明园简介
- 医院环境卫生学监测课件
- 六年级古诗词字帖
- 特殊儿童融合教育档案
- 机械原理 潘存云课件 第8章 其它常用机构
- 各种汉服款式剪裁图大全
评论
0/150
提交评论