예제 #1
0
        private void SeeCosts()
        {
            Console.Clear();

            List <Outing> masterList    = new List <Outing>();
            List <Outing> golfList      = _repo.GetGolfList();
            List <Outing> bowlingList   = _repo.GetBowlingList();
            List <Outing> themeParkList = _repo.GetThemeParkList();
            List <Outing> concertList   = _repo.GetConcertList();

            Console.WriteLine("Which events would you like costs of? \n[1) All Events 2) Golf 3) Bowling 4) Theme Parks 5) Concerts");
            int userDisplaySelection = int.Parse(Console.ReadLine());

            switch (userDisplaySelection)
            {
            case 1:
                decimal golfCost      = _repo.CostOfGolfEvents();
                decimal bowlingCost   = _repo.CostOfBowlingEvents();
                decimal themeParkCost = _repo.CostOfThemeParkEvents();
                decimal concertCost   = _repo.CostOfConcertEvents();

                decimal totalCost = golfCost + bowlingCost + themeParkCost + concertCost;
                Console.WriteLine($"Total cost is ${totalCost}");
                Console.ReadKey();
                break;

            case 2:
                decimal totalGolfCost = _repo.CostOfGolfEvents();
                Console.WriteLine($"{totalGolfCost}");
                break;

            case 3:
                decimal totalBowlingCost = _repo.CostOfBowlingEvents();
                Console.WriteLine($"{totalBowlingCost}");
                break;

            case 4:
                decimal totalThemeParkCost = _repo.CostOfThemeParkEvents();
                Console.WriteLine($"{totalThemeParkCost}");
                break;

            case 5:
                decimal totalConcertCost = _repo.CostOfConcertEvents();
                Console.WriteLine($"{totalConcertCost}");
                break;

            default:
                break;
            }
        }
예제 #2
0
        private void SeeListOfOutings()
        {
            EventType     TheEventType = new EventType();
            List <Outing> _outinglist  = _outingRepo.GetEventList();
            List <Outing> _Golflist    = _outingRepo.GetGolfList();
            List <Outing> _APlist      = _outingRepo.GetAPList();
            List <Outing> _Bowlinglist = _outingRepo.GetBowlingList();
            List <Outing> _Concertlist = _outingRepo.GetConcertList();

            Console.Clear();
            Console.WriteLine("What would you like t do?\n" +
                              "1. See All Events and total cost?\n" +
                              "2. See a Specific Event Type total cost");
            string UserinputMenu = Console.ReadLine();


            switch (UserinputMenu)
            {
            case "1":
                foreach (Outing outing in _outinglist)
                {
                    Console.WriteLine($"{outing.TypeOfEvent} {outing.DateOfEvent.ToString("d")} \n" +
                                      $"Attendance - {outing.Attendees} Cost Per-Person - {outing.CostOfEventPerPerson.ToString("C2")}\n " +
                                      $"Total Cost - {outing.TotalCostOfEvent.ToString("C2")}");
                }
                Console.WriteLine($"Total Cost = {_outingRepo.AllEventTotalCost(_outinglist).ToString("C2")}");
                Console.ReadKey();
                break;

            case "2":
                Console.WriteLine("what is the type of event?\n" +
                                  "1. golf\n" +
                                  "2. bowling\n" +
                                  "3. amusement park\n" +
                                  "4. concert");
                string userinputoftypeofevent = Console.ReadLine();
                int    numberofevent          = int.Parse(userinputoftypeofevent);
                switch (numberofevent)
                {
                case 1:
                    foreach (Outing outing in _Golflist)
                    {
                        Console.WriteLine($"{outing.TypeOfEvent} {outing.DateOfEvent.ToString("d")} \n" +
                                          $"Attendance - {outing.Attendees} Cost Per-Person - {outing.CostOfEventPerPerson.ToString("C2")}\n " +
                                          $"Total Cost - {outing.TotalCostOfEvent.ToString("C2")}");
                    }
                    Console.WriteLine($"Total Cost = {_outingRepo.AllEventTotalCost(_Golflist).ToString("C2")}");
                    Console.ReadKey();
                    break;

                case 2:
                    foreach (Outing outing in _APlist)
                    {
                        Console.WriteLine($"{outing.TypeOfEvent} {outing.DateOfEvent.ToString("d")} \n" +
                                          $"Attendance - {outing.Attendees} Cost Per-Person - {outing.CostOfEventPerPerson.ToString("C2")}\n " +
                                          $"Total Cost - {outing.TotalCostOfEvent.ToString("C2")}");
                    }
                    Console.WriteLine($"Total Cost = {_outingRepo.AllEventTotalCost(_APlist).ToString("C2")}");
                    Console.ReadKey();
                    break;

                case 3:
                    foreach (Outing outing in _Bowlinglist)
                    {
                        Console.WriteLine($"{outing.TypeOfEvent} {outing.DateOfEvent.ToString("d")} \n" +
                                          $"Attendance - {outing.Attendees} Cost Per-Person - {outing.CostOfEventPerPerson.ToString("C2")}\n " +
                                          $"Total Cost - {outing.TotalCostOfEvent.ToString("C2")}");
                    }
                    Console.WriteLine($"Total Cost = {_outingRepo.AllEventTotalCost(_Bowlinglist).ToString("C2")}");
                    Console.ReadKey();
                    break;

                case 4:
                    foreach (Outing outing in _Concertlist)
                    {
                        Console.WriteLine($"{outing.TypeOfEvent} {outing.DateOfEvent.ToString("d")} \n" +
                                          $"Attendance - {outing.Attendees} Cost Per-Person - {outing.CostOfEventPerPerson.ToString("C2")}\n " +
                                          $"Total Cost - {outing.TotalCostOfEvent.ToString("C2")}\n");
                    }
                    Console.WriteLine($"Total Cost = {_outingRepo.AllEventTotalCost(_Concertlist).ToString("C2")}");
                    Console.ReadKey();
                    break;
                }
                break;
            }
        }