Пример #1
0
        /// <summary>
        /// Handles Account information
        /// </summary>
        private void Account()
        {
            const int MAKE_TRANSACTION = 1;
            const int VIEW_TRANSACTION = 2;
            const int REFRESH          = 3;
            const int LOGOUT           = 4;
            const int LOGOUT_EXIT      = 0;

            int  selection;
            bool bLoggedIn = true;

            List <int> rules = new List <int>
            {
                MAKE_TRANSACTION, VIEW_TRANSACTION, REFRESH, LOGOUT, LOGOUT_EXIT
            };

            Console.Title = "KISS Banking - Account";

            while (bLoggedIn)
            {
                mcAccount = Task.Run(() => GetAccountEventRaised.Invoke()).Result;

                Console.Clear();

                AccountView.MainMenuHeader(GetUsernameEventRaised.Invoke());
                AccountView.AccountAmount(mcAccount.mcAccountBalance.mBalance.ToString());

                selection = ConsoleHelper.ValidateSelection(
                    AccountView.MainMenuSelections, rules
                    );

                switch (selection)
                {
                case MAKE_TRANSACTION:
                    MakeTransaction();
                    break;

                case VIEW_TRANSACTION:
                    DisplayTransactions();
                    break;

                case REFRESH:
                    break;

                case LOGOUT:
                    Logout();
                    bLoggedIn = false;
                    break;

                case LOGOUT_EXIT:
                    bLoggedIn = false;
                    Exit();
                    break;
                }
            }
        }