public virtual ActionResult RecurringSchedule()
        {
            var vm = RecurringOrderTemplatesViewService.GetRecurringOrderTemplatesViewModelAsync(new GetRecurringOrderTemplatesParam {
                Scope       = ComposerContext.Scope,
                CustomerId  = ComposerContext.CustomerId,
                CultureInfo = ComposerContext.CultureInfo,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString()
            }).Result;

            if (vm != null && vm.RecurringOrderTemplateViewModelList.Count == 0)
            {
                return(View("RecurringScheduleContainer", new { TotalQuantity = 0 }));
            }

            return(View("RecurringScheduleContainer", vm));
        }
Example #2
0
    void LoadData()
    {
        int id = RequestUtils.GetPollId(this);

        if (id != 0)
        {
            using (GmConnection conn = Global.CreateConnection())
            {
                poll = Poll.GetPoll(conn, id);
            }
        }
        if (poll == null)
        {
            poll = new Poll();
        }
    }
        public virtual async Task <IHttpActionResult> GetWishList()
        {
            var viewModel = await WishListViewService.GetWishListViewModelAsync(new GetCartParam
            {
                Scope             = ComposerContext.Scope,
                CultureInfo       = ComposerContext.CultureInfo,
                CustomerId        = ComposerContext.CustomerId,
                CartName          = CartConfiguration.WishlistCartName,
                ExecuteWorkflow   = CartConfiguration.WishListExecuteWorkflow,
                WorkflowToExecute = CartConfiguration.WishListWorkflowToExecute,
                BaseUrl           = RequestUtils.GetBaseUrl(Request).ToString(),
                //WebsiteId = SiteConfiguration.GetWebsiteId()
            });

            return(Ok(viewModel));
        }
        public virtual ActionResult Index(int pagesize = 9)
        {
            var model = StoreLocatorViewService.GetEmptyStoreLocatorViewModel(new GetEmptyStoreLocatorViewModelParam
            {
                CultureInfo = ComposerContext.CultureInfo,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString(),
            });

            model.Context.Add("pageSize", pagesize);

            if (!string.IsNullOrWhiteSpace(Request["storeDirectorySearchInput"]))
            {
                model.PostedAddress = Request["storeDirectorySearchInput"];
            }
            return(View("StoreLocator", model));
        }
Example #5
0
        public virtual async Task <IHttpActionResult> GetCart()
        {
            var homepageUrl = GetHomepageUrl();

            var cartViewModel = await CartService.GetCartViewModelAsync(new GetCartParam
            {
                Scope       = ComposerContext.Scope,
                CultureInfo = ComposerContext.CultureInfo,
                CustomerId  = ComposerContext.CustomerId,
                CartName    = CartConfiguration.ShoppingCartName,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString(),
            });

            SetHomepageUrl(cartViewModel, homepageUrl);
            SetEditCartUrl(cartViewModel);

            if (cartViewModel.OrderSummary != null)
            {
                var checkoutUrlTarget = GetCheckoutUrl();
                var checkoutStepInfos = CartUrlProvider.GetCheckoutStepPageInfos(new BaseUrlParameter
                {
                    CultureInfo = ComposerContext.CultureInfo
                });
                //Build redirect url in case of the customer try to access an unauthorized step.
                var stepNumber = cartViewModel.OrderSummary.CheckoutRedirectAction.LastCheckoutStep;
                if (!checkoutStepInfos.ContainsKey(stepNumber))
                {
                    return(BadRequest("StepNumber is invalid"));
                }

                var checkoutStepInfo = checkoutStepInfos[stepNumber];

                //If the cart contains recurring items and user is not authenticated, redirect to sign in
                if (RecurringOrdersSettings.Enabled && cartViewModel.HasRecurringLineitems && !ComposerContext.IsAuthenticated)
                {
                    cartViewModel.OrderSummary.CheckoutRedirectAction.RedirectUrl = checkoutUrlTarget;
                }
                else
                {
                    cartViewModel.OrderSummary.CheckoutRedirectAction.RedirectUrl = checkoutStepInfo.Url;
                }
                cartViewModel.OrderSummary.CheckoutStepUrls  = checkoutStepInfos.Values.Select(x => x.Url).ToList();
                cartViewModel.OrderSummary.CheckoutUrlTarget = checkoutUrlTarget;
            }

            return(Ok(cartViewModel));
        }
