예제 #1
0
        public bool AuthenticateUser(IUser user)
        {
            User authenticatedUser = user as User;

            if (authenticatedUser != null)
            {
                foreach (var registeredUser in ContainerOfUsers.GetRegisteredUsers())
                {
                    if (authenticatedUser.EqualsByEmail(registeredUser))
                    {
                        if (authenticatedUser.EqualsByPassword(registeredUser))
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
예제 #2
0
        public void ValidateUserInput()
        {
            Console.Write("Enter your email: ");
            string userEmail = Console.ReadLine();

            Console.Write("Enter your password: "******"Welcome!");
                    user = db.GetUserWithFullInfo(user);
                    Console.WriteLine(user.GetFullInfo());
                    db.SetLastLoginTime(user);
                }
            }
            else
            {
                Console.WriteLine("Unsuccessful attempt. Try again.");
            }
        }