📄 bos_billmsg.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_BillMsg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'''''''''''''''''''''''''''''''''''''''''''''''
''票据
''建立日期:2005-07-26
''建立人:倪树祥
'''''''''''''''''''''''''''''''''''''''''''''''''
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
'定义 BaseClassEvent 接口. 必须具有的声明, 以此来获得事件
Private WithEvents m_BaseListInterface As BaseClassEvent
Attribute m_BaseListInterface.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
Case "BaseClassEvent"
Set m_BaseListInterface = oBosInterface
End Select
End Sub
Private Sub Class_Terminate()
'释放接口对象
'注意: 此方法必须存在, 请勿修改
Set m_BillInterface = Nothing
Set m_ListInterface = Nothing
Set m_BaseListInterface = Nothing
End Sub
Private Sub m_BaseListInterface_MenuBarClick(ByVal BOSTool As K3ClassEvents.BOSTool, Cancel As Boolean)
'已经使用的不允许删除
Dim rsRec As New Recordset
If 12 = BOSTool.ToolID Then '删除操作
Set rsRec = m_BaseListInterface.K3Lib.GetData("select 1 from t_BillMsg where FID = " & m_BaseListInterface.GetSelectedItemID & " and FOutID > 0 ")
If Not rsRec.EOF Then
MsgBox "此票据已经使用付款,不允许删除!", vbInformation + vbOKOnly, "金蝶提示"
Cancel = True
End If
End If
End Sub
Private Sub m_BillInterface_beforesave(bCancel As Boolean)
Dim sFOutType As String
Dim sFOutDate As String
Dim sFOutID As String
Dim sFNumber As String
sFOutType = Trim(m_BillInterface.GetFieldValue("FOutType"))
sFOutDate = Trim(m_BillInterface.GetFieldValue("FOutDate"))
sFNumber = Trim(m_BillInterface.GetFieldValue("FNumber"))
sFOutID = Trim(m_BillInterface.GetFieldValue("FOutID"))
If sFOutID <> "" Then
If CLng(sFOutID) > 0 Then
MsgBox "票据已经付款,不接受修改!", vbCritical + vbOKOnly, "金蝶提示"
bCancel = True
End If
End If
If sFOutType <> "" Then
If sFOutDate = "" Then
MsgBox "出票方式不为空,则必须填写出票日期!", vbCritical + vbOKOnly, "金蝶提示"
bCancel = True
End If
End If
If sFNumber = "" Then bCancel = True
m_BillInterface.SetFieldValue "FName", sFNumber
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -