Underlying value

Posts   
 
    
HcD avatar
HcD
User
Posts: 214
Joined: 12-May-2005
# Posted on: 08-Jun-2005 10:59:56   

Hi,

is there a way to retrieve the "underlying value" of a field, ie the value that the field had when last loaded or instanciated ?

What i mean : i have an entity with a field "Locked" true/false. Default the value is false. When the value is true, it means no changes can be written to the record. In my gui code, the field is databound to a checkbox. The possible entity lock-states are : i have a new enity -> locked = false : user can make changes to whatever fields (also the "locked" field) and save the entity i have a loaded entity with locked = false : see above i have a loaded entity with locked = true : my custom validator will reject validation with reason "no locked entity may be changed", UNLESS the user has changed the locked checkbox to false.

So my validator needs to have the two states: the current state (i have that from the databound checkbox) and the "original" state ..how can i retrieve that original state from LLBL ? Or do i just customize the entityclass, and add some properties to set it mysellf (where?) when i load an entity ? Kind of like :

entity = new entity("PK"),
entity.OriginalLockState/*custom property*/ = entity.LockState/*database field*/;
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 08-Jun-2005 12:06:42   

entity.Fields[index].DbValue simple_smile

Frans Bouma | Lead developer LLBLGen Pro