


下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、數據庫技術及應用項目設計報告學生成績管理系統姓名:CeliaYan2015-01-07一. 設計目的及意義在如今的高校日常管理中,學生成績管理系統是其中非常重要的一環,特別是當前學校規模不斷擴大,學生人數日益增加,課程門類多,校區分散等實際情況,學生成績統計功能越來越繁重,稍有疏忽就會出現差錯。因此,學生成績管理系統更具有非常大的實際應用意義。在互聯網快速崛起的今天,改革傳統的手工錄入方式,公正,準確,及時反映學生的信息和成績的情況,以適應信息時代的要求,是學生成績管理系統的一個新的理念。通過成績管理可以大大提高學校的工作效率。學生成績管理系統應該完成以下兩個方面的內容:學生檔案資料的管理、學
2、生成績的管理。通過學生成績管理系統可以做到信息的規范管理,科學統計和快速查詢、修改、增加、刪除等,減少管理方面的工作量。二. 主要功能該系統主要用于學校學生信息管理,總體任務是實現學生信息關系的系統化、規范化和自動化,其主要任務是用計算機對學生信息進行日常管理,如查詢、修改、增加、刪除,另外還考慮到用戶登錄的權限,針對學生信息和權限登錄的學生成績管理系統。本系統主要包括注冊管理、教師管理、學生信息查詢、添加、修改、刪除等部分。其主要功能有:(1) 學生信息的添加,包括輸入學生基本信息和成績。(2) 學生信息的查詢,包括查詢學生的基本信息和成績。(3) 學生信息的修改,包括修改學生基本信息和成績
3、。(4) 學生信息的刪除,包括刪除學生基本信息和成績。(5) 登錄用戶密碼修改,用戶登錄到系統可進行相應的用戶密碼修改。(6) 管理員用戶對用戶名的管理,包括添加新用戶、刪除用戶。學生成績管理系統是典型的信息管理系統,其開發主要包括后臺數據庫的建立和維護以及前端應用程序開發兩個方面。對于前者要求建立起數據一致性和完整性強、數據安全性好的數據庫。對于后者則要求應用程序功能完備,易使用。該管理系統我使用的是MicrosoftVisualStudio2012及MicrosoftSQLServer2008。系統功能流程圖學生成務管理條毓學主威理系統轂師官J1系登錄管理靈系技退出田|除退出漬II學生1.
4、JL老肺學生三. 圖2.1系統功能流程數據庫設計3.1本系統的數據庫采用的是SQLServer2008。該數據庫包括學生成績表、用戶登錄表用于紀錄學生的基本信息數據庫表結構如下:成績表物理結構DELL4-330342SQLEu.nt5Core-dbo.cjb*允許Null值學號char(lC)LJ卜!姓名char(10)f訐算機網絡int數掘岸實用敦程int0面向對象程序設計int高教intB英諳int總分int圖3.1嘉果匚J消忌學岳件名汁尊機河藉面向對象f.序診計高數其語忌汁12宰二SOG2597B9023456273S3祁031于一Si耳76鈕04sSiE2E3我59054劑呂B?789
5、8231065劉五7504曖77區土3285B13S093林Gi晚01370圖3.2用戶登錄表物理結構:DELU-330342SLEt.nUGQr&-dba.dlb列名數據婆型允肴:Mull值用戶名vanehar(50)rIvaneha臨0)n類劇vanehar(50)-卜科目-vaneharO)iia圖3.3主媽醐耳目1池2留能234M7S93612.WB虹n4杜罟平博誓序新Is季一1ZW5678學生&1r7李=8的字生9iiUiO5M&0OT學生11011區七字生IZMC7M60茅主Io臥ImJiWiih曲時慧翻1匏員圖3.43.2觸發器刪除DLB中的記錄時同時刪除CJB中姓名相同的記錄U
6、SEstudentscoreGO/*Object:Triggerdbo.dlb_deleteScriptDate:01/07/201512:42:17*/SETANSI_NULLSONGOSETQUOTED_IDENTIFIEFONGOALTERtriggerdbo.dlb_deleteondbo.dlbafterdeleteasbegindeclareleibvarchar(50)selectleib=學生fromdeleteddeletefromcjbwhere姓名in(select用戶名fromdeleted)End3.3數據庫連接stringconstr=Password=617804
7、;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING”;SqlConnectionconn=newSqlConnection(constr);stringsqlstr=select*fromcjb”;|SqlCommanotmd=newSqlCommandsqlstr,conn);SqlDataReaderreader=cmd.ExecuteReader();DataSetds=newDataSet();while(reader.Read()(stringid=reader學號.T
8、oString();stringname=reader姓名.ToString();MessageBoxShow(string.Format(id=0,name=1,學號,姓名);系統實現4.1.登錄界面圖4.1該界面是學生成績管理系統的登錄界面,可以選擇作為學生,管理員或者教師身份登錄。在登錄時只有用戶名,密碼,與身份相符合時才每一個進入系統的人都會看到當前的時間,能進入系統,否則登錄無法成功。usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.D
9、rawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;namespaceWindowsFormsApplication1publicpartialclassForml:Formstaticpublicstringsn,sub;Form2fr2=newForm2();Form3fr3=newForm3();Form4fr4=newForm4();privatevoidForm1_Load(objectsend
10、er,EventArgse)privatevoidbutton1_Click(objectsender,EventArgse)stringconstr=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING”;SqlConnectionconn=newSqlConnection(constr);conn.Open();if(textname.Text=|textpassword.Text=)MessageBoxShow(信息不全,請不要遺漏信息!);if
11、(rbtnmanager.Checked)stringcstr=select*fromdlbwhere類別=管理員and用戶名=+textname.Text.Trim()+and密碼=+textpassword.Text.Trim()+;SqlCommancfcomm=newSqlCommandcstr,conn);SqlDataReaderdr=comm.ExecuteReader();if(dr.Read()sn=textname.Text.Trim();fr4.Show();this.Visible=false;elseMessageBoxShow(笞碼或用戶名出錯,請重新輸入!);te
12、xtname.Text=;textpassword.Text=;if(rbtnteacher.Checked)(stringcstr=select*fromdlbwhere類別=教師and用戶名=+textname.Text.Trim()+and密碼=+textpassword.Text.Trim()+;SqlCommancfcomm=newSqlCommandcstr,conn);SqlDataReaderdr=comm.ExecuteReader();if(dr.Read()(sn=textname.Text.Trim();sub=dr.GetValue(3).ToString();fr3
13、.Show();this.Visible=false;if(rbtnstudent.Checked)類別=學生and用戶名=stringcstr=select*fromdlbwhereSqlDataReaderdr=comm.ExecuteReader();if(dr.Read()(sn=textname.Text.Trim();fr2.Show();this.Visible=false;+textname.Text.Trim()+and密碼=+textpassword.Text.Trim()+SqlCommancfcomm=newSqlCommandcstr,conn);else(Messa
14、geBoxShow(笞碼或用戶名出錯,請重新輸入!);textname.Text=;textpassword.Text=;conn.Close();conn.Dispose();privatevoidbutton2Click(objectsender,EventArgse)(Application.Exit();privatevoidtimer1Tick(objectsender,EventArgse)(label4.Text=當前時間:+DateTime.Now.ToLongDateString()+DateTime.Now.ToLongTimeString();4.2學生成績管理圖4.2設
15、計過程:此部分主要針對學生信息的管理,可以查詢學生的所有成績信息,實現成績的添加、刪除、修改、計算平均分等功能。還可以修改當前用戶下的密碼。privatevoidForm2Load(objectsender,EventArgse)label1.Text=Form1.sn+”同學,歡迎你進入成績管理系統!”;timer1.Start();/stringconstr=Password=null;PersistSecurityInfo=True;UserID=BINIANDOUKOUadministrator;InitialCatalog=studentscore;DataSource=BINIAN
16、DOUKOUSQLEXPRESS”;/SqlConnectionconn=newSqlConnection(constr);/conn.Open();/SqlDataAdapterda=newSqlDataAdapter(Select*fromcjbwhere姓名=+textBox1.Text,conn);/DataSetds=newDataSet();|/da.Fill(ds,usertable);/dataGridView1.DataSource=;privatevoidtoolStripButton1_Click(objectsender,EventArgse)dataGridView1
17、.Visible=true;groupBox1.Visible=false;groupBox2.Visible=false;stringconstr=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING;SqlConnectionconn=newSqlConnection(constr);conn.Open();SqlDataAdapterda=newSqlDataAdapter(select*fromcjbwhere姓名=+Form1.sn.Trim
18、()+,,conn);/-詳細信息DataSetds=newDataSet();da.Fill(ds,usertable);dataGridView1.DataSource=ds.Tablesusertable.DefaultView;conn.Close();conn.Dispose();|privatevoidtoolStripButton2Click(objectsender,EventArgse)privatevoidtoolStripButton4Click(objectsender,EventArgse)groupBox1.Visibletrue;privatevoidbutton
19、1_Click_1(objectsender,EventArgse)(stringconstr=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING”;SqlConnectionconn=newSqlConnection(constr);conn.Open();if(textnpd.Text!=textpassword.Text)(MessageBoxShow(密碼輸入有誤,請重新輸入);if(textnpd.Text=&textpassword.Te
20、xt=)(MessageBoxShow(密碼不允許為空!);if(textnpd.Text=textpassword.Text&textnpd.Text!=)(SqlCommancfcom=newSqlCommandupdatedlbset密碼=+textpassword.Text.Trim()+where用戶名=+Form1.sn.Trim()+,conn);if(com.ExecuteNonQuery()=1)(MessageBoxShow(密碼更改成功);groupBox1.Visible=false;conn.Close();conn.Dispose();privatevoiddata
21、GridView1_CellContentClick(objectsender,DataGridViewCellEventArgse)(privatevoidtoolStripButton5Click(objectsender,EventArgse)(this.Close();Form1l=newForm1();l.Visible=trueprivatevoidtoolStripButton6_Click(objectsender,EventArgse)(/stringconstr=Password=null;PersistSecurityInfo=True;UserID=BINIANDOUK
22、OUadministrator;InitialCatalog=studentscore;DataSource=BINIANDOUKOUSQLEXPRESS”;/SqlConnectionconn=newSqlConnection(constr);/conn.Open();/SqlDataAdapterda=newSqlDataAdapter(Select*fromcjbwhere姓名=+textBox1.Text,conn);/DataSetds=newDataSet();|/da.Fill(ds,usertable);/strings;/for(inti=2;i=6;i+)/(/if(int
23、.Parse(ds.Tablesusertable.Rows0i.ToString()60)/s=int.Parse(ds.Tablesusertable.Rows0i.ToString();/privatevoidgroupBox2Enter(objectsender,EventArgse)(dataGridView1.Visible=false;groupBox1.Visible=falseprivatevoidtoolStripButton3_Click(objectsender,EventArgse)(groupBox2.Visible=true;stringconstr=Passwo
24、rd=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING;SqlConnectionconn=newSqlConnection(constr);conn.Open();SqlDataAdapterda=newSqlDataAdapter(Select*fromcjbwhere姓名=+Form1.sn.Trim()+,conn);DataSetds=newDataSet();da.Fill(ds,usertable);intmax=0,min=1001;doubleav
25、e=0.0;for(inti=2;imax)max=nt.Parse(ds.Tablesusertable.Rows0i.ToString();if(int.Parse(ds.Tablesusertable.Rows0i.ToString()min)min=int.Parse(ds.Tablesusertable.Rows0i.ToString();txthscore.Text=max.ToString();txtlscore.Text=min.ToString();txtall.Text=ds.Tablesusertable.Rows0總分.ToString();ave=int.Parse(
26、ds.Tablesusertable.Rows0總分.ToString()/(double)5;txtave.Text=ave.ToString();conn.Close();conn.Dispose();privatevoidtimer1_Tick(objectsender,EventArgse)(label2.Text=”當前時間:+DateTime.Now.ToLongDateString()+DateTime.Now.ToLongTimeString();4.3教師管理界面圖4.3設計過程:此部分主要針對教師信息管理,可以查詢學生的所有成績信息,實現成績的添加、刪除、修改、成績升序排序
27、等功能。還可以修改當前用戶下的密碼。privatevoidbutton1_Click(objectsender,EventArgse)/查找(stringconstr=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING;SqlConnectionconn=newSqlConnection(constr);conn.Open();if(comboBox1.Text=學號)(SqlCommandcm=newSqlCommandselect學號,+Form
28、1.sub+fromcjbwhere學號=+textBox1.Text+,conn);if(cm.ExecuteScalar()=null)MessageBoxShow(用戶名不存在);else(SqlDataAdapterda=newSqlDataAdapter(select學號,+Form1.sub+fromcjbwhere學號=+textBox1.Text+”m,conn);DataSetds=newDataSet();da.Fill(ds,chaxun);dataGridView1.DataSource=ds.Tableschaxun.DefaultView;if(comboBox1.
29、Text=姓名)(SqlCommanccm=newSqlCommandselect姓名,+Form1.sub+fromcjbwhere姓名=+textBox1.Text+,conn);if(cm.ExecuteScalar()=null)MessageBoxShow(該用戶不存在);elseSqlDataAdapterda=newSqlDataAdapter(select姓名,+Form1.sub+fromcjbwhere姓名:=+textBox1.Text+”,conn);DataSetds=newDataSet();da.Fill(ds,table);dataGridView1.DataS
30、ource=ds.Tablestable.DefaultView;conn.Close();conn.Dispose();groupBox3.Visible=true;stringconstr=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING;SqlConnectionconn=newSqlConnection(constr);conn.Open();SqlDataAdapterda=newSqlDataAdapter(select學號,姓名,+F
31、orm1.sub+fromcjb,conn);DataSetds=newDataSet();da.Fill(ds,table);dataGridView1.DataSource=ds.Tablestable.DefaultView;conn.Close();conn.Dispose();privatevoidbutton2_Click(objectsender,EventArgse)/修改成績stringconstr=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSourc
32、e=YANJING;SqlConnectionconn=newSqlConnection(constr);conn.Open();SqlCommandcom=newSqlComman(updatecjbset+Form1.sub+=+textBox3.Text+where姓名=+textBox4.Text+,conn);if(com.ExecuteNonQuery()=1)MessageBoxShow(修改成功);elseMessageBoxShow(信息有誤,請重新輸入);conn.Close();conn.Dispose();privatevoidtoolStripButton3_Clic
33、k(objectsender,EventArgse)/修改學生成績groupBox3.Visible=false;groupBox2.Enabled=true;groupBox1.Enabled=false;groupBox3.Visible=falseprivatevoidtextBox3TextChanged(objectsender,EventArgse)privatevoidgroupBox2_Enter(objectsender,EventArgse)privatevoidbutton3_Click(objectsender,EventArgse)/確認修改密碼stringconst
34、r=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING;SqlConnectionconn=newSqlConnection(constr);conn.Open();if(txtnpd.Text!=txtnpassword.Text)(MessageBoxShow(兩次輸入密碼不一致,請重新輸入);if(txtnpd.Text=:=&txtnpassword.Text=)(MessageBoxShow(密碼不允許為空,請輸入密碼);if(txtnpd
35、.Text=txtnpassword.Text&txtnpd.Text!=)(SqlCommancfcom=newSqlCommandupdatedlbset密碼=+txtnpassword.Text.Trim()+where用戶名=+Form1.sn.Trim()+”,conn);if(com.ExecuteNonQuery()=1)(MessageBoxShow(密碼更改成功);groupBox1.Visible=true;conn.Close();conn.Dispose();privatevoidtoolStripButton5_Click(objectsender,EventArgs
36、e)(groupBox4.Visible=true;groupBox3.Visible=true;dataGridView1.Visible=false;_|privatevoidtoolStripButton4_Click(objectsender,EventArgse)/升序排序(groupBox3.Visible=true;stringconstr=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCatalog=studentscore;DataSource=YANJING;SqlConnectionconn=newS
37、qlConnection(constr);conn.Open();SqlDataAdapterda=newSqlDataAdapter(select學號,姓名,+Form1.sub+fromcjborderby+Form1.sub+desc,conn);DataSetds=newDataSet();da.Fill(ds,table);dataGridView1.DataSource=ds.Tablestable.DefaultView;conn.Close();conn.Dispose();|privatevoidtoolStripButton6Click(objectsender,Event
38、Argse)(this.Close();Form1l=newForm1();l.Visible=true;privatevoidtimer1_Tick(objectsender,EventArgse)(label8.Text=當前時間:+DateTime.Now.ToLongDateString()+DateTime.Now.ToLongTimeString();4.4管理員管理界面圖4.4設計過程:此部分主要針對管理員的,可以添加和刪除所有用戶的賬號和密碼。privatevoidForm4_Load(objectsender,EventArgse)(timer1.Start();label1
39、.Text=Form1.sn+”管理員,歡迎進入成績管理系統!groupBox2.Enabled=false;privatevoidlabel1Click(objectsender,EventArgse)(privatevoidradioButton1_CheckedChanged(objectsender,EventArgse)(if(radioButton1.Checked)(groupBox2.Enabled=true;txtkm.Enabled=true;privatevoidradioButton2_CheckedChanged(objectsender,EventArgse)(if
40、(radioButton2.Checked)(groupBox2.Enabled=truetxtkm.Enabled=false;privatevoidtxtyhmTextChanged(objectsender,EventArgse)(privatevoidbutton2Click(objectsender,EventArgse)(txtkm.Text=txtmm.Text=txtyhm.Text=privatevoidbutton3Click(objectsender,EventArgse)(this.Close();Formll=newForm1();l.Visible=true;pri
41、vatevoidlabel5Click(objectsender,EventArgse)(privatevoidtimer1_Tick(objectsender,EventArgse)(label5.Text=”當前時間:+DateTime.Now.ToLongDateString()+DateTime.Now.ToShortTimeString();privatevoidbutton1Click(objectsender,EventArgse)stringconstr=Password=617804;PersistSecurityInfo=True;UserID=ywj;InitialCat
42、alog=studentscore;DataSource=YANJING”;SqlConnectionconn=newSqlConnection(constr);conn.Open();if(radioButton1.Checked)System.Console.Out.WriteLine();if(txtyhm.Text!=&txtmm.Text!=&txtkm.Text!=)SqlCommancfcom=newSqlCommand(select*fromdlbwhere用戶名+txtyhm.Text.Trim()+,conn);if(com.ExecuteScalar()!=null)MessageBox.Show(用戶已存在);elseSqlCommandcm=newSqlCommand(insertintodlb(用戶名,密碼,類別,科目)values(+txtyhm.Tex
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 新解讀《CB-T 33-1999索具套環》新解讀
- 生物●海南卷丨2022年海南省普通高中學業水平選擇性考試高考生物真題試卷及答案
- Brand KPIs for health insurance:IKK in Germany-英文培訓課件2025.4
- 強化性間歇訓練對高中田徑專項隊800m跑運動員身體機能訓練效果的研究
- 重慶市2022-2023學年高二下學期期末聯合診斷檢測化學試題(含答案)
- 汽車傳感器與檢測技術電子教案:廢氣再循環系統電位計式EGR閥傳感器
- 基礎建成后續管理制度
- 財務信息管理人才培養方案
- 醫院質量病歷管理制度
- 培訓人員日常管理制度
- 農村三資管理
- 【初中地理】七年級地理下冊全冊期末總復習(課件)-2024-2025學年七年級地理課件(人教版2024年)
- 2025年全國青少年禁毒知識競賽題庫附答案(共150題)
- 道路工程外文文獻翻譯
- 王洪圖黃帝內經80課時講稿
- A4作文格子紙打印版文檔
- 北京交通大學集成直流穩壓電源的設計
- dsa技師試題1全國大型醫用設備工程技術人員上崗資質考核試卷DSA
- (完整word版)全國教育科學規劃課題申請書
- 新通用大學英語綜合教程2(第2冊)U3課后答案及課件(第三單元unit03)高等教育出版社
- 某區發展現代都市型農業經驗匯報材料農業項目匯報材料.doc
評論
0/150
提交評論