📄 trepair.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 = "TRepair"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'保持属性值的局部变量
Private m_Id As Long '局部复制
Private m_Code As String '局部复制
Private m_RepairName As String '局部复制
Private m_Rate As Long '局部复制
Private m_IsChange As Boolean '局部复制
Public Property Get IsChange() As Boolean
IsChange = m_IsChange
End Property
Public Property Get Rate() As Long
Rate = m_Rate
End Property
Public Property Get RepairName() As String
RepairName = m_RepairName
End Property
Public Property Get Code() As String
Code = m_Code
End Property
Public Property Get Id() As Long
Id = m_Id
End Property
Public Function Find(ByRef pFindString As String) As Boolean
Dim re As ADODB.Recordset
If IsNumeric(pFindString) Then
Set re = SQLFind(pFindString, "RepairItem", "Code", FT_CHAR)
Else
Set re = SQLFind(pFindString, "RepairItem", "Name", FT_CHAR)
End If
If re.BOF And re.EOF Then
Find = False
Exit Function
End If
m_Id = re.Fields(0).Value
m_Code = re.Fields(1).Value
m_RepairName = re.Fields(2).Value
m_Rate = re.Fields(3).Value
m_IsChange = True
Set re = Nothing
Find = True
End Function
Public Function FindAsId(ByVal pId As Long) As Boolean
Dim re As ADODB.Recordset
Set re = SQLFind(CStr(pId), "RepairItem", "AutoId", FT_NUMBER)
If re.BOF And re.EOF Then
FindAsId = False
Exit Function
End If
m_Id = re.Fields(0).Value
m_Code = re.Fields(1).Value
m_RepairName = re.Fields(2).Value
m_Rate = re.Fields(3).Value
Set re = Nothing
FindAsId = True
End Function
Private Sub Class_Initialize()
ClearData
End Sub
Public Sub ClearData()
m_Id = -1
m_Code = vbNullString
m_RepairName = vbNullString
m_Rate = -1
m_IsChange = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -