Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetAllEntities and Saving Changes at one time
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01276286
Message ID:
01276405
Vues:
20
Yassin,

>I have a business object that retrives information using Businessobject.GetAllEntities. I want to make changes to the list retrived and update the database at the sametime. The following piece of code doesnt work for me.
>
>
>  Private Function Save() As Boolean
>
>        Me.oOSPBusinessRules.GetAllEntities()
>
>        Me.oOSPBusinessRules.Entity.SettingName = "DisplayCCSiteTermsToCustomerUponCheckout"
>        Me.oOSPBusinessRules.Entity.SettingValue = IIf(Me.DisplayCCSiteTermsToCustomerUponCheckoutCheckBox.Checked, 1, 0)
>
>
>        Me.oOSPBusinessRules.Entity.SettingName = "DisplayeCheckSiteTermsToCustomerUponCheckout"
>        Me.oOSPBusinessRules.Entity.SettingValue = IIf(Me.DisplayeCheckSiteTermsToCustomerUponCheckout.Checked, 1, 0)
>
>        Me.oOSPBusinessRules.Entity.SettingName = "StudentProfileRules.ValidateStudentInformation"
>        Me.oOSPBusinessRules.Entity.SettingValue = IIf(Me.DisplayStudentProfileRulesValidateStudentInformationCheckBox.Checked, 1, 0)
>
>        Me.oOSPBusinessRules.Entity.SettingName = "DisplayeCheckSiteTermsToCustomerUponCheckout"
>        Me.oOSPBusinessRules.Entity.SettingValue = IIf(Me.DisplayeCheckSiteTermsToCustomerUponCheckout.Checked, 1, 0)
>
>        Me.oOSPBusinessRules.Entity.SettingName = "OSPProductBV.SendEmail"
>        Me.oOSPBusinessRules.Entity.SettingValue = IIf(Me.DisplayStudentProfileRulesOSPProductBVSendEmailCheckBox.Checked, 1, 0)
>
>        Dim Result As OakLeaf.MM.Main.Business.mmSaveDataResult = Me.oOSPBusinessRules.SaveEntityList()
>        If Result = OakLeaf.MM.Main.Business.mmSaveDataResult.RulesBroken Then
>            Dim BrokenRules As String = oOSPBusinessRules.Rules.GetAllBrokenRules()
>            MessageBox1.ShowError(BrokenRules)
>            Return False
>        Else
>            Return True
>        End If
>
>    End Function
>
>
When calling GetEntityList() you should be working with the business object's EntityList property rather than the Entity property--unless you just want to affect the first entity in the list (which is automatically stored in the Entity property when you call GetEntityList().

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform