版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
教務(wù)管理系統(tǒng)數(shù)據(jù)庫(kù)(SQLServer+delphi7)試驗(yàn)匯報(bào)班級(jí):7姓名:787學(xué)號(hào):787指導(dǎo)老師:完成日期:目錄系統(tǒng)概述……………3系統(tǒng)分析……………3系統(tǒng)設(shè)計(jì)……………4系統(tǒng)功效……………9系統(tǒng)實(shí)現(xiàn)……………9源程序附錄…………15參考文件……………73系統(tǒng)概述學(xué)校學(xué)生管理信息系統(tǒng)是針對(duì)學(xué)校人事處大量業(yè)務(wù)處理工作而開發(fā)管理軟件,是經(jīng)典管理信息系統(tǒng)(ManagementInformationSystem)。它是一個(gè)教育單位不可缺乏部分,它內(nèi)容對(duì)于學(xué)校決議者和管理者來說全部至關(guān)關(guān)鍵,它能夠?yàn)橛脩籼峁┏渥阈畔⒑涂旖莶樵兪侄?。能有效幫助學(xué)校和老師掌握學(xué)生情況,為學(xué)生提供成績(jī)跟課程方面查詢。本系統(tǒng)是以delphi7編輯用戶界面,以SQLserver為數(shù)據(jù)源后臺(tái)而成學(xué)生信息管理系統(tǒng)。本系統(tǒng)是以計(jì)算機(jī)為基礎(chǔ),由人和計(jì)算機(jī)結(jié)合對(duì)信息進(jìn)行搜集、存放、維護(hù)、加工、傳輸和使用一個(gè)管理系統(tǒng),其目標(biāo)是使人流、物流、資金流和信息流處于最好狀態(tài),以最少資源投入取得最好綜合效益。本系統(tǒng)關(guān)鍵包含學(xué)生信息管理模塊、老師信息管理模塊、課程信息管理模塊、成績(jī)信息管理模塊和系統(tǒng)維護(hù)模塊等部分。在校務(wù)管理中,為相關(guān)部門提供完整、綜合、共享信息,對(duì)于學(xué)校教育管理、教務(wù)和科研等全部有很大實(shí)用價(jià)值。第二章系統(tǒng)分析1、問題定義伴隨科學(xué)技術(shù)不停提升,計(jì)算機(jī)科學(xué)日漸成熟,其強(qiáng)大功效已為大家深刻認(rèn)識(shí),它已進(jìn)入大家生活各個(gè)領(lǐng)域,并發(fā)揮了越來越關(guān)鍵作用,針對(duì)人工管理缺點(diǎn),最好處理措施就是借助計(jì)算機(jī)技術(shù)提供一個(gè)電子化學(xué)生信息管理平臺(tái)。為了愈加好地管理學(xué)生和教職員資料文檔,我開發(fā)一個(gè)軟件工程學(xué)生信息管理系統(tǒng)。老師和學(xué)生能夠應(yīng)用該系統(tǒng)實(shí)現(xiàn)以下功效:1、可隨時(shí)查詢出不一樣系及各系老師和各系學(xué)生情況,系、老師和學(xué)生各反應(yīng)以下情況:系:系號(hào)、系名、系責(zé)任人、專業(yè)數(shù)等。老師:工號(hào)、姓名、性別、職稱、工齡、出生年月、基礎(chǔ)工資等。學(xué)生:學(xué)號(hào)、姓名、性別、年紀(jì)等。2、為簡(jiǎn)單起見老師和學(xué)生區(qū)分系別,而課程不分系,課程需反應(yīng)以下信息:課程代號(hào)、課程名、課時(shí)數(shù)、必修課、學(xué)分。3、學(xué)生入課時(shí)新生需錄入登記,登記后即可選課學(xué)習(xí)課程(一學(xué)期約20學(xué)分)。4、一門只由一位老師上,一位老師可上多門課,滿30人才開課。5、學(xué)生選每門課有個(gè)成績(jī),若成績(jī)不及格則補(bǔ)考后還需統(tǒng)計(jì)補(bǔ)考成績(jī)。1)在某數(shù)據(jù)庫(kù)管理系統(tǒng)中建立各關(guān)系模式對(duì)應(yīng)庫(kù)表,并設(shè)計(jì)所需視圖、索引等。2)能對(duì)各庫(kù)表進(jìn)行輸入、修改、刪除、添加、查詢、打印等基礎(chǔ)操作。3)新生入校登記后可即時(shí)選課,老生每學(xué)期開始前可選課或作選課調(diào)整,通常要選共約20學(xué)分若干門課程。4)能明細(xì)查詢某學(xué)生選課情況及某課程選修學(xué)生情況。5)能統(tǒng)計(jì)查詢出某學(xué)生成績(jī)單(包含總成績(jī)、平均成績(jī)、不及格門數(shù)等)及某門課選課人數(shù)、最高分、最低分、平均成績(jī)等統(tǒng)計(jì)信息。6)能分析出某老師教學(xué)質(zhì)量情況(可依據(jù)該老師所任全部課優(yōu)良數(shù)平均超出一定百分比來粗略評(píng)定)。7)其它你認(rèn)為子系統(tǒng)應(yīng)有查詢、統(tǒng)計(jì)功效。8)要求子系統(tǒng)設(shè)計(jì)得界面友好,功效選擇方便合理,并合適考慮子系統(tǒng)在其安全性、完整性、備份、恢復(fù)等方面功效要求2、可行性分析1.項(xiàng)目目標(biāo):學(xué)生和老師能夠方便進(jìn)行各自所需要信息管理活動(dòng),同時(shí)能夠查詢和修改各自信息,方便學(xué)校管理。2.運(yùn)行環(huán)境:(1)以Windows98以上/ME//XP作為學(xué)生選課管理系統(tǒng)后臺(tái)操作系統(tǒng)。(2)前臺(tái)開發(fā)程序?yàn)镈ELPHI,SQLServer。(3)后臺(tái)數(shù)據(jù)SQLServer。(4)關(guān)鍵硬件設(shè)備:PC機(jī)一臺(tái)。。3.技術(shù)可行性:本系統(tǒng)僅僅簡(jiǎn)單實(shí)現(xiàn)了教務(wù)管理系統(tǒng)基礎(chǔ)功效和需求,含有一定實(shí)用性。但真正意義上大型信息管理存放還是不太現(xiàn)實(shí)。對(duì)于大量信息維護(hù)也不含有很強(qiáng)穩(wěn)定性。不過操作簡(jiǎn)單,適合小型學(xué)生信息管理,維護(hù)也更為方便。技術(shù)要求也不是很高,有一點(diǎn)delphi和SQLserver技術(shù)基礎(chǔ)就行了。4.總體分析:成本低,犯錯(cuò)率低,使學(xué)校實(shí)現(xiàn)現(xiàn)代化網(wǎng)絡(luò)教學(xué)管理。系統(tǒng)設(shè)計(jì)依據(jù)該系統(tǒng)需求,數(shù)據(jù)庫(kù)采取MicrosoftSQLServer,它完全設(shè)和本系統(tǒng)工作需求,它所支持字段數(shù)據(jù)類型包含數(shù)值、字符、日期時(shí)間及二進(jìn)制和圖片等類型,是目前主流數(shù)據(jù)庫(kù)產(chǎn)品之一。它還含有性能穩(wěn)定、便于操作維護(hù)和含有很好安全可靠性等特點(diǎn),是作為服務(wù)器端數(shù)據(jù)庫(kù)平臺(tái)理想選擇。依據(jù)系統(tǒng)需求,系統(tǒng)用到多種數(shù)據(jù)表以下圖所表示。學(xué)生信息表老師信息表課程信息表管理信息表老師課程表成績(jī)信息表表和表之間關(guān)系以下圖所表示: 成績(jī)?cè)u(píng)定查詢成績(jī)查詢課程查詢新增刪除修改查詢查詢修改密碼修改密碼修改密碼個(gè)人信息個(gè)人信息個(gè)人信息網(wǎng)上選課開通選課修改新增刪除修改新增刪除管理員教職員學(xué)生E-R關(guān)系圖成績(jī)?cè)u(píng)定查詢成績(jī)查詢課程查詢新增刪除修改查詢查詢修改密碼修改密碼修改密碼個(gè)人信息個(gè)人信息個(gè)人信息網(wǎng)上選課開通選課修改新增刪除修改新增刪除管理員教職員學(xué)生
系統(tǒng)功效學(xué)生模塊此模塊為學(xué)生操作模塊。學(xué)生能夠經(jīng)過此模塊實(shí)現(xiàn)查看個(gè)人信息、修改密碼、查看課程信息、才查看成績(jī)信息、網(wǎng)上選課(在管理員開通選課前提下)很多功效。教職員模塊此模塊為教職員操作模塊。教職員能夠經(jīng)過此模塊實(shí)現(xiàn)查看個(gè)人信息、修改密碼、查看課程信息、輸入學(xué)生平時(shí)成績(jī)和期末成績(jī)很多功效。系統(tǒng)管理員模塊此模塊為系統(tǒng)管理員操作模塊。系統(tǒng)管理員能夠經(jīng)過此模塊實(shí)現(xiàn)查看管理員信息、修改密碼、查看、新增、修改、刪除學(xué)生信息、查看、新增、刪除、修改教職員信息、查看、新增、刪除、修改課程信息、開通、關(guān)閉選課很多功效。系統(tǒng)實(shí)現(xiàn)1.主界面2.登陸界面3.學(xué)生界面(1)查看個(gè)人信息(2)修改密碼(3)成績(jī)查詢(4)課程查詢(5)網(wǎng)上選課選課提醒選課界面已選提醒成功提醒刪除提醒教職員界面?zhèn)€人信息(同學(xué)生界面)修改密碼(同學(xué)生界面)課程查詢(同學(xué)生界面)成績(jī)?cè)u(píng)定管理員界面?zhèn)€人信息(同學(xué)生界面)修改密碼(同學(xué)生界面)學(xué)生查詢管理學(xué)生信息修改老師信息查詢老師信息修改課程信息查詢課程信息修改成績(jī)查詢?cè)闯绦蚋戒泆nitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,ExtCtrls,StdCtrls,Unit2,jpeg,DB,ADODB;typeTForm1=class(TForm)Button1:TButton;Button2:TButton;Panel1:TPanel;Image1:TImage;Label1:TLabel;Label2:TLabel;ADOConnection1:TADOConnection;Timer1:TTimer;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureTimer1Timer(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm1:TForm1;implementation{$R*.dfm}procedureTForm1.Button1Click(Sender:TObject);beginForm2.ManualDock(Form1.Panel1,nil,alNone);Form2.Show;Panel1.Visible:=True;end;procedureTForm1.Button2Click(Sender:TObject);beginifMessageDlg('確定退出整個(gè)系統(tǒng)嗎?',mtConfirmation,[mbYes,mbNo],0)=mrYesthenbeginApplication.Terminate;end;end;procedureTForm1.Timer1Timer(Sender:TObject);beginLabel2.Caption:=DateTimeToStr(Now);end;end.unitUnit2;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,DB,ADODB,Unit3;typeTForm2=class(TForm)Label1:TLabel;Label2:TLabel;Label3:TLabel;ComboBox1:TComboBox;Edit1:TEdit;Edit2:TEdit;Button1:TButton;Button2:TButton;ADOConnection1:TADOConnection;ADOQuery1:TADOQuery;Label4:TLabel;Button3:TButton;Label5:TLabel;Edit3:TEdit;procedureComboBox1Change(Sender:TObject);procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureFormCreate(Sender:TObject);procedureButton3Click(Sender:TObject);procedureFormShow(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm2:TForm2;implementationusesUnit1,Unit8,Unit12;{$R*.dfm}procedureTForm2.ComboBox1Change(Sender:TObject);begincaseComboBox1.ItemIndexof0:Label2.Caption:='賬號(hào)';1:Label2.Caption:='工號(hào)';elseLabel2.Caption:='學(xué)號(hào)';end;end;procedureTForm2.Button1Click(Sender:TObject);beginifEdit3.Text=Label4.CaptionthenbegincaseComboBox1.ItemIndexof0:beginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Text:='select*from管理信息表where賬號(hào)='''+Edit1.Text+'''AND密碼='''+Edit2.Text+'''AND用戶名='''+ComboBox1.Text+'''';ADOQuery1.Open;ifADOQuery1.RecordCount=0thenbeginShowMessage('用戶名或密碼錯(cuò)誤,請(qǐng)重新登錄');endelsebeginForm12.Show;Form2.Close;Form1.Panel1.Visible:=False;end;end;1:beginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Text:='select*from管理信息表where賬號(hào)='''+Edit1.Text+'''and密碼='''+Edit2.Text+'''and用戶名='''+ComboBox1.Text+'''';ADOQuery1.Open;ifADOQuery1.RecordCount=0thenbeginShowMessage('用戶名或密碼錯(cuò)誤,請(qǐng)重新登錄');endelsebeginForm8.Show;Form2.Close;Form1.Panel1.Visible:=False;end;end;2:beginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Text:='select*from管理信息表where賬號(hào)='''+Edit1.Text+'''and密碼='''+Edit2.Text+'''and用戶名='''+ComboBox1.Text+'''';ADOQuery1.Open;ifADOQuery1.RecordCount=0thenbeginShowMessage('用戶名或密碼錯(cuò)誤,請(qǐng)重新登陸');endelsebeginForm3.Show;Form2.Close;Form1.Panel1.Visible:=False;end;end;elseShowMessage('請(qǐng)選擇身份');end;endelseShowMessage('驗(yàn)證碼錯(cuò)誤');end;procedureTForm2.Button2Click(Sender:TObject);beginForm2.Close;Form1.Panel1.Visible:=False;end;procedureTForm2.FormCreate(Sender:TObject);beginRandomize;end;procedureTForm2.Button3Click(Sender:TObject);vari,j:Integer;c:Char;beginLabel4.Caption:='';//這個(gè)是標(biāo)簽forj:=0to3do//隨機(jī)生成4個(gè)a到z字符串begini:=Random(24);c:=chr(ord('a')+i);Label4.Caption:=Label4.Caption+c;end;beginRandomize;end;end;procedureTForm2.FormShow(Sender:TObject);vari,j:Integer;c:Char;beginLabel4.Caption:='';//這個(gè)是標(biāo)簽forj:=0to3do//隨機(jī)生成4個(gè)a到z字符串begini:=Random(24);c:=chr(ord('a')+i);Label4.Caption:=Label4.Caption+c;end;end;end.unitUnit3;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,ExtCtrls,jpeg,DB,ADODB,DBCtrls;typeTForm3=class(TForm)Button1:TButton;Button2:TButton;Button3:TButton;Button4:TButton;Panel1:TPanel;Image1:TImage;DBText1:TDBText;DataSource1:TDataSource;ADOQuery1:TADOQuery;ADOConnection1:TADOConnection;Label1:TLabel;Timer1:TTimer;Label2:TLabel;procedureButton1Click(Sender:TObject);procedureButton3Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureButton4Click(Sender:TObject);procedureImage1Click(Sender:TObject);procedureTimer1Timer(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm3:TForm3;implementationusesUnit4,Unit5,Unit6,Unit7,Unit19,Unit2;{$R*.dfm}procedureTForm3.Button1Click(Sender:TObject);beginForm5.Close;Form6.Close;Form7.Close;Form4.ManualDock(Form3.Panel1,nil,alNone);Form4.Show;Panel1.Visible:=True;end;procedureTForm3.Button3Click(Sender:TObject);beginForm4.Close;Form6.Close;Form7.Close;Form5.ManualDock(Form3.Panel1,nil,alNone);Form5.Show;Panel1.Visible:=True;end;procedureTForm3.Button2Click(Sender:TObject);beginForm4.Close;Form5.Close;Form7.Close;Form6.ManualDock(Form3.Panel1,nil,alNone);Form6.Show;Panel1.Visible:=True;end;procedureTForm3.Button4Click(Sender:TObject);beginifForm19.Label11.Caption='已開通選課'thenbeginForm4.Close;Form5.Close;Form6.Close;Form7.ManualDock(Form3.Panel1,nil,alNone);Form7.Show;Panel1.Visible:=True;endelseShowMessage('選課系統(tǒng)已關(guān)閉!');end;procedureTForm3.Image1Click(Sender:TObject);beginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('select姓名from學(xué)生信息表where學(xué)號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Open;end;procedureTForm3.Timer1Timer(Sender:TObject);beginLabel1.Caption:=DateTimeToStr(Now);end;end.unitUnit4;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,Grids,DBGrids,DB,ADODB,StdCtrls;typeTForm4=class(TForm)DBGrid1:TDBGrid;ADOQuery1:TADOQuery;DataSource1:TDataSource;Button1:TButton;Button2:TButton;Button3:TButton;GroupBox1:TGroupBox;Label1:TLabel;Label2:TLabel;Label3:TLabel;Label4:TLabel;Edit1:TEdit;Edit2:TEdit;Edit3:TEdit;Edit4:TEdit;Label5:TLabel;Button4:TButton;Button5:TButton;Button6:TButton;procedureButton1Click(Sender:TObject);procedureButton3Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureGroupBox1Click(Sender:TObject);procedureButton6Click(Sender:TObject);procedureButton4Click(Sender:TObject);procedureButton5Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm4:TForm4;implementationusesUnit2;{$R*.dfm}procedureTForm4.Button1Click(Sender:TObject);beginGroupBox1.Visible:=False;DBGrid1.Visible:=True;ADOQuery1.Close;ADOQuery1.SQL.Clear;beginADOQuery1.SQL.Add('select*from學(xué)生信息表where學(xué)號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Open;end;end;procedureTForm4.Button3Click(Sender:TObject);beginADOQuery1.Close;DBGrid1.Visible:=False;GroupBox1.Visible:=False;end;procedureTForm4.Button2Click(Sender:TObject);beginDBGrid1.Visible:=False;GroupBox1.Visible:=True;end;procedureTForm4.GroupBox1Click(Sender:TObject);vari,j:Integer;c:Char;beginLabel5.Caption:='';//這個(gè)是標(biāo)簽forj:=0to3do//隨機(jī)生成4個(gè)a到z字符串begini:=Random(24);c:=chr(ord('a')+i);Label5.Caption:=Label5.Caption+c;end;beginRandomize;end;end;procedureTForm4.Button6Click(Sender:TObject);beginGroupBox1.Visible:=False;end;procedureTForm4.Button4Click(Sender:TObject);vari,j:Integer;c:Char;beginLabel5.Caption:='';//這個(gè)是標(biāo)簽forj:=0to3do//隨機(jī)生成4個(gè)a到z字符串begini:=Random(24);c:=chr(ord('a')+i);Label5.Caption:=Label5.Caption+c;end;beginRandomize;end;end;procedureTForm4.Button5Click(Sender:TObject);beginifMessageDlg('確定修改嗎?',mtConfirmation,[mbYes,mbNO],0)=mrYesthenbeginifEdit4.Text=Label5.CaptionthenbeginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Text:='select*from管理信息表where賬號(hào)='''+Form2.Edit1.Text+'''and密碼='''+Edit1.Text+'''';ADOQuery1.Open;ifADOQuery1.RecordCount=1thenbeginifEdit2.Text=Edit3.TextthenbeginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('Update管理信息表SET密碼=:Awhere賬號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Parameters.ParamByName('A').Value:=Edit2.Text;ADOQuery1.ExecSQL;ShowMessage('修改成功');endelseShowMessage('新密碼不一致')endelseShowMessage('原密碼錯(cuò)誤');endelseShowMessage('驗(yàn)證碼錯(cuò)誤');end;Edit1.Text:='';Edit2.Text:='';Edit3.Text:='';Edit4.Text:='';end;end.unitUnit5;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,DB,ADODB,StdCtrls,Grids,DBGrids;typeTForm5=class(TForm)DBGrid1:TDBGrid;Button1:TButton;Button2:TButton;ADOQuery1:TADOQuery;DataSource1:TDataSource;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm5:TForm5;implementationusesUnit2;{$R*.dfm}procedureTForm5.Button1Click(Sender:TObject);beginDBGrid1.Visible:=True;ADOQuery1.Close;ADOQuery1.SQL.Clear;beginADOQuery1.SQL.Add('select*from成績(jī)信息表where學(xué)號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Open;end;end;procedureTForm5.Button2Click(Sender:TObject);beginADOQuery1.Close;DBGrid1.Visible:=False;end;end.unitUnit6;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,DB,ADODB,StdCtrls,Grids,DBGrids;typeTForm6=class(TForm)DBGrid1:TDBGrid;Button1:TButton;Button2:TButton;ADOQuery1:TADOQuery;DataSource1:TDataSource;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm6:TForm6;implementationusesUnit2;{$R*.dfm}procedureTForm6.Button1Click(Sender:TObject);beginDBGrid1.Visible:=True;ADOQuery1.Close;ADOQuery1.SQL.Clear;beginADOQuery1.SQL.Add('select*from課程信息表where學(xué)號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Open;end;end;procedureTForm6.Button2Click(Sender:TObject);beginADOQuery1.Close;DBGrid1.Visible:=False;end;end.unitUnit7;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,Grids,DBGrids,DB,ADODB;typeTForm7=class(TForm)Button1:TButton;ADOQuery1:TADOQuery;DataSource1:TDataSource;DBGrid1:TDBGrid;Label1:TLabel;Edit1:TEdit;Button2:TButton;Button3:TButton;DBGrid2:TDBGrid;Button4:TButton;ADOQuery2:TADOQuery;ADOQuery3:TADOQuery;ADOQuery4:TADOQuery;DataSource2:TDataSource;ADOQuery5:TADOQuery;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureButton4Click(Sender:TObject);procedureButton3Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm7:TForm7;implementationusesUnit2;{$R*.dfm}procedureTForm7.Button1Click(Sender:TObject);beginADOQuery3.Close;ADOQuery3.SQL.Clear;ADOQuery3.SQL.Add('select*from老師課程表');ADOQuery3.Open;end;procedureTForm7.Button2Click(Sender:TObject);beginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Text:='select*from老師課程表where課程號(hào)='''+Edit1.Text+'''';ADOQuery1.Open;ifADOQuery1.RecordCount=0thenbeginShowMessage('此課程不存在');endelseADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Text:='select*from課程信息表where課程號(hào)='''+Edit1.Text+'''and學(xué)號(hào)='''+Form2.Edit1.Text+'''';ADOQuery1.Open;ifADOQuery1.RecordCount=0thenbeginifMessageDlg('確定選課嗎?',mtConfirmation,[mbYes,mbNo],0)=mrYesthenbeginADOQuery2.Close;ADOQuery2.SQL.Clear;ADOQuery2.SQL.Add('select*from老師課程表where課程號(hào)='''+Edit1.Text+'''');ADOQuery2.Open;ADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('insertinto課程信息表values(:A,:B,:C,:D,:E,:F,:G,:H,:I)');ADOQuery1.Parameters.ParamByName('A').Value:=Form2.Edit1.Text;ADOQuery1.Parameters.ParamByName('B').Value:=ADOQuery2.FieldByName('課程號(hào)').AsString;ADOQuery1.Parameters.ParamByName('C').Value:=ADOQuery2.FieldByName('課程名').AsString;ADOQuery1.Parameters.ParamByName('D').Value:=ADOQuery2.FieldByName('課時(shí)').AsString;ADOQuery1.Parameters.ParamByName('E').Value:=ADOQuery2.FieldByName('學(xué)分').AsString;ADOQuery1.Parameters.ParamByName('F').Value:=ADOQuery2.FieldByName('開課時(shí)間').AsString;ADOQuery1.Parameters.ParamByName('G').Value:=ADOQuery2.FieldByName('老師工號(hào)').AsString;ADOQuery1.Parameters.ParamByName('H').Value:=ADOQuery2.FieldByName('老師姓名').AsString;ADOQuery1.Parameters.ParamByName('I').Value:=ADOQuery2.FieldByName('備注').AsString;ADOQuery1.ExecSQL;ADOQuery5.Close;ADOQuery5.SQL.Clear;ADOQuery5.SQL.Add('select*from學(xué)生信息表where學(xué)號(hào)='''+Form2.Edit1.Text+'''');ADOQuery5.Open;ADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('insertinto成績(jī)信息表values(:J,:K,:L,:M,:N,:O,:P,:Q,:R,:S)');ADOQuery1.Parameters.ParamByName('J').Value:=Form2.Edit1.Text;ADOQuery1.Parameters.ParamByName('K').Value:=ADOQuery5.FieldByName('姓名').AsString;ADOQuery1.Parameters.ParamByName('L').Value:=ADOQuery2.FieldByName('課程號(hào)').AsString;ADOQuery1.Parameters.ParamByName('M').Value:=ADOQuery2.FieldByName('課程名').AsString;ADOQuery1.Parameters.ParamByName('N').Value:=ADOQuery2.FieldByName('課時(shí)').AsString;ADOQuery1.Parameters.ParamByName('O').Value:=ADOQuery2.FieldByName('學(xué)分').AsString;ADOQuery1.Parameters.ParamByName('P').Value:='';ADOQuery1.Parameters.ParamByName('Q').Value:='';ADOQuery1.Parameters.ParamByName('R').Value:='';ADOQuery1.Parameters.ParamByName('S').Value:=ADOQuery2.FieldByName('備注').AsString;ADOQuery1.ExecSQL;ShowMessage('選課成功');Edit1.Text:='';end;endelseShowMessage('已選過此課程');end;procedureTForm7.Button4Click(Sender:TObject);beginADOQuery4.Close;ADOQuery4.SQL.Clear;ADOQuery4.SQL.Add('select*from課程信息表where學(xué)號(hào)='''+Form2.Edit1.Text+'''');ADOQuery4.Open;end;procedureTForm7.Button3Click(Sender:TObject);beginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Text:='select*from課程信息表where課程號(hào)='''+Edit1.Text+'''';ADOQuery1.Open;ifADOQuery1.RecordCount=0thenbeginShowMessage('未選此課程');endelsebeginifMessageDlg('刪除后無法恢復(fù),確定刪除嗎?',mtConfirmation,[mbYes,mbNo],0)=mrYesthenbeginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('DELETEFROM課程信息表where課程號(hào)=:T');ADOQuery1.Parameters.ParamByName('T').Value:=Edit1.Text;ADOQuery1.ExecSQL;ADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('DELETEFROM成績(jī)信息表where課程號(hào)=:U');ADOQuery1.Parameters.ParamByName('U').Value:=Edit1.Text;ADOQuery1.ExecSQL;Edit1.Text:='';ShowMessage('成功刪除!');end;end;end;end.unitUnit8;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,jpeg,ExtCtrls,DB,ADODB,DBCtrls;typeTForm8=class(TForm)Image1:TImage;Button1:TButton;Button2:TButton;Button3:TButton;Panel1:TPanel;DBText1:TDBText;ADOQuery1:TADOQuery;DataSource1:TDataSource;ADOConnection1:TADOConnection;Label1:TLabel;Timer1:TTimer;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureButton3Click(Sender:TObject);procedureImage1Click(Sender:TObject);procedureTimer1Timer(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm8:TForm8;implementationusesUnit9,Unit10,Unit11,Unit2;{$R*.dfm}procedureTForm8.Button1Click(Sender:TObject);beginForm10.Close;Form11.Close;Form9.ManualDock(Form8.Panel1,nil,alNone);Form9.Show;Form8.Panel1.Visible:=True;end;procedureTForm8.Button2Click(Sender:TObject);beginForm9.Close;Form11.Close;Form10.ManualDock(Form8.Panel1,nil,alNone);Form10.Show;Form8.Panel1.Visible:=True;end;procedureTForm8.Button3Click(Sender:TObject);beginForm9.Close;Form10.Close;Form11.ManualDock(Form8.Panel1,nil,alNone);Form11.Show;Form8.Panel1.Visible:=True;end;procedureTForm8.Image1Click(Sender:TObject);beginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('select姓名from老師信息表where老師工號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Open;end;procedureTForm8.Timer1Timer(Sender:TObject);beginLabel1.Caption:=DateTimeToStr(Now);end;end.unitUnit9;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,DB,StdCtrls,ADODB,Grids,DBGrids;typeTForm9=class(TForm)DBGrid1:TDBGrid;ADOQuery1:TADOQuery;Button1:TButton;Button2:TButton;Button3:TButton;DataSource1:TDataSource;GroupBox1:TGroupBox;Label1:TLabel;Label2:TLabel;Label3:TLabel;Label4:TLabel;Button4:TButton;Button5:TButton;Edit1:TEdit;Edit2:TEdit;Edit3:TEdit;Edit4:TEdit;Label5:TLabel;Button6:TButton;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);procedureGroupBox1Click(Sender:TObject);procedureButton3Click(Sender:TObject);procedureButton6Click(Sender:TObject);procedureButton5Click(Sender:TObject);procedureButton4Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm9:TForm9;implementationusesUnit2;{$R*.dfm}procedureTForm9.Button1Click(Sender:TObject);beginDBGrid1.Visible:=True;ADOQuery1.Close;ADOQuery1.SQL.Clear;beginADOQuery1.SQL.Add('select*from老師信息表where老師工號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Open;end;end;procedureTForm9.Button2Click(Sender:TObject);beginADOQuery1.Close;DBGrid1.Visible:=False;end;procedureTForm9.GroupBox1Click(Sender:TObject);vari,j:Integer;c:Char;beginLabel5.Caption:='';//這個(gè)是標(biāo)簽forj:=0to3do//隨機(jī)生成4個(gè)a到z字符串begini:=Random(24);c:=chr(ord('a')+i);Label5.Caption:=Label5.Caption+c;end;beginRandomize;end;end;procedureTForm9.Button3Click(Sender:TObject);beginDBGrid1.Visible:=False;GroupBox1.Visible:=True;end;procedureTForm9.Button6Click(Sender:TObject);vari,j:Integer;c:Char;beginLabel5.Caption:='';//這個(gè)是標(biāo)簽forj:=0to3do//隨機(jī)生成4個(gè)a到z字符串begini:=Random(24);c:=chr(ord('a')+i);Label5.Caption:=Label5.Caption+c;end;beginRandomize;end;end;procedureTForm9.Button5Click(Sender:TObject);beginGroupBox1.Visible:=False;end;procedureTForm9.Button4Click(Sender:TObject);beginifMessageDlg('確定修改嗎?',mtConfirmation,[mbYes,mbNO],0)=mrYesthenbeginifEdit4.Text=Label5.CaptionthenbeginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Text:='select*from管理信息表where賬號(hào)='''+Form2.Edit1.Text+'''and密碼='''+Edit1.Text+'''';ADOQuery1.Open;ifADOQuery1.RecordCount=1thenbeginifEdit2.Text=Edit3.TextthenbeginADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('Update管理信息表SET密碼=:Awhere賬號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Parameters.ParamByName('A').Value:=Edit2.Text;ADOQuery1.ExecSQL;ShowMessage('修改成功');endelseShowMessage('新密碼不一致')endelseShowMessage('原密碼錯(cuò)誤');endelseShowMessage('驗(yàn)證碼錯(cuò)誤');end;Edit1.Text:='';Edit2.Text:='';Edit3.Text:='';Edit4.Text:='';end;end.unitUnit10;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,DB,ADODB,Grids,DBGrids;typeTForm10=class(TForm)DBGrid1:TDBGrid;ADOQuery1:TADOQuery;DataSource1:TDataSource;Button1:TButton;Button2:TButton;procedureButton1Click(Sender:TObject);procedureButton2Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm10:TForm10;implementationusesUnit2;{$R*.dfm}procedureTForm10.Button1Click(Sender:TObject);beginDBGrid1.Visible:=True;ADOQuery1.Close;ADOQuery1.SQL.Clear;beginADOQuery1.SQL.Add('select*from課程信息表where老師工號(hào)='''+Form2.Edit1.Text+'''');ADOQuery1.Open;end;end;procedureTForm10.Button2Click(Sender:TObject);beginADOQuery1.Close;DBGrid1.Visible:=False;end;end.unitUnit11;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,Grids,DBGrids,DB,ADODB,StdCtrls;typeTForm11=class(TForm)Button1:TButton;ADOQuery1:TADOQuery;DataSource1:TDataSource;DBGrid1:TDBGrid;Edit1:TEdit;Label1:TLabel;Label2:TLabel;Edit2:TEdit;Label3:TLabel;Edit3:TEdit;Label4:TLabel;Edit4:TEdit;Button2:TButton;Button3:TButton;procedureButton1Click(Sender:TObject);procedureButton3Click(Sender:TObject);procedureButton2Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm11:TForm11;implementationusesUnit8;{$R*.dfm}procedureTForm11.Button1Click(Sender:TObject);beginDBGrid1.Visible:=True;ADOQuery1.Close;ADOQuery1.SQL.Clear;ADOQuery1.SQL.Add('select*from成績(jī)信息表where課程號(hào)='''+Edit1.Text+'''');ADOQuery1.Open;end;procedureT
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 會(huì)議服務(wù)合同協(xié)議書的履行期限
- 苯板采購(gòu)合同的履行威脅
- 螺旋式機(jī)器購(gòu)買協(xié)議
- 房屋買賣合同的違約金計(jì)算及支付方式
- 電腦交易協(xié)議示范
- 招標(biāo)方案設(shè)計(jì)背景介紹
- 目標(biāo)責(zé)任書撰寫技巧
- 裝卸信譽(yù)保證
- 網(wǎng)絡(luò)打印機(jī)采購(gòu)協(xié)議
- 致愛妻忠誠(chéng)的保證書
- 2024河北省建筑安全員-C證(專職安全員)考試題庫(kù)
- 餐飲公司股權(quán)合同模板
- 通風(fēng)工程安裝維修合同模板
- 廣東省廣州市越秀區(qū)2023-2024學(xué)年八年級(jí)上學(xué)期期末道德與法治試題(含答案)
- 美容學(xué)徒帶薪合同范例
- 醫(yī)療機(jī)構(gòu)從業(yè)人員行為規(guī)范培訓(xùn)
- 2024年人教部編版語(yǔ)文小學(xué)四年級(jí)上冊(cè)復(fù)習(xí)計(jì)劃及全冊(cè)單元復(fù)習(xí)課教案
- 水利信息化數(shù)據(jù)中心及軟件系統(tǒng)單元工程質(zhì)量驗(yàn)收評(píng)定表、檢查記錄
- 2024年城市園林苗木移植合同范例
- 應(yīng)用PDCA提高醫(yī)療安全不良事件的上報(bào)率
- 軍事理論課(2024)學(xué)習(xí)通超星期末考試答案章節(jié)答案2024年
評(píng)論
0/150
提交評(píng)論