public bool RemoveByEject(GPS gps) { int oldCount = GPSCollection.Count; int index = 0; while (index < GPSCollection.Count) { if (GPSCollection[index].DeviceID == gps.DeviceID) { _gpsRemovedByEject = true; GPSCollection.RemoveAt(index); break; } index++; } return(oldCount > GPSCollection.Count); }
public void DeleteRecordFromRepo(string id) { if (id == null) { throw new Exception("Record ID cannot be null"); } int index = 0; while (index < GPSCollection.Count) { if (GPSCollection[index].ID == id) { GPSCollection.RemoveAt(index); break; } index++; } }
public bool DeleteRecordFromRepo(string code) { if (code == null) { throw new Exception("Record ID cannot be null"); } int index = 0; while (index < GPSCollection.Count) { if (GPSCollection[index].Code == code) { GPSCollection.RemoveAt(index); break; } index++; } return(EditSuccess); }