GitHub地址:https://github.com/Knock-man/studentStatusManagementSyatem

学籍管理系统设计

  • 一、模块功能
  • 二、数据库设计
  • 三、窗体设计
    • (一)登录界面
    • (二)注册界面
    • (三)主菜单
    • (四)专业管理模块
    • (五)班级管理
    • (六)学生管理
    • (七)课程管理
    • (八)成绩管理

一、模块功能

设计一个用户登录界面,当用户未注册时,点击注册后跳转注册界面,注册后返回登录界面。
登录后菜单功能模块:

二、数据库设计

数据库名称:StudentStatusManagement
各实体属性
专业(专业编号,专业名称,专业描述)
班级(班级编号,班级名称,班级人数,班级描述,班主任)
学生(学生编号,学生名称,性别,年龄,学生描述)
课程(课程编号,课程学分,课程名称,课程说明)
用户(用户编号,用户名,密码)
E-R图设计

关系模式设计

专业(专业编号,专业名称,专业描述)
Major(majorId,majorName,majorExplain)班级(班级编号,班级名称,班级人数,班级描述,班主任,专业编号)
Class(classId,className,classCount,classExplain,teacher,majorId)学生(学生编号,学生名称,性别,年龄,,学生描述,班级编号)
Student(studentId,studentName,sex,age,studentExplain,classId)课程(课程编号,课程学分,课程名称,课程说明)
Course(courseId,courseGrade,courseName,courseExplain)选课(课程号,学生编号,成绩)
Choose(courseId,studentId,grade)用户(用户编号,用户名,密码)
User(userId,userName,userPassword)

建表

#建库
CREATE DATABASE IF NOT EXISTS StudentStatusManagement;
#建专业表
CREATE TABLE IF NOT EXISTS Major(majorId CHAR(10) NOT NULL PRIMARY KEY,majorName CHAR(10),majorExplain CHAR(30)
)
#建课程表
CREATE TABLE IF NOT EXISTS Course(courseId CHAR(10) NOT NULL PRIMARY KEY,courseGrade CHAR(10),courseName CHAR(10),courseExplain CHAR(30)
)
#建用户表
CREATE TABLE IF NOT EXISTS USER(userId INT NOT NULL PRIMARY KEY AUTO_INCREMENT,userName CHAR(20),userPassword CHAR(20)
)
#建班级表
CREATE TABLE IF NOT EXISTS Class(classId CHAR(10)  NOT NULL PRIMARY KEY,className CHAR(10),classCount CHAR(10),classExplain CHAR(30),teacher CHAR(10),majorId char(10),FOREIGN KEY(majorId) REFERENCES  Major(majorId)
)
#建学生表
CREATE TABLE IF NOT EXISTS Student(studentId char(10) NOT NULL PRIMARY KEY,studentName char(10), sex char(10),age char(10),studentExplain char(30),classId char(10),FOREIGN KEY(classId) REFERENCES  Class(classId)
)
#建选课表
CREATE TABLE IF NOT EXISTS Choose(courseId char(10) not null,studentId char(10) not null,grade char(10),PRIMARY KEY(courseId,studentId),FOREIGN KEY(courseId) REFERENCES  Course(courseId),FOREIGN KEY(studentId) REFERENCES  Student(studentId)
)

三、窗体设计

各窗体控件名:

用户登录:
窗体名:register
用户名:userName
密码:passWord
验证码:verification用户注册:
窗体名:sign
用户名:userName
密码:passWord
确认密码:againPassword主菜单:
窗体名:Menu添加专业:
窗体名:AddProfessional
专业编号:zhuanyeId
专业名称:zhuanyeName
专业描述:describe浏览专业:
窗体名:BrowseMajor修改专业:
窗体名:UpdateMajor添加课程:
窗体名:AddCourse
课程编号:courseId
课程学分:courseCredit
课程名称:courseName
课程说明:describe浏览课程:
窗体名:BrowseCourse添加班级:
窗体名:AddClass
班级号:classId
班级名称:className
班主任:teacher
班级人数:count
所属专业:major
说明:emplain班级浏览:
窗体名:BrowseClass
班级号:classid添加学生:
窗体名:AddStudent
学号:studentId
姓名:studentName
性别:sex
年龄:age
班级编号:classId学生预览:
窗体名:BrowseStudent
学号:studentId录入成绩:
窗体名:AddScore
学号:studentId
课程号:courseId
成绩:Score成绩浏览:
窗体名:BrowseScore

(一)登录界面

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class register : Form{public register(){InitializeComponent();}private void button2_Click(object sender, EventArgs e){this.Hide();sign stu = new sign();stu.Show();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (userName.Text==""){MessageBox.Show("用户名不能为空", "用户登录", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (passWord.Text == ""){MessageBox.Show("密码不能为空", "用户登录", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (verification.Text == ""){MessageBox.Show("验证码不能为空", "用户登录", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (verification.Text != label4.Text){MessageBox.Show("验证码错误,请重新输入", "用户登录", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{//查询数据库账户信息string username = userName.Text;string password = passWord.Text;string sql = "SELECT COUNT(*) FROM USER WHERE userName='" + username + "' AND userPassword = '" + password + "'; ";MySqlCommand com = new MySqlCommand(sql, conn);if (Convert.ToInt32(com.ExecuteScalar())==0){MessageBox.Show("用户名或者密码错误,请重新输入", "用户登录", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{Menu stu = new Menu();stu.Show();this.Hide();}}}private void register_Load(object sender, EventArgs e){Random rd = new Random();label4.Text = Convert.ToString(rd.Next(1000, 10000));}}
}

(二)注册界面

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class sign : Form{public sign(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (userName.Text == ""){MessageBox.Show("用户名不能为空", "用户注册", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (passWord.Text == ""){MessageBox.Show("密码不能为空", "用户注册", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (againPassword.Text == ""){MessageBox.Show("请再次输入密码", "用户注册", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (passWord.Text != againPassword.Text){MessageBox.Show("两次密码输入不一致", "用户注册", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{string username = userName.Text;string password = passWord.Text;//账户存入数据库string sql = "insert into User set userName='" + username + "',userPassword='" + password + "'";MySqlCommand com = new MySqlCommand(sql, conn);com.ExecuteNonQuery();MessageBox.Show("注册成功", "用户注册", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();register stu = new register();stu.Show();}}private void button2_Click(object sender, EventArgs e){this.Hide();register stu = new register();stu.Show();}private void sign_Load(object sender, EventArgs e){}}
}

(三)主菜单

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace studentStatusManagementSyatem
{public partial class Menu : Form{public Menu(){InitializeComponent();}private void 添加专业ToolStripMenuItem_Click(object sender, EventArgs e){//打开添加专业窗口page.Text = "添加专业";AddProfessional stu = new AddProfessional();stu.Show();}private void 专业浏览ToolStripMenuItem_Click(object sender, EventArgs e){//打开浏览专业窗口page.Text = "专业浏览";BrowseMajor stu = new BrowseMajor();stu.Show();}private void 添加课程ToolStripMenuItem_Click(object sender, EventArgs e){page.Text = "添加课程";AddCourse stu = new AddCourse();stu.Show();}private void 课程浏览ToolStripMenuItem_Click(object sender, EventArgs e){page.Text = "课程浏览";BrowseCourse stu = new BrowseCourse();stu.Show();}private void 退出系统ToolStripMenuItem_Click(object sender, EventArgs e){this.Hide();register stu = new register();stu.Show();}private void 班级浏览ToolStripMenuItem_Click(object sender, EventArgs e){BrowseClass stu = new BrowseClass();stu.Show();page.Text = "班级浏览";}private void 添加班级ToolStripMenuItem_Click(object sender, EventArgs e){AddClass stu = new AddClass();stu.Show();page.Text = "添加班级";}private void 添加学生ToolStripMenuItem_Click(object sender, EventArgs e){page.Text = "添加学生";AddStudent stu = new AddStudent();stu.Show();}private void 学生浏览ToolStripMenuItem_Click(object sender, EventArgs e){page.Text = "学生预览";BrowseStudent stu = new BrowseStudent();stu.Show();}private void 录入成绩ToolStripMenuItem_Click(object sender, EventArgs e){page.Text = "添加成绩";AddScore stu = new AddScore();stu.Show();}private void 成绩浏览ToolStripMenuItem_Click(object sender, EventArgs e){page.Text = "成绩浏览";BrowseScore stu = new BrowseScore();stu.Show();}private void Menu_Load(object sender, EventArgs e){}}
}

(四)专业管理模块

添加专业

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class AddProfessional : Form{public AddProfessional(){InitializeComponent();}private void button2_Click(object sender, EventArgs e){this.Hide();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (zhuanyeId.Text == ""){MessageBox.Show("专业编号不能为空不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (zhuanyeName.Text == ""){MessageBox.Show("专业名称不能为空不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{//数据库取数据判断专业是否存在string zhuanyeid = zhuanyeId.Text;string zhuanyename = zhuanyeName.Text;string miaoshu = textBox1.Text;string sql1 = "select count(*) from major where majorId='"+zhuanyeid+"'";MySqlCommand com = new MySqlCommand(sql1, conn);if (Convert.ToInt32(com.ExecuteScalar())>0)//专业存在{MessageBox.Show("此专业已存在", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else//添加进数据库{string sql2 = "insert into major set majorId='" + zhuanyeid + "',majorName='" + zhuanyename + "',majorExplain='" + miaoshu + "'";MySqlCommand com2 = new MySqlCommand(sql2, conn);com2.ExecuteNonQuery();MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}}private void AddProfessional_Load(object sender, EventArgs e){}}
}

2.浏览专业

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class BrowseMajor : Form{public static string t1;public static string t2;public static string t3;public static string[] array = new string[100];public static int index;public BrowseMajor(){InitializeComponent();}private void button3_Click(object sender, EventArgs e){this.Hide();}private void BrowseMajor_Load(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregion//获取所有专业string sql = "SELECT * FROM major";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();listBox1.Items.Clear();listBox1.Items.Add(string.Format("专业编号       专业名          专业说明"));int i = 0;while (reader.Read()){listBox1.Items.Add(string.Format("{0,5}\t{1,10}\t{2,10}",reader[0],reader[1],reader[2]));array[i++] = (string)reader[0];//将编号依次存入数组}reader.Close();}private void button2_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (listBox1.SelectedIndex > 0){//删除这个专业的学生string sql3 = "DELETE student FROM Student,Class WHERE  Student.classId=Class.classId AND Class.majorId='"+array[listBox1.SelectedIndex - 1]+"'";MySqlCommand comdt = new MySqlCommand(sql3, conn);comdt.ExecuteNonQuery();//先删除在这个专业的所有班级string sql1 = "DELETE FROM Class WHERE class.majorId='"+ array[listBox1.SelectedIndex - 1] + "'";MySqlCommand comd = new MySqlCommand(sql1, conn);comd.ExecuteNonQuery();//删除专业#region 删除string sql = "DELETE FROM major WHERE majorId='" + array[listBox1.SelectedIndex - 1] + "'";MySqlCommand cmd = new MySqlCommand(sql, conn);cmd.ExecuteNonQuery();#endregionMessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (listBox1.SelectedIndex > 0){//查数据string sql2 = "select * from major where majorId='" + array[listBox1.SelectedIndex - 1] + "'";MySqlCommand cmdd = new MySqlCommand(sql2, conn);MySqlDataReader reader = cmdd.ExecuteReader();while (reader.Read()){t1 = (string)reader[0];t2 = (string)reader[1];t3 = (string)reader[2];}reader.Close();BrowseMajor.index = listBox1.SelectedIndex - 1;UpdateMajor stu = new UpdateMajor();stu.Show(this);this.Hide();}    }}
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class UpdateMajor : Form{public UpdateMajor(){InitializeComponent();}private void textBox1_TextChanged(object sender, EventArgs e){}private void UpdateMajor_Load(object sender, EventArgs e){textBox1.Text = BrowseMajor.t1;textBox2.Text = BrowseMajor.t2;textBox3.Text = BrowseMajor.t3;}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregion//string newt1 = textBox1.Text;string newt2 = textBox2.Text;string newt3 = textBox3.Text;string sql="UPDATE major SET  majorName = '"+newt2+"', majorExplain = '"+newt3+"' WHERE majorid = '"+ BrowseMajor.array[BrowseMajor.index] + "'";MySqlCommand com = new MySqlCommand(sql, conn);com.ExecuteNonQuery();MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}
}

(五)班级管理

添加班级

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace studentStatusManagementSyatem
{public partial class AddClass : Form{public AddClass(){InitializeComponent();}private void button2_Click(object sender, EventArgs e){this.Hide();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (classId.Text==""){MessageBox.Show("班级编号不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (className.Text == ""){MessageBox.Show("班级名称不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{string banjiId = classId.Text;string banjiName = className.Text;string banzhur = teacher.Text;string renshu = count.Text;//获得专业名称string zhuanye = "";if (major.SelectedIndex != -1){zhuanye = major.SelectedItem.ToString();}else{major.SelectedIndex = 0;}//获得专业idstring zhuanyeId="";string sql = "select majorId from major where majorName='" + zhuanye + "'";MySqlCommand comt = new MySqlCommand(sql,conn);MySqlDataReader reader = comt.ExecuteReader();while (reader.Read()){zhuanyeId =(string) reader[0];}reader.Close();MySqlCommand comm = new MySqlCommand();string shuoming = emplain.Text;string sql1 = "select count(*) from Class where ClassId='" + banjiId + "'";MySqlCommand com = new MySqlCommand(sql1, conn);if (Convert.ToInt32(com.ExecuteScalar()) > 0)//班级存在{MessageBox.Show("此班级已存在", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else//添加进数据库{string sql2 = "insert into Class set classId='" + banjiId + "',className='" + banjiName + "',classCount='" + renshu + "',teacher='"+banzhur+"',classExplain='"+shuoming+"',majorId='"+zhuanyeId+"'";MySqlCommand com2 = new MySqlCommand(sql2, conn);com2.ExecuteNonQuery();MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();                 }}}private void AddClass_Load(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregion//导入专业进集合MySqlCommand st = new MySqlCommand("select majorName from major", conn);MySqlDataReader reader1 = st.ExecuteReader();major.Items.Clear();while (reader1.Read()){major.Items.Add((string)reader1[0]);}reader1.Close();}}
}

班级浏览

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class BrowseClass : Form{public static string t1 = "";public static string t2 = "";public static string t3 = "";public static string t4 = "";public static string t5 = "";public static string t6 = "";public static string[] array = new string[100];public static int index;public BrowseClass(){InitializeComponent();}private void button3_Click(object sender, EventArgs e){this.Hide();}private void button4_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionstring classId = classid.Text;string sql = "select * from Class where classId='" + classId + "'";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();listBox1.Items.Clear();listBox1.Items.Add("班级编号\t班级名称\t班级人数\t班主任\t  班级说明\t");while(reader.Read()){listBox1.Items.Add(string.Format("{0}\t{1}\t{2}\t\t{3}\t  {4}", reader[0], reader[1], reader[2], reader[4], reader[3] ));}if (listBox1.Items.Count == 1){MessageBox.Show("不存在此班级", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}}private void button2_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (listBox1.SelectedIndex>0){//先删除这个班的学生string sql3 = "DELETE student FROM Student WHERE  Student.classId='" + array[listBox1.SelectedIndex - 1] + "'";MySqlCommand comdt = new MySqlCommand(sql3, conn);comdt.ExecuteNonQuery();//删除#region 删除string sql = "DELETE FROM Class WHERE ClassId='" + array[listBox1.SelectedIndex-1] + "'";MySqlCommand cmd = new MySqlCommand(sql, conn);cmd.ExecuteNonQuery();#endregionMessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}private void button1_Click(object sender, EventArgs e){if (listBox1.SelectedIndex>0){index = listBox1.SelectedIndex - 1;#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionstring sql = "select * from Class where classId='" + array[index] + "'";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();while (reader.Read()){t1 = (string)reader[0];t2 = (string)reader[1];t3 = (string)reader[2];t4 = (string)reader[3];t5 = (string)reader[4];t6 = (string)reader[5];}updateClass stu = new updateClass();stu.Show();this.Hide();}}private void BrowseClass_Load(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregion//获取所有班级string sql = "SELECT * FROM Class";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();listBox1.Items.Clear();listBox1.Items.Add(string.Format("班级编号\t班级名称\t班级人数\t班主任\t  班级说明\t"));int i = 0;while (reader.Read()){listBox1.Items.Add(string.Format("{0}\t{1}\t{2}\t\t{3}\t  {4}", reader[0], reader[1], reader[2], reader[4], reader[3]));array[i++] = (string)reader[0];//将编号依次存入数组}reader.Close();}}
}

修改班级信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class updateClass : Form{public updateClass(){InitializeComponent();}private void updateClass_Load(object sender, EventArgs e){classId.Text = BrowseClass.t1;className.Text = BrowseClass.t2;count.Text = BrowseClass.t3;emplain.Text = BrowseClass.t4;teacher.Text = BrowseClass.t5;#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregion//导入专业进集合MySqlCommand st = new MySqlCommand("select majorName from major", conn);MySqlDataReader reader1 = st.ExecuteReader();major.Items.Clear();while (reader1.Read()){major.Items.Add((string)reader1[0]);}reader1.Close();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionstring banjiId = classId.Text;string banjiName = className.Text;string banzhur = teacher.Text;string renshu = count.Text;//获得专业名称string zhuanye = "";if (major.SelectedIndex != -1){zhuanye = major.SelectedItem.ToString();}else{major.SelectedIndex = 0;}//获得专业idstring zhuanyeId = "";string sql = "select majorId from major where majorName='" + zhuanye + "'";MySqlCommand comt = new MySqlCommand(sql, conn);MySqlDataReader reader = comt.ExecuteReader();while (reader.Read()){zhuanyeId = (string)reader[0];}reader.Close();string shuoming = emplain.Text;string sql2 = "update Class set className='" + banjiName + "',classCount='" + renshu + "',teacher='" + banzhur + "',classExplain='" + shuoming + "',majorId='" + zhuanyeId + "' where ClassId='"+ banjiId + "'";MySqlCommand com2 = new MySqlCommand(sql2, conn);com2.ExecuteNonQuery();MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}
}

(六)学生管理

添加学生

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class AddStudent : Form{public AddStudent(){InitializeComponent();}private void label2_Click(object sender, EventArgs e){}private void comboBox1_SelectedIndexChanged(object sender, EventArgs e){}private void label5_Click(object sender, EventArgs e){}private void button2_Click(object sender, EventArgs e){this.Hide();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (studentId.Text == ""){MessageBox.Show("学号不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (studentName.Text == ""){MessageBox.Show("学生姓名不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{//  判断该学生是否已经存在string studentage = age.Text;//获得班级名称string banji = "";if (classId.SelectedIndex != -1){banji  = classId.SelectedItem.ToString();}else{classId.SelectedIndex = 0;}//获得班级idstring classid = "";string sql = "select ClassId from Class where className='" + banji + "'";MySqlCommand comt = new MySqlCommand(sql, conn);MySqlDataReader reader = comt.ExecuteReader();while (reader.Read()){classid = (string)reader[0];}reader.Close();string miashu = textBox5.Text;string studentid = studentId.Text;string studentname = studentName.Text;string studentsex = sex.SelectedItem.ToString();string sql1 = "select count(*) from Student where studentId='" + studentid + "'";MySqlCommand com = new MySqlCommand(sql1, conn);if (Convert.ToInt32(com.ExecuteScalar()) > 0)//学生存在{MessageBox.Show("此学生已存在", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else//添加进数据库{string sql2 = "insert into student set studentId='" + studentid + "',studentName='" + studentname + "',sex='" + studentsex + "',age='" + studentage + "',studentExplain='"+ miashu + "',classId='"+classid+"'";MySqlCommand com2 = new MySqlCommand(sql2, conn);com2.ExecuteNonQuery();MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}}private void AddStudent_Load(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregion//导入班级进集合MySqlCommand st = new MySqlCommand("select className from Class", conn);MySqlDataReader reader1 = st.ExecuteReader();classId.Items.Clear();while (reader1.Read()){classId.Items.Add((string)reader1[0]);}reader1.Close();}}
}

学生浏览

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class BrowseStudent : Form{public static string t1 = "";public static string t2 = "";public static string t3 = "";public static string t4 = "";public static string t5 = "";public static string t6 = "";public static string[] array = new string[100];public BrowseStudent(){InitializeComponent();}private void button3_Click(object sender, EventArgs e){this.Hide();}private void button4_Click(object sender, EventArgs e){string studentid = studentId.Text;#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionstring sql = "select * from Student where studentId='" + studentid + "'";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();listBox1.Items.Clear();listBox1.Items.Add("  学号\t\t姓名\t性别\t年龄\t 班级编号\t 说明\t");while (reader.Read()){listBox1.Items.Add(string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", reader[0], reader[1], reader[2],reader[3],reader[5],reader[4]));}if (listBox1.Items.Count == 1){MessageBox.Show("不存在此学生", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}}private void button2_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (listBox1.SelectedIndex>0){//删除学生的所有成绩string sql1 = "delete from choose where studentId='"+ BrowseStudent.t1 + "'";MySqlCommand cmdt = new MySqlCommand(sql1, conn);cmdt.ExecuteNonQuery();//删除#region 删除string sql = "DELETE FROM Student WHERE studentId='" + BrowseStudent.t1 + "'";MySqlCommand cmd = new MySqlCommand(sql, conn);cmd.ExecuteNonQuery();#endregionMessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}private void button1_Click(object sender, EventArgs e){if (listBox1.SelectedIndex> 0){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionstring sql = "select * from Student where studentId='" + array[listBox1.SelectedIndex-1] + "'";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();while (reader.Read()){t1 = (string)reader[0];t2 = (string)reader[1];t3 = (string)reader[2];t4 = (string)reader[3];t5 = (string)reader[4];t6 = (string)reader[5];}UpdateStudent stu = new UpdateStudent();stu.Show(this);this.Hide();}}private void BrowseStudent_Load(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregion//获取所有班级string sql = "SELECT * FROM student";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();listBox1.Items.Clear();listBox1.Items.Add(string.Format("  学号\t\t姓名\t性别\t年龄\t 班级编号\t 说明\t"));int i = 0;while (reader.Read()){listBox1.Items.Add(string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", reader[0], reader[1], reader[2], reader[3], reader[5], reader[4]));array[i++] = (string)reader[0];//将编号依次存入数组}reader.Close();}}}

修改学生信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class UpdateStudent : Form{public UpdateStudent(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (studentId.Text == ""){MessageBox.Show("学号不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (studentName.Text == ""){MessageBox.Show("学生姓名不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{//  判断该学生是否已经存在string studentage = age.Text;//获得班级名称string banji = "";if (classId.SelectedIndex != -1){banji = classId.SelectedItem.ToString();}else{classId.SelectedIndex = 0;}//获得班级idstring classid = "";string sql = "select ClassId from Class where className='" + banji + "'";MySqlCommand comt = new MySqlCommand(sql, conn);MySqlDataReader reader = comt.ExecuteReader();while (reader.Read()){classid = (string)reader[0];}reader.Close();string miashu = textBox5.Text;string studentid = studentId.Text;string studentname = studentName.Text;string studentsex = sex.SelectedItem.ToString();string sql1 = "select count(*) from Student where studentId='" + studentid + "'";                        string sql2 = "update student set studentName='" + studentname + "',sex='" + studentsex + "',age='" + studentage + "',studentExplain='" + miashu + "',classId='" + classid + "' where studentId='"+ studentid + "'";MySqlCommand com2 = new MySqlCommand(sql2, conn);com2.ExecuteNonQuery();MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}private void UpdateStudent_Load(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionstudentId.Text = BrowseStudent.t1;studentName.Text = BrowseStudent.t2;age.Text = BrowseStudent.t4;textBox5.Text = BrowseStudent.t5;//导入班级进集合MySqlCommand st = new MySqlCommand("select className from Class", conn);MySqlDataReader reader1 = st.ExecuteReader();classId.Items.Clear();while (reader1.Read()){classId.Items.Add((string)reader1[0]);}reader1.Close();}}
}

(七)课程管理

添加课程

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace studentStatusManagementSyatem
{public partial class AddCourse : Form{public AddCourse(){InitializeComponent();}private void textBox2_TextChanged(object sender, EventArgs e){}private void button2_Click(object sender, EventArgs e){this.Hide();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (courseId.Text == ""){MessageBox.Show("课程编号不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (courseName.Text == ""){MessageBox.Show("课程名不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (courseCredit.Text == ""){MessageBox.Show("课程学分不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{//判断课程编号是否已存在string courseid = courseId.Text;string credit = courseCredit.Text;string coursename = courseName.Text;string shuoming = textBox1.Text;//添加入课程表中string sql = "select count(*) from Course where courseId='" + courseid + "'";MySqlCommand com = new MySqlCommand(sql, conn);if (Convert.ToInt32(com.ExecuteScalar()) > 0)//课程存在{MessageBox.Show("此课程已存在", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else//添加进数据库{string sql2 = "insert into Course set courseID='" + courseid + "',courseGrade='" + credit + "',courseName='" + coursename + "',courseExplain='" + shuoming + "'";MySqlCommand com2 = new MySqlCommand(sql2, conn);com2.ExecuteNonQuery();MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}}private void AddCourse_Load(object sender, EventArgs e){}}
}

课程浏览

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;namespace studentStatusManagementSyatem
{public partial class BrowseCourse : Form{public static string t1;public static string t2;public static string t3;public static string t4;string[] array = new string[100];public BrowseCourse(){InitializeComponent();}private void button3_Click(object sender, EventArgs e){this.Hide();}private void BrowseCourse_Load(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregion//获取所有专业string sql = "SELECT * FROM course";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();listBox1.Items.Clear();listBox1.Items.Add(string.Format("课程编号       课程学分          课程名称           课程说明"));int i = 0;while (reader.Read()){listBox1.Items.Add(string.Format("{0,5}\t{1,10}\t{2,15}\t{3,10}", reader[0], reader[1], reader[2],reader[3]));array[i++] = (string)reader[0];//将编号依次存入数组}reader.Close();}private void button2_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (listBox1.SelectedIndex > 0){//删除所有选课记录string sql1 = "delete from choose where courseId='" + array[listBox1.SelectedIndex - 1] + "'";MySqlCommand comt = new MySqlCommand(sql1, conn);comt.ExecuteNonQuery();//删除#region 删除string sql = "DELETE FROM Course WHERE courseId='" + array[listBox1.SelectedIndex - 1] + "'";MySqlCommand cmd = new MySqlCommand(sql, conn);cmd.ExecuteNonQuery();#endregionMessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (listBox1.SelectedIndex > 0){//查数据string sql2 = "select * from Course where courseId='" + array[listBox1.SelectedIndex - 1] + "'";MySqlCommand cmdd = new MySqlCommand(sql2, conn);MySqlDataReader reader = cmdd.ExecuteReader();while (reader.Read()){t1 = (string)reader[0];t2 = (string)reader[1];t3 = (string)reader[2];t4 = (string)reader[3];}reader.Close();UpdateCourse stu = new UpdateCourse();stu.Show(this);this.Hide();}}}
}

课程信息修改

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace studentStatusManagementSyatem
{public partial class UpdateCourse : Form{public UpdateCourse(){InitializeComponent();}private void UpdateCourse_Load(object sender, EventArgs e){courseId.Text = BrowseCourse.t1;courseCredit.Text = BrowseCourse.t2;courseName.Text = BrowseCourse.t3;textBox1.Text = BrowseCourse.t4;}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionstring courseid = courseId.Text;string credit = courseCredit.Text;string coursename = courseName.Text;string shuoming = textBox1.Text;//添加入课程表中string sql2 = "update  Course set courseGrade='" + credit + "',courseName='" + coursename + "',courseExplain='" + shuoming + "' where courseId='"+courseid+"'";MySqlCommand com2 = new MySqlCommand(sql2, conn);com2.ExecuteNonQuery();MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}
}

(八)成绩管理

录入成绩

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace studentStatusManagementSyatem
{public partial class AddScore : Form{public AddScore(){InitializeComponent();}private void button2_Click(object sender, EventArgs e){this.Hide();}private void button1_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (studentId.Text == ""){MessageBox.Show("学号不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (courseId.Text == ""){MessageBox.Show("课程号不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (Score.Text == ""){MessageBox.Show("成绩不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else{//判断是否已经录入string studentid = studentId.Text;string courseid = courseId.Text;string score = Score.Text;string sql1 = "SELECT COUNT(*) FROM choose WHERE studentId='"+studentid+"' AND courseId='"+courseid+"' ";//判断是否存在此学生string sql = "SELECT COUNT(*) FROM student WHERE studentId = '"+studentid+"'";MySqlCommand com1 = new MySqlCommand(sql,conn);// 判断是否存在此课程string sql3 = "SELECT COUNT(*) FROM course WHERE courseId = '" +courseid +"'";MySqlCommand com2 = new MySqlCommand(sql3, conn);MySqlCommand com = new MySqlCommand(sql1, conn);if (Convert.ToInt32(com1.ExecuteScalar())==0){MessageBox.Show("不存在此学生,请先添加", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (Convert.ToInt32(com2.ExecuteScalar()) == 0){MessageBox.Show("不存在此课程,请先添加", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else if (Convert.ToInt32(com.ExecuteScalar()) > 0)//成绩存在{MessageBox.Show("此成绩已存在", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);}else//添加进数据库{string sql2 = "insert into choose set studentId='" + studentid + "',courseId='" + courseid + "',grade='"+score+"'";MySqlCommand com3 = new MySqlCommand(sql2, conn);com3.ExecuteNonQuery();MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}}private void AddScore_Load(object sender, EventArgs e){}}
}

浏览成绩

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace studentStatusManagementSyatem
{public partial class BrowseScore : Form{public static string[] id1 = new string[100];public static string[] id2 = new string[100];public static string[] id3 = new string[100];public static int index;public BrowseScore(){InitializeComponent();}private void button3_Click(object sender, EventArgs e){this.Hide();}private void button4_Click(object sender, EventArgs e){string studentid = studentId.Text;#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionstring sql = "SELECT course.courseId,student.studentId,studentName,courseName,grade FROM choose,student,course WHERE choose.courseId=course.courseId AND choose.studentId=student.studentId AND student.studentId='"+studentid+"'";MySqlCommand com = new MySqlCommand(sql, conn);MySqlDataReader reader = com.ExecuteReader();listBox1.Items.Clear();listBox1.Items.Add("课程号\t学号\t\t    姓名\t  课程名\t\t成绩");int i = 0;while (reader.Read()){listBox1.Items.Add(string.Format("{0,5}\t{1,5}\t{2,10}\t{3,10}\t{4,10}", reader[0], reader[1], reader[2], reader[3],reader[4]));id1[i] = (string)reader[0];id2[i] = (string)reader[1];id3[i++] = (string)reader[4];}}private void button2_Click(object sender, EventArgs e){#region 连接数据库//定义连接字符串string connStr = "Database=StudentStatusManagement;Data Source=127.0.0.1;port=3306;User Id=root;";MySqlConnection conn = new MySqlConnection(connStr);//创建Connection对象conn.Open();//打开数据库#endregionif (listBox1.SelectedIndex > 0){//删除#region 删除string sql = "delete FROM choose WHERE choose.courseId='"+ id1[listBox1.SelectedIndex - 1] + "' AND choose.studentId='"+ id2[listBox1.SelectedIndex - 1] + "'";MySqlCommand cmd = new MySqlCommand(sql, conn);cmd.ExecuteNonQuery();#endregionMessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);this.Hide();}}private void button1_Click(object sender, EventArgs e){if (listBox1.SelectedIndex > 1){index = listBox1.SelectedIndex - 1;UpdateSocore stu = new UpdateSocore();stu.Show(this);this.Hide();}}private void BrowseScore_Load(object sender, EventArgs e){}}
}

C#实现学生学籍管理系统 (Mysql)相关推荐

  1. mysql学籍管理系统的开发背景,学生学籍管理系统的设计与实现(JSP,MySQL)

    学生学籍管理系统的设计与实现(JSP,MySQL)(任务书,开题报告,中期检查表,文献综述,外文翻译,毕业论文22000字,程序代码,MySQL数据库) 本课题根据学生学籍管理系统的流程及所需要的相关 ...

  2. 学生学籍管理系统 jsp mysql_学生学籍管理系统的设计与实现(JSP,MySQL)

    学生学籍管理系统的设计与实现(,MySQL)(任务书,开题报告,中期检查表,文献综述,外文翻译,毕业论文22000字,程序代码,MySQL数据库) 本课题根据学生学籍管理系统的流程及所需要的相关操作, ...

  3. 用mysql设计学籍管理系统_学生学籍管理系统(SQL数据库系统设计)(完整版).pdf...

    . 数据库课程设计报告 < 学生学籍管理系统 > 专业 班级 小组成员 指导老师 开始时间 完成时间 word 专业资料 . 目录 数据库课程设计报告 1 1. 问题描述 3 1.1 背景 ...

  4. 基于java的学生学籍管理系统(含源文件)

    欢迎添加微信互相交流学习哦! 项目源码:https://gitee.com/oklongmm/biye 目录 内容摘要    - 2 - 引言    - 4 - 学生学籍管理系统开发的意义和目的   ...

  5. 学生学籍管理系统html代码,学生学籍管理系统源代码.doc

    学生学籍管理系统源代码 源代码: 连接数据库的代码: package cn.system.manage.tools; import java.sql.Connection; import java.s ...

  6. 西电数据库实验-学生学籍管理系统 数据库设计

    西电数据库实验-学生学籍管理系统 数据库设计 文章目录 西电数据库实验-学生学籍管理系统 数据库设计 需求分析 实体集 联系集 概念结构设计 逻辑结构设计 实体集 department(id‾,nam ...

  7. 基于php学生学籍管理系统获取(php毕业设计)

    基于php学生学籍管理系统 学生学籍管理系统是基于php和mysql开发的系统,系统分为学生,教师,管理员三个角色,其中学生修改个人信息,查看成绩:教师查看学生学籍,添加成绩,查看成绩:管理员可以对院 ...

  8. 用PHP写一个学生学籍管理系统

    为了搭建一个完整的学生学籍管理系统,需要分模块进行设计和实现.这里我们按照以下模块来讲解: 数据库设计 用户登录和权限控制 学生信息管理 班级信息管理 课程信息管理 成绩信息管理 1. 数据库设计 我 ...

  9. 【计算机毕业设计】679学生学籍管理系统

    一.系统截图(需要演示视频可以私聊) 目 录 目 录 摘  要 ABSTRACT 1 绪论 1.1 课题背景 1.2 研究现状 1.3 研究内容 2 系统开发环境 2.1 vue技术 2.2 JAVA ...

  10. 学籍管理系统 c语言流程图,程序设计基础 ——C语言第10章 综合应用案例——学生学籍管理系统...

    程序设计基础 第 10章 综合应用 案例 -学生学籍 管理系统 1 详细设计 需求分析 总体设计 第 10章 综合应用 案例 -学生学籍管理系统 编码实现 运行结果 2 设计一个利用 文件 处理方式, ...

最新文章

  1. LOJ6435 PKUSC2018 星际穿越
  2. UIWindow简单介绍
  3. 深入理解android卷II 即将发布
  4. csharp通过dll调用opencv函数,图片作为参数
  5. 51. N 皇后(回溯算法)
  6. 天池四月读书会|数据分析金融量化,6场直播,6位大咖,6个项目实战
  7. 递归Java_递归的Java实现
  8. 用gRPC建设微服务,Proto 怎么管理更合适
  9. [转]Stream 和 byte[] 之间的转换
  10. 遗留非springboot传统项目接入eureka注册与服务发现
  11. 开发一个Java项目的完整流程(附2600套Java项目源码+视频)
  12. php导出合同模板到excel
  13. PyTorch 单机多GPU 训练方法与原理整理
  14. JavaScript 编程精解 中文第三版 四、数据结构:对象和数组
  15. gogodroid--android 上的IPV6工具
  16. IT人员必须关注的五个IT新技术方向
  17. 我只管向前奔跑,其他的交给时间
  18. HTTPS网站提示证书有安全问题的解决方案
  19. 木兰编程语言python_国产木兰编程果然是大骗局,碰瓷Python毫无悬念
  20. Java对接微信公众号模板消息推送

热门文章

  1. 五、函数与lambda表达式
  2. System.out.println(“我的创作纪念日 - 三周年“);
  3. LOJ#10003 加工生产调度(贪心)
  4. matlab 保存多个变量,Matlab将变量导出到文件心得
  5. JavaScript 年历的制作
  6. Windows下谷歌浏览器快捷键方式汇总
  7. 四次元新浪微博客户端Android源码
  8. 腾讯中国电竞市场新玩法
  9. 在循环列表的富文本里摘出每个item的img标签内容(适合vue渲染)
  10. 从某种意义上讲,其实我们这些有份薪水的人也是有钱人