Пример #1
0
        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);
        }
Пример #2
0
        private static MarkerCollection GetMarkersByModuleId(int moduleId)
        {
            MarkerCollection markers = new MarkerCollection();
            MarkerQuery      q       = new MarkerQuery();

            q.Where(q.ModuleId == moduleId);
            q.OrderBy(q.Title.Ascending);
            markers.Load(q);

            return(markers);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }