




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、數(shù)據(jù)庫課程設(shè)計設(shè)計題目: 工資管理系統(tǒng) 班 級: 學(xué) 號: 姓 名: 任務(wù)分配表第 一 組學(xué)號姓名負(fù)責(zé)部分成績組長數(shù)據(jù)庫的建表與連接組員實驗報告完善與界面設(shè)計目錄一 緒論····································
2、;······3二 需求分析·······································3三 概要設(shè)計··
3、83;····································4四 物理設(shè)計············
4、183;··························5五 詳細(xì)設(shè)計······················&
5、#183;················6六 調(diào)試分析································
6、·······9七 小結(jié)··········································1
7、6八 附件············································16 一、緒論隨著計算機技術(shù)的飛速發(fā)展和經(jīng)濟(jì)體制改革的不斷深入
8、,傳統(tǒng)企業(yè)管理方法、手段以及工作效率已不能適應(yīng)新的發(fā)展需要,無法很好地完成員工工資管理工作。提高公司企業(yè)管理水平的主要途徑是更新管理者的思想,增強對管理活動的科學(xué)認(rèn)識?;贑#與SQL server數(shù)據(jù)庫技術(shù)建立一個通用工資管理系統(tǒng),該系統(tǒng)為提供了查詢、增加記錄、刪除等功能,功能比較的齊全,并對工資進(jìn)行了統(tǒng)計如津貼管理、報表統(tǒng)計等?;旧夏軡M足管理員和公司的要求。此次數(shù)據(jù)庫課程設(shè)計的主要設(shè)計如下:原理分析、程序設(shè)計過程、程序?qū)崿F(xiàn)和程序調(diào)試以及數(shù)據(jù)庫的設(shè)計。需求分析、概要結(jié)構(gòu)設(shè)計、邏輯結(jié)構(gòu)設(shè)計、物理結(jié)構(gòu)設(shè)計和數(shù)據(jù)庫的實施和維護(hù)。主要包括兩大大功能模塊:1 管理員管理界面設(shè)計。2 員工管理界面設(shè)計
9、。二、 需求分析 功能需求分析:該通用工資管理系統(tǒng)具備下列功能:管理員通過輸入用戶名和密碼進(jìn)下該系統(tǒng)后,可以進(jìn)行一些基本查詢(員工信息查詢、工資獎金信息查詢)、工資管理(計算總工資、獎金管理);通過輸入密碼,可以進(jìn)行查詢員工的數(shù)據(jù)(工資,獎金,稅收等)。具體功能的詳細(xì)描述如下1、 在首頁進(jìn)行選擇,員工與管理員通道2、 點擊管理員登陸3、用戶名和密碼即可進(jìn)入 工資管理功能窗體,在此可以選擇功能,添加,查詢,人員列表4、點擊添加功能窗體,添加員工工資信息。5、點擊查詢功能窗體,輸入員工號即可查詢員工信息。6、點擊人員列表功能窗體,可查看所有員工的列表,這界面內(nèi)可以進(jìn)行刪除操作。7、點擊員工登陸8、
10、用戶名和密碼即可進(jìn)入 員工工資查詢功能窗體,在此可以選擇查詢基本信息,查詢工資信息。9、在查詢基本信息,員工可自己查看自己的信息。10、在查詢工作信息,員工可自己查看自己的工作信息。數(shù)據(jù)流需求分析: 登陸信息 返回信息 用 戶登 錄操 作數(shù)據(jù)庫 錯誤信息 尋找信息 數(shù)據(jù)庫需求分析數(shù)據(jù)流圖三、概要設(shè)計根據(jù)需求分析階段得到的功能需求,管理員、員工通過輸入用戶名號和密碼進(jìn)下該系統(tǒng)后,可以進(jìn)行一些基本查詢(員工工資信息查詢、信息查詢)、還可以進(jìn)行員工刪除和添加員工的操作,員工通過登錄并輸入密碼,可以進(jìn)行查詢自己的數(shù)據(jù)(工資,基本信息)。 模塊功能大概可以分為如圖下幾個個方面:圖如下圖所示 四、物理設(shè)計
11、1. 選擇登陸 則會進(jìn)入相應(yīng)登陸界面。 2. 選擇員工登陸 管理員登陸 按鈕命令3. 選擇管理員登陸按鈕命令即可進(jìn)入 管理功能窗體。4. 選擇員工登陸 按鈕命令即可進(jìn)入 員工查詢功能窗體。5. 在添加,管理員對員工的信息進(jìn)行添加。6. 在查詢,可以對員工查詢并進(jìn)行修改。7. 在列表,可以查看所有員工的列表。五、詳細(xì)設(shè)計 (1) 數(shù)據(jù)庫的E-R圖及合并部分視圖生成E-R 圖員工信息E-R圖:病假天數(shù)工作天數(shù)Empinfotale姓名工齡銀行卡 年齡 工種名稱用戶名性別員工工資信息E-R圖:銀行卡號退休工資國家稅收 Salaryinfo工作天數(shù)基本工資獎金 員號總工資實際工作管理員用戶E-R圖:
12、admin 用戶 用戶號 密碼(2) 數(shù)據(jù)庫結(jié)構(gòu)設(shè)計根據(jù)上面概念結(jié)構(gòu)設(shè)計階段得到的E-R圖,下一步應(yīng)該將它轉(zhuǎn)化為關(guān)系模型??梢缘玫綄?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ù)庫的表的建立與實現(xiàn)admin表的建立:Salaryinfo表的建立:Empinfotale表的建立:1. 數(shù)據(jù)庫的運行和截圖:選擇登錄界面截圖:管理員登錄后:查詢界面:添加界面:顯示所有信息:(2)調(diào)試與運行程序分析及存在的主要問題在此次課程設(shè)計中的主要數(shù)據(jù)庫部分為數(shù)據(jù)庫的連接部分,該部分直接影響到數(shù)據(jù)庫與應(yīng)用程序的接口實現(xiàn),而且必須注意數(shù)據(jù)庫的名稱與連接數(shù)據(jù)庫是取的名稱一致。 七、小結(jié)該工資管理系統(tǒng)總體說來功能不是很齊全齊全,只具備管理員和員工的一些基本的功
15、能;數(shù)據(jù)庫的設(shè)計方面,建有員工信息表、個人信息表、工資表。數(shù)據(jù)庫中存在一些問題,如數(shù)據(jù)冗余,不夠完善。但在做課程設(shè)計的過程中也遇到很多問題,一開始時其中最大的問題是不知道用哪種編譯工具,后來選擇了Microsoft Visual Studio,在編寫程序時,編寫程序起來也有點困難,但是也越來越順利了。經(jīng)過調(diào)試后終于把自已想到實現(xiàn)的功能一步步實現(xiàn)了,通過這次課程設(shè)計使我收獲了好多,熟悉了C#的運用,還復(fù)習(xí)了數(shù)據(jù)庫相關(guān)語句的編寫。 此次課程設(shè)計讓我感受頗多:做一個數(shù)據(jù)庫其實是一件很有趣的事情。想到自己可以創(chuàng)建一個小型的數(shù)據(jù)庫系統(tǒng),有點學(xué)習(xí)后的滿足感。數(shù)據(jù)庫的建立并非難事,難點在于數(shù)據(jù)庫的連接和編程
16、語言的選擇。C#的功能很強大,這也是我以后需要學(xué)習(xí)的課程,于是我毅然選擇了它。再就是建立數(shù)據(jù)庫系統(tǒng)的步驟,我的經(jīng)驗就是要先總體規(guī)劃,再局部整理。先做好總的界面,再通過該界面的布置一步一步實現(xiàn)其功能!同時我體會到:熟練的編程能力,對知識運用的強烈渴望及其創(chuàng)新和團(tuán)隊的合作精神設(shè)做好一個大型數(shù)據(jù)庫的基礎(chǔ)。因此通過此次課程設(shè)計我明顯感覺到自身的不足,并希望以后能更加用心地運用所學(xué)知識和學(xué)習(xí)新的知識。 在這個系統(tǒng)中我主要負(fù)責(zé)了數(shù)據(jù)庫的建立和管理員管理的頁面設(shè)計,雖然做的不是很好的,但是讓我們學(xué)到了很多關(guān)于數(shù)據(jù)庫連接方面的知識。我會繼續(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(); 驗證用戶名登陸頁面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); /創(chuàng)建Connection對象 /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ù)庫錯誤","錯誤"); 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); /創(chuàng)建Connection對象 /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ù)庫錯誤","錯誤"); 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、 "數(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("輸入有誤", "請重新輸入", 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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 通信原理簡明教程(第2版)課件 第8章 同步原理
- 2025年河北省定州市輔警招聘考試試題題庫附答案詳解(完整版)
- 2025年Z世代消費習(xí)慣研究:新消費品牌如何提升用戶忠誠度報告
- 2025年K2學(xué)校STEM課程實施與教師教學(xué)反思研究報告
- 膀胱腫瘤整塊切除術(shù)手術(shù)技術(shù)2025
- 初中數(shù)學(xué)九年級下冊統(tǒng)編教案 6.5相似三角形的性質(zhì)(第1課時)
- 2025屆高考物理大一輪復(fù)習(xí)課件 第九章 第49課時 專題強化:帶電粒子在電場中的力電綜合問題
- 抗炎緩解治療藥物
- 2025年父親節(jié)小學(xué)生國旗下講話稿-父愛如山溫暖相伴
- 物流司機培訓(xùn)試題及答案
- 中國絲綢簡述ppt課件
- 蘇軾《浣溪沙》優(yōu)秀課件
- 塑料包裝袋購銷合同
- 生產(chǎn)良率系統(tǒng)統(tǒng)計表
- 代理機構(gòu)服務(wù)質(zhì)量考核評價表
- 淺談打擊樂器在小學(xué)低段音樂課堂中的運用
- 2018年瀘州市生物中考試題含答案
- S7、S9、S11系列變壓器損耗表
- 消防電氣檢驗批質(zhì)量驗收記錄表
- 品控員作業(yè)指導(dǎo)書
- 醫(yī)療器械質(zhì)量手冊含程序文件
評論
0/150
提交評論