《C#.NET程序设计》课程设计说明书教师信息管理系统

上传人:仙*** 文档编号:34027494 上传时间:2021-10-20 格式:DOC 页数:17 大小:460.06KB
收藏 版权申诉 举报 下载
《C#.NET程序设计》课程设计说明书教师信息管理系统_第1页
第1页 / 共17页
《C#.NET程序设计》课程设计说明书教师信息管理系统_第2页
第2页 / 共17页
《C#.NET程序设计》课程设计说明书教师信息管理系统_第3页
第3页 / 共17页
资源描述:

《《C#.NET程序设计》课程设计说明书教师信息管理系统》由会员分享,可在线阅读,更多相关《《C#.NET程序设计》课程设计说明书教师信息管理系统(17页珍藏版)》请在装配图网上搜索。

1、、C#.NET程序设计课程设计说明书设计题目: 教师信息管理系统 学院、系: 软件学院 专业班级: 软升本10-4 学生姓名: 某某 指导教师: 成 绩: 2011 年 7 月 12 日一、课程设计目的1)要求学生达到熟练掌握C#.NET基本结构以及C#语言的基本知识和技能;2)掌握面向对象程序开发的基本思路和方法;3)掌握ADO.NET数据库开发基本知识;4)能够利用所学的基本知识和技能,进行简单数据库应用程序设计。二、课程设计任务与要求1. 基本要求:1)要求利用C#的编程思想以及组件开发原理来完成系统的设计;2)突出C#语言与其它语言不同点(即体现C#的高级功能,如属性概念、接口、事件、

2、委托等);3)体现可视化编程基本思想,如系统带有菜单、工具栏、状态栏以及一些常用的高级控件。2. 创新要求:在基本要求达到后,可进行创新设计。三、需求分析本系统的设计主要具备以下功能:教师授课信息管理,即课程管理;教师个人信息管理;教师所属院系信息管理;教师月收入信息管理。开始的界面也很美观,同时也方便用户的使用,快捷,实用。这个设计中的每个模块都提供了以下四个功能:添加、修改,查询浏览以及删除,更清晰细致的展现了整个系统设计。四、概要设计1、模块功能:(1) 教师个人信息管理:添加:增加教师个人信息记录。浏览:对已有教师个人信息进行浏览。修改:对现有信息记录进行修改。删除:删除选中信息记录。

3、(2) 课程信息管理:添加:增加课程信息记录。浏览:对已存在信息记录浏览。修改:修改已存在信息记录。删除:删除信息记录。(3) 院系类别信息管理:添加:增加院系类别信息记录。浏览:对已存在信息记录浏览。修改:修改已存在信息记录。删除:删除信息记录。(4) 教师工资管理:添加:增加教师月工资信息记录。浏览:对已存在信息记录浏览。修改:修改已存在信息记录。删除:删除信息记录。2、模块结构:3、数据库设计:授课信息Tb_course字段类型描述KIDKNameKbeizhuint(自动编号)Varchar(50)Varchar(50)课程编号课程名称课程备注 教师信息表Tb_teacher 字段类型

4、描述TIDTNameBIDKNameTsexTplaceTlevelTspecialTbusiTbeizhuVarchar(50)Varchar(50)intVarchar(50)Varchar(50)Varchar(50)Varchar(50)Varchar(50)Varchar(50)Varchar(50)教师编号教师姓名部门编号课程名称性别教师籍贯学历所学专业职称备注部门信息表Tb_bumen 字段类型描述BidBNameBbeizhuint(自动编号) Varchar(50)Varchar(50)部门编号部门名称部门备注月收入Tb_shouru 字段类型描述SIDSMOnthTIDSn

5、comeSbeizhuint(自动编号)Varchar(50)Varchar(50)Varchar(50)Varchar(50)收入编号月份教师编号月收入备注4、文件夹设计: 五、详细设计注意:此部分应包括具体设计过程,如设计目的、设计思路,界面设计,代码实现(关键代码)等,但不需要粘贴所有程序代码。(此部分必须包含主界面及至少两个模块设计)。 此部分红颜色文字在报告中应删去1、系统运行主页面:主要代码:public partial class FromMain : Form public FromMain() InitializeComponent(); private void FromM

6、ain_Load(object sender, EventArgs e) Addkecheng frmAddkecheng; private void menuAddkecheng_Click(object sender, EventArgs e) if (frmAddkecheng = null | frmAddkecheng.IsDisposed) frmAddkecheng = new Addkecheng(); for (int x = 0; x this.MdiChildren.Length; x+) Form tempChild = (Form)this.MdiChildrenx;

