Deleted, Restored ?

Deleted, Restored ?

Old forum URL: forums.lhotka.net/forums/t/794.aspx


JoOfMetL posted on Thursday, August 03, 2006


Hi,

I have a question.

In Our software we never deleted a item into the data base. If the user asks to deleted an element, we mark in the data base the fact that the element is deleted and if it wishes it, the user can restore this element. For that, in each table, we have a field which indicates if the line is removed or not. The framework not having been conceived for that, I asked for the extent of the modifications to be made to Framework or then I to use the framework such as it is currently ?

xal replied on Thursday, August 03, 2006

You could have a Public Shared Sub ResurrectItem(Byval itemID as Integer) and call a command object to do what you want....
Or if you need to fetch the resurrected item, you could call a specialized dataportal_fetch (by passing a different criteria) that updates the column that you need and then fetch everything.... Like public shared function ResurrectAndGet( itemID as integer) as yourBO

Andrés

Massong replied on Thursday, August 03, 2006

We just have an IsDeleted-property in our Business Objects...

JoOfMetL replied on Thursday, August 03, 2006

Do you have modified the Framework ? or you have just added an IsDeleted-property ?



RockfordLhotka replied on Thursday, August 03, 2006

You don't need to modify the framework for this purpose. If you want all (or most) of your objects to have this behavior, just create your own base class that inherits from BusinessBase:

BusinessBase<-MyBaseClass<-MyObject

You can add extra features like this to MyBaseClass and all your business objects will inherit that behavior.

JoOfMetL replied on Thursday, August 03, 2006


Ok

Thank you.

Massong replied on Thursday, August 03, 2006

No, I haven’t modified the framework. You can use your own base class that inherits from BusinessBase and implements the IsDeleted property for all your business objects. But then you loose the advantages of generics. I use this IsDeleted-property only in a few of my objects, so I just added this property to them.

Copyright (c) Marimer LLC