教务管理系统(概要设计及详细设计)

更新时间:2023-05-26 03:04:59 阅读: 评论:0

父与子读后感-春节灯谜大全及答案

教务管理系统(概要设计及详细设计)
2023年5月26日发(作者:喜剧之王观后感)

概要设计说明书

1 总体设计

1.1 需求规定

教务管理系统可分为学生信息管理系统和教师管理信息系统,系统开发的整

体任务是实现学校教师和学生信息管理的系统化、规范化、自动化和智能化,

而达到提高学校管理效率的目的。

本阶段目的在于明确系统的数据结构和软件结构,此外总体设计还将给出内

部软件和外部系统部件之间的接口定义,各个软件模块的功能说明,数据结构的

细节以及具体的装配要求.

1.2 运行环境

软件基本运行环境为Windows XP环境。

13 基本设计概念和处理流程

概要说明书的目的在于明确系统的数据结构和软件结构,设计外部软件和内

部软件的接口,说明各个软件模块的功能说明,数据结构的细节等。系统的总体

处理流程如图1-1所示:

教务管理系统

选择操作

选择操作

11 系统的总体处理流程

1.4 系统体系结构

基础维护 教学管理 报表统计

用一览表及框图的形式说明本系统的系统元素(各层模块、子程序、公用程序等)的划

- 1 -

选择操作

分,扼要说明每个系统元素的标识符和功能,分层次地给出各元素之间的控制与被控制关系。

本系统的体系架构如图1-2所示:

12 系统体系架构

本系统体系结构大致可以定义为:客户机层上的表示层主要是通过Struts

架实现的,由显示视图产生一个请求. 请求被ActionServlet(控制器)接收,它

struts文件中寻找请求的URI找到对应的Action类后,Action

类执行相应的业务逻辑。Action类执行建立在模型组件基础上的业务逻辑,模

型组件是和应用程序关联的。一旦Action类处理完业务逻辑,它把控制权返回

ActionServlet,Action类提供一个键值作为返回的一部分,它指明了处理的

结果。ActionServlet使用这个键值来决定在什么视图中显示Action的类处理

结果.ActionServletAction类的处理结果传送到指定的视图中,请求的过

程也就完成了。中间业务层是通过Spring框架实现的,首先建立一个BaAction

它继承了Action,而其他定义的Action都要继承这个BaAction。这个

BaAction需要导入AppContext工具类,这个AppContext需要导入Springorg

springframeworkt。*

;这样一个继承BaActionAction,就可以getXXXService)的方法得到某一

rvice的实例-————服务定位器的设计模式。持久(PO)层是由hibernate

架构实现的,它包括关于整体数据库的xml文件、每个表的JavaBean

类和每个表的hbmxml文件,通过Spring集成模板HibernateTemplate提供DAO

来使用PO.Spring 的配置文件(applicationContext

xml)中配置ssionFactorybean 来管理hibernate.

本系统组件图如图1-3所示

管理员登陆 业务调度

班信维护

学信维护

课信维护

师信维护学生选课

课表查询

???成绩输入

数据连接

DAO组件

- 2 -

持久实体

XML解析

2 接口设计

2.1 用户接口

用户接口 语法结构 软件回答信息

教务系统管理员登录 以英文和汉字开头,不超过6个字符 进入主界面

信息管理相关操作 进行相应的操作

3 运行设计

31 运行模块组合

具体软件的运行模块组合为程序多窗口的运行环境,各个模块在软件运行过

程中能较好的交换信息,处理数据。

32 运行控制

软件运行时有较友好的界面,基本能够实现用户的数据处理要求。

33 运行时间

系统的运行时间基本可以达到要求。

4. 系统数据结构

4.1 逻辑设计

教务管理系统E-R

- 3 -

42 逻辑结构设计

1、表名称:bkb 表类型:约束表 含义:班级报考表

字段名称 字段类型 Null 含义 示例数据

id 整形 否,自增 主键列 1

name 字符 八班

2、表名称:cjb 表类型:约束表 含义:班级成绩表(打印表)

字段名称 字段类型 Null 含义 示例数据

id 整形 否,自增 主键列 1

cjb_id 整形 外键列 1

name 字符 八班

3、表名称:jhcjb 表类型:约束表 含义:班级计划成绩表(显示和打印)

字段名称 字段类型 Null 含义 示例数据

id 整形 否,自增 主键列 1

name 字符 八班

4、表名称:hks 表类型:约束表 含义:班计划学期考试课程表

字段名称 字段类型 Null 含义 示例数据

id 整形 否,自增 主键列 1

name 字符 长三

外键列 1 fangguansuo_id 整形

5、表名称:hxq 表类型:约束表 含义:班计划学期课程开设表

字段名称 字段类型 Null 含义 示例数据

id 整形 否,自增 主键列 1

name 字符 英语

fenshu 整形 分数 4

参见 bkb

7、表名称:xxb 表类型:约束表 含义:班注册和档案表

参见 bkb

8、表名称:kbpdfb 表类型:约束表 含义:报考编排登分表

参见bkb

9、表名称:ctdmkb_tmp 表类型:约束表 含义:毕业课程替代免考表

参见 cjb

10、表名称:ctdmkb 表类型:约束表 含义:毕业课程替代免考表

参见 cjb

11、表名称:ysmdb 表类型:约束表 含义:毕业生名单

- 4 -

6、表名称:xjh 表类型:约束表 含义:班教学计划信息表

参见 cjb

12、表名称:ycymdb 表类型:约束表 含义:毕业预审审核差异名单表

参见 cjb

13、表名称:yyshsdfb 表类型:约束表 含义:毕业预审审核得分表

参见 ycymdb

14、表名称:yyshsdfb_tmp 表类型:实体表 含义:毕业预审审核得分表

字段名称 字段类型 Null 含义 示例数据

id 整形 否,自增 主键列

zhaidihao 字符 宅第号

zhuanghao 字符 幢号

diquleibie 字符 地区类别 限定:一类/

chanbie 字符 产别 限定:直管/自管

chanquanzhenghao 字符 产权证号

jiuqu 整形 旧区 约束表:qu

jiuxiaoqu 整形 旧小区 约束表:xiaoqu

jiulouhao 字符 旧楼号

xinqu 整形 新区 约束表:qu

xinxiaoqu 整形 新小区 约束表:xiaoqu

xinlouhao 字符 新楼号

jiegou 整形 结构 约束表:jiegou

zongcengshu 整形 总层数

/三类

/托管

15、表名称:gdw 类型:约束表 含义:采购单位

16、表名称:gdwdhzz 类型:约束表 含义:采购单位到货总账

17、表名称:gdwzz 类型:约束表 含义:采购总账

18、表名称:gdhmxb 类型:约束表 含义:采购到货明细表

19、表名称:gdhmxml 类型:约束表 含义:采购到货明细目录

20、表名称:gmxb 类型:约束表 含义:采购明细表

21、表名称:gzb 类型:约束表 含义:采购总表

22、表名称:cjdmb 类型:约束表 含义:成绩代码表

23、表名称:cjgdb 类型:约束表 含义:成绩更动表

24、表名称:cjtjb 类型:约束表 含义:成绩统计表

25、表名称:cjzb 类型:约束表 含义:成绩总表

26、表名称:cjzb_copy 类型:约束表 含义:成绩总表

27、表名称:dgdw 类型:约束表 含义:订购单位

28、表名称:dgdwmxb 类型:约束表 含义:订购单位明细表

29、表名称:dgmxb 类型:约束表 含义:订购明细表

30、表名称:dgzb 类型:约束表 含义:订购总表

31、表名称:fxzyb 类型:约束表 含义:辅修专业表

32、表名称:jhkkkcb 类型:约束表 含义:计划开考课程表

33、表名称:jhkkkcb 类型:约束表 含义:计划开考课程传递表

34、表名称:jljb 类型:约束表 含义:奖励级别表

- 5 -

35、表名称:jlqkjzb 类型:约束表 含义:奖励情况记载表

36、表名称:jccgfdml 类型:约束表 含义:教材采购分单目录

37、表名称:jccgjsb 类型:约束表 含义:教材采购计算表

