Exemple #1
0
        private void ValidationCodeIsEmpty()
        {
            var propertyName = "UserValCode";

            if (string.IsNullOrEmpty(UserValCode))
            {
                AddError(propertyName,
                         new ValidationErrorInfo()
                {
                    ErrorCode    = ValCodeNULLERROCODE,
                    ErrorMessage = string.Format("验证码不能为空, 请输入:{0}! ", CurrValCode.ToLower())
                });
            }
            else
            {
                RemoveError(propertyName, ValCodeNULLERROCODE);
            }
        }
Exemple #2
0
        private void ValidationCode()
        {
            if (string.IsNullOrEmpty(UserValCode))
            {
                return;
            }

            var propertyName = "UserValCode";

            RemoveError(propertyName, ValCodeNULLERROCODE);
            if (UserValCode.ToLower() != CurrValCode.ToLower())
            {
                AddError(propertyName,
                         new ValidationErrorInfo()
                {
                    ErrorCode    = ValCodeERROCODE,
                    ErrorMessage = string.Format("输入的验证码不匹配, {0} 不为 {1}! ", UserValCode, CurrValCode.ToLower())
                });
            }
            else
            {
                RemoveError(propertyName, ValCodeERROCODE);
            }
        }