I'd like to write some code (adding to the CustomEntityBase class?) so that when I call the Delete on any of my entities the StatusID field of the entity is set rather than the Entity being deleted. Is this possible?
I've tried things like in the CustomEntityBase class:
Private _RealDelete As Boolean
Public Property RealDelete() As Boolean
Get
Return _RealDelete
End Get
Set(ByVal value As Boolean)
_RealDelete = value
End Set
End Property
Protected Overrides Sub OnDelete()
If _RealDelete Then
MyBase.OnDelete()
Else
Me.Fields("StatusId").CurrentValue = StatusEntity.Deleted
Me.Save()
End If
End Sub
Public Overloads Function Delete() As Boolean
If _RealDelete Then
MyBase.OnDelete()
Else
Me.Fields("StatusId").CurrentValue = StatusEntity.Deleted
MyBase.Save()
End If
End Function
Any suggestions gratefully received!
Winforms Vb.net in Visual Studio 2008 Sp1, llblgen 2.6, access mdb