Function in Class

This commit is contained in:
Frozd
2025-09-18 08:34:06 +02:00
parent 1654c4d722
commit 7d71783102
11 changed files with 1154 additions and 24 deletions

View File

@@ -48,11 +48,13 @@ namespace CarManagerV2
public static Car fromCsvString(string csv)
{
Console.WriteLine(csv);
string[] parts = csv.Split(';');
Console.WriteLine(parts.Length);
Console.WriteLine($"Fetched ID: {parts[0]}");
return new Car(int.Parse(parts[0]), parts[1], parts[2], int.Parse(parts[3]), parts[4], int.Parse(parts[5]), decimal.Parse(parts[6]));
}
public bool isChanged(Car other)
{
return make != other.make || model != other.model || year != other.year || color != other.color || mileage != other.mileage || price != other.price;
}
}
}