Пример #1
0
        public override IEnumerable <ValidationResult> Validate()
        {
            if (this.Password != this.ConfirmPassword)
            {
                yield return(TfValidationResult.Compose("ConfirmPassword", nameof(this.Password), nameof(this.ConfirmPassword)));
            }

            if (CheckMember.CheckEmailExists(this.Email))
            {
                yield return(TfValidationResult.Compose("EmailExists", nameof(this.Email)));
            }

            if (CheckMember.CheckUsernameExists(this.Username))
            {
                yield return(TfValidationResult.Compose("UsernameExists", nameof(this.Username)));
            }

            yield return(TfValidationResult.FieldRequired(nameof(this.Username), this.Username));

            yield return(TfValidationResult.FieldRequired(nameof(this.Password), this.Password));

            yield return(TfValidationResult.FieldRequired(nameof(this.ConfirmPassword), this.ConfirmPassword));

            yield return(TfValidationResult.FieldRequired(nameof(this.Email), this.Email));

            yield return(TfValidationResult.FieldRequired(nameof(this.FirstName), this.FirstName));

            yield return(TfValidationResult.FieldRequired(nameof(this.LastName), this.LastName));
        }
Пример #2
0
        public override IEnumerable <ValidationResult> Validate()
        {
            yield return(TfValidationResult.CheckSessionActivity(this.SessionId, this.SessionKey));

            if (this.Handling)
            {
                TfValidationResult.FieldRequired(nameof(this.GroupId), this.GroupId);
                TfValidationResult.FieldRequired(nameof(this.Message), this.Message);
            }
        }
Пример #3
0
        public override IEnumerable <ValidationResult> Validate()
        {
            yield return(TfValidationResult.CheckSessionActivity(this.SessionId, this.SessionKey));

            yield return(TfValidationResult.FieldRequired(nameof(this.Username), this.Username));

            if (CheckAdd.CheckContactExists(this.SessionId, this.Username))
            {
                yield return(TfValidationResult.Compose("ContactExists", nameof(this.Username)));
            }
        }
Пример #4
0
        public override IEnumerable <ValidationResult> Validate()
        {
            yield return(TfValidationResult.FieldRequired(nameof(this.Username), this.Username));

            if (this.Mapping)
            {
                yield return(TfValidationResult.FieldRequired(nameof(this.SessionKey), this.SessionKey));
            }

            if (this.Handling)
            {
                yield return(TfValidationResult.FieldRequired(nameof(this.Password), this.Password));

                if (!CheckMember.CheckUsernamePasswordExists(this.Username, this.Password))
                {
                    yield return(TfValidationResult.Compose("InvalidLogin", nameof(this.Username), nameof(this.Password)));
                }
            }
        }
Пример #5
0
        public override IEnumerable <ValidationResult> Validate()
        {
            yield return(TfValidationResult.CheckSessionActivity(this.SessionId, this.SessionKey));

            if (this.Handling)
            {
                yield return(TfValidationResult.FieldRequired(nameof(this.GroupName), this.GroupName));

                yield return(TfValidationResult.FieldRequired(nameof(this.Members), this.Members));

                if (this.Members != null && this.Members.Count > 0)
                {
                    foreach (var member in this.Members)
                    {
                        if (!CheckMember.CheckUsernameExists(member))
                        {
                            yield return(TfValidationResult.Compose("UsernameNotExists", new[] { member }, nameof(this.Members)));
                        }
                    }
                }
            }
        }