?? bos_voutype_plugins.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_VouType_PlugIns"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Description = "This is BillEvent Interface Class, made by K3BOSPLUGINSWIZAED"
Option Explicit
'定義 BillEvent 接口. 必須具有的聲明, 以此來獲得事件
Private WithEvents m_BillInterface As BillEvent
Attribute m_BillInterface.VB_VarHelpID = -1
Public Sub Show(ByVal oBillInterface As Object)
'BillEvent 接口實(shí)現(xiàn)
'注意: 此方法必須存在, 請勿修改
Set m_BillInterface = oBillInterface
End Sub
Private Sub Class_Terminate()
'釋放接口對象
'注意: 此方法必須存在, 請勿修改
Set m_BillInterface = Nothing
End Sub
Private Sub m_BillInterface_AfterLoadBill()
'-------------------------------------------------------------------
'在模板類型為“借款申請單模板”時,隱藏 字段“報(bào)銷項(xiàng)目”,“部門”,“部門名稱”,“類型”
'-------------------------------------------------------------------
With m_BillInterface
If .GetFieldValue("FVouTempletType", , Enu_ValueType_FDSP) = "借款申請單模板" Then
.ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), False
.ShowHideField .GetFieldInfoByKey("FDepID", "", 0), False
.ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), False
.ShowHideField .GetFieldInfoByKey("FVouType", "", 0), False
.ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), True
Else
.ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), True
.ShowHideField .GetFieldInfoByKey("FDepID", "", 0), True
.ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), True
.ShowHideField .GetFieldInfoByKey("FVouType", "", 0), True
.ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), False
End If
End With
End Sub
'************************************************************
'新增單據(jù)后,
'1給單據(jù)體的顯示狀態(tài)付值
'2自動給代碼付值'
'************************************************************
Private Sub m_BillInterface_AfterNewBill()
Dim sSql As String
Dim rs As New ADODB.Recordset
With m_BillInterface
.ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), True
.ShowHideField .GetFieldInfoByKey("FDepID", "", 0), True
.ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), True
.ShowHideField .GetFieldInfoByKey("FVouType", "", 0), True
.ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), False
sSql = "select max(cast(FNumber as decimal)) as maxNum from t_EP_ER_VouType"
Set rs = .K3Lib.GetData(sSql)
If rs.State = adStateOpen And rs.RecordCount > 0 Then
.SetFieldValue "FNumber", CStr(CNulls(rs("maxNum"), 0)) + 1
End If
End With
Set rs = Nothing
End Sub
Private Sub m_BillInterface_BeforeSave(bCancel As Boolean)
'-------------------------------------------------------------------
'保存數(shù)據(jù)
'在模板類型為“借款申請單模板”時, “借款方式”不為空
'在模板類型為“借款申請單模板”時, “報(bào)銷項(xiàng)目”,“部門”,“部門名稱”,“類型”不為空
'-------------------------------------------------------------------
With m_BillInterface
If .GetFieldValue("FVouTempletType", , Enu_ValueType_FDSP) = "借款申請單模板" Then
If .GetFieldValue("FLoanType") = "" Then
MsgBox "請檢查“借款方式”是否為空!", vbOKOnly + vbInformation, HINTINFO
bCancel = True
End If
Else
If .GetFieldValue("FWipeItem") = "" Or .GetFieldValue("FDepID") = "" Or _
.GetFieldValue("FBaseProperty") = "" Or .GetFieldValue("FVouType") = "" Then
MsgBox "請檢查“報(bào)銷項(xiàng)目”,“部門”,“部門名稱”,“報(bào)銷類型”是否為空", vbOKOnly + vbInformation, HINTINFO
bCancel = True
End If
End If
End With
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 FAmt
Dim FMaxAmt
With m_BillInterface
'-------------------------------------------------------------------
'在模板類型為“借款申請單模板”時,隱藏 字段“報(bào)銷項(xiàng)目”,“部門”,“部門名稱”,“類型”
'-------------------------------------------------------------------
If dct("FFieldName") = "FVouTempletType" Then
If .GetFieldValue("FVouTempletType", , Enu_ValueType_FDSP) = "借款申請單模板" Then
.ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), False
.ShowHideField .GetFieldInfoByKey("FDepID", "", 0), False
.ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), False
.ShowHideField .GetFieldInfoByKey("FVouType", "", 0), False
.ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), True
If .GetFieldValue("FWipeitem") <> "" Or .GetFieldValue("FWipeitem") <> "" Or _
.GetFieldValue("FWipeitem") <> "" Or .GetFieldValue("FWipeitem") <> "" Then
Cancel = True
MsgBox "“報(bào)銷項(xiàng)目”,“部門”,“部門名稱”,“報(bào)銷類型”不能有值!", vbInformation + vbOKOnly, HINTINFO
.SetFieldValue ("FVouTempletType"), 2
m_BillInterface_Change dct, dctFld, Col, Row, Cancel
End If
Else
.SetFieldValue "FLoanType", ""
.ShowHideField .GetFieldInfoByKey("FWipeItem", "", 0), True
.ShowHideField .GetFieldInfoByKey("FDepID", "", 0), True
.ShowHideField .GetFieldInfoByKey("FBaseProperty", "", 0), True
.ShowHideField .GetFieldInfoByKey("FVouType", "", 0), True
.ShowHideField .GetFieldInfoByKey("FLoanType", "", 0), False
If .GetFieldValue("FLoanType") <> "" Then
MsgBox "“借款方式”不能有值!", vbInformation + vbOKOnly, HINTINFO
.SetFieldValue ("FVouTempletType"), 1
m_BillInterface_Change dct, dctFld, Col, Row, Cancel
End If
End If
End If
End With
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -