// Method to remove customer from the crm file public void RemoveCustomerSubmenu(bool clear = true) { if (clear) { Console.Clear(); } Console.WriteLine("### Delete Customer Submenu ###\n"); DeleteCRMValidationInput(); // Ensure that the desired ID to be deleted exists in the customer list to execute deletion if (Crm.CustomerList.Any(customer => customer.ID == DeleteRecordID)) { // deletion is successful if customer is not renting a vehicle if (Crm.RemoveCustomer(DeleteRecordID, Fleet)) { Crm.SaveToFile(); Console.WriteLine($"\nSuccessfully deleted the Customer with an ID of '{DeleteRecordID}'"); } else { Console.WriteLine($"\nDeletion Unsuccessful. Customer '{DeleteRecordID}' is currently renting a vehicle."); } LastMRRCscreen(() => SubMenu("Customer"), () => RemoveCustomerSubmenu()); } // If the desired ID to be deleted is not in the list, prompt a message else { Console.Clear(); Console.WriteLine("Customer with an ID of '{0}' does not exist in the Customers List\n", DeleteRecordID); RemoveCustomerSubmenu(false); LastMRRCscreen(() => SubMenu("Customer"), () => RemoveCustomerSubmenu()); } }