public void AddRecordToRepo(AOI aoi) { if (aoi == null) { throw new ArgumentNullException("Error: The argument is Null"); } AOICollection.Add(aoi); }
public List <string> SelectFromCommonGridSizes(int selectedSize) { List <string> files = new List <string>(); foreach (var aoi in AOICollection.Where(t => t.Selected == true).ToList()) { files.Add(aoi.GetGridFileNameOfGridSize(selectedSize.ToString())); } return(files); }
public void DeleteRecordFromRepo(int id) { if (id == 0) { throw new Exception("Record ID cannot be null"); } int index = 0; while (index < AOICollection.Count) { if (AOICollection[index].ID == id) { AOICollection.RemoveAt(index); break; } index++; } }
public AOI GetAOI(string name) { CurrentEntity = AOICollection.FirstOrDefault(n => n.Name == name); return(CurrentEntity); }
public AOI GetAOI(int id) { CurrentEntity = AOICollection.FirstOrDefault(n => n.ID == id); return(CurrentEntity); }
public bool AOINameExist(string name) { return(AOICollection.Where(t => t.Name == name).FirstOrDefault() != null); }
public List <AOI> GetAllAOI() { return(AOICollection.ToList()); }
public List <AOI> GetSelectedAOIs() { return(AOICollection.Where(t => t.Selected == true).ToList()); }
public int CountSelected() { return(AOICollection.Count(t => t.Selected == true)); }