/// <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); }
/// <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 ); }
/// <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) { }
/// <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); }
/// <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; }
public void SetAsLesserThan(string target, string comparisonFieldName, IsLesserValidationType validationType, string violationMessage) { throw new System.NotImplementedException(); }
/// <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); }