예제 #1
0
 public ActionResult ListingDetails(Guid facilityGuid, SeoSearchFilterViewModel seofilter)
 {
     var filter = this.RestoreFilter(seofilter);
     ListingLogic llogic = new ListingLogic();
     ListingViewModelEdit listingnew = llogic.GetListingByFacilityGuid(facilityGuid).ToEdit();
     var csz = this.CityStateZipAll.FirstOrDefault(c => c.CityStateZipGuid == listingnew.CityStateZipGuid);
     this.AddTypesOfCareToListing(listingnew);
     this.AddFacilityPhotoToListing(listingnew, false);
     var details = listingnew.ToListingDetails(csz, filter);
     return View(details);
 }
예제 #2
0
        public virtual ActionResult Search(SeoSearchFilterViewModel seofilter)
        {
            var filter = this.RestoreFilter(seofilter);
            if (SessionHandler.Current.UserGeolocation == null)
            {
                SessionHandler.Current.UserGeolocation =
                    new PSSLocation
                    {
                        GeolocationStatus = Enums.GeolocationStates.WaitingForResolve
                    };
            }
            else
            {
                SessionHandler.Current.UserGeolocation.GeolocationStatus = Enums.GeolocationStates.ResolveNotPossible;
            }
            // set geolocation data on first action loading
            if (filter.Latitude.HasValue && filter.Longitude.HasValue && filter.SearchType == Enums.SearchTypes.Undefined)
            {
                SessionHandler.Current.UserGeolocation.Latitude = filter.Latitude.Value;
                SessionHandler.Current.UserGeolocation.Longitude = filter.Longitude.Value;
                SessionHandler.Current.UserGeolocation.GeolocationStatus = Enums.GeolocationStates.Resolved;
            }

            filter.GeolocationStatus = SessionHandler.Current.UserGeolocation.GeolocationStatus;

            return View(filter);
        }
예제 #3
0
        public ActionResult ShowFacilitiesNearYou(SeoSearchFilterViewModel seofilter)
        {
            var filter = this.RestoreFilter(seofilter);
            if (SessionHandler.Current.UserGeolocation.GeolocationStatus == Enums.GeolocationStates.WaitingForResolve)
            {
                return View();
            }

            var location = SessionHandler.Current.UserGeolocation;
            filter.Latitude = location.Latitude;
            filter.Longitude = location.Longitude;
            filter.GeolocationStatus = location.GeolocationStatus;
            filter.SearchType = Enums.SearchTypes.Distance;
            var resultsViewModel = this.SearchFacilities(filter, 1);
            return PartialView("Search/_SearchResultsPartial", resultsViewModel);
        }
예제 #4
0
 private SearchFilterViewModel RestoreFilter(SeoSearchFilterViewModel seoFilter)
 {
     return seoFilter.ToSearchFilter(this.TypesOfCareDefinitions);
 }
예제 #5
0
 public ActionResult SearchResultsWide(SeoSearchFilterViewModel seofilter, int? page)
 {
     var filter = this.RestoreFilter(seofilter);
     filter.SearchType = Enums.SearchTypes.FilteredDistance;
     var resultsViewModel = this.SearchFacilities(filter, page);
     return View("SearchResults", resultsViewModel);
 }