Ejemplo n.º 1
0
        private void makeReservationErrors(int campgroundID_input)
        {
            DateTime arrivalDate;
            string   msg = "";

            do
            {
                Console.ForegroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("     What date would you like to arrive? (MM/DD/YYYY) ");
                Console.ResetColor();
                arrivalDate             = Convert.ToDateTime(Console.ReadLine());
                msg                     = cliHelper.CheckArrivalDates(DateTime.Today, arrivalDate);
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine();
                if (msg == errorMssg100)
                {
                    Console.WriteLine(msg);
                }
            }while (msg == errorMssg100);

            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.WriteLine("     What date will you be leaving? (MM/DD/YYYY) ");
            Console.ResetColor();
            DateTime departDate = Convert.ToDateTime(Console.ReadLine());

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine();
            if (cliHelper.CheckDepartDates(DateTime.Today, arrivalDate, departDate) == errorMssg101)
            {
                Console.WriteLine(errorMssg101);
                Console.ResetColor();
                MakeReservationMenu();
            }

            if (cliHelper.CheckParkOpenMonths(campgroundDAO.FindCampground(campgroundID_input), arrivalDate, departDate))
            {
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("     Would you like to search for additional criteria? (Y/N)");
                Console.ResetColor();
                if (Console.ReadLine().ToLower() == "y")
                {
                    Console.Clear();
                    AdvancedSearchMenu(campgroundID_input, arrivalDate, departDate);
                    //if no campsites meet criteria, say something and dont continue to next method
                }
                Console.ResetColor();
                Console.Clear();
                MountainASCII();
                AvailableCampsites(campgroundID_input, arrivalDate, departDate);
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("              Unfortunately, this Park is not open for the dates you entered. " +
                                  "\n     You may enter 'Y' to enter new dates, or any other key to return to the main menu.");
                string newDates = Console.ReadLine().ToLower();
                if (newDates == "y")
                {
                    MakeReservationMenu();
                }
                else
                {
                    Console.Clear();
                    PrintHeader();
                    PrintMenu();
                    RunCLI();
                }
            }
        }