public AdministrativeDivision(string parentId, string name, string alias, double latitude, double longitude)
 {
     ParentId = parentId;
     Name = name;
     Alias = alias;
     GeoPoint = new GeoPoint(latitude, longitude);
 }
Esempio n. 2
0
        //[Fact]
        public void RetrieveCasinoGeoPointIfItIsNotSet()
        {
            var documentStore = new DocumentStore() { ConnectionStringName = "Secure", Conventions = { DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites } };
            documentStore.Initialize();
            var documentSession = documentStore.OpenSession();

            var yandexGeolocationService = new YandexGeolocationService();

            var casinos = documentSession.Query<Casino>().ToList();

            foreach (var casino in casinos)
            {
                if (casino.GeoPoint == null || casino.GeoPoint.IsEmpty)
                {
                    var city = documentSession.Load<AdministrativeDivision>(casino.CityId);
                    var geoPoint = new GeoPoint(0, 0);
                    if (city != null)
                        geoPoint = yandexGeolocationService.GetPoint(city.Name, casino.Address);

                    casino.GeoPoint = geoPoint;
                    documentSession.Store(casino);
                }
            }
            documentSession.SaveChanges();
        }
Esempio n. 3
0
 public DrugsSalePoint(string administrativeDivisionId, string address, GeoPoint geoPoint, string description) : this()
 {
     AdditionDate = DateTime.UtcNow;
     AdministrativeDivisionId = administrativeDivisionId;
     Address = address;
     GeoPoint = geoPoint;
     Description = description;
 }
Esempio n. 4
0
        public Casino(string cityId, string address, GeoPoint geoPoint, string name) : this()
        {
            AdditionDate = DateTime.UtcNow;
            CityId = cityId;
            Address = address;
            GeoPoint = geoPoint;
            Title = name;

            Status = CasinoStatus.Opened;

            Comments = new List<Comment>();
            Suspensions = new List<Suspension>();
        }