38、表名称:jccgmxb 类型:约束表 含义:教材采购明细表

39、表名称:jccgshb 类型:约束表 含义:教材采购审核表

40、表名称:jcch 类型:约束表 含义:教材册号

41、表名称:jcdgzb 类型:约束表 含义:教材订购总表

42、表名称:jclxbmdz 类型:约束表 含义:教材类型编码对照

43、表名称:jcsmmb 类型:约束表 含义:教材说明模板

44、表名称:jcthzt 类型:约束表 含义:教材替换状态

45、表名称:dgdwzb 类型:约束表 含义:教材征订订购单位总表

46、表名称:jczb 类型:约束表 含义:教材总表

47、表名称:jxbm 类型:约束表 含义:教学部门表

48、表名称:jxdg 类型:约束表 含义:教学大纲

49、表名称:jxhjdy 类型:约束表 含义:教学环节定义

50、表名称:kkdw 类型:约束表 含义:开课单位表

51、表名称:kcqkb 类型:约束表 含义:考场情况表

52、表名称:kdxxb 类型:约束表 含义:考点代码表

53、表名称:kslb 类型:约束表 含义:考生类别代码表

54、表名称:ksdmb 类型:约束表 含义:考试代码表

55、表名称:ksdmcd 类型:约束表 含义:考试代码传递表

56、表名称:ksdxb 类型:约束表 含义:考试对象表

57、表名称:ksfsdm 类型:约束表 含义:考试方式代码表

58、表名称:kslxdmb 类型:约束表 含义:考试类型代码表

59、表名称:kccc 类型:约束表 含义:课程层次代码表

60、表名称:kcgldw 类型:约束表 含义:课程管理单位

61、表名称:kcjsfs 类型:约束表 含义:课程建设方式

62、表名称:kcjsjb 类型:约束表 含义:课程建设级别表

63、表名称:kcjslb 类型:约束表 含义:课程建设类别

64、表名称:kcjcdzb 类型:约束表 含义:课程教材对照

65、表名称:kclb 类型:约束表 含义:课程类别代码表

66、表名称:kctdb 类型:约束表 含义:课程替代表

67、表名称:kcxz 类型:约束表 含义:课程性质代码表

68、表名称:kczb 类型:约束表 含义:课程总表

69、表名称:ljhkcb 类型:约束表 含义:类计划课程表

70、表名称:ljhxqks 类型:约束表 含义:类计划学期开设课程表

71、表名称:ljhxqksb 类型:约束表 含义:类计划学期考试课程表

72、表名称:ljxjhb 类型:约束表 含义:类教学计划表

73、表名称:mzdmb 类型:约束表 含义:民族代码表

74、表名称:ndszb 类型:约束表 含义:年度收支表

75、表名称:njdmb 类型:约束表 含义:年级代码表

76、表名称:njkcb 类型:约束表 含义:年级课程表

77、表名称:njzyb 类型:约束表 含义:年级专业表

78、表名称:xkkcb 类型:约束表 含义:新开课程表

- 6 -

79、表名称:xszcb 类型:约束表 含义:新生注册表

80、表名称:xflydmb 类型:约束表 含义:学费来源代码表

81、表名称:xjbddmb 类型:约束表 含义:学籍变动代码表

82、表名称:xjbdjzb 类型:约束表 含义:学籍变动记载表

83、表名称:xjztdmb 类型:约束表 含义:学籍状态代码表

84、表名称:fzjbytj 类型:约束表 含义:学生非在籍和毕业生统计表

85、表名称:xsjbqkb 类型:约束表 含义:学生基本情况表

86、表名称:xsjhcjb 类型:约束表 含义:学生计划成绩表

87、表名称:xslbdmb 类型:约束表 含义:学生类别代码表

88、表名称:xslxdmb 类型:约束表 含义:学生类型代码表

89、表名称:xslxdyb 类型:约束表 含义:学生类型代码对应表

90、表名称:bjxx 表类型:约束表 含义:班级信息表

字段名称 字段类型 Null 含义 示例数据

Bjbh 整形 否,自增 主键列 1

Nj 字符 英语

Bjmc 字符 名称 信管八班

Bjjc 字符 简称 8

Rs 整形 人数 80

Bzr 字符 班主任

示例数据 字段名称 字段类型 Null 含义

1 Jgbh 整形 否,自增 主键列

郑州 Jg 字符

示例数据 字段名称 字段类型 Null 含义

1 Mzbh 整形 否,自增 主键列

Mz 字符

91、表名称:jgdmb 表类型:约束表 含义:籍贯代码表

92、表名称:mzdmb 表类型:约束表 含义:民族代码表

93、表名称:zzmmdmb 表类型:约束表 含义:政治面貌代码表

字段名称 字段类型 Null 含义 示例数据

Zzmmbh 整形 ,自增 主键列 1

Zzmm 字符

示例数据 字段名称 字段类型 Null 含义

1 Xjbh 整形 否,自增 主键列

20097650 Xjmc 字符

示例数据 字段名称 字段类型 Null 含义

1 Bh 整形 否,自增 主键列

2 Xh 字符

4 Kcbh 整形 课程编号

99 Cj 整形

2 Kscs 整形

94、表名称:xjdm 表类型:约束表 含义:学籍代码表

96、表名称:cjb 表类型:约束表 含义:成绩表

- 7 -

Sfbx 字符 是否补修

Sfck 字符 是否重考

Sfqcj 字符 确定成绩

97、表名称:xsxx 表类型:约束表 含义:学生信息表

字段名称 字段类型 Null 含义 示例数据

Xh 整形 否,自增 主键列 2

Xm 字符 张三

Bjbh 整形 班级编号 4

Xb 字符 性别

Nj 字符 年级 2009

Zzmmbh 整形 政治面貌编号 2

Mzbh 整形 民族编号 2

Jgbh 整形 籍贯编号 3

Sfzh 整形 身份证号 4065543

Xjbh 整形 学籍编号 2009

示例数据 字段名称 字段类型 Null 含义

1 Kcbh 整形 否,自增 主键列

英语 Kcmc 字符

英语 Kcjc 字符

Yingyu Pym 字符

Bxqkc 字符

Js 字符 教师

1 Kkxb 整形 开课系别

3 Xf 整形 学分

示例数据 字段名称 字段类型 Null 含义

1 Bh 整形 ,自增 主键列

2 Kxh 字符 课序号

4 Kcbh 整形 课程编号

Sksjt 整形 上课时间天

Sksjj 整形 上课时间节

Skdd 字符 上课地点

示例数据 字段名称 字段类型 Null 含义

1 Bh 整形 ,自增 主键列

2 Xh 整形 学号

4 Kxh 整形 课序号

98、表名称:kcxx 表类型:约束表 含义:课程信息表

99、表名称:kcb 表类型:约束表 含义:课程表

100、表名称:xkb 表类型:约束表 含义:选课表

4.2 物理结构设计

系统的物理结构具体由数据库来设计与生成,故此处略。

- 8 -

5 系统出错处理设计

51 出错信息

错误登录信息 系统提示错误登录信息 系统返回登录界面

输入错误的数据 系统提示数据错误信息 提示重新输入数据

打印不成功 系统提示打印不成功信进行重新打印操作

5.2 补救措施

由于数据在数据库中已经有备份,故在系统出错后可以依靠数据库的恢复功

,并且依靠日志文件使系统再启动,就算系统崩溃数据也不会丢失或遭到破坏。

但有可能占用更多的数据存储空间,权衡措施由用户来决定

5 详细设计说明书

1 引言

11 项目定义

教务综合管理信息系统是为了适应现代化学校管理的需要,加快推进我校数字化

校园建设、充分利用校园网,利用网络、多媒体等计算机应用技术和手段,提高

办公效率、改善质量的高效管理信息系统。

12 编写目的

本文档为“教务管理系统—详细设计说明书",主要用于为实现系统的功能而进行

的系统详细设计说明,详细系统各软件组成模块的实现流程、功能、接口、编译、

测试要点等内容,便于对系统的编码进行指导和约束。

- 9 -

13 参考资料

《教务管理系统_系统软件需求说明书》。

