?? t_lostresume.bas
字號(hào):
Attribute VB_Name = "T_LostResume"
'查找出掛失、恢復(fù)后的字符串
Public Function FindLostResume(CLostResume As String, AFalg As String, BFalg As String, Falg As Integer) As String
Dim ClostH As String
Dim ClostNO As String
Dim k As Integer
ClostH = ""
ClostNO = ""
For i = 0 To TAllControlRecord - 1
If Mid(CLostResume, TComputerControl(i) + 1, 1) = AFalg Then '所有機(jī)號(hào),如果有一個(gè)機(jī)號(hào)沒(méi)有掛失
For j = 0 To TRecord - 1 '本地機(jī)號(hào)
If TComputerControl(i) = TcControl(j) Then '它們的機(jī)號(hào)相同
If Mid(CLostResume, TcControl(j) + 1, 1) = AFalg Then '本地機(jī)號(hào),如果沒(méi)有掛失
If Val(TcControl(j)) = 0 Then '本地機(jī)號(hào),如果0號(hào)機(jī)沒(méi)有掛失
ClostH = BFalg & Mid(CLostResume, TComputerControl(i) + 2, 128)
Else '本地機(jī)號(hào),如果其它機(jī)號(hào)沒(méi)有掛失
ClostH = Left(CLostResume, TComputerControl(i)) & BFalg & Mid(CLostResume, TComputerControl(i) + 2, 128)
End If
CLostResume = Left(ClostH, 128)
Else
TCardsYes = Falg '已經(jīng)掛失
End If
End If
Next j
Else
For k = 0 To TRecord - 1
If TComputerControl(i) = Val(TcControl(k)) Then '已經(jīng)掛失、恢復(fù)的卡號(hào)是否在本計(jì)算機(jī)上
TCardsYes = Falg
End If
Next k
End If
Next i
FindLostResume = CLostResume
End Function
'檢測(cè)機(jī)號(hào)是否已經(jīng)打開(kāi)
Public Sub CheckControlOC()
On Error GoTo OpenError
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "tSystemTableSetup"
Cmd.Parameters(1) = LoginComputerName
Set rs = Cmd.Execute
Do Until rs.EOF
If Trim(rs(0)) = "1" Then '機(jī)口存在
If T_frmMenu.Jsykt_1.OpenEtc_(Val(rs(3)), 4, 20) = "2" Then '是否聯(lián)通
DoEvents
TCheckControlOC = False
MsgBox rs(3) & "號(hào)機(jī)沒(méi)有打開(kāi)或者是串口設(shè)置錯(cuò)誤!", vbCritical, "打開(kāi)錯(cuò)誤"
End If
End If
rs.MoveNext
Loop
Set rs = Nothing
Exit Sub
OpenError:
' Unload Me
End Sub
'填充網(wǎng)格的數(shù)據(jù)
Public Sub FillGrid(cntl As Control, IRs As ADODB.Recordset, ParamArray sColumns() As Variant)
On Error GoTo XuErr
Dim X, Y As Long
Y = 1
cntl.Rows = 1
cntl.Rows = 2
If IRs.EOF = True And IRs.BOF = True Then Exit Sub
cntl.Redraw = False
If (Not IRs.BOF) Then
Do Until IRs.EOF
cntl.Row = Y
For X = 0 To UBound(sColumns)
With cntl
.Col = X + 1
.Text = Trim(IRs(CStr(sColumns(X))) & "")
End With
Next X
IRs.MoveNext
Y = Y + 1
cntl.Rows = Y + 1
Loop
End If
cntl.Redraw = True
cntl.Rows = cntl.Rows - 1
Exit Sub
XuErr:
MsgBox "Err" & err.Number & err.Description
End Sub
'根據(jù)卡的類型找出相應(yīng)的號(hào)碼
Function CardModelToCardsON(mStr As String) As String
Dim SQL As String
Select Case mStr
Case "授權(quán)卡"
SQL = "0"
Case "操作卡"
SQL = "1"
Case "月卡"
SQL = "2"
Case "儲(chǔ)值卡A"
SQL = "3"
Case "儲(chǔ)值卡B"
SQL = "4"
Case "儲(chǔ)值卡C"
SQL = "5"
Case "臨時(shí)卡A"
SQL = "6"
Case "臨時(shí)卡B"
SQL = "7"
Case "臨時(shí)卡C"
SQL = "8"
Case "免費(fèi)卡"
SQL = "9"
End Select
CardModelToCardsON = SQL
End Function
'查找IC卡類型
Function FindInCarModel(strNo As String) As String
Dim cStrModel As String
Select Case Right(Trim(strNo), 1)
Case "0"
cStrModel = "授權(quán)卡"
Case "1"
cStrModel = "操作卡"
Case "2"
cStrModel = "月卡"
Case "3"
cStrModel = "儲(chǔ)值卡A"
Case "4"
cStrModel = "儲(chǔ)值卡B"
Case "5"
cStrModel = "儲(chǔ)值卡C"
Case "6"
cStrModel = "臨時(shí)卡A"
Case "7"
cStrModel = "臨時(shí)卡B"
Case "8"
cStrModel = "臨時(shí)卡C"
Case "9"
cStrModel = "免費(fèi)卡"
End Select
If (pubgm = 1 Or pubgm = 2) And Trim(strNo) = "41" Then cStrModel = "免費(fèi)卡"
FindInCarModel = cStrModel
End Function
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -