重庆三峡学院
this.Close(); }
//插入成绩信息,取消按钮消息相应函数
private void button5_Click(object sender, EventArgs e) {
textBox16.Text = \ textBox17.Text = \ textBox18.Text = \ } } }
1.2信息删除模块
namespace StudentManagerSys {
public partial class DeleteForm : Form {
public string delStudentNo = \ public string delClassNo = \ public string delCourseNo = \ public string delScoreid = \
public DeleteForm() {
InitializeComponent(); }
//显示所有相应表格的数据
public void ShowAllData(string type) {
DataSet set;
if (type == \学生\ {
Student stu = new Student(); set = stu.selectAll();
dataGridView1.DataSource = set;
dataGridView1.DataMember = \ }
else if (type == \班级\ {
Classinfo cla = new Classinfo(); set = cla.selectAll();
共 42 页 第 15 页
重庆三峡学院
dataGridView2.DataSource = set;
dataGridView2.DataMember = \ }
else if (type == \课程\ {
Course cou = new Course(); set = cou.selectAll();
dataGridView3.DataSource = set;
dataGridView3.DataMember = \ }
else if (type == \成绩\ {
Score sco = new Score(); set = sco.selectAll();
dataGridView4.DataSource = set;
dataGridView4.DataMember = \ } }
private void tabControl1_Selected(object sender, TabControlEventArgs e) {
if (e.TabPage == tabPage1) {
ShowAllData(\学生\ }
else if (e.TabPage == tabPage2) {
ShowAllData(\班级\ }
else if (e.TabPage == tabPage3) {
ShowAllData(\课程\ }
else if (e.TabPage == tabPage4) {
ShowAllData(\成绩\ } }
//删除学生信息
private void button1_delstu_Click(object sender, EventArgs e) {
if (MessageBox.Show(this, \要删除所选记录吗?\请确认\ MessageBoxButtons.YesNo,
共 42 页 第 16 页
重庆三峡学院
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign) == DialogResult.No) return;
foreach (Control ctrl in this.Controls)//通过个一循环得到信息 {
string ctrlName = ctrl.Name.Trim();
if (ctrlName.StartsWith(\查询信息根据的主键 {
ctrl.Enabled = false; }
delStudentNo
dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value.ToString(); Student stu = new Student();
stu.delete(delStudentNo); } }
//删除成绩信息
private void button1_delsco_Click(object sender, EventArgs e) {
if (MessageBox.Show(this, \要删除所选记录吗?\请确认\ MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign) == DialogResult.No) return;
if (delStudentNo != \ {
Score sco = new Score();
sco.delete(delStudentNo, delClassNo); }
}
//删除课程信息
private void button1_delCou_Click(object sender, EventArgs e) {
if (MessageBox.Show(this, \要删除所选记录吗?\请确认\ MessageBoxButtons.YesNo, MessageBoxIcon.Question,
共 42 页 第 17 页
=
重庆三峡学院
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign) == DialogResult.No) return;
foreach (Control ctrl in this.Controls)//通过个一循环得到信息 {
string ctrlName = ctrl.Name.Trim();
if (ctrlName.StartsWith(\查询信息根据的主键 {
ctrl.Enabled = false; }
delCourseNo
dataGridView3.Rows[dataGridView3.CurrentRow.Index].Cells[0].Value.ToString(); Course cou = new Course();
cou.delete(delCourseNo); } }
//删除班级信息
private void button1_delcla_Click(object sender, EventArgs e) {
if (MessageBox.Show(this, \要删除所选记录吗?\请确认\ MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign) == DialogResult.No) return;
foreach (Control ctrl in this.Controls)//通过个一循环得到信息 {
string ctrlName = ctrl.Name.Trim();
if (ctrlName.StartsWith(\查询信息根据的主键 {
ctrl.Enabled = false; }
delClassNo=
dataGridView2.Rows[dataGridView2.CurrentRow.Index].Cells[0].Value.ToString(); Classinfo cla = new Classinfo(); cla.delete(delClassNo); } }
private void DeleteForm_Load(object sender, EventArgs e) {
共 42 页 第 18 页
=
重庆三峡学院
ShowAllData(\学生\ }
private void dataGridView4_CellValidated(object sender, DataGridViewCellEventArgs e) {
delStudentNo = dataGridView4.Rows[e.RowIndex].Cells[0].Value.ToString(); delClassNo = dataGridView4.Rows[e.RowIndex].Cells[1].Value.ToString(); } } }
1.3信息修改模块
namespace StudentManagerSys {
public partial class ModifyForm : Form {
//修改学生信息用到的数据 public string modifyStudnetno; public string modifyStudnetname; public string modifySex; public string modifyAtive; public string modifyAddress; public string modifyBirth;
//修改班级信息用到的数据 public string modifyClassno; public string modifyDepart; public string modifySpecical; public string modifyStudyears; public string modifyEntertime;
//修改课程信息用到的数据 public string modifyCourseno; public string modifyCoursename; public string modifyCoursetype; public string modifyOpenterm; public string modifyCcoursehours; public string modifyCredit;
//修改成绩信息需要的数据 public string modifyScore;
public ModifyForm()
共 42 页第 19 页
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库学生成绩管理系统设计说明书(4)在线全文阅读。
相关推荐: