예제 #1
0
        public static bool SecurityQuestionAnsweredCorrect(string username, string answer)
        {
            TravelExpertsContext    context = new TravelExpertsContext();
            CustomersAuthentication target  = context.CustomersAuthentications.SingleOrDefault(c => c.Username == username);

            if (target.SQAnswer1 == answer)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
        public static string GetSecurityQuestion(string username)
        {
            TravelExpertsContext context = new TravelExpertsContext();

            CustomersAuthentication target = context.CustomersAuthentications.SingleOrDefault(c => c.Username == username);

            string question;

            if (target == null)
            {
                question = null;
            }
            else
            {
                question = target.SecurityQuestion1;
            }

            return(question);
        }