Example #1
0
        public void ProcessRequest(HttpContext context)
        {
            bool showallShop = false;

            if (context.Request.Params["showAllBrandInf"] != null && context.Request.Params["showAllBrandInf"].ToLower() == "true")
            {
                showallShop = true;
            }

            string dataString = string.Empty;

            List <RosShopInfo> shopDatas = new List <RosShopInfo>(HotSpotWebService.LoadShopData("M001001", "F1_0", showallShop));

            if (context.Request.Params["data"] != null && context.Request.Params["data"].ToLower() == "true")
            {
                List <ROSHotSpot> dataarrays = new List <ROSHotSpot>();
                foreach (RosShopInfo shopInfo in shopDatas)
                {
                    dataarrays.Add(shopInfo.HotSpotInfo);
                }
                dataString = JsonConvert.SerializeObject(dataarrays);
            }
            else
            {
                DataRecordArray <RosShopInfo> datas = new DataRecordArray <RosShopInfo>(shopDatas);
                dataString = JsonConvert.SerializeObject(datas);
            }


            context.Response.ContentType = "text/plain";
            context.Response.Write(dataString);
            context.Response.End();
        }
        public void ProcessRequest(HttpContext context)
        {
            List <BrandCompetitionScoreResult> brandCompetitionScoreResults = new List <BrandCompetitionScoreResult>(HotSpotWebService.GetBrandCompetitionScoreResult("M001001", "F1_0", context.Request.Params["shopbrandinfo"]));


            DataRecordArray <BrandCompetitionScoreResult> datas = new DataRecordArray <BrandCompetitionScoreResult>(brandCompetitionScoreResults);

            string dataString = JsonConvert.SerializeObject(datas);

            context.Response.ContentType = "text/plain";
            context.Response.Write(dataString);
            context.Response.End();
        }