




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、數(shù)據(jù)庫(kù)系統(tǒng)應(yīng)用課程設(shè)計(jì)課程設(shè)計(jì)報(bào)告 設(shè) 計(jì) 題 目: 學(xué)生成績(jī)管理系統(tǒng)_ 專 業(yè) (方 向): 信息管理與信息系統(tǒng) 年 級(jí)、 班: xxxxxxxxx 學(xué) 生 學(xué) 號(hào): xxxxxxxxxx 學(xué) 生 姓 名: XX 指 導(dǎo) 教 師: XXX 12 月 17 日目 錄 TOC o 1-3 h z u HYPERLINK l _Toc 一、概述 表 3所示。表 SEQ 表 * ARABIC 3課程信息表列名數(shù)據(jù)類型長(zhǎng)度備注課程號(hào)Char5主鍵課程名稱String 10無(wú)課程類型string5無(wú)學(xué)分int5無(wú)3.2.4成績(jī)信息表如 REF _Ref h 表 4所示。表 SEQ 表 * ARABIC
2、4成績(jī)信息表列名數(shù)據(jù)類型長(zhǎng)度備注學(xué)號(hào)Char10主鍵課程號(hào)Char5主鍵成績(jī)類型String5無(wú)分?jǐn)?shù)float5無(wú)3.2.5顧客信息表如 REF _Ref h 表 5所示。表 SEQ 表 * ARABIC 5顧客信息表列名數(shù)據(jù)類型長(zhǎng)度備注登錄IDchar5主鍵登錄名String10無(wú)顧客名String 10無(wú)密碼String 10四、具體設(shè)計(jì)(一)、系統(tǒng)管理功能模塊旳實(shí)現(xiàn)創(chuàng)立一種FormSystemMessage窗體,實(shí)現(xiàn)添加顧客、刪除顧客、修改密碼、退出系統(tǒng)旳功能。public partial class FormSystemMessage : Form public FormSystemM
3、essage() InitializeComponent(); private void operatorBindingNavigatorSaveItem_Click(object sender, EventArgs e) this.Validate(); this.operatorBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.dataSetUserPassword); DataSetUserPassword dsp = new DataSetUserPassword(); DataSetUserPasswor
4、dTableAdapters.OperatorTableAdapter dsup = new DataSetUserPasswordTableAdapters.OperatorTableAdapter(); private void FormSystemMessage_Load(object sender, EventArgs e) / TODO: 這行代碼將數(shù)據(jù)加載到表“dataSetUserPassword.Operator”中。您可以根 據(jù)需要移動(dòng)或刪除它。 this.operatorTableAdapter.Fill(this.dataSetUserPassword.Operator)
5、; dsup.Fill(dsp.Operator); dataGridViewSystemMessage.DataSource = dsp.Operator; private void buttonDelete_Click(object sender, EventArgs e) DataSetUserPassword.OperatorRow row = (DataSetUserPassword.OperatorRow) (DataRowView)dataGridViewSystemMessage.CurrentRow.DataBoundItem).Row); if (MessageBox.Sh
6、ow(您擬定要?jiǎng)h除這個(gè)顧客嗎?, 擬定提示) = DialogResult.No) return; row.Delete(); private void buttonAdd_Click(object sender, EventArgs e) if (string.IsNullOrEmpty(nameTextBox.Text) MessageBox.Show(顧客名不能為空, 錯(cuò)誤提示, MessageBoxButtons.OK, MessageBoxIcon.Error); return; if (string.IsNullOrEmpty(passwordTextBox.Text) Messa
7、geBox.Show(密碼不能為空, 錯(cuò)誤提示, MessageBoxButtons.OK, MessageBoxIcon.Error); return; DataSetUserPassword.OperatorRow row = dsp.Operator.NewOperatorRow(); row.Name = nameTextBox.Text; row.Password = passwordTextBox.Text; dsp.Operator.AddOperatorRow(row); private void buttonSave_Click(object sender, EventArg
8、s e) try dsup.Update(dsp.Operator); MessageBox.Show(數(shù)據(jù)保存成功, 提示信息, MessageBoxButtons.OK, MessageBoxIcon.Information); catch (Exception ex) MessageBox.Show(ex.Message, 提示信息, MessageBoxButtons.OK, MessageBoxIcon.Error); private void buttonExit_Click(object sender, EventArgs e) Application.Exit(); (二)、學(xué)
9、生信息管理模塊旳實(shí)現(xiàn)4.2.1.“學(xué)生信息管理”窗體旳實(shí)現(xiàn)如圖4.2.1所示。圖 4.2.1“學(xué)生信息管理”窗體在構(gòu)造函數(shù)前添加數(shù)據(jù)庫(kù)上下文對(duì)象,并在構(gòu)造函數(shù)中增長(zhǎng)如下代碼ScoreManContext db = new ScoreManContext();public FormClass() InitializeComponent(); db.Studentes.Load(); studentBindingSource.DataSource = db.Studentes.Local; “新添”按鈕代碼實(shí)現(xiàn)如下private void bindingNavigatorAddNewItem_Cl
10、ick(object sender, EventArgs e) Student student = new Course(); course.Id = Guid.NewGuid(); FormEditCourse formEdit = new FormEditCourse(course ); if(formEdit.ShowDialog ()=DialogResult.OK) courseBindingSource.Add(course); courseBindingSource.EndEdit(); db.SaveChanges(); “刪除”按鈕代碼實(shí)現(xiàn)如下private void bin
11、dingNavigatorDeleteItem_Click(object sender, EventArgs e) if (studentBindingSource.Current = null) return; if(Dialogs.ShowConfirm (你擬定刪除嗎)=DialogResult.Yes) studentBindingSource.RemoveCurrent(); db.SaveChanges(); “編輯”按鈕代碼實(shí)現(xiàn)如下private void toolStripEdit_Click(object sender, EventArgs e) if (studentBin
12、dingSource.Current = null) return; Student student = studentBindingSource.Current as Student; FormStudentEdit formEdit = new FormStudentEdit(student); if(formEdit .ShowDialog ()=DialogResult.OK) studentBindingSource.EndEdit(); db.SaveChanges(); else db.Entry(student).Reload(); studentBindingSource.R
13、esetBindings(false ); 4.2.2.“編輯學(xué)生信息”窗體設(shè)計(jì)如圖4.2.2所示。圖 4.2.2“編輯學(xué)生信息”窗體設(shè)計(jì)在該窗體中“選擇照片”按鈕代碼實(shí)現(xiàn)如下private void buttonSelectPicture_Click(object sender, EventArgs e) OpenFileDialog openDialog = new OpenFileDialog(); openDialog.Filter = 所有圖片(*.jpg;*.png;*.bmp;*.gif)|*.jpg;*.png;*.gif;*.bmp; if(openDialog .ShowD
14、ialog()=DialogResult.OK) photoPictureBox.Image = Image.FromFile(openDialog.FileName); “擬定”按鈕代碼實(shí)現(xiàn)如下private void buttonOK_Click(object sender, EventArgs e) if (ValidateData() DialogResult = DialogResult.OK; “取消”按鈕代碼實(shí)現(xiàn)如下private void buttonCancel_Click(object sender, EventArgs e) DialogResult = DialogRe
15、sult.Cancel; (三)、班級(jí)信息管理模塊旳實(shí)現(xiàn) 4.3.1.“班級(jí)信息管理”窗體設(shè)計(jì)如圖4.3.1所示。圖 4.3.1“班級(jí)信息管理”窗體設(shè)計(jì)在構(gòu)造函數(shù)前添加數(shù)據(jù)庫(kù)上下文對(duì)象,并在構(gòu)造函數(shù)中增長(zhǎng)如下代碼ScoreManContext db = new ScoreManContext();public FormClass() InitializeComponent(); db.Classes.Load(); classBindingSource.DataSource = db.Classes.Local; “新添”按鈕代碼實(shí)現(xiàn)如下private void bindingNavigato
16、rAddNewItem_Click(object sender, EventArgs e) Class classes = new Class(); classes.Id = Guid.NewGuid(); FormEditClass formEdit = new FormEditClass(); if (formEdit.ShowDialog() = DialogResult.OK) classBindingSource.Add(classes); classBindingSource.EndEdit(); db.SaveChanges(); “刪除”按鈕代碼實(shí)現(xiàn)如下private void
17、 bindingNavigatorDeleteItem_Click(object sender, EventArgs e) if (classBindingSource.Current = null) return; classBindingSource.RemoveCurrent(); db.SaveChanges(); Dialogs.ShowMessage(刪除成功); “編輯”按鈕代碼實(shí)現(xiàn)如下private void toolStripButton1_Click(object sender, EventArgs e) if (classBindingSource.Current = n
18、ull) return; Class classes = classBindingSource.Current as Class; FormEditClass formEdit = new FormEditClass( ); if (formEdit.ShowDialog() = DialogResult.OK) db.SaveChanges(); else db.Entry(classes ).Reload(); 4.3.2.“編輯班級(jí)信息”窗體如圖4.3.2所示。圖4.3.2“編輯班級(jí)信息”窗體設(shè)計(jì)“擬定”按鈕代碼實(shí)現(xiàn)如下private void buttonOK_Click(object
19、 sender, EventArgs e) if (ValidateData() DialogResult = DialogResult.OK; “取消”按鈕代碼實(shí)現(xiàn)如下private void buttonCancel_Click(object sender, EventArgs e) DialogResult = DialogResult.Cancel; (四)、課程信息管理模塊旳實(shí)現(xiàn)4.4.1.“課程信息窗體”設(shè)計(jì)如圖4.4.1所示。圖 4.4.1“課程信息窗體”設(shè)計(jì)在構(gòu)造函數(shù)前添加數(shù)據(jù)庫(kù)上下文對(duì)象,并在構(gòu)造函數(shù)中增長(zhǎng)如下代碼ScoreManContext db = new ScoreM
20、anContext();public FormClass() InitializeComponent(); db.Courses.Load(); courseBindingSource.DataSource = db.Courses.Local; “新添”按鈕實(shí)現(xiàn)代碼如下private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) Course course = new Course(); course.Id = Guid.NewGuid(); FormEditCourse formEdit = new Fo
21、rmEditCourse(course ); if(formEdit.ShowDialog ()=DialogResult.OK) courseBindingSource.Add(course); courseBindingSource.EndEdit(); db.SaveChanges(); “刪除”按鈕實(shí)現(xiàn)代碼如下private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) if (courseBindingSource.Current = null) return; courseBindingSourc
22、e.RemoveCurrent(); db.SaveChanges(); Dialogs.ShowMessage(刪除成功); “編輯”按鈕實(shí)現(xiàn)代碼如下 private void toolStripButtonEdit_Click(object sender, EventArgs e) if (courseBindingSource.Current = null) return; Course course = courseBindingSource.Current as Course; FormEditCourse formEdit = new FormEditCourse(course);
23、 if(formEdit .ShowDialog ()=DialogResult.OK) db.SaveChanges(); else db.Entry(course).Reload(); 4.4.2.“編輯課程信息”窗體設(shè)計(jì)如圖4.4.2所示。圖 4.4.2“編輯課程信息”窗體設(shè)計(jì)“擬定”按鈕代碼實(shí)現(xiàn)如下private void buttonOK_Click(object sender, EventArgs e) if (ValidateData() DialogResult = DialogResult.OK; “取消”按鈕代碼實(shí)現(xiàn)如下private void buttonCancel_C
24、lick(object sender, EventArgs e) DialogResult = DialogResult.Cancel; (五)、成績(jī)信息管理模塊旳實(shí)現(xiàn)4.5.1.“成績(jī)信息管理”窗體設(shè)計(jì)如圖4.5.1所示。圖 4.5.1“成績(jī)信息管理”窗體設(shè)計(jì)在構(gòu)造函數(shù)前添加數(shù)據(jù)庫(kù)上下文對(duì)象,并在構(gòu)造函數(shù)中增長(zhǎng)如下代碼ScoreManContext db = new ScoreManContext();public FormClass() InitializeComponent(); db.Scores.Load(); scoreBindingSource.DataSource = db.S
25、cores.Local; “新添”按鈕實(shí)現(xiàn)代碼如下 private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) Score score = new Score(); score.StudentId = Guid.NewGuid(); score.CourseId = Guid.NewGuid(); FormEditScore formEdit = new FormEditScore(); if (formEdit.ShowDialog() = DialogResult.OK) scoreBindingSou
26、rce.Add(score); scoreBindingSource.EndEdit(); db.SaveChanges(); “刪除”按鈕實(shí)現(xiàn)代碼如下 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) if (scoreBindingSource.Current = null) return; scoreBindingSource.RemoveCurrent(); db.SaveChanges(); Dialogs.ShowMessage(刪除成功); “編輯”按鈕實(shí)現(xiàn)代碼如下 private void toolStripButton1_Click(object sender, EventArgs e) if (scoreBindingSource.Current = null) return; Score score = scoreBindingSource.Current as Score; FormEditScore formEdit = new FormEditScore(); if (formEdit.ShowDialog() = DialogResult.OK) scoreBindingSource.EndEdit(); db.SaveC
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 蘇教版數(shù)學(xué)三年級(jí)上冊(cè)單元測(cè)試卷-第五單元-解決問(wèn)題的策略(含答案)-
- 2025年湖南吉利汽車職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)技能測(cè)試題庫(kù)及答案一套
- 2025年河南物流職業(yè)學(xué)院?jiǎn)握新殬I(yè)適應(yīng)性測(cè)試題庫(kù)匯編
- 2025年河北青年管理干部學(xué)院?jiǎn)握新殬I(yè)傾向性測(cè)試題庫(kù)參考答案
- 2024年H-系列卷材涂料項(xiàng)目資金申請(qǐng)報(bào)告代可行性研究報(bào)告
- 2024年體育公園項(xiàng)目投資申請(qǐng)報(bào)告代可行性研究報(bào)告
- 2025年河北女子職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)適應(yīng)性測(cè)試題庫(kù)一套
- 物理-云南省師范大學(xué)附屬中學(xué)2025屆高三下學(xué)期開(kāi)學(xué)考試試題和答案
- 第22課《智取生辰綱》教學(xué)設(shè)計(jì) 2024-2025學(xué)年統(tǒng)編版語(yǔ)文九年級(jí)上冊(cè)
- 汽車旅館裝修合同解除
- 人教版八年級(jí)數(shù)學(xué)下冊(cè)《第十六章二次根式》專題復(fù)習(xí)附帶答案
- 2024屆武漢武昌區(qū)五校聯(lián)考數(shù)學(xué)九年級(jí)第一學(xué)期期末經(jīng)典試題含解析
- 高考復(fù)習(xí)概率中的遞推數(shù)列問(wèn)題課件
- 生物工程設(shè)備課件
- 詐騙控告書(shū)模板
- 善借者贏天下(2017甘肅慶陽(yáng)中考議論文閱讀試題含答案)
- 新聞采訪與寫(xiě)作課件第十章采訪的實(shí)施現(xiàn)場(chǎng)觀察
- 八年級(jí)數(shù)學(xué)下冊(cè)《三角形的證明》單元測(cè)試卷(附答案解析)
- 國(guó)內(nèi)公務(wù)接待清單
- 《調(diào)整心態(tài)迎接中考》主題班會(huì)
- 領(lǐng)導(dǎo)科學(xué)與領(lǐng)導(dǎo)藝術(shù)
評(píng)論
0/150
提交評(píng)論