Esempio n. 1
0
        public void GetGeographyRepository(Action <GeographyRepository, Exception> callback)
        {
            var repo = new GeographyRepository();

            repo.CreateAllDesign();
            callback(repo, null);
        }
Esempio n. 2
0
        private void GeographyRepositoryLoaded(GeographyRepository repo, Exception error)
        {
            if (error != null)
            {
                Messenger.Default.Send(new DialogMessage(error.ToString(), null)
                {
                    Button = MessageBoxButton.OK, Caption = "Error"
                });
                return;
            }

            Continents.Clear();
            foreach (var continent in repo.Continents)
            {
                Continents.Add(continent);
            }

            CountriesRaw.Clear();
            foreach (var country in repo.Countries)
            {
                CountriesRaw.Add(country);
            }

            CitiesRaw.Clear();
            foreach (var city in repo.Cities)
            {
                CitiesRaw.Add(city);
            }

            ContinentFilterSelected();
        }
        public IActionResult Index()

        {
            //List<Province> provinceList = new List<Province>();
            var provinceRepository  = new ProvinceRepository();
            var geographyRepository = new GeographyRepository();
            var raceRepository      = new RaceRepository();

            ViewBag.ProvinceList  = provinceRepository.GetProvinces().OrderBy(Province => Province.Name);
            ViewBag.GeographyList = geographyRepository.GetGeography().OrderBy(Geography => Geography.Name);
            ViewBag.RaceList      = raceRepository.GetRaces().OrderBy(Race => Race.Name);

            return(View());
        }
Esempio n. 4
0
 public GeographyService(GeographyRepository geographyRepository, IMapper mapper)
     : base(geographyRepository)
 {
     _mapper = mapper;
 }