《教务管理系统_系统概要设计说明书》。

《教务管理系统_数据库设计说明书(数据库字典)》等。

2. 程序系统的结构

2.1整个教务管理系统的结构

可由以下图示来表明

教务管理系统

选择操作

3 系统功能实现

从前面需求分析可以看出,系统功能庞杂,主要分为前台浏览器(B/S)信息发

布和数据查询,后台(C/S)数据管理和处理,教务管理功能部分数据分为四类:

学生基本信息相关;教师基本信息相关;课程信息相关; 学生成绩综合查询相

关。从使用和操作的功能上分,有三种用户:该校学生;业务数据管理人员(学

选择操作

生工作辅导员、教务干事);系统管理员.为便于整个系统组织管理,把各个相

我们把各个相对独立的功能完全独对独立的数据或功能组织到整个大系统中来,

立设计,编译成独立的目标(功能)模块(single Executable),各功能模块最后

相应地将系统结构分为一个控制台被集成到一个称为虚拟桌面的控制台模块中。

程序和七个子系统,各子系统又分为若干各子模块。对应于每一个模块,几乎都

教学管理 报表统计 基础维护

11 系统的总体处理流程

选择操作

有录入、查询、修改、删除、查看详细资料等这几个功能.整个业务流程就是由

这几种基本功能实现的。在这里每个模块都要用到的功能没必要在每个子模块里

- 10 -

重复阐述,在每个子模块里只列出区别于其它子模块的功能实现。

3.1 系统控制台模块

:

各子功能模块的组织和调用;

统一的登陆界面实现到数据库服务器的登陆;

显示教务主页

系统图标.

1

登陆数据库:

输入数据库服务器名(ServerIP)、用户账号()UrID、密码(PassWord); 登陆

数据库服务器,检索系统权限表,根据权限设置相应功能模块:

①无此用户或禁止权限

Enable = Fal

②浏览权限

Enable = True

修改 Ur ID= ;

修改 Pass Word :=

③修改权限

Enable = True

修改 Ur ID =

修改 Pass Word = ;

2 采用WinXP 下程序组、程序项的原理组织各执行模块:

登陆服务器

基础维护

教学管理

报表统计

退出

各程序组、程序项的显示分别可以是分层/树状/大图标/小图标等方式;各程序

- 11 -

项或菜单项的名称命名为相应功能模块的目标代码文件名。

32. 各具体模块如下:

模块1名称:班级信息维护

输入: 班级信息维处理: 维护管理该校各班级基本信息 输出: 各班级信息

数据表:

班级信息表

模块2名称:学生基本信息维护

输入:学生基本信处理: 维护管理学生基本信息 输出: 学生基本信

数据表:

学生信息表

模块3名称:课程信息维护

输入: 课程信息维处理: 维护管理课程基本信息 输出: 课程信息

数据表:

课程信息表

模块4名称:学生选课信息

输入:学生选课信息 处理: 维护管理学生选课信息 输出: 学生选课信

数据表:

学生基本信息表

课程信息表

模块5名称:课表查询

输入:课表查询 处理: 维护管理课表查询信息 输出:所查班级课表

数据表:

学生基本信息表

班级信息表

模块6名称:成绩输入

- 12 -

输入:成绩输入 处理: 维护管理成绩输入信息 输出:成绩

数据表:

学生基本信息表

课程信息表

模块7名称:教师信息为维护

输入: 教师信息为处理: 维护管理教师信息 输出: 教师信息

维护

数据表:

教师信息表

4. 具体设计:

设计功能实现

包括:班级信息维护,学生信息维护,课程信息维护,学生选课,课表查询,成绩输入,报

表统计,退出系统

Public Class frmMain

Inherits SystemForm

Private Function GetInstanceStateByVal name As String) As Boolean

'获得frmMain窗体的子窗体的数量

Dim i As Integer = Me

循环判断是否有名为name的子窗体实例

For i = 0 To Me.MdiChildrenLength - 1

If MeMdiChildren(iName = name Then

'存在名为name的子窗体,是子窗体获得焦点并返回True

MeMdiChildreni).Focus()

Return True

End If

Next

不存在名为Name的子窗体Fal

Return Fal

End Function

Private Sub mnClass_Click(ByVal nder As , ByVal e As System

EventArgs Handles

If GetInstanceState"frmClass” Then

Exit Sub

End If

Dim childFrm As frmClass = New frmClass

childFrmMdiParent = Me

- 13 -

childFrmShow)

End Sub

Private Sub mnStudent_Click(ByVal nder As SystemObject ByVal e As

rgs) Handles mnStudentClick

If GetInstanceState("frmStudent") Then

Exit Sub

End If

Dim childFrm As frmStudent = New frmStudent

ent = Me

childFrmShow()

End Sub

Private Sub mnSubject_ClickByVal nder As SystemObject ByVal e As System

EventArgs Handles

If GetInstanceState”frmSubject") Then

Exit Sub

End If

Dim childFrm As frmSubject = New frmSubject

ent = Me

