Exemple #1
0
        public ActionResult VideoCreate(ProductVideoRecordModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManagePlugins))
            {
                return(Content("Access denied"));
            }

            if (!ModelState.IsValid)
            {
                return(Configure());
            }

            var productVideoRecord = new ProductVideoRecord
            {
                ProductId          = model.ProductId,
                EmbedVideoHtmlCode = model.EmbedVideoHtmlCode,
                VideoThumbId       = model.VideoThumbId,
                DisplayOrder       = model.DisplayOrder
            };

            _productVideoRecordService.InsertProductVideoRecord(productVideoRecord);

            SuccessNotification(_localizationService.GetResource("Admin.Plugins.Saved"));

            //redisplay the form
            return(View("~/Plugins/Widgets.BsProductVideo/Views/ProductVideo/VideoCreate.cshtml", model));
        }
Exemple #2
0
        public virtual void DeleteProductVideoRecord(ProductVideoRecord productVideoRecord)
        {
            if (productVideoRecord == null)
            {
                throw new ArgumentNullException("productVideoRecord");
            }

            _productVideoRecordRepository.Delete(productVideoRecord);
        }