コード例 #1
0
        public ActionResult ChangeHotelAddress(HotelAddress hotel)
        {
            if (User.Identity.Name == "Admin")
            {
                _hotelsSqlExecutor.EditHotel(hotel.Id_Hotel, hotel.Name, hotel.FullAddress, null, null, hotel.Lat, hotel.Lng);

                var response = new { response = "ok" };
                return(Json(response, JsonRequestBehavior.AllowGet));
            }

            else
            {
                return(RedirectToAction("Index"));
            }
        }
コード例 #2
0
 public ActionResult Edit(Hotel hotel)
 {
     if (User.Identity.Name == "Admin")
     {
         _hotelsSqlExecutor.EditHotel(hotel.Id_Hotel, hotel.Name, hotel.FullAddress, hotel.Webpage, hotel.Phone, hotel.Lat, hotel.Lng);
         return(RedirectToAction("Index"));
     }
     else
     {
         return(RedirectToAction("Index"));
     }
 }