首页 《C#程序设计》课程设计报告-学生成绩管理系统

《C#程序设计》课程设计报告-学生成绩管理系统

举报
开通vip

《C#程序设计》课程设计报告-学生成绩管理系统《C#程序设计》课程设计报告-学生成绩管理系统 《C#程序设计》 (2010— 2011学年 第 2 学期) 题 目: 专 业: 班 级: 姓名学号: 指导教师: 成 绩: 计算机科学与技术系 年 月 日 C#学生成绩管理系统 一、设计目的 1、掌握简单WinForm应用程序的设计 2、ADO.net的应用。 3、使用C#语言解决实际问题的能力 二、设计内容 1、基本要求 (1)根据查询条件实现学生信息的查询。 (2)学生选课信息查询、成绩信息的查询。 (3)学生信息、课程信息、成绩信息...

《C#程序设计》课程设计报告-学生成绩管理系统
《C#程序 设计 领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计 》课程设计 报告 软件系统测试报告下载sgs报告如何下载关于路面塌陷情况报告535n,sgs报告怎么下载竣工报告下载 -学生成绩管理系统 《C#程序设计》 (2010— 2011学年 第 2 学期) 题 目: 专 业: 班 级: 姓名学号: 指导教师: 成 绩: 计算机科学与技术系 年 月 日 C#学生成绩管理系统 一、设计目的 1、掌握简单WinForm应用程序的设计 2、ADO.net的应用。 3、使用C#语言解决实际问题的能力 二、设计 内容 财务内部控制制度的内容财务内部控制制度的内容人员招聘与配置的内容项目成本控制的内容消防安全演练内容 1、基本要求 (1)根据查询条件实现学生信息的查询。 (2)学生选课信息查询、成绩信息的查询。 (3)学生信息、课程信息、成绩信息的增加、删除、修改。 (4)对基本信息完成增加、删除、修改时,需注意表与表之间的关联 三、软件设计过程 一、按照任务书写表格 1、课程表 2、学生表 3、成绩表 另外添加了一张用户登陆表 二、软件功能介绍 1、登陆界面 点击登陆后进入主界面,点击退出即退出系统 2、主界面 主界面有四个按钮,分别是:学生信息查寻、学生信息修改、学生成绩录入和退出。前三个进入相应的功能界面,退出则是退出系统。 3、学生信息查询 界面 进入学生信息查寻界面。可以按照姓名、学号和专业进行查寻。 按专业查询: 按姓名查询: 按学号查询: 点击会显示所选行学生的成绩 以学号061101王林为例: 返回键返回主菜单 4、学生信息修改 界面 点击任意一行,会将相应学生的信息显示在分别显示在相应的空格里,如图: 对其作出修改 点击更新 当输入的姓名在学生表里没有时,如: 点击更新怎是加入一条学生信息 ,点击删除,会有选中一条学生信息 提示框提示是否删除: 点击确定会提示删除成功 取消则是取消删除。 返回键返回主菜单 5、学生成绩录入 界面 进入学生成绩录入界面,显示有记录学生成绩的学号、姓名、课程号及成绩。 录入成绩,以录入Tom 学号061120课程号101为例: 点击确认即录入成绩 点击返回,返回主菜单。 四、心得体会 这次课程设计,一开始无从下手。在听过老师的讲解后,逐渐知道了大体方向。开始慢慢地做了起来。碰到困难,寻求同学和网络的帮助,在他们的帮助下,问题一一解决,最终完成了此次的课程设计。此次的课程设计让我对C#和数据库有更深一步的了解,把平时零散的理论知识在此次课程设计中用起来了。同时也发现了自己的不足之处,日后要多多实践。 五、源程序 用户登陆界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace _1 { public partial class userLog : Form { public userLog() { InitializeComponent(); } public string connstr; public void Getway() { connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; } private void quit_Click(object sender, EventArgs e) { this.Close(); } private void log_Click(object sender, EventArgs e) { Getway(); string username = uname.Text.Trim(); string password = upassword.Text.Trim(); //string selectcommond = "select * from Userxx where UserName ='"+ username+"' and Userpassword = '"+ password+"'"; string _sql = "select * from userinfo"; //方?便?前?期ú操ù作痢? 后ó来ぁ?要癮删?除y的?记?住? using (SqlConnection conn = new SqlConnection(connstr)) { conn.Open(); SqlCommand sql = new SqlCommand(_sql, conn); SqlDataReader reader = sql.ExecuteReader(); if (reader.Read()) { main open1 = new main(); open1.ShowDialog(); } else { if (uname.Text == "") { MessageBox.Show("用?户?名?不?能û为a空?~?", "错洙??示?~?"); } else { if (upassword.Text == "") { MessageBox.Show("密û码?不?能û为a空?~?", "错洙??示?~?"); } else { MessageBox.Show("不?存?在ú该?用?户?信?息,~?", "错洙?误ó ?示?~?"); } } uname.Text = ""; upassword.Text = ""; } } } } } 主界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace _1 { public partial class main : Form { public main() { InitializeComponent(); } private void button1_Click_1(object sender, EventArgs e) { StuinfoCheck stu1 = new StuinfoCheck(); stu1.ShowDialog(); } private void button2_Click_1(object sender, EventArgs e) { StuinfoAdd stu2 = new StuinfoAdd(); stu2.ShowDialog(); } private void button3_Click_1(object sender, EventArgs e) { StuGraceinfo stu3 = new StuGraceinfo(); stu3.ShowDialog(); } private void button4_Click_1(object sender, EventArgs e) { this.Close(); } } } 学生信息查询 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.IO; namespace _1 { public partial class StuinfoCheck : Form { public StuinfoCheck() { InitializeComponent(); } public string SelectSno; private void StuinfoCheck_Load(object sender, EventArgs e) { // TODO: 这a行D代洙?码?将?数簓据Y加ó载?到?表括?“?studentDataSet.S”ª中D。,您ú可é以?根ù据Y需è要癮移?动ˉ或ò移?除y它û。, //this.sTableAdapter.Fill(this.studentDataSet.S); // TODO: 这a行D代洙?码?将?数簓据Y加ó载?到?表括?“?studentDataSet.C”ª中D。,您ú可é以?根ù据Y需è要癮移?动ˉ或ò移?除y它û。, //this.cTableAdapter.Fill(this.studentDataSet.C); //---------------------------------------------- string connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; string _sql = "SELECT Sno as 学?号?,Sname as 姓?名?,Smajor as 专痢?业唉?Ssex as 性?别纄,Sbirth as 生Θ?日?,totalpoint as 总哩?学?分?,remark as 备?注痢?from S"; // string _sql = "select Sno as 学?号?,Sname as 姓?名? from S"; SqlConnection cnn = new SqlConnection(connstr); SqlDataAdapter sda = new SqlDataAdapter(_sql, cnn); DataSet ds = new DataSet(); sda.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView; string sql_Smajor="select distinct Smajor from S"; SqlCommand cmd = new SqlCommand(sql_Smajor,cnn); cnn.Open(); // SqlDataReader dr = new SqlDataReader(); SqlDataReader dr = cmd.ExecuteReader(); while(dr.Read()) { majorSelection.Items.Add(dr[0]); } cnn.Close(); majorSelection.SelectedIndex=0; } public DataSet Conn(string sql) { string connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; //string _sql = "SELECT Sno as 学?号?,Sname as 姓?名?,Smajor as 专痢?业唉?Ssex as 性?别纄,Sbirth as 生Θ?日?,totalpoint as 总哩?学?分?,remark as 备?注痢?from S"; SqlConnection cnn = new SqlConnection(connstr); SqlDataAdapter sda = new SqlDataAdapter(sql, cnn); DataSet ds = new DataSet(); sda.Fill(ds); return ds ; } private void search_Click(object sender, EventArgs e) { string sql = "select * from S where 1=1 "; if (no.Text.Trim() != string.Empty) { sql += " and Sno like '%" + no.Text.Trim() + "%'"; } if (name.Text.Trim() != string.Empty) { sql += " and Sname like '%" + name.Text.Trim() + "%'"; } if (majorSelection.Text.Trim() != "所ù有瓺专痢?业唉?) { sql += " and Smajor like '%" + majorSelection.Text + "'"; } DataSet ds = Conn(sql); dataGridView1.DataSource = ds.Tables[0].DefaultView; } //private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) //{ // string str = dataGridView1.CurrentRow.Cells[0].Value.ToString(); // string _sql = "SELECT Sno as 学?号?,Sname as 姓?名?,Smajor as 专痢?业唉?Ssex as 性?别纄,Sbirth as 生Θ?日?,totalpoint as 总哩?学?分?,remark as 备?注痢?from S"; // DataSet ds = Conn(_sql); // dataGridView1.DataSource = ds.Tables[0].DefaultView; // } private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { stuinfodetail formCourse = new stuinfodetail(); formCourse.SelectSno = dataGridView1.CurrentRow.Cells[0].Value.ToString(); formCourse.ShowDialog(); } private void exit_Click(object sender, EventArgs e) { this.Close(); } } } 成绩显示界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace _1 { public partial class stuinfodetail : Form { public string SelectSno; public stuinfodetail() { InitializeComponent(); } private void stuinfodetail_Load(object sender, EventArgs e) { string connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; string _sql = "SELECT S.Sno as 学?号?,Sname as 姓?名?,Cno as 课?程ì号?,Point 成é绩? FROM S,SC where S.Sno = SC.Sno and S.Sno='" + this.SelectSno + "'"; SqlConnection cnn = new SqlConnection(connstr); cnn.Open(); SqlDataAdapter sda = new SqlDataAdapter(_sql, cnn); DataSet ds = new DataSet(); sda.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView; cnn.Close(); } } } 学生信息修改 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace _1 { public partial class StuinfoAdd : Form { public StuinfoAdd() { InitializeComponent(); } private void StuinfoAdd_Load(object sender, EventArgs e) { // TODO: 这a行D代洙?码?将?数簓据Y加ó载?到?表括?“?studentDataSet.S”ª中D。,您ú可é以?根ù据Y需è要癮移?动ˉ或ò移?除y它û。, //this.sTableAdapter.Fill(this.studentDataSet.S); // TODO: 这a行D代洙?码?将?数簓据Y加ó载?到?表括?“?studentDataSet.C”ª中D。,您ú可é以?根ù据Y需è要癮移?动ˉ或ò移?除y它û。, //this.cTableAdapter.Fill(this.studentDataSet.C); //---------------------------------------------- string connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; string _sql = "SELECT Sno as 学?号?,Sname as 姓?名?,Smajor as 专痢?业唉?Ssex as 性?别纄,Sbirth as 生Θ?日?,totalpoint as 总哩?学?分?,remark as 备?注痢?from S"; // string _sql = "select Sno as 学?号?,Sname as 姓?名? from S"; SqlConnection cnn = new SqlConnection(connstr); SqlDataAdapter sda = new SqlDataAdapter(_sql, cnn); DataSet ds = new DataSet(); sda.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView; //string sql_Smajor = "select distinct Smajor from S"; //SqlCommand cmd = new SqlCommand(sql_Smajor, cnn); cnn.Open(); //SqlDataReader dr = new SqlDataReader(); //SqlDataReader dr = cmd.ExecuteReader(); //while (dr.Read()) //{ // majorSeletion.Items.Add(dr[0]); //} //cnn.Close(); //majorSeletion.SelectedIndex = 0; } private void delete_Click(object sender, EventArgs e) { string connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; DialogResult ret = MessageBox.Show("确ü?定?要癮删?除y该?信?息,吗e,?", "删?除y", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if(ret == DialogResult.Cancel) { return;} string _sql="delete from S where Sno='"+stuno.Text+"'"; SqlConnection conn = new SqlConnection(connstr); SqlCommand cmd = new SqlCommand(_sql,conn); try { conn .Open(); int rows=cmd .ExecuteNonQuery(); if(rows == 1) { MessageBox.Show("删?除y成é功|~?", "?示?", MessageBoxButtons.OK, MessageBoxIcon.Information); } StuinfoAdd_Load(null ,null ); } finally { conn.Close(); } } private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { stuno.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); stuname.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); cname.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); stubirth.Text = dataGridView1.CurrentRow.Cells[4].Value.ToString(); credit.Text = dataGridView1.CurrentRow.Cells[5].Value.ToString(); sturemark.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString(); if (dataGridView1.CurrentRow.Cells[3].Value.ToString().Trim () == "男D") { male.Checked = true; } else { female.Checked = true; } //stubirth.Text = Convert.ToDateTime((stubirth.Text.Trim())).ToShortDateString(); } private void updata_Click(object sender, EventArgs e) { //更û新?信?息, string connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; string _title = "select count(*) from S where sno='" + stuno.Text + "'"; SqlConnection conn = new SqlConnection(connstr); SqlCommand cmd = new SqlCommand(_title, conn); //检ì查é是?否?有瓺该?学?生Θ?的?信?息,,?有瓺则ò修T改?,?无T?加ó try { conn.Open(); int str = (int)cmd.ExecuteScalar();//强?制?转羇换?,?执′行D查é询ˉ并, 返う?回?查é询ˉ所ù返う?回?的?结á果?集ˉ中D第台?一?行D的?第台?一? //修T改?信?息, if (str == 1) { _title = "update S set Sname = '" + stuname.Text + "',Smajor = '" + cname.Text + "',totalpoint = " + int.Parse(credit.Text) + ",remark='" + sturemark.Text + "' where Sno='" + stuno.Text + "'"; } //?加ó新?信?息, else { //DateTime cn = Convert.ToDateTime(stubirth.Text.Trim()); string sex = male.Checked ? "男D" : "女?"; _title = "insert into S(Sno,Sname,Smajor,Ssex,Sbirth,totalpoint,remark) values ( '" + stuno.Text + "','" + stuname.Text + "','" + cname.Text + "','" + sex + "','" + stubirth.Text.Trim() + "'," + int.Parse(credit.Text) + ",'" + sturemark.Text + "')"; } cmd = new SqlCommand(_title, conn); cmd.ExecuteNonQuery(); StuinfoAdd_Load(null, null); } finally { conn.Close(); } } private void exit_Click(object sender, EventArgs e) { this.Close(); } } } 学生成绩录入 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace _1 { public partial class StuGraceinfo : Form { public StuGraceinfo() { InitializeComponent(); } private void StuGraceinfo_Load(object sender, EventArgs e) { string connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; string _sql = "SELECT S.Sno as 学?号?,Sname as 姓?名?,Cno as 课?程ì号?,Point as 成é绩? FROM S,SC where S.Sno=SC.Sno"; //SELECT Sno as 学?号?,Sname as 姓?名?,Smajor as 专痢?业唉?Ssex as 性?别纄,Sbirth as 生Θ?日?,totalpoint as 总哩?学?分?,remark as 备?注痢?from S SqlConnection cnn = new SqlConnection(connstr); SqlDataAdapter sda = new SqlDataAdapter(_sql, cnn); cnn.Open(); DataSet ds = new DataSet(); sda.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView; //cnn.Close(); } private void button3_Click(object sender, EventArgs e) { this.Close(); } private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { textBox1.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); textBox3.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); textBox4.Text = dataGridView1.CurrentRow.Cells[3].Value.ToString(); textBox6.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString(); } private void button1_Click(object sender, EventArgs e) { string connstr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\1\Student.mdf;Integrated Security=True;Connect Timeout=30;User Instance=False"; string _sql = "select count(*) from S where S.Sno='" + textBox1.Text + "'"; string sql1 = "select Cno from C where Cno='" + textBox6 .Text + "'"; SqlConnection cnn = new SqlConnection(connstr); SqlCommand cmd = new SqlCommand(_sql,cnn); SqlCommand cmd1 = new SqlCommand(sql1, cnn); string cno=""; try { cnn.Open(); SqlDataReader dr = cmd1.ExecuteReader(); while (dr.Read()) { cno = dr[0].ToString(); } cnn.Close(); cnn.Open(); int cnt = (int)cmd.ExecuteScalar(); //制?转羇化ˉ 返う?回?第台?一?行D第台?一? 修T改?记?录? if (cnt == 1) { _sql = "update SC set Point='" + textBox4.Text + "',Cno='" + textBox6.Text + "' where Sno='"+textBox1.Text +"'"; } else //?加ó记?录? { _sql = "insert into SC(Sno,Cno,Point) values('" + textBox3.Text.Trim() + "','" + textBox6.Text.Trim() + "','" + int.Parse(textBox4.Text.Trim()) + "')"; } cmd = new SqlCommand(_sql, cnn); int i = cmd.ExecuteNonQuery(); StuGraceinfo_Load(null, null); } finally { cnn.Close(); } } } } 记录每天的主要设计内容、遇到的问题、解决方法及效果,等。 DAY 1 听了老师对系统架构的部分分析,对本次课程设计有了大致的了解,明确了大体框架,把任务书上的数据库表准备好了,并简单地完成了系统各个窗体的设计。 DAY 2 对各个窗体进行了更为细致的设计,对需要用到的事件和要修改的属性进行适当分配,以便设计代码时能对整体更清晰,完成了用户登陆的代码设计。 DAY 3 开始代码设计,实现了学生信息查询的功能。在这过程中,遇到了许多问题诸如数据库的链接、SQL语句等,在同学的帮助下这些问题都一一解决了。 DAY 4 今天开始实现学生信息修改功能。难题出现在了此功能的修改功能上,代码不断的报错,不断修改,到今天结束还没实现修改功能,晚上问问同学,查查资料,希望明天早上能很快的完成修改功能。 设计 日志 LAST DAY 最后一天,早上在同学的帮助下,把昨天学生信息修改中的修改功能实现了。然后实现了最后一个功能——学生成绩录入功能。下午,给老师检查完后开始着手写报告。 (注:指导教师评语和成绩所在表格另起一页) 指导教师 评 语 课程设计 指导教师签字 年 月 日 成 绩 附录:外文翻译 In Wang Zuoliang?s translation practices, he translated many poems, especially the poems written by Robert Burns. His translation of Burn?s “A Red, Red Rose” brought him fame as a verse translator. At the same time, he published about ten papers on the translation of poems. Some argue that poems cannot be translated. Frost stresses that poetry might get lost in translation. According to Wang, verse translation is possible and necessary, for “The poet-translator brings over some exciting work from another culture and in doing so is also writing his own best work, thereby adding something to his culture. In this transmission and exchange, a richer, more colorful world emerges. ”(Wang, 1991:112). Then how can we translate poems? According to Wang?s understanding, the translation of poems is related to three aspects: A poem?s meaning, poetic art and language. (1)A poem?s meaning “Socio-cultural differences are formidable enough, but the matter is made much more complex when one realizes that meaning does not consist in the meaning of words only, but also in syntactical structures, speech rhythms, levels of style.” (Wang, 1991:93). (2)Poetic art According to Wang, “Bly?s point about the „marvelous translation? being made possible in the United States only after Whitman, Pound and Williams Carlos Williams composed poetry in speech rhythms shows what may be gained when there is a genuine revolution in poetic art.” (Wang, 1991:93). (3)Language “Sometimes language stays static and sometimes language stays active. When language is active, it is beneficial to translation” “This would require this kind of intimate understanding, on the part of the translator, of its genius, its idiosyncrasies, its past and present, what it can do and what it choose not to do.” (Wang, 1991:94). Wang expresses the difficulties of verse translation. Frost?s comment is sufficient to prove the difficulty a translator has to grapple with. Maybe among literary translations, the translation of poems is the most difficult thing. Poems are the crystallization of wisdom. The difficulties of poetic comprehension lie not only in lines, but also in structure, such as cadence, rhyme, metre, rhythm, all these conveying information. One point merits our attention. Wang not only talks about the times? poetic art, but also the impact language?s activity has produced on translation. In times when the language is active, translation is prospering. The reform of poetic art has improved the translation quality of poems. For example, around May Fourth Movement, Baihua replaced classical style of writing, so the translation achieved earth-shaking success. The relation between the state of language and translation is so
本文档为【《C#程序设计》课程设计报告-学生成绩管理系统】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_421808
暂无简介~
格式:doc
大小:462KB
软件:Word
页数:34
分类:
上传时间:2017-09-27
浏览量:63