(

End Sub

Private Sub mnSelect_Click(ByVal nder As SystemObject, ByVal e As

rgs Handles mnSelectClick

If GetInstanceState(”frmSelect") Then

Exit Sub

End If

Dim childFrm As frmSelect = New frmSelect

ent = Me

(

End Sub

Private Sub mnCour_Click(ByVal nder As SystemObject ByVal e As System

EventArgs Handles mnCourClick

If GetInstanceState”frmCour") Then

Exit Sub

End If

Dim childFrm As frmCour = New frmCour

ent = Me

childFrmShow()

End Sub

Private Sub mnResult_Click(ByVal nder As , ByVal e As rgs)

Handles

If GetInstanceState(”frmScore” Then

Exit Sub

End If

Dim childFrm As frmScore = New frmScore

- 14 -

ent = Me

childFrmShow)

End Sub

Private Sub mnReport_ClickByVal nder As SystemObject ByVal e As System

EventArgs Handles

If GetInstanceState”frmReport") Then

Exit Sub

End If

Dim childFrm As frmReport = New frmReport

ent = Me

childFrmShow()

End Sub

Private Sub mnExit_Click(ByVal nder As SystemObject ByVal e As rgs)

Handles

End Sub

End Class

5 基础维护:

5.1 班级信息维护

实现的功能包括: 查看首记录 :表中首个班级记录,上记录, 下记录, 查尾记录,新

增,修改,删除等

可实现模糊搜索功能 即:输入班级编号可查询相关班级信息

如下所示:

Public Class frmBa

Inherits SystemWindowsFormsForm

Protected bmData As BindingManagerBa

Protected dtData As DataTable

’bAdd = true 为新增

’bAdd = fal 为修改

Protected bAdd As Boolean

Private Sub frmBa_LoadByVal nder As Object _

ByVal e As rgs Handles MyBa.Load

Prepare()

SetDataGrid()

SetTextBoxStateTrue)

End Sub

Private Sub ToolBar1_ButtonClickByVal nder As Object _

ByVal e As ToolBarButtonClickEventArgs _

Handles Click

Select Ca e

Ca 首记录"

- 15 -

'返回首记录

on = 0

Ca "上记录"

If on < 0 Then

on = 1

End If

Ca 下记录"

If on < Then

bmDataPosition += 1

End If

Ca "尾记录

'返回尾记录

on =

Ca "新增

Me.dgdListEnabled = Fal

SetTextBoxStateFal

SetToolBarStateFal

bAdd = True

Clear()

Ca "修改

Me.d = Fal

SetTextBoxState(Fal)

SetToolBarStateFal

bAdd = Fal

Ca 删除

弹出询问对话框

Dim dlgResult As DialogResult = _

MessageBoxShow你确认删除此数据?", _

"删除" el

If dlgResult = DialogResultOK Then

DeleteData()

End If

Ca "保存

SetToolBarState(True

SetTextBoxState(True

If bAdd = True Then

'为新增数据保存

SaveForAdd)

El

'为更新数据保存

SaveForUpdate()

End If

MedgdListEnabled = True

Ca "取消"

- 16 -

SetTextBoxState(True

SetToolBarState(True)

Me.dgdListEnabled = True

SearchResult()

Ca 退出"

'关闭本窗体

Me.Clo)

End Select

Try

MetRowIndex = bmDataPosition

SetData)

Catch ex As Exception

End Try

End Sub

Private Sub btnSearch_ClickByVal nder As SystemObject, _

ByVal e As rgs) Handles btnSearchClick

SearchResult)

End Sub

Private Sub dgdList_CurrentCellChanged(ByVal nder As Object _

ByVal e As rgs) Handles dgdListCurrentCellChanged

Try

'判断bmData是否为Nothing

If bmData Is Nothing Then

Exit Sub

End If

If bmDataPosition <> tCellRowNumber Then

bmDataPosition = dgdListCurrentCellRowNumber

SetData()

End If

Catch ex As Exception

(ng)

End Try

End Sub

Private Sub SetToolBarStateByVal bState As Boolean

设置Button的是否能够单击

s0.Enabled = bState

s(1.Enabled = bState

ToolBar1Buttons(2).Enabled = bState

s3.Enabled = bState

s(4.Enabled = bState

s(5.Enabled = bState

s(6)Enabled = bState

ToolBar1Buttons(7Enabled = Not bState

s(8)Enabled = Not bState

- 17 -

End Sub

Public Overridable Sub Prepare(

End Sub

设置DataGrid控件

Public Overridable Sub SetDataGrid(

End Sub

'查询函数

Public Overridable Sub SearchResult()

SetDataGrid)

' urce = dtDataDefaultView

End Sub

'新增函数

Public Overridable Sub LoadData()

End Sub

Public Overridable Sub SaveForAdd()

End Sub

'更新函数

Public Overridable Sub SaveForUpdate(

End Sub

删除函数

Public Overridable Sub DeleteData()

End Sub

清除函数

Public Overridable Sub Clear()

End Sub

设置TextBox函数

Public Overridable Sub SetTextBoxStateByVal bState As Boolean

End Sub

Public Overridable Sub SetData()

End Sub

End Class

52 学生信息维护

实现的功能包括: 查看首记录 ,上记录, 下记录, 查尾记录,新增,修改,删除等

可实现模糊搜索功能

如下所示:

Public Class frmStudent

Inherits 教务管理系统.frmBa

Public Overrides Sub Prepare()

Me.Text = "学生信息维护"

Me = 学号"

Me = 姓名

Me = 年级

- 18 -

'设置ComboBox控件数据源

Dim db As DataBa = New DataBa

Dim dv As DataView = ectSQL _

("lect 班级编号,班级名称from 班级信息order by 班级名称

MecbbClassIdDataSource = dv

Me.yMember = 班级名称"

Me.ember = 班级编号

dv = dbRunSelectSQL _

("lect 政治面貌编号,政治面貌from 政治面貌代码表")

Meurce = dv

Me.yMember = 政治面貌"

Me.ember = "政治面貌编号"

dv = ectSQL("lect 民族编号,民族from 民族代码表"

Me.cbbNationDataSource = dv

Me.yMember = "民族

Me.ember = 民族编号"

dv = dbRunSelectSQL”lect 籍贯编号,籍贯from 籍贯代码表")

Me.urce = dv

Me.yMember = "籍贯"

Me.cbbBirthPlaceValueMember = "籍贯编号

dv = ectSQL("lect 学籍编号,学籍名称from 学籍代码表)

Meurce = dv

MecbbStatusDisplayMember = "学籍名称"

Me.cbbStatus.ValueMember = 学籍编号

dbDispo()

End Sub

Public Overrides Sub LoadData()

Dim strFilter As String

If txbOneTextTrimLength = 0 Then

If txbTwo = 0 Then

If = 0 Then

strFilter = "”

El

strFilter = ”where 年级like ’”

strFilter += + ”%'"

End If

El

strFilter = ”where 姓名like ’"

strFilter += Trim + ”%’"

If TrimLength > 0 Then

strFilter += " and 年级like ’"

strFilter += Trim + "'”

End If

End If

- 19 -

El

strFilter = ”where 学号like ’”

strFilter += txbOneTextTrim + '”

If txbTwo > 0 Then

strFilter += " and 姓名like '”

strFilter += txbTwo + "'"

If Length <> 0 Then

strFilter += ” and 年级like '”

strFilter += txbThree + ”%'”

End If

El

If 〈〉 0 Then

strFilter += " and 年级like ’”

strFilter += txbThree + ”%’”

End If

End If

End If

'清空DataSet11

(

SqlConnection1ConnectionString =

Dim strSQL As String

dText _

= ”lect * from 学生信息 + strFilter

'根据查询条件重新填充DataSet11

(DataSet11

dtData = 学生信息)

If dtData 15 Then

dtDataColumnsAdd("班级"

dtData("政治面貌

dtData(民族)

"籍贯)

(学籍"

End If

bmData = Me.BindingContext(DataSet11 学生信息")

If 〈〉 0 Then

on = 0

End If

End Sub

Public Overrides Sub SetDataGrid()

LoadData()

定义一个DataGrid表样式

Dim ts As New DataGridTableStyle

Dim aColumnTextColumn As DataGridTextBoxColumn

Dim numCols As Integer = dtDataColumnsCount

- 20 -

Dim i As Integer

For i = 0 To numCols 1

'If i = 6 Then

i = 10

’End If

aColumnTextColumn = New DataGridTextBoxColumn

aColumnTextColumnMappingName = _

dtDataColumnsi.ColumnName

Text = _

si)ColumnName

aColumnTextColumnNullText = ”"

ly = True

' = 55

tsGridColumnStylesAdd(aColumnTextColumn

Next

atingBackColor = ray

orting = Fal

gName = dtDataTableName

dgdList)

dgdListTableStylesAddts)

Dim dv As DataView = dtDataDefaultView

ew = Fal

dvAllowDelete = Fal

'dit = Fal

设置数据源

urce = dtDataDefaultView

bmData = MeBindingContextDataSet11, 学生信息)

lblCountText = 记录数:" + ToString)

SetDetailData()

End Sub

Private Sub SetDetailData(

Dim dtClassId, dtPolity, dtNation, _

dtBirthPlace, dtStatus As DataTable

Dim db As DataBa = New DataBa

dtClassId = dbRunSelectSQL _

"lect 班级编号,班级名称from 班级信息order by 班级名称".Table

dtPolity = ectSQL _

”lect 政治面貌编号,政治面貌from 政治面貌代码表.Table

dtNation = dbRunSelectSQL _

"lect 民族编号,民族from 民族代码表").Table

dtBirthPlace = dbRunSelectSQL _

("lect 籍贯编号,籍贯from 籍贯代码表").Table

dtStatus = dbRunSelectSQL _

(”lect 学籍编号,学籍名称from 学籍代码表).Table

- 21 -

Dim dv As DataView

For i As Integer = 0 To dtDataRowsCount 1

dv = tView

dvRowFilter = "班级编号='” + i)("班级编号 + ”'”

i("班级") = dv(0)1

dv = tView

dvRowFilter = "政治面貌编号=’” + dtDataRowsi)(政治面貌编号) + ”’”

(i政治面貌 = dv(0)(1

dv = dtNationDefaultView

ter = "民族编号=’" + dtDataRowsi)("民族编号 + "’”

i民族") = dv(01

dv = tView

dvRowFilter = 籍贯编号=’” + dtDataRowsi)("籍贯编号) + ”’"

dtDataRowsi)籍贯" = dv(01)

dv = dtStatusDefaultView

dvRowFilter = 学籍编号=’" + i学籍编号) + "'”

i学籍") = dv(0)1

Next

End Sub

Public Overrides Sub SetTextBoxStateByVal bState As Boolean

Med = Not bState

End Sub

Public Overrides Sub Clear()

MetxbClassIdText = ”"

Me = ”"

MetxbNameText = ”"

Me = ”"

Me.cbbBirthPlaceText = "”

MecbbClassIdText = ””

Me. = ”"

Me. = ””

MecbbSexText = ""

Me. = "”

End Sub

Public Overrides Sub SaveForAdd()

Dim dr As DataRow = 学生信息NewRow(

Try

dr("学号 = Me.Trim

dr("姓名") = MetxbName

dr"年级) = MeTrim

dr"性别") = Me.

dr(年级) = MeTrim

dr(身份证号) = MetxbPIDTextTrim

dr政治面貌编号") = Me.cbbPolitySelectedValue

- 22 -

dr(民族编号") = MeedValue

dr("籍贯编号 = Me.edValue

dr"班级编号") = MeedValue

dr("学籍编号 = Me.cbbStatusSelectedValue

Catch ex As Exception

(数据格式不正确!)

Return

End Try

Try

学生信息"RowsAdddr

If Me.nges = True Then

(DataSet11)

End If

Catch ex As Exception

MessageBoxShow(exToString) ’("数据添加失败!")

End Try

LoadData)

dgdListDataSource = tView

End Sub

Public Overrides Sub DeleteData)

Try

'删除当前行的数据

(学生信息. _

Rows(on).Delete)

If Me.nges = True Then

更新DataSet11

DataSet11)

End If

Catch ex As Exception

MessageBoxShow("数据删除失败!”

End Try

End Sub

Public Overrides Sub SaveForUpdate)

Try

Dim row As Integer

row = tCellRowNumber

dgdListCurrentCell = _

New DataGridCell(row + 1 Mod bmDataCount 0

判断是否有更新的数据

If Me.nges = True Then

SqlDataAdapter1Update(DataSet11)

End If

Catch ex As Exception

"数据修改失败!"

- 23 -

End Try

End Sub

Private Sub frmStudent_LoadByVal nder As , ByVal e As

rgs) Handles MyBaLoad

End Sub

End Class

5.3 课程信息维护

实现的功能包括: 查看首记录 :表中首个班级记录,上记录, 下记录, 查尾记录,新

增,修改,删除等

可实现模糊搜索功能

如下所示:

Public Class frmSelect

Inherits SystemWindowsFormsForm

Private dtData As DataTable

Private dtSubject As DataTable

Private Sub btnSearch_ClickByVal nder As , _

ByVal e As SystemEventArgs Handles btnSearchClick

SetDGDSubject)

End Sub

Private Sub btnSelect_Click(ByVal nder As , _

ByVal e As rgs) Handles

If dgdListCurrentCellRowNumber = -1 Or _

ber = 1 Then

Exit Sub

End If

Dim db As DataBa = New DataBa

Dim dv As DataView

Dim strSQL As String = ”"

Dim strTmp As String = dtSubject _

RowsdgdSubjectCurrentCellRowNumber)(1).)

strSQL = ”lect from 选课表where 学号=’” + txbId

strSQL += ”' and 课序号inlect 课序号from 课程表where 课程编号=’"

strSQL += strTmp + ”’"

dv = ectSQLstrSQL

If 〈〉 0 Then

MessageBoxShow该课程已经选择!

e()

Exit Sub

End If

Dim strCId As String = dtSubject. _

Rows(dgdSubjectber)0ToStringTrim()

strSQL = ”lect * from 选课表as a, 课程表as b "

- 24 -

strSQL += "where a.课序号=b。课序号and a。学号='”

strSQL += Trim + "’ and 100*b。上课时间天+”

strSQL += "b。上课时间节in lect 100*上课时间天+上课时间节

strSQL += ” from 课程表where 课序号='” + strCId + "’"

dv = dbRunSelectSQL(strSQL

If <> 0 Then

MessageBoxShow该课序号时间和已经选择的课程冲突!")

Exit Sub

El

strSQL = ”inrt into 选课表(学号,课序号) values('"

strSQL += txbId + "''” + strCId + " ’"

OrInsSQLstrSQL

strSQL = ”lect c.学号,a。课序号,b。课程名称,b。教师,b.开课系别,”

strSQL += "a。上课时间天,a.上课时间节,a.上课地点from 选课表"

strSQL += "as c, 课程表as a 课程信息as b where ”

strSQL += ”a。课程编号=b.课程编号and c。课序号=a.课序号and 学号=’"

strSQL += Trim + "’ order by a.课序号"

dv = ectSQL(strSQL)

elete = Fal

dit = Fal

ew = Fal

dtData =

Meurce = dtData

End If

e()

End Sub

Private Sub btnDel_ClickByVal nder As SystemObject _

ByVal e As SystemEventArgs) Handles btnDelClick

If MedgdListCurrentCellRowNumber = 1 Then

Exit Sub

End If

Dim dlgResult As DialogResult = MessageBox _

Show("确定删除指定的已选课程吗?, "提示 _

MessageBoxButtonsYesNo)

If dlgResult = DialogResultYes Then

Dim strCId As String = dtData. _

Rowsber(1()

Dim strSQL As String = ”delete from 选课表where 学号='”

strSQL += Me.

strSQL += ”’ and 课序号= ’” + strCId + ”’"

Dim db As DataBa = New DataBa

OrInsSQL(strSQL

Dim dv As DataView

strSQL = ”lect c.学号,a。课序号,b。课程名称,b。教师,b.开课系别,"

- 25 -

strSQL += "a.上课时间天,a。上课时间节,a.上课地点from 选课表"

strSQL += "as c, 课程表as a, 课程信息as b where ”

strSQL += "a。课程编号=b。课程编号and c.课序号=a。课序号

strSQL += "and 学号='" + Trim + ”’ order by a。课序号

dv = ectSQLstrSQL)

dvAllowDelete = Fal

dit = Fal

ew = Fal

dtData =

Meurce = dtData

e(

End If

End Sub

Private Sub btnDisplay_ClickByVal nder As SystemObject, _

ByVal e As rgs) Handles

Dim dlgChild As frmCour = New frmCour

()

End Sub

Private Sub txbId_KeyDown(ByVal nder As Object _

ByVal e As SystemWindowsntArgs Handles txbIdKeyDown

If eKeyCode = And txbIdText < 0 Then

Dim db As DataBa = New DataBa

Dim strSQL As String = ”"

strSQL = ”lect 姓名, 班级名称, 学籍编号from 学生信息as a,"

strSQL += " 班级信息as b where a.班级编号=b.班级编号"

strSQL += ”and 学号=’" + Me + ”'"

Dim dv As DataView = dbRunSelectSQL(strSQL

If dvCount = 0 Then

MessageBoxShow"不是在籍的学生)

Me = "”

El

MetxbNameText = dv(0)0

Me = dv(0(1).ToStringTrim

End If

strSQL = "lect c。学号,a。课序号,b。课程名称,b。教师,b。开课系别,"

strSQL += "a.上课时间天,a.上课时间节,a.上课地点from 选课表"

strSQL += "as c 课程表as a 课程信息as b where a.课程编号

strSQL += ”=b.课程编号and c。课序号=a。课序号and 学号=’”

strSQL +=

strSQL += "' order by a。课序号"

dv = dbRunSelectSQLstrSQL)

If dvCount = 0 Then

("不是在籍的学生"

Me.txbIdText = ""

- 26 -

El

dvAllowDelete = Fal

dvAllowEdit = Fal

ew = Fal

dtData =

Meurce = dtData

End If

e()

End If

End Sub

Private Sub txbPY_KeyDown(ByVal nder As Object _

ByVal e As KeyEventArgs) Handles txbPYKeyDown

If eKeyCode = KeysEnter Then

SetDGDSubject()

End If

End Sub

Private Sub SetDGDSubject()

根据查询条件组合SQL语句

Dim strSQL As String = ”lect a。课序号,b。课程编号,b.课程名称,b。教师,"

strSQL += "b.开课系别,a.上课时间天,a.上课时间节,a。上课地点from 课程表

strSQL += " as a 课程信息as b where a。课程编号=b。课程编号

Dim strFilter As String = ””

If MetxbPY < 0 Then

strFilter += " and 拼音码like '" + Me.txbPYTextTrim + ”%'”

End If

If Me.TrimLength < 0 Then

strFilter += ” and 课程名称like ’" + MetxbCNameTextTrim + ”%’”

End If

If MetxbCIdLength 〈〉 0 Then

strFilter += " and b.课程编号like '” + MetxbCIdTextTrim + "'”

End If

If Me. <> 0 Then

strFilter += ” and 课序号like '” + Me. + ”%’"

End If

If strFilterTrimLength = 0 Then

Exit Sub

End If

strFilter += " order by 课序号"

'执行SQL语句

Dim db As DataBa = New DataBa

Dim dv As DataView = dbRunSelectSQLstrSQL + strFilter)

dvAllowDelete = Fal

dvAllowEdit = Fal

dvAllowNew = Fal

- 27 -

MedgdSubjectAllowSorting = Fal

dtSubject = dvTable

'设置数据源

Meurce = dtSubject

dbDispo()

End Sub

Private Sub txbCName_KeyDown(ByVal nder As Object ByVal e As

KeyEventArgs Handles txbCNameKeyDown

If e = KeysEnter Then

SetDGDSubject)

End If

End Sub

Private Sub txbCNumber_KeyDownByVal nder As Object, ByVal e As System

KeyEventArgs) Handles n

If e = KeysEnter Then

SetDGDSubject()

End If

End Sub

Private Sub txbCId_KeyDownByVal nder As Object, ByVal e As SystemWindows

FormsKeyEventArgs) Handles n

If eKeyCode = Then

SetDGDSubject()

End If

End Sub

Private Sub frmSelect_LoadByVal nder As ByVal e As System

EventArgs Handles MyBaLoad

End Sub

End Class

6 教学管理

61学生选课

可实现的功能:课程的查询,选课,删除,显示课表等

查询功能实现如下所示:

Public Class frmSelect

Inherits System

Private dtData As DataTable

Private dtSubject As DataTable

Private Sub btnSearch_ClickByVal nder As SystemObject _

ByVal e As rgs) Handles

SetDGDSubject()

End Sub

- 28 -

Private Sub btnSelect_ClickByVal nder As SystemObject _

ByVal e As rgs) Handles btnSelectClick

If tCellRowNumber = 1 Or _

tCellRowNumber = 1 Then

Exit Sub

End If

Dim db As DataBa = New DataBa

Dim dv As DataView

Dim strSQL As String = ""

Dim strTmp As String = dtSubject _

Rows(dgdSubjectCurrentCellRowNumber(1(

strSQL = "lect * from 选课表where 学号=’” + txbId

strSQL += "' and 课序号in(lect 课序号from 课程表where 课程编号='”

strSQL += strTmp + "’)"

dv = dbRunSelectSQLstrSQL)

If dvCount > 0 Then

(该课程已经选择!"

dbDispo()

Exit Sub

End If

Dim strCId As String = dtSubject. _

RowsdgdSubjectber)0).ToStringTrim()

strSQL = ”lect * from 选课表as a, 课程表as b ”

strSQL += "where a。课序号=b。课序号and a。学号=’”

strSQL += txbId + ”’ and 100*b.上课时间天+"

strSQL += "b.上课时间节in lect 100*上课时间天+上课时间节

strSQL += " from 课程表where 课序号='” + strCId + ”’)”

dv = dbRunSelectSQLstrSQL)

If dvCount <> 0 Then

MessageBoxShow(该课序号时间和已经选择的课程冲突!

Exit Sub

El

strSQL = ”inrt into 选课表(学号,课序号) values('”

strSQL += txbId + ”''" + strCId + ” ’)"

OrInsSQLstrSQL

strSQL = "lect c.学号,a.课序号,b。课程名称,b。教师,b.开课系别,"

strSQL += ”a。上课时间天,a。上课时间节,a。上课地点from 选课表"

strSQL += "as c 课程表as a, 课程信息as b where ”

strSQL += "a.课程编号=b.课程编号and c。课序号=a。课序号and 学号='"

strSQL += + ”’ order by a.课序号"

dv = dbRunSelectSQL(strSQL)

dvAllowDelete = Fal

dvAllowEdit = Fal

ew = Fal

- 29 -

dtData = dvTable

MedgdListDataSource = dtData

End If

e()

End Sub

Private Sub btnDel_Click(ByVal nder As _

ByVal e As SystemEventArgs Handles btnDelClick

If MedgdListCurrentCellRowNumber = -1 Then

Exit Sub

End If

Dim dlgResult As DialogResult = MessageBox. _

Show确定删除指定的已选课程吗?, 提示 _

If dlgResult = Then

Dim strCId As String = dtData. _

Rows(ber)(1)ToStringTrim()

Dim strSQL As String = "delete from 选课表where 学号=’"

strSQL += MeTrim

strSQL += "' and 课序号= '” + strCId + ”’"

Dim db As DataBa = New DataBa

OrInsSQLstrSQL)

Dim dv As DataView

strSQL = ”lect c。学号,a.课序号,b.课程名称,b.教师,b。开课系别,"

strSQL += "a。上课时间天,a。上课时间节,a。上课地点from 选课表"

strSQL += "as c 课程表as a, 课程信息as b where "

strSQL += ”a.课程编号=b。课程编号and c.课序号=a.课序号

strSQL += ”and 学号=’" + Trim + ”' order by a.课序号"

dv = ectSQLstrSQL

elete = Fal

dit = Fal

ew = Fal

dtData =

Me.dgdListDataSource = dtData

dbDispo)

End If

End Sub

Private Sub btnDisplay_ClickByVal nder As , _

ByVal e As rgs) Handles

Dim dlgChild As frmCour = New frmCour

dlgChildShow)

End Sub

Private Sub txbId_KeyDownByVal nder As Object, _

ByVal e As SystemKeyEventArgs) Handles n

If e = And txbIdLength < 0 Then

- 30 -

Dim db As DataBa = New DataBa

Dim strSQL As String = ""

strSQL = "lect 姓名, 班级名称, 学籍编号from 学生信息as a

strSQL += 班级信息as b where a。班级编号=b。班级编号"

strSQL += ”and 学号='" + Me + "’”

Dim dv As DataView = ectSQLstrSQL

If dvCount = 0 Then

不是在籍的学生

MetxbIdText = ””

El

Me = dv0)0.ToStringTrim

Me.txbGradeText = dv(0(1ToStringTrim

End If

strSQL = "lect c。学号,a.课序号,b.课程名称,b。教师,b.开课系别,”

strSQL += ”a。上课时间天,a.上课时间节,a。上课地点from 选课表"

strSQL += ”as c, 课程表as a, 课程信息as b where a。课程编号

strSQL += "=b.课程编号and c。课序号=a.课序号and 学号=’"

strSQL += Trim

strSQL += ”’ order by a.课序号

dv = ectSQLstrSQL

If dvCount = 0 Then

("不是在籍的学生

Me.txbIdText = ""

El

dvAllowDelete = Fal

dvAllowEdit = Fal

ew = Fal

dtData =

Meurce = dtData

End If

dbDispo()

End If

End Sub

Private Sub txbPY_KeyDown(ByVal nder As Object _

ByVal e As ntArgs Handles txbPY.KeyDown

If e = KeysEnter Then

SetDGDSubject(

End If

End Sub

Private Sub SetDGDSubject)

'根据查询条件组合SQL语句

Dim strSQL As String = "lect a。课序号,b.课程编号,b.课程名称,b.教师,”

strSQL += "b。开课系别,a。上课时间天,a。上课时间节,a。上课地点from 课程

"

- 31 -

strSQL += " as a 课程信息as b where a。课程编号=b.课程编号"

Dim strFilter As String = ”"

If Me.txbPY <> 0 Then

strFilter += ” and 拼音码like '” + MeTrim + ”%'"

End If

If MeTrimLength <> 0 Then

strFilter += " and 课程名称like ’” + MetxbCNameTextTrim + "%’”

End If

If Me. > 0 Then

strFilter += ” and b.课程编号like ’” + Me. + ”%'”

End If

If Me. 〈〉 0 Then

strFilter += ” and 课序号like ’” + MetxbCNumber + ”%’”

End If

If strFilterTrimLength = 0 Then

Exit Sub

End If

strFilter += " order by 课序号"

执行SQL语句

Dim db As DataBa = New DataBa

Dim dv As DataView = dbRunSelectSQL(strSQL + strFilter)

dvAllowDelete = Fal

dit = Fal

ew = Fal

MedgdSubjectAllowSorting = Fal

dtSubject =

'设置数据源

MedgdSubjectDataSource = dtSubject

dbDispo(

End Sub

Private Sub txbCName_KeyDown(ByVal nder As Object, ByVal e As

KeyEventArgs Handles txbCNameKeyDown

If e = Then

SetDGDSubject()

End If

End Sub

Private Sub txbCNumber_KeyDown(ByVal nder As Object ByVal e As

sntArgs) Handles n

If e = KeysEnter Then

SetDGDSubject()

End If

End Sub

Private Sub txbCId_KeyDown(ByVal nder As Object, ByVal e As s

FormsKeyEventArgs) Handles txbCIdKeyDown

- 32 -

If eKeyCode = Then

SetDGDSubject()

End If

End Sub

Private Sub frmSelect_Load(ByVal nder As SystemObject, ByVal e As rgs)

Handles MyBaLoad

End Sub

End Class

62 课表查询

输入学生学号即可查询该生课表:

示例如下:

63 成绩输入

输入课程拼音:zggms,运行结果如下:

详细代码如下:

Public Class frmScore

Inherits SystemForm

Private dtData As DataTable

#Region Windows 窗体设计器生成的代码

Public Sub New)

MyBaNew()

'该调用是Windows 窗体设计器所必需的。

InitializeComponent(

'InitializeComponent() 调用之后添加任何初始化

End Sub

'窗体重写dispo 以清理组件列表。

Protected Overloads Overrides Sub Dispo(ByVal disposing As Boolean)

If disposing Then

If Not components Is Nothing) Then

componentsDispo()

End If

End If

MyBaDispo(disposing

End Sub

Windows 窗体设计器所必需的

Private components As entModelIContainer

注意: 以下过程是Windows 窗体设计器所必需的

'可以使用Windows 窗体设计器修改此过程。

'不要使用代码编辑器修改它。

Friend WithEvents GroupBox1 As SystemWindowsFormsGroupBox

- 33 -

Friend WithEvents Label1 As s

Friend WithEvents GroupBox2 As SystemWindowsox

Friend WithEvents Label2 As SystemWindows

Friend WithEvents Label3 As Label

Friend WithEvents Label4 As sFormsLabel

Friend WithEvents Label5 As Label

Friend WithEvents GroupBox3 As SystemGroupBox

Friend WithEvents btnClear As Button

Friend WithEvents dgdList As DataGrid

Friend WithEvents Label6 As SystemLabel

Friend WithEvents txbPY As SystemWindowsFormsTextBox

Friend WithEvents txbName As SystemWindowsFormsTextBox

Friend WithEvents txbId As x

Friend WithEvents btnSearch As SystemWindowsFormsButton

Friend WithEvents btnSubmit As sFormsButton

Friend WithEvents txbScore As SystemWindowsFormsTextBox

Friend WithEvents btnUpdate As sFormsButton

SystemDiagnosticsDebuggerStepThrough()> Private Sub InitializeComponent

()

Dim resources As SystemceManager = New

ceManager(GetTypefrmScore)

MeGroupBox1 = New SystemWindowsFormsGroupBox

Me.Label1 = New sFormsLabel

MebtnClear = New sFormsButton

Me.GroupBox2 = New ox

Me.btnSubmit = New

Me.btnSearch = New SystemWindows

Me.txbId = New SystemWindowsFormsTextBox

MetxbName = New SystemWindowsx

Me.Label5 = New

MeLabel4 = New sFormsLabel

Me.Label3 = New SystemWindowsFormsLabel

MeLabel2 = New System

MetxbPY = New SystemTextBox

Me.GroupBox3 = New ox

MebtnUpdate = New s

MeLabel6 = New Label

Me.txbScore = New x

Me.dgdList = New SystemWindowsid

MedLayout()

Me.dLayout)

MedLayout()

CType(MedgdList, rtInitialize.BeginInit

)

- 34 -

MeSuspendLayout)

'

'GroupBox1

'

MeGroupBox1(Me.Label1

MeMebtnClear

Me = System

Meon = New gPoint0 0)

Me.GroupBox1Name = "GroupBox1

Me.GroupBox1Size = New (664, 88)

MeGroupBox1TabIndex = 0

MeGroupBox1TabStop = Fal

Me. = "结束选课,生成空成绩单"

'Label1

Meon = New System(200, 8)

Me. = Label1

MeLabel1Size = New SystemDrawingSize(360 72)

Me.Label1TabIndex = 1

Me = "应该单独有一个终止选课的功能,终止选课后生成空的成绩

单,所有学生将不允许更改课程信息,如果需要更改,必须单独申请,特殊处理.终止选课

一学年应该只能进行一次操作. & _

"者需要注意实例没有制作开始选课等功能,终止选课后在学生选课中仍然可以更

改选择的课程."

'btnClear

Meon = New SystemDrawingPoint8, 32)

Me. = btnClear"

Me.btnClearSize = New gSize(152 23

Me.btnClearTabIndex = 0

MebtnClearText = "终止选课,生成空成绩单

'GroupBox2

'

Me.GroupBox2ControlsAddMebtnSubmit

MeGroupBox2ControlsAdd(Me.btnSearch

MeGroupBox2MetxbId)

Me.(Me.txbName

Me.GroupBox2ControlsAdd(MeLabel5)

Me.GroupBox2MeLabel4)

Me.(MeLabel3)

Me.GroupBox2ControlsAddMeLabel2

- 35 -

Me.(Me.txbPY)

Me.GroupBox2Dock = yleTop

Meon = New gPoint0 88)

Me. = GroupBox2

Me = New (664 88

Me.ex = 1

Me.GroupBox2TabStop = Fal

Me. = 选择课程"

btnSubmit

Me.btnSubmitLocation = New (208 48)

Me.btnSubmitName = btnSubmit

Me = New 64 23)

Me.btnSubmitTabIndex = 8

Me = 最终提交

'

btnSearch

'

MebtnSearchLocation = New gPoint144 48)

Me.btnSearchName = btnSearch

Me.btnSearchSize = New SystemDrawingSize(56, 23)

Meex = 7

MebtnSearchText = 查询"

'

txbId

'

MetxbIdLocation = New (64 50)

Me = txbId

Me = New gSize64, 21)

MetxbIdTabIndex = 6

Me.txbIdText = ""

'

txbName

Me.on = New gPoint201, 19)

MetxbNameName = "txbName"

MetxbNameSize = New System64 21)

Me.ex = 5

Me. = "

'Label5

Meon = New gPoint144 24)

- 36 -

Me. = Label5"

Me = New (56 16)

MeLabel5TabIndex = 3

Me.Label5Text = 课程名称

Label4

Me.on = New System8, 56

Me. = "Label4"

Me. = New gSize56, 16

Meex = 2

MeLabel4Text = 课程编号"

'Label3

'

Me.Label3Location = New gPoint8 24

MeLabel3Name = "Label3

Me = New 56, 16)

Meex = 1

Me = 课程拼音"

Label2

'

Me.Label2Location = New SystemDrawingPoint288, 16)

Me.Label2Name = "Label2

Me. = New gSize(368, 64

Meex = 0

Me. = 这里选择一门课程,查询出该课程所有的学生,并输入成绩.

实际应用时不用选择课程,而是根据登陆系统的的老师的编号,自动列出该老师所有课程,

老师只能对自己的课程进行成绩" & _

"的输入的操作;最终提交是老师提交的成绩,提交后的成绩将不可以修改。"

'txbPY

Me.on = New System64 19)

Me.txbPYName = "txbPY"

MetxbPYSize = New gSize(64, 21

Me.txbPYTabIndex = 4

Me.txbPYText = ""

GroupBox3

Me.GroupBox3(Me.btnUpdate

Me.lsAdd(Me.Label6

- 37 -

MeGroupBox3ControlsAdd(Me.txbScore)

Me.(Me.dgdList)

Me = sForms

Me.GroupBox3Location = New SystemDrawingPoint0, 176)

Me.GroupBox3Name = GroupBox3

Me. = New gSize(664, 149

Me.ex = 2

Me.GroupBox3TabStop = Fal

Me. = 课程成绩输入"

'btnUpdate

MebtnUpdateLocation = New System(568 80)

Me = btnUpdate"

Me = New 64, 23

Me.btnUpdateTabIndex = 8

Me = 修改成绩

'

Label6

'

Meon = New 536 45)

MeLabel6Name = "Label6"

Me. = New SystemDrawingSize32 16)

MeLabel6TabIndex = 5

Me.Label6Text = 成绩"

'

'txbScore

MetxbScoreLocation = New System(568, 40

Me = "txbScore"

Me. = New System64 21

Meex = 6

Me.txbScoreText = ""

dgdList

'

Me = CType(((SystemWindowsFormsAnchorStylesTop Or

System) _

Or System

WindowsStyles

Me.dgdListCaptionVisible = Fal

Member = "

Me.ForeColor = glText

Me.dgdListLocation = New System8 16)

- 38 -

Me = dgdList"

Me. = New SystemDrawingSize(520 128)

Me.ex = 0

'frmScore

Me.AutoScaleBaSize = New 6, 14)

MeClientSize = New SystemDrawingSize664 325)

Me.ControlsAddMe.GroupBox3)

Me.ControlsAdd(Me.GroupBox2)

Me.ControlsAddMeGroupBox1)

MeIcon = CTyperesourcesGetObject, g

Icon)

MeName = frmScore

MeText = "成绩输入"

Me.GroupBox1ResumeLayout(Fal)

MeGroupBox2ResumeLayoutFal

MeGroupBox3ResumeLayout(Fal

CTypeMedgdList SystemrtInitializeEndInit

)

Me.ResumeLayoutFal)

End Sub

End Region

Private Sub btnClear_Click(ByVal nder As , _

ByVal e As SystemEventArgs Handles

Dim db As DataBa = New DataBa

OrInsSQL(exec sf_终止选课)

dbDispo()

End Sub

Private Sub SetDGDList()

Dim strSQL As String = "lect b.课程名称,a。学号,c.姓名,a.成绩,

strSQL += " a.编号,a。课程编号 from 成绩表as a 课程信息as b,

strSQL += 学生信息as c where a。课程编号=b.课程编号and a。学号"

strSQL += =c.学号and 是否已确定成绩= 'N' "

Dim strFilter As String = ""

If MetxbPYTextTrimLength 〈〉 0 Then

strFilter += and 拼音码like '" + + %"

End If

If Me.Length < 0 Then

strFilter += and a.学号like ' + Trim + %"

End If

If Me.txbName > 0 Then

strFilter += and c.姓名like ' + + "%"

End If

- 39 -

If = 0 Then

Exit Sub

El

strFilter += " order by b.课程名称,a.学号"

Dim db As DataBa = New DataBa

Dim dv As DataView = dbRunSelectSQL(strSQL + strFilter

elete = Fal

dvAllowEdit = Fal

dvAllowNew = Fal

dtData =

Meurce = dv

MedgdListAllowSorting = Fal

dbDispo()

End If

End Sub

Private Sub txbId_KeyDownByVal nder As Object _

ByVal e As SystemKeyEventArgs) Handles txbIdKeyDown

If eKeyCode = KeysEnter Then

SetDGDList()

End If

End Sub

Private Sub txbName_KeyDownByVal nder As Object ByVal e As System

KeyEventArgs) Handles n

If e = Then

SetDGDList)

