学生成绩管理系统(8).doc

上传人:laozhun 文档编号:3795584 上传时间:2023-03-22 格式:DOC 页数:27 大小:1.33MB
返回 下载 相关 举报
学生成绩管理系统(8).doc_第1页
第1页 / 共27页
学生成绩管理系统(8).doc_第2页
第2页 / 共27页
学生成绩管理系统(8).doc_第3页
第3页 / 共27页
学生成绩管理系统(8).doc_第4页
第4页 / 共27页
学生成绩管理系统(8).doc_第5页
第5页 / 共27页
点击查看更多>>
资源描述

《学生成绩管理系统(8).doc》由会员分享,可在线阅读,更多相关《学生成绩管理系统(8).doc(27页珍藏版)》请在三一办公上搜索。

1、学生成绩管理系统目录1. 学生成绩管理系统11.1、需求分析11.2、系统设计11.2.1 用例图21.2.2顺序图21.2.3 加载流程31.3、系统结构31.3.2 系统结构41.4、部分模块及界面设计41.4.1主界面41.4.2登录模块51.4.3学生信息查询71.4.4学生成绩查询91.4.5学生信息修改121.4.6学生成绩录入161.5、数据库后台设计191.5.1部分数据表设计191. 学生成绩管理系统1.1、需求分析管理员使用系统的流程一般是,首先进入系统,然后选择某个功能。(1) 学生成绩查询 (2) 添加学生 (3) 课程信息录入(4) 学生成绩录入本系统的使用的结构如图

2、1-1所示。图1-1 结构图 1.2、系统设计1.2.1 用例图本系统就一个管理员如图1-2 用例图所示图1-2 用例图1.2.2顺序图在添加板块的过程中,管理员首先输入必要的信息等,最后提交给数据库,由数据库将内容加入数据库中,更具输入信息返回学生信息。图1-3是管理员添加学生顺序图。 图1-3顺序图。1.2.3 加载流程图1-4 加载功能模块的流程1.3、系统结构1.3.1 系统结构 图1-5系统结构图。1.4、部分模块及界面设计1.4.1主界面(1)Main.cs页面是成绩系统的的主页面,主要显示成绩系统里所有的板块。如下图图3-6主界面(2)加载页面代码如下:using System;

3、using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.OleDb;namespace 学生成绩管理系统3 public partial class Mian : Form OleDbConnection conn=new OleDbConnection(); OleDbDataAdapter da; DataSet ds; p

4、ublic Mian() InitializeComponent(); conn = new OleDbConnection(Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.mdb); ds = new DataSet(); private void selectToolStripMenuItem_Click(object sender, EventArgs e) Select addform = new Select(); addform.ShowDialog(); /调用? Select窗体? private void 查询成绩ToolStr

5、ipMenuItem_Click(object sender, EventArgs e) 查询成绩 selectForm = new 查询成绩(); selectForm.ShowDialog(); /调用?查询成绩窗体? private void 删?除y成绩ToolStripMenuItem_Click_1(object sender, EventArgs e) 删?除y成绩 deleteForm = new 删?除y成绩(); deleteForm.ShowDialog(); /调用?删?除y成绩窗体? private void button2_Click(object sender,

6、EventArgs e) 添加成绩 addform = new 添加成绩(); addform.ShowDialog(); /调用?添加成绩窗体? private void 添加课?程记?录?ToolStripMenuItem_Click(object sender, EventArgs e) 添加课?程记?录? addform = new 添加课?程记?录?(); addform.ShowDialog(); /调用?添加课?程记?录?窗体? private void button3_Click(object sender, EventArgs e) 添加新?学生 addStuForm = n

