
sorry, english is my second language.
i mean program like this is efficient or not.
Employee table:
Id integer
Name string 20
Birthday date
************ boolean
Address string 50
¡®Employee class:
Option Explicit
Private mId As Integer
Private mName As String
Private mBirthday As Date
Private mSex As Boolean
Private mAddress As String
Private mIsDirty As Boolean
Public Property Get Id() As Integer
Id = mId
End Property
Public Property Get Name() As String
Name = mName
End Property
Public Property Let Name(ByVal vNewValue As String)
If mName <> vNewValue Then
mName = vNewValue
mIsDirty = True
End If
End Property
Public Property Get Birthday() As Date
Birthday = mBirthday
End Property
Public Property Let Birthday(ByVal vNewValue As Date)
If mBirthday <> vNewValue Then
mBirthday = vNewValue
mIsDirty = True
End If
End Property
Public Property Get ************() As Boolean
************ = mSex
End Property
Public Property Let ************(ByVal vNewValue As Boolean)
If mSex <> vNewValue Then
mSex = vNewValue
mIsDirty = True
End If
End Property
Public Property Get Address() As String
Address = mAddress
End Property
Public Property Let Address(ByVal vNewValue As String)
If mAddress <> vNewValue Then
mAddress = vNewValue
mIsDirty = True
End If
End Property
Public Property Get IsDirty() As Variant
IsDirty = mIsDirty
End Property
Public Function Save()
If mIsDirty Then
'..save to db
End If
End Function
Public Function Delete()
'..delete from db
End Function