private void CreateNewOuting() { Console.WriteLine("Enter the number for the event type of the outing:\n" + "1. Golf\n" + "2. Bowling\n" + "3. Amusement Park\n" + "4. Concert"); int eventType = ParseInput(); EventType type; switch (eventType) { default: 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($"Please enter the number of attendants"); int attendants = ParseInput(); Console.WriteLine("Please enter the date of the event(dd/mm/yy)"); DateTime dateOfEvent = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Enter the cost per person for the event"); decimal costPerPerson = decimal.Parse(Console.ReadLine()); Console.WriteLine("Please enter the total cost of the event"); decimal eventCost = decimal.Parse(Console.ReadLine()); OutingInformation outing = new OutingInformation(type, attendants, dateOfEvent, costPerPerson, eventCost); _outingRepo.AddOutingToList(outing); Console.WriteLine($"\"{outing.Type}\" on {outing.DateOfEvent} has been added to list."); Console.ReadKey(); }
public void AddOutingToList(OutingInformation outing) { _outingInfo.Add(outing); }