7、ew 添加新?学生(); addStuForm.ShowDialog(); /调用?添加新?学生窗体? private void 修T改?成绩ToolStripMenuItem_Click_1(object sender, EventArgs e) 修T改? updateForm = new 修T改?(); updateForm.ShowDialog(); /调用?修T改?窗体? private void Form1_Load(object sender, EventArgs e) Login frm = new Login(); if (DialogResult.OK = frm.ShowD

8、ialog() return; else Application.Exit(); private void 退?出?ToolStripMenuItem_Click_1(object sender, EventArgs e) if (MessageBox.Show(提示?:o + 要a退?出?管理系统3吗e??, 消?息, MessageBoxButtons.YesNo) = DialogResult.Yes) this.Close(); private void getData() da = new OleDbDataAdapter(select 姓?名?,score.学号?,班级?,年级?,

9、专业,课?程名?,成绩,绩点?,开a课?时间?,任?课?教师|,学时,学分? from score,course,student where score.学号?=student.学号? and score.课?程代号?=course.课?程代号? , conn); conn.Open(); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(da); da.Fill(ds, score); dataGridView1.DataSource = ds.Tablesscore; conn.Close(); private void to

10、olStripMenuItem2_Click(object sender, EventArgs e) ds.Clear(); getData(); private void button1_Click(object sender, EventArgs e) ds.Clear(); getData(); private void button5_Click(object sender, EventArgs e) this.Close(); 1.4.2登录模块(1)login.cs页面是系统的登录页面。如下图(2)登录页面代码如下:using System;using System.Collect

11、ions.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.OleDb;namespace 学生成绩管理系统3 public partial class Login : Form public Login() InitializeComponent(); private void loginBtn_Click(object sender, EventArgs e) str

12、ing conStr = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.mdb; OleDbConnection conn = new OleDbConnection(conStr); conn.Open(); string cmdStr = select * from Login where ( 用?户名?= LoginName) and( 密码? = Pwd); OleDbCommand cmd = new OleDbCommand(cmdStr, conn); cmd.Parameters.Add(LoginName, OleDbType

13、.Integer); cmd.Parameters.Add(pwd, OleDbType.Integer); cmd.ParametersLoginName.Value = Convert.ToInt32( userNameTbx.Text); cmd.Parameterspwd.Value = Convert.ToInt32(pswTbx.Text); OleDbDataReader reader = cmd.ExecuteReader(); if (reader.Read() this.DialogResult = DialogResult.OK; else MessageBox.Show

14、(用?户名?或密码?错误!); Application.Exit(); reader.Close(); cmd.Connection.Close(); conn.Close(); private void cancleBtn_Click(object sender, EventArgs e) this.Close(); 1.4.4学生成绩查询(1) 查询成绩.cs页面是系统的学生成绩查询页面。如下图(2) 学生成绩查询页面代码如下: using System;using System.Collections.Generic;using System.ComponentModel;using S

15、ystem.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Data.OleDb;namespace 学生成绩管理系统3 public partial class 查询成绩 : Form OleDbConnection conn; OleDbDataAdapter da; DataSet ds; private System.Data.DataTable myTable=new DataTable(); public 查询成绩() InitializeComponent();

16、 conn = new OleDbConnection(Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.mdb); ds = new DataSet(); private void getData() da = new OleDbDataAdapter(select 姓?名?,score.学号?,班级?,年级?,课?程名?,成绩,绩点?,开a课?时间?,任?课?教师|,学时,学分? from score,course,student where score.学号?=student.学号? and score.课?程代号?=course.课?程代号

17、? , conn); conn.Open(); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(da); da.Fill(ds, score); dataGridView1.DataSource = ds.Tablesscore; conn.Close(); private void 查询成绩_Load(object sender, EventArgs e) / TODO: 这a行D代码?将?数y据Y加载?到?表“dBDataSet11.course”中D。您可以?根据Y需要a移?动或移?除y它。 this.courseTabl

18、eAdapter.Fill(this.dBDataSet11.course); / TODO: 这a行D代码?将?数y据Y加载?到?表“dBDataSet11.student”中D。您可以?根据Y需要a移?动或移?除y它。 this.studentTableAdapter.Fill(this.dBDataSet11.student); getData(); private void fillByToolStripButton_Click(object sender, EventArgs e) try this.studentTableAdapter.FillBy(this.dBDataSet1

19、1.student); catch (System.Exception ex) System.Windows.Forms.MessageBox.Show(ex.Message); private void dataGridView1_Click(object sender, EventArgs e) try stu_name_comboBox.Text = dataGridView1.CurrentRow.Cells0.Value.ToString(); stu_id_comboBox.Text = dataGridView1.CurrentRow.Cells1.Value.ToString(

20、); class_comboBox.Text = dataGridView1.CurrentRow.Cells2.Value.ToString(); grade_comboBox.Text = dataGridView1.CurrentRow.Cells3.Value.ToString(); course_comboBox.Text = dataGridView1.CurrentRow.Cells4.Value.ToString(); /dataGridView1.CurrentRow.Cells0.Selected = true; catch (Exception) MessageBox.S

21、how(错误:o + 所查询记?录?不?存?在,?未能选?定值!?!?, 出?现?错误, MessageBoxButtons.OK, MessageBoxIcon.Error); private void ok_btn_Click(object sender, EventArgs e) ds.Clear(); da = new OleDbDataAdapter(select 姓?名?,score.学号?,班级?,年级?,课?程名?,成绩,绩点?,开a课?时间?,任?课?教师|,学时,学分? from score,course,student where score.学号?=student.学号

22、? and score.学号?= + stu_id_comboBox.Text + and score.课?程代号?=course.课?程代号? , conn); conn.Open(); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(da); try da.Fill(ds, score); dataGridView1.DataSource = ds.Tablesscore; stu_name_comboBox.Text = dataGridView1.CurrentRow.Cells0.Value.ToString(); c

23、atch (Exception) MessageBox.Show(查找出?错:o + 没?有D符?合?该?条?件t的?记?录?,?请?确认?输?入?的?数y据Y是?否?正y确!?, 出?现?错误, MessageBoxButtons.OK, MessageBoxIcon.Error); finally conn.Close(); private void update_btn_Click(object sender, EventArgs e) private void classSelect_btn_Click(object sender, EventArgs e) ds.Clear(); d

24、a = new OleDbDataAdapter(select 姓?名?,score.学号?,班级?,年级?,课?程名?,成绩,绩点?,开a课?时间?,任?课?教师|,学时,学分? from score,course,student where score.学号?=student.学号? and 班级?= + class_comboBox.Text + and score.课?程代号?=course.课?程代号? , conn); conn.Open(); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(da); try da.

25、Fill(ds, score); dataGridView1.DataSource = ds.Tablesscore; catch (Exception) MessageBox.Show(查找出?错:o + 没?有D符?合?该?条?件t的?记?录?,?请?确认?输?入?的?数y据Y是?否?正y确!?, 出?现?错误, MessageBoxButtons.OK, MessageBoxIcon.Error); finally conn.Close(); private void nameSelect_btn_Click(object sender, EventArgs e) ds.Clear();

26、 da = new OleDbDataAdapter(select 姓?名?,score.学号?,班级?,年级?,课?程名?,成绩,绩点?,开a课?时间?,任?课?教师|,学时,学分? from score,course,student where score.学号?=student.学号? and 姓?名?= + stu_name_comboBox.Text + and score.课?程代号?=course.课?程代号? , conn); conn.Open(); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(da); t

27、ry da.Fill(ds, score); dataGridView1.DataSource = ds.Tablesscore; catch (Exception) MessageBox.Show(查找出?错:o + 没?有D符?合?该?条?件t的?记?录?,?请?确认?输?入?的?数y据Y是?否?正y确!?, 出?现?错误, MessageBoxButtons.OK, MessageBoxIcon.Error); finally conn.Close(); private void gradeSelect_btn_Click(object sender, EventArgs e) ds.C

28、lear(); da = new OleDbDataAdapter(select 姓?名?,score.学号?,班级?,年级?,课?程名?,成绩,绩点?,开a课?时间?,任?课?教师|,学时,学分? from score,course,student where score.学号?=student.学号? and 年级?= + grade_comboBox.Text + and score.课?程代号?=course.课?程代号? , conn); conn.Open(); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(da)

29、; try da.Fill(ds, score); dataGridView1.DataSource = ds.Tablesscore; catch (Exception) MessageBox.Show(查找出?错:o + 没?有D符?合?该?条?件t的?记?录?,?请?确认?输?入?的?数y据Y是?否?正y确!?, 出?现?错误, MessageBoxButtons.OK, MessageBoxIcon.Error); finally conn.Close(); private void courseSelect_btn_Click(object sender, EventArgs e)

30、ds.Clear(); da = new OleDbDataAdapter(select 姓?名?,score.学号?,班级?,年级?,课?程名?,成绩,绩点?,开a课?时间?,任?课?教师|,学时,学分? from score,course,student where score.学号?=student.学号? and 课?程名?= + course_comboBox.Text + and score.课?程代号?=course.课?程代号? , conn); conn.Open(); OleDbCommandBuilder cmdBuilder = new OleDbCommandBuil

31、der(da); try da.Fill(ds, score); dataGridView1.DataSource = ds.Tablesscore; catch (Exception) MessageBox.Show(查找出?错:o + 没?有D符?合?该?条?件t的?记?录?,?请?确认?输?入?的?数y据Y是?否?正y确!?, 出?现?错误, MessageBoxButtons.OK, MessageBoxIcon.Error); finally conn.Close(); private void AllSelect_btn_Click(object sender, EventArgs

32、 e) ds.Clear(); da = new OleDbDataAdapter(select 姓?名?,score.学号?,班级?,年级?,课?程名?,成绩,绩点?,开a课?时间?,任?课?教师|,学时,学分? from score,course,student where score.学号?=student.学号? and 班级?= + class_comboBox.Text + and 课?程名?= + course_comboBox.Text + and 姓?名?= + stu_name_comboBox.Text + and score.学号?= + stu_id_comboBox.Text + and 年级?= + grade_c

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号