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); }
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); }
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)); }
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"); }
public RuleMemberPermissionsCriteria(IRuleBaseProperties properties) : base(properties) { }
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) { }
public RuleValidCodeIdentifier(IRuleBaseProperties properties) : base(properties) { properties.CustomMessageTemplate = ErrorMessage; }
public CodeRuleObjectIsValidRule(IRuleBaseProperties properties) : base(properties) { }
public PivotGridSavedLayoutDeleteRule(IRuleBaseProperties properties) : base(properties) { }
public PacientDocumentValueRule(IRuleBaseProperties properties) : base(properties) { }
public ForexTradeRule(IRuleBaseProperties properties) : base(properties) { }
public RuleObjectPermissionsCriteria(IRuleBaseProperties properties) : base(properties) { }
public PacientPolisValueRule(IRuleBaseProperties properties) : base(properties) { }
public XmlContentCodeRule(IRuleBaseProperties properties) : base(properties) { }
public ClaveFuerte(IRuleBaseProperties properties) : base(properties) { }
public RuleClassInfoMerge(IRuleBaseProperties properties) : base(properties) { properties.CustomMessageTemplate = ErrorMessage; }
public CustomCodeRule(IRuleBaseProperties properties) : base(properties) { }
public GenLedgerRule(IRuleBaseProperties properties) : base(properties) { }
public DSValueRule(IRuleBaseProperties properties) : base(properties) { }
public EditableProtocolValueRule(IRuleBaseProperties properties) : base(properties) { }
public RuleDocumentoValido(IRuleBaseProperties properties) : base(properties) { }
public PasswordStrengthCodeRule(IRuleBaseProperties properties) : base(properties) { }
public RuleCriteriaValidationBase(IRuleBaseProperties properties) : base(properties) { }
/// <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); }