/// <summary>
        /// Saves the places to the cache file and redirects to the provided url
        /// </summary>
        public ActionResult Persist(string url = "")
        {
            _cartoPlaceService.Save();
            _cartoPlaceService.Reload();

            return(new RedirectResult(String.IsNullOrWhiteSpace(url) ? CartoViewModel.GetCartoUrl() : url));
        }
        /// <summary>
        /// Removes a place from the cache
        /// </summary>
        public ActionResult Delete(string id)
        {
            var key = id.ToUpperInvariant();

            _cartoPlaceService.DeletePlace(key);

            return(new RedirectResult(CartoViewModel.GetPlacesUrl()));
        }
        private CartoViewModel InitModel()
        {
            var model = new CartoViewModel();

            model.LastSaved  = _cartoPlaceService.LastSaved;
            model.HasChanges = _cartoPlaceService.HasChanges;

            model.Places = _cartoPlaceService.ListPlaces();

            model.Countries  = _cartoPlaceService.ListCountries();
            model.PlaceTypes = _cartoPlaceService.ListPlaceTypes();

            model.SourceCountries = _tripSheetService.ListCountries();
            model.SourceYears     = _tripSheetService.ListYears();

            return(model);
        }
        /// <summary>
        /// Reloads the places from the cache file
        /// </summary>
        /// <returns></returns>
        public ActionResult Reload()
        {
            _cartoPlaceService.Reload();

            return(new RedirectResult(CartoViewModel.GetCartoUrl()));
        }