📄 hwbms.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 = "HwBms"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Dim OHwBms As Collection
Public Property Get Count() As Integer
Count = OHwBms.Count
End Property
Public Sub Add(OHwBm As HwBm)
Dim vKey As Integer, vHwBm As HwBm
For Each vHwBm In OHwBms
If vHwBm.HwBm_Key > vKey Then
vKey = vHwBm.HwBm_Key
End If
Next
vKey = vKey + 1
OHwBm.HwBm_Key = vKey
OHwBms.Add OHwBm, CStr(vKey)
End Sub
Public Function Item(Vindex) As HwBm
Attribute Item.VB_UserMemId = 0
Set Item = OHwBms.Item(Vindex)
End Function
Public Sub Remove(Vindex, Optional NeedDel As Integer = 1)
If NeedDel = 1 Then
Dim mHwBm As HwBm
Set mHwBm = OHwBms(Vindex)
mHwBm.DbDel
End If
OHwBms.Remove (Vindex)
End Sub
Public Sub ClearAll()
Dim i, Vcount As Integer
Vcount = OHwBms.Count
For i = 1 To Vcount
OHwBms.Remove (1)
Next
End Sub
Public Sub Fillbydb(Optional Wherestr As String = "", Optional Orderstr As String = "HWBM_HWFLNO,HwBmCode")
Dim OHwBm As HwBm
Dim Rs As DbRs
Dim SqlStr As String
Dim vKey As Integer
On Error GoTo ErrorHandle
ClearAll
SqlStr = "select HWBM_HWFLNO,HWBM_HWFLCODE=HWFLCODE,HWBM_HWFLMC=HWFLMC,HwBmCode,HwBmMc,HWBMEMC,HWBMSIZE,HWBM_HWDWNO,HWBM_HWDWCODE=HWDWCODE,HwBmISSTOP,HwBmNo from HwBmrec,HWFLREC,HWDWREC WHERE HWFLNO=HWBM_HWFLNO AND HWDWNO=HWBM_HWDWNO "
If Wherestr <> "" Then
SqlStr = SqlStr + " AND " + Wherestr
End If
If Orderstr <> "" Then
SqlStr = SqlStr + " order by " + Orderstr
End If
Set Rs = New DbRs
Rs.Fillbydb SqlStr
Rs.MoveFirst
vKey = 1
Do Until Rs.EOF
Set OHwBm = New HwBm
OHwBm.HwBm_Key = vKey
OHwBm.BatchLet Rs!HwBm_HwFlNo, Rs!HwBm_HwFlCode, Rs!HwBm_HwFlMc, Rs!HwBmCode, Rs!HwBmMc, Rs!HwBmEMc, Rs!HwBmSize, Rs!HwBm_HwDwNo, Rs!HwBm_HwDwCode, Rs!HwBmIsStop, Rs!HwBmNo
OHwBms.Add OHwBm, CStr(vKey)
Rs.MoveNext
vKey = vKey + 1
Loop
Set Rs = Nothing
Exit Sub
ErrorHandle:
Set Rs = Nothing
Err.Raise vbObjectError + 1, , Err.Description
End Sub
Public Function NewEnum() As IUnknown
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
Set NewEnum = OHwBms.[_NewEnum]
End Function
Private Sub Class_Initialize()
Set OHwBms = New Collection
End Sub
Private Sub Class_Terminate()
Set OHwBms = Nothing
End Sub
Public Property Get Name() As String
Name = "HwBms"
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -