예제 #1
0
        // there is a method to show available room //Show available rooms

        // Show info about the provided funcitons
        public static void ShowInfo()
        {
            Console.WriteLine("[Tour agent list] [Hotel's guests info] [Available rooms] [Customer's tour agent] [Tour agent's statistics]");
            Console.WriteLine("Or write anything to come back to the main menu");
            string input = Console.ReadLine();

            switch (input)
            {
            case ("Tour agent list"):
                TourAgentList();
                ShowInfo();
                break;

            case ("Hotel's guests info"):
                ShowBookedRoomCustomerInfo();
                ShowInfo();
                break;

            case ("Available rooms"):
                TourAgent.ShowAvailableRoom();
                ShowInfo();
                break;

            case ("Customer's tour agent"):
                Console.Write("Customer's id: ");
                int id = Convert.ToInt32(Console.ReadLine());
                CustomerTourAgent(id);
                ShowInfo();
                break;

            case ("Tour agent's statistics"):
                Console.Write("Tour agnet's name&surname: ");
                string tourAgentNameSurname = Console.ReadLine();
                ShowTourAgentStatics(tourAgentNameSurname);
                ShowInfo();
                break;

            default:
                RequestController.SelectCategory();
                break;
            }
        }
예제 #2
0
        public static void SelectCategory()
        {
            Console.WriteLine("Please , Select your category");
            Console.WriteLine("[Tour agent] [Customer] [Administrator]");
            string category = Console.ReadLine();

            switch (category)
            {
            case ("Tour agent"):
                string agentInfo = TourAgent.CheckTourAgent();
                if (agentInfo != "false")
                {
                    Console.WriteLine("How many people would you like to register?");
                    int numberOfPeople = Convert.ToInt32(Console.ReadLine());
                    if (numberOfPeople < 11)
                    {
                        for (int i = 0; i < numberOfPeople; i++)
                        {
                            TourAgent.RegisterCustomer(agentInfo);
                            Console.WriteLine("Please select an available room's number from the provided");
                            TourAgent.ShowAvailableRoom();
                            TourAgent.ConfirmRegistration();
                        }
                        ;
                        SelectCategory();
                    }
                    else
                    {
                        Console.WriteLine("Please, use only numbers from 0-9");
                    }
                }
                SelectCategory();
                break;

            case ("Customer"):
                Console.WriteLine("List of tour agents: ");
                Customer.ShowTourAgentList();
                Console.WriteLine("List of available rooms: ");
                TourAgent.ShowAvailableRoom();
                SelectCategory();
                break;

            case ("Administrator"):
                bool input = Administrator.CheckAdministrator();
                switch (input)
                {
                case (true):
                    Administrator.ShowInfo();
                    break;

                case (false):
                    Console.WriteLine("Wrong data provided!");
                    SelectCategory();
                    break;
                }
                break;

            default:
                Console.WriteLine("Please select from the provided");
                SelectCategory();
                break;
            }
        }