Esempio n. 1
0
 public ResellerIdentifier GetResellerIdentifier()
 {
     return(new ResellerIdentifier
     {
         AccountHash = "184ec886dc90d2c1b5e50b6afe80db01",
         BaseUrl = BaseUriHelper.GetBaseUriString()
     });
 }
        /// <summary>
        /// Get <see cref="Atomia.Store.Core.ResellerIdentifier"/> from session, or default with empty hash and current base URI.
        /// </summary>
        public ResellerIdentifier GetResellerIdentifier()
        {
            var identifier = HttpContext.Current.Session["ResellerIdentifier"] as ResellerIdentifier;

            if (identifier == null)
            {
                identifier = new ResellerIdentifier
                {
                    AccountHash = "",
                    BaseUrl     = BaseUriHelper.GetBaseUriString()
                };
            }

            return(identifier);
        }
Esempio n. 3
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var request = filterContext.HttpContext.Request;

            if (filterContext.Controller.ControllerContext.IsChildAction || request.IsAjaxRequest())
            {
                return;
            }

            if (request.QueryString["reseller"] != null)
            {
                var identifier = new ResellerIdentifier()
                {
                    AccountHash = request.QueryString["reseller"],
                    BaseUrl     = BaseUriHelper.GetBaseUriString()
                };

                var resellerIdentifierProvider = DependencyResolver.Current.GetService <IResellerIdentifierProvider>();
                resellerIdentifierProvider.SetResellerIdentifier(identifier);
            }
        }