📄 bos_hitrec.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "BOS_HitRec"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'''''''''''''''''''''''''''''''''''''''''''''''
''中标记录
''建立日期:2005-07-28
''建立人:裴立巍
'''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
'定义 BillEvent 接口. 必须具有的声明, 以此来获得事件
Private WithEvents m_BillInterface As BillEvent
Attribute m_BillInterface.VB_VarHelpID = -1
'定义 ListEvents 接口. 必须具有的声明, 以此来获得事件
Private WithEvents m_ListInterface As ListEvents
Attribute m_ListInterface.VB_VarHelpID = -1
Public Sub Show(ByVal oBosInterface As Object)
'BillEvent 接口实现
'注意: 此方法必须存在, 请勿修改
Select Case VBA.TypeName(oBosInterface)
Case "BillEvent"
Set m_BillInterface = oBosInterface
Case "ListEvents"
Set m_ListInterface = oBosInterface
End Select
End Sub
Private Sub Class_Terminate()
'释放接口对象
'注意: 此方法必须存在, 请勿修改
Set m_BillInterface = Nothing
Set m_ListInterface = Nothing
End Sub
Private Sub m_BillInterface_Change(ByVal dct As KFO.IDictionary, ByVal dctFld As KFO.IDictionary, ByVal Col As Long, ByVal Row As Long, Cancel As Boolean)
''改变供应商后触发
Dim strSql As String
Dim rt As New ADODB.Recordset
Dim strfu As String
Dim re As ADODB.Recordset
Dim strka As String
Dim strta As String
'On Error GoTo ErrHandle
If dct.Value("Ffieldname") = "VName" Then
strSql = "select VictualerName from t_BOS200000023 inner join t_BOS200000023Entry2 on t_BOS200000023.FID = t_BOS200000023Entry2.FID where t_BOS200000023Entry2.VictualerName ='" & m_BillInterface.GetFieldValue("VName") & "' and t_BOS200000023.Fno ='" & m_BillInterface.GetFieldValue("FNo") & "'"
Set rt = m_BillInterface.K3Lib.GetData(strSql)
''判断供应商的合法性,如果合法进行更改
If rt.EOF Then
MsgBox "请选择参加投标的供应商!", vbInformation, "金蝶提示"
m_BillInterface.SetFieldValue "VName", 0
Exit Sub
Else
strfu = "select price from t_BOS200000165 inner join t_BOS200000165Entry2 on t_BOS200000165.FID = t_BOS200000165Entry2.FID where t_BOS200000165.FBase = " & m_BillInterface.GetFieldValue("VName") & " and t_BOS200000165.FYBillNO = " & m_BillInterface.GetFieldValue("FNo") & "and t_BOS200000165Entry2.MaterielNo = " & m_BillInterface.GetFieldValue("DNumber")
Set re = m_BillInterface.K3Lib.GetData(strfu)
If Not re.EOF Then
m_BillInterface.SetFieldValue "Price", IIf(IsNull(re!price) = True, 0, re!price)
End If
strka = "update t_BOS200000165Entry2 set FCheckBox = 1 where FID = (select fid from t_BOS200000165 where FYBillNo ='" & m_BillInterface.GetFieldValue("FNo") & "' and FBase ='" & m_BillInterface.GetFieldValue("VName") & "') and MaterielNo ='" & m_BillInterface.GetFieldValue("DNumber") & "'"
m_BillInterface.K3Lib.GetData strka
strta = "update t_BOS200000165Entry2 set FCheckBox = 0 where FID = (select fid from t_BOS200000165 where FYBillNo ='" & m_BillInterface.GetFieldValue("FNo") & "' and FBase <>'" & m_BillInterface.GetFieldValue("VName") & "') and MaterielNo ='" & m_BillInterface.GetFieldValue("DNumber") & "'"
m_BillInterface.K3Lib.GetData strta
End If
End If
'ErrHandle:
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -