private TravelAgentList() { TravelAgent a1 = new TravelAgent("Michael Franklin", "470-525-5272", 543); TravelAgent a2 = new TravelAgent("Demonte", "470-365-5666", 123); TravelAgent a3 = new TravelAgent("Clark Wilson", "470-543-8764", 117); _startupAgentList = new List <TravelAgent> { a1, a2, a3 }; }
//constructor public Trip(TravelAgent owner) //TravelAgent agent { Agent = owner; //will need to change this to something like GlobalTrips.Trips.Count(); //tripNum++; Random random = new Random(); _ID = random.Next(1000, 10000);//Double.//DateTime.Now.ToOADate(); _note = null; _stateType = TripStateType.AddTravelers; _reservations = new List <Reservation> { }; _travelers = new List <Person> { }; }
public void Login() { //persistence = new TripPersistence(); bool success = false; while (success == false) { Console.WriteLine("Please select Travel Agent by typing Agent ID:"); IReadOnlyList <TravelAgent> startupAgents = TravelAgentList.GetStartupAgentList(); for (var person = 0; person < startupAgents.Count; person++) { Console.WriteLine($"{person + 1}. {startupAgents[person]._name}, {startupAgents[person]._agentID}"); } string input = Console.ReadLine(); int id; if (int.TryParse(input, out id)) { for (int i = 0; i < startupAgents.Count; i++) { if (id == startupAgents[i]._agentID) { CurrentAgent = startupAgents[i]; Console.WriteLine($"Current Agent = {CurrentAgent._name}"); success = true; break; } } } else { Console.WriteLine("Please enter a valid integer:"); success = false; } } }