コード例 #1
0
        public void PrintSpaceList(int menuID)
        {
            IList <Space> allSpaces = spaceDAO.GetAllSpacesInVenue(menuID);

            Console.WriteLine();
            Console.WriteLine("Space #".PadRight(10) + "Name".PadRight(27) + "Open".PadRight(10) + "Close".PadRight(10) + "Daily Rate".PadRight(15) +
                              "Max Occupancy");
            Console.WriteLine("------------------------------------------------------------------------------------");

            foreach (Space space in allSpaces)
            {
                Console.WriteLine(space.SpaceListToString());
            }
            Console.WriteLine();

            string spaceListSelection = "";

            while (spaceListSelection != "R")
            {
                Console.WriteLine();
                Console.WriteLine("What would you like to do next?");
                Console.WriteLine("1) Reserve a space");
                Console.WriteLine("R) Return to Venue Detail Menu");
                spaceListSelection = Console.ReadLine().ToUpper();

                switch (spaceListSelection)
                {
                case "1":
                    ReserveSpaceMenu(menuID);
                    break;

                case "R":
                    return;

                default:
                    Console.WriteLine("Please enter a valid selection.");
                    break;
                }
            }
        }