📄 frmarrange.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmArrange
BorderStyle = 1 'Fixed Single
Caption = "上机安排"
ClientHeight = 6810
ClientLeft = 45
ClientTop = 330
ClientWidth = 6735
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 6810
ScaleWidth = 6735
Begin MSFlexGridLib.MSFlexGrid grdArrangeList
Height = 3015
Left = 480
TabIndex = 22
Top = 3480
Width = 5655
_ExtentX = 9975
_ExtentY = 5318
_Version = 393216
FixedCols = 0
SelectionMode = 1
AllowUserResizing= 3
End
Begin VB.CommandButton cmdModi
Caption = "修改"
Height = 375
Left = 2040
TabIndex = 10
Top = 2880
Width = 1095
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 5040
TabIndex = 9
Top = 2880
Width = 1095
End
Begin VB.CommandButton cmdAdd
Caption = "添加"
Height = 375
Left = 480
TabIndex = 7
Top = 2880
Width = 1095
End
Begin VB.CommandButton cmdSearch
Caption = "查询"
Height = 375
Left = 3600
TabIndex = 6
Top = 2880
Width = 1095
End
Begin VB.Frame Frame1
Height = 2535
Left = 480
TabIndex = 0
Top = 120
Width = 5655
Begin VB.TextBox txtID
Appearance = 0 'Flat
Height = 375
Left = 3960
TabIndex = 24
Top = 120
Visible = 0 'False
Width = 1575
End
Begin VB.TextBox txtEndDate
Appearance = 0 'Flat
Height = 375
Left = 1920
Locked = -1 'True
MaxLength = 50
TabIndex = 23
Top = 1800
Width = 1215
End
Begin VB.TextBox txtStartDate
Appearance = 0 'Flat
Height = 375
Left = 1920
Locked = -1 'True
MaxLength = 50
TabIndex = 21
Top = 1200
Width = 1215
End
Begin VB.ComboBox cmbStartHour
Height = 315
Left = 3480
Style = 2 'Dropdown List
TabIndex = 16
Top = 1320
Width = 735
End
Begin VB.ComboBox cmbStartMinute
Height = 315
Left = 4560
Style = 2 'Dropdown List
TabIndex = 15
Top = 1320
Width = 615
End
Begin VB.ComboBox cmbEndHour
Height = 315
Left = 3480
Style = 2 'Dropdown List
TabIndex = 14
Top = 1920
Width = 735
End
Begin VB.ComboBox cmbEndMinute
Height = 315
Left = 4560
Style = 2 'Dropdown List
TabIndex = 13
Top = 1920
Width = 615
End
Begin VB.ComboBox cmbRoom
Height = 315
Left = 4440
Style = 2 'Dropdown List
TabIndex = 8
Top = 600
Width = 975
End
Begin VB.TextBox txtTeacher
Appearance = 0 'Flat
Height = 375
Left = 1920
MaxLength = 10
TabIndex = 2
Top = 480
Width = 1575
End
Begin VB.Label Label14
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "时"
ForeColor = &H80000008&
Height = 195
Left = 4320
TabIndex = 20
Top = 2040
Width = 180
End
Begin VB.Label Label13
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "分"
ForeColor = &H80000008&
Height = 195
Left = 5280
TabIndex = 19
Top = 1440
Width = 180
End
Begin VB.Label Label12
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "分"
ForeColor = &H80000008&
Height = 195
Left = 5280
TabIndex = 18
Top = 2040
Width = 180
End
Begin VB.Label Label11
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "时"
ForeColor = &H80000008&
Height = 195
Left = 4320
TabIndex = 17
Top = 1440
Width = 180
End
Begin VB.Label Label9
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "日"
ForeColor = &H80000008&
Height = 195
Left = 3240
TabIndex = 12
Top = 1440
Width = 180
End
Begin VB.Label Label8
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "日"
ForeColor = &H80000008&
Height = 195
Left = 3240
TabIndex = 11
Top = 2040
Width = 180
End
Begin VB.Label Label4
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "机房:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 285
Left = 3600
TabIndex = 5
Top = 600
Width = 945
End
Begin VB.Label Label3
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "结束时间:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 285
Left = 360
TabIndex = 4
Top = 1920
Width = 1575
End
Begin VB.Label Label1
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "开始时间:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 285
Left = 360
TabIndex = 3
Top = 1320
Width = 1575
End
Begin VB.Label Label2
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "指导老师:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 285
Left = 360
TabIndex = 1
Top = 600
Width = 1575
End
End
Begin VB.Menu mnuArrangeOpt
Caption = "aa"
Visible = 0 'False
Begin VB.Menu mnuModiArrange
Caption = "修改记录"
End
Begin VB.Menu mnuDelArrange
Caption = "删除记录"
End
End
End
Attribute VB_Name = "frmArrange"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'本页用来添加机房安排信息
'
'在该页启动的时候,把数据库里面的机房号码读出,加入到列表,供用户选择
'
'arrange表中增加自动编号的字段 id int(4)作为主键,便于查询
Public objArrange As New arrange
Public intCurIndex As Integer '当前的列表项目
Private Sub cmdAdd_Click()
'编号由数据库自动编号生成
Dim dtStartTime As Date
Dim dtEndTime As Date
Dim strStartTime As String
Dim strEndTime As String
Dim strTeacher As String
Dim strRoom As String
Dim blFlag As Boolean
strRoom = Me.cmbRoom.Text
If strRoom = "" Then
MsgBox "请选择要使用的机房!"
Exit Sub
End If
strStartTime = Me.txtStartDate & " " & Me.cmbStartHour.Text & ":" & Me.cmbStartMinute & ":" & "00"
strEndTime = Me.txtEndDate & " " & Me.cmbEndHour.Text & ":" & Me.cmbEndMinute & ":" & "00"
If Not IsDate(strStartTime) Then
MsgBox "开始日期不正确,请检查!"
Exit Sub
End If
If Not IsDate(strEndTime) Then
MsgBox "结束日期不正确,请检查!"
Exit Sub
End If
dtStartTime = CDate(strStartTime)
dtEndTime = CDate(strEndTime)
strTeacher = Me.txtTeacher.Text
If dtStartTime >= dtEndTime Then
MsgBox "开始时间必须大于结束时间!"
Exit Sub
End If
'合法性检查
If objDBOpt.IsRecordExist("Arrange", "room='" & strRoom & "' and StartTime=convert(datetime,'" & dtStartTime & "') and EndTime=convert(datetime,'" & dtEndTime & "') and Teacher='" & strTeacher & "'") Then
MsgBox "该上机安排已经存在!"
Exit Sub
End If
If objArrange.IsRoomFree(strRoom, dtStartTime, dtEndTime) Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -