Exemple #1
0
        internal static void BookFlightTicket()
        {
            Console.Write("Enter flight name: ");
            string addFlightTicket = Console.ReadLine();

            FlightRepository.BookFlightTicket(addFlightTicket);
        }
Exemple #2
0
        internal static void RemoveFlightDetails()
        {
            Console.WriteLine("Flights available");
            FlightRepository.ViewFlightDetails();
            Console.WriteLine("Enter the item no you want to remove: ");
            int removeFlight = Int32.Parse(Console.ReadLine());

            FlightRepository.RemoveFlightDetails(removeFlight);
        }
Exemple #3
0
        internal static void PortalEntry()
        {
            FlightRepository.ViewFlightDetails();
            Console.WriteLine("Do you want to book ticket[yes/no]: ");
            string input = Console.ReadLine().ToLower();

            if (input.Equals("yes"))
            {
                SelectChoice();
            }
            else
            {
                Console.WriteLine("Thank you for visiting our website!!!");
            }
        }
Exemple #4
0
        static void UserOption()
        {
            UserManager userManager = new UserManager();
            string      status;

            do
            {
                Console.WriteLine("Enter your choice: \n1.View flight details\n2.Book flight ticket\n3.Display user details\n4.remove user\n5.Search user\n6.Update user");
                int userChoice = Int32.Parse(Console.ReadLine());
                switch (userChoice)
                {
                case 1:
                    FlightRepository.ViewFlightDetails();
                    break;

                case 2:
                    FlightManager.BookFlightTicket();
                    break;

                case 3:
                    UserRepository.DisplayUserDetails();
                    break;

                case 4:
                    userManager.RemoveUser();
                    break;

                case 5:
                    userManager.SearchUser();
                    break;

                case 6:
                    userManager.UpdateUser();
                    break;

                default:
                    Console.WriteLine("Please enter a valid choice!!!");
                    break;
                }
                Console.WriteLine("Do you want to continue[yes/no]");
                status = Console.ReadLine().ToLower();
            } while (status == "yes");
        }
Exemple #5
0
        internal static void AddFlightDetails()
        {
            Console.WriteLine("Enter Flight name: ");
            string flightName = Console.ReadLine();

            Console.WriteLine("Enter source point: ");
            string sourcePoint = Console.ReadLine();

            Console.WriteLine("Enter destination point: ");
            string destinationPoint = Console.ReadLine();

            Console.WriteLine("Enter no of seats available: ");
            int noOfSeats = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Enter ticket cost: ");
            double ticketCost = double.Parse(Console.ReadLine());
            Flight flight     = new Flight(flightName, sourcePoint, destinationPoint, noOfSeats, ticketCost);

            FlightRepository.AddFlightDetails(flight);
        }
Exemple #6
0
        static void AdminOption()
        {
            string status;

            do
            {
                Console.WriteLine("Enter your choice: \n1.Add flight details\n2.View flight details\n3.Clear all flight details\n4.Update flight details\n5.Remove flight details");
                int adminChoice = Int32.Parse(Console.ReadLine());
                switch (adminChoice)
                {
                case 1:
                    FlightManager.AddFlightDetails();
                    break;

                case 2:
                    FlightRepository.ViewFlightDetails();
                    break;

                case 3:
                    FlightRepository.ClearAllFlightDetails();
                    break;

                case 4:
                    FlightManager.UpdateFlightDetails();
                    break;

                case 5:
                    FlightManager.RemoveFlightDetails();
                    break;

                default:
                    Console.WriteLine("Invalid option chosen please try again!!!");
                    break;
                }
                Console.WriteLine("Do you want to continue[yes/no]");
                status = Console.ReadLine().ToLower();
            } while (status == "yes");
        }