示例#1
0
        private void GetCanShipStores(HttpContext context)
        {
            int                num           = context.Request["regionId"].ToInt(0);
            string             fullPath      = RegionHelper.GetFullPath(num, true);
            IList <StoresInfo> canShipStores = StoresHelper.GetCanShipStores(num, fullPath);
            StringBuilder      strData       = new StringBuilder();

            if (canShipStores.Count == 0)
            {
                strData.Append("[]");
            }
            else
            {
                strData.Append("[");
                canShipStores.ForEach(delegate(StoresInfo x)
                {
                    strData.Append("{");
                    strData.AppendFormat("\"StoreId\":{0},", x.StoreId);
                    strData.AppendFormat("\"StoreName\":\"{0}\"", x.StoreName);
                    strData.Append("},");
                });
                strData.Remove(strData.Length - 1, 1);
                strData.Append("]");
            }
            context.Response.ContentType = "text/json";
            context.Response.Write(strData);
        }