Exemplo n.º 1
0
 public void AddFailure(ValidationFailure validationFailure)
 {
     this._validationFailures.Add(validationFailure);
 }
        private void ProcessFailure(ValidationFailure failure)
        {
            if (failure.Exception != null)
            {
                this.FlashExceptionChain(failure.Exception, failure.DisplayMessage);
                return;
            }

            // Don't display message in flash if the key is set
            if (failure.HasMessage && string.IsNullOrWhiteSpace(failure.ModelStateKey))
            {
                switch (failure.FlashLevel)
                {
                    case FlashLevelType.Error:
                        this.FlashError(failure.DisplayMessage);
                        break;
                    case FlashLevelType.Warning:
                        this.FlashWarning(failure.DisplayMessage);
                        break;
                    case FlashLevelType.Info:
                        this.FlashInfo(failure.DisplayMessage);
                        break;
                }
            }
        }
 public static void AddFailure(this IUseEventBroker implementsEventBroker, ValidationFailure validationRule)
 {
     implementsEventBroker.EventBroker.AddFailure(validationRule);
 }
Exemplo n.º 4
0
 public void AddFailure(ValidationFailure validationFailure)
 {
     this._validationFailures.Add(validationFailure);
 }