Пример #1
0
        public static long GetStoreIdForCustomUrl(System.Uri url, MerchantTribeApplication app)
        {
            string host = url.DnsSafeHost.ToLowerInvariant();
            long result = app.AccountServices.Stores.FindStoreIdByCustomUrl(host);

            if (result < 1)
            {
                // Check other custom domains
                Accounts.StoreDomainRepository repo = new Accounts.StoreDomainRepository(app.CurrentRequestContext);
                Accounts.StoreDomain possible = repo.FindForAnyStoreByDomain(host);
                if (possible != null)
                {
                    if (possible.StoreId > 0)
                    {
                        RedirectToMainStoreUrl(possible.StoreId, url, app);
                    }
                }
            }

            return result;
        }
Пример #2
0
        public static long GetStoreIdForCustomUrl(System.Uri url, MerchantTribeApplication app)
        {
            string host   = url.DnsSafeHost.ToLowerInvariant();
            long   result = app.AccountServices.Stores.FindStoreIdByCustomUrl(host);

            if (result < 1)
            {
                // Check other custom domains
                Accounts.StoreDomainRepository repo     = new Accounts.StoreDomainRepository(app.CurrentRequestContext);
                Accounts.StoreDomain           possible = repo.FindForAnyStoreByDomain(host);
                if (possible != null)
                {
                    if (possible.StoreId > 0)
                    {
                        RedirectToMainStoreUrl(possible.StoreId, url, app);
                    }
                }
            }

            return(result);
        }