public void AddCompanyOutingToList()
        {
            Console.Clear();

            Console.WriteLine("Please enter the NAME of the event you want to add to the list of Company Outings");
            string eventName = Console.ReadLine();

            Console.WriteLine("Please select the EVENT TYPE");
            Console.WriteLine(
                "1. Golf\n" +
                "2. Bowling\n" +
                "3. Amusement Park\n" +
                "4. Concert");

            string eventTypeChoice = Console.ReadLine();

            EventType eventType = EventType.Golf;

            switch (eventTypeChoice)
            {
            case "1":
                eventType = EventType.Golf;
                break;

            case "2":
                eventType = EventType.Bowling;
                break;

            case "3":
                eventType = EventType.AmusementPark;
                break;

            case "4":
                eventType = EventType.Concert;
                break;

            default:
                Console.WriteLine("Please select a valid option");
                Console.ReadKey();
                AddCompanyOutingToList();
                break;
            }

            Console.WriteLine("Please enter the ATTENDENCE for the event");
            int eventAttendence = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Please enter the DATE of the event (Month, Day, Year)(Ex. June 3 2020)");
            string eventDate = Console.ReadLine();

            Console.WriteLine("Please enter the COST for one person to attend this event");
            double eventCost = Convert.ToDouble(Console.ReadLine());

            double eventTotalCost = (eventAttendence * eventCost);

            CompanyOutings outings = new CompanyOutings(eventName, eventType, eventAttendence, eventDate, eventCost, eventTotalCost);

            _repo.AddToOutingsList(outings);

            Console.WriteLine("Thank you for adding an event to the list of Company Outings!");
            Console.ReadKey();
            RunMenu();
        }
示例#2
0
 public void AddToOutingsList(CompanyOutings item)
 {
     _outingsList.Add(item);
 }