Example #1
0
        /// <summary>
        /// Allow user to login
        /// </summary>
        /// <param name="username">User input for username</param>
        /// <param name="password">User input for password</param>
        public void Login(string username, string password)
        {
            var loginSuccess = _credentialManager.CheckCredential(username, password);

            if (loginSuccess)
            {
                _status = AppStatus.UserActions;
                Console.Clear();
            }
            else
            {
                Console.Clear();
                _output.Send("INFO: Login Failed");
                _output.Send("1 Try again");
                var response = _input.ReadData();
                if (response == "1")
                {
                    Console.Clear();
                    return;
                }
                else
                {
                    Console.Clear();
                    Run();
                }
            }
        }