public Bus(Bus result) { this.numeroBus = result.numeroBus; foreach (var born in result.Borns) { this.borns.Add(born); } this.typeVehicule = result.typeVehicule; }
public void AddResult(string born, int numeroBus, string typeOperation, DateTime dateOperation, string typeVehicule) { if(! borns.Contains(born)) borns.Add(born); foreach (var r in results) { if (r.NumeroBus == numeroBus) { r.AddBorn(born, typeOperation, dateOperation); return; } } Bus result = new Bus(born, numeroBus, typeOperation, dateOperation, typeVehicule); this.results.Add(result); }