Пример #1
0
        public List<PushPinModel> GetAddressList()
        {
            FreeQ_DBEntities context = new FreeQ_DBEntities();

            FreeQ_WS.Classes.FreeQ_DataContext db = new Classes.FreeQ_DataContext();
            List<PushPinModel> ppl = new List<PushPinModel>();
            geoloc l;
            List<string> la = (from a in context.Queue.Where("1 == 1")
                    where a.Queue_Address.Length != 0
                    select a.Queue_Address).ToList<string>();

            foreach (string a in la)
            {
                l = this.GeocodeAddress(a);

                //add the pushpin info
                ppl.Add(new PushPinModel
                {
                    Description = a,
                    Latitude = l.lat,
                    Longitude = l.lon,
                    Title = ""
                });
            }

            db.Dispose();
            context.Dispose();

            return ppl;
        }