Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Required but allow Zero
Message
De
18/10/2010 11:46:05
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Required but allow Zero
Divers
Thread ID:
01485947
Message ID:
01485947
Vues:
135
Hi,

I've used the Business Layer Generator and it has generated a rule like this for a field:
		/// <summary>
		/// Validates the Min Age
		/// </summary>
		public string ValidateMinAge(byte minAge)
		{
			string Msg = null;
			if (mmType.IsEmpty(minAge))
			{
				this.EntityPropertyDisplayName = "Minimum Age";

				Msg = this.RequiredFieldMessagePrefix + 
					this.EntityPropertyDisplayName + 
					this.RequiredFieldMessageSuffix;

				AddErrorProviderBrokenRule("MinAge",  Msg);
			}
			return Msg;
		}
This causes a zero value to be invalid. What do I do to disallow null values but allow a zero value?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform