private void AddOuting() { Console.Clear(); Outings newOuting = new Outings(); Console.WriteLine("Enter the type of outing:\n" + "1. Golf\n" + "2. Bowling\n" + "3. Amusement Park\n" + "4. Concert"); string outingAsString = Console.ReadLine(); int outingAsInt = int.Parse(outingAsString); newOuting.Event = (EventTypes)outingAsInt; Console.WriteLine(newOuting.Event); Console.WriteLine("Enter the number of employees in attendance:"); newOuting.Attendance = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter the date (yyyy/mm/dd, press enter after each line):"); int year = Convert.ToInt32(Console.ReadLine()); int month = Convert.ToInt32(Console.ReadLine()); int day = Convert.ToInt32(Console.ReadLine()); newOuting.Date = new DateTime(year, month, day); Console.WriteLine("Enter the total cost:"); newOuting.TotalCost = Convert.ToDouble(Console.ReadLine()); _outingsRepo.AddNewOuting(newOuting); }
private void SeedData() { DateTime dateOne = new DateTime(2019, 04, 15); DateTime dateTwo = new DateTime(2019, 05, 23); DateTime dateThree = new DateTime(2019, 07, 10); DateTime dateFour = new DateTime(2019, 09, 25); Outings outingOne = new Outings(EventTypes.Bowling, 10, dateOne, 30.25); Outings outingTwo = new Outings(EventTypes.AmusementPark, 20, dateTwo, 375.65); Outings outingThree = new Outings(EventTypes.Concert, 25, dateThree, 750.75); Outings outingFour = new Outings(EventTypes.Golf, 12, dateFour, 315.48); _outingsRepo.AddNewOuting(outingOne); _outingsRepo.AddNewOuting(outingTwo); _outingsRepo.AddNewOuting(outingThree); _outingsRepo.AddNewOuting(outingFour); }
public void AddNewOuting(Outings newOuting) { _listOfOutings.Add(newOuting); }