예제 #1
0
 public ValidationResult(MemberInfo property, string message, ValidationLevelType level, object target, IEnumerable <ValidationResult> nestedValidationResults)
 {
     _property = property;
     _message  = message;
     _target   = target;
     NestedValidationResults = nestedValidationResults ?? new List <ValidationResult>();
     Level = level;
 }
예제 #2
0
 public ValidationResult(MemberInfo property, string message, ValidationLevelType level, object target, IEnumerable<ValidationResult> nestedValidationResults)
 {
     _property = property;
     _message = message;
     _target = target;
     NestedValidationResults = nestedValidationResults;
     Level = level;
 }
예제 #3
0
 public ValidationResult(MemberInfo property, string errorMessage, ValidationLevelType level, object target)
 {
     _property = property;
     _message  = errorMessage;
     _target   = target;
     NestedValidationResults = new List <ValidationResult>();
     Level = level;
 }
예제 #4
0
 public ValidationResult(MemberInfo property, string errorMessage, ValidationLevelType level, object target)
 {
     _property = property;
     _message = errorMessage;
     _target = target;
     NestedValidationResults = new List<ValidationResult>();
     Level = level;
 }
예제 #5
0
 public RuleValidatorContext(object instance, string propertyName, object propertyValue, ValidationLevelType level, MemberInfo propertyInfo, RuleValidatorContext parentContext)
 {
     Instance = instance;
     PropertyName = propertyName;
     PropertyValue = propertyValue;
     PropertyInfo = propertyInfo;
     Parent = parentContext;
     Level = level;
 }
예제 #6
0
 public RuleValidatorContext(object instance, string propertyName, object propertyValue, ValidationLevelType level, MemberInfo propertyInfo, RuleValidatorContext parentContext)
 {
     Instance      = instance;
     PropertyName  = propertyName;
     PropertyValue = propertyValue;
     PropertyInfo  = propertyInfo;
     Parent        = parentContext;
     Level         = level;
 }
예제 #7
0
        public RuleValidatorContext(object instance, PropertyValidator validator, RuleValidatorContext parentContext)
        {
            PropertyValue = validator.GetValueForProperty(instance);

            if (validator.PropertyNameOverride == null)
            {
                SelectPropertyName(instance, validator);
            }
            else
            {
                PropertyName = validator.PropertyNameOverride;
            }

            PropertyInfo = validator.PropertyInfo;
            Parent       = parentContext;
            Instance     = instance;
            Level        = validator.Level;
        }
예제 #8
0
 private void set_validation_level()
 {
     var name = this.GetType().Name.to_lower();
     if (name.EndsWith("requirement"))
     {
         ValidationLevel = ValidationLevelType.Requirement;
     }
     else if (name.EndsWith("suggestion"))
     {
         ValidationLevel = ValidationLevelType.Suggestion;
     }
     else if (name.EndsWith("note"))
     {
         ValidationLevel = ValidationLevelType.Note;
     }
     else
     {
         ValidationLevel = ValidationLevelType.Guideline;
     }
 }
예제 #9
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ReportValidationItemModel validationItem = (ReportValidationItemModel)value;

            ValidationLevelType level = ReportValidationBusiness.ValidationTypeByMessage[validationItem.WorkScheduleValidationType].Level;

            switch (level)
            {
            case ValidationLevelType.ERROR:
                return(DELETE_IMAGE_PATH);

            case ValidationLevelType.WARNING:
                return(WARNING_IMAGE_PATH);

            case ValidationLevelType.VALIDATED:
                return(VALIDATED_IMAGE_PATH);

            default:
                return(DEFAULT_IMAGE_PATH);
            }
        }
 public ValidationMessage(string propertyName, string errorMsg, ValidationLevelType validationLevel = ValidationLevelType.Error)
 {
     PropertyName = propertyName;
     ErrorMessage = errorMsg;
     ValidationLevel = validationLevel;
 }
 public PackageValidationResult(bool validated, string validationFailureMessage, ValidationLevelType validationLevel)
 {
     Validated = validated;
     ValidationFailureMessage = validationFailureMessage;
     ValidationLevel = validationLevel;
 }
예제 #12
0
 public void Add(string propertyName, string errorMessage, ValidationLevelType validationLevel = ValidationLevelType.Error)
 {
     Add(new ValidationMessage(propertyName, errorMessage, validationLevel));
 }
 public PackageValidationResult(bool validated, string validationFailureMessage, ValidationLevelType validationLevel)
 {
     Validated = validated;
     ValidationFailureMessage = validationFailureMessage;
     ValidationLevel          = validationLevel;
 }
예제 #14
0
 public ValidationMessage(string propertyName, string errorMsg, ValidationLevelType validationLevel = ValidationLevelType.Error)
 {
     PropertyName    = propertyName;
     ErrorMessage    = errorMsg;
     ValidationLevel = validationLevel;
 }
예제 #15
0
        private static List <string> GetReportedWorkScheduleIds(ReportValidationModel reportValidationModel, ValidationLevelType validationType)
        {
            List <string> rowsWithErrors = reportValidationModel.GetWorkScheduleIds(
                ReportValidationBusiness.WorkScheduleValidationTypeMessageList.Where(
                    ws => ws.Level == validationType).Select(ws => ws.ValidationType).ToList <WorkScheduleValidationType>());

            return(rowsWithErrors);
        }
예제 #16
0
 public WorkScheduleValidationTypeMessage(WorkScheduleValidationType validationType, ValidationLevelType level, string message)
 {
     _validationType = validationType;
     _level = level;
     _message = message;
 }