public ActionResult UpdateVenue(VenuesViewModel model)
        {
            Venues venue = _venuesRepository.GetVenueById(model.VenueID);

            if (venue == null)
            {
                return(Json(new { success = false, message = "Локалот не постои" }));
            }
            venue.Name         = model.Name;
            venue.Street       = model.Street;
            venue.StreetNumber = model.StreetNumber;
            venue.CityID       = model.CityID;
            venue.Phone        = model.Phone;
            venue.VenueTypeID  = model.VenueTypeID;

            _venuesRepository.Update(venue);
            return(RedirectToAction("Index"));
            //return Json(new { success = true, message = "Success" });
        }
Beispiel #2
0
 /// <summary>
 /// 修改一个实体
 /// </summary>
 /// <param name="_entity"></param>
 /// <returns></returns>
 public int Update(Models.APP.Venues model)
 {
     return(dal.Update(model));
 }