public ActionResult PostGalleryEdit(PostGalleryViewModel model) { PostGallery postGallery = _postGalleryService.GetById(model.Id); if (postGallery != null) { model.ImageSmallSize = postGallery.ImageSmallSize; model.ImageBigSize = postGallery.ImageBigSize; model.ImageMediumSize = postGallery.ImageMediumSize; PostGallery postGalleryMap = Mapper.Map <PostGalleryViewModel, PostGallery>(model, postGallery); _postGalleryService.Update(postGalleryMap); } return(base.Json( new { succes = true } , JsonRequestBehavior.AllowGet)); }
public ActionResult PostGalleryEdit(PostGalleryViewModel model) { var postGallery = _postGalleryService.GetById(model.Id); if (postGallery != null) { model.ImageBigSize = postGallery.ImageBigSize; model.ImageMediumSize = postGallery.ImageMediumSize; model.ImageSmallSize = postGallery.ImageSmallSize; model.OrderDisplay = postGallery.OrderDisplay; model.IsAvatar = postGallery.IsAvatar; model.Status = postGallery.Status; var postGalleryMap = Mapper.Map(model, postGallery); _postGalleryService.Update(postGalleryMap); } return(Json( new { succes = true } , JsonRequestBehavior.AllowGet)); }