Example #6
0
        /// <summary>
        /// 为查询获取分页信息,通过Url="userAction.do?action=View&type=bySearch"调用
        /// </summary>
        /// <param name="httpContext"></param>
        /// <param name="curUserInfo"></param>
        /// <param name="pageNo"></param>
        /// <param name="pageSize"></param>
        /// <param name="sortField"></param>
        /// <param name="sortDir"></param>
        /// <returns></returns>
        private PageInfo GetPageInfoBySearch(HttpContext httpContext, int pageNo, int pageSize, string sortField, string sortDir)
        {
            PageInfo pageInfo;

            // 获取过滤条件
            bool canEmpty = RequestUtils.GetBoolParameter(httpContext, "canEmpty", true);

            string[] filterNames = RequestUtils.GetStringArrayParameter(httpContext,
                                                                        "filterNames", Constants.ITEM_SEPARATOR, new string[0]);
            string[] filterValues = RequestUtils.GetStringArrayParameter(httpContext,
                                                                         "filterValues", Constants.ITEM_SEPARATOR, null);
            string[] filterTypes = RequestUtils.GetStringArrayParameter(httpContext,
                                                                        "filterTypes", Constants.ITEM_SEPARATOR, null);
            if (logger.IsDebugEnabled)
            {
                logger.Debug("In GetPageInfoBySearch:");
                logger.Debug("  canEmpty=" + RequestUtils.GetStringParameter(httpContext, "canEmpty", "null"));
                logger.Debug("  filterNames="
                             + RequestUtils.GetStringParameter(httpContext, "filterNames", "null"));
                logger.Debug("  filterValues="
                             + RequestUtils.GetStringParameter(httpContext, "filterValues", "null"));
                logger.Debug("  filterTypes="
                             + RequestUtils.GetStringParameter(httpContext, "filterTypes", "null"));
                logger.Debug("  pageNo=" + pageNo);
                logger.Debug("  pageSize=" + pageSize);
                logger.Debug("  sortField=" + sortField);
                logger.Debug("  sortDir=" + sortDir);
            }

            // 创建过滤条件
            IList filters = new ArrayList();

            for (int i = 0; i < filterNames.Length; i++)
            {
                filters.Add(new FilterParameter(filterNames[i], filterValues[i], filterTypes[i]));
            }
            if (canEmpty)
            {
                pageInfo = this.userService.GetPage(pageNo, pageSize, sortField, sortDir, filters);
            }
            else
            {
                pageInfo = new PageInfo();
            }

            return(pageInfo);
        }
Example #7
0
    public static int GetArticleId(Page page)
    {
        int articleId = RequestUtils.GetArticleId(page);

        if (articleId == 0)
        {
            string tag = RequestUtils.GetTag(page);
            if (!String.IsNullOrWhiteSpace(tag))
            {
                using (var conn = Global.CreateConnection())
                {
                    articleId = Article.GetArticleId(conn, tag);
                }
            }
        }
        return(articleId);
    }
        public async Task <object> Any(GetValidationRules request)
        {
            var feature = HostContext.AssertPlugin <ValidationFeature>();

            RequestUtils.AssertAccessRole(base.Request, accessRole: feature.AccessRole, authSecret: request.AuthSecret);

            var type = HostContext.Metadata.FindDtoType(request.Type);

            if (type == null)
            {
                throw HttpError.NotFound(request.Type);
            }

            return(new GetValidationRulesResponse {
                Results = await ValidationSource.GetAllValidateRulesAsync(request.Type).ConfigAwait(),
            });
        }
    void LoadData()
    {
        int id = RequestUtils.GetArticleParamId(this);

        if (id != 0)
        {
            using (GmConnection conn = Global.CreateConnection())
            {
                articleParam = ArticleParam.GetArticleParam(conn, id);
            }
        }
        else
        {
            int ar = RequestUtils.GetArticleId(this);
            articleParam = new ArticleParam(ar);
        }
    }
Example #10
0
        /**
         * Get balances of NEO and GAS for an address
         * @param {string} net - 'MainNet' or 'TestNet'.
         * @param {string} address - Address to check.
         * @return {Promise<Balance>} Balance of address
         */
        public static Dictionary <string, decimal> GetBalance(Net net, string address)
        {
            var apiEndpoint = getAPIEndpoint(net);
            var url         = apiEndpoint + "/v2/address/balance/" + address;
            var response    = RequestUtils.Request(RequestType.GET, url);

            var result = new Dictionary <string, decimal>();

            foreach (var node in response.Children)
            {
                if (node.HasNode("balance"))
                {
                    result[node.Name] = node.GetDecimal("balance");
                }
            }
            return(result);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // 判断是否多选
            ListSelectionMode selectionMode = "true".Equals(this.Request["singleSelect"]) ? ListSelectionMode.Single : ListSelectionMode.Multiple;

            this.AllUserInfo.SelectionMode = selectionMode;

            // 设置根OU节点
            this.rootOUUnid   = RequestUtils.GetStringParameter(this.Context, "rootOUUnid", TSWEBContext.Current.CurUser.UnitUnid);
            this.rootOUName   = HttpUtility.UrlDecode(RequestUtils.GetStringParameter(this.Context, "rootOUName", TSWEBContext.Current.CurUser.UnitFullName));
            this.groupType    = HttpUtility.UrlDecode(RequestUtils.GetStringParameter(this.Context, "groupType", "0"));
            this.OUUnid.Value = rootOUUnid;
            this.OUName.Text  = rootOUName;

            // 绑定岗位列表
            BindAllGroup();
        }
Example #12
0
        protected override TSLib.PageInfo GetPageInfo(TSLibStruts.ActionContext actionContext, HttpContext httpContext, int pageNo, int pageSize, string sortField, string sortDir)
        {
            string punid = RequestUtils.GetStringParameter(httpContext, "punid", "");
            string type  = RequestUtils.GetStringParameter(httpContext, "type", "");

            if (logger.IsDebugEnabled)
            {
                logger.Debug("punid = " + punid + " type = " + type);
            }
            pageNo   = 1;
            pageSize = int.MaxValue;
            if (string.IsNullOrEmpty(punid))
            {
                return(this.atmService.GetPage(pageNo, pageSize, sortField, sortDir));
            }
            return(this.atmService.GetPage(pageNo, pageSize, sortField, sortDir, punid, type));
        }
Example #13
0
        protected virtual async Task <StoreViewModel> GetStoreViewModelAsync(string storeNumber)
        {
            if (string.IsNullOrWhiteSpace(storeNumber))
            {
                return(ContextHelper.HandlePreviewMode(() => GetStoreViewModelAsync(PreviewModeService.Value.GetStoreNumber()).Result));
            }

            var vm = await StoreViewService.GetStoreViewModelAsync(new GetStoreByNumberParam
            {
                StoreNumber = storeNumber,
                CultureInfo = ComposerContext.CultureInfo,
                Scope       = ComposerContext.Scope,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString()
            }).ConfigureAwait(false);

            return(vm);
        }
    public static void AddItemToCart(string itemUri)
    {
        HttpWebResponse itemResponse     = SendHttpRequestToCortex.SendGetRequest(itemUri);
        string          itemResponseJSON = SendHttpRequestToCortex.GetResponseBody(itemResponse);

        Response itemResponseObj = (Response)RequestUtils.deserialize(itemResponseJSON, typeof(Response));

        // -- Get add to cart form uri
        string addToCartFormUrl = "";

        foreach (Response.Links linkObj in itemResponseObj.links)
        {
            if (linkObj.rel.Equals("addtocartform"))
            {
                addToCartFormUrl = linkObj.href;
            }
        }
        Debug.Log(addToCartFormUrl);

        // -- get add to cart form object to get addtodefaultcart action url
        HttpWebResponse addToCartFormResponse     = SendHttpRequestToCortex.SendGetRequest(addToCartFormUrl);
        string          addToCartFormResponseJSON = SendHttpRequestToCortex.GetResponseBody(addToCartFormResponse);

        Response addToCartFormResponseObj = (Response)RequestUtils.deserialize(addToCartFormResponseJSON, typeof(Response));

        Debug.Log(addToCartFormResponseJSON);

        // -- Get add to cart form uri
        string addToDefaultCartActionUrl = "";

        foreach (Response.Links linkObj in addToCartFormResponseObj.links)
        {
            if (linkObj.rel.Equals("addtodefaultcartaction"))
            {
                addToDefaultCartActionUrl = linkObj.href;
            }
        }

        Debug.Log(addToDefaultCartActionUrl);

        // add item to cart
        HttpWebResponse httpResponse = SendHttpRequestToCortex.SendPostRequest(addToDefaultCartActionUrl, quantityJsonForm);

        Debug.Log(httpResponse.StatusCode);
    }
        public void ExtractIpUsingXForwardedForHeaderMultipleIp()
        {
            var options = SecureNativeConfigurationBuilder.DefaultConfigBuilder().Build();

            var headers = new WebHeaderCollection
            {
                { "x-forwarded-for", "141.246.115.116, 203.0.113.1, 12.34.56.3" }
            };

            var uri     = new Uri("http://www.securenative.com/login");
            var request = WebRequest.Create(uri);

            request.Headers = headers;

            var clientIp = RequestUtils.GetClientIpFromRequest((HttpWebRequest)request, options);

            Assert.AreEqual("141.246.115.116", clientIp);
        }
Example #16
0
        /* 获取账户用户信息 */
        public JObject testUserInfo(string userToken)
        {
            JObject headParam = CommonUtils.GetCommonSystem(apiToken, userToken);
            string  url       = CommonUtils.GetAppConfig("account-host") + "/api/open/v1/user";
            JObject result    = RequestUtils.HttpGetRequest(url, headParam, null);

            if (result == null)
            {
                Console.WriteLine("请求失败");
                return(null);
            }
            if (result.Value <int>("retcode") == 0)
            {
                string payload = CommonUtils.DecodeAES(result.Value <string>("payload"));
                result["payload"] = JObject.Parse(payload);
            }
            return(result);
        }
        private string BuildUrl(CultureInfo cultureInfo, string keywords, int page, string sortBy, string sortDirection)
        {
            var searchUrl = SearchUrlProvider.BuildSearchUrl(new BuildSearchUrlParam
            {
                SearchCriteria = new SearchCriteria
                {
                    BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString(),
                    CultureInfo = cultureInfo,
                    Keywords    = keywords,
                    //We have to return to page 1 because the number of results can be different from a language to another
                    Page          = 1,
                    SortBy        = sortBy,
                    SortDirection = sortDirection
                }
            });

            return(searchUrl);
        }
        public void ExtractIpUsingXForwardedForHeaderIpv6()
        {
            var options = SecureNativeConfigurationBuilder.DefaultConfigBuilder().Build();

            var headers = new WebHeaderCollection
            {
                { "x-forwarded-for", "f71f:5bf9:25ff:1883:a8c4:eeff:7b80:aa2d" }
            };

            var uri     = new Uri("http://www.securenative.com/login");
            var request = WebRequest.Create(uri);

            request.Headers = headers;

            var clientIp = RequestUtils.GetClientIpFromRequest((HttpWebRequest)request, options);

            Assert.AreEqual("f71f:5bf9:25ff:1883:a8c4:eeff:7b80:aa2d", clientIp);
        }
        protected virtual async Task <ProductViewModel> GetProductViewModelAsync(string id, string variantId = null)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return(ContextHelper.HandlePreviewMode(() => GetProductViewModelAsync(PreviewModeService.Value.GetProductId()).Result));
            }

            var productViewModel = await ProductService.GetProductViewModelAsync(new GetProductParam
            {
                ProductId   = id,
                CultureInfo = ComposerContext.CultureInfo,
                Scope       = ComposerContext.Scope,
                VariantId   = variantId,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString()
            }).ConfigureAwait(false);

            return(productViewModel);
        }
