?? modwinsock.bas
字號:
If sFunction <> "ROBI" Then GoTo ERROR_EXIT
If sPara(3) <> m_strOld Then GoTo ERROR_EXIT
If UCase(sPara(1)) = "QUER" Then
If UCase(sPara(2)) = "OK" Then
frmQueue.cmdRecall.Tag = "1"
'顯示選擇框
Set dlg = New dlgSrgQueue
Load dlg
dlg.CustCode = sPara(4)
If dlg.InitSet = True Then dlg.Show vbModal
If dlg.bResult = True Then
m_sCustomerCode = dlg.sResult
Else
m_sCustomerCode = ""
End If
Set dlg = Nothing
If m_sCustomerCode = "" Then
frmQueue.cmdRecall.Tag = "0"
Else
send_data "ROBK" & vbTab & "CUCD" & vbTab & m_strOld & vbTab & m_sCustomerCode
End If
Else
Select Case CInt(sPara(4))
Case 1
Debug.Print "用戶工號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 2
MsgBox "沒有存儲的客戶編號!", vbOKOnly, "系統提示"
Case Else
Debug.Print "其他數據服務錯誤!", vbCritical + vbOKOnly, "系統錯誤"
End Select
cust_roback = CInt(sPara(4))
Exit Function
End If
Else
If UCase(sPara(2)) = "OK" Then
If sPara(4) <> m_sCustomerCode Then
Debug.Print "客戶編號不正確!", vbCritical + vbOKOnly, "系統錯誤"
cust_roback = 2
Exit Function
End If
frmQueue.cmdRecall.Tag = "0"
m_bService = True '呼叫成功,開始排隊工作
frmQueue.EnableButton True
frmQueue.Refresh_Info 1
Else
Select Case CInt(sPara(3))
Case 1
Debug.Print "用戶工號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 2
Debug.Print "客戶編號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 3
Debug.Print "服務狀態不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 4
Debug.Print "命令格式不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case Else
Debug.Print "其他數據服務錯誤!", vbCritical + vbOKOnly, "系統錯誤"
End Select
frmQueue.cmdRecall.Tag = "0"
cust_roback = CInt(sPara(3))
Exit Function
End If
End If
cust_roback = 0
Exit Function
ERROR_EXIT:
m_tagErrInfo.strErrDate = Format(Now, "yyyy-mm-dd hh:mm:ss")
m_tagErrInfo.strErrFile = "modWinsock"
m_tagErrInfo.strErrFunc = "cust_roback"
m_tagErrInfo.nErrNum = Err.Number
m_tagErrInfo.strErrDesc = Error(Err.Number)
If Err.Number <> 0 Then Err.Clear
modErrorInfo.WriteErrLog m_tagErrInfo
frmQueue.cmdRecall.Tag = "0"
cust_roback = 9
End Function
'客戶順呼
Private Function cust_storage(ByVal data As String) As Integer
On Error GoTo ERROR_EXIT
Dim sFunction As String, sPara() As String
sPara = Split(data, vbTab)
sFunction = UCase(sPara(0))
If UBound(sPara) = 0 Then GoTo ERROR_EXIT
If sFunction <> "STGI" Then GoTo ERROR_EXIT
If sPara(2) <> m_strOld Then GoTo ERROR_EXIT
If UCase(sPara(1)) = "OK" Then
If sPara(3) <> m_sCustomerCode Then
MsgBox "客戶編號不正確!", vbCritical + vbOKOnly, "系統錯誤"
cust_storage = 2
Exit Function
End If
m_sCustomerCode = ""
m_bService = False '呼叫成功,開始排隊工作
frmQueue.EnableButton True
frmQueue.Refresh_Info 1
Else
Select Case CInt(sPara(3))
Case 1
Debug.Print "用戶工號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 2
MsgBox "客戶編號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 3
MsgBox "服務狀態不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 4
Debug.Print "命令格式不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case Else
Debug.Print "其他數據服務錯誤!", vbCritical + vbOKOnly, "系統錯誤"
End Select
cust_storage = CInt(sPara(3))
Exit Function
End If
cust_storage = 0
Exit Function
ERROR_EXIT:
m_tagErrInfo.strErrDate = Format(Now, "yyyy-mm-dd hh:mm:ss")
m_tagErrInfo.strErrFile = "modWinsock"
m_tagErrInfo.strErrFunc = "cust_storage"
m_tagErrInfo.nErrNum = Err.Number
m_tagErrInfo.strErrDesc = Error(Err.Number)
If Err.Number <> 0 Then Err.Clear
modErrorInfo.WriteErrLog m_tagErrInfo
cust_storage = 9
End Function
'客戶優先呼叫
Private Function cust_first(ByVal data As String) As Integer
On Error GoTo ERROR_EXIT
Dim sFunction As String, sPara() As String
Dim dlg As dlgSrgQueue
sPara = Split(data, vbTab)
sFunction = UCase(sPara(0))
If UBound(sPara) = 0 Then GoTo ERROR_EXIT
If sFunction <> "FRSI" Then GoTo ERROR_EXIT
If sPara(3) <> m_strOld Then GoTo ERROR_EXIT
If UCase(sPara(1)) = "QUER" Then
If UCase(sPara(2)) = "OK" Then
'顯示選擇框
Set dlg = New dlgSrgQueue
Load dlg
dlg.CustCode = sPara(4)
If dlg.InitSet(False) = True Then dlg.Show vbModal
If dlg.bResult = True Then
m_sCustomerCode = dlg.sResult
Else
m_sCustomerCode = ""
End If
Set dlg = Nothing
If m_sCustomerCode <> "" Then
send_data "FRST" & vbTab & "CUCD" & vbTab & m_strOld & vbTab & m_sCustomerCode
End If
Else
Select Case CInt(sPara(4))
Case 1
Debug.Print "用戶工號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 2
MsgBox "沒有存儲的客戶編號!", vbOKOnly, "系統提示"
Case Else
Debug.Print "其他數據服務錯誤!", vbCritical + vbOKOnly, "系統錯誤"
End Select
cust_first = CInt(sPara(4))
Exit Function
End If
Else
If UCase(sPara(2)) = "OK" Then
If sPara(4) <> m_sCustomerCode Then
Debug.Print "客戶編號不正確!", vbCritical + vbOKOnly, "系統錯誤"
cust_first = 2
Exit Function
End If
m_bService = True '呼叫成功,開始排隊工作
frmQueue.EnableButton True
frmQueue.Refresh_Info 1
Else
Select Case CInt(sPara(3))
Case 1
Debug.Print "用戶工號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 2
Debug.Print "客戶編號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 3
Debug.Print "服務狀態不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 4
Debug.Print "命令格式不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case Else
Debug.Print "其他數據服務錯誤!", vbCritical + vbOKOnly, "系統錯誤"
End Select
cust_first = CInt(sPara(3))
Exit Function
End If
End If
cust_first = 0
Exit Function
ERROR_EXIT:
m_tagErrInfo.strErrDate = Format(Now, "yyyy-mm-dd hh:mm:ss")
m_tagErrInfo.strErrFile = "modWinsock"
m_tagErrInfo.strErrFunc = "cust_first"
m_tagErrInfo.nErrNum = Err.Number
m_tagErrInfo.strErrDesc = Error(Err.Number)
If Err.Number <> 0 Then Err.Clear
modErrorInfo.WriteErrLog m_tagErrInfo
cust_first = 9
End Function
'客戶轉移呼叫
Private Function cust_shift(ByVal data As String) As Integer
On Error GoTo ERROR_EXIT
Dim sFunction As String, sPara() As String
' Dim dlg As dlgService
' Dim sService As String
sPara = Split(data, vbTab)
sFunction = UCase(sPara(0))
If UBound(sPara) = 0 Then GoTo ERROR_EXIT
If sFunction <> "SHII" Then GoTo ERROR_EXIT
If sPara(3) <> m_strOld Then GoTo ERROR_EXIT
If UCase(sPara(1)) = "QUER" Then
' If UCase(sPara(2)) = "OK" Then
' '顯示選擇框
' Set dlg = New dlgService
' Load dlg
' dlg.CustCodeList = sPara(4)
' dlg.CustCodeText = m_sCustomerCode
' If dlg.InitSet(True) = True Then dlg.Show vbModal
' If dlg.ServiceStatus = True Then
' m_sCustomerCode = dlg.CustCode
' sService = dlg.ServiceCode
' Else
' m_sCustomerCode = ""
' sService = ""
' End If
' Set dlg = Nothing
' If m_sCustomerCode <> "" And sService <> "" Then
' send_data "SHIT" & vbTab & "CUCD" & vbTab & m_strOld & vbTab & m_sCustomerCode & _
' vbTab & sService
' End If
' Else
' Select Case CInt(sPara(4))
' Case 1
' Debug.Print "用戶工號不正確!", vbCritical + vbOKOnly, "系統錯誤"
' Case 2
' Debug.Print "沒有存儲的客戶編號!", vbOKOnly, "系統提示"
' Case Else
' Debug.Print "其他數據服務錯誤!", vbCritical + vbOKOnly, "系統錯誤"
' End Select
' cust_shift = CInt(sPara(4))
' Exit Function
' End If
Else
If UCase(sPara(2)) = "OK" Then
If sPara(4) <> m_sCustomerCode Then
Debug.Print "客戶編號不正確!", vbCritical + vbOKOnly, "系統錯誤"
cust_shift = 2
Exit Function
End If
m_sCustomerCode = ""
m_bService = False '轉移成功,開始新的排隊工作
frmQueue.EnableButton True
frmQueue.Refresh_Info 1
Else
Select Case CInt(sPara(3))
Case 1
Debug.Print "用戶工號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 2
Debug.Print "客戶編號不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 3
Debug.Print "服務狀態不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case 4
Debug.Print "命令格式不正確!", vbCritical + vbOKOnly, "系統錯誤"
Case Else
Debug.Print "其他數據服務錯誤!", vbCritical + vbOKOnly, "系統錯誤"
End Select
cust_shift = CInt(sPara(3))
Exit Function
End If
End If
cust_shift = 0
Exit Function
ERROR_EXIT:
m_tagErrInfo.strErrDate = Format(Now, "yyyy-mm-dd hh:mm:ss")
m_tagErrInfo.strErrFile = "modWinsock"
m_tagErrInfo.strErrFunc = "cust_shift"
m_tagErrInfo.nErrNum = Err.Number
m_tagErrInfo.strErrDesc = Error(Err.Number)
If Err.Number <> 0 Then Err.Clear
modErrorInfo.WriteErrLog m_tagErrInfo
cust_shift = 9
End Function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -