private void AddOuting() { Outing newOuting = new Outing(); Console.WriteLine("What is the event type?\n" + "1. Golf\n" + "2. Bowling\n" + "3. Concert\n" + "4. Amusement Park"); string typeAsString = Console.ReadLine().ToLower(); switch (typeAsString) { case "golf": case "1": newOuting.TypeOfEvent = EventType.Golf; break; case "bowling": case "2": newOuting.TypeOfEvent = EventType.Bowling; break; case "concert": case "3": newOuting.TypeOfEvent = EventType.Concert; break; case "amusement park": case "4": newOuting.TypeOfEvent = EventType.AmusementPark; break; } Console.WriteLine("How many people are attending?"); string attendanceAsString = Console.ReadLine(); newOuting.NumberOfPeople = int.Parse(attendanceAsString); Console.WriteLine("When is the outing?\n" + "Use the format mm/dd/yyyy (time)pm/am"); string dateOfEvent = Console.ReadLine(); newOuting.DateOfEvent = DateTime.Parse(dateOfEvent); Console.WriteLine("What is the cost per person?"); string costPerPerson = Console.ReadLine(); newOuting.CostPerPerson = decimal.Parse(costPerPerson); Console.WriteLine("What is the total cost of the outing?"); string totalOutingCost = Console.ReadLine(); newOuting.TotalCost = decimal.Parse(totalOutingCost); _outingRepo.AddOutingToList(newOuting); }
private void AddOutingToList() { Console.WriteLine("Enter the number for the type of event:\n" + "1. Golf\n" + "2. Bowling\n" + "3. Amusement Park\n" + "4. Concert"); int outingType = ParseInput(); OutingType type; switch (outingType) { default: case 1: type = OutingType.Golf; break; case 2: type = OutingType.Bowling; break; case 3: type = OutingType.AmusementPark; break; case 4: type = OutingType.Concert; break; } Console.WriteLine($"How many people attended"); int numberPeople = int.Parse(Console.ReadLine()); Console.WriteLine("Enter the date of outing(dd/mm/yy"); DateTime outingDate = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Enter the cost per person"); decimal outingCpp = decimal.Parse(Console.ReadLine()); Console.WriteLine("Enter the cost per event"); decimal costPerEvent = decimal.Parse(Console.ReadLine()); OutingEvent outing = new OutingEvent(type, numberPeople, outingDate, outingCpp, costPerEvent); _outingRepo.AddOutingToList(outing); Console.WriteLine($"\"{outing.OutingCPP}\" added to list:"); Console.ReadKey(); }
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(); }
private void AddPersonOutings() { Console.WriteLine("What is the event?\n" + "1. Golf\n" + "2. Bowling\n" + "3. Amusement Park\n" + "4. Concert\n"); int eventtype = int.Parse(Console.ReadLine()); EventType type; switch (eventtype) { default: case 1: type = EventType.Golf; break; case 2: type = EventType.Bowling; break; case 3: type = EventType.Amusement_Park; break; case 4: type = EventType.Concert; break; } Console.WriteLine("How many people attended the event?"); int attendees = int.Parse(Console.ReadLine()); Console.WriteLine("When did the event happen?"); string date = Console.ReadLine(); Console.WriteLine("What was the individual cost?"); decimal personCost = decimal.Parse(Console.ReadLine()); Outing outing = new Outing(date, attendees, type, personCost); _outingRepo.AddOutingToList(outing); }