Example #20
0
        protected virtual HttpRequestMessage FormRequest(string api, string path, Dictionary <string, string> args)
        {
            var timestamp = RequestUtils.GetTimestamp();

            var headers = new Dictionary <string, string>()
            {
                { "User-Agent", ".NET" },
                //{ "Content-Type", "application/json" },
                { "Accept", " */*" },
                { "9GAG-9GAG_TOKEN", AuthenticationInfo.Token },
                { "9GAG-TIMESTAMP", timestamp },
                { "9GAG-APP_ID", AuthenticationInfo.AppId },
                { "X-Package-ID", AuthenticationInfo.AppId },
                { "9GAG-DEVICE_UUID", AuthenticationInfo.DeviceUuid },
                { "X-Device-UUID", AuthenticationInfo.DeviceUuid },
                { "9GAG-DEVICE_TYPE", "android" },
                { "9GAG-BUCKET_NAME", "MAIN_RELEASE" },
                { "9GAG-REQUEST-SIGNATURE", RequestUtils.GetSignature(timestamp, AuthenticationInfo.AppId, AuthenticationInfo.DeviceUuid) }
            };

            var argsStrings = new List <string>();

            foreach (var entry in args)
            {
                argsStrings.Add(string.Format("{0}/{1}", entry.Key, entry.Value));
            }

            var urlItems = new List <string>()
            {
                api,
                path,
                string.Join("/", argsStrings)
            };

            var url     = string.Join("/", urlItems);
            var request = new HttpRequestMessage(HttpMethod.Get, url);

            foreach (var entry in headers)
            {
                request.Headers.Add(entry.Key, entry.Value);
            }

            return(request);
        }
