C#.NET程序设计课程设计说明书教师管理系统 .doc

上传人:文库蛋蛋多 文档编号:2384321 上传时间:2023-02-17 格式:DOC 页数:20 大小:188.50KB
返回 下载 相关 举报
C#.NET程序设计课程设计说明书教师管理系统 .doc_第1页
第1页 / 共20页
C#.NET程序设计课程设计说明书教师管理系统 .doc_第2页
第2页 / 共20页
C#.NET程序设计课程设计说明书教师管理系统 .doc_第3页
第3页 / 共20页
C#.NET程序设计课程设计说明书教师管理系统 .doc_第4页
第4页 / 共20页
C#.NET程序设计课程设计说明书教师管理系统 .doc_第5页
第5页 / 共20页
点击查看更多>>
资源描述

《C#.NET程序设计课程设计说明书教师管理系统 .doc》由会员分享,可在线阅读,更多相关《C#.NET程序设计课程设计说明书教师管理系统 .doc(20页珍藏版)》请在三一办公上搜索。

1、C#.NET程序设计课程设计说明书设计题目: 教师管理系统 学院、系: 软件学院 专业班级: 软升本10-4班 学生姓名: 指导教师: 成 绩: 2011 年 7 月 12 日一、课程设计目的通过完成从用户需求分析、数据库设计、目录结构与通用模块、管理主界面设计及各个具体管理模块设计到上机编程、调试和应用等全过程,进一步了解和掌握C#.NET程序设计技术。二、 课程设计任务与要求1. 基本要求:1)要求利用C#的编程思想以及组件开发原理来完成系统的设计;2)突出C#语言与其它语言不同点(即体现C#的高级功能,如属性概念、接口、事件、委托等);3)体现可视化编程基本思想,如系统带有菜单、工具栏、

2、状态栏以及一些常用的高级控件。2. 创新要求:在基本要求达到后,可进行创新设计。完成该系统数据库设计;实现相应信息的添加、删除、删除、查看等功能。三、需求分析在设计数据库结构时,应尽量可能满足用户所提出的各项要求,同时避免冗余数据的产生。由于教师管理系统中需要采集大量的信息,包括院系信息、课程信息、教师信息、收入信息等,如果不能有效合理地组织数据表的结构以及每张表所含的字段,那么在后期进行数据整理及汇总时,将增加开发人员的工作难度和工作量。根据教师基本信息及相关特点,可以总结出一下规律:l 一个院系包括一名或多名教师l 一名教师可以教多门课程l 每名教师都有不同的教师编码l 每名教师都有自己对

3、应的月收入l 一个角色对应一个或多个用户四、概要设计1. 系统功能模块划分教师管理系统院系设置课程设置教师设置收入设置添加院系浏览院系修改院系添加课程删除课程修改课程添加教师修改教师浏览教师添加收入修改收入2. 数据库逻辑结构设计系统数据库名称为hanqifang,数据库中包括:(1)院系信息表dbo.yuanxi;(2)教师表信息dbo.jiaoshi;(3)课程信息表dbo.kecheng.下面列出各个表的数据结构 院系信息表字段名 类 型描 述yuanxibianmayuanximingcheng int varchar院系编码(主键)院系名称 教师信息表 字段名 类 型描 述jiaos

4、hibianmajiaoshixingmingjiaoshixingbiejiaoshixueli yuanximingchengkechengbianmaintvarcharvarcharvarcharvarcharint教师编码(主键)教师姓名教师性别教师学历院系名称课程编码 课程信息表 字段名 类 型描 述kechengbianmakechengmingchengkechengmiaosuintvarcharvarchar课程编码(主键)课程名称课程描述五、详细设计主界面设计主界面设计的作用就是显示本系统所有的功能菜单项,本且把用户经常用到的功能设计成菜单项,以方便用户操作,然后当用户单

5、击相应的菜单项或菜单按钮时,打开对应的模块窗口。本系统的主界面如图。由图可知“院系”菜单下有子菜单,包括“修改”和“添加”。主界面编码:zhuyemian.csusing 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 WindowsFormsApplication1hanqifang.yuan

6、xi;/导入用于院系的命名空间using WindowsFormsApplication1hanqifang.jiaoshi;namespace WindowsFormsApplication1hanqifang public partial class zhuyemian : Form public zhuyemian() InitializeComponent(); private void zhuyemian_Load(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e) this

7、.ttsTime.Text = 时间为: + DateTime.Now.ToString(); tianjia a; private void b_Click(object sender, EventArgs e) if (a= null | a.IsDisposed) a = new tianjia (); for (int x = 0; x this.MdiChildren.Length; x+) Form tempChild = (Form)this.MdiChildrenx; tempChild.Close(); a.MdiParent = this; a.Show(); liulan

8、 c; private void 浏览ToolStripMenuItem_Click(object sender, EventArgs e) if (c = null | c.IsDisposed) c = new liulan (); for (int x = 0; x this.MdiChildren.Length; x+) Form tempChild = (Form)this.MdiChildrenx; tempChild.Close(); c.MdiParent = this; c.Show(); liulan1 c1; private void 浏览ToolStripMenuIte

9、m1_Click(object sender, EventArgs e) if (c1 = null | c1.IsDisposed) c1 = new liulan1(); for (int x = 0; x this.MdiChildren.Length; x+) Form tempChild = (Form)this.MdiChildrenx; tempChild.Close(); c1.MdiParent = this; c1.Show(); tianjia3 a1; private void 修改ToolStripMenuItem1_Click(object sender, Even

10、tArgs e) if (a1 = null | a.IsDisposed) a1 = new tianjia3 (); for (int x = 0; x this.MdiChildren.Length; x+) Form tempChild = (Form)this.MdiChildrenx; tempChild.Close(); a1.MdiParent = this; a1.Show(); Jiaoshi:liulan1.cs:using System;using System.Collections.Generic;using System.ComponentModel;using

11、System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace WindowsFormsApplication1hanqifang.jiaoshi public partial class liulan1 : Form public liulan1() InitializeComponent(); public static string strConn = Data Source=(loca

12、l);Initial Catalog=hanqifang;Integrated Security=True; private void liulan1_Load(object sender, EventArgs e) showinf(); private void showinf() using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); ; try string sql = select jiaoshibianma as 编号,jiaos

13、hixingming as 教师姓名,jiaoshixingbie as 教师性别 from jiaoshi order by jiaoshibianma; SqlDataAdapter adp = new SqlDataAdapter(sql, con); DataSet ds = new DataSet(); ds.Clear(); adp.Fill(ds, Job); this.dataGridView1.DataSource = ds.Tables0.DefaultView; catch (Exception ex) MessageBox.Show(错误: + ex.Message,

14、错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); xiugai2 frmModifyDepart; private void btnUpdate_Click(object sender, EventArgs e) if (this.dataGridView1.CurrentCell != null) frmModifyDepart = new xiugai2(); frmModifyD

15、epart.Tag = this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim(); /frmModifyDepart.txtDName.Text = this.dgvDepartInfo1, this.dgvDepartInfo.CurrentCell.RowIndex.Value.ToString().Trim(); /frmModifyDepart.txtDLeader.Text = this.dgvDepartInfo2, this.dgvDepartInfo.CurrentC

16、ell.RowIndex.Value.ToString().Trim(); /frmModifyDepart.txtDReark.Text = this.dgvDepartInfo3, this.dgvDepartInfo.CurrentCell.RowIndex.Value.ToString().Trim(); frmModifyDepart.StartPosition = FormStartPosition.CenterParent; frmModifyDepart.ShowDialog(); if (frmModifyDepart.DialogResult = DialogResult.

17、OK) showinf(); private void btnDelete_Click(object sender, EventArgs e) using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); ; try if (this.dataGridView1.CurrentCell != null) string sql = select kechengmingcheng from dbo.kecheng wherekechengbianma

18、 = + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim() + and kechengbianma not in (select distinct kechengbianma from dbo.kecheng inner join dbo.jiaoshi on dbo.kecheng.kechengbianma=dbo.jiaoshi.kechengbianma); SqlCommand cmd = new SqlCommand(sql, con); SqlDataReade

19、r 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 dbo.kecheng where kechengbianma= + this.dataGridView10, this.dataGridView1.CurrentCell

20、.RowIndex.Value.ToString().Trim() + and kechengbianma not in (select distinct kechengbianma from dbo.jiaoshi); cmd.CommandText = sql; cmd.ExecuteNonQuery(); MessageBox.Show(删除院系 + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim() + 成功, 提示); catch (Exception ex) Mes

21、sageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); showinf(); private void btnExit_Click(object sender, EventArgs e) this.Close(); yuanxi liulan.cs:using System;using System.Collections.Gen

22、eric;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Data.SqlClient;namespace WindowsFormsApplication1hanqifang.yuanxi public partial class liulan : Form public liulan() InitializeComponent(); public stati

23、c string strConn = Data Source=(local);Initial Catalog=hanqifang;Integrated Security=True; private void liulan_Load(object sender, EventArgs e) showinf(); private void showinf() using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); ; try string sql

24、 = select yuanxibianma as 编号,yuanximingcheng as 院系名称 from dbo.yuanxi order by yuanxibianma; SqlDataAdapter adp = new SqlDataAdapter(sql, con); DataSet ds = new DataSet(); ds.Clear(); adp.Fill(ds, Job); this.dataGridView1.DataSource = ds.Tables0.DefaultView; catch (Exception ex) MessageBox.Show(错误: +

25、 ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open) con.Close(); con.Dispose(); xiugai frmModifyJob; private void btnUpdate_Click(object sender, EventArgs e) if (this.dataGridView1.CurrentCell != null) frmModifyJob = new xiugai(); frmMo

26、difyJob.Tag = this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim(); /frmModifyJob.dataGridView1.Text = this.dataGridView11, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim(); frmModifyJob.StartPosition = FormStartPosition.CenterParent; frmModifyJob.ShowD

27、ialog(); if (frmModifyJob.DialogResult = DialogResult.OK) showinf(); private void btnDelete_Click(object sender, EventArgs e) using (SqlConnection con = new SqlConnection(strConn) if (con.State = ConnectionState.Closed) con.Open(); ; try if (this.dataGridView1.CurrentCell != null) string sql = selec

28、t yuanximingcheng from dbo.yuanxi where yuanxibianma= + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim() + and yuanxibianma not in (select distinct dbo.yuanxi.yuanxibianma from dbo.yuanxi inner join dbo.jiaoshi on dbo.jiaoshi.yuanximingcheng=dbo.yuanxi.yuanximingc

29、heng); 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 dbo.yuanxi

30、 where yuanxibianma= + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim() + and yuanximingcheng not in (select yuanximingcheng from dbo.yuanxi); cmd.CommandText = sql; cmd.ExecuteNonQuery(); MessageBox.Show(删除院系 + this.dataGridView10, this.dataGridView1.CurrentCell.RowIndex.Value.ToString().Trim() + 成功, 提示); catch (Exception ex) MessageBox.Show(错误: + ex.Message, 错误提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); finally if (con.State = ConnectionState.Open)

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号