Example #1
0
        //Sign in Page
        public bool SignInPage()
        {
            //loop until valid input or user choose 'back'
            while (true)
            {
                // ask for username
                Console.WriteLine("Please enter your Username:"******"Please enter your password:  or enter \"Back\" to main menu");
                string password = Console.ReadLine();

                if (password.ToLower().Equals("back"))
                {
                    return(false);
                }

                //check if the account exists
                //if exist, the AccountMatch method would also save information of account to CurrentAccount Class
                if (!BL.AccountMatch(username, password))
                {
                    Console.WriteLine("Username or Passward doesn't  match. Please try again.\n");
                }
                else
                {
                    //after sign in,open or create json file for saving bank account information
                    if (new BankAccountBL().FetchInfo())
                    {
                        break;
                    }
                }
            }//end of loop

            return(true);
        }