This commit is contained in:
Frozd
2025-11-28 09:52:24 +01:00
parent 7d71783102
commit c7076476f6
11 changed files with 103 additions and 108 deletions

View File

@@ -41,18 +41,18 @@ namespace CarManagerV2
return $"{make} {model} ({year})";
}
public string toCsvString()
public string ToCsvString()
{
return $"{id};{make};{model};{year};{color};{mileage};{price}";
}
public static Car fromCsvString(string csv)
public static Car FromCsvString(string csv)
{
string[] parts = csv.Split(';');
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)
public bool IsChanged(Car other)
{
return make != other.make || model != other.model || year != other.year || color != other.color || mileage != other.mileage || price != other.price;
}