Ejemplo n.º 1
0
        private void AddOutingToList()
        {
            Console.WriteLine("Enter type of event you would like to add\n" +
                              "1.Golf\n" +
                              "2.Bowling\n" +
                              "3.AmusementPark\n" +
                              "4.Concert\n");
            int eventType = ParseInput();

            Console.Clear();

            EventType type = EventType.Concert;

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

            case 2:
                type = EventType.Bowling;
                break;

            case 3:
                type = EventType.AmusementPark;
                break;

            case 4:
                type = EventType.Concert;
                break;
            }
            Console.WriteLine("Enter the number of people that will attend the event");
            int numberOfPeopleThatAttended = int.Parse(Console.ReadLine());

            Console.Clear();

            Console.WriteLine("Enter the date and time this event will take place");
            DateTime datetime;

            if (DateTime.TryParse(Console.ReadLine(), out datetime))
            {
                Console.WriteLine("The date entered is:" + datetime);
            }
            else
            {
                Console.WriteLine("You have entered an incorrect value.");
            }
            Console.ReadLine();
            Console.Clear();

            Console.WriteLine("Enter the total cost per person for the event");
            decimal totalCostPerPersonForTheEvent = decimal.Parse(Console.ReadLine());

            Console.Clear();

            Console.WriteLine("Enter the total cost for the event");
            decimal totalCostForEventTheEvent = decimal.Parse(Console.ReadLine());

            Console.Clear();
            EventPlanning eventPlanning = new EventPlanning(numberOfPeopleThatAttended, datetime, totalCostPerPersonForTheEvent, totalCostForEventTheEvent, type);

            _eventrepo.AddEventPlanningList(eventPlanning);



            Console.Clear();
        }
Ejemplo n.º 2
0
 public void AddEventPlanningList(EventPlanning plan)
 {
     _listEventPlanning.Add(plan);
 }