private void ManageMainMenuScreen()
        {
            MenuOption userMenuChoice;

            _consoleView.DisplayWelcomeScreen();

            userMenuChoice = _consoleView.MainMenu();

            switch (userMenuChoice)
            {
            case MenuOption.None:
                break;

            case MenuOption.SetupAccount:
                _salesperson = _consoleView.DisplaySetupAccount();

                ManageApplicationLoop();
                break;

            case MenuOption.StartFromSave:
                DisplayLoadAccountInfo();
                ManageApplicationLoop();
                break;

            case MenuOption.Exit:
                break;

            default:
                ConsoleUtil.DisplayMessage("I have no words that explain how amazed I am you got this to display");
                break;
            }
        }
Beispiel #2
0
 private void DisplaySetupAccount()
 {
     //
     // setup initial salesperson account
     //
     _salesperson = _consoleView.DisplaySetupAccount();
     _salesperson.Logs.Push(DateTime.Now + " ... Account Created!");
 }
Beispiel #3
0
        /// <summary>
        /// method to manage the application setup and control loop
        /// </summary>
        private void ManageApplicationLoop()
        {
            MenuOption userMenuChoice;

            _consoleView.DisplayWelcomeScreen();

            //
            // setup initial salespersons account
            //
            _salesperson = _consoleView.DisplaySetupAccount();

            //
            // application loop
            //
            while (_usingApplication)
            {
                //
                // get a menu choice from the user
                //
                userMenuChoice = _consoleView.DisplayGetUserMenuChoice();

                //
                // choose an action based on the user menu choice
                //
                switch (userMenuChoice)
                {
                case MenuOption.None:
                    break;

                case MenuOption.Travel:
                    Travel();
                    break;

                case MenuOption.DisplayCities:
                    DisplayCities();
                    break;

                case MenuOption.DisplayAccountInfo:
                    DisplayAccountInfo();
                    break;

                case MenuOption.Exit:
                    _usingApplication = false;
                    break;

                default:
                    break;
                }
            }

            _consoleView.DisplayClosingScreen();

            //
            // close the application
            //
            Environment.Exit(1);
        }
Beispiel #4
0
        public void ManageApplicationLoop()
        {
            MenuOption userMenuChoice;

            _consoleView.DisplayWelcomeScreen();

            _salesperson = _consoleView.DisplaySetupAccount();

            while (_usingApplication)
            {

                userMenuChoice = _consoleView.DisplayGetUserMenuChoice();

                switch (userMenuChoice)
                {
                    case MenuOption.None:
                        break;
                    case MenuOption.Travel:
                        Travel();
                        break;
                    case MenuOption.Buy:
                        Buy();
                        break;
                    case MenuOption.Sell:
                        Sell();
                        break;
                    case MenuOption.DisplayInventory:
                        DisplayInventory();
                        break;
                    case MenuOption.DisplayCities:
                        DisplayCities();
                        break;
                    case MenuOption.DisplayAccountInfo:
                        DisplayAccountInfo();
                        break;
                    case MenuOption.SaveAccountInfo:
                        SaveAccountInfo();
                        break;
                    case MenuOption.LoadAccountInfo:
                        LoadAccountInfo();
                        break;
                    case MenuOption.Exit:
                        _usingApplication = false;
                        break;
                    default:
                        break;
                }
            }

            _consoleView.DisplayClosingScreen();

            Environment.Exit(1);

        }
        /// <summary>
        /// method to manage the application setup and control loop
        /// </summary>
        private void ManageApplicationLoop()
        {
            MenuOption userMenuChoice;

            _consoleView.DisplayWelcomeScreen();

            // Display and setup salesperson account
            _salesperson = _consoleView.DisplaySetupAccount();

            // Start application loop
            while (_usingApplication)
            {

                // Get user menu choice
                userMenuChoice = _consoleView.DisplayGetUserMenuChoice();

                // Do something with menu choice
                switch (userMenuChoice)
                {
                    case MenuOption.None:
                        break;
                    case MenuOption.Travel:
                        Travel();
                        break;
                    case MenuOption.DisplayCities:
                        DisplayCities();
                        break;
                    case MenuOption.DisplayAccountInfo:
                        DisplayAccountInfo();
                        break;
                    case MenuOption.Exit:
                        _usingApplication = false;
                        break;
                    default:
                        break;
                }
            }

            _consoleView.DisplayClosingScreen();

            //
            // close the application
            //
            Environment.Exit(1);
        }
 private void SetupAccount()
 {
     _salesperson = _consoleView.DisplaySetupAccount();
 }
Beispiel #7
0
        /// <summary>
        /// method to manage the application setup and control loop
        /// </summary>
        private void ManageApplicationLoop()
        {
            MenuOption userMenuChoice;

            _consoleView.DisplayWelcomeScreen();

            //
            //setup intial salesperson



            //
            //application loop
            //
            while (_usingApplication)
            {
                //
                // get a menu choice from user
                //


                userMenuChoice = _consoleView.DisplayGetUserMenuChoice();

                //
                //choose an action based on user menu choice

                switch (userMenuChoice)
                {
                case MenuOption.None:
                    break;

                case MenuOption.SetupAccount:
                    _salesperson = _consoleView.DisplaySetupAccount();
                    break;

                case MenuOption.UpdateAccountInfo:
                    DisplayUpdateAccountInfo();
                    break;

                case MenuOption.Travel:
                    Travel();
                    break;

                case MenuOption.DisplayCities:
                    DisplayCities();
                    break;

                case MenuOption.DisplayAccountInfo:
                    DisplayAccountInfo();
                    break;

                case MenuOption.Buy:
                    Buy();
                    break;

                case MenuOption.Sell:
                    Sell();
                    break;

                case MenuOption.DisplayInventory:
                    DisplayInventory();
                    break;

                case MenuOption.SaveAccountInfo:
                    DisplaySaveAccountInfo();
                    break;

                case MenuOption.LoadAccountInfo:
                    DisplayLoadAccountInfo();
                    break;

                case MenuOption.Exit:
                    _usingApplication = false;
                    break;

                default:
                    break;
                }
            }

            //
            // close the application
            //
            Environment.Exit(1);
        }
        private void ManageApplicationLoop()
        {
            MenuOption userMenuChoice;

            _consoleView.DisplayWelcomeScreen();

            //
            // setup initial salesperson account
            //
            _salesperson = _consoleView.DisplaySetupAccount();

            //
            // application loop
            //
            while (_usingApplication)
            {
                //
                // get a menu choice from the ConsoleView object
                //
                userMenuChoice = _consoleView.DisplayGetUserMenuChoice();

                //
                // menu structure with correlating methods
                //
                switch (userMenuChoice)
                {
                case MenuOption.None:
                    break;

                case MenuOption.Travel:
                    Travel();
                    break;

                case MenuOption.Buy:
                    Buy();
                    break;

                case MenuOption.Sell:
                    Sell();
                    break;

                case MenuOption.DisplayInventory:
                    DisplayInventory();
                    break;

                case MenuOption.DisplayCities:
                    DisplayCities();
                    break;

                case MenuOption.DisplayAccountInfo:
                    DisplayAccountInfo();
                    break;

                case MenuOption.Exit:
                    _usingApplication = false;
                    break;

                default:
                    break;
                }
            }

            _consoleView.DisplayClosingScreen();

            //
            // end the application
            //
            Environment.Exit(1);
        }