Пример #1
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>();
 }
Пример #2
0
        public virtual IActionResult CelebrityPictureList(CelebrityPictureSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCelebrities))
            {
                return(AccessDeniedDataTablesJson());
            }

            //try to get a celebrity with the specified id
            var celebrity = _celebrityService.GetCelebrityById(searchModel.CelebrityId)
                            ?? throw new ArgumentException("No celebrity found with the specified id");

            //prepare model
            var model = _celebrityModelFactory.PrepareCelebrityPictureListModel(searchModel, celebrity);

            return(Json(model));
        }