Пример #1
0
        public ActionResult GdprConsent(bool isSmall)
        {
            if (!_privacySettings.DisplayGdprConsentOnForms)
            {
                return(new EmptyResult());
            }

            var customer           = Services.WorkContext.CurrentCustomer;
            var hasConsentedToGdpr = customer.GetAttribute <bool>(SystemCustomerAttributeNames.HasConsentedToGdpr);

            if (hasConsentedToGdpr)
            {
                return(new EmptyResult());
            }

            var model = new GdprConsentModel();

            model.GdprConsent  = false;
            model.SmallDisplay = isSmall;

            return(PartialView(model));
        }
        public IViewComponentResult Invoke(bool isSmall)
        {
            if (!_privacySettings.DisplayGdprConsentOnForms)
            {
                return(Empty());
            }

            var customer = Services.WorkContext.CurrentCustomer;

            var hasConsentedToGdpr = customer.GenericAttributes.HasConsentedToGdpr;

            if (hasConsentedToGdpr)
            {
                return(Empty());
            }

            var model = new GdprConsentModel
            {
                GdprConsent  = false,
                SmallDisplay = isSmall
            };

            return(View(model));
        }
Пример #3
0
 public static GdprConsent ToEntity(this GdprConsentModel model, GdprConsent destination)
 {
     return(model.MapTo(destination));
 }
Пример #4
0
 public static GdprConsent ToEntity(this GdprConsentModel model)
 {
     return(model.MapTo <GdprConsentModel, GdprConsent>());
 }