/// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            IList <Park> parks    = parkDAO.GetAllParks();
            int          key      = int.Parse(choice) - 1;
            Park         park     = parks[key];
            SubMenu1     subMenu1 = new SubMenu1(park, campgroundDAO, siteDAO, reservationDAO);

            subMenu1.Run();

            //switch (choice)
            //{
            //    case "1": // Do whatever option 1 is. You may prompt the user for more information
            //                // (using the Helper methods), and then pass those values into some
            //                //business object to get something done.
            //        int i1 = GetInteger("Enter the first integer: ");
            //        int i2 = GetInteger("Enter the second integer: ");
            //        Console.WriteLine($"{i1} + {i2} = {i1+i2}");
            //        Pause("Press enter to continue");
            //        return true;    // Keep running the main menu
            //    case "2": // Do whatever option 2 is
            //        string name = GetString("What is your name?");
            //        WriteError($"Not yet implemented, {name}.");
            //        Pause("");
            //        return true;    // Keep running the main menu
            //    case "3":
            //        // Create and show the sub-menu
            //        SubMenu1 sm = new SubMenu1();
            //        sm.Run();
            //        return true;    // Keep running the main menu
            //}
            return(true);
        }
Exemple #2
0
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            switch (choice)
            {
            case "1":     // Do whatever option 1 is. You may prompt the user for more information
                          // (using the Helper methods), and then pass those values into some
                          //business object to get something done.
                int i1 = GetInteger("Enter the first integer: ");
                int i2 = GetInteger("Enter the second integer: ");
                Console.WriteLine($"{i1} + {i2} = {i1+i2}");
                Pause("Press enter to continue");
                return(true); // Keep running the main menu

            case "2":         // Do whatever option 2 is
                string name = GetString("What is your name?");
                WriteError($"Not yet implemented, {name}.");
                Pause("");
                return(true);       // Keep running the main menu

            case "3":
                // Create and show the sub-menu
                SubMenu1 sm = new SubMenu1();
                sm.Run();
                return(true);       // Keep running the main menu
            }
            return(true);
        }
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            switch (choice)
            {
            case "1":     // Do whatever option 1 is. You may prompt the user for more information
                          // (using the Helper methods), and then pass those values into some
                          //business object to get something done.
                Console.WriteLine();

                // set color here?
                SetColor(ConsoleColor.Blue);
                Console.WriteLine("CURRENT INVENTORY");
                Console.WriteLine("**********************");
                Console.WriteLine(ourVendingMachine.DisplayInventory());
                ResetColor();
                Pause("");
                return(true);                                  // Keep running the main menu

            case "2":                                          // Do whatever option 2 is
                SubMenu1 sm = new SubMenu1(ourVendingMachine); // Create and show the sub-menu
                sm.Run();
                return(true);                                  // Keep running the main menu
            }
            return(true);
        }
Exemple #4
0
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            switch (choice)
            {
            case "1":
                Console.Clear();
                while (true)
                {
                    SetColor(ConsoleColor.Green);
                    Console.WriteLine(Figgle.FiggleFonts.Standard.Render("Parks"));
                    ResetColor();

                    SetColor(ConsoleColor.White);
                    ListParks();
                    ResetColor();
                    int  parkID = GetInteger("Select a Park for Further Details");
                    Park park   = ParkDAO.GetInfoById(parkID);
                    if (parkID != park.Park_Id)
                    {
                        Console.Clear();
                        SetColor(ConsoleColor.White);
                        Console.WriteLine("Sorry that park isn't in the list! Press enter to return to the previous screen");
                        ResetColor();
                        Console.ReadLine();
                        Console.Clear();
                    }
                    else if (parkID == park.Park_Id)
                    {
                        Console.Clear();
                        SetColor(ConsoleColor.Green);
                        Console.WriteLine(Figgle.FiggleFonts.Standard.Render("Parks"));
                        ResetColor();

                        SetColor(ConsoleColor.Green);
                        Console.WriteLine($"------|{park.Name,-4}|------");
                        SetColor(ConsoleColor.White);
                        Console.WriteLine($"Location: {park.Location}");
                        Console.WriteLine($"Established: {park.Establish_Date.ToString("M / d / yyyy")}");
                        Console.WriteLine($"Area: {park.Area}");
                        Console.WriteLine($"Annual Visitors: {park.Vistors}");
                        Console.WriteLine(park.Description);
                        ResetColor();
                        break;
                    }
                }
                Pause("");
                return(true);

            case "2":
                SubMenu1 sm = new SubMenu1(CampgroundDAO, ParkDAO, SiteDAO, ReservationDAO);
                sm.Run();
                Pause("");
                return(true);
            }
            return(true);
        }
Exemple #5
0
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            switch (choice)
            {
            case "1":
                Console.Clear();

                SetColor(ConsoleColor.DarkCyan);
                Console.WriteLine("------------------------------------------------");
                Console.WriteLine("Vendo-Matic 800 - Tech Elevator Cleveland Campus");
                Console.WriteLine("------------------------------------------------");
                ResetColor();
                foreach (KeyValuePair <string, Capstone.Models.Item> entry in vm.Inventory)
                {
                    Console.Write($"{entry.Value.Name}");
                    if (entry.Value.QuantityAvailable == 0)
                    {
                        SetColor(ConsoleColor.Red);
                        Console.Write($" SOLD OUT\n");
                        ResetColor();
                    }
                    else
                    {
                        Console.Write($"| Qty {entry.Value.QuantityAvailable}\n");
                    }
                }
                Pause("");
                return(true); // Keep running the main menu

            case "2":         // Do whatever option 2 is

                SubMenu1 purchaseMenu = new SubMenu1(vm);
                purchaseMenu.Run();

                return(true);       // Keep running the main menu

            case "3":


                return(false);       // Keep running the main menu
            }
            return(true);
        }
Exemple #6
0
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            string countryCode;

            switch (choice)
            {
            case "1":     // Do whatever option 1 is
                WriteError("Not yet implemented");
                Pause("");
                return(true); // Keep running the main menu

            case "2":         // Do whatever option 2 is
                WriteError("Not yet implemented");
                Pause("");
                return(true); // Keep running the main menu

            case "3":         // Create and show the sub-menu
                SubMenu1 sm = new SubMenu1();
                sm.Run();
                return(true);       // Keep running the main menu
            }
            return(true);
        }
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            switch (choice)
            {
            case "1":     // Do whatever option 1 is
                int i1 = GetInteger("Enter the first integer: ");
                int i2 = GetInteger("Enter the second integer: ");
                Console.WriteLine($"{i1} + {i2} = {i1+i2}");
                Pause("Press enter to continue");
                return(true); // Keep running the main menu

            case "2":         // Do whatever option 2 is
                WriteError("Not yet implemented");
                Pause("");
                return(true); // Keep running the main menu

            case "3":         // Create and show the sub-menu
                SubMenu1 sm = new SubMenu1();
                sm.Run();
                return(true);       // Keep running the main menu
            }
            return(true);
        }