Ejemplo n.º 1
0
        public void InsertLocations()
        {
            //-------------------------------------------
            //         LOCATION REFERENCE TABLES
            //-------------------------------------------

            if (_repository.CountAll<City>() == 0)
            {
                //Create Provinces
                Province provinceNord = new Province();
                provinceNord.Label = "Province Nord";
                provinceNord.AddCity(new City { LabelUrlPart = "Poya-Nord", Label = "Poya Nord" });
                provinceNord.AddCity(new City { LabelUrlPart = "Pouembout", Label = "Pouembout" });
                provinceNord.AddCity(new City { LabelUrlPart = "Kone", Label = "Koné" });
                provinceNord.AddCity(new City { LabelUrlPart = "Voh", Label = "Voh" });
                provinceNord.AddCity(new City { LabelUrlPart = "Kaala-Gomen", Label = "Kaala-Gomen" });
                provinceNord.AddCity(new City { LabelUrlPart = "Koumac", Label = "Koumac" });
                provinceNord.AddCity(new City { LabelUrlPart = "Poum", Label = "Poum" });
                provinceNord.AddCity(new City { LabelUrlPart = "Iles-Belep", Label = "Iles Belep" });
                provinceNord.AddCity(new City { LabelUrlPart = "Ouegoa", Label = "Ouégoa" });
                provinceNord.AddCity(new City { LabelUrlPart = "Pouebo", Label = "Pouébo" });
                provinceNord.AddCity(new City { LabelUrlPart = "Hienghene", Label = "Hienghène" });
                provinceNord.AddCity(new City { LabelUrlPart = "Touho", Label = "Touho" });
                provinceNord.AddCity(new City { LabelUrlPart = "Poindimie", Label = "Poindimié" });
                provinceNord.AddCity(new City { LabelUrlPart = "Ponerihouen", Label = "Ponérihouen" });
                provinceNord.AddCity(new City { LabelUrlPart = "Houailou", Label = "Houaïlou" });
                provinceNord.AddCity(new City { LabelUrlPart = "Kouaoua", Label = "Kouaoua" });
                provinceNord.AddCity(new City { LabelUrlPart = "Canala", Label = "Canala" });
                _repository.Save(provinceNord);

                Province provinceSud = new Province();
                provinceSud.Label = "Province Sud";

                City noumea = new City();
                noumea.Label = "Nouméa";
                noumea.LabelUrlPart = "Noumea";

                noumea.AddDistrict(new District { Label = "Centre-Ville" });
                noumea.AddDistrict(new District { Label = "Nouville" });
                noumea.AddDistrict(new District { Label = "Quartier Latin" });
                noumea.AddDistrict(new District { Label = "Vallée du Génie" });
                noumea.AddDistrict(new District { Label = "Artillerie" });
                noumea.AddDistrict(new District { Label = "Orphelinat" });
                noumea.AddDistrict(new District { Label = "Baie des Citrons" });
                noumea.AddDistrict(new District { Label = "Anse Vata" });
                noumea.AddDistrict(new District { Label = "Val Plaisance" });
                noumea.AddDistrict(new District { Label = "N'Géa" });
                noumea.AddDistrict(new District { Label = "Receiving" });
                noumea.AddDistrict(new District { Label = "Motor Pool" });
                noumea.AddDistrict(new District { Label = "Trianon" });
                noumea.AddDistrict(new District { Label = "Riviere-Salée" });
                noumea.AddDistrict(new District { Label = "Ducos" });
                noumea.AddDistrict(new District { Label = "Magenta" });
                noumea.AddDistrict(new District { Label = "Haut-Magenta" });
                noumea.AddDistrict(new District { Label = "Aérodrome" });
                noumea.AddDistrict(new District { Label = "PK4" });
                noumea.AddDistrict(new District { Label = "PK6" });
                noumea.AddDistrict(new District { Label = "PK7" });
                noumea.AddDistrict(new District { Label = "Tina" });
                noumea.AddDistrict(new District { Label = "Normandie" });
                noumea.AddDistrict(new District { Label = "Vallée des Colons" });
                noumea.AddDistrict(new District { Label = "Faubourg Blanchot" });
                noumea.AddDistrict(new District { Label = "Montravel" });
                noumea.AddDistrict(new District { Label = "Montagne Coupée" });
                noumea.AddDistrict(new District { Label = "Vallée du Tir" });
                noumea.AddDistrict(new District { Label = "Doniambo" });
                noumea.AddDistrict(new District { Label = "Ouémo" });
                noumea.AddDistrict(new District { Label = "Portes de Fer" });
                provinceSud.AddCity(noumea);
                _repository.Save(noumea);

                City dumbea = new City();
                dumbea.Label = "Dumbéa";
                dumbea.LabelUrlPart = "Dumbea";
                dumbea.AddDistrict(new District { Label = "Auteuil" });
                dumbea.AddDistrict(new District { Label = "Centre" });
                dumbea.AddDistrict(new District { Label = "Dumbéa sur Mer" });
                dumbea.AddDistrict(new District { Label = "Koghi" });
                dumbea.AddDistrict(new District { Label = "Koutio" });
                dumbea.AddDistrict(new District { Label = "Nakutakoin" });
                dumbea.AddDistrict(new District { Label = "Plaine de Koé" });
                dumbea.AddDistrict(new District { Label = "Pointe à la Dorade" });
                dumbea.AddDistrict(new District { Label = "ZAC Panda" });
                provinceSud.AddCity(dumbea);
                _repository.Save(dumbea);

                City montDor = new City();
                montDor.Label = "Mont-Dore";
                montDor.LabelUrlPart = "Mont-Dore";
                montDor.AddDistrict(new District { Label = "Boulari" });
                montDor.AddDistrict(new District { Label = "La Conception" });
                montDor.AddDistrict(new District { Label = "La Coulée" });
                montDor.AddDistrict(new District { Label = "Mont-Dore Sud" });
                montDor.AddDistrict(new District { Label = "Plum" });
                montDor.AddDistrict(new District { Label = "Pont des Francais" });
                montDor.AddDistrict(new District { Label = "Robinson" });
                montDor.AddDistrict(new District { Label = "Saint-Louis" });
                montDor.AddDistrict(new District { Label = "Saint-Michel" });
                montDor.AddDistrict(new District { Label = "Vallon-Dore" });
                montDor.AddDistrict(new District { Label = "Yahoué" });
                provinceSud.AddCity(montDor);
                _repository.Save(montDor);

                City paita = new City();
                paita.Label = "Païta";
                paita.LabelUrlPart = "Paita";
                paita.AddDistrict(new District { Label = "Val Boisé" });
                paita.AddDistrict(new District { Label = "Tontouta" });
                paita.AddDistrict(new District { Label = "Tamoa" });
                paita.AddDistrict(new District { Label = "Savannah" });
                paita.AddDistrict(new District { Label = "Centre" });
                paita.AddDistrict(new District { Label = "Naia" });
                paita.AddDistrict(new District { Label = "Mont Mou" });
                paita.AddDistrict(new District { Label = "Beauvallon" });

                provinceSud.AddCity(paita);
                _repository.Save(paita);

                provinceSud.AddCity(new City { LabelUrlPart = "Thio", Label = "Thio" });
                provinceSud.AddCity(new City { LabelUrlPart = "Yate", Label = "Yaté" });
                provinceSud.AddCity(new City { LabelUrlPart = "Ile-des-Pins", Label = "Ile des Pins" });
                provinceSud.AddCity(new City { LabelUrlPart = "Boulouparis", Label = "Boulouparis" });
                provinceSud.AddCity(new City { LabelUrlPart = "La-Foa", Label = "La Foa" });
                provinceSud.AddCity(new City { LabelUrlPart = "Sarramea", Label = "Sarraméa" });
                provinceSud.AddCity(new City { LabelUrlPart = "Farino", Label = "Farino" });
                provinceSud.AddCity(new City { LabelUrlPart = "Moindou", Label = "Moindou" });
                provinceSud.AddCity(new City { LabelUrlPart = "Bourail", Label = "Bourail" });
                provinceSud.AddCity(new City { LabelUrlPart = "Poya-Sud", Label = "Poya Sud" });
                _repository.Save(provinceSud);

                Province ilesLoyaute = new Province();
                ilesLoyaute.Label = "Iles Loyauté";
                ilesLoyaute.AddCity(new City { LabelUrlPart = "Ouvea", Label = "Ouvéa" });
                ilesLoyaute.AddCity(new City { LabelUrlPart = "Lifou", Label = "Lifou" });
                ilesLoyaute.AddCity(new City { LabelUrlPart = "Mare", Label = "Maré" });
                _repository.Save(ilesLoyaute);

                _repository.Flush();
            }
        }