学生管理信息系统课程设计报告_第1页
学生管理信息系统课程设计报告_第2页
学生管理信息系统课程设计报告_第3页
学生管理信息系统课程设计报告_第4页
学生管理信息系统课程设计报告_第5页
已阅读5页,还剩26页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、数据库系统应用课程设计课程设计报告 设 计 题 目: 学生成绩管理系统_ 专 业 (方 向): 信息管理与信息系统 年 级、 班: xxxxxxxxx 学 生 学 号: xxxxxxxxxx 学 生 姓 名: XX 指 导 教 师: XXX 12 月 17 日目 录 TOC o 1-3 h z u HYPERLINK l _Toc 一、概述 表 3所示。表 SEQ 表 * ARABIC 3课程信息表列名数据类型长度备注课程号Char5主键课程名称String 10无课程类型string5无学分int5无3.2.4成绩信息表如 REF _Ref h 表 4所示。表 SEQ 表 * ARABIC

2、4成绩信息表列名数据类型长度备注学号Char10主键课程号Char5主键成绩类型String5无分数float5无3.2.5顾客信息表如 REF _Ref h 表 5所示。表 SEQ 表 * ARABIC 5顾客信息表列名数据类型长度备注登录IDchar5主键登录名String10无顾客名String 10无密码String 10四、具体设计(一)、系统管理功能模块旳实现创立一种FormSystemMessage窗体,实现添加顾客、删除顾客、修改密码、退出系统旳功能。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: 这行代码将数据加载到表“dataSetUserPassword.Operator”中。您可以根 据需要移动或删除它。 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(您拟定要删除这个顾客吗?, 拟定提示) = DialogResult.No) return; row.Delete(); private void buttonAdd_Click(object sender, EventArgs e) if (string.IsNullOrEmpty(nameTextBox.Text) MessageBox.Show(顾客名不能为空, 错误提示, MessageBoxButtons.OK, MessageBoxIcon.Error); return; if (string.IsNullOrEmpty(passwordTextBox.Text) Messa

7、geBox.Show(密码不能为空, 错误提示, 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(数据保存成功, 提示信息, 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(); (二)、学

9、生信息管理模块旳实现4.2.1.“学生信息管理”窗体旳实现如图4.2.1所示。图 4.2.1“学生信息管理”窗体在构造函数前添加数据库上下文对象,并在构造函数中增长如下代码ScoreManContext db = new ScoreManContext();public FormClass() InitializeComponent(); db.Studentes.Load(); studentBindingSource.DataSource = db.Studentes.Local; “新添”按钮代码实现如下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(); “删除”按钮代码实现如下private void bin

11、dingNavigatorDeleteItem_Click(object sender, EventArgs e) if (studentBindingSource.Current = null) return; if(Dialogs.ShowConfirm (你拟定删除吗)=DialogResult.Yes) studentBindingSource.RemoveCurrent(); db.SaveChanges(); “编辑”按钮代码实现如下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.“编辑学生信息”窗体设计如图4.2.2所示。图 4.2.2“编辑学生信息”窗体设计在该窗体中“选择照片”按钮代码实现如下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); “拟定”按钮代码实现如下private void buttonOK_Click(object sender, EventArgs e) if (ValidateData() DialogResult = DialogResult.OK; “取消”按钮代码实现如下private void buttonCancel_Click(object sender, EventArgs e) DialogResult = DialogRe

15、sult.Cancel; (三)、班级信息管理模块旳实现 4.3.1.“班级信息管理”窗体设计如图4.3.1所示。图 4.3.1“班级信息管理”窗体设计在构造函数前添加数据库上下文对象,并在构造函数中增长如下代码ScoreManContext db = new ScoreManContext();public FormClass() InitializeComponent(); db.Classes.Load(); classBindingSource.DataSource = db.Classes.Local; “新添”按钮代码实现如下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(); “删除”按钮代码实现如下private void

17、 bindingNavigatorDeleteItem_Click(object sender, EventArgs e) if (classBindingSource.Current = null) return; classBindingSource.RemoveCurrent(); db.SaveChanges(); Dialogs.ShowMessage(删除成功); “编辑”按钮代码实现如下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.“编辑班级信息”窗体如图4.3.2所示。图4.3.2“编辑班级信息”窗体设计“拟定”按钮代码实现如下private void buttonOK_Click(object

19、 sender, EventArgs e) if (ValidateData() DialogResult = DialogResult.OK; “取消”按钮代码实现如下private void buttonCancel_Click(object sender, EventArgs e) DialogResult = DialogResult.Cancel; (四)、课程信息管理模块旳实现4.4.1.“课程信息窗体”设计如图4.4.1所示。图 4.4.1“课程信息窗体”设计在构造函数前添加数据库上下文对象,并在构造函数中增长如下代码ScoreManContext db = new ScoreM

20、anContext();public FormClass() InitializeComponent(); db.Courses.Load(); courseBindingSource.DataSource = db.Courses.Local; “新添”按钮实现代码如下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(); “删除”按钮实现代码如下private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) if (courseBindingSource.Current = null) return; courseBindingSourc

22、e.RemoveCurrent(); db.SaveChanges(); Dialogs.ShowMessage(删除成功); “编辑”按钮实现代码如下 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.“编辑课程信息”窗体设计如图4.4.2所示。图 4.4.2“编辑课程信息”窗体设计“拟定”按钮代码实现如下private void buttonOK_Click(object sender, EventArgs e) if (ValidateData() DialogResult = DialogResult.OK; “取消”按钮代码实现如下private void buttonCancel_C

24、lick(object sender, EventArgs e) DialogResult = DialogResult.Cancel; (五)、成绩信息管理模块旳实现4.5.1.“成绩信息管理”窗体设计如图4.5.1所示。图 4.5.1“成绩信息管理”窗体设计在构造函数前添加数据库上下文对象,并在构造函数中增长如下代码ScoreManContext db = new ScoreManContext();public FormClass() InitializeComponent(); db.Scores.Load(); scoreBindingSource.DataSource = db.S

25、cores.Local; “新添”按钮实现代码如下 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(); “删除”按钮实现代码如下 private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) if (scoreBindingSource.Current = null) return; scoreBindingSource.RemoveCurrent(); db.SaveChanges(); Dialogs.ShowMessage(删除成功); “编辑”按钮实现代码如下 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. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论