public static MarkerCollection FilterByCustomField(int moduleId, string customField, string country, string state, string city, int maxPoints) { MarkerCollection states = new MarkerCollection(); MarkerQuery q = new MarkerQuery(); q.Select(q.Country, q.ModuleId, q.Region, q.City); q.Where(q.ModuleId == moduleId); q.Where(q.CustomField == customField); if (!String.IsNullOrEmpty(country)) { q.Where(q.Country == country); } if (!String.IsNullOrEmpty(state)) { q.Where(q.Region == state); } if (!String.IsNullOrEmpty(city)) { q.Where(q.City == city); } q.Where(q.Latitude.IsNotNull() && q.Longitude.IsNotNull()); q.es.Distinct = true; q.OrderBy(q.Country.Ascending); states.Load(q); return(states); }
public static MarkerCollection GetDistinctCustomFields(int moduleId, int maxPoints) { MarkerCollection customFields = new MarkerCollection(); MarkerQuery q = new MarkerQuery(); q.Select(q.CustomField, q.ModuleId); q.Where(q.ModuleId == moduleId); q.Where(q.Latitude.IsNotNull() && q.Longitude.IsNotNull() && q.CustomField != ""); q.es.Distinct = true; q.OrderBy(q.CustomField.Ascending); customFields.Load(q); return(customFields); }
public static MarkerCollection GetDistinctCountriesByCustomField(int moduleId, int maxPoints, string customField) { MarkerCollection countries = new MarkerCollection(); MarkerQuery q = new MarkerQuery(); q.Select(q.Country, q.ModuleId); q.Where(q.ModuleId == moduleId); if (!String.IsNullOrEmpty(customField)) { q.Where(q.CustomField == customField); } q.Where(q.Latitude.IsNotNull() && q.Longitude.IsNotNull()); q.es.Distinct = true; q.OrderBy(q.Country.Ascending); countries.Load(q); return(countries); }