Пример #1
0
        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);
        }
Пример #2
0
        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++;
            }
        }
Пример #3
0
        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);
        }