<<排课管理系统>>
院系______ 专业______ 班级______ 姓名______
日期 年 月 日
目 录
摘 要 I ABSTRACT II 第一章 引言 1 1.1 背景 1
1.1.1教师管理系统 1
1.2开发教师管理系统的目的和原则 3 1.3开发环境介绍 3 1.3.1 开发平台 4
1.3.2数据库设计工具——ACCESS数据库管理系统 7 第二章 系统设计 9 2.1 系统分析 9
2.2 系统流程和操作方式设计 11 第三章 系统界面设计 12 3.1系统界面设计以及代码分析 12 第四章 数据库的设计 30 4.1数据库设计 30
4.2 数据库概念和发展 30 4.3系统测试与评价 38
总 结 39 致 谢 40 参考文献 41
摘 要
20世纪以来,社会生产力迅速发展,科学技术突飞猛进,人们进行信息交流的深度与广度不断增加,信息量急剧增长,传统的信息处理与决策的手段已不能适应社会的需要,信息的重要性和信息处理问题的紧迫性空前提高了,面对着日益复杂和不断发展,变化的社会环境,特别是企业间日趋剧烈的竞争形势,一个人、一个企业要在现代社会中求生存,求发展,必须具备足够的信息和强有力的信息收集与处理手段。
对于一个学校来说,大量教师课程安排难于通过传统的方法进行管理;这就迫切需要利用计算机技术来帮助学校管理者来处理教师课程安排的日常管理,合理安排课程,防止课程冲突.排课管理系统可以很好的解决以上问题.排课管理系统是管理信息系统的一个典型用例.
管理信息系统是一个集信息技术、经济管理理论、统计学与运筹学、数据库技术为一体的综合性系统,是一个资金
技术密集型、劳动密集型、智力密集型的项目。我国拥有广阔的市场和丰富的人才资源,有几十年的技术积累和经验积累,有一定的后发优势。管理信息系统的创新工作既不能妄自菲薄,更不能夜郎自大。要抓住当前网络经济兴起的有利时机,以实现我国信息技术和信息产业的跨越式发展,更好地发挥信息产业对国民经济增长的拉动作用。
开发学校排课管理系统的过程就是要实现数据处理方式由人工管理向计算机管理的转变,它在计算机技术和教师管理实践活动两者之间架设桥梁。
关键字:排课管理,管理信息系统,数据库,计算机管理
ABSTRACT
Since the 20th century, the rapid development of social productive forces, science and technology, exchange of information is the depth and scope of increasing the volume of information rapid growth, the traditional information processing and decision-making tools have not the needs of the community, the importance of information and information
processing problems urgency unprecedented increase, in the face of increasingly complex and evolving. changes in the social environment, in particular the increasingly keen competition among enterprises situation, a person or an enterprise to survive in modern society, and development, we must have sufficient information and powerful information gathering and processing tools.
For a school, a large number of teachers through the curriculum to the traditional methods of management; This urgent need for using computer technology to help school managers to handle the day-to-teacher curriculum management, rationalize courses conflict prevention courses. feeling good management system can solve the above problems. urethra management system is a typical use of management information systems cases.
Management Information System is a collection of information technology, economic management theory, statistics and research, database integration technology for the integrated system is a capital-and technology-intensive and labor-intensive, intellectual-intensive projects. China has a vast market and abundant human resources, technical accumulation and decades of accumulated experience, a certain advantages. Mis innovation can not sell, not self-assertive. We should seize the current favorable opportunity to network economy, China's information technology and to achieve a leap forward of the information
industry, give better play to the information industry to stimulate economic growth.
School comes to the process of management development is to achieve data management approach to computer management by artificial changes in computer technology and management practices between teachers build bridges.
keyword: feeling management, management information systems, databases, computer management
第一章 引言
对于一个学校来说,大量教师课程安排难于通过传统的方法进行管理;这就迫切需要利用计算机技术来帮助学校管理者来处理教师课程安排的日常管理,合理安排课程,防止课程冲突.排课管理系统可以很好的解决以上问题.排课管理系统是管理信息系统的一个典型用例. 1.1背景
1.1.1排课管理系统
如今随着教育事业的发展,学校对教师课程安排的复杂度的增加,
一个单位,各个学科每天的课程安排以及教室资源的分配,排课工资等信息量将迅速的增加,传统的手工的处理方式已经跟不上信息爆炸般的扩增.所以开发一种可靠,高效的教师排课管理系统是很有必要的.
1.2 开发排课管理系统的目的与原则
排课管理系统的主要目的是服务与中小学,各高校的管理者,方便其管理本校排课信息的软件系统.其原则是做到,界面友好人性,操作简单,可靠.
1.3开发环境介绍
1.3.1开发平台
本教师管理系统的开发平台为微软windows xp visual basic 6.0 以及微软的Access作为操作数据库.
1.3.2 数据库设计工具——ACCESS数据库管理系统
Microsoft Access介绍:
使用 Microsoft Access,可以在单一的数据库文件中管理所有的信息。在这个文件中,用户可以将自己的数据分别保存在各自独立的存储空间中,这些空间称作表;可以使用联机窗体来查看、添加及更新表中的数据;使用查询来查找并检索所要的数据;也可以使用报表以特定的版面布置来分析及打印数据。
如果要保存数据,请为每一种类型的信息创建一个表。如果要从查询、窗体或报表中的多个表中将数据合并在一起,就要定义各个表之间的关系。 如果要搜索并检索符合指定条件的数据,包括来自多个表中的数据,就要创建查询。查询的同时也可以更新或删除多条记录,并对数据执行内嵌或自定义的计算。
如果要简单地直接在某个表中查看、输入及更改数据,请创建一个窗体。
在打开一个窗体时,Microsoft Access 将从一个或多个表中检索数据,并使用用户在“窗体向导”选择的版面布局或所创建的版面布局,将窗体显示在屏幕上。
如果要分析数据或将数据以特定的方式打印出来,请创建一个报表。例如,可以打印一份将数据分组并计算数据总和的报表,也可以打印另一份带有各种数据格式的打印邮件标签的报表。
第二章 系统设计
2.1系统分析
本排课管理系统主要由以下几大模块构成.
一.教职员入库信息. 二.排课管理 三.教职员带课查询 四.本学期课程设置 五.打印课程表 六.打印教师代课表
2.2 系统流程和操作方式设计
系统登陆 主界面 教职员工入库信排课管理 教职员工带课查本学期课程安排 打印课程表 打印教师带课表
第三章 系统界面设计
3.1系统界面设计 1.登陆界面
代码分析: Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click() 'set the global var to false 'to denote a failed login LoginSucceeded = False Unload fmStart End Sub
Private Sub cmdOK_Click() 'check for correct password If txtPassword = \"password\" Then 'place code to here to pass the 'success to the calling sub 'setting a global var is the easiest LoginSucceeded = True Me.Hide fmStart.Show Else
MsgBox \"Invalid Password, try again!\ txtPassword.SetFocus SendKeys \"{Home}+{End}\" End If
End Sub
Private Sub Form_Load() Load fmStart fmStart.Hide End Sub
2. 教职员入库信息界面:
代码分析:
Dim con As ADODB.Connection Dim rs As ADODB.Recordset Dim qrs As ADODB.Recordset
Dim slSql As String Dim i, j As Integer Dim strBak(2) As String Dim sqlStr As String
Private Sub Command1_Click(Index As Integer) On Error GoTo Err: Dim cn As Integer For cn = 0 To 2 Text1(cn).Text = \"\" Next cn
If rs.RecordCount > 0 Then Select Case Index Case 0:
rs.MoveFirst Case 1:
rs.MovePrevious
Command1(2).Enabled = True
Command1(3).Enabled = True Case 2:
rs.MoveNext
Command1(0).Enabled = True Command1(1).Enabled = True Case 3:
rs.MoveLast End Select displayInfo End If GoTo ok: Err:
Call dataOver ok: End Sub
Private Sub dataOver() If rs.BOF Then
Command1(0).Enabled = False Command1(1).Enabled = False
Command1(2).Enabled = True Command1(3).Enabled = True rs.MoveFirst Else
If rs.EOF Then rs.MoveLast
Command1(0).Enabled = True Command1(1).Enabled = True Command1(2).Enabled = False Command1(3).Enabled = False Else
MsgBox \"Database Error\unknown\" End If End If End Sub
Private Sub Command2_Click(Index As Integer) On Error GoTo errDeal If Index = 0 Or Index = 2 Then CanSave (True) Else
CanSave (False) End If
Select Case Index Case 0: rs.AddNew Call toNull Case 1:
j = MsgBox(\"你确定要删除本记录吗?\+ vbQuestion, \"删除\")
If j = vbYes Then rs.Delete Call toNull End If Case 2:
rs.Delete rs.AddNew Case 3:
If Len(LTrim$(RTrim$(Text1(0).Text))) > 0 Then 'rs.AddNew For i = 0 To 2
If Len(LTrim$(RTrim$(Text1(i).Text))) > 0 Then
rs.Fields(i) = Text1(i).Text End If Next i rs.Update Else
MsgBox \"姓名不得为空\vbOKOnly + vbExclamation, \"Error\" End If Case 4:
For i = 0 To 2
Text1(i).Text = strBak(i) Next i
Call Command2_Click(3) End Select Exit Sub errDeal:
MsgBox \"database Error\'okEnd: End Sub
Private Sub CanSave(ok As Boolean) Frame1.Enabled = Not ok Frame3.Enabled = ok
For i = 0 To 4 If i < 3 Then
Command2(i).Enabled = Not ok Else
Command2(i).Enabled = ok End If Next i
End Sub
Private Sub Form_Load() Dim cnt As Integer
Set con = New ADODB.Connection Set rs = New ADODB.Recordset Set qrs = New ADODB.Recordset
'\"Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\\WINDOWS\\Desktop\\dataUse.mdb\"
con.Open \"provider=Microsoft.Jet.OLEDB.4.0; data source= \" & App.Path & \"\\dataUse.mdb\"
rs.Open \"select * from teacher\If rs.RecordCount > 0 Then rs.MoveFirst displayInfo CanSave (False) Else
'new data CanSave (True)
Call Command2_Click(0)
End If End Sub
Private Sub displayInfo() i = j = 0 For i = 0 To 2 'Text1(i).Text = \"\"
If Len(rs.Fields(i)) > 0 Then
Text1(i).Text = rs.Fields(i)
strBak(i) = Text1(i).Text End If Next i End Sub
Private Sub toNull() For i = 0 To 2 Text1(i).Text = \"\" strBak(i) = \"\"
Next i End Sub
Private Sub Form_Unload(Cancel As Integer) On Error GoTo KK rs.Close Set rs = Nothing qrs.Close Set qrs = noting con.Close Set con = Nothing KK: End Sub
Private Sub queryComm_Click()
slSql = \"select * from Teacher where cTrname = '\" + Text1(3).Text + \"'\"
qrs.Open slSql, con, adOpenStatic
If Not qrs.EOF Then qrs.MoveFirst i = j = 0 For i = 0 To 2 'Text1(i).Text = \"\"
If Len(qrs.Fields(i)) > 0 Then
Text1(i).Text = qrs.Fields(i)
strBak(i) = Text1(i).Text End If Next i End If qrs.Close End Sub
3. 排课管理界面
代码分析:
Option Explicit
Dim conn As ADODB.Connection Dim rsTr As ADODB.Recordset Dim rsSj As ADODB.Recordset Dim i, j, sjCnt As Integer Dim ClassCode As String
Dim TrChanged, ClassChanged As Boolean Dim strSql As String
Dim rsTrAry As ADODB.Recordset Dim rsClassAry As ADODB.Recordset Dim StrTr(9) As String Dim strSj(49) As String
Dim minht, maxHt As Integer
Private Sub EnableSave(ok As Boolean) Dim k As Integer For k = 0 To 3 If k < 2 Then
cb(k).Enabled = Not ok Else
cb(k).Enabled = ok End If Next k
Frame7.Enabled = Not ok Frame2.Enabled = ok Frame3.Enabled = ok
End Sub
Private Sub cb_Click(Index As Integer) Me.MousePointer = 11
On Error GoTo errDeal Select Case Index Case 0:
ClassCode = Trim(Combo1(0).Text) & \".\" & Trim(Combo1(1).Text) If Len(Trim(Combo1(0).Text)) > 0 And Len(ClassCode) > 1 Then Call displayInfo
cb(1).Enabled = True End If Case 1:
cb_Click (0)
EnableSave (True) cb(1).Enabled = False Case 2:
If TrChanged Then
strSql = \"delete * from trclass where cclasscode='\" & ClassCode & \"'\" conn.Execute strSql
Dim strTrName As String For i = 0 To sjCnt - 1
strTrName = Trim(Combo2(i).Text) If Len(strTrName) > 0 Then
strSql = \"insert into trclass values('\" & ClassCode & \"' ,\" + \"'\" + Trim(Label2(i).Caption) + \"' ,\" + \"'\" + Trim(Combo2(i).Text) + \"' )\" 'me.caption = strSql conn.Execute strSql End If Next i
TrChanged = False rsTrAry.Requery
cb(1).Enabled = False
End If
If ClassChanged Then
conn.Execute \"delete * from classarray where cclasscode='\" & ClassCode &
\"'\"
Dim X, Y As Integer
For i = 0 To 49
Y = i Mod 5 + 1 X = Int(i / 5) + 1
If Len(Trim(Combo3(i).Text)) > 0 Then
strSql = \"insert into classarray values('\" & ClassCode & \"' ,\" & Y & \ 'me.caption = strSql conn.Execute strSql End If Next i
ClassChanged = False rsClassAry.Requery End If
EnableSave (False) Case 3:
For i = 0 To sjCnt - 1
Combo2(i).Text = Combo2(i).Tag Next i
For i = 0 To 49
Combo3(i).Text = Combo3(i).Tag Next i
EnableSave (False) cb(1).Enabled = False
End Select
GoTo ok errDeal:
MsgBox \"Error Unknown\" ok:
Me.MousePointer = 0
End Sub
Private Sub displayInfo()
For j = 0 To sjCnt - 1
strSql = \"select cteacher from trclass where cclasscode='\" & ClassCode & \"' and csubject='\" & Trim(Label2(j).Caption) & \"'\" 'Text1.Text = strSql 'me.caption = strSql
Set rsTrAry = conn.Execute(strSql)
'Dim tpRs As ADODB.Recordset
'Set tpRs = conn.Execute(\"select cteacher from trclass where cclasscode='\" & ClassCode & \"' and csubject='\" & Trim(Label2(j).Caption) & \"'\") 'Text1.Text = \"####\" & strSql & \"####\" 'While Not tpRs.EOF
' Text1.Text = Text1.Text + tpRs.Fields(0) ' tpRs.MoveNext 'Wend
'这里用另一种方法创建 recordset
'rsTrAry.
If Not rsTrAry.EOF Then 'rsTrAry.MoveFirst
Combo2(j).Text = rsTrAry.Fields(0) 'rsTrAry!cteacher Combo2(j).Tag = rsTrAry.Fields(0) ' rsTrAry!cteacher 'EnableSave (False) Else
' MsgBox \"nodata\
Combo2(j).Text = \"\" Combo2(j).Tag = \"\" 'EnableSave (True)
'''''''''''''''''''''''''''这里语句可能出错 End If
Next j
For i = 0 To 49
Dim X, Y As Integer X = Int(i / 5 + 1)
Y = i Mod 5 + 1
strSql = \"select csjname from classarray where cclasscode='\" & ClassCode & \"' and itimew=\" & Y & \" and itimen=\" & X 'me.caption = strSql
' rsClassAry.Open strSql, conn, adOpenStatic, adLockOptimistic Set rsClassAry = conn.Execute(strSql)
If Not rsClassAry.EOF Then
Combo3(i).Text = rsClassAry.Fields(0) Combo3(i).Tag = rsClassAry.Fields(0) 'EnableSave (False) Else
Combo3(i).Text = \"\" Combo3(i).Tag = \"\" 'EnableSave (True) End If Next i
End Sub
Private Function Trim(str As String) As String Trim = LTrim$(RTrim$(str))
End Function
Private Sub Combo2_Change(Index As Integer) TrChanged = True
End Sub
Private Sub Combo3_Change(Index As Integer) ClassChanged = True End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load() Me.MousePointer = 11
Set conn = New ADODB.Connection Set rsTr = New ADODB.Recordset Set rsSj = New ADODB.Recordset Set rsTrAry = New ADODB.Recordset Set rsClassAry = New ADODB.Recordset
'\"Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\\WINDOWS\\Desktop\\dataUse.mdb\"
conn.Open \"provider=Microsoft.Jet.OLEDB.4.0; data source= \" & App.Path & \"\\dataUse.mdb\"
rsTr.Open \"select * from teacher\rsSj.Open \"select * from subject\minht = 4090 maxHt = 9000
sjCnt = rsSj.RecordCount Call comboInit
EnableSave (False) cb(1).Enabled = False 'Command1.Tag = \"<<\"
Me.Height = minht
Me.MousePointer = 0
End Sub
Private Sub comboInit() rsSj.MoveFirst
Dim trCnt As Integer trCnt = rsTr.RecordCount rsTr.MoveFirst
Combo1(0).Text = \"\" Combo1(1).Text = \"\"
For i = 1 To 12
Combo1(0).AddItem (i) Next i
For i = 1 To 20
Combo1(1).AddItem (i) Next i
For i = 0 To 9
Combo2(i).Text = \"\"
If i < sjCnt Then
Label2(i).Caption = rsSj!csjname
rsSj.MoveNext Else
Label2(i).Visible = False Combo2(i).Visible = False End If
Label3(i).Caption = i + 1
Next i
For i = 0 To sjCnt - 1
If i > 0 Then
For j = 0 To trCnt - 1
'the last modified here....................
Combo2(i).List(j) = Combo2(0).List(j) Next j Else
rsTr.MoveFirst
While Not rsTr.EOF
Combo2(i).AddItem (rsTr.Fields(0)) rsTr.MoveNext Wend End If Next i
For i = 0 To 49
Combo3(i).Text = \"\"
For j = 0 To sjCnt - 1
Combo3(i).AddItem (Label2(j).Caption) Next j Next i
End Sub
Private Sub Form_Resize()
Frame3.Top = Me.Height - Frame3.Height - 520 End Sub
Private Sub Form_Unload(Cancel As Integer) On Error GoTo Err: rsTr.Close rsSj.Close rsTrAry.Close rsClassAry.Close Set rsTr = Nothing Set rsSj = Nothing Set rsTrAry = Nothing Set rsClassAry = Nothing conn.Close
Set conn = Nothing Err:
End Sub
Private Sub Timer1_Timer()
If Command1.Caption = \">>\" Then If Me.Height < maxHt Then
Me.Height = Me.Height + 150 Else
Timer1.Enabled = False Command1.Caption = \"<<\"
Command1.ToolTipText = \"收起课程表!\" Me.Height = maxHt Timer2.Enabled = False
Command1.BackColor = RGB(255, 255, 255) Shape2.BackColor = RGB(0, 100, 200) End If Else
If Me.Height > minht Then
Me.Height = Me.Height - 150 Else
Timer1.Enabled = False
Command1.Caption = \">>\"
Command1.ToolTipText = \"课程表在这里!\" Me.Height = minht Timer2.Enabled = True End If End If End Sub
Private Sub Timer2_Timer() Static r, g, b As Integer 'r = 100 'g = 50 'b = 20
Command1.BackColor = RGB(r, g, b)
Shape2.BackColor = RGB(255 - r, 255 - g, 255 - b)
r = r + 15 g = g + 39 b = b + 87 If r > 255 Then r = 0 End If
If g > 255 Then g = 0 End If
If b > 255 Then b = 0 End If
End Sub
4. 教职员带课查询 界面设计:
代码分析:
Option Explicit
Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim rsTr As ADODB.Recordset Dim i, j, value, idx As Integer Dim strName, strSql As String
Private Type DataGet class As String
Sjname As String
Tw As Integer Tn As Integer End Type
Private Sub Command1_Click() On Error GoTo bnEnd Me.MousePointer = 11
Dim sSql As String Dim dgUse As DataGet
'Select Case Index 'Case 0:
Call ClearCombo
strName = LTrim$(RTrim$(Combo1.Text)) If Len(strName) > 0 Then
sSql = strSql & \"'\" & strName & \"'\"
Set rs = conn.Execute(sSql)
If Not rs.EOF Then
While Not rs.EOF
dgUse.class = rs.Fields(0) dgUse.Sjname = rs.Fields(1) dgUse.Tw = rs.Fields(2) dgUse.Tn = rs.Fields(3)
idx = (dgUse.Tn - 1) * 5 + dgUse.Tw - 1 Combo3(idx).Visible = True
Combo3(idx).AddItem (dgUse.class & \"班\") Combo3(idx).AddItem (dgUse.Sjname)
Combo3(idx).Text = Combo3(idx).List(value)
rs.MoveNext Wend Else
MsgBox \"没有得到相关数据,请检查\vbOKOnly + vbInformation, \"数据捕捉\" End If
Dim lcnt As Integer
For lcnt = 0 To 49
If Combo3(lcnt).ListCount > 2 Then
Combo3(lcnt).BackColor = RGB(200, 255, 255) Combo3(lcnt).AddItem (\"注意有重课\") End If Next lcnt Else
MsgBox \"请输入或选择一教职员姓名\vbInformation + vbOKOnly, \"查询输入\" End If
'End Select bnEnd:
Me.MousePointer = 0
End Sub
Private Sub ClearCombo()
For i = 0 To 49
Combo3(i).BackColor = RGB(255, 255, 255)
Combo3(i).Text = \"\" Combo3(i).Visible = False Combo3(i).Clear Next i End Sub
Private Sub Form_Load() Me.MousePointer = 11
On Error GoTo KKa
Set conn = New ADODB.Connection
conn.Open \"provider=Microsoft.Jet.OLEDB.4.0; data App.Path & \"\\dataUse.mdb\"
Set rsTr = conn.Execute(\"select ctrname from teacher\") For i = 0 To 9
Label3(i).Caption = i + 1 Next i
source= \" & While Not rsTr.EOF
Combo1.AddItem (rsTr.Fields(0)) rsTr.MoveNext Wend
Call ClearCombo strSql
=
\"select
trclass.cclasscode,trclass.csubject,classarray.itimew,classarray.itimen\" + _ \" from teacher,trclass,classarray \" + _ \"where
teacher.ctrname=trclass.cteacher
and
trclass.cclasscode=classarray.cclasscode\" + _
\" and trclass.csubject=classarray.csjname and teacher.ctrname=\" 'select
trclass.cclasscode,trclass.csubject,classarray.itimew,classarray.itimen 'From teacher, trclass, classarray
'Where teacher.ctrname = trclass.cteacher And trclass.cclasscode = classarray.cclasscode
'and trclass.csubject=classarray.csjname 'and teacher.ctrname='陈'
'strSql
=
\"select
teacher.ctrname,trclass.cclasscode,classarray.itimew,classarray.itimen\" + _
\" from teacher join trclass on teacher.ctrname=trclass.cteacher join classarray\" + _
\" on trclass.cclasscode=classarray.classcode where teacher.ctrname=\" value = 0 GoTo ok KKa:
MsgBox \"Error Unknown\" ok:
Me.MousePointer = 0 End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error GoTo KK: rs.Close
rsTr.Close Set rs = Nothing Set rsTr = Nothing conn.Close Set conn = Nothing KK: End Sub
Private Sub Opn_Click(Index As Integer) value = Index Call Command1_Click End Sub
5. 本学期课程设置 界面设计:
代码分析:
Option Explicit
Dim con As ADODB.Connection Dim rs As ADODB.Recordset Dim str(9) As String
'Dim strSql As String
Private Sub cn_Click(Index As Integer) 'On Error GoTo ex: Dim lcnt As Integer Dim strTxt As String
Select Case Index Case 0:
CanSave (True)
Case 1:
con.Execute (\"delete * from subject\")
For lcnt = 0 To 9
strTxt = Trim$(LTrim$(Txt(lcnt).Text)) If Len(strTxt) > 0 Then rs.AddNew rs!csjname = strTxt rs.Update End If Next lcnt CanSave (False) Case 2:
For lcnt = 0 To 9 Txt(lcnt) = str(lcnt) Next lcnt CanSave (False) End Select
Exit Sub ex:
MsgBox \"database error\ End Sub
Private Sub Form_Load()
'strSql = \"insert into subject values( '\" Set con = New ADODB.Connection Set rs = New ADODB.Recordset
Call clearTxt CanSave (False)
con.Open \"provider=Microsoft.Jet.OLEDB.4.0; data source= \" App.Path & \"\\dataUse.mdb\"
rs.Open \"select * from subject\Call displayInfo End Sub
Private Sub CanSave(bSave As Boolean)
& Frame1.Enabled = bSave cn(1).Enabled = bSave cn(2).Enabled = bSave
cn(0).Enabled = Not bSave End Sub
Private Sub displayInfo() rs.MoveFirst Dim lcnt As Integer lcnt = 0
While (Not rs.EOF And lcnt < 10)
Txt(lcnt).Text = rs!csjname str(lcnt) = Txt(lcnt).Text
lcnt = lcnt + 1 rs.MoveNext Wend End Sub
Private Sub clearTxt() Dim lcnt As Integer For lcnt = 0 To 9 Txt(lcnt).Text = \"\" Next lcnt End Sub
Private Sub Form_Unload(Cancel As Integer) rs.Close con.Close Set rs = Nothing Set con = Nothing End Sub
6. 打印课程表 界面设计:
代码设计:
临时课表
Dim ctCon As ADODB.Connection Dim ctrs As ADODB.Recordset 'classArray表
Dim cacon As ADODB.Connection Dim cars As ADODB.Recordset Dim sqlStr As String Dim ClassCode As String Dim wStr(5) As String
Private Sub clearStr() For i = 1 To 5 wStr(i) = \" \" Next i End Sub
Private Sub Update_ct() '删除所有以前的记录
ctCon.Execute (\"delete * from tempCT\") '更新表
sqlStr = \"select * from classArray where cclasscode='\" & ClassCode & \"'\" & \" order by iTimeN\"
cacon.Execute sqlStr
cars.Open sqlStr, cacon, adOpenStatic, adLockOptimistic cars.MoveFirst Dim i As Integer i = 1 clearStr
While (Not cars.EOF)
While cars!iTimeN <> i '添加一条课程记录
strSql = \"insert into tempCT values(\" & i & \" ,\" + \"'\" + wStr(1) + \"' ,\" + \"'\" + wStr(2) + \"' ,\" + \"'\" + wStr(3) + \"' ,\" + \"'\" + wStr(4) + \"' ,\" + \"'\" + wStr(5) + \"' )\" ctCon.Execute strSql clearStr i = i + 1 Wend
wStr(cars!iTimeW) = cars!csjname cars.MoveNext Wend
'添加一条课程记录
strSql = \"insert into tempCT values(\" & i & \" ,\" + \"'\" + wStr(1) + \"' ,\" + \"'\" +
wStr(2) + \"' ,\" + \"'\" + wStr(3) + \"' ,\" + \"'\" + wStr(4) + \"' ,\" + \"'\" + wStr(5) + \"' )\" ctCon.Execute strSql clearStr While i < 10
'添加一条课程记录
strSql = \"insert into tempCT values(\" & i & \" ,\" + \"'\" + wStr(1) + \"' ,\" + \"'\" + wStr(2) + \"' ,\" + \"'\" + wStr(3) + \"' ,\" + \"'\" + wStr(4) + \"' ,\" + \"'\" + wStr(5) + \"' )\" ctCon.Execute strSql i = i + 1 Wend End Sub
Private Sub Command1_Click()
ClassCode = Trim(gradeCombox.Text) & \".\" & Trim(classCombox.Text) Call Update_ct Unload Me classRep.Show End Sub
Private Sub Form_Load() For i = 1 To 12
gradeCombox.AddItem (i) Next i
For i = 1 To 20
classCombox.AddItem (i) Next i
Set cacon = New ADODB.Connection Set cars = New ADODB.Recordset
cacon.Open \"provider=Microsoft.Jet.OLEDB.4.0; data source= \" & App.Path & \"\\dataUse.mdb\"
Set ctCon = New ADODB.Connection Set ctrs = New ADODB.Recordset
ctCon.Open \"provider=Microsoft.Jet.OLEDB.4.0; data source= \" & App.Path & \"\\dataUse.mdb\" End Sub
Private Sub Form_Unload(Cancel As Integer) cars.Close cacon.Close
Set cars = Nothing Set cacon = Nothing ctCon.Close
Set ctrs = Nothing Set ctCon = Nothing End Sub
7. 打印教师代课表 界面设计:
代码设计:
'临时教师代课表
Dim ttCon As ADODB.Connection Dim ttrs As ADODB.Recordset 'trClass表
Dim trcon As ADODB.Connection Dim trrs As ADODB.Recordset Dim sqlStr As String Dim trname As String Dim wStr(5) As String Dim clStr(5) As String
Private Sub clearStr() For i = 1 To 5 wStr(i) = \" \" clStr(i) = \" \" Next i End Sub
Private Sub Update_tt()
ttCon.Execute \"delete * from tempTT\"
strSql =
trclass.cclasscode,trclass.csubject,classarray.itimew,classarray.itimen\" + _
\"select
\" from teacher,trclass,classarray \" + _
\"where teacher.ctrname=trclass.cteacher and trclass.cclasscode=classarray.cclasscode\" + _
\" and trclass.csubject=classarray.csjname and teacher.ctrname=\" + \"'\" + trname + \"'\" _ + \" order by iTimeN\"
trcon.Execute strSql
trrs.Open strSql, trcon, adOpenStatic, adLockOptimistic trrs.MoveFirst Dim i As Integer i = 1 clearStr
While Not trrs.EOF
While trrs!iTimeN <> i
strSql = \"insert into tempTT values(\" & i & \" ,\" + \"'\" + wStr(1) + \"' ,\" + \"'\" + wStr(2) + \"' ,\" + \"'\" + wStr(3) + \"' ,\" + \"'\" + wStr(4) + \"' ,\" + \"'\" + wStr(5) + _ \"' ,'\" + clStr(1) + \"' ,\" + \"'\" + clStr(2) + \"' ,\" + \"'\" + clStr(3) + \"' ,\" + \"'\" + clStr(4) + \"' ,\" + \"'\" + clStr(5) + \"' )\" ttCon.Execute strSql clearStr i = i + 1 Wend
wStr(trrs!iTimeW) = trrs!csubject clStr(trrs!iTimeW) = trrs!cClassCode trrs.MoveNext Wend
strSql = \"insert into tempTT values(\" & i & \" ,\" + \"'\" + wStr(1) + \"' ,\" + \"'\" + wStr(2) + \"' ,\" + \"'\" + wStr(3) + \"' ,\" + \"'\" + wStr(4) + \"' ,\" + \"'\" + wStr(5) + _
\"' ,'\" + clStr(1) + \"' ,\" + \"'\" + clStr(2) + \"' ,\" + \"'\" + clStr(3) + \"' ,\" + \"'\" + clStr(4) + \"' ,\" + \"'\" + clStr(5) + \"' )\" ttCon.Execute strSql clearStr While i < 10 i = i + 1
strSql = \"insert into tempTT values(\" & i & \" ,\" + \"'\" + wStr(1) + \"' ,\" + \"'\" + wStr(2) + \"' ,\" + \"'\" + wStr(3) + \"' ,\" + \"'\" + wStr(4) + \"' ,\" + \"'\" + wStr(5) + _
\"' ,'\" + clStr(1) + \"' ,\" + \"'\" + clStr(2) + \"' ,\" + \"'\" + clStr(3) + \"' ,\" + \"'\" + clStr(4) + \"' ,\" + \"'\" + clStr(5) + \"' )\" ttCon.Execute strSql Wend End Sub
Private Sub Command1_Click()
trname = Trim(teacherCombox.Text)
Call Update_tt Unload Me TrRep.Show End Sub
Private Sub Form_Load()
Set ttCon = New ADODB.Connection Set ttrs = New ADODB.Recordset
ttCon.Open \"provider=Microsoft.Jet.OLEDB.4.0; data source= \" & App.Path & \"\\dataUse.mdb\"
Set trcon = New ADODB.Connection Set trrs = New ADODB.Recordset
trcon.Open \"provider=Microsoft.Jet.OLEDB.4.0; data source= \" & App.Path & \"\\dataUse.mdb\" End Sub
Private Sub Form_Unload(Cancel As Integer) 'ttrs.Close ttCon.Close
Set ttrs = Nothing Set ttCon = Nothing trcon.Close
Set trrs = Nothing Set trcon = Nothing End Sub
第四章 数据库的设计
4.1数据库设计
1.classarray信息表
2.teacher表:
3.tempct表:
4.班级表:
4.2 数据库概念和发展
关系数据库是目前各类数据库中最重要、最流行的数据库,他应用数学方法来处理数据库数据,是目前使用最广泛的数据库系统。20世纪70年代以后开发的数据库管理系统产品几乎都是基于关系的。在数据库发展的历史上,最重要的成就就是关系模型。
关系数据库系统与非关系数据库系统的区别是:关系系统只有“表“这一
种数据结构;而非关系数据库系统还有其他数据结构,对这些数据结构有其他的操作。
结构化查询语言SQL(Structured Query Language)是一种介于关系代数与关系演算之间的语言,其功能包括查询、操纵、定义和控制四个方面,是一个通用的、功能极强的关系数据库语言。目前已成为关系数据库的标准语言
4.3系统测试与评价
测试在软件开发过程中一直都是备受关注的,即使在传统的软件工程中,也有一个明确、独立的测试阶段。随着软件危机的频频出现以及人们对于软件本质的进一步认识,测试的地位得到了前所未有的提高。测试已经不仅仅局限于软件开发中的一个阶段,它已经开始贯穿于整个软件开发过程,人们已经开始认识到:测试开始的时间越早,测试执行的越频繁,所带来的整个软件开发成本的下降就会越多。Extreme Programming更是把测试推到了极限的位置,一切软件开发活动都要从首先编写测试代码开始。
总 结
排课管理系统是一个典型的信息管理系统,其主要通过软件工程方面的选择课题、需求分析、总体设计、选用工具、程序模块、系统测试等几个步骤来实现。开发本系统的过程中,首先要对排课信息管理进行系统调研,熟悉学校教师排课的程序、班级分配,课程安排管理的流程、步骤;其次在系统需求分析过程中,要透过现象看本质,敏锐观察到学校教师管理中存在的各种问题,
并在总体设计把握好对问题的分析、理解,进而解决问题;选用开发工具要选用自己最熟悉、应用较多的开发工具,本系统开发选用MS Visual Basic 6.0,其具有语言简单、功能强大、组件众多的优点。程序模块的编制中,重点把握系统内部完整性、功能性、实用性、便捷性,使其能够协调统一、运行无误。运行结果证明,本学校教师信息管理系统极大提高了工作效率,节省了人力和物力,最终满足学校管理、学校员工工作的需要,同时也成为现代化学校管理的标志
致 谢
我首先感谢我的指导老师吕老师,在他严格的要求下我懂得了开发软件要有一种极其认真负责的态度。无论做什么事都要大胆的去想去做,这样会有好的创意,才能更有作为。
在这里我还要感谢我们宿舍的其它5个同学。他们和我共同生活了四年,在生活和学习上给了我很大的帮助。
参考文献
1陈明 . 软件工程学教程 .科技出版社,2002
2 萨师煊,王珊 . 数据库系统概论 . 第三版 . 高等教育出版社,2000 3 飞思科技产品研发中心 . visual basic 6.0数据库应用开发 .电子工业出版社,2003
4 飞思科技产品研发中心 . visual basic 6.0开发者手册 . 电子工业出版社, 2002
5 申旻 . visual basic 6.0高手突破 . 清华大学出版社,2002,302 6 Steve Teixeira,Xaviver Pacheco著,龙劲松,王瑜,谢尚书译 . visual basic 6.0开发人员指南 . 机械工业出版社 .2003
7 乔林 .参透Delphi/Kylix . 中国铁道出版社 .2003
8 李维 .Inside 深入核心 VCL 架构剖析 . 电子工业出版社 .2004 9 张立科编写组 .Windows API 函数参考手册 .人民邮电出版社 .2002 严蔚敏,吴伟民 .数据结构 .第二版 .清华大学出版社 .2001 10 王珍玲 。实用软件工程教程 高等教育出版社 2004 11 (英)Ian Sommerville 机械工业出版社 2003
12 美Cantu,U. 王辉等译visual basic 6.0 从入门到精通 电子工业出版社 2003
13 李维 面向对象开发实践之路(visual basic 6.0版)(BORLAND资深顾问著名visual basic 6.0专家李维最新力作) 电子工业出版社 2005.4
14 秦斌 等 visual basic 6.0数据库系统开发与应用 中国水利水电出版社 2006 .1
15 刘艺 visual basic 6.0面向对象编程思想 机械工业出版社 2003 16.visual basic 程序设计第二版 谭浩强 清华大学出版社 2003 17. visual basic6.0 程序设计教程. 胡同森 赵剑锋等. 浙江科学技术出版社,2002.1
18.软件工程学教程 (第二版) 周苏 王文 著 科学出版社 2003
19.Visual Basic 6.0 程序设计与开发技术 求是科技 人民邮电出版社 2004.9
因篇幅问题不能全部显示,请点此查看更多更全内容