public List <string> GetModels(string brand) { var list = GPSCollection .Where(t => t.Brand == brand).ToList(); return((from gps in list select gps.Model).Distinct().ToList()); }
public void AddRecordToRepo(GPS gps) { if (gps == null) { throw new ArgumentNullException("Error: The argument is Null"); } GPSCollection.Add(gps); }
public bool AddToCollection(GPS gps) { int oldCount = GPSCollection.Count; _addToCollectionOnly = true; if (GetGPS(gps.DeviceID) == null) { GPSCollection.Add(gps); } _addToCollectionOnly = false; return(GPSCollection.Count > oldCount); }
public bool AddRecordToRepo(GPS gps) { int oldCount = GPSCollection.Count; if (gps == null) { throw new ArgumentNullException("Error: The argument is Null"); } GPSCollection.Add(gps); return(GPSCollection.Count > oldCount); }
public ObservableCollection <GPS> AvailableGPS() { List <GPS> availableGPS = GPSCollection.ToList(); //foreach (var gps in GPSes.GetAssignedUnits()) foreach (var fg in BSCEntities.FisherGPSViewModel.FisherGPSCollection .Where(t => t.DateReturned == null)) { GPS tempGPS = fg.GPS; if (availableGPS.Contains(tempGPS)) { availableGPS.Remove(tempGPS); } } return(new ObservableCollection <GPS>(availableGPS)); }
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); }
public GPS GetGPSEx(string deviceID) { CurrentEntity = GPSCollection.FirstOrDefault(n => n.DeviceID == deviceID); if (CurrentEntity == null) { CurrentEntity = GPSCollection.FirstOrDefault(n => n.Device?.PNPDeviceID == deviceID); } if (CurrentEntity != null) { GPSModels = GetModels(CurrentEntity.Brand); } else { if (GPSModels != null) { GPSModels.Clear(); } } return(CurrentEntity); }
public GPS GetGPS(string ID) { return(GPSCollection.FirstOrDefault(n => n.ID == ID)); }
public List <GPS> GetAllGPS() { return(GPSCollection.ToList()); }
public GPS GetGPS(string deviceID) { CurrentEntity = GPSCollection.FirstOrDefault(n => n.DeviceID == deviceID); return(CurrentEntity); }
public GPS GetGPSByName(string deviceName) { CurrentEntity = GPSCollection.FirstOrDefault(n => n.DeviceName == deviceName); return(CurrentEntity); }
public bool Exists(GPS gps) { return(GPSCollection.Where(t => t.DeviceID == gps.DeviceID).FirstOrDefault() != null); }
public List <GPS> GetAll() { return(GPSCollection.OrderBy(t => t.DeviceName).ToList()); }