Ejemplo n.º 1
0
        public ActionResult ProductVideoRecordDelete(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageProducts))
            {
                return(Content("Access denied"));
            }
            ;

            var productVideoRecord = _productVideoRecordService.GetById(id);

            if (productVideoRecord == null)
            {
                throw new ArgumentException("No record found with the specified id");
            }
            var picture = _pictureService.GetPictureById(productVideoRecord.VideoThumbId);

            if (picture != null)
            {
                _pictureService.DeletePicture(picture);
            }
            _productVideoRecordService.DeleteProductVideoRecord(productVideoRecord);


            return(new NullJsonResult());
        }