public void DeleteBannerPicture(PromoBannerPicture bannerPictureToDelete)
 {
     _bannerPictureRepository.Delete(bannerPictureToDelete);
     _eventPublisher.EntityDeleted<PromoBannerPicture>(bannerPictureToDelete);
 }
 public void UpdateBannerPicture(PromoBannerPicture bannerPictureToUpdate)
 {
     _bannerPictureRepository.Update(bannerPictureToUpdate);
     _eventPublisher.EntityUpdated<PromoBannerPicture>(bannerPictureToUpdate);
 }
        private PromoBannerDisplayPictureModel GetBannerPictureModel(PromoBannerPicture promoBannerPicture, string transitionType)
        {
            var returnItem = new PromoBannerDisplayPictureModel()
            {
                Comment = promoBannerPicture.Comment,
                DisplaySequence = promoBannerPicture.DisplaySequence,
                PictureId = promoBannerPicture.PictureId,
                Url = promoBannerPicture.Url,
                TransitionType = transitionType
            };

            returnItem.PictureUrl = _pictureService.GetPictureUrl(returnItem.PictureId);
            return returnItem;
        }
 public void InsertBannerPicture(PromoBannerPicture bannerPictureToInsert)
 {
     _bannerPictureRepository.Insert(bannerPictureToInsert);
     _eventPublisher.EntityInserted<PromoBannerPicture>(bannerPictureToInsert);
 }
        public ActionResult BannerPictureAdd(int bannerId, int pictureId, string promoRef, int displaySequence, string url, string comment)
        {
            if (pictureId == 0)
            {
                ModelState.AddModelError(string.Empty, _localizationService.GetResource("Plugins.Widgets.QixolPromo.BannerPicture.ValidationMsg.Add"));
                return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() });
            }

            var newBannerPicture = new PromoBannerPicture()
            {
                PictureId = pictureId,
                PromoReference = promoRef,
                PromoBannerId = bannerId,
                Comment = comment,
                DisplaySequence = displaySequence,
                Url = url
            };

            _promoBannerService.InsertBannerPicture(newBannerPicture);

            return Json(new { Result = true }, JsonRequestBehavior.AllowGet);
        }