有了班级课程表的设计成功,教师课程表就显得容易多了。我们依然把课程表导入到EXCEL中,基于界面风格的统一,与班级课表查询相似。下面是教师课表查询界面:
图5-5 教师课表查询界面
Chart 5-5 Interface of inquire teacher table
通过以上界面可以查询具体教师一学期的课程安排情况,其中生成的课表信息包括所教课程和班级,上课具体时间,教室。使教师一目了然,方便地查询到自己所教班级、课程。准确无误地反映在课表上。
若图片无法显示请联系QQ752018766,本论文免费,转发请注明源于www.751com.cn
图5-6 教师课程表界面
Chart 5-6 Interface of teacher table
以下是主要代码:
Private Sub Command1_Click()
Dim a As String
Dim i As Integer, j As Integer
Dim strCourseID As String
Dim strClassRoomID As String
Dim strclasssql As String
Dim strClassID As String
strsql = "SELECT * FROM bTempTableA where teacherid= " & Text1.Text & " order by ttime"
strtempsql = "SELECT courseID,courseName FROM bCourse"
strclassroomsql = "SELECT ClassRoomID,ClassRoomName FROM bclassroom"
strclasssql = "select classID,classname from bclass"
ConenctToDatabase
rst.Open strsql, db, adOpenKeyset, adLockOptimistic
coursetemprst.Open strtempsql, db, adOpenKeyset, adLockReadOnly
classtemprst.Open strclasssql, db, adOpenKeyset, adLockReadOnly
classroomrst.Open strclassroomsql, db, adOpenDynamic, adLockReadOnly
If rst.RecordCount() <> 0 Then
i = rst.RecordCount()
Else
MsgBox "无此信息,请重新输入!"
rst.Close
coursetemprst.Close
classtemprst.Close
classroomrst.Close
Exit Sub
End If
Set xlapp = New Excel.Application
Set xlbook = xlapp.Workbooks.Open(App.Path & "\课程表模板.xlt")
xlapp.Visible = True
Set xlsheet = xlbook.Worksheets("教师课程表")
xlsheet.Activate
xlsheet.Cells(5, 1) = DataGrid1.Columns(1).Text
xlsheet.Cells(5, 6) = Date
While i <> 0
strCourseID = rst.Fields("courseID")
coursetemprst.Filter = "courseID = '" & strCourseID & "'"
strClassRoomID = rst.Fields("classroomID")
classroomrst.Filter = "classroomID = '" & strClassRoomID & "'"
strClassID = rst.Fields("classID")
classtemprst.Filter = "classID = '" & strClassID & "'"
Select Case rst.Fields("Ttime")
Case Is = 1
xlsheet.Cells(9, 3) = coursetemprst.Fields("coursename")
xlsheet.Cells(10, 3) = classroomrst.Fields("classroomName")
xlsheet.Cells(12, 3) = classtemprst.Fields("classname")
Case Is = 2
xlsheet.Cells(13, 3) = coursetemprst.Fields("coursename")
xlsheet.Cells(14, 3) = classroomrst.Fields("classroomName")
xlsheet.Cells(16, 3) = classtemprst.Fields("classname")
Case Is = 3
xlsheet.Cells(17, 3) = coursetemprst.Fields("coursename")
xlsheet.Cells(18, 3) = classroomrst.Fields("classroomName")
xlsheet.Cells(20, 3) = classtemprst.Fields("classname")
Case Is = 4
xlsheet.Cells(21, 3) = coursetemprst.Fields("coursename")
xlsheet.Cells(22, 3) = classroomrst.Fields("classroomName")
xlsheet.Cells(24, 3) = classtemprst.Fields("classname")
Case Is = 5
xlsheet.Cells(9, 4) = coursetemprst.Fields("coursename")
xlsheet.Cells(10, 4) = classroomrst.Fields("classroomName")
xlsheet.Cells(12, 4) = classtemprst.Fields("classname")
Case Is = 6
xlsheet.Cells(13, 4) = coursetemprst.Fields("coursename")
xlsheet.Cells(14, 4) = classroomrst.Fields("classroomName")
xlsheet.Cells(16, 4) = classtemprst.Fields("classname")
Case Is = 7
xlsheet.Cells(17, 4) = coursetemprst.Fields("coursename")
xlsheet.Cells(18, 4) = classroomrst.Fields("classroomName")
xlsheet.Cells(20, 4) = classtemprst.Fields("classname")
Case Is = 8
xlsheet.Cells(21, 4) = coursetemprst.Fields("coursename")
xlsheet.Cells(22, 4) = classroomrst.Fields("classroomName")
xlsheet.Cells(24, 4) = classtemprst.Fields("classname")
Case Is = 9
xlsheet.Cells(9, 5) = coursetemprst.Fields("coursename")
xlsheet.Cells(10, 5) = classroomrst.Fields("classroomName")
xlsheet.Cells(12, 5) = classtemprst.Fields("classname")
Case Is = 10
xlsheet.Cells(13, 5) = coursetemprst.Fields("coursename")
xlsheet.Cells(14, 5) = classroomrst.Fields("classroomName")
xlsheet.Cells(16, 5) = classtemprst.Fields("classname")
Case Is = 11
xlsheet.Cells(17, 5) = coursetemprst.Fields("coursename")
xlsheet.Cells(18, 5) = classroomrst.Fields("classroomName")
xlsheet.Cells(20, 5) = classtemprst.Fields("classname")
Case Is = 12
xlsheet.Cells(21, 5) = coursetemprst.Fields("coursename")
xlsheet.Cells(22, 5) = classroomrst.Fields("classroomName")
xlsheet.Cells(24, 5) = classtemprst.Fields("classname")
Case Is = 13
xlsheet.Cells(9, 6) = coursetemprst.Fields("coursename")
xlsheet.Cells(10, 6) = classroomrst.Fields("classroomName")
xlsheet.Cells(12, 6) = classtemprst.Fields("classname")
Case Is = 14
xlsheet.Cells(13, 6) = coursetemprst.Fields("coursename")
xlsheet.Cells(14, 6) = classroomrst.Fields("classroomName")
xlsheet.Cells(16, 6) = classtemprst.Fields("classname")
Case Is = 15
xlsheet.Cells(17, 6) = coursetemprst.Fields("coursename")
xlsheet.Cells(18, 6) = classroomrst.Fields("classroomName")
xlsheet.Cells(20, 6) = classtemprst.Fields("classname")
Case Is = 16
xlsheet.Cells(21, 6) = coursetemprst.Fields("coursename")
xlsheet.Cells(22, 6) = classroomrst.Fields("classroomName")
xlsheet.Cells(24, 6) = classtemprst.Fields("classname")
Case Is = 17
xlsheet.Cells(9, 7) = coursetemprst.Fields("coursename")
xlsheet.Cells(10, 7) = classroomrst.Fields("classroomName")
xlsheet.Cells(12, 7) = classtemprst.Fields("classname")
Case Is = 18
xlsheet.Cells(13, 7) = coursetemprst.Fields("coursename")
xlsheet.Cells(14, 7) = classroomrst.Fields("classroomName")
xlsheet.Cells(16, 7) = classtemprst.Fields("classname")
Case Is = 19
xlsheet.Cells(17, 7) = coursetemprst.Fields("coursename")
xlsheet.Cells(18, 7) = classroomrst.Fields("classroomName")
xlsheet.Cells(20, 7) = classtemprst.Fields("classname")
Case Is = 20
xlsheet.Cells(21, 7) = coursetemprst.Fields("coursename")
xlsheet.Cells(22, 7) = classroomrst.Fields("classroomName")
xlsheet.Cells(24, 7) = classtemprst.Fields("classname")
Case Is = 21
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>