Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicated Broken Rules Message at bottom page?
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01175129
Message ID:
01177060
Vues:
9
Liew,

>Even I have done the child obj registration, it will just show the warning message in the last tab where the user saves the record, but I would prefer to display the warning message for the invalid entry in the respective tab. So the validation will be done for each tab when the tab index is changed. Currently I'm using the following function for my validations. Is there a better way to do so? Thanks.
>
>
>            saveResult = Me.oAddress.Rules.CheckRules(Me.oAddress.DataSet, Me.oAddress.TableName, True)
>
>            Select Case saveResult
>                Case mmSaveDataResult.RulesPassed
>                    Return True
>                Case mmSaveDataResult.Exception
>                    ' Do something
>                    Return False
>                Case Else
>                    ' Do something
>                    Return False
>             End Select
>
Yes, there is a better way. If you call CheckRules() directly on the business object, it will automatically call CheckRules() on all child business objects and bubble all errors up to the parent business object. However, the mmBusinessObject.CheckRules() method is protected, so you need to create a public wrapper method on ABusinessObject in order to call this method directly. For example:
Public Function CallCheckRules() As mmSaveDataResult
    Return Me.CheckRules(Me, Me.DataSet, Me.TableName)
End Function
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