Ejemplo n.º 1
0
            /// <summary>
            /// Sets that a field's value must be lesser than another field's value.
            /// </summary>
            /// <remarks>Not implemented by the JQuery validate plugin. Done via a custom rule.</remarks>
            /// <param name="target">The target name (ie, a hint about the controller being validated)</param>
            /// <param name="comparisonFieldName">The name of the field to compare with.</param>
            /// <param name="validationType">The type of data to compare.</param>
            /// <param name="violationMessage">The violation message.</param>
            public void SetAsLesserThan(string target, string comparisonFieldName, IsLesserValidationType validationType,
                                        string violationMessage)
            {
                if (validationType != IsLesserValidationType.Decimal && validationType != IsLesserValidationType.Integer)
                {
                    return;
                }

                var prefixedComparisonFieldName = GetPrefixJQuerySelector(GetPrefixedFieldld(target, comparisonFieldName));

                ConfigureTarget(target, "lesserThan", String.Format("\"{0}\"", prefixedComparisonFieldName), violationMessage);
            }
Ejemplo n.º 2
0
			/// <summary>
			/// Sets that a field's value must be lesser than another field's value.
			/// </summary>
			/// <remarks>Not implemented by the JQuery validate plugin. Done via a custom rule.</remarks>
			/// <param name="target">The target name (ie, a hint about the controller being validated)</param>
			/// <param name="comparisonFieldName">The name of the field to compare with.</param>
			/// <param name="validationType">The type of data to compare.</param>
			/// <param name="violationMessage">The violation message.</param>
			public void SetAsLesserThan( string target, string comparisonFieldName, IsLesserValidationType validationType, string violationMessage )
			{
			}
		/// <summary>
		/// Initializes a new instance of the <see cref="ValidateIsLesserAttribute"/> class.
		/// </summary>
		/// <param name="type"><see cref="IsLesserValidationType"/>The data type to compare.</param>
		/// <param name="propertyToCompare">Target property to compare</param>
		/// <param name="errorMessage">The error message.</param>
		public ValidateIsLesserAttribute( IsLesserValidationType type, string propertyToCompare, string errorMessage )
			: base(propertyToCompare, errorMessage)
		{
			validator = new IsLesserValidator( type, propertyToCompare );
		}
Ejemplo n.º 4
0
		/// <summary>
		/// Initializes a IsLesserValidator of the given type and target property.
		/// </summary>
		/// <param name="type">The type of data to compare.</param>
		/// <param name="propertyToCompare">The name of the property to compare.</param>
		public IsLesserValidator( IsLesserValidationType type, string propertyToCompare )
			: base(propertyToCompare)
		{
			this.validationType = type;
		}
 /// <summary>
 /// Sets that a field's value must be lesser than another field's value.
 /// </summary>
 /// <remarks>Not implemented by the JQuery validate plugin. Done via a custom rule.</remarks>
 /// <param name="target">The target name (ie, a hint about the controller being validated)</param>
 /// <param name="comparisonFieldName">The name of the field to compare with.</param>
 /// <param name="validationType">The type of data to compare.</param>
 /// <param name="violationMessage">The violation message.</param>
 public void SetAsLesserThan(string target, string comparisonFieldName, IsLesserValidationType validationType, string violationMessage)
 {
 }
Ejemplo n.º 6
0
			/// <summary>
			/// Sets that a field's value must be lesser than another field's value.
			/// </summary>
			/// <remarks>Not implemented by the JQuery validate plugin. Done via a custom rule.</remarks>
			/// <param name="target">The target name (ie, a hint about the controller being validated)</param>
			/// <param name="comparisonFieldName">The name of the field to compare with.</param>
			/// <param name="validationType">The type of data to compare.</param>
			/// <param name="violationMessage">The violation message.</param>
			public void SetAsLesserThan(string target, string comparisonFieldName, IsLesserValidationType validationType,
			                            string violationMessage)
			{
				if (validationType != IsLesserValidationType.Decimal && validationType != IsLesserValidationType.Integer)
					return;

				string prefixedComparisonFieldName = GetPrefixJQuerySelector(GetPrefixedFieldld(target, comparisonFieldName));
				ConfigureTarget(target, "lesserThan", String.Format("\"{0}\"", prefixedComparisonFieldName), violationMessage);
			}
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a IsLesserValidator of the given type and target property.
 /// </summary>
 /// <param name="type">The type of data to compare.</param>
 /// <param name="propertyToCompare">The name of the property to compare.</param>
 public IsLesserValidator(IsLesserValidationType type, string propertyToCompare)
     : base(propertyToCompare)
 {
     this.validationType = type;
 }
Ejemplo n.º 8
0
 public void SetAsLesserThan(string target, string comparisonFieldName, IsLesserValidationType validationType, string violationMessage)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ValidateIsLesserAttribute"/> class.
 /// </summary>
 /// <param name="type"><see cref="IsLesserValidationType"/>The data type to compare.</param>
 /// <param name="propertyToCompare">Target property to compare</param>
 /// <param name="errorMessage">The error message.</param>
 public ValidateIsLesserAttribute(IsLesserValidationType type, string propertyToCompare, string errorMessage)
     : base(propertyToCompare, errorMessage)
 {
     validator = new IsLesserValidator(type, propertyToCompare);
 }
Ejemplo n.º 10
0
 public void SetAsLesserThan(string target, string comparisonFieldName, IsLesserValidationType validationType, string violationMessage)
 {
     throw new System.NotImplementedException();
 }