// GET: ResortPointsTable public ActionResult ResortPointsTable() { var model = ResortMapper.MapForPointsTable(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View(model)); }
// GET: ResortAssociationOwners public ActionResult ResortAssociationOwners() { var model = ResortMapper.MapForAssociationOwners(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View(model)); }
public ActionResult Resort() { ResortModel model = ResortMapper.Map(CurrentPage); model = MasterMapper.Map(model, CurrentPage); return(View(model)); }
// GET: ResortWeather public ActionResult ResortWeather() { var model = ResortMapper.MapForWeather(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View(model)); }
// GET: AreaInformation public ActionResult AreaInformation() { var model = ResortMapper.MapForAreaInformation(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View(model)); }
/// <summary> /// This action will use the current page's parent (the parent is the resort and we need the resort model...it includes the child photo list) /// </summary> /// <returns></returns> public ActionResult ResortPhotoList() { var model = ResortMapper.MapForPhotos(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View(model)); }
// GET: ResortFoodAndBeverage public ActionResult ResortFoodAndBeverage() { var model = ResortMapper.MapForFoodAndBeverages(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View(model)); }
// GET: LocationMapAndDirections public ActionResult LocationMapAndDirections() { var model = ResortMapper.Map(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View(model)); }
// GET: ResortFloorPlanList public ActionResult ResortFloorPlanList() { var model = ResortMapper.MapForFloorPlans(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View("ResortFloorPlanList", model)); }
// GET: AvailableAmenities public ActionResult AvailableAmenities() { var model = ResortMapper.MapForAmenities(CurrentPage.Parent); model = MasterMapper.Map(model, CurrentPage.Parent); return(View(model)); }
public ActionResult OurPagedResorts(int pageNumber) { ValidateSession(); OurResortsModel ourResorts = OurResortsMapper.Map(CurrentPage); dynamic resorts = null; int resortContentId; string resortContentIdString = System.Configuration.ConfigurationManager.AppSettings["ourResortsContentId"]; if (!string.IsNullOrWhiteSpace(resortContentIdString) && Int32.TryParse(resortContentIdString, out resortContentId)) { resorts = Umbraco.Content(resortContentId); } int resortCount = 0; int pageSize = String.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["ourResortsListPageSize"]) == true ? 6 : Convert.ToInt32(ConfigurationManager.AppSettings["ourResortsListPageSize"]); int resortNumberStart = (pageNumber * pageSize); int resortNumberStop = resortNumberStart + pageSize - 1; if (resorts != null) { // loop through the children increment the resort count foreach (IPublishedContent child in resorts) { // we will increment the counter for every resort (for the sake of the resort pager), but will only create and add ResortModels to OurResortModel for the page to be displayed. resortCount++; if (resortCount >= resortNumberStart) { if (resortCount <= resortNumberStop) { ResortModel resort = ResortMapper.Map(child); if (resort != null) { ourResorts.OurResorts.Add(resort); } } } } } if (ourResorts.ResortCount > 0) { ourResorts.PagerModel = new OurResortsPagerModel(); ourResorts.PagerModel.CurrentPage = pageNumber; ourResorts.PagerModel.PageCount = ourResorts.ResortCount / pageSize; if (ourResorts.ResortCount % pageSize > 0) { ourResorts.PagerModel.PageCount++; } } return(View("OurResorts", ourResorts)); }
// GET: ReportQuickSelect public ActionResult ResortQuickSelect() { ResortQuickSelectModel model = new ResortQuickSelectModel(); model.Destinations = new List <Destination>(); // loop through the children of Resorts content item and populate the destination member of the model if (Umbraco.TypedContent(1088) != null) { foreach (IPublishedContent child in Umbraco.TypedContent(1088).Children) { ResortModel resort = ResortMapper.Map(child); if (resort != null) { model.Destinations.Add(new Destination(resort.ID, resort.Name, resort.Url)); } } } List <SitecoreResorts> Resorts = new List <SitecoreResorts>(); // Add Resorts to the list. Resorts.Add(new SitecoreResorts() { ResortName = "Eilan Hotel & Spa ", ResortId = 138, ResortUrl = "/our-resorts/Eilan-Hotel---Spa" }); Resorts.Add(new SitecoreResorts() { ResortName = "Blue Ridge Village ", ResortId = 136, ResortUrl = "/our-resorts/Blue-Ridge-Village" }); Resorts.Add(new SitecoreResorts() { ResortName = "Blue Water Resort at Cable Beach ", ResortId = 113, ResortUrl = "/our-resorts/Blue-Water-Resort-at-Cable-Beach" }); Resorts.Add(new SitecoreResorts() { ResortName = "Bluegreen at Atlantic Palace", ResortId = 102, ResortUrl = "/our-resorts/Bluegreen-at-Atlantic-Palace" }); Resorts.Add(new SitecoreResorts() { ResortName = "Bluegreen at TradeWinds", ResortId = 126, ResortUrl = "/our-resorts/Bluegreen-at-TradeWinds" }); Resorts.Add(new SitecoreResorts() { ResortName = "Bluegreen Club 36 ", ResortId = 95, ResortUrl = "/our-resorts/Bluegreen-Club-36" }); Resorts.Add(new SitecoreResorts() { ResortName = "Bluegreen Club La Pension", ResortId = 104, ResortUrl = "/our-resorts/Bluegreen-Club-La-Pension" }); Resorts.Add(new SitecoreResorts() { ResortName = "Bluegreen Odyssey Dells", ResortId = 97, ResortUrl = "/our-resorts/Bluegreen-Odyssey-Dells" }); Resorts.Add(new SitecoreResorts() { ResortName = "Bluegreen Wilderness Club at Big Cedar ", ResortId = 2, ResortUrl = "/our-resorts/Bluegreen-Wilderness-Club-at-Big-Cedar" }); Resorts.Add(new SitecoreResorts() { ResortName = "Carolina Grande", ResortId = 71, ResortUrl = "/our-resorts/Carolina-Grande" }); Resorts.Add(new SitecoreResorts() { ResortName = "Casa del Mar Beach Resort ", ResortId = 26, ResortUrl = "/our-resorts/Casa-del-Mar-Beach-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Christmas Mountain Village ", ResortId = 3, ResortUrl = "/our-resorts/Christmas-Mountain-Village" }); Resorts.Add(new SitecoreResorts() { ResortName = "Cibola Vista Resort and Spa", ResortId = 115, ResortUrl = "/our-resorts/Cibola-Vista-Resort-and-Spa" }); Resorts.Add(new SitecoreResorts() { ResortName = "Club Lodges at Trillium", ResortId = 134, ResortUrl = "/our-resorts/Club-Lodges-at-Trillium" }); Resorts.Add(new SitecoreResorts() { ResortName = "Daytona SeaBreeze", ResortId = 63, ResortUrl = "/our-resorts/Daytona-SeaBreeze" }); Resorts.Add(new SitecoreResorts() { ResortName = "King 583", ResortId = 135, ResortUrl = "/our-resorts/King-583" }); Resorts.Add(new SitecoreResorts() { ResortName = "Dolphin Beach Club", ResortId = 18, ResortUrl = "/our-resorts/Dolphin-Beach-Club" }); Resorts.Add(new SitecoreResorts() { ResortName = "Fantasy Island Resort II", ResortId = 21, ResortUrl = "/our-resorts/Fantasy-Island-Resort-II" }); Resorts.Add(new SitecoreResorts() { ResortName = "Foxrun Townhouses", ResortId = 65, ResortUrl = "/our-resorts/Foxrun-Townhouses" }); Resorts.Add(new SitecoreResorts() { ResortName = "Golf Club Villas at Big Canoe ", ResortId = 108, ResortUrl = "/our-resorts/Golf-Club-Villas-at-Big-Canoe" }); Resorts.Add(new SitecoreResorts() { ResortName = "Grande Villas at World Golf Village", ResortId = 9, ResortUrl = "/our-resorts/Grande-Villas-at-World-Golf-Village" }); Resorts.Add(new SitecoreResorts() { ResortName = "Gulfstream Manor", ResortId = 19, ResortUrl = "/our-resorts/Gulfstream-Manor" }); Resorts.Add(new SitecoreResorts() { ResortName = "Harbour Lights", ResortId = 8, ResortUrl = "/our-resorts/Harbour-Lights" }); Resorts.Add(new SitecoreResorts() { ResortName = "Horizons at 77th", ResortId = 129, ResortUrl = "/our-resorts/Horizons-at-77th" }); Resorts.Add(new SitecoreResorts() { ResortName = "Hotel Blake", ResortId = 131, ResortUrl = "/our-resorts/Hotel-Blake" }); Resorts.Add(new SitecoreResorts() { ResortName = "La Cabana Beach Resort & Casino", ResortId = 46, ResortUrl = "/our-resorts/La-Cabana-Beach-Resort--Casino" }); Resorts.Add(new SitecoreResorts() { ResortName = "Lake Condominiums at Big Sky", ResortId = 42, ResortUrl = "/our-resorts/Lake-Condominiums-at-Big-Sky" }); Resorts.Add(new SitecoreResorts() { ResortName = "Landmark Holiday Beach Resort", ResortId = 31, ResortUrl = "/our-resorts/Landmark-Holiday-Beach-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Laurel Crest", ResortId = 5, ResortUrl = "/our-resorts/Laurel-Crest" }); Resorts.Add(new SitecoreResorts() { ResortName = "Mariner's Boathouse And Beach Resort", ResortId = 28, ResortUrl = "/our-resorts/Mariners-Boathouse-And-Beach-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Mountain Run at Boyne", ResortId = 13, ResortUrl = "/our-resorts/Mountain-Run-at-Boyne" }); Resorts.Add(new SitecoreResorts() { ResortName = "Mountain Loft", ResortId = 6, ResortUrl = "/our-resorts/MountainLoft" }); Resorts.Add(new SitecoreResorts() { ResortName = "Ocean Towers Beach Club", ResortId = 30, ResortUrl = "/our-resorts/Ocean-Towers-Beach-Club" }); Resorts.Add(new SitecoreResorts() { ResortName = "Orlando's Sunshine Resort I & II", ResortId = 12, ResortUrl = "/our-resorts/Orlandos-Sunshine-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Outrigger Beach Club", ResortId = 24, ResortUrl = "/our-resorts/Outrigger-Beach-Club" }); Resorts.Add(new SitecoreResorts() { ResortName = "Panama City Resort & Club", ResortId = 61, ResortUrl = "/our-resorts/Panama-City-Resort-And-Club" }); Resorts.Add(new SitecoreResorts() { ResortName = "Paradise Isle Resort", ResortId = 44, ResortUrl = "/our-resorts/Paradise-Isle-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Paradise Point ", ResortId = 121, ResortUrl = "/our-resorts/Paradise-Point" }); Resorts.Add(new SitecoreResorts() { ResortName = "Parkside Williamsburg Resort", ResortId = 114, ResortUrl = "/our-resorts/Parkside-Williamsburg-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Patrick Henry Square", ResortId = 96, ResortUrl = "/our-resorts/Patrick-Henry-Square" }); Resorts.Add(new SitecoreResorts() { ResortName = "Petit Crest Villas at Big Canoe", ResortId = 33, ResortUrl = "/our-resorts/Petit-Crest-Villas-at-Big-Canoe" }); Resorts.Add(new SitecoreResorts() { ResortName = "Players Club", ResortId = 20, ResortUrl = "/our-resorts/Players-Club" }); Resorts.Add(new SitecoreResorts() { ResortName = "Pono Kai Resort", ResortId = 16, ResortUrl = "/our-resorts/Pono-Kai-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Resort Sixty-Six ", ResortId = 25, ResortUrl = "/our-resorts/Resort-Sixty-Six" }); Resorts.Add(new SitecoreResorts() { ResortName = "Sandcastle Village II", ResortId = 69, ResortUrl = "/our-resorts/Sandcastle-Village-II" }); Resorts.Add(new SitecoreResorts() { ResortName = "SeaGlass Tower", ResortId = 70, ResortUrl = "/our-resorts/SeaGlass-Tower" }); Resorts.Add(new SitecoreResorts() { ResortName = "Shenandoah Crossing", ResortId = 4, ResortUrl = "/our-resorts/Shenandoah-Crossing" }); Resorts.Add(new SitecoreResorts() { ResortName = "Shore Crest Vacation Villas I & II", ResortId = 7, ResortUrl = "/our-resorts/Shore-Crest-Vacation-Villas-I--II" }); Resorts.Add(new SitecoreResorts() { ResortName = "Shoreline Towers", ResortId = 43, ResortUrl = "/our-resorts/Shoreline-Towers" }); Resorts.Add(new SitecoreResorts() { ResortName = "Solara Surfside ", ResortId = 1, ResortUrl = "/our-resorts/Solara-Surfside" }); Resorts.Add(new SitecoreResorts() { ResortName = "South Mountain Resort", ResortId = 116, ResortUrl = "/our-resorts/South-Mountain-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Surfrider Beach Club", ResortId = 68, ResortUrl = "/our-resorts/Surfrider-Beach-Club" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Breakers Resort- Bluegreen Resorts", ResortId = 118, ResortUrl = "/our-resorts/The-Breakers-Resort--Bluegreen-Resorts" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Cliffs at Long Creek", ResortId = 101, ResortUrl = "/our-resorts/The-Cliffs-at-Long-Creek" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Club at Big Bear Village", ResortId = 125, ResortUrl = "/our-resorts/The-Club-at-Big-Bear-Village" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Falls Village ", ResortId = 10, ResortUrl = "/our-resorts/The-Falls-Village" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Fountains", ResortId = 14, ResortUrl = "/our-resorts/The-Fountains" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Hammocks at Marathon", ResortId = 15, ResortUrl = "/our-resorts/The-Hammocks-at-Marathon" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Innsbruck Aspen", ResortId = 128, ResortUrl = "/our-resorts/The-Innsbruck-Aspen" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Lodge Alley Inn", ResortId = 11, ResortUrl = "/our-resorts/The-Lodge-Alley-Inn" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Manhattan Club", ResortId = 120, ResortUrl = "/our-resorts/The-Manhattan-Club" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Soundings Seaside Resort ", ResortId = 109, ResortUrl = "/our-resorts/The-Soundings-Seaside-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Studio Homes at Ellis Square", ResortId = 124, ResortUrl = "/our-resorts/The-Studio-Homes-at-Ellis-Square" }); Resorts.Add(new SitecoreResorts() { ResortName = "The Suites at Hershey ", ResortId = 17, ResortUrl = "/our-resorts/The-Suites-at-Hershey" }); Resorts.Add(new SitecoreResorts() { ResortName = "Tropical Sands Resort", ResortId = 27, ResortUrl = "/our-resorts/Tropical-Sands-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Via Roma Beach Resort ", ResortId = 22, ResortUrl = "/our-resorts/Via-Roma-Beach-Resort" }); Resorts.Add(new SitecoreResorts() { ResortName = "Waterwood Townhouses", ResortId = 66, ResortUrl = "/our-resorts/Waterwood-Townhouses" }); Resorts.Add(new SitecoreResorts() { ResortName = "Windward Passage Resort ", ResortId = 41, ResortUrl = "/our-resorts/Windward-Passage-Resort" }); // Write out the Resorts in the list. This will call the overridden ToString method // in the SitecoreResorts class. string BGOResort = Request.CurrentExecutionFilePath.ToLower(); string splResorts; splResorts = BGOResort; bool?spl = false; string del = string.Empty; if (BGOResort.Contains("/")) { del = "/"; } string[] splitUrl = BGOResort.Split(del.ToCharArray()); string Regresorts = "/" + splitUrl[2].ToString() + "/" + splitUrl[3].ToString(); if (BGOResort == "/BGModern/our-resorts") { Response.Redirect(ConfigurationManager.AppSettings["OurResortsToSiteCore"], true); } else { foreach (SitecoreResorts resort in Resorts) { if ((splResorts.Contains("Eilan-Hotel-Spa")) || (splResorts.Contains("eilan-hotel-spa"))) { splResorts = "/our-resorts/Eilan-Hotel---Spa"; spl = true; } if ((splResorts.Contains("La-Cabana-Beach-Resort")) || (splResorts.Contains("la-cabana-beach-resort"))) { splResorts = "/our-resorts/La-Cabana-Beach-Resort--Casino"; spl = true; } if ((splResorts.Contains("mountain-loft")) || (splResorts.Contains("Mountain-Loft"))) { splResorts = "/our-resorts/MountainLoft"; spl = true; } if ((splResorts.Contains("panama-city-resort-club")) || (splResorts.Contains("Panama-City-Resort-Club"))) { splResorts = "/our-resorts/Panama-City-Resort-And-Club"; spl = true; } if ((splResorts.Contains("orlandos-sunshine-resort")) || (splResorts.Contains("Orlandos-Sunshine-Resort"))) { splResorts = "/our-resorts/Orlandos-Sunshine-Resort"; spl = true; } if ((splResorts.Contains("Shore-Crest-Vacation-Villas")) || (splResorts.Contains("shore-crest-vacation-villas"))) { splResorts = "/our-resorts/Shore-Crest-Vacation-Villas-I--II"; spl = true; } if ((splResorts.Contains("The-Hotel-Blake")) || (splResorts.Contains("the-hotel-blake"))) { splResorts = "/our-resorts/Hotel-Blake"; spl = true; } if ((splResorts.Contains("The-Breakers-Resort-Bluegreen-Resorts")) || (splResorts.Contains("the-breakers-resort-bluegreen-resorts"))) { splResorts = "/our-resorts/The-Breakers-Resort--Bluegreen-Resorts"; spl = true; } splResorts = splResorts.ToLower(); if (spl == true) { if (splResorts == resort.ResortUrl.ToLower()) { Response.Redirect(ConfigurationManager.AppSettings["SitecoreResortUrl"] + resort.ResortUrl.ToLower(), true); break; } } else { if (Regresorts == resort.ResortUrl.ToLower()) { Response.Redirect(ConfigurationManager.AppSettings["SitecoreResortUrl"] + resort.ResortUrl.ToLower(), true); break; } } } } return(PartialView(model)); }
// // GET: /Home/ public ActionResult Home() { if (Session["BXGOwner"] == null) { if (Session["_path_info"] != null) { Session["_path_info"] = Request.RawUrl; } Response.Redirect(ConfigurationManager.AppSettings["bxgwebUnsecureURL"] + "default.aspx?sess=timeout", true); } // Fixed/Flex users have a different home page var isFixedFlexOrTraditionalOwner = Session["IsFixedFlexOrTraditionalOwner"]; string referrer = string.Empty; if (System.Web.HttpContext.Current.Request.UrlReferrer != null) { if (System.Web.HttpContext.Current.Request.UrlReferrer.AbsoluteUri != null) { referrer = System.Web.HttpContext.Current.Request.UrlReferrer.AbsoluteUri; } } if (isFixedFlexOrTraditionalOwner is bool && (bool)isFixedFlexOrTraditionalOwner) { OurResortsModel ourResorts = null; bool vacationClubOwner = false; bool vacationClubOrSampler = false; int ourResortsContentId; IPublishedContent resortContent = null; string ourResortsContentIdString = ConfigurationManager.AppSettings["ourResortsContentId"]; if (!string.IsNullOrWhiteSpace(ourResortsContentIdString) && Int32.TryParse(ourResortsContentIdString, out ourResortsContentId)) { resortContent = Umbraco.TypedContent(ourResortsContentId); ourResorts = OurResortsMapper.Map(resortContent); ourResorts.VacationClubOwner = vacationClubOwner; ourResorts.VacationClubOrSamplerOwner = vacationClubOrSampler; ourResorts.PagerModel = null; } var children = resortContent.Children; var homeResortId = Session["OwnerHomeResort"]; if (homeResortId != null) { children = children.Where(x => x.GetPropertyValue <string>("databaseid") == (string)homeResortId); } foreach (IPublishedContent child in children) { ResortModel resort = ResortMapper.Map(child); resort.IncludeBorderLine = true; resort.IncludePhone = true; if (resort != null) { if (resort.Name != null) { resort.Name = resort.Name.ToUpper(); } ourResorts.OurResorts.Add(resort); } } if (AllowLegacySearch(referrer)) { Response.Redirect(HomePageRedirect, true); } return(View("HomeFixed", ourResorts)); } else { HomeModel model = new HomeModel(); //Logic for checking side navigation visibility BGO.OwnerWS.Owner BXGOwner = (BGO.OwnerWS.Owner)Session["BXGOwner"]; model.VacationClubOwner = false; if (Session["OwnerContractType"] != null && (Session["OwnerContractType"].ToString() == "Vacation Club" || Session["OwnerContractType"].ToString() == "Sampler")) { if (BXGOwner != null && BXGOwner.User != null && !BXGOwner.User[0].isSampler && Session["OwnerContractType"].ToString() != "Sampler") { model.VacationClubOwner = true; } } if (Session["BGModernSessionVariablesAreSet"] == null) { Global.SetSessionVariablesForBGModern(); } if (AllowLegacySearch(referrer)) { Response.Redirect(HomePageRedirect, true); } return(View(model)); } }
public ActionResult OurResorts(OurResortsModel resorts) { ValidateSession(); if (Request.QueryString["ResortID"] != null) { dynamic resortsContent = null; int ourResortsContentId; string ourResortsContentIdString = ConfigurationManager.AppSettings["ourResortsContentId"]; if (!string.IsNullOrWhiteSpace(ourResortsContentIdString) && Int32.TryParse(ourResortsContentIdString, out ourResortsContentId)) { resortsContent = Umbraco.TypedContent(ourResortsContentId); } //Populate the image based on the resorts. if (resortsContent != null) { string resortId = Request.QueryString["ResortId"]; foreach (IPublishedContent content in resortsContent.Children) { if (content.DocumentTypeAlias.Equals("Resort")) { if (resortId == content.GetPropertyValue <string>("DatabaseId")) { string path = BGModern.HtmlExtensions.CustomHtmlHelpers.GetParentSitePath(null).ToString(); return(Redirect(path + content.Url)); } } } } } //Logic for checking side navigation visibility BGO.OwnerWS.Owner BXGOwner = (BGO.OwnerWS.Owner)Session["BXGOwner"]; bool vacationClubOwner = false; bool vacationClubOrSampler = false; if (Session["OwnerContractType"] != null && (Session["OwnerContractType"].ToString() == "Vacation Club" || Session["OwnerContractType"].ToString() == "Sampler")) { vacationClubOrSampler = true; if (BXGOwner != null && BXGOwner.User != null && !BXGOwner.User[0].isSampler && Session["OwnerContractType"].ToString() != "Sampler") { vacationClubOwner = true; } } Boolean showAll = false; int pageNumber = 1; OurResortsModel ourResorts = null; if (resorts == null || resorts.Page == 0) { pageNumber = 1; } else { if (resorts.Page == -1) { showAll = true; } else { pageNumber = resorts.Page; } } if (showAll) { ourResorts = OurResortsMapper.Map(CurrentPage); ourResorts.VacationClubOwner = vacationClubOwner; ourResorts.VacationClubOrSamplerOwner = vacationClubOrSampler; ourResorts.PagerModel = null; var children = CurrentPage.Children; if (!string.IsNullOrWhiteSpace(resorts.FilterCity) && !string.IsNullOrWhiteSpace(resorts.FilterState)) { resorts.FilterCity = resorts.FilterCity.ToUpper(); resorts.FilterState = resorts.FilterState.ToUpper(); children = children.Where(x => x.GetPropertyValue <string>("city").Trim().ToUpper() == resorts.FilterCity && x.GetPropertyValue <string>("state").Trim().ToUpper() == resorts.FilterState); ourResorts.FilterCity = resorts.FilterCity; ourResorts.FilterState = resorts.FilterState; } if (!string.IsNullOrWhiteSpace(resorts.FilterExperience)) { var experienceList = resorts.FilterExperience.Split(','); children = children.Where(x => x.GetPropertyValue <string>("experience") != null && x.GetPropertyValue <string>("experience") .Split(',') .Intersect(experienceList) .Any()); ourResorts.FilterExperience = resorts.FilterExperience; } foreach (IPublishedContent child in children) { ResortModel resort = ResortMapper.Map(child); if (resort != null) { ourResorts.OurResorts.Add(resort); } } } else { ourResorts = OurResortsMapper.MapWithPaging(CurrentPage, pageNumber, resorts.FilterCity, resorts.FilterState, resorts.FilterExperience); ourResorts.VacationClubOwner = vacationClubOwner; ourResorts.VacationClubOrSamplerOwner = vacationClubOrSampler; if (ourResorts.ResortCount == 1 && ((resorts.FilterCity != null && resorts.FilterState != null) || resorts.FilterExperience != null)) { string url = ourResorts.OurResorts[0].Url; string path = BGModern.HtmlExtensions.CustomHtmlHelpers.GetParentSitePath(null).ToString(); return(Redirect(path + url)); } } string CurrentURL = Request.CurrentExecutionFilePath; if (CurrentURL == "/BGModern/our-resorts") { Response.Redirect(ConfigurationManager.AppSettings["OurResortsToSiteCore"], true); } // return a view return(View("OurResorts", ourResorts)); }
private void HydrateModel(ResortLocatorModel model) { model.Cities = new List <string>(); model.Destinations = new Dictionary <string, List <Destination> >(); var citiesAndStates = new List <Tuple <string, string> >(); var destinations = new List <Destination>(); var conn = new BGO.clsDBConnectivity(); conn.dbCmnd.CommandText = "uspSelectDestination"; conn.dbCmnd.CommandType = CommandType.StoredProcedure; conn.dbCmnd.Parameters.Clear(); var reader = conn.dbCmnd.ExecuteReader(); while (reader.Read()) { string city = reader["City"].ToString().Trim(); string state = reader["StateCode"].ToString().Trim(); string cityState = GetCityAndStateString(city, state).ToUpper(); if (!model.Destinations.ContainsKey(cityState)) { citiesAndStates.Add(Tuple.Create(city, state)); model.Destinations[cityState] = new List <Destination>(); } } model.Cities = citiesAndStates .OrderBy(x => x.Item2) .ThenBy(x => x.Item1) .Select(x => x.Item1 + ", " + x.Item2) .ToList(); reader.Close(); conn.Close(); IPublishedContent ourResorts = null; int ourResortsContentId; string ourResortsContentIdString = System.Configuration.ConfigurationManager.AppSettings["ourResortsContentId"]; if (!string.IsNullOrWhiteSpace(ourResortsContentIdString) && Int32.TryParse(ourResortsContentIdString, out ourResortsContentId)) { ourResorts = Umbraco.TypedContent(ourResortsContentId); } if (ourResorts != null) { var resortList = new List <ResortModel>(); foreach (IPublishedContent child in ourResorts.Children) { var resort = ResortMapper.Map(child); resort.Name = resort.Name.Trim(); resortList.Add(resort); } foreach (var resort in resortList) { string city = GetCityAndStateString(resort.City.Trim(), resort.State.Trim()).ToUpper(); string resortName; if (string.IsNullOrWhiteSpace(resort.Name)) { resortName = string.Format("Resort #{0}", resort.ResortPageID); } else { resortName = resort.Name; } if (resort != null) { if (model.Destinations.ContainsKey(city.ToUpper())) { model.Destinations[city.ToUpper()].Add(new Destination(resort.ID, resortName, resort.Url)); } } } } RemoveEmptyDestinations(model.Cities, model.Destinations); model.DestinationMap = BuildDestinationMap(model); // //loop through the children of Resorts content item and populate the destination member of the model //if (ourResorts != null) //{ // var resortList = new List<ResortModel>(); // foreach (IPublishedContent child in ourResorts.Children) // { // resortList.Add(ResortMapper.Map(child)); // } // // Build list of cities, then sort // var citiesAndStates2 = new List<Tuple<string, string>>(); // foreach (var resort in resortList) // { // string city = GetCityAndStateString(resort.City, resort.State).ToUpper(); // if (!model.Destinations.ContainsKey(city)) // { // citiesAndStates.Add(Tuple.Create(resort.City, resort.State)); // model.Destinations[city] = new List<Destination>(); // } // } // model.Cities = citiesAndStates // .OrderBy(x => x.Item2) // .ThenBy(x => x.Item1) // .Select(x => x.Item1 + ", " + x.Item2) // .ToList(); // foreach (var resort in resortList) // { // string city = GetCityAndStateString(resort.City, resort.State).ToUpper(); // string resortName; // if (string.IsNullOrWhiteSpace(resort.Name)) // { // resortName = string.Format("Resort #{0}", resort.ResortPageID); // } // else // { // resortName = resort.Name; // } // if (resort != null) // { // model.Destinations[city].Add(new Destination(resort.ID, resortName, resort.Url)); // } // } //} ////var x = JsonConvert.SerializeObject(model.Destinations); //model.DestinationMap = BuildDestinationMap(model); }