Example #1
0
        public virtual IActionResult CelebrityPictureUpdate(CelebrityPictureModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCelebrities))
            {
                return(AccessDeniedView());
            }

            //try to get a Celebrity picture with the specified id
            var celebrityPicture = _celebrityService.GetCelebrityPictureById(model.Id)
                                   ?? throw new ArgumentException("No Celebrity picture found with the specified id");

            //try to get a picture with the specified id
            var picture = _pictureService.GetPictureById(celebrityPicture.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);

            celebrityPicture.DisplayOrder = model.DisplayOrder;
            _celebrityService.UpdateCelebrityPicture(celebrityPicture);

            return(new NullJsonResult());
        }
Example #2
0
 public CelebrityModel()
 {
     CelebrityPictureModels = new List <CelebrityPictureModel>();
     Locales                      = new List <CelebrityLocalizedModel>();
     AddPictureModel              = new CelebrityPictureModel();
     CelebrityPictureSearchModel  = new CelebrityPictureSearchModel();
     CelebrityEditorSettingsModel = new CelebrityEditorSettingsModel();
     SelectedStoreIds             = new List <int>();
     AvailableStores              = new List <SelectListItem>();
 }