Ejemplo n.º 1
0
        private void AddOutingToList()

        {
            Console.WriteLine("Enter the number for the type of event:\n" +
                              "1. Golf\n" +
                              "2. Bowling\n" +
                              "3. Amusement Park\n" +
                              "4. Concert");
            int outingType = ParseInput();

            OutingType type;

            switch (outingType)
            {
            default:
            case 1:
                type = OutingType.Golf;
                break;

            case 2:
                type = OutingType.Bowling;
                break;

            case 3:
                type = OutingType.AmusementPark;
                break;

            case 4:
                type = OutingType.Concert;
                break;
            }


            Console.WriteLine($"How many people attended");
            int numberPeople = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter the date of outing(dd/mm/yy");
            DateTime outingDate = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Enter the cost per person");
            decimal outingCpp = decimal.Parse(Console.ReadLine());

            Console.WriteLine("Enter the cost per event");
            decimal costPerEvent = decimal.Parse(Console.ReadLine());

            OutingEvent outing = new OutingEvent(type, numberPeople, outingDate, outingCpp, costPerEvent);

            _outingRepo.AddOutingToList(outing);
            Console.WriteLine($"\"{outing.OutingCPP}\" added to list:");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
 public void AddOutingToList(OutingEvent outing)
 {
     _outingEvent.Add(outing);
 }