7、 tempChild.Close(); frmAddkecheng.MdiParent = this; frmAddkecheng.Show(); Addyuanxi frmAddyuanxi; private void menuAddyuanxi_Click(object sender, EventArgs e) if (frmAddyuanxi = null | frmAddyuanxi.IsDisposed) frmAddyuanxi = new Addyuanxi(); for (int x = 0; x this.MdiChildren.Length; x+) Form tempCh

8、ild = (Form)this.MdiChildrenx; tempChild.Close(); frmAddyuanxi.MdiParent = this; frmAddyuanxi.Show(); 2、部门信息管理模块: 该模块主要实现用户对部门信息的添加、浏览、修改和删除操作。 运行结果如下图: 部分代码: Addkecheng.cs页面:private void button1_Click(object sender, EventArgs e) if (txtkechengName.Text.Trim() = | txtkeshi.Text.Trim() = ) MessageBox

9、.Show(请输入课程名称和课时!, 提示, 0); else using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open();try SqlCommand cmd = new SqlCommand(select * from tb_kecheng where CName= + txtkechengName.Text.Trim() + , con); if (cmd.ExecuteScalar() != null) MessageBox.Show(课

10、程名重复,请重新输入!, 提示, 0); else string sql = insert into tb_kecheng(CName,CTime) values( + txtkechengName.Text.Trim() + , + txtkeshi.Text.Trim() + ); cmd.CommandText = sql; cmd.ExecuteNonQuery(); MessageBox.Show(添加课程信息成功!, 提示, 0); txtkechengName.Clear(); txtkeshi.Clear(); catch (Exception ex) MessageBox.S

11、how(错误: + ex.Message, 错误提示,MessageBoxButtons.OKCancel,MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); Browsekecheng.cs页面:private void Browsekecheng_Load(object sender, EventArgs e) showinf(); private void showinf() using (SqlConnection con = new SqlCo

12、nnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); try string sql = select CId as 编号,CName as 课程名称,CTime as 总课时 from tb_kecheng order by CId; SqlDataAdapter adp = new SqlDataAdapter(sql, con); DataSet ds = new DataSet(); ds.Clear(); adp.Fill(ds, kecheng); this.dataGridView1.DataSo

13、urce = ds.Tables0.DefaultView; catch(Exception ex) MessageBox.Show(错误: + ex.Message , 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); updatekecheng frmupdatekecheng; private void btnUpdate_Click(object sender, EventAr

14、gs e) if (this.dataGridView1.CurrentCell != null) frmupdatekecheng = new updatekecheng(); frmupdatekecheng.Tag = this.dataGridView10,this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim(); frmupdatekecheng.StartPosition = FormStartPosition.CenterParent; frmupdatekecheng.ShowDialog(); if (fr

15、mupdatekecheng.DialogResult = DialogResult.OK) showinf(); private void btnExit_Click(object sender, EventArgs e) this.Close(); private void btnDelete_Click(object sender, EventArgs e) using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); try if (th

16、is.dataGridView1.CurrentCell != null) string sql = select CName from tb_kecheng where CId= + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim() + and CId not in (select distinct tb_kecheng.CId from tb_teacher inner join tb_kecheng on tb_teacher.CName=tb_kecheng.CNam

17、e); SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader dr; dr = cmd.ExecuteReader(); if (!dr.Read() MessageBox.Show(删除工种 + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim() + 失败,请先删除与此工种相关的员工!, 提示); dr.Close(); else dr.Close(); sql = delete from tb_kecheng wh

18、ere CId= + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim() + and CName not in (select distinct CName from tb_teacher);cmd.CommandText = sql; cmd.ExecuteNonQuery(); MessageBox.Show(删除工种 + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString(

19、).Trim() + 成功, 提示); catch (Exception ex) MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); showinf(); updatekecheng.cs页面:public partial class updatekecheng : Form public updatekecheng()

20、 InitializeComponent();private void updatekecheng_Load(object sender, EventArgs e) this.StartPosition = FormStartPosition.CenterParent; this.lblID .Text = this.Tag.ToString().Trim();private void btnExit_Click(object sender, EventArgs e) this.Close(); public static string strConn = Data Source=(local

21、);Initial Catalog=teacher;Integrated Security=true;private void tnOk_Click(object sender, EventArgs e) if (this.txtkechengName .Text.Trim() = | this.txtzhuanyeName .Text.Trim() = ) MessageBox.Show(请输入完整信息!, 提示, 0); else using (SqlConnection con = new SqlConnection(strConn) if (con.State = Connection

22、State.Closed) con.Open(); try SqlCommand cmd = new SqlCommand(select * from tb_kecheng where CName= + txtkechengName.Text.Trim() + and CId + this.Tag.ToString().Trim(), con); if (cmd.ExecuteScalar() != null) MessageBox.Show(课程名称发生重复,请重新输入!, 提示, 0); else string sql = update tb_kecheng set CName= + tx

23、tkechengName.Text.Trim() + ,CTime= + txtzhuanyeName.Text.Trim() + where CId= + this.Tag.ToString().Trim(); cmd.CommandText = sql; cmd.ExecuteNonQuery(); MessageBox.Show(课程信息修改成功!, 提示, 0); catch (Exception ex) MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error);

24、finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose();3、教师个人信息管理模块: 该模块主要实现用户对教师个人信息进行操作,具体操作包括:添加、浏览、修改和删除操作。运行结果如下图: 部分代码: Addjiaoshi.cs页面:private void btnOk_Click(object sender, EventArgs e) if (this.txtTID .Text.Trim() = | this.txtTName .Text.Trim() = | this.cmbTSex .Text.Trim

25、() = | this.txtPlevel.Text.Trim() = |this.cmbCName .Text.Trim() = | this.cmbYuanxiID .Text.Trim() = ) MessageBox.Show(请填写完整的教师信息!, 提示, 0); elseusing (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); try SqlCommand cmd = new SqlCommand(select * from t

26、b_teacher where TId= + txtTID.Text.Trim() + , con); if (cmd.ExecuteScalar() != null) MessageBox.Show(教师编号重复,请重新输入!, 提示, 0); else string sql1, sql2, sql; sql1 = insert into tb_teacher (TId,TName,TSex,TLevel,CName,YId; sql2 = values ( + txtTID.Text.ToString() + , + txtTName.Text.ToString() + , + cmbTS

27、ex.Text.Trim() + , + txtPlevel.Text.ToString() + , + cmbCName.Text.Trim() + , + cmbYuanxiID.SelectedValue.ToString(); sql = sql1 + ) + sql2 + ); cmd.CommandText = sql; cmd.ExecuteNonQuery(); MessageBox.Show(教师信息添加成功, 提示, 0); catch (Exception ex) MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButt

28、ons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); Browsejiaoshi.cs页面:private void showinf() using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); try string sql = select tb_teacher.TId as

29、 教师编号,tb_teacher.TName as 教师姓名,tb_teacher.TSex as 性别,tb_teacher.Tlevel as 教师学历,tb_yuanxi.YName as 院系名称 from tb_teacher inner join tb_yuanxi on tb_teacher.YId = tb_yuanxi.YId where tb_yuanxi.YName= + this.cmbYuanxiId.Text.ToString() + order by TId; SqlDataAdapter adp = new SqlDataAdapter(sql, con); D

30、ataSet ds = new DataSet(); ds.Clear(); adp.Fill(ds, person); if (ds.Tables0.Rows.Count != 0) this.dgvteacherInfo.DataSource = ds.Tables0.DefaultView; this.label2 .Text = 共有 + ds.Tables0.Rows.Count + 条查询结果; else this.label2 .Text = 没有您所查找的教师信息; this.dgvteacherInfo .DataSource = null; catch (Exception

31、 ex) MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); private void button2_Click(object sender, EventArgs e) using (SqlConnection con = new SqlConnection(strConn) if (con.State = Conne

32、ctionState.Closed) con.Open(); try if (this.dgvteacherInfo.CurrentCell != null) string sql = select * from tb_Income where TId= + this.dgvteacherInfo0, this.dgvteacherInfo.CurrentCell.RowIndex.Value.ToString().Trim() + ; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader dr; dr = cmd.ExecuteRe

33、ader(); if (dr.Read() MessageBox.Show(删除教师 + this.dgvteacherInfo0, this.dgvteacherInfo.CurrentCell.RowIndex.Value.ToString().Trim() + 失败,请先删除该教师的收入信息!, 提示); dr.Close(); else dr.Close(); sql = delete from tb_teacher where TId= + this.dgvteacherInfo0, this.dgvteacherInfo.CurrentCell.RowIndex.Value.ToS

34、tring().Trim() + ;cmd.CommandText = sql; cmd.ExecuteNonQuery(); MessageBox.Show(删除员工 + this.dgvteacherInfo0, this.dgvteacherInfo.CurrentCell.RowIndex.Value.ToString().Trim() + 成功, 提示); else MessageBox.Show(没有指定的员工信息, 提示); catch (Exception ex) MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons

35、.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); showinf(); updatejiaoshi.cs页面:public partial class updatejiaoshi : Form public static string strConn = Data Source=(local);Initial Catalog=teacher;Integrated Security=true; public updatejiaosh

36、i() InitializeComponent();private void btnOk_Click(object sender, EventArgs e) using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); try string sql = update tb_teacher set TId= + this.txtTID .Text.ToString() + ,TName= + this.txtTName .Text.ToString

37、() + ,TSex= + this.cmbTSex .Text.Trim() + ,Tlevel= + this.textBox5 . Text.ToString() + ,CName= + this.cmbCName .Text.Trim() + ,YId= + this.cmbYuanxiID .SelectedValue.ToString(); sql = sql + where PID= + this.Tag.ToString().Trim() + ; SqlCommand cmd = new SqlCommand(sql, con); cmd.ExecuteNonQuery();

38、MessageBox.Show(教师信息修改成功!, 提示, 0); catch (Exception ex) MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose();private void updatejiaoshi_Load(object sender, EventArgs e) this.txtTID.Enabled

39、= false; AddteacherNameToCmbteacherName(); AddyuanxiNameToCmbYId(); private void AddteacherNameToCmbteacherName() using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); try SqlDataAdapter adp = new SqlDataAdapter(select CName from tb_kecheng, con);

40、DataSet ds = new DataSet(); adp.Fill(ds, Job); this.cmbCName .DisplayMember = CName; this.cmbCName.ValueMember = CName; this.cmbCName.DataSource = ds.Tables0.DefaultView; catch (Exception ex) MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.S

41、tate = ConnectionState.Open) con.Close();con.Dispose(); private void AddyuanxiNameToCmbYId() using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); try SqlDataAdapter adp = new SqlDataAdapter(select YId,YName from tb_yuanxi, con); DataSet ds = new D

42、ataSet(); adp.Fill(ds, Depart); this.cmbYuanxiID .DisplayMember = YName; this.cmbYuanxiID.ValueMember = YId; this.cmbYuanxiID.DataSource = ds.Tables0.DefaultView; catch (Exception ex)MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = Co

43、nnectionState.Open) con.Close(); con.Dispose(); private void btnExit_Click(object sender, EventArgs e) this.Close(); 六、课程设计总结 这次课程设计基本上含盖了大学这一年学习到的C# 语言知识点,课设题目要求不仅要求对课本知识有较深刻的了解,同时要求程序设计者有较强的思维和动手能力。这次课设使我了解我编程思想和编程技巧,也认识了软件生命周期的各个环境,包括构思、设计、编写、调试、发布、文档化、维护和修订。编程的风格也很重要,同学只关心程序运行的结果,而对程序代码的结构的良好丝毫不

44、在意。这是非常不可取的,如果我们希望将来从事编程工作,在这一点上该引起足够的重视。这是严谨的态度,很重要! 做课设不仅让我修补了以前学习的漏洞,也让我知道一个道理:编程需要兴趣和实际动手。这应该可以借鉴在老师的教学工作上。创新思维至关重要,这不仅让我们写出精简的代码,也有助于开发出高效的程序。开始编写修改和删除时,很头疼,去向其他人寻求帮助,在别人的帮助和提示下,我编完了修改程序,但编译时老出错,修改后的内容将文本内的信息全部覆盖了。困难之时,我们组的其他人,帮助了我,完成了修改和删除。 最后,使我对C#有了更进一步的认识和了解,要想学好它要重在实践,要通过不断的上机操作才能更好地学习它,我也

45、发现我的好多不足之处,还是需要日后的改进.该感谢帮助我的可爱的同学和老师,首先该感谢董老师的命题和关键性的提示。在编写程序中,感谢同学为我带来的参考资料,最终这次的设计顺利完成!ut2ApOdfXXc02GyBKsKCWw97MrqqWhoj5TL15Zt6jIPYytYCummtARp3v1N5luizi3xh3BhWYreKO8d9g7nmZQoWPJeTLDrw08gVS8DsDQQYGC3cE7moO2tLF0Jf1gK74IUXyBmtIVR97CkrfVqULT5fn2t6MpJR6rbzVPSortZvIj5NB5ndVvSr4iWr1TwLFKgLSPzuhRjQ3CmZU98

46、eUOuijdLSZqPmvrw9zKupxf8WFUG9l2G9277g2rTipa1YpCZEuqxpKBhtVDCooQOzxUz3vJrZmOcijyM62zchmeooTYes8EBMm932tbz2Yo09RtsZEYS8Zrd2Yktj8l6jEAzVAjnfbtryLvsm6oFbfToXVRFFn7OwIYgJlamkUNXJYbz5Rrb7r4VsuR9zpfZFMfsjhcfCA37lNW2VVLRKN7R8psz1BN6oRic5hU5Z6HCxAYqyNPOG8duYbAwqSl20CSg06Dh2sM8HLtgPkIcSkrgOPDpuHBj1LmPk7lYdvC6NNMwL3fwhZFTF

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!