Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for child record before saving parent
Message
From
29/08/2011 17:17:59
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 4.0
OS:
Windows Server 2003
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01522124
Message ID:
01522165
Views:
32
>I have a tool rental system for which I would like to avoid saving the main issue ticket until I am sure that I have at least one valid detail row. Of course, I don't want to save the detail row without a valid ticket either. I thought I could do that by making the detail row a child of the ticket but the parent rules are validated before checking the child records. Is this possible? If so, where do I put the check for existing child records? Thanks.

I would consider doing as you indicated and creating a parent entity, then a child entity. When the user completes the child entity, you can call any rules on it yourself prior to saving the whole thing. Then if the child record is valid, call the save on the parent which would also save the child. If they never complete the child, then don't save anything.
Timothy
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform