feat: reordering

This commit is contained in:
2026-03-02 15:33:56 +01:00
parent 48be020dc4
commit 272ed999d8
10 changed files with 119 additions and 34 deletions

View File

@@ -119,6 +119,17 @@ namespace CarManagerV3
filePath = path;
}
public static List<Car> normalizeOrders(List<Car> cars)
{
// Normalize the Order field of all cars to be sequential starting from 1, while keeping the relative order the same.
var orderedCars = cars.OrderBy(c => c.Order).ToList();
for (int i = 0; i < orderedCars.Count; i++)
{
orderedCars[i].Order = i + 1;
}
return orderedCars;
}
public static bool askForMigration()
{
if (hasConfirmedMigration)