Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business Rule Logic
Message
De
01/03/2005 12:16:52
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, Californie, États-Unis
 
 
À
01/03/2005 09:01:13
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00991524
Message ID:
00991653
Vues:
13
This message has been marked as the solution to the initial question of the thread.
Hello Joe,

I think you just got your boolean logic mixed up.

Look at your statement again...

You'll get your broken rule added if any of those three <> statements resolves to true, and from what I can tell, one will always resolve to true, right?

I think you wanted "and" operators instead of "or" ones?

---J

>I am not able to save a record due to the following Business Rule not passing.
>Any thoughts on how I can correct my code to restrict the values to "Square", "RectangleLandscape" or "RectanglePortrait"?
>
>The value being tested, companyLogoShape, gets a database default of "Square" and this value is bound to a combobox that would only permit acceptable values yet I am not ever passing the validation criteria of my Business Rules object detailed below:
>
>
>' Validate the CompanyLogoShape
>    Public Function ValidateCompanyLogoShape(ByVal companyLogoShape As String) As String
>        Dim message As String = Nothing
>
>        If companyLogoShape <> "Square" _
>            Or companyLogoShape <> "RectangleLandscape" _
>            Or companyLogoShape <> "RectanglePortrait" Then
>            message = "Logo Shape must be either Square, " _
>            + "RectangleLandscape, or RectanglePortrait"
>            Me.AddErrorProviderBrokenRule("CompanyLogoShape", message)
>        End If
>        Return message
>    End Function
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform