Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parent-Child Delete?
Message
De
02/07/2008 14:21:13
 
 
À
02/07/2008 09:03:00
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01328201
Message ID:
01328333
Vues:
11
I don't think I understand the delete process in the framework.

I have an entity with 20 records "ReportReturnSum". In this scenerio I have 20 child records in the "ReportReturnHeader" table with a 1-to-1 relationship to the "ReportReturnSum" table.

I would think that as each record in the "ReportReturnSum" entity is deleted my

Protected Overrides Sub HookParentNavigated(ByVal bizObj As mmBusinessObject, ByVal e As mmBusinessStateChangeEventArgs)
Me.GetReportReturnSumByFK(CType(e.PrimaryKeyValue, Guid))
End Sub

method would be called for each record in "ReportReturnSum" as it is being deleted.

The only method that gets fired in my "ReportReturnHeader" BO is the

Protected Overrides Sub HookParentRetrieved(ByVal bizObj As mmBusinessObject, ByVal e As mmBusinessStateChangeEventArgs)
Me.GetReportReturnSumByFK(CType(e.PrimaryKeyValue, Guid))
End Sub

method when the "ReportReturnSum" entity is filled by

Public Function SelectReportReturnSumByCaseFK(ByVal CasePK As String) As mmBindingList(Of ReportReturnSumEntity)
'Get a dataset of the data we want to delete
Me.GetEntityList("Select * From ReportReturnSum Where rrs_chdGUIDFK = @CasePK", Me.CreateParameter("@CasePK", CasePK))

Return Me.EntityList
End Function

Since the "ReportReturnHeader" HookParentRetrieved method is fired when the entity is filled only one record in "ReportReturnHeader" is being deleted.

Do I have to loop through my "ReportReturnSum" entity and delete each entity 1-by-1 to get the children of that entity to delete too?

Thanks

-Bob S.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform