Пример #1
0
        private void AddOuting()
        {
            Console.WriteLine("Enter the Outing Number of People\n\t");
            string numberStr = Console.ReadLine();
            int    number    = int.Parse(numberStr);

            Console.WriteLine("Enter Event Date\n\tExample:mm/dd/yyyy");
            DateTime outingDate = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("What type of Outing was it?\n\t" +
                              "1. Golf\n\t" +
                              "2. Bowling\n\t" +
                              "3. Amusement Park\n\t" +
                              "4. Concert");
            int typeInput = int.Parse(Console.ReadLine());

            EventType type = _outingsRepo.GetTypeFromInput(typeInput);

            Console.WriteLine("Enter the Cost per Person");
            string personCostStr = Console.ReadLine();
            int    personCost    = int.Parse(personCostStr);

            Outings newOuting = new Outings(number, outingDate, type, personCost);

            _outingsRepo.AddOutingsToList(newOuting);
        }
Пример #2
0
        private void AddOutingToList()
        {
            Outings newOuting = new Outings();

            Console.Clear();
            Console.WriteLine("Choose the type of event you would like to add: \n" +
                              "1. Golf \n" +
                              "2. Bowling \n" +
                              "3. Amusement Park \n" +
                              "4. Concert");
            string inputAsString = Console.ReadLine();
            int    input         = int.Parse(inputAsString);

            switch (input)
            {
            case 1:
                newOuting.TypeOfEvent = EventType.Golf;
                break;

            case 2:
                newOuting.TypeOfEvent = EventType.Bowling;
                break;

            case 3:
                newOuting.TypeOfEvent = EventType.AmusementPark;
                break;

            case 4:
                newOuting.TypeOfEvent = EventType.Concert;
                break;
            }
            Console.Clear();
            Console.WriteLine("Please enter how many people attended this event: ");
            newOuting.NumberOfAttendees = int.Parse(Console.ReadLine());

            Console.Clear();
            Console.WriteLine("Please enter the cost per attendee: ");
            newOuting.CostPerPerson = decimal.Parse(Console.ReadLine());

            Console.Clear();
            Console.WriteLine("Please enter the date of the event: (example: 01/02/18)");
            newOuting.Date = DateTime.Parse(Console.ReadLine());
            _outingRepo.AddOutingToList(newOuting);
        }
Пример #3
0
 public void AddOutingsToList(Outings outings)
 {
     _outingsList.Add(outings);
 }
 public void AddOutingsToList(Outings outings)
 {
     _listOfOutings.Add(outings);
 }
 public void AddOutingToList(Outings newOuting)
 {
     _outingList.Add(newOuting);
 }