VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 1  'Persistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Customer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private XCustomerID As Long
Private XName As String
Private XStreet As String
Private XCity As String
Private XState As String
Private XZip As Long
Private XPhone As String
Private XEMailAddress As String
Private XDateAdded As Date
Private XDateUpdated As Date
Private XMailingList As Boolean
Private XComments As String
Private XIsDirty As Boolean

Public Property Get CustomerId() As Long

CustomerId = XCustomerID

End Property

Public Property Let CustomerId(c As Long)

If c <> XCustomerID Then
   XCustomerID = c
   XIsDirty = True
   PropertyChanged "CustomerId"
    
End If

End Property
Public Property Get Name() As String

Name = XName

End Property

Public Property Let Name(c As String)

If c <> XName Then
   XName = c
   XIsDirty = True
   PropertyChanged "Name"
   
End If

End Property

Public Property Get Street() As String

Street = XStreet

End Property

Public Property Let Street(c As String)

If c <> XStreet Then
   XStreet = c
   XIsDirty = True
   PropertyChanged "Street"
      
End If

End Property

Public Property Get City() As String

City = XCity

End Property

Public Property Let City(c As String)

If c <> XCity Then
   XCity = c
   XIsDirty = True
   PropertyChanged "City"
   
End If

End Property

Public Property Get State() As String

State = XState

End Property

Public Property Let State(c As String)

If c <> XState Then
   XState = c
   XIsDirty = True
   PropertyChanged "State"
   
End If

End Property

Public Property Get Zip() As Long

Zip = XZip

End Property

Public Property Let Zip(c As Long)

If c <> XZip Then
   XZip = c
   XIsDirty = True
   PropertyChanged "Zip"
   
End If

End Property

Public Property Get Phone() As String

Phone = XPhone

End Property

Public Property Let Phone(c As String)

If c <> XPhone Then
   XPhone = c
   XIsDirty = True
   PropertyChanged "Phone"
   
End If

End Property

Public Property Get EMailAddress() As String

EMailAddress = XEMailAddress

End Property

Public Property Let EMailAddress(c As String)

If c <> XEMailAddress Then
   XEMailAddress = c
   XIsDirty = True
   PropertyChanged "EMailAddress"
   
End If

End Property

Public Property Get DateAdded() As Date

DateAdded = XDateAdded

End Property
 
Public Property Let DateAdded(c As Date)

If c <> XDateAdded Then
   XDateAdded = c
   XIsDirty = True
   PropertyChanged "DateAdded"
     
End If

End Property

Public Property Get DateUpdated() As Date

DateUpdated = XDateUpdated

End Property
 
Public Property Let DateUpdated(c As Date)

If c <> XDateUpdated Then
   XDateUpdated = c
   XIsDirty = True
   PropertyChanged "DateUpdated"
 
End If

End Property

Public Property Get MailingList() As Boolean

MailingList = XMailingList

End Property
 
Public Property Let MailingList(c As Boolean)

If c <> XMailingList Then
   XMailingList = c
   XIsDirty = True
   PropertyChanged "MailingList"
   
End If

End Property

Public Property Get Comments() As String

Comments = XComments

End Property

Public Property Let Comments(c As String)

If c <> XComments Then
   XComments = c
   XIsDirty = True
   PropertyChanged "Comments"
   
End If

End Property

Public Property Get IsDirty() As Boolean

IsDirty = XIsDirty

End Property

Public Sub ResetDirty()

XIsDirty = False

End Sub

Private Sub Class_InitProperties()

XCustomerID = -1
XName = ""
XStreet = ""
XCity = ""
XState = ""
XZip = 0
XPhone = ""
XEMailAddress = ""
XDateAdded = Now
XDateUpdated = Now
XMailingList = False
XComments = ""
XIsDirty = False

End Sub

Private Sub Class_ReadProperties(PropBag As PropertyBag)

XCustomerID = PropBag.ReadProperty("CustomerId", 0)
XName = PropBag.ReadProperty("Name", "")
XStreet = PropBag.ReadProperty("Street", "")
XCity = PropBag.ReadProperty("City", "")
XState = PropBag.ReadProperty("State", "")
XZip = PropBag.ReadProperty("Zip", 0)
XPhone = PropBag.ReadProperty("Phone", "")
XEMailAddress = PropBag.ReadProperty("EMailAddress", "")
XDateAdded = PropBag.ReadProperty("DateAdded", 0)
XDateUpdated = PropBag.ReadProperty("DateUpdated", 0)
XMailingList = PropBag.ReadProperty("MailingList", False)
XComments = PropBag.ReadProperty("Comments", "")
XIsDirty = False

End Sub

Private Sub Class_WriteProperties(PropBag As PropertyBag)

PropBag.WriteProperty "CustomerId", XCustomerID
PropBag.WriteProperty "Name", XName
PropBag.WriteProperty "Street", XStreet
PropBag.WriteProperty "City", XCity
PropBag.WriteProperty "State", XState
PropBag.WriteProperty "Zip", XZip
PropBag.WriteProperty "Phone", XPhone
PropBag.WriteProperty "EMailAddress", XEMailAddress
PropBag.WriteProperty "DateAdded", XDateAdded
PropBag.WriteProperty "DateUpdated", XDateUpdated
PropBag.WriteProperty "MailingList", XMailingList
PropBag.WriteProperty "Comments", XComments
PropBag.WriteProperty "IsDirty", XIsDirty

End Sub
