Пример #1
0
        public decimal GetAllPeopleCount(Outings outing)
        {
            decimal totalCount = 0m;

            foreach (Outings person in _outingsList)
            {
                totalCount += person.PeopleAtEvent;
            }
            return(totalCount);
        }
Пример #2
0
        private void AddAnOuting()

        {
            Console.WriteLine("What Type of Event are you wanting to input information for?:\n" +
                              "1. Golf\n" +
                              "2. Bowling\n" +
                              "3. Amusement Park\n" +
                              "4. Concert\n" +
                              "5. See All Data.");

            string    inputAsString = Console.ReadLine();
            int       inputType     = int.Parse(inputAsString);
            EventType eventType     = EventType.None;

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

            case 2:
                eventType = EventType.Bowling;
                break;

            case 3:
                eventType = EventType.AmusementPark;
                break;

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


            Console.WriteLine("What Date was the Event?\n" +
                              "month/date/year.");
            string   dateofConcert = Console.ReadLine();
            DateTime dateOfEvent   = DateTime.Parse(dateofConcert);


            Console.WriteLine("How many people attended the Event?");
            string concert       = Console.ReadLine();
            int    peopleAtEvent = int.Parse(concert);

            Console.WriteLine("How much did each person pay?");
            string  costForPerson = Console.ReadLine();
            decimal costPerPerson = decimal.Parse(costForPerson);



            Outings outing = new Outings(eventType, dateOfEvent, peopleAtEvent, costPerPerson);

            _outings_Repository.AddOutingToList(outing);
        }
Пример #3
0
 public void AddOutingToList(Outings outings)
 {
     _outingsList.Add(outings);
 }