Exemplo n.º 1
0
        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");
            }
        }
Exemplo n.º 2
0
        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");
        }
Exemplo n.º 3
0
 //[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"));
     }
 }