예제 #1
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="securityQuestion">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual(SecurityQuestion securityQuestion)
        {
            if (securityQuestion == null)
            {
                return(false);
            }

            var valuesEqual =
                Equals(_questionNote, securityQuestion._questionNote) &&
                Equals(_answerNote, securityQuestion._answerNote);

            return(valuesEqual);
        }
예제 #2
0
        /// <summary>
        /// Adds the security question.
        /// </summary>
        /// <param name="securityQuestion">The security question.</param>
        public virtual void AddSecurityQuestion(SecurityQuestion securityQuestion)
        {
            Check.IsNotNull(securityQuestion, "Security question is required.");

            DomainRuleEngine.CreateRuleEngine <SystemAccount, SecurityQuestion> (this, () => AddSecurityQuestion)
            .WithContext(securityQuestion)
            .Execute(
                () =>
            {
                securityQuestion.SystemAccount = this;
                _securityQuestions.Add(securityQuestion);
                NotifyItemAdded(() => _securityQuestions, securityQuestion);
            });
        }
예제 #3
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="securityQuestion">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>           
        public virtual bool ValuesEqual(SecurityQuestion securityQuestion)
        {
            if (securityQuestion == null)
            {
                return false;
            }

            var valuesEqual =
                Equals(_questionNote, securityQuestion._questionNote) &&
                Equals(_answerNote, securityQuestion._answerNote);

            return valuesEqual;
        }
예제 #4
0
 /// <summary>
 /// Removes the security question.
 /// </summary>
 /// <param name="securityQuestion">The security question.</param>
 public virtual void RemoveSecurityQuestion(SecurityQuestion securityQuestion)
 {
     Check.IsNotNull(securityQuestion, "Security question is required.");
     _securityQuestions.Remove(securityQuestion);
     NotifyItemRemoved(() => SecurityQuestions, securityQuestion);
 }
예제 #5
0
        /// <summary>
        /// Adds the security question.
        /// </summary>
        /// <param name="securityQuestion">The security question.</param>
        public virtual void AddSecurityQuestion(SecurityQuestion securityQuestion)
        {
            Check.IsNotNull(securityQuestion, "Security question is required.");

            DomainRuleEngine.CreateRuleEngine<SystemAccount, SecurityQuestion> ( this, () => AddSecurityQuestion )
                .WithContext ( securityQuestion )
                .Execute (
                    () =>
                        {
                            securityQuestion.SystemAccount = this;
                            _securityQuestions.Add ( securityQuestion );
                            NotifyItemAdded ( () => _securityQuestions, securityQuestion );
                        } );
        }
예제 #6
0
 /// <summary>
 /// Removes the security question.
 /// </summary>
 /// <param name="securityQuestion">The security question.</param>
 public virtual void RemoveSecurityQuestion(SecurityQuestion securityQuestion)
 {
     Check.IsNotNull(securityQuestion, "Security question is required.");
     _securityQuestions.Remove(securityQuestion);
     NotifyItemRemoved(() => SecurityQuestions, securityQuestion);
 }