コード例 #1
0
 public void AddconcertToList(Outing newEventItem)
 {
     _ConcertList.Add(newEventItem);
 }
コード例 #2
0
 public void AddAPToList(Outing newEventItem)
 {
     _APList.Add(newEventItem);
 }
コード例 #3
0
 public void AddBowlingToList(Outing newEventItem)
 {
     _BowlingList.Add(newEventItem);
 }
コード例 #4
0
 public void AddGolfToList(Outing newEventItem)
 {
     _GolfList.Add(newEventItem);
 }
コード例 #5
0
 //This will allow the user to add a new menu item to the menu
 public void AddEventToList(Outing newEventItem)
 {
     _EventList.Add(newEventItem);
 }
コード例 #6
0
 public ProgramUI()
 {
     _outingRepo = new OutingRepository();
     _outing     = new Outing();
 }
コード例 #7
0
        private void AddNewOutingToList()
        {
            Console.Clear();
            EventType TheEventType = new EventType();

            Console.WriteLine("What is the type of Event?\n" +
                              "1. Golf\n" +
                              "2. Bowling\n" +
                              "3. Amusement Park\n" +
                              "4. Concert");
            string userinputOfTypeOfEvent = Console.ReadLine();
            int    NumberofEvent          = int.Parse(userinputOfTypeOfEvent);

            switch (NumberofEvent)
            {
            case 1:
                TheEventType = EventType.Golf;
                break;

            case 2:
                TheEventType = EventType.Bowling;
                break;

            case 3:
                TheEventType = EventType.Amusement_Park;
                break;

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

            Console.WriteLine("How many people were in attendance?");
            int AttendanceAtEvent = int.Parse(Console.ReadLine());

            Console.WriteLine("What was the date of the event? DD/MM/YYYY");
            DateTime dateTime = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("What was the cost of the event in total?");
            decimal CostofWholeEvent = decimal.Parse(Console.ReadLine());

            decimal TotalCostofEventPerPerson = CostofWholeEvent / AttendanceAtEvent;

            Outing EventToList = new Outing(AttendanceAtEvent, dateTime, TotalCostofEventPerPerson, CostofWholeEvent, TheEventType);

            switch (NumberofEvent)
            {
            case 1:
                _outingRepo.AddGolfToList(EventToList);
                break;

            case 2:
                _outingRepo.AddBowlingToList(EventToList);
                break;

            case 3:
                _outingRepo.AddAPToList(EventToList);
                break;

            case 4:
                _outingRepo.AddconcertToList(EventToList);
                break;
            }
            _outingRepo.AddEventToList(EventToList);

            Console.WriteLine("Event was successfully added to the list please press any key to continue.");
            Console.ReadKey();
        }
コード例 #8
0
 public void AddOutingToList(Outing outing)
 {
     _outing.Add(outing);
 }