End If

End Sub

Private Sub txbPY_KeyDownByVal nder As Object ByVal e As System

ntArgs) Handles txbPYKeyDown

If eKeyCode = KeysEnter Then

SetDGDList)

End If

End Sub

Private Sub btnUpdate_Click(ByVal nder As SystemObject, _

ByVal e As SystemEventArgs) Handles btnUpdateClick

Try

Dim score As Integer = CInt)

Catch ex As Exception

MessageBoxShow"成绩格式不正确!)

End Try

If ber 〈〉 -1 Then

Dim db As DataBa = New DataBa

Dim strSQL As String = update 成绩表t 成绩=

strSQL += Trim + " where 编号="

- 40 -

strSQL += dtDataRowsdgdList _

CurrentCellRowNumber)4)

OrInsSQLstrSQL

dbDispo()

SetDGDList)

End If

End Sub

Private Sub btnSubmit_ClickByVal nder As SystemObject _

ByVal e As rgs Handles btnSubmitClick

If dgdListber = 1 Then

Exit Sub

End If

Dim strSubject = dtDataRows( _

tCellRowNumber)(5)

Dim dlgResult As DialogResult = _

(提交后成绩不可以修改,是否确认提交?" _

"提示" MessageBoxButtonsYesNo)

If dlgResult = DialogResultYes Then

