private MZRangeAttribute(string field, Type type, object minimum, object maximum) { this.Minimum = minimum; this.Maximum = maximum; this.OperandType = type; this.ErrorMessage = MZHelperValidators.GetMensagemIntervaloValor(field, minimum, maximum); }
public MZLengthAttribute(int minlength, int maxlength, string field) { this._min = minlength; this._max = maxlength; this._field = field; this.ErrorMessage = MZHelperValidators.GetMensagemTamanhoCampo(field, minlength, maxlength); }
public MZEmailAttribute(string field) : base(DataType.EmailAddress) { _field = field; _regex = new Regex(@"^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$", RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase); ErrorMessage = MZHelperValidators.GetMensagemCampoPrecisaSerUmEmail(_field); }
private static string GetFieldMustBeNumericResource(ControllerContext controllerContext) { return(GetUserResourceString(controllerContext, "FieldMustBeNumeric") ?? MZHelperValidators.GetMensagemCampoPrecisaSerUmNumero("{0}")); }
private void SetErrorMessage(string field, object value) { this.ErrorMessage = MZHelperValidators.GetMensagemMenorOuIgual(field, value); }
public MZRequiredAttribute(string field) { this.AllowEmptyStrings = false; this.ErrorMessage = MZHelperValidators.GetMensagemRequerido(field); }