Entity.RejectChanges

Posts   
 
    
Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 28-Apr-2005 04:24:31   

Hi,

I would like to know what does the Entity.RejectChanges do. Does it copy the values from fields.DbValue to fields.CurrentValue?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 28-Apr-2005 10:03:10   

RejectChanges is an old routine, ment for databinding purposes. RejectChanges is used when IEditableObject.CancelEdit is called by a grid for example. It calls entity.Fields.RejectChanges which in turn calls field.RejectChange, which copies _originalValue back to _currentValue and resets IsChanged (and IsDirty is reset as well on Fields)

_originalValue is an internal value which is set when IEditableObject.BeginEdit() is called by a grid.

DbValue is never copied to any other variable. DbValue is set when the entity is read and is after that not touched so it's usable for testing against the database value last known for that field: when it was fetched.

Frans Bouma | Lead developer LLBLGen Pro