Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One to Many Save
Message
From
29/06/2006 17:58:48
Evans Carl
System Answers Consulting, Inc
Big Lake, Minnesota, United States
 
 
To
29/06/2006 17:48:03
Evans Carl
System Answers Consulting, Inc
Big Lake, Minnesota, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01128455
Message ID:
01132928
Views:
11
>>All,
>>
>>I want to be able to save an invoice by saving the header and all the line items at the same time. I can save the header and I can edit the line items.
>>
>>Can I create a method that iterates through the line item datarows and execute the LineItem.Save method against each datarow? I think I need call this new method is the PreSaveHook and retun false from the method to prevent the default Save behavior, is this correct?
>>
>>TIA
>>
>>Rex
>
>I

I would create a method with a Transaction and try/catch
try 
    insert header with Transaction
    for each line item
              insert line item with same transaction
    transaction.commit
catch 
    -- do some logging code
    transaction.rollback
end try
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°`°º¤ø¤º°¤º°
Carl Evans
CEO & President
System Answers Consulting, Inc.
MCSD .NET, ASP.NET, C#.NET, VB.NET,
Previous
Reply
Map
View

Click here to load this message in the networking platform