public void DeleteRecordFromRepo(string id) { if (id == null) { throw new Exception("Record ID cannot be null"); } int index = 0; while (index < GearCollection.Count) { if (GearCollection[index].GearID == id) { GearCollection.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 < GearCollection.Count) { if (GearCollection[index].Code == code) { GearCollection.RemoveAt(index); break; } index++; } return(_editSucceeded); }