StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
How to check Business Rules from a parent BO into a Child BO
How to check Business Rules from a parent BO into a Child BO
Post Reply
Like
1
How to check Business Rules from a parent BO into a Child BO
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Ger Cannoll
Ger Cannoll
posted 14 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 430,
Visits: 507
I have a Parent BO and a Child BO (using a Chikd Dialog) . I am at the point where I want to save the Parent and the child out to the Database and want to check the rules first. So I have code like:
if (this.ParentBO1.CheckRules(true) && this.childBO1.CheckRules(true) )
{
this.childBo1.Save();
this.parentBO1.Save();
MessageBox.Show("Document has been saved", "Kernel Software",MessageBoxButtons.OK, MessageBoxIcon.Information);
}
All works fine. But I want to put validation code into the Parent Business object which will be dependent on what's in the child buisness object. e.g. Particular Customers (on the Parent Bo) can only purchase certain Products (on the child BO). So at the stage I am validating the Parent BO, I need to loop through the Child BO . I would like to put this valididation code into the CheckRulesOnCurrentRow on the parent BO but am not clear on how I will access the Child Business Object on the Parent Business Object. ( It cant really be done from the ChildBO because the Customer could be changed after a whole pile of products have been added ).
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
How to check Business Rules from a parent BO into a Child BO
Ger Cannoll
-
14 Years Ago
Hi Gerard, Since you are using a ChildForm dialog, the StrataFlix...
Edhy Rijo
-
14 Years Ago
Hi Edhy. Just checking the ChildBo will not be sufficient in my case...
Ger Cannoll
-
14 Years Ago
Edhy's suggestion will work really well to check rules before...
Greg McGuffey
-
14 Years Ago
Hi Greg. Many thnaks for your very detailed and informative reply...
Ger Cannoll
-
14 Years Ago
Hi Gerald, I'd tend to be more modular. I.e. I'd likely have methods...
Greg McGuffey
-
14 Years Ago
Hi Greg. From the purist point of view I can sort of see what youare...
Ger Cannoll
-
14 Years Ago
Not sure why I did it VB.NET... DirectCast is a cast:...
Greg McGuffey
-
14 Years Ago
Hi Greg I have that working very well now checking the Child Business...
Ger Cannoll
-
14 Years Ago
Glad it helped and you have it working. I'll be glad to continue the...
Greg McGuffey
-
14 Years Ago
Post Reply
Like
1
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search