public void DeleteBanner(PromoBanner bannerToDelete)
        {
            // Delete all pictures assoicated with banner
            var allPictures = RetrievePicturesForBanner(bannerToDelete.Id);
            allPictures.ToList().ForEach(sp =>
                {
                    DeleteBannerPicture(sp);
                });

            // Delete all widget zones associated with banner.
            var allWidgetZones = RetrieveWidgetZonesForBanner(bannerToDelete.Id);
            allWidgetZones.ToList().ForEach(zr =>
                {
                    DeleteBannerWidgetZone(zr);
                });

            // Now delete the actual banner
            _bannerRepository.Delete(bannerToDelete);
            _eventPublisher.EntityDeleted<PromoBanner>(bannerToDelete);
        }
 public void InsertBanner(PromoBanner bannerToInsert)
 {
     _bannerRepository.Insert(bannerToInsert);
     _eventPublisher.EntityInserted<PromoBanner>(bannerToInsert);
 }
 public void UpdateBanner(PromoBanner bannerToUpdate)
 {
     _bannerRepository.Update(bannerToUpdate);
     _eventPublisher.EntityUpdated<PromoBanner>(bannerToUpdate);
 }
        public ActionResult BannerAdd(string name, bool enabled, string transitionType)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");

            var newBanner = new PromoBanner()
            {
                Name = name,
                Enabled = enabled,
                TransitionType = transitionType
            };

            _promoBannerService.InsertBanner(newBanner);

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