Dim strSQL As String = "exec sf_成绩提交" + strSubject

Dim db As DataBa = New DataBa

OrInsSQL(strSQL

dbDispo()

MessageBoxShow(提交成绩成功!)

SetDGDList()

End If

End Sub

Private Sub btnSearch_ClickByVal nder As SystemObject, _

ByVal e As SystemEventArgs Handles btnSearchClick

SetDGDList(

End Sub

End Class

7 报表统计

71 打印成绩单

运行结果如下:

详细代码设计:

Imports

Public Class frmPrint

Inherits SystemForm

Private dtPrint As DataTable

#Region " Windows 窗体设计器生成的代码

- 41 -

Public Sub New(

MyBa.New)

该调用是Windows 窗体设计器所必需的。

InitializeComponent(

InitializeComponent() 调用之后添加任何初始化

End Sub

窗体重写dispo 以清理组件列表。

Protected Overloads Overrides Sub Dispo(ByVal disposing As Boolean

If disposing Then

If Not (components Is Nothing Then

componentsDispo)

End If

End If

MyBa.Dispodisposing)

End Sub

'Windows 窗体设计器所必需的

Private components As SystemComponentModelIContainer

注意: 以下过程是Windows 窗体设计器所必需的

可以使用Windows 窗体设计器修改此过程。

不要使用代码编辑器修改它。

Friend WithEvents CrystalReportViewer1 As

CrystalReportViewer

DebuggerStepThrough) Private Sub InitializeComponent

()

Dim resources As ceManager = New System

ceManager(GetTypefrmPrint))

MeCrystalReportViewer1 = New CrystalDecisions

lReportViewer

Me.SuspendLayout)

