Exemplo n.º 1
0
        private static void Choose(Agency agency)
        {
            Choices();

            Int32.TryParse(Console.ReadLine(), out int choice);
            switch (choice)
            {
            case 1:
                //Create a new Rent
                agency.CreateRent();

                DoYouWantToContinue(agency);
                break;

            case 2:
                //View all rents
                agency.ViewAllRents();
                DoYouWantToContinue(agency);
                break;

            case 3:
                //View all car rents
                agency.ViewAllCarRents();
                DoYouWantToContinue(agency);
                break;

            case 4:
                //View all apartment rents
                agency.ViewAllApartmentRents();
                DoYouWantToContinue(agency);
                break;

            case 5:
                //View rent revenue
                agency.ViewAllRevenue();
                DoYouWantToContinue(agency);
                break;

            case 6:
                //View revenue from car rents
                agency.CarRentsRevenue();
                DoYouWantToContinue(agency);
                break;

            case 7:
                //View revenue from apartment rents
                agency.ApartmentRentsRevenue();
                DoYouWantToContinue(agency);
                break;

            case 8:
                // Get car rents for cars above 140 horsepowers
                agency.CarRentWith140HorsePowersAndAbove();
                DoYouWantToContinue(agency);
                break;

            case 9:
                //Get apartment rents for apartments above 100 square meters
                agency.ApartmentRentsWith100SquareMetersAndAbove();
                DoYouWantToContinue(agency);
                break;

            case 10:
                //View rent by Id
                agency.ViewRentByID();
                DoYouWantToContinue(agency);
                break;

            case 11:
                //Remove rent by id
                agency.RemoveRentByID();
                DoYouWantToContinue(agency);
                break;

            case 12:
                //View all cars and apartments available for rent
                agency.ViewAllAvailableRents();
                DoYouWantToContinue(agency);
                break;

            case 13:
                //-Add a car for rentn
                agency.AddCarForRent();
                DoYouWantToContinue(agency);
                break;

            case 14:
                //Add an apartment for rent
                agency.AddApartmentForRent();
                DoYouWantToContinue(agency);
                break;

            default:
                Console.WriteLine("Invalid input");
                DoYouWantToContinue(agency);
                break;
            }
        }