private void DisplayOutings(Outings outing) { Console.WriteLine($"Date: {outing.Date.ToString("d")}"); Console.WriteLine($"Event Type: {outing.Type}"); Console.WriteLine($"Event Cost: ${outing.EventCost}"); Console.WriteLine($"Attendance: {outing.Attendance}"); Console.WriteLine($"Cost Per Person: ${outing.CostPerPerson}"); }
private void SeedContent() { Outings outing1 = new Outings(new DateTime(2020, 4, 30), EventType.GOLF, 10000m, 200, 50m); Outings outing2 = new Outings(new DateTime(2020, 5, 22), EventType.BOWLING, 5000m, 200, 25m); Outings outing3 = new Outings(new DateTime(2020, 5, 29), EventType.BOWLING, 500m, 10, 50m); Outings outing4 = new Outings(new DateTime(2020, 6, 21), EventType.AMUSEMENTPARK, 20000m, 400, 50m); Outings outing5 = new Outings(new DateTime(2020, 7, 4), EventType.CONCERT, 50000m, 500, 100m); _repo.AddOutingToDirectory(outing1); _repo.AddOutingToDirectory(outing2); _repo.AddOutingToDirectory(outing3); _repo.AddOutingToDirectory(outing4); _repo.AddOutingToDirectory(outing5); }
private void AddNewOuting() { Console.Clear(); Outings newOuting = new Outings(); Console.WriteLine("Enter Date of Outing(MM/DD/YYYY):"); newOuting.Date = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Enter Event Type:\n" + "1. Golf\n" + "2. Bowling\n" + "3. Amusement Park\n" + "4. Concert"); string typeAsString = Console.ReadLine(); int typeAsInt = int.Parse(typeAsString); newOuting.Type = (EventType)typeAsInt; Console.WriteLine("Enter Event Cost(no $):"); string costAsString = Console.ReadLine(); decimal costAsDecimal = decimal.Parse(costAsString); newOuting.EventCost = costAsDecimal; Console.WriteLine("Enter Number in Attendance:"); string attendanceAsString = Console.ReadLine(); int attendanceAsInt = int.Parse(attendanceAsString); newOuting.Attendance = attendanceAsInt; newOuting.CostPerPerson = costAsDecimal / attendanceAsInt; bool outingAdded = _repo.AddOutingToDirectory(newOuting); if (outingAdded == true) { Console.WriteLine("Outing successfully added to list"); } else { Console.WriteLine("Uh oh, something went wrong. The outing was NOT added."); } Console.Read(); }