【VB开源代码栏目提醒】:网学会员VB开源代码为您提供FrmArrange.frm参考,解决您在FrmArrange.frm学习中工作中的难题,参考学习。
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form FrmArrange
Caption = "会议室日程安排"
ClientHeight = 6570
ClientLeft = 60
ClientTop = 345
ClientWidth = 7260
LinkTopic = "Form1"
ScaleHeight = 6570
ScaleWidth = 7260
StartUpPosition = 2 '屏幕中心
Begin MSComctlLib.TreeView TreeView1
Height = 6255
Left = 2520
TabIndex = 3
Top = 120
Width = 4695
_ExtentX = 8281
_ExtentY = 11033
_Version = 393217
Style = 7
Appearance = 1
End
Begin VB.CommandButton Cmd_Back
Caption = "返 回"
Height = 375
Left = 600
TabIndex = 2
Top = 6000
Width = 1215
End
Begin MSACAL.Calendar Calendar1
Height = 2295
Left = 120
TabIndex = 1
Top = 3480
Width = 2295
_Version = 524288
_ExtentX = 4048
_ExtentY = 4048
_StockProps = 1
BackColor = -2147483633
Year = 2004
Month = 9
Day = 29
DayLength = 1
MonthLength = 0
DayFontColor = 0
FirstDay = 7
GridCellEffect = 1
GridFontColor = 10485760
GridLinesColor = -2147483632
ShowDateSelectors= -1 'True
ShowDays = 0 'False
ShowHorizontalGrid= 0 'False
ShowTitle = 0 'False
ShowVerticalGrid= 0 'False
TitleFontColor = 10485760
ValueIsNull = 0 'False
BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSAdodcLib.Adodc AdoRooms
Height = 375
Left = 120
Top = 5880
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "AdoRooms"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataList DataList1
Height = 3210
Left = 120
TabIndex = 0
Top = 120
Width = 2295
_ExtentX = 4048
_ExtentY = 5662
_Version = 393216
End
End
Attribute VB_Name = "FrmArrange"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sDate As String '显示日期
Dim sRoomNo As String '会议室编号
Private Sub Calendar1_Click()
sDate = Trim(Calendar1.Value) '指定查看的会议日期
'根据日期和会议室号显示会议信息
ListMeetings
End Sub
Private Sub Cmd_Back_Click()
Unload Me
End Sub
Private Sub DataList1_Click()
If Trim(DataList1.BoundText) = "" Then
MsgBox "请选择会议室"
Exit Sub
End If
'根据日期和会议室房间号取得会议信息
sRoomNo = Trim(DataList1.BoundText)
ListMeetings
End Sub
Private Sub Form_Load()
LoadRooms '载入会议室信息
'设置时间为当日
Calendar1.Value = Date
sDate = Date
End Sub
Private Sub TreeView1_Click()
Dim Focuskey As String
Dim nKey As Integer
'根据关键字获取会议信息
Focuskey = TreeView1.SelectedItem.Key
If InStr(Focuskey, "a") > 0 Then '根结点
Exit Sub
Else
'从关键字中截取会议编号
Focuskey = Right(Focuskey, Len(Focuskey) - InStr(Focuskey, "b"))
nKey = Val(Focuskey)
'根据会议编号取得会议信息
If MyMeeting.GetInfo(nKey) Then
FrmMeetingEdit.txtSubject = MyMeeting.Subject
FrmMeetingEdit.txtSDate = MyMeeting.StartDate
FrmMeetingEdit.txtEDate = MyMeeting.EndDate
FrmMeetingEdit.txtSTime = MyMeeting.StartTime
FrmMeetingEdit.txtETime = MyMeeting.EndTime
FrmMeetingEdit.txtPreside = MyMeeting.Preside
FrmMeetingEdit.dco_RoomNo.BoundText = MyMeeting.RoomNo
FrmMeetingEdit.txtOAttendant = MyMeeting.OAttendant
'取得内部与会人员列表
FrmMeetingEdit.txtIAttendant = MyEmp.GetNames(MyMeeting.IAttendant)
FrmMeetingEdit.txtDetail = MyMeeting.Detail
'设置控件为不可用
FrmMeetingEdit.Frame1.Enabled = False
FrmMeetingEdit.Cmd_OK.Enabled = False
FrmMeetingEdit.Show 1
End If
End If
End Sub
Private Sub LoadRooms()
AdoRooms.ConnectionString = Conn '设置数据库连接
AdoRooms.RecordSource = "SELECT * FROM MeetingRooms ORDER BY RoomNo"
AdoRooms.Refresh
Set DataList1.RowSource = AdoRooms
DataList1.ListField = "RoomName" '显示会议室名称
DataList1.BoundColumn = "RoomNo" '绑定会议室编号字段
End Sub
Private Sub ListMeetings()
'先判断是否选择了会议室,如果日期为空,则为当日
If sRoomNo = "" Then
MsgBox "请选择会议室"
Exit Sub
End If
If sDate = "" Then
sDate = Trim(Date)
End If
'根据记录时间刷新TreeView列表
Dim TmpNode As Node
Dim sStartTime As String
Dim sEndTime As String
Dim i, j As Integer
TreeView1.Nodes.Clear '清空节点内容
'设置根结点
For i = 0 To 9
'以小时为单位显示从7:00到17:00中所有时间段
If i + 7 < 10 Then
sStartTime = "0" + Trim(Str(i + 7)) + ":00" '如果时间小于10:00的开始时间显示格式
Else
sStartTime = Trim(Str(i + 7)) + ":00" '如果时间大于10:00的开始时间显示格式
End If
If i + 8 < 10 Then
sEndTime = "0" + Trim(Str(i + 8)) + ":00"
Else
sEndTime = Trim(Str(i + 8)) + ":00"
End If
Set TmpNode = TreeView1.Nodes.Add(, , "a" + Trim(Str(i)), _
sStartTime + " - " + sEndTime)
'载入此时间段内的会议信息,根据会议室房间号和日期到数据库中提取数据
MyMeeting.Load_by_NoDate sRoomNo, sDate, sStartTime, sEndTime
'显示此时间段内的会议主题,刚刚载入时显示当天的第一个会议室的安排
j = 0
Set TmpNode = Nothing
Do While Arr_MtSubject(j) <> ""
'添加此时间段内的会议信息
Set TmpNode = TreeView1.Nodes.Add("a" + Trim(Str(i)), _
tvwChild, Trim(Str(i)) + "b" + Trim(Str(Arr_MtId(j))), Trim(Arr_
上一篇:
Bigpas.pas
下一篇:
英语美文:尽在不言中