Esempio n. 1
0
        /// <summary>
        /// Inserts a popup
        /// </summary>
        /// <param name="popup">Popup</param>
        public virtual void InsertPopupActive(PopupActive popup)
        {
            if (popup == null)
            {
                throw new ArgumentNullException("popup");
            }

            _popupActiveRepository.Insert(popup);

            //event notification
            _eventPublisher.EntityInserted(popup);
        }
Esempio n. 2
0
        /// <summary>
        /// Inserts a popup
        /// </summary>
        /// <param name="popup">Popup</param>
        public virtual async Task InsertPopupActive(PopupActive popup)
        {
            if (popup == null)
            {
                throw new ArgumentNullException("popup");
            }

            await _popupActiveRepository.InsertAsync(popup);

            //event notification
            await _mediator.EntityInserted(popup);
        }
Esempio n. 3
0
 protected async Task PrepareBanner(CustomerAction action, Banner banner, string customerId)
 {
     var banneractive = new PopupActive()
     {
         Body             = banner.GetLocalized(x => x.Body, _workContext.WorkingLanguage.Id),
         CreatedOnUtc     = DateTime.UtcNow,
         CustomerId       = customerId,
         CustomerActionId = action.Id,
         Name             = banner.GetLocalized(x => x.Name, _workContext.WorkingLanguage.Id),
         PopupTypeId      = (int)PopupType.Banner
     };
     await _popupService.InsertPopupActive(banneractive);
 }
        protected void PrepareBanner(CustomerAction action, Banner banner, string customerId)
        {
            var banneractive = new PopupActive()
            {
                Body             = banner.GetLocalized(x => x.Body),
                CreatedOnUtc     = DateTime.UtcNow,
                CustomerId       = customerId,
                CustomerActionId = action.Id,
                Name             = banner.GetLocalized(x => x.Name),
                PopupTypeId      = (int)PopupType.Banner
            };

            _popupService.InsertPopupActive(banneractive);
        }
Esempio n. 5
0
        protected async Task PrepareInteractiveForm(CustomerAction action, InteractiveForm form, string customerId)
        {
            var body = PrepareDataInteractiveForm(form);

            var formactive = new PopupActive()
            {
                Body             = body,
                CreatedOnUtc     = DateTime.UtcNow,
                CustomerId       = customerId,
                CustomerActionId = action.Id,
                Name             = form.GetLocalized(x => x.Name, _workContext.WorkingLanguage.Id),
                PopupTypeId      = (int)PopupType.InteractiveForm
            };
            await _popupService.InsertPopupActive(formactive);
        }
        protected void PrepareInteractiveForm(CustomerAction action, InteractiveForm form, string customerId)
        {
            var body = PrepareDataInteractiveForm(form);

            var formactive = new PopupActive()
            {
                Body             = body,
                CreatedOnUtc     = DateTime.UtcNow,
                CustomerId       = customerId,
                CustomerActionId = action.Id,
                Name             = form.GetLocalized(x => x.Name),
                PopupTypeId      = (int)PopupType.InteractiveForm
            };

            _popupService.InsertPopupActive(formactive);
        }
 public PopupRenderEvent(Customer customer, PopupActive popupActive)
 {
     Customer    = customer;
     PopupActive = popupActive;
 }