?? formyytx.frm
字號:
VERSION 5.00
Object = "{A964BDA3-3E93-11CF-9A0F-9E6261DACD1C}#3.0#0"; "resize32.ocx"
Begin VB.Form frmMain
BackColor = &H80000018&
BorderStyle = 0 'None
Caption = "預約查詢"
ClientHeight = 8730
ClientLeft = 0
ClientTop = -105
ClientWidth = 11700
Icon = "FormYYTX.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 8730
ScaleWidth = 11700
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
WindowState = 2 'Maximized
Begin VB.CommandButton CmdPrintHT
BackColor = &H80000001&
Caption = "打印號條"
BeginProperty Font
Name = "隸書"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1515
Left = 3720
Picture = "FormYYTX.frx":1982
TabIndex = 0
Top = 2580
Width = 3465
End
Begin VB.Timer Timer1
Left = 600
Top = 8160
End
Begin ResizeLibCtl.ReSize ReSize1
Left = 0
Top = 8160
_Version = 196608
_ExtentX = 741
_ExtentY = 741
_StockProps = 64
Enabled = -1 'True
Enabled = -1 'True
FormMinWidth = 0
FormMinHeight = 0
FormDesignHeight= 8730
FormDesignWidth = 11700
End
Begin VB.Image ImgBottom
BorderStyle = 1 'Fixed Single
Height = 8055
Left = 0
Picture = "FormYYTX.frx":A68A3
Stretch = -1 'True
Top = 0
Width = 10695
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdPrintHT_Click()
Dim strTemp As String
'找出當前隊列記錄中的最大序號
strTemp = GetMaxSerialNum()
'將該條記錄添加到當前隊列
gstrQueue = gstrQueue & "#" & strTemp & "#1#" & GetTimeMark()
'重寫隊列文件
RewriteQueueFile gstrQueue
'打印號條
If printHT(CLng(strTemp)) <> 0 Then
MsgBox "產生打印故障,請聯系工作人員", vbOKOnly, "故障報警"
End If
End Sub
'打印號條
Public Function printHT(intS As Long) As Integer
End Function
'找出當前隊列記錄中的最大序號
Public Function GetMaxSerialNum() As String
Dim strTmp As String
Dim intTmp As Integer
Dim intS As Long
Dim strRecordTmp As String
intTmp = GetRecordNum()
If intTmp > 0 Then
'取得最后一條記錄
strRecordTmp = GetQueueRecord(intTmp)
strTmp = GetRecordStrSerialNum(strRecordTmp)
intS = CLng(strTmp)
If intS < 9 Then
strTmp = "0000" & CStr(intS + 1)
ElseIf 10 < intS < 99 Then
strTmp = "000" & CStr(intS + 1)
ElseIf 100 < intS < 999 Then
strTmp = "00" & CStr(intS + 1)
ElseIf 1000 < intS < 9999 Then
strTmp = "0" & CStr(intS + 1)
ElseIf 10000 < intS < 99999 Then
strTmp = CStr(intS + 1)
ElseIf CStr(intS) = "9" Then
strTmp = "00010"
ElseIf CStr(intS) = "99" Then
strTmp = "00100"
ElseIf CStr(intS) = "999" Then
strTmp = "01000"
ElseIf CStr(intS) = "9999" Then
strTmp = "10000"
End If
Else
strTmp = "00001"
End If
GetMaxSerialNum = strTmp
End Function
Private Sub Form_Load()
Dim i As Integer
Timer1.Enabled = False
'設置程序界面
SetInterface
'取初始運行參數
GetIniParameter
'初始將所有護士工作站設為閑
ReDim gNurseStatus(gNurseNum) As Integer
For i = 1 To gNurseNum
gNurseStatus(i) = 0
Next
'讀取隊列文件,如不為空,說明是斷電重啟,則重新叫號,如文件不存在,則創建空文件,如存在空文件,不做任何處理
gQueueFileName = Mid(App.Path & QueueFile, 1, Len(App.Path & QueueFile) - 4) & NeatenDate() & ".dat"
'啟動定時器
Timer1.Interval = gintTimerInterval
Timer1.Enabled = True
'進入處理
InitFile
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Dim j As Integer
Dim intTmp As Integer
Dim strRecordTmp As String
'刪除排隊記錄中超時的記錄
gstrQueue = DeleteTimeoutRecord()
'查找是否有空閑的護士臺且排隊隊列中是否有待叫記錄,如有則呼叫
intTmp = GetRecordNum()
If intTmp > 0 Then
For i = 1 To gNurseNum
If gNurseStatus(i) = 0 Then
'如果該護士臺狀態為空閑
'查找第一個可叫的記錄,并叫號
For j = 1 To intTmp
strRecordTmp = GetQueueRecord(j)
If GetRecordStatus(strRecordTmp) = 1 Then
'當前記錄未叫號,則叫號
SpeakRecord j, i
'改寫時間戳
strRecordTmp = WriteTimeMark(strRecordTmp)
'改寫該條記錄的狀態
strRecordTmp = Mid(strRecordTmp, 1, 1 + intSerialNumLen + 1) & _
"2" & _
Mid(strRecordTmp, 1 + intSerialNumLen + 1 + intStatusLen + 1)
'將記錄了時間戳和狀態的記錄寫回隊列字符串
gstrQueue = RewriteQueue(gstrQueue, strRecordTmp, j)
'重寫隊列文件
RewriteQueueFile gstrQueue
Exit Sub
End If
Next j
End If
Next i
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -