?? 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 + -