




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、數(shù)據(jù)庫課程設(shè)計(jì)設(shè)計(jì)題目: 工資管理系統(tǒng) 班 級(jí): 學(xué) 號(hào): 姓 名: 任務(wù)分配表第 一 組學(xué)號(hào)姓名負(fù)責(zé)部分成績組長數(shù)據(jù)庫的建表與連接組員實(shí)驗(yàn)報(bào)告完善與界面設(shè)計(jì)目錄一 緒論····································
2、;······3二 需求分析·······································3三 概要設(shè)計(jì)··
3、83;····································4四 物理設(shè)計(jì)············
4、183;··························5五 詳細(xì)設(shè)計(jì)······················&
5、#183;················6六 調(diào)試分析································
6、·······9七 小結(jié)··········································1
7、6八 附件············································16 一、緒論隨著計(jì)算機(jī)技術(shù)的飛速發(fā)展和經(jīng)濟(jì)體制改革的不斷深入
8、,傳統(tǒng)企業(yè)管理方法、手段以及工作效率已不能適應(yīng)新的發(fā)展需要,無法很好地完成員工工資管理工作。提高公司企業(yè)管理水平的主要途徑是更新管理者的思想,增強(qiáng)對(duì)管理活動(dòng)的科學(xué)認(rèn)識(shí)?;贑#與SQL server數(shù)據(jù)庫技術(shù)建立一個(gè)通用工資管理系統(tǒng),該系統(tǒng)為提供了查詢、增加記錄、刪除等功能,功能比較的齊全,并對(duì)工資進(jìn)行了統(tǒng)計(jì)如津貼管理、報(bào)表統(tǒng)計(jì)等?;旧夏軡M足管理員和公司的要求。此次數(shù)據(jù)庫課程設(shè)計(jì)的主要設(shè)計(jì)如下:原理分析、程序設(shè)計(jì)過程、程序?qū)崿F(xiàn)和程序調(diào)試以及數(shù)據(jù)庫的設(shè)計(jì)。需求分析、概要結(jié)構(gòu)設(shè)計(jì)、邏輯結(jié)構(gòu)設(shè)計(jì)、物理結(jié)構(gòu)設(shè)計(jì)和數(shù)據(jù)庫的實(shí)施和維護(hù)。主要包括兩大大功能模塊:1 管理員管理界面設(shè)計(jì)。2 員工管理界面設(shè)計(jì)
9、。二、 需求分析 功能需求分析:該通用工資管理系統(tǒng)具備下列功能:管理員通過輸入用戶名和密碼進(jìn)下該系統(tǒng)后,可以進(jìn)行一些基本查詢(員工信息查詢、工資獎(jiǎng)金信息查詢)、工資管理(計(jì)算總工資、獎(jiǎng)金管理);通過輸入密碼,可以進(jìn)行查詢員工的數(shù)據(jù)(工資,獎(jiǎng)金,稅收等)。具體功能的詳細(xì)描述如下1、 在首頁進(jìn)行選擇,員工與管理員通道2、 點(diǎn)擊管理員登陸3、用戶名和密碼即可進(jìn)入 工資管理功能窗體,在此可以選擇功能,添加,查詢,人員列表4、點(diǎn)擊添加功能窗體,添加員工工資信息。5、點(diǎn)擊查詢功能窗體,輸入員工號(hào)即可查詢員工信息。6、點(diǎn)擊人員列表功能窗體,可查看所有員工的列表,這界面內(nèi)可以進(jìn)行刪除操作。7、點(diǎn)擊員工登陸8、
10、用戶名和密碼即可進(jìn)入 員工工資查詢功能窗體,在此可以選擇查詢基本信息,查詢工資信息。9、在查詢基本信息,員工可自己查看自己的信息。10、在查詢工作信息,員工可自己查看自己的工作信息。數(shù)據(jù)流需求分析: 登陸信息 返回信息 用 戶登 錄操 作數(shù)據(jù)庫 錯(cuò)誤信息 尋找信息 數(shù)據(jù)庫需求分析數(shù)據(jù)流圖三、概要設(shè)計(jì)根據(jù)需求分析階段得到的功能需求,管理員、員工通過輸入用戶名號(hào)和密碼進(jìn)下該系統(tǒng)后,可以進(jìn)行一些基本查詢(員工工資信息查詢、信息查詢)、還可以進(jìn)行員工刪除和添加員工的操作,員工通過登錄并輸入密碼,可以進(jìn)行查詢自己的數(shù)據(jù)(工資,基本信息)。 模塊功能大概可以分為如圖下幾個(gè)個(gè)方面:圖如下圖所示 四、物理設(shè)計(jì)
11、1. 選擇登陸 則會(huì)進(jìn)入相應(yīng)登陸界面。 2. 選擇員工登陸 管理員登陸 按鈕命令3. 選擇管理員登陸按鈕命令即可進(jìn)入 管理功能窗體。4. 選擇員工登陸 按鈕命令即可進(jìn)入 員工查詢功能窗體。5. 在添加,管理員對(duì)員工的信息進(jìn)行添加。6. 在查詢,可以對(duì)員工查詢并進(jìn)行修改。7. 在列表,可以查看所有員工的列表。五、詳細(xì)設(shè)計(jì) (1) 數(shù)據(jù)庫的E-R圖及合并部分視圖生成E-R 圖員工信息E-R圖:病假天數(shù)工作天數(shù)Empinfotale姓名工齡銀行卡 年齡 工種名稱用戶名性別員工工資信息E-R圖:銀行卡號(hào)退休工資國家稅收 Salaryinfo工作天數(shù)基本工資獎(jiǎng)金 員號(hào)總工資實(shí)際工作管理員用戶E-R圖:
12、admin 用戶 用戶號(hào) 密碼(2) 數(shù)據(jù)庫結(jié)構(gòu)設(shè)計(jì)根據(jù)上面概念結(jié)構(gòu)設(shè)計(jì)階段得到的E-R圖,下一步應(yīng)該將它轉(zhuǎn)化為關(guān)系模型。可以得到對(duì)應(yīng)的關(guān)系模式為:Empinfotale(cin,name,year,sex,workyear,position,creditcard,workday,illday)Salaryinfo(cin,bonus,salary,individual,individual2,workout,workday,Reality,creditcar)admin(id,cin,password)數(shù)據(jù)庫表的建立:(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,);六、調(diào)試分析(1)數(shù)據(jù)庫的表的建立與實(shí)現(xiàn)admin表的建立:Salaryinfo表的建立:Empinfotale表的建立:1. 數(shù)據(jù)庫的運(yùn)行和截圖:選擇登錄界面截圖:管理員登錄后:查詢界面:添加界面:顯示所有信息:(2)調(diào)試與運(yùn)行程序分析及存在的主要問題在此次課程設(shè)計(jì)中的主要數(shù)據(jù)庫部分為數(shù)據(jù)庫的連接部分,該部分直接影響到數(shù)據(jù)庫與應(yīng)用程序的接口實(shí)現(xiàn),而且必須注意數(shù)據(jù)庫的名稱與連接數(shù)據(jù)庫是取的名稱一致。 七、小結(jié)該工資管理系統(tǒng)總體說來功能不是很齊全齊全,只具備管理員和員工的一些基本的功
15、能;數(shù)據(jù)庫的設(shè)計(jì)方面,建有員工信息表、個(gè)人信息表、工資表。數(shù)據(jù)庫中存在一些問題,如數(shù)據(jù)冗余,不夠完善。但在做課程設(shè)計(jì)的過程中也遇到很多問題,一開始時(shí)其中最大的問題是不知道用哪種編譯工具,后來選擇了Microsoft Visual Studio,在編寫程序時(shí),編寫程序起來也有點(diǎn)困難,但是也越來越順利了。經(jīng)過調(diào)試后終于把自已想到實(shí)現(xiàn)的功能一步步實(shí)現(xiàn)了,通過這次課程設(shè)計(jì)使我收獲了好多,熟悉了C#的運(yùn)用,還復(fù)習(xí)了數(shù)據(jù)庫相關(guān)語句的編寫。 此次課程設(shè)計(jì)讓我感受頗多:做一個(gè)數(shù)據(jù)庫其實(shí)是一件很有趣的事情。想到自己可以創(chuàng)建一個(gè)小型的數(shù)據(jù)庫系統(tǒng),有點(diǎn)學(xué)習(xí)后的滿足感。數(shù)據(jù)庫的建立并非難事,難點(diǎn)在于數(shù)據(jù)庫的連接和編程
16、語言的選擇。C#的功能很強(qiáng)大,這也是我以后需要學(xué)習(xí)的課程,于是我毅然選擇了它。再就是建立數(shù)據(jù)庫系統(tǒng)的步驟,我的經(jīng)驗(yàn)就是要先總體規(guī)劃,再局部整理。先做好總的界面,再通過該界面的布置一步一步實(shí)現(xiàn)其功能!同時(shí)我體會(huì)到:熟練的編程能力,對(duì)知識(shí)運(yùn)用的強(qiáng)烈渴望及其創(chuàng)新和團(tuán)隊(duì)的合作精神設(shè)做好一個(gè)大型數(shù)據(jù)庫的基礎(chǔ)。因此通過此次課程設(shè)計(jì)我明顯感覺到自身的不足,并希望以后能更加用心地運(yùn)用所學(xué)知識(shí)和學(xué)習(xí)新的知識(shí)。 在這個(gè)系統(tǒng)中我主要負(fù)責(zé)了數(shù)據(jù)庫的建立和管理員管理的頁面設(shè)計(jì),雖然做的不是很好的,但是讓我們學(xué)到了很多關(guān)于數(shù)據(jù)庫連接方面的知識(shí)。我會(huì)繼續(xù)完善下去的。 八、附件一、程序代碼選擇登陸頁面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(); 驗(yàn)證用戶名登陸頁面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("請(qǐng)輸入用戶名或密碼", "提示"); 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); /創(chuàng)建Connection對(duì)象 /Data Source=.;Initial Catalog=數(shù)據(jù)庫名;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; /觸發(fā)確定¨ /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("數(shù)據(jù)庫錯(cuò)誤","錯(cuò)誤"); 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("請(qǐng)輸入用戶名或密碼", "提示"); 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); /創(chuàng)建Connection對(duì)象 /Data Source=.;Initial Catalog=數(shù)據(jù)庫名;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; /觸發(fā)確定 /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("數(shù)據(jù)庫錯(cuò)誤","錯(cuò)誤"); 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("請(qǐng)重新輸入空白地方", "輸入錯(cuò)誤", MessageBoxButtons.OK); catch (SqlException ex) MessageBox.Show("錯(cuò)誤",
37、 "數(shù)據(jù)庫連接異常", MessageBoxButtons.OK); private void tbworkday_TextChanged(object sender, EventArgs e) try int workday = Convert.ToInt32(tbworkday.Text); if (workday >= 30 && workday <= 1) MessageBox.Show("輸入有誤", "請(qǐng)重新輸入", 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("出錯(cuò)了", "錯(cuò)誤", 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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 山東育嬰師試題及答案
- 企業(yè)管理規(guī)定試題及答案
- 2024年紡織設(shè)計(jì)師行業(yè)調(diào)查試題及答案
- 廣告設(shè)計(jì)師考試色彩心理研究試題及答案
- 廣告設(shè)計(jì)與內(nèi)容營銷試題及答案
- 2024年與設(shè)計(jì)相關(guān)的行業(yè)動(dòng)態(tài)國際商業(yè)美術(shù)設(shè)計(jì)師考試試題及答案
- 買豆?jié){的孩子試題及答案
- 2024年廣告設(shè)計(jì)師的復(fù)習(xí)新方法試題及答案
- 廣告設(shè)計(jì)中的轉(zhuǎn)化率提升策略試題及答案
- 科學(xué)編制考試試題及答案
- 基于深度學(xué)習(xí)的語音分離技術(shù)研究
- 拆井施工方案
- 【中小企業(yè)財(cái)務(wù)管理存在的問題及對(duì)策分析-以A公司為例5100字(論文)】
- -2月班主任隨堂聽課記錄表
- 《虛擬現(xiàn)實(shí)(VR)制作與應(yīng)用》考試復(fù)習(xí)題庫(匯總)
- 解剖學(xué)下肢肌課件
- NB/T 11141-2023煤礦用氮?dú)饨禍匮b置
- 2023年山東省煙臺(tái)市中考?xì)v史真題卷(含答案與解析)
- 國開2023春《語言學(xué)概論》形考任務(wù)1-3+大作業(yè)參考答案
- 第七章第四節(jié)+俄羅斯第二課時(shí)課件人教版七年級(jí)地理下冊(cè)
- 大學(xué)生國家安全教育智慧樹知到答案章節(jié)測(cè)試2023年廣西科技大學(xué)
評(píng)論
0/150
提交評(píng)論