Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Event handling in business objects
Message
From
25/06/2008 13:23:39
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Event handling in business objects
Miscellaneous
Thread ID:
01326692
Message ID:
01326692
Views:
58
Hi again.

I am just starting out with MM and have a question on event handling. I have read through the documentation, but still am not sure how to handle this.

My database has some tables with FK constraints. When deleting a record may violate a FK constraint in another table (can't delete the parent when there are children) I use a stored procedure to check to see if the constraint will be violated. I do this so that I don't generate a cryptic (to the user) SQL exception. I call this pre delete SP from within the HookPreDeleteEntity method and everything works fine.

However, I would like to be able to raise an event to the user interface to tell the user why the delete failed. Unlike the SaveEntity() method, the DeleteEntity() method returns a bool instead of a RulesBroken enum. Can I use the OnStateChange() method to raise the event I need, or do I need to add another event to my BusinessObject class? Or am I missing something more fundamental?

Thanks in advance.

Tim Holgerson
Next
Reply
Map
View

Click here to load this message in the networking platform