public void Create(CommentAdd newComment, int id, double lat, double lng) { try { if (!HttpContext.User.Identity.IsAuthenticated) { RedirectToAction("Login", "Account"); } if (!ModelState.IsValid) { RedirectToAction("Index", "Home"); } newComment.LocationId = id; m.LocationAddComment(newComment); var geoCoord = new UserGeoLocation { Latitude = lat, Longitude = lng, }; //return RedirectToAction("Index", "Home"); } catch { RedirectToAction("Index", "Home"); } }
public void Create(RatingAdd newRating, int id, double lat, double lng) { if (!HttpContext.User.Identity.IsAuthenticated) { RedirectToAction("Login", "Account"); } if (!ModelState.IsValid) { RedirectToAction("Index", "Home"); } newRating.LocationId = id; m.RatingAdd(newRating); //if (addedRating == null) //{ // return View(newRating); //} var userGeoCoord = new UserGeoLocation { Latitude = lat, Longitude = lng, //Locations = m.LocationGetAll() }; //return RedirectToAction("Index","Home"); }
//[Route("Markers/{postalCode}")] public ActionResult Markers(UserGeoLocation data) { try { var userGeoCoord = new UserGeoWithLocations { Latitude = data.Latitude, Longitude = data.Longitude, Locations = m.LocationGetAll() }; return(View(userGeoCoord)); } catch { return(View("Index")); } }