예제 #1
0
        /// <summary>
        /// Validate form-level request
        /// </summary>
        /// <param name="validationDictionary"></param>
        public bool ValidateRequest(IValidationDictionary validationDictionary)
        {
            var requestDictionary = new ValidationDictionary();

            if (Password != ConfirmPassword)
            {
                requestDictionary.AddError("Password", "Passwords do not match.");
            }
            validationDictionary.Merge(requestDictionary);
            return(requestDictionary.IsValid);
        }
예제 #2
0
        /// <summary>
        /// Validate form-level request
        /// </summary>
        /// <param name="validationDictionary"></param>
        public bool ValidateRequest(IValidationDictionary validationDictionary)
        {
            var requestDictionary = new ValidationDictionary();

            if (string.IsNullOrEmpty(ResetToken))
            {
                requestDictionary.AddError("ResetToken", "Reset token not specified.");
            }
            if (string.IsNullOrEmpty(Password))
            {
                requestDictionary.AddError("Password", "Password is required.");
            }
            if (Password != ConfirmPassword)
            {
                requestDictionary.AddError("Password", "Passwords do not match.");
            }
            validationDictionary.Merge(requestDictionary);
            return(requestDictionary.IsValid);
        }