Esempio n. 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);
        }
Esempio n. 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);
            });
        }
Esempio n. 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;
        }
Esempio n. 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);
 }
Esempio n. 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 );
                        } );
        }
Esempio n. 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);
 }