private static void Edit() { WriteVehiclesToScreen(); int vehicleId = InputValidator.GetPositiveNumber("Enter number of vehicle to edit"); Vehicle vehicle = Autobazar.GetVehicleById(vehicleId); if (vehicle == null) { Console.WriteLine("Vehicle not found"); } else { bool toContinue = true; do { WriteMenuForEditToScreen(); int propertyToEdit = InputValidator.GetNumberFromInterval("Enter number of selected property", 1, 9); vehicle = GetNewData(propertyToEdit, vehicle); bool isError = false; try { Autobazar.EditVehicle(vehicle); } catch (VehicleNotFoundException) { isError = true; Console.WriteLine("Vehicle not found"); } if (isError == false) { ConsoleWriter.ConsoleHorizontalLine('-'); Console.WriteLine("Vehicle was edited."); } toContinue = InputValidator.GetBoolen($"Something else to edit on vehicle {vehicleId} ? Yes/No"); } while (toContinue); } }