public string addAuto(Automobile auto) { try { autos.Add(auto); return "automobile inséré"; } catch (Exception) { return "erreur l'ajout d'automobile"; } }
public string updateAuto(Automobile au1,Automobile au2) { try { int pos = getIndexAuto(au1); autos[pos] = au2; return "mise a jour réussi "; } catch (Exception ex) { return "mise a jour échoué " + ex; } }
public int getIndexAuto(Automobile au) { return autos.IndexOf(au); }