




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
1、數(shù)據(jù)庫技術(shù)及應(yīng)用項目設(shè)計報告學(xué)生成績管理系統(tǒng) 姓名:Celia Yan 2015-01-07一設(shè)計目的及意義在如今的高校日常管理中,學(xué)生成績管理系統(tǒng)是其中非常重要的一環(huán),特別是當(dāng)前學(xué)校規(guī)模不斷擴大,學(xué)生人數(shù)日益增加,課程門類多,校區(qū)分散等實際情況,學(xué)生成績統(tǒng)計功能越來越繁重,稍有疏忽就會出現(xiàn)差錯。因此,學(xué)生成績管理系統(tǒng)更具有非常大的實際應(yīng)用意義。在互聯(lián)網(wǎng)快速崛起的今天,改革傳統(tǒng)的手工錄入方式,公正,準(zhǔn)確,及時反映學(xué)生的信息和成績的情況,以適應(yīng)信息時代的要求,是學(xué)生成績管理系統(tǒng)的一個新的理念。通過成績管理可以大大提高學(xué)校的工作效率。學(xué)生成績管理系統(tǒng)應(yīng)該完成以下兩個方面的內(nèi)容:學(xué)生檔案資料的管理、
2、學(xué)生成績的管理。通過學(xué)生成績管理系統(tǒng)可以做到信息的規(guī)范管理,科學(xué)統(tǒng)計和快速查詢、修改、增加、刪除等,減少管理方面的工作量。二主要功能該系統(tǒng)主要用于學(xué)校學(xué)生信息管理,總體任務(wù)是實現(xiàn)學(xué)生信息關(guān)系的系統(tǒng)化、規(guī)范化和自動化,其主要任務(wù)是用計算機對學(xué)生信息進行日常管理,如查詢、修改、增加、刪除,另外還考慮到用戶登錄的權(quán)限,針對學(xué)生信息和權(quán)限登錄的學(xué)生成績管理系統(tǒng)。本系統(tǒng)主要包括注冊管理、教師管理、學(xué)生信息查詢、添加、修改、刪除等部分。其主要功能有:(1) 學(xué)生信息的添加,包括輸入學(xué)生基本信息和成績。(2) 學(xué)生信息的查詢,包括查詢學(xué)生的基本信息和成績。(3) 學(xué)生信息的修改,包括修改學(xué)生基本信息和成績。
3、(4) 學(xué)生信息的刪除,包括刪除學(xué)生基本信息和成績。(5) 登錄用戶密碼修改,用戶登錄到系統(tǒng)可進行相應(yīng)的用戶密碼修改。(6) 管理員用戶對用戶名的管理,包括添加新用戶、刪除用戶。 學(xué)生成績管理系統(tǒng)是典型的信息管理系統(tǒng),其開發(fā)主要包括后臺數(shù)據(jù)庫的建立和維護以及前端應(yīng)用程序開發(fā)兩個方面。對于前者要求建立起數(shù)據(jù)一致性和完整性強、數(shù)據(jù)安全性好的數(shù)據(jù)庫。對于后者則要求應(yīng)用程序功能完備,易使用。該管理系統(tǒng)我使用的是Microsoft Visual Studio 2012 及 Microsoft SQL Server 2008。系統(tǒng)功能流程圖圖 2.1 系統(tǒng)功能流程三數(shù)據(jù)庫設(shè)計3.1本系統(tǒng)的數(shù)據(jù)庫采用的是S
4、QL Server2008 。該數(shù)據(jù)庫包括學(xué)生成績表、用戶登錄表用于紀(jì)錄學(xué)生的基本信息數(shù)據(jù)庫表結(jié)構(gòu)如下:成績表物理結(jié)構(gòu)圖3.1圖3.2用戶登錄表物理結(jié)構(gòu):圖3.3圖3.43.2觸發(fā)器刪除DLB中的記錄時同時刪除CJB中姓名相同的記錄USE studentscoreGO/* Object: Trigger dbo.dlb_delete Script Date: 01/07/2015 12:42:17 */SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER trigger dbo.dlb_deleteon dbo.dlb after deletea
5、sbegindeclare leib varchar(50) select leib='學(xué)生'from deleteddelete from cjb where 姓名 in (select 用戶名 from deleted)End3.3數(shù)據(jù)庫連接 string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalog=studentscore;Data Source=YANJING" SqlConnection conn = new SqlConnecti
6、on(constr); string sqlstr = "select * from cjb" SqlCommand cmd = new SqlCommand(sqlstr, conn); SqlDataReader reader = cmd.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read() string id = reader"學(xué)號".ToString(); string name = reader"姓名".ToString(); MessageBox
7、.Show(string.Format("id=0,name=1,學(xué)號,姓名"); 四系統(tǒng)實現(xiàn) 4.1.登錄界面圖4.1該界面是學(xué)生成績管理系統(tǒng)的登錄界面,可以選擇作為學(xué)生,管理員或者教師身份登錄。每一個進入系統(tǒng)的人都會看到當(dāng)前的時間,在登錄時只有用戶名,密碼,與身份相符合時才能進入系統(tǒng),否則登錄無法成功。using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using
8、 System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Data.SqlClient;namespace WindowsFormsApplication1 public partial class Form1 : Form static public string sn, sub; public Form1() InitializeComponent(); Form2 fr2 = new Form2(); Form3 fr3 = new Form3(); Form4 fr4 = new
9、Form4(); private void Form1_Load(object sender, EventArgs e) timer1.Start(); private void label1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalog=studentscore;Data Sou
10、rce=YANJING" SqlConnection conn = new SqlConnection(constr); conn.Open(); if (textname.Text = "" | textpassword.Text = "") MessageBox.Show("信息不全,請不要遺漏信息!"); if (rbtnmanager.Checked) string cstr = "select * from dlb where 類別='管理員' and 用戶名='" +
11、textname.Text.Trim() + "'and 密碼='" + textpassword.Text.Trim() + "'" SqlCommand comm = new SqlCommand(cstr, conn); SqlDataReader dr = comm.ExecuteReader(); if (dr.Read() sn = textname.Text.Trim(); fr4.Show(); this.Visible = false; ; else MessageBox.Show("密碼或用戶名出錯,
12、請重新輸入!"); textname.Text = "" textpassword.Text = "" if (rbtnteacher.Checked) string cstr = "select * from dlb where 類別='教師' and 用戶名='" + textname.Text.Trim() + "'and 密碼='" + textpassword.Text.Trim() + "'" SqlCommand comm
13、= new SqlCommand(cstr, conn); SqlDataReader dr = comm.ExecuteReader(); if (dr.Read() sn = textname.Text.Trim(); sub = dr.GetValue(3).ToString(); fr3.Show(); this.Visible = false; else MessageBox.Show("密碼或用戶名出錯,請重新輸入!"); textname.Text = "" textpassword.Text = "" if (rbtn
14、student.Checked) string cstr = "select * from dlb where 類別='學(xué)生' and 用戶名='" + textname.Text.Trim() + "'and 密碼='" + textpassword.Text.Trim() + "'" SqlCommand comm = new SqlCommand(cstr, conn); SqlDataReader dr = comm.ExecuteReader(); if (dr.Read()
15、sn = textname.Text.Trim(); fr2.Show(); this.Visible = false; else MessageBox.Show("密碼或用戶名出錯,請重新輸入!"); textname.Text = "" textpassword.Text = "" conn.Close(); conn.Dispose(); private void button2_Click(object sender, EventArgs e) Application.Exit(); private void timer1_T
16、ick(object sender, EventArgs e) label4.Text = "當(dāng)前時間:" + DateTime.Now.ToLongDateString() + "" + DateTime.Now.ToLongTimeString(); 4.2學(xué)生成績管理圖4.2設(shè)計過程: 此部分主要針對學(xué)生信息的管理,可以查詢學(xué)生的所有成績信息,實現(xiàn)成績的添加、刪除、修改、計算平均分等功能。還可以修改當(dāng)前用戶下的密碼。 private void Form2_Load(object sender, EventArgs e) label1.Te
17、xt = Form1.sn + "同學(xué),歡迎你進入成績管理系統(tǒng)!" timer1.Start(); groupBox1.Visible = false; groupBox2.Visible = false; private void button1_Click(object sender, EventArgs e) private void button3_Click(object sender, EventArgs e) / string constr = "Password=null;Persist Security Info=True;User ID=BIN
18、IANDOUKOUadministrator;Initial Catalog=studentscore;Data Source=BINIANDOUKOUSQLEXPRESS" /SqlConnection conn = new SqlConnection(constr); /conn.Open(); /SqlDataAdapter da = new SqlDataAdapter("Select * from cjb where 姓名="+textBox1 .Text , conn); /DataSet ds = new DataSet(); /da.Fill(ds
19、, "usertable"); /dataGridView1.DataSource = ; private void toolStripButton1_Click(object sender, EventArgs e) dataGridView1.Visible = true; groupBox1.Visible = false; groupBox2.Visible = false; string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalog=stu
20、dentscore;Data Source=YANJING" SqlConnection conn = new SqlConnection(constr); conn.Open(); SqlDataAdapter da = new SqlDataAdapter("select * from cjb where 姓名='" + Form1.sn.Trim() + "'", conn);/-詳細(xì)信息 DataSet ds = new DataSet(); da.Fill(ds, "usertable"); dat
21、aGridView1.DataSource = ds.Tables"usertable".DefaultView; conn.Close(); conn.Dispose(); private void toolStripButton2_Click(object sender, EventArgs e) private void toolStripButton4_Click(object sender, EventArgs e) groupBox1.Visible = true; private void button1_Click_1(object sender, Even
22、tArgs e) string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalog=studentscore;Data Source=YANJING" SqlConnection conn = new SqlConnection(constr); conn.Open(); if (textnpd.Text != textpassword.Text) MessageBox.Show("密碼輸入有誤,請重新輸入"); if (textnpd.Text
23、 = "" && textpassword.Text = "") MessageBox.Show("密碼不允許為空!"); if (textnpd.Text=textpassword.Text && textnpd.Text !="") SqlCommand com = new SqlCommand("update dlb set 密碼='" + textpassword.Text.Trim() + "'where 用戶名='&q
24、uot; + Form1.sn.Trim() + "'", conn); if (com.ExecuteNonQuery() = 1) MessageBox.Show("密碼更改成功"); groupBox1.Visible = false; conn.Close(); conn.Dispose(); private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) private void toolStripButton5_Click(
25、object sender, EventArgs e) this.Close(); Form1 l = new Form1(); l.Visible = true; private void toolStripButton6_Click(object sender, EventArgs e) / string constr = "Password=null;Persist Security Info=True;User ID=BINIANDOUKOUadministrator;Initial Catalog=studentscore;Data Source=BINIANDOUKOUS
26、QLEXPRESS" /SqlConnection conn = new SqlConnection(constr); /conn.Open(); /SqlDataAdapter da = new SqlDataAdapter("Select * from cjb where 姓名="+textBox1 .Text , conn); /DataSet ds = new DataSet(); /da.Fill(ds, "usertable"); /string s; /for(int i=2;i <=6;i+) / / if (int.Pa
27、rse(ds.Tables"usertable".Rows0i.ToString() <60) / s=int.Parse(ds.Tables"usertable".Rows0i.ToString(); / private void groupBox2_Enter(object sender, EventArgs e) dataGridView1.Visible = false; groupBox1.Visible = false; private void toolStripButton3_Click(object sender, EventAr
28、gs e) groupBox2 .Visible=true; string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalog=studentscore;Data Source=YANJING" SqlConnection conn = new SqlConnection(constr); conn.Open(); SqlDataAdapter da = new SqlDataAdapter("Select * from cjb where 姓名='
29、;"+Form1 .sn .Trim ()+"'" , conn); DataSet ds = new DataSet(); da.Fill(ds, "usertable"); int max=0,min=1001; double ave = 0.0; for(int i=2;i <=6;i+) if(int.Parse(ds.Tables"usertable".Rows0i.ToString()>max) max=int.Parse(ds.Tables"usertable".Rows
30、0i.ToString(); if (int.Parse(ds.Tables"usertable".Rows0i.ToString()<min ) min=int.Parse(ds.Tables"usertable".Rows0i.ToString(); txthscore.Text=max.ToString(); txtlscore.Text=min.ToString(); txtall.Text=ds.Tables"usertable".Rows0"總分".ToString(); ave=int.Pars
31、e(ds.Tables"usertable".Rows0"總分".ToString()/(double)5; txtave.Text=ave.ToString(); conn.Close();conn.Dispose(); private void timer1_Tick(object sender, EventArgs e) label2.Text="當(dāng)前時間:"+DateTime.Now.ToLongDateString()+DateTime.Now.ToLongTimeString(); 4.3教師管理界面 圖4.3設(shè)計過程:&
32、#160;此部分主要針對教師信息管理,可以查詢學(xué)生的所有成績信息,實現(xiàn)成績的添加、刪除、修改、成績升序排序等功能。還可以修改當(dāng)前用戶下的密碼。private void button1_Click(object sender, EventArgs e) /查找 string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalog=studentscore;Data Source=YANJING" SqlConnection conn= new SqlConnection(
33、constr); conn.Open(); if (comboBox1.Text="學(xué)號") SqlCommand cm=new SqlCommand("select 學(xué)號,"+Form1 .sub + "from cjb where 學(xué)號='"+ textBox1.Text+"'",conn ); if (cm.ExecuteScalar ()=null)MessageBox.Show("用戶名不存在"); else SqlDataAdapter da =new SqlData
34、Adapter("select 學(xué)號,"+Form1.sub+" from cjb where 學(xué)號='"+textBox1.Text+"'",conn); DataSet ds =new DataSet(); da.Fill (ds ,"chaxun"); dataGridView1.DataSource=ds.Tables"chaxun".DefaultView; if (comboBox1.Text="姓名") SqlCommand cm=new Sql
35、Command("select 姓名," + Form1.sub + "from cjb where 姓名='" + textBox1.Text+"'",conn ); if (cm.ExecuteScalar()=null)MessageBox.Show("該用戶不存在"); else SqlDataAdapter da = new SqlDataAdapter("select 姓名,"+Form1.sub + " from cjb where 姓名='&qu
36、ot; + textBox1.Text + "'",conn ); DataSet ds = new DataSet(); da.Fill (ds,"table"); dataGridView1.DataSource=ds.Tables"table".DefaultView; conn.Close();conn.Dispose(); private void textBox1_TextChanged(object sender, EventArgs e) private void toolStripButton2_Click(
37、object sender, EventArgs e) /查找 groupBox3 .Visible =false ; groupBox1.Enabled = true; groupBox2.Enabled = false; private void toolStripButton1_Click(object sender, EventArgs e) /所有成績 groupBox3.Visible = true; string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalo
38、g=studentscore;Data Source=YANJING" SqlConnection conn = new SqlConnection(constr); conn.Open(); SqlDataAdapter da = new SqlDataAdapter("select 學(xué)號,姓名," + Form1.sub + " from cjb ",conn); DataSet ds = new DataSet(); da.Fill(ds, "table"); dataGridView1 .DataSource =ds
39、.Tables "table".DefaultView; conn.Close ();conn .Dispose(); private void button2_Click(object sender, EventArgs e) /修改成績 string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalog=studentscore;Data Source=YANJING" SqlConnection conn = new SqlConnectio
40、n(constr); conn.Open(); SqlCommand com = new SqlCommand("update cjb set " + Form1.sub + "='" + textBox3.Text + "'where 姓名 ='" + textBox4.Text + "'", conn); if (com.ExecuteNonQuery() = 1) MessageBox.Show("修改成功"); else MessageBox.Show(&
41、quot;信息有誤,請重新輸入"); conn.Close(); conn.Dispose(); private void toolStripButton3_Click(object sender, EventArgs e) /修改學(xué)生成績 groupBox3 .Visible =false ; groupBox2.Enabled = true; groupBox1.Enabled = false; groupBox3.Visible = false; private void textBox3_TextChanged(object sender, EventArgs e) priv
42、ate void groupBox2_Enter(object sender, EventArgs e) private void button3_Click(object sender, EventArgs e) /確認(rèn)修改密碼 string constr = "Password=617804;Persist Security Info=True;User ID=ywj;Initial Catalog=studentscore;Data Source=YANJING" SqlConnection conn = new SqlConnection(constr); conn
43、.Open(); if (txtnpd.Text != txtnpassword.Text) MessageBox.Show("兩次輸入密碼不一致,請重新輸入"); if (txtnpd.Text = "" && txtnpassword.Text = "") MessageBox.Show("密碼不允許為空,請輸入密碼"); if (txtnpd.Text = txtnpassword.Text && txtnpd.Text != "") SqlCommand
44、com = new SqlCommand("update dlb set 密碼='" + txtnpassword.Text.Trim() + "'where 用戶名='" + Form1.sn.Trim() + "'", conn); if (com.ExecuteNonQuery() = 1) MessageBox.Show("密碼更改成功"); groupBox1.Visible = true; conn.Close(); conn.Dispose(); private voi
45、d toolStripButton5_Click(object sender, EventArgs e) groupBox4.Visible = true; groupBox3.Visible = true; dataGridView1.Visible = false; private void toolStripButton4_Click(object sender, EventArgs e) /升序排序 groupBox3.Visible = true; string constr = "Password=617804;Persist Security Info=True;Use
46、r ID=ywj;Initial Catalog=studentscore;Data Source=YANJING" SqlConnection conn = new SqlConnection(constr); conn.Open(); SqlDataAdapter da = new SqlDataAdapter("select 學(xué)號,姓名," + Form1.sub + " from cjb order by " + Form1.sub + " desc ", conn); DataSet ds = new DataSe
47、t(); da.Fill(ds, "table"); dataGridView1.DataSource = ds.Tables"table".DefaultView; conn.Close(); conn.Dispose(); private void toolStripButton6_Click(object sender, EventArgs e) this.Close(); Form1 l = new Form1(); l.Visible = true; private void timer1_Tick(object sender, EventAr
48、gs e) label8.Text = "當(dāng)前時間:" + DateTime.Now.ToLongDateString() + DateTime.Now.ToLongTimeString(); 4.4管理員管理界面 圖4.4設(shè)計過程: 此部分主要針對管理員的,可以添加和刪除所有用戶的賬號和密碼。 private void Form4_Load(object sender, EventArgs e) timer1.Start(); label1.Text = Form1.sn + "管理員,歡迎進入成績管理系統(tǒng)!" groupBox2.Enabled = false; private void label1_Click(object sender, EventArgs e) private void radio
溫馨提示
- 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度拆除工程風(fēng)險評估及應(yīng)急預(yù)案
- 2025年度新能源項目場站建設(shè)與運營管理合同
- 2025年度電池儲能系統(tǒng)設(shè)計與集成服務(wù)合同
- 2025年度商業(yè)秘密保護保密勞動合同及保密協(xié)議
- 2025年度城市道路臨時停車位租賃及交通管理合同
- 2025年度彩鋼板隔墻快速安裝服務(wù)合同
- 2025年度體育賽事贊助商提成協(xié)議
- 2025年冷墩鋼合作協(xié)議書
- 如何選擇理財顧問計劃
- 多元文化背景下的藝術(shù)教育計劃
- 實驗動物飼養(yǎng)人員崗位競聘演講范文匯報報告范文
- 商業(yè)地產(chǎn)市場競品樓盤市場調(diào)研表格
- SMT失效模式分析PFMEA
- 國際貿(mào)易地理全套課件
- 家校共育-助孩子成長-家長會課件
- 叉形件工藝及車床夾具設(shè)計說明書
- GB/T 709-2019熱軋鋼板和鋼帶的尺寸、外形、重量及允許偏差
- GB/T 5916-2008產(chǎn)蛋后備雞、產(chǎn)蛋雞、肉用仔雞配合飼料
- GB/T 14177-2003林業(yè)機械便攜式割灌機和割草機試驗方法
- 安全測試工具、蹭網(wǎng)利器wifiphisher新增漢化版
- 中學(xué)教育-中學(xué)生心理健康量表參考范本
評論
0/150
提交評論