Exemplo n.º 1
0
        RuleType GetRuleType(IRuleBaseProperties validationRule)
        {
            var modelClass = ((IModelNode)validationRule).Application.BOModel[validationRule.TargetType.FullName];

            if (modelClass != null)
            {
                var ruleType = GetRuleType(modelClass, validationRule);
                return(ruleType != RuleType.Critical ? ruleType : GetRuleType(validationRule as IRulePropertyValueProperties, modelClass));
            }
            return(RuleType.Critical);
        }
Exemplo n.º 2
0
 public override bool IsValidate(out string message, IRuleBaseProperties properties, RuleBase rule)
 {
     var existedNames = base.GetReadableVariants();
     if (existedNames != null)
     {
         if (existedNames.Any(x => x.CodeVariant == this.CodeVariant))
         {
             message = "�Ѿ����ڴ˱�������,���޸�!";
             return false;
         }
     }
     return base.IsValidate(out message, properties, rule);
 }
Exemplo n.º 3
0
        public override bool IsValidate(out string message, IRuleBaseProperties properties, RuleBase rule)
        {
            var existedNames = base.GetReadableVariants();

            if (existedNames != null)
            {
                if (existedNames.Any(x => x.CodeVariant == this.CodeVariant))
                {
                    message = "已经存在此变量名称,请修改!";
                    return(false);
                }
            }
            return(base.IsValidate(out message, properties, rule));
        }
Exemplo n.º 4
0
        protected RuleType GetRuleType(IRuleBaseProperties properties)
        {
            var resultType = properties.ResultType;

            switch (resultType)
            {
            case ValidationResultType.Error:
                return(RuleType.Critical);

            case ValidationResultType.Information:
                return(RuleType.Information);

            case ValidationResultType.Warning:
                return(RuleType.Warning);
            }

            throw new InvalidOperationException("Unknown ResultType");
        }
Exemplo n.º 5
0
 public RuleMemberPermissionsCriteria(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 6
0
        RuleType GetRuleType(IModelClass modelClass, IRuleBaseProperties validationRule)
        {
            var ruleErrorTypeAttribute = modelClass.TypeInfo.FindAttributes <RuleErrorTypeAttribute>().FirstOrDefault(attribute => attribute.Id == validationRule.Id);

            return(ruleErrorTypeAttribute != null ? ruleErrorTypeAttribute.RuleType : RuleType.Critical);
        }
 public DispServiceListValueRule(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 8
0
 public RuleValidCodeIdentifier(IRuleBaseProperties properties) : base(properties)
 {
     properties.CustomMessageTemplate = ErrorMessage;
 }
 public CodeRuleObjectIsValidRule(IRuleBaseProperties properties)
     : base(properties)
 {
 }
Exemplo n.º 10
0
 public PivotGridSavedLayoutDeleteRule(IRuleBaseProperties properties)
     : base(properties)
 {
 }
Exemplo n.º 11
0
 public PacientDocumentValueRule(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 12
0
 public ForexTradeRule(IRuleBaseProperties properties)
     : base(properties)
 {
 }
Exemplo n.º 13
0
 public RuleObjectPermissionsCriteria(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 14
0
 public PacientPolisValueRule(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 15
0
 public XmlContentCodeRule(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 16
0
 public ClaveFuerte(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 17
0
 public RuleClassInfoMerge(IRuleBaseProperties properties) : base(properties)
 {
     properties.CustomMessageTemplate = ErrorMessage;
 }
Exemplo n.º 18
0
 public CustomCodeRule(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 19
0
 public GenLedgerRule(IRuleBaseProperties properties)
     : base(properties)
 {
 }
Exemplo n.º 20
0
 public DSValueRule(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 21
0
 public EditableProtocolValueRule(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 22
0
 public RuleDocumentoValido(IRuleBaseProperties properties) : base(properties)
 {
 }
 public PasswordStrengthCodeRule(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 24
0
 public RuleCriteriaValidationBase(IRuleBaseProperties properties) : base(properties)
 {
 }
Exemplo n.º 25
0
        /// <summary>
        /// 获取可读变量
        /// </summary>
        /// <returns></returns>
        //public virtual List<VariantDefine> GetReadableVariants()
        //{
        //    var list = new List<VariantDefine>();
        //    #region 平级代码的变量

        //    if (ParentUnit != null)
        //    {
        //        var child =
        //            ParentUnit.ChildrenUnits.OfType<VariantDefine>()
        //                .Where(x => x.Index < this.Index)
        //                .OrderBy(x => x.Index);
        //        foreach (var c in child)
        //        {
        //            var p = c as ParameterDefine;
        //            if (p == null || p.ParameterType == ParameterType.Input)
        //                list.Add(c);
        //        }
        //        list.AddRange(ParentUnit.GetReadableVariants());
        //    }

        //    #endregion

        //    return list;
        //}

        //public virtual List<VariantDefine> GetWriteableVariants()
        //{
        //    return null;
        //}

        public virtual bool IsValidate(out string message, IRuleBaseProperties properties, RuleBase rule)
        {
            message = "";
            return(true);
        }