static void Main(string[] args)
        {
            CampgroundCLI cli = new CampgroundCLI();

            cli.RunProgram();
            Console.WriteLine("Thank you for using our Campsite Reservation System!");
        }
        public void Display()
        {
            while (true)
            {
                Console.WriteLine();
                Console.WriteLine("Select Command");
                Console.WriteLine("1] >> Search for Available Reservation");
                Console.WriteLine("2] >> Return to Previous Screen");

                Console.Write("What option do you want to select? ");
                string input = Console.ReadLine();

                if (input == "1")
                {
                    Console.WriteLine("Searching for an Available Reservation");
                    CampgroundCLI campground = new CampgroundCLI(parkID);
                    campground.GetAllCampgrounds();
                    MakeReservation();
                }
                else if (input == "2")
                {
                    Console.WriteLine("Returning to Previous Screen");
                    break;
                }
                else
                {
                    Console.WriteLine("Please try again");
                }
            }
        }
        public void RunCLI()
        {
            PrintHeader();
            PrintMenu();

            while (true)
            {
                string command = Console.ReadLine();

                Console.Clear();

                if (command.ToLower() == "q")
                {
                    Console.WriteLine("Thank you for using the campground reservation system");
                    return;
                }
                else if (int.Parse(command) <= numParks && int.Parse(command) > 0)
                {
                    CampgroundCLI cli = new CampgroundCLI(int.Parse(command));
                    cli.RunCampgroundCLI();
                }
                else
                {
                    Console.WriteLine("The command provided was not a valid command, please try again.");
                    break;
                }

                PrintMenu();
            }
        }
예제 #4
0
        static void Main(string[] args)
        {
            string        connectionString = ConfigurationManager.ConnectionStrings["CapstoneDatabase"].ConnectionString;
            CampgroundCLI cli = new CampgroundCLI();

            cli.RunCLI();
        }
예제 #5
0
        static void Main(string[] args)
        {
            // Sample Code to get a connection string from the
            // App.Config file
            // Use this so that you don't need to copy your connection string all over your code!
            string connectionString = ConfigurationManager.ConnectionStrings["CapstoneDatabase"].ConnectionString;

            CampgroundCLI program = new CampgroundCLI(connectionString);

            program.RunCLI();

            /* Tests for all  (We have some)
             * Make a reservation function
             * Formatting the user interface
             *
             * Search for park-wide reservations
             * Off-search
             * Search by campsite requirements (utilities, RV-length, etc)
             * View all upcoming reservations (30 days)
             */
        }