public IControlValidation Create(FieldMacroRule info)
        {
            var parser = new XmlRulesParser();
            var rule   = parser.GetXmlRules(info);

            return(new DateToControlValidation
            {
                HasValue = true,
                ValidationValue = rule.Rule.Properties.T,
                ValidationRule = "date-to",
                ValidationErrorMessage = string.IsNullOrEmpty(info.ErrorMessage) ? "Date is greater than maximum" : info.ErrorMessage
            });
        }
        public IControlValidation Create(FieldMacroRule info)
        {
            var parser = new XmlRulesParser();
            var rule   = parser.GetXmlRules(info);

            return(new CompareToControlValidation
            {
                HasValue = true,
                ValidationValue = rule.Rule.Properties.T,
                ValidationRule = "equalto",
                ValidationErrorMessage = string.IsNullOrEmpty(info.ErrorMessage) ? "Not valid" : info.ErrorMessage
            });
        }
Exemplo n.º 3
0
        public IControlValidation Create(FieldMacroRule info)
        {
            var parser = new XmlRulesParser();
            var rule   = parser.GetXmlRules(info);

            return(new MinimumLengthControlValidation()
            {
                HasValue = true,
                ValidationValue = rule.Rule.Properties.T,
                ValidationRule = "minlength",
                ValidationErrorMessage = string.IsNullOrEmpty(info.ErrorMessage) ? "Length is less than minimum" : info.ErrorMessage
            });
        }
        public IControlValidation Create(FieldMacroRule info)
        {
            var parser = new XmlRulesParser();
            var rule   = parser.GetXmlRules(info);

            return(new RegularExpressionControlValidation()
            {
                HasValue = true,
                ValidationValue = rule.Rule.Properties.T,
                ValidationRule = "regular-expression",
                ValidationErrorMessage = string.IsNullOrEmpty(info.ErrorMessage) ? "Invalid data entered" : info.ErrorMessage,
                MacroValidationRule = info.MacroRule
            });
        }