重庆三峡学院
{
InitializeComponent(); }
//显示所有相应表格的数据s
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();
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 button_edit_stu_Click(object sender, EventArgs e) {
if (MessageBox.Show(this, \要修改所选记录吗?\请确认\ MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
共 42 页 第 20 页
重庆三峡学院
MessageBoxOptions.RightAlign) == DialogResult.No) return;
Student stu = new Student();
stu.update(modifyStudnetno, modifyStudnetname, modifySex, modifyBirth, modifyAtive, modifyAddress); }
private void button_edit_class_Click(object sender, EventArgs e) {
if (MessageBox.Show(this, \要修改所选记录吗?\请确认\ MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign) == DialogResult.No) return;
Classinfo cla = new Classinfo(); cla.update(modifyClassno, modifyDepart, modifySpecical, modifyEntertime); }
private void button_edit_course_Click(object sender, EventArgs e) {
if (MessageBox.Show(this, \要修改所选记录吗?\请确认\ MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign) == DialogResult.No) return;
Course cou = new Course();
cou.update(modifyCourseno, modifyCoursename, modifyCoursetype, modifyCcoursehours, modifyCredit); }
private void button_edit_score_Click(object sender, EventArgs e) {
if (MessageBox.Show(this, \要修改所选记录吗?\请确认\ MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign) == DialogResult.No) return;
共 42 页 第 21 页
modifyStudyears, modifyOpenterm, 重庆三峡学院
Score sco = new Score();
sco.update(modifyStudnetno, modifyCourseno, modifyScore); }
private void ModifyForm_Load(object sender, EventArgs e) {
ShowAllData(\学生\ }
private void tabControl2_Selected(object sender, TabControlEventArgs e) {
if (e.TabPage == tabPage5) {
ShowAllData(\学生\ }
else if (e.TabPage == tabPage6) {
ShowAllData(\班级\ }
else if (e.TabPage == tabPage7) {
ShowAllData(\课程\ }
else if (e.TabPage == tabPage8) {
ShowAllData(\成绩\ } }
private void dataGridView1_CellValidated(object sender, DataGridViewCellEventArgs e) {
modifyStudnetno = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); modifyStudnetname = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); modifySex = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString(); modifyBirth = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString(); modifyAtive = dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString(); modifyAddress = dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString(); }
private void dataGridView2_CellValidated(object sender, DataGridViewCellEventArgs e) {
modifyClassno = dataGridView2.Rows[e.RowIndex].Cells[0].Value.ToString(); modifyDepart = dataGridView2.Rows[e.RowIndex].Cells[1].Value.ToString();
共 42 页 第 22 页
重庆三峡学院
modifySpecical = dataGridView2.Rows[e.RowIndex].Cells[2].Value.ToString(); modifyStudyears = dataGridView2.Rows[e.RowIndex].Cells[3].Value.ToString(); modifyEntertime = dataGridView2.Rows[e.RowIndex].Cells[4].Value.ToString(); }
private void dataGridView3_CellValidated(object sender, DataGridViewCellEventArgs e) {
modifyCourseno = dataGridView3.Rows[e.RowIndex].Cells[0].Value.ToString(); modifyCoursename = dataGridView3.Rows[e.RowIndex].Cells[1].Value.ToString(); modifyCoursetype = dataGridView3.Rows[e.RowIndex].Cells[2].Value.ToString(); modifyOpenterm = dataGridView3.Rows[e.RowIndex].Cells[3].Value.ToString(); modifyCcoursehours = dataGridView3.Rows[e.RowIndex].Cells[4].Value.ToString(); modifyCredit = dataGridView3.Rows[e.RowIndex].Cells[5].Value.ToString(); }
private void dataGridView4_CellValidated(object sender, DataGridViewCellEventArgs e) {
modifyStudnetno = dataGridView4.Rows[e.RowIndex].Cells[0].Value.ToString(); modifyCourseno = dataGridView4.Rows[e.RowIndex].Cells[1].Value.ToString(); modifyScore = dataGridView4.Rows[e.RowIndex].Cells[2].Value.ToString(); } } }
1.4信息查询模块
using System;
using System.Collections.Generic; using System.Text; using System.Data;
using System.Data.OleDb; using System.IO;
using System.Windows.Forms;
namespace StudentManagerSys {
public partial class SearchForm : Form {
public SearchForm() {
InitializeComponent(); }
private void button_search_stu_Click(object sender, EventArgs e)
共 42 页 第 23 页
重庆三峡学院
{
string type = comboBox1.Text; string item = textBox1.Text; Student stu = new Student();
DataSet dstu = stu.select(type, item); dataGridView1.DataSource = dstu;
dataGridView1.DataMember = \ }
private void button_search_cla_Click(object sender, EventArgs e) {
string type = comboBox2.Text; string item = textBox2.Text; Classinfo cla = new Classinfo(); DataSet dcla = cla.select(type, item); dataGridView2.DataSource = dcla;
dataGridView2.DataMember = \ }
private void button_search_cou_Click(object sender, EventArgs e) {
string type = comboBox3.Text; string item = textBox3.Text; Course cou = new Course();
DataSet dcou = cou.select(type, item); dataGridView3.DataSource = dcou; dataGridView3.DataMember = \ }
private void button_search_sco_Click(object sender, EventArgs e) {
string studnetno = textBox5.Text; string courseno = textBox4.Text; Score sco = new Score();
DataSet dsco = sco.select(\ dataGridView4.DataSource = dsco; dataGridView4.DataMember = \ }
private void button1_Click(object sender, EventArgs e) {
Score sco = new Score();
共 42 页 第 24 页
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库学生成绩管理系统设计说明书(5)在线全文阅读。
相关推荐: