private void RemoveDeveloper() { Console.Clear(); Console.WriteLine("Which developer would you like to remove?"); List <KomodoInsuranceDeveloper> devs = _komodoRepository.GetDevs(); int count = 0; foreach (KomodoInsuranceDeveloper developer in devs) { count++; Console.WriteLine($"{count}: {developer.LastName}"); } int targetID = int.Parse(Console.ReadLine()); int targetIndex = targetID - 1; if (targetIndex >= 0 && targetIndex < devs.Count) { KomodoInsuranceDeveloper targetedDev = devs[targetIndex]; if (_komodoRepository.DeleteDeveloper(targetedDev)) { Console.WriteLine($"{targetedDev.LastName} was successfully removed"); } else { Console.WriteLine("I can't do that"); } } else { Console.WriteLine("Not a valid developer"); } Console.WriteLine("Press any key to continue....."); Console.ReadKey(); }
private void DisplayDev(KomodoInsuranceDeveloper dev) { Console.WriteLine($"Name: {dev.LastName}\n" + $"ID Number: {dev.DeveloperID}\n" + $"Has Access: {dev.HasAccess}"); }