예제 #1
0
        public void AddOutingsToList()
        {
            Outings newOuting = new Outings();

            Console.Clear();
            Console.WriteLine("--------Hi, please choose the outing you want to add!\n");
            Console.WriteLine("\t1. Golf\n" +
                              "\t2. Bowling\n" +
                              "\t3. Amusement Park\n" +
                              "\t4. Concert\n");

            int choice = int.Parse(Console.ReadLine());

            switch (choice)
            {
            case 1:
                newOuting.Type = TypeOfOutings.Golf;
                break;

            case 2:
                newOuting.Type = TypeOfOutings.Bowling;
                break;

            case 3:
                newOuting.Type = TypeOfOutings.AmusementPark;
                break;

            case 4:
                newOuting.Type = TypeOfOutings.Concert;
                break;
            }
            Console.WriteLine("Pleae enter the cost per person:\n");
            newOuting.CostPerPerson = double.Parse(Console.ReadLine());

            Console.WriteLine("Date of event in the format of: mm dd yyyy\n");
            newOuting.EventDate = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Please enter no of people to attend the event:\n");
            newOuting.NumberOfPeople = int.Parse(Console.ReadLine());

            newOuting.TotalCost = newOuting.NumberOfPeople * newOuting.CostPerPerson;

            _outingsRepository.AddOutingToList(newOuting);
            Run();
        }
예제 #2
0
 public void AddOutingToList(Outings outings)
 {
     listOfOutings.Add(outings);
 }