Esempio n. 1
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;
            }
        }