public LocationDetailsDataContract GetAllActivitiesForSelectedLocation(string locationName, string userAgent) { LocationDetailsDataContract result = new LocationDetailsDataContract(); if (userAgent == "smartphone") { result = GetLocationDetails(userAgent.ToUpper(), locationName); foreach (var item in result.AllActivities) { item.ImageURL = string.Format("Images/icons/{0}.png", item.ImageURL); } result.ImageURL = string.Format("Images/mobile/{0}", result.ImageURL); } else if (userAgent == "tablet") { result = GetLocationDetails(userAgent.ToUpper(), locationName); foreach (var item in result.AllActivities) { item.ImageURL = string.Format("Images/icons/{0}.png", item.ImageURL); } result.ImageURL = string.Format("Images/tablet/{0}", result.ImageURL); } else { result = GetLocationDetails(userAgent.ToUpper(), locationName); result.ImageURL = string.Format("Images/desktop/{0}", result.ImageURL); } return result; }
public ActionResult SaveLocationDetails(LocationDetailsDataContract locationDetails) { if (locationDetails.LocationKey != default(string)) { _locationService.UpdateLocationDetails(locationDetails); } else { _locationService.CreateNewLocation(locationDetails); } return Json(true, JsonRequestBehavior.AllowGet); }
private LocationDetailsDataContract GetLocationDetails(string deviceInfo, string locationName) { LocationDetailsDataContract results = new LocationDetailsDataContract(); if (deviceInfo != "SMARTPHONE" && deviceInfo != "TABLET") { results.TopOffersForLocation = GetDummyTopOffers(locationName); results.DefaultActivityCategoryKey = "TOPTRENDING"; } else { results.AllActivities = GetAllActivityCategoriesForLocation(locationName); } results.ImageURL = "gangtok"; results.LocationName = "Gangtok"; results.Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."; results.GettingAround = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."; results.MustDrink = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor consectetur adipiscing elit, sed do eiusmod."; results.MustEat = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor consectetur adipiscing elit, sed do eiusmod."; results.LatLong = "27.3300, 88.6200"; results.MapIconURL = "Images/icons/location_nav.png"; return results; }