/// <summary> /// UpdatePhotoGalleryMap /// </summary> /// <param name="photoGalleryMapping"></param> public void UpdatePhotoGalleryMap(PhotoGalleryMapping photoGalleryMapping) { if (photoGalleryMapping == null) { throw new ArgumentNullException(nameof(photoGalleryMapping)); } _photoGalleryMapRepository.Update(photoGalleryMapping); }
public PhotoGalleryModel PreParePhotoGalleryModel(PhotoGalleryModel model, PhotoGalleryMapping photoGallery) { if (photoGallery == null) { return(new PhotoGalleryModel()); } model.Id = photoGallery.Id; model.DisplayOrder = photoGallery.DisplayOrder; model.Url = photoGallery.Url; model.PictureModels = PreParePictureModel(photoGallery.PictureId); return(model); }
public virtual IActionResult GaleriPictureDelete(int id) { //try to get a product picture with the specified id PhotoGalleryMapping galeriPicture = _photoGalleryMapRepository.GetById(id) ?? throw new ArgumentException("No product picture found with the specified id"); int pictureId = galeriPicture.PictureId; _photoGalleryMapRepository.Delete(galeriPicture); //try to get a picture with the specified id Picture picture = _pictureService.GetPictureById(pictureId) ?? throw new ArgumentException("No picture found with the specified id"); _pictureService.DeletePicture(picture); return(new NullJsonResult()); }
public virtual IActionResult GaleriPictureUpdate(GalleryPictureModel model) { PhotoGalleryMapping galeriPicture = _photoGalleryMapRepository.GetById(model.Id) ?? throw new ArgumentException("No product picture found with the specified id"); Picture picture = _pictureService.GetPictureById(galeriPicture.PictureId) ?? throw new ArgumentException("No picture found with the specified id"); _pictureService.UpdatePicture(picture.Id, _pictureService.LoadPictureBinary(picture), picture.MimeType, picture.SeoFilename, model.OverrideAltAttribute, model.OverrideTitleAttribute); galeriPicture.DisplayOrder = model.DisplayOrder; _photoGalleryMapRepository.Update(galeriPicture); return(new NullJsonResult()); }