Example #21
0
        public virtual async Task <IHttpActionResult> GetSearchResults(GetSearchResultsRequest request)
        {
            var queryString    = HttpUtility.ParseQueryString(request.QueryString ?? "");
            var SelectedFacets = SearchUrlProvider.BuildSelectedFacets(queryString).ToList();
            var CurrentPage    = int.TryParse(queryString[SearchRequestParams.Page], out int page) && page > 0 ? page : 1;
            var SortDirection  = queryString[SearchRequestParams.SortDirection] ?? SearchRequestParams.DefaultSortDirection;
            var SortBy         = queryString[SearchRequestParams.SortBy] ?? SearchRequestParams.DefaultSortBy;
            var BaseUrl        = RequestUtils.GetBaseUrl(Request).ToString();
            var Keywords       = queryString[SearchRequestParams.Keywords];
            BaseSearchViewModel viewModel;

            if (!string.IsNullOrEmpty(request.CategoryId))
            {
                var param = new GetCategoryBrowsingViewModelParam
                {
                    CategoryId           = request.CategoryId,
                    CategoryName         = string.Empty,
                    BaseUrl              = BaseUrl,
                    IsAllProducts        = false,
                    NumberOfItemsPerPage = SearchConfiguration.MaxItemsPerPage,
                    Page                 = CurrentPage,
                    SortBy               = SortBy,
                    SortDirection        = SortDirection,
                    InventoryLocationIds = await InventoryLocationProvider.GetInventoryLocationIdsForSearchAsync().ConfigureAwait(false),
                    SelectedFacets       = SelectedFacets,
                    CultureInfo          = ComposerContext.CultureInfo,
                };

                viewModel = await CategoryBrowsingViewService.GetCategoryBrowsingViewModelAsync(param).ConfigureAwait(false);
            }
            else
            {
                var searchCriteria = await BaseSearchCriteriaProvider.GetSearchCriteriaAsync(Keywords, BaseUrl, true, CurrentPage).ConfigureAwait(false);

                searchCriteria.SortBy        = SortBy;
                searchCriteria.SortDirection = SortDirection;
                searchCriteria.SelectedFacets.AddRange(SelectedFacets);

                viewModel = await SearchViewService.GetSearchViewModelAsync(searchCriteria).ConfigureAwait(false);
            }

            viewModel.ProductSearchResults.Facets = viewModel.ProductSearchResults.Facets.Where(f => !f.FieldName.StartsWith(SearchConfiguration.CategoryFacetFiledNamePrefix)).ToList();
            return(Ok(viewModel));
        }
        public virtual ActionResult PageHeader(string storeNumber)
        {
            var model = StoreContext.ViewModel;

            if (model == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            var vm = StoreViewService.GetPageHeaderViewModel(model, new GetStorePageHeaderViewModelParam
            {
                Scope       = ComposerContext.Scope,
                CultureInfo = ComposerContext.CultureInfo,
                StoreNumber = model.Number,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString()
            });

            return(View(vm));
        }
    /*
     * returns item url
     */
    static string SearchForItem(string itemName)
    {
        //Create search request json object
        RequestItemSearch searchRequestObj = new RequestItemSearch();

        searchRequestObj.keywords = itemName;

        string          requestJSON  = RequestUtils.serialize(searchRequestObj, typeof(RequestItemSearch));
        HttpWebResponse httpResponse = SendHttpRequestToCortex.SendPostRequest(searchURL, requestJSON);

        string         responseJSON      = SendHttpRequestToCortex.GetResponseBody(httpResponse);
        ResponseSearch responseSearchObj = (ResponseSearch)RequestUtils.deserialize(responseJSON, typeof(ResponseSearch));

        string itemUrl = responseSearchObj.links[0].href;         //We know there is only one link in the search results

        Debug.Log("Item URL: " + itemUrl);

        return(itemUrl);
    }
    public void SaveData()
    {
        int       positionId = RequestUtils.GetArticleId(this);
        Candidate candidate  = new Candidate();

        candidate.positionId = positionId;
        candidate.name       = tbName.Text.Trim();
        candidate.surname    = tbSurname.Text.Trim();
        candidate.comments   = tbComments.Text.Trim();
        candidate.phone      = tbPhone.Text.Trim();
        candidate.email      = tbEmail.Text.Trim();
        candidate.date       = DateTime.Now;
        using (GmConnection conn = Global.CreateConnection())
        {
            candidate.Save(conn);
            candidate.resume = UploadResume(candidate.Id);
            candidate.UpdateResume(conn);
        }
    }
Example #25
0
        public ActionResult VerifyTicket()
        {
            var ticket      = RequestUtils.GetString("Ticket");
            var callBackUrl = RequestUtils.GetString("CallBackUrl");
            //验证Ticket
            var verifyResult = _ticketManager.VerifyTicket(ticket);

            if (verifyResult)
            {
                //如果验证成功,那么将Account信息返回给客户端
                var account     = _ticketGrantingManager.GetTicketGranting();
                var key         = "";
                var accountBack = _ticketGrantingManager.BackAccount(account, out key);
                //根据CallBack地址 先拿到请求是属于哪一个客户端
                var webAppInfo = _webAppManager.GetWebAppInfoByUrl(callBackUrl);
                return(Redirect(UrlUtils.GetClientPutUrl(webAppInfo, accountBack, key, callBackUrl)));
            }
            return(Redirect(UrlUtils.GetVerifyUrl(callBackUrl)));
        }
            public response.ProfileScoringList list(string source_id, string profile_id = null, string profile_reference = null)
            {
                // To avoid a line of about 30000 column.
                var mess = String.Format("One beetween profile_id and profile_reference has to be not null or empty. (profile_id: {0} profile_reference: {1})", profile_id, profile_reference);

                RequestUtils.assert_id_ref_notNull(profile_id, profile_reference, mess);

                var query = new Dictionary <string, string>
                {
                    { "source_id", source_id }
                };

                RequestUtils.addIfNotNull(ref query, "profile_id", profile_id);
                RequestUtils.addIfNotNull(ref query, "profile_reference", profile_reference);

                var resp = _client.get <response.ProfileScoringList>("profile/scoring", args: query);

                return(resp.data);
            }
Example #27
0
    public PageInfo(Page page)
    {
        this.page = page;
        log       = new Log(page);
        try
        {
            AppCache appCache      = Global.AppCache;
            WebPage  defaultPage   = appCache.DefaultPage;
            WebPage  communityPage = null;
            int      cm            = RequestUtils.GetCommunityId(page);
            if (cm > 0)
            {
                communityPage = appCache.GetWebPage(cm);
            }
            string pageName = WebUtils.GetPageNameWithoutExtension(page);
            if (pageName.Length == 0)
            {
                pageName = Constants.defaultPageName;
            }
            WebPage webPage = appCache.GetWebPage(pageName);

/*			title=GetString(GetTitle(webPage),GetTitle(communityPage),GetTitle(defaultPage)," - ");
 *                      description=GetString(GetDescription(webPage),GetDescription(communityPage),GetDescription(defaultPage)," ");
 *                      keywords=GetString(GetKeywords(webPage),GetKeywords(communityPage),GetKeywords(defaultPage),", ");*/
            AddInfo(defaultPage);
            AddInfo(webPage);
            AddInfo(communityPage);
            if (communityPage != null)
            {
                AddBanners(communityPage, appCache);
            }
            else
            {
                AddBanners(webPage, appCache);
            }
            AddBanners(defaultPage, appCache);
            page.PreRender += new EventHandler(page_PreRender);
        }
        catch (Exception ex)
        {
            log.Exception(ex);
        }
    }
Example #28
0
        public virtual async Task <IHttpActionResult> GetGuestOrderByNumber(GetGuestOrderRequest param)
        {
            if (param == null)
            {
                return(BadRequest("No request found."));
            }

            var viewModel = await OrderHistoryViewService.GetOrderDetailViewModelForGuestAsync(new GetOrderForGuestParam
            {
                OrderNumber = param.OrderNumber,
                Scope       = ComposerContext.Scope,
                CultureInfo = ComposerContext.CultureInfo,
                CountryCode = ComposerContext.CountryCode,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString(),
                Email       = param.Email
            });

            return(Ok(viewModel));
        }
Example #29
0
        public virtual async Task <IHttpActionResult> RemoveCouponAsync(CouponRequest request)
        {
            if (request == null)
            {
                return(BadRequest("No request found."));
            }

            var vm = await CouponViewService.RemoveCouponAsync(new CouponParam
            {
                CartName    = CartConfiguration.ShoppingCartName,
                Scope       = ComposerContext.Scope,
                CouponCode  = request.CouponCode,
                CultureInfo = ComposerContext.CultureInfo,
                CustomerId  = ComposerContext.CustomerId,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString()
            });

            return(Ok(vm));
        }
        public virtual ActionResult LanguageSwitch(string storeNumber)
        {
            var model   = StoreContext.ViewModel;
            var baseUrl = RequestUtils.GetBaseUrl(Request).ToString();

            if (model == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }

            var languageSwitchViewModel = LanguageSwitchService.GetViewModel(cultureInfo => BuildUrl(
                                                                                 baseUrl,
                                                                                 cultureInfo,
                                                                                 model.LocalizedDisplayNames[cultureInfo.Name],
                                                                                 model.Number),
                                                                             ComposerContext.CultureInfo);

            return(View("LanguageSwitch", languageSwitchViewModel));
        }