trepair.cls

来自「汽车维修管理软件。其中包含三个编辑控件。」· CLS 代码 · 共 81 行

CLS
81
字号
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 + =
减小字号Ctrl + -
显示快捷键?