'

'CrystalReportViewer1

MeCrystalReportViewer1ActiveViewIndex = -1

Me = SystemyleFill

Meon = New gPoint(0 0)

Me = CrystalReportViewer1

Me.Source = Nothing

Me.CrystalReportViewer1Size = New SystemDrawingSize(552 293

MeCrystalReportViewer1TabIndex = 0

'frmPrint

MeAutoScaleBaSize = New gSize6, 14

Me.ClientSize = New System(552, 293

- 42 -

MeControlsAdd(Me.CrystalReportViewer1

MeIcon = CType(resourcesGetObject$thisIcon

MeName = frmPrint

MeText = Print Preview"

Me.ResumeLayoutFal

End Sub

End Region

Sub NewByRef dt As DataTable)

MyBa.New(

'该调用是Windows 窗体设计器所必需的.

InitializeComponent()

'InitializeComponent() 调用之后添加任何初始化

dtPrint = dt

End Sub

Private Sub frmPrint_Load(ByVal nder As Object, _

ByVal e As SystemEventArgs Handles MyBaLoad

Try

Dim obj As ReportDocument = New ReportDocument

'obj加载Crystal Report的路径要设置好

("")

'设置报表的数据源

Dim ds As DataSet = New DataSet

dsTablesAdd(dtPrint)

aSourcedtPrint

Me.Source = obj

Catch ex As Exception

(exToString

End Try

End Sub

End Class

- 43 -

姓氏英语-食品管理制度

教务管理系统(概要设计及详细设计)

本文发布于:2023-05-26 03:04:58,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/zhishi/a/168504149954462.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:教务管理系统(概要设计及详细设计).doc

本文 PDF 下载地址:教务管理系统(概要设计及详细设计).pdf

相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 实用文体写作网旗下知识大全大全栏目是一个全百科类宝库! 优秀范文|法律文书|专利查询|