Пример #1
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");
        }
Пример #2
0
        //Ratings Methods

        //public RatingBase GetOneLoactionForRating(int id)
        //{

        //}
        public void RatingAdd(RatingAdd newRating)
        {
            var addedRating = ds.Ratings.Add(mapper.Map <Rating>(newRating));

            addedRating.UserName = HttpContext.Current.User.Identity.Name;
            ds.SaveChanges();
        }