public void ListAllParks()
        {
            ParkSqlDAL parkSqlDAL = new ParkSqlDAL(dbconnectionString);

            List <Park> testPark = new List <Park>();

            testPark = parkSqlDAL.ListAllParkNames();

            Assert.IsNotNull(testPark);
            Assert.AreEqual(park_num, testPark.Count);
        }
Esempio n. 2
0
        public static bool ParkExists(int input)
        {
            string databaseconnectionString = ConfigurationManager.ConnectionStrings["CapstoneDatabase"].ConnectionString;

            ParkSqlDAL  doesParkExist = new ParkSqlDAL(databaseconnectionString);
            List <Park> parksToCheck  = doesParkExist.ListAllParkNames();

            if (input <= parksToCheck.Count)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public void PrintMainMenu()
        {
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Select a park for further details:  ");
            ParkSqlDAL  menuPrint    = new ParkSqlDAL(databaseconnectionString);
            List <Park> parksToPrint = menuPrint.ListAllParkNames();

            for (int i = 0; i < parksToPrint.Count; i++)
            {
                Console.WriteLine((i + 1).ToString() + ") " + parksToPrint[i].Name);
            }
            Console.WriteLine("Q) Quit");
        }
Esempio n. 4
0
        public void PrintParkDetails(int input)
        {
            Console.Clear();
            ParkSqlDAL  parkDetails  = new ParkSqlDAL(databaseconnectionString);
            List <Park> listOfParks  = parkDetails.ListAllParkNames();
            Park        parkToDetail = new Park();

            try
            {
                parkToDetail = parkDetails.GetParkDetails(listOfParks[input - 1].Name.ToString());
            }
            catch (SqlException ex)
            {
                Console.WriteLine("Invalid input.  Please try again.");
                return;
            }
            Console.WriteLine(parkToDetail.ToString());
            Console.WriteLine();
            Park.WrapText(parkToDetail);
        }