Esempio n. 1
0
        public static string GetValidationErrorMessage(ValidationModelException error, string cultureName = null)
        {
            if (error.ValidatorType == typeof(RequiredValidator))
            {
                return(string.Format(Instance.GetString("ErrMandatoryFieldRequired"), EidssFields.Get(error.PropertyName, null)));
            }

            return(Instance.GetString(error.MessageId, error.MessageId, cultureName));
        }
Esempio n. 2
0
 public bool OnValidationEnd(ValidationModelException ex)
 {
     if (ValidationEnd != null)
     {
         var args = new ValidationEventArgs(ex.MessageId, ex.FieldName, ex.PropertyName, ex.Pars, ex.ValidatorType, ex.Obj, ex.ValidationType);
         ValidationEnd(this, args);
         return args.Continue;
     }
     return false;
 }
Esempio n. 3
0
 protected bool ChainsValidate(FFTemplateLookup obj, bool bRethrowException)
 {
     ValidationModelException ex = ChainsValidate(obj);
     if (ex != null)
     {
         if (bRethrowException)
             throw ex;
         if (!obj.OnValidation(ex))
         {
             obj.OnValidationEnd(ex);
             return false;
         }
     }
     return true;
 }
Esempio n. 4
0
            protected bool ChainsValidate(HACodeLookup obj, bool bRethrowException)
            {
                ValidationModelException ex = ChainsValidate(obj);

                if (ex != null)
                {
                    if (bRethrowException)
                    {
                        throw ex;
                    }
                    if (!obj.OnValidation(ex))
                    {
                        obj.OnValidationEnd(ex);
                        return(false);
                    }
                }
                return(true);
            }
Esempio n. 5
0
            protected bool ChainsValidate(VetAggregateActionDetailed obj, bool bRethrowException)
            {
                ValidationModelException ex = ChainsValidate(obj);

                if (ex != null)
                {
                    if (bRethrowException)
                    {
                        throw ex;
                    }
                    if (!obj.OnValidation(ex))
                    {
                        obj.OnValidationEnd(ex);
                        return(false);
                    }
                }
                return(true);
            }
Esempio n. 6
0
            protected bool ChainsValidate(SmphGisBaseReferenceTranslationLookup obj, bool bRethrowException)
            {
                ValidationModelException ex = ChainsValidate(obj);

                if (ex != null)
                {
                    if (bRethrowException)
                    {
                        throw ex;
                    }
                    if (!obj.OnValidation(ex))
                    {
                        obj.OnValidationEnd(ex);
                        return(false);
                    }
                }
                return(true);
            }