Пример #1
0
        private string sendGoods(HttpContext context)
        {
            string text  = context.Request["OrderNO"].Trim();
            string text2 = context.Request["SndStyle"].Trim();
            string text3 = context.Request["BillID"].Trim();
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("OrderId", text);
            dictionary.Add("SndStyle", text2);
            dictionary.Add("BillID", text3);
            dictionary.Add("ErrorMsg", "");
            if (text.IndexOf(',') > 0)
            {
                return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>0</Result><Cause><![CDATA[{不支持合并发货,请选择单个订单}]]></Cause></Rsp>");
            }
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(text);

            if (orderInfo == null)
            {
                return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>0</Result><Cause><![CDATA[{未找到此订单}]]></Cause></Rsp>");
            }
            if (orderInfo.OrderStatus == OrderStatus.WaitBuyerPay && OrderHelper.NeedUpdateStockWhenSendGoods(orderInfo) && !OrderHelper.CheckStock(orderInfo))
            {
                return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>0</Result><Cause><![CDATA[{订单有商品库存不足,请补充库存后发货!}]]></Cause></Rsp>");
            }
            if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Success)
            {
                return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>0</Result><Cause><![CDATA[{当前订单为团购订单,团购活动还未成功结束,所以不能发货!}]]></Cause></Rsp>");
            }
            if (!orderInfo.CheckAction(OrderActions.SELLER_SEND_GOODS))
            {
                return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>0</Result><Cause><![CDATA[{当前订单状态没有付款或不是等待发货的订单,所以不能发货!}]]></Cause></Rsp>");
            }
            if (string.IsNullOrEmpty(text3.Trim()) || text3.Trim().Length > 20)
            {
                return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>0</Result><Cause><![CDATA[{运单号码不能为空,在1至20个字符之间!}]]></Cause></Rsp>");
            }
            ExpressCompanyInfo expressCompanyInfo = ExpressHelper.FindNodeLikeName(text2);

            if (expressCompanyInfo != null)
            {
                orderInfo.ExpressCompanyAbb  = expressCompanyInfo.Kuaidi100Code;
                orderInfo.ExpressCompanyName = expressCompanyInfo.Name;
            }
            else
            {
                orderInfo.ExpressCompanyAbb  = "";
                orderInfo.ExpressCompanyName = text2;
            }
            orderInfo.ShipOrderNumber = text3;
            if (!string.IsNullOrEmpty(orderInfo.OuterOrderId) && orderInfo.OuterOrderId.StartsWith("jd_") && (expressCompanyInfo == null || string.IsNullOrWhiteSpace(expressCompanyInfo.JDCode)))
            {
                return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>0</Result><Cause><![CDATA[{此订单是京东订单,所选物流公司不被京东支持!}]]></Cause></Rsp>");
            }
            if (OrderHelper.SendAPIGoods(orderInfo, true))
            {
                string text4 = "";
                if (orderInfo.Gateway == "hishop.plugins.payment.weixinrequest")
                {
                    try
                    {
                        SiteSettings masterSettings = SettingsManager.GetMasterSettings();
                        PayClient    payClient      = new PayClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, masterSettings.WeixinPaySignKey, "", "", "");
                        DeliverInfo  deliverInfo    = new DeliverInfo();
                        deliverInfo.TransId    = orderInfo.GatewayOrderId;
                        deliverInfo.OutTradeNo = orderInfo.OrderId;
                        MemberOpenIdInfo memberOpenIdInfo = Users.GetUser(orderInfo.UserId).MemberOpenIds.FirstOrDefault((MemberOpenIdInfo item) => item.OpenIdType.ToLower() == "hishop.plugins.openid.weixin");
                        if (memberOpenIdInfo != null)
                        {
                            deliverInfo.OpenId = memberOpenIdInfo.OpenId;
                        }
                        payClient.DeliverNotify(deliverInfo);
                    }
                    catch (Exception ex)
                    {
                        dictionary["ErrrorMsg"] = "同步微信支付发货状态失败";
                        Globals.WriteExceptionLog(ex, dictionary, "APISendGoods");
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && orderInfo.GatewayOrderId.Trim().Length > 0)
                    {
                        try
                        {
                            PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(orderInfo.Gateway);
                            if (paymentMode != null && !string.IsNullOrEmpty(paymentMode.Settings))
                            {
                                string         hIGW           = paymentMode.Gateway.Replace(".", "_");
                                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.PayOrderId, orderInfo.GetTotal(false), "订单发货", "订单号-" + orderInfo.PayOrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(""), Globals.FullPath(RouteConfig.GetRouteUrl(HttpContext.Current, "PaymentReturn_url", new
                                {
                                    HIGW = hIGW
                                })), Globals.FullPath(RouteConfig.GetRouteUrl(HttpContext.Current, "PaymentNotify_url", new
                                {
                                    HIGW = hIGW
                                })), "");
                                paymentRequest.SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS");
                            }
                        }
                        catch (Exception ex2)
                        {
                            dictionary["ErrrorMsg"] = "同步支付接口发货状态失败";
                            Globals.WriteExceptionLog(ex2, dictionary, "APISendGoods");
                        }
                    }
                    if (!string.IsNullOrEmpty(orderInfo.OuterOrderId))
                    {
                        if (orderInfo.OuterOrderId.StartsWith("tb_"))
                        {
                            string text5 = orderInfo.OuterOrderId.Replace("tb_", "");
                            try
                            {
                                string     requestUriString = $"http://order2.kuaidiangtong.com/UpdateShipping.ashx?tid={text5}&companycode={expressCompanyInfo.TaobaoCode}&outsid={orderInfo.ShipOrderNumber}&Host={HiContext.Current.SiteUrl}";
                                WebRequest webRequest       = WebRequest.Create(requestUriString);
                                webRequest.GetResponse();
                            }
                            catch (Exception ex3)
                            {
                                dictionary["ErrrorMsg"] = "同步淘宝发货状态失败";
                                Globals.WriteExceptionLog(ex3, dictionary, "APISendGoods");
                            }
                        }
                        else if (orderInfo.OuterOrderId.StartsWith("jd_"))
                        {
                            string text5 = orderInfo.OuterOrderId.Replace("jd_", "");
                            try
                            {
                                SiteSettings masterSettings2 = SettingsManager.GetMasterSettings();
                                JDHelper.JDOrderOutStorage(masterSettings2.JDAppKey, masterSettings2.JDAppSecret, masterSettings2.JDAccessToken, expressCompanyInfo.JDCode, orderInfo.ShipOrderNumber, text5);
                            }
                            catch (Exception ex4)
                            {
                                dictionary["ErrrorMsg"] = "同步京东发货失败";
                                Globals.WriteExceptionLog(ex4, dictionary, "APISendGoods");
                                text4 = $"同步京东发货失败,京东订单号:{text5},{ex4.Message}\r\n";
                            }
                        }
                    }
                }
                MemberInfo user = Users.GetUser(orderInfo.UserId);
                Messenger.OrderShipping(orderInfo, user);
                orderInfo.OnDeliver();
                return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>1</Result><Cause></Cause></Rsp>");
            }
            return("<?xml version='1.0' encoding='utf-8'?><Rsp><Result>0</Result><Cause><![CDATA[{发货失败,可能是商品库存不足,订单中有商品正在退货、换货状态!}]]></Cause></Rsp>");
        }
Пример #2
0
        public void CreateCateXml()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.XmlResolver = null;
            XmlDeclaration newChild = xmlDocument.CreateXmlDeclaration("1.0", "utf-8", null);

            xmlDocument.AppendChild(newChild);
            XmlElement xmlElement = xmlDocument.CreateElement("", "urlset", "http://www.sitemaps.org/schemas/sitemap/0.9");

            xmlDocument.AppendChild(xmlElement);
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("select CategoryId,RewriteName from Hishop_Categories");

            using (IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                while (dataReader.Read())
                {
                    XmlElement xmlElement2 = xmlDocument.CreateElement("url", xmlElement.NamespaceURI);
                    XmlElement xmlElement3 = xmlDocument.CreateElement("loc", xmlElement2.NamespaceURI);
                    object     obj         = ((IDataRecord)dataReader)["RewriteName"];
                    string     text        = (obj != null && obj != DBNull.Value && !string.IsNullOrEmpty(obj.ToString())) ? (this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "subCategory_Rewrite", new
                    {
                        rewrite = obj,
                        categoryId = Convert.ToInt32(((IDataRecord)dataReader)["CategoryId"])
                    })) : (this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "subCategory", new
                    {
                        categoryId = Convert.ToInt32(((IDataRecord)dataReader)["CategoryId"])
                    }));
                    XmlText newChild2 = xmlDocument.CreateTextNode(text);
                    xmlElement3.AppendChild(newChild2);
                    XmlElement xmlElement4 = xmlDocument.CreateElement("lastmod", xmlElement2.NamespaceURI);
                    XmlText    newChild3   = xmlDocument.CreateTextNode(DateTime.Now.ToString("yyyy-MM-dd"));
                    xmlElement4.AppendChild(newChild3);
                    XmlElement xmlElement5 = xmlDocument.CreateElement("changefreq", xmlElement2.NamespaceURI);
                    xmlElement5.InnerText = "daily";
                    XmlElement xmlElement6 = xmlDocument.CreateElement("priority", xmlElement2.NamespaceURI);
                    xmlElement6.InnerText = "1.0";
                    XmlElement xmlElement7 = xmlDocument.CreateElement("data", xmlElement2.NamespaceURI);
                    XmlElement xmlElement8 = xmlDocument.CreateElement("display", xmlElement7.NamespaceURI);
                    XmlElement xmlElement9 = xmlDocument.CreateElement("html5_url", xmlElement8.NamespaceURI);
                    xmlElement9.InnerText = text;
                    XmlElement xmlElement10 = xmlDocument.CreateElement("wml_url", xmlElement8.NamespaceURI);
                    xmlElement10.InnerText = text;
                    XmlElement xmlElement11 = xmlDocument.CreateElement("xhtml_url", xmlElement8.NamespaceURI);
                    xmlElement11.InnerText = text;
                    xmlElement7.AppendChild(xmlElement8);
                    xmlElement8.AppendChild(xmlElement9);
                    xmlElement8.AppendChild(xmlElement10);
                    xmlElement8.AppendChild(xmlElement11);
                    xmlElement2.AppendChild(xmlElement3);
                    xmlElement2.AppendChild(xmlElement4);
                    xmlElement2.AppendChild(xmlElement5);
                    xmlElement2.AppendChild(xmlElement6);
                    xmlElement2.AppendChild(xmlElement7);
                    xmlElement.AppendChild(xmlElement2);
                }
            }
            if (File.Exists(this.webroot + "/sitemap1.xml"))
            {
                File.Delete(this.webroot + "/sitemap1.xml");
            }
            xmlDocument.Save(this.webroot + "/sitemap1.xml");
        }
Пример #3
0
        public void CreateArticleXml()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.XmlResolver = null;
            XmlDeclaration newChild = xmlDocument.CreateXmlDeclaration("1.0", "utf-8", null);

            xmlDocument.AppendChild(newChild);
            XmlElement xmlElement = xmlDocument.CreateElement("", "urlset", "http://www.sitemaps.org/schemas/sitemap/0.9");

            xmlDocument.AppendChild(xmlElement);
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("select ArticleId from dbo.Hishop_Articles where IsRelease='1'");

            using (IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                while (dataReader.Read())
                {
                    XmlElement xmlElement2 = xmlDocument.CreateElement("url", xmlElement.NamespaceURI);
                    XmlElement xmlElement3 = xmlDocument.CreateElement("loc", xmlElement2.NamespaceURI);
                    XmlText    newChild2   = xmlDocument.CreateTextNode(this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "ArticleDetails", new
                    {
                        articleId = Convert.ToInt32(((IDataRecord)dataReader)["ArticleId"])
                    }));
                    xmlElement3.AppendChild(newChild2);
                    XmlElement xmlElement4 = xmlDocument.CreateElement("lastmod", xmlElement2.NamespaceURI);
                    XmlText    newChild3   = xmlDocument.CreateTextNode(DateTime.Now.ToString("yyyy-MM-dd"));
                    xmlElement4.AppendChild(newChild3);
                    XmlElement xmlElement5 = xmlDocument.CreateElement("changefreq", xmlElement2.NamespaceURI);
                    xmlElement5.InnerText = "daily";
                    XmlElement xmlElement6 = xmlDocument.CreateElement("priority", xmlElement2.NamespaceURI);
                    xmlElement6.InnerText = "1.0";
                    XmlElement xmlElement7 = xmlDocument.CreateElement("data", xmlElement2.NamespaceURI);
                    XmlElement xmlElement8 = xmlDocument.CreateElement("display", xmlElement7.NamespaceURI);
                    XmlElement xmlElement9 = xmlDocument.CreateElement("html5_url", xmlElement8.NamespaceURI);
                    xmlElement9.InnerText = this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "ArticleDetails", new
                    {
                        articleId = Convert.ToInt32(((IDataRecord)dataReader)["ArticleId"])
                    });
                    XmlElement xmlElement10 = xmlDocument.CreateElement("wml_url", xmlElement8.NamespaceURI);
                    xmlElement10.InnerText = this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "ArticleDetails", new
                    {
                        articleId = Convert.ToInt32(((IDataRecord)dataReader)["ArticleId"])
                    });
                    XmlElement xmlElement11 = xmlDocument.CreateElement("xhtml_url", xmlElement8.NamespaceURI);
                    xmlElement11.InnerText = this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "ArticleDetails", new
                    {
                        articleId = Convert.ToInt32(((IDataRecord)dataReader)["ArticleId"])
                    });
                    xmlElement7.AppendChild(xmlElement8);
                    xmlElement8.AppendChild(xmlElement9);
                    xmlElement8.AppendChild(xmlElement10);
                    xmlElement8.AppendChild(xmlElement11);
                    xmlElement2.AppendChild(xmlElement3);
                    xmlElement2.AppendChild(xmlElement4);
                    xmlElement2.AppendChild(xmlElement5);
                    xmlElement2.AppendChild(xmlElement6);
                    xmlElement2.AppendChild(xmlElement7);
                    xmlElement.AppendChild(xmlElement2);
                }
            }
            if (File.Exists(this.webroot + "/sitemap3.xml"))
            {
                File.Delete(this.webroot + "/sitemap3.xml");
            }
            xmlDocument.Save(this.webroot + "/sitemap3.xml");
        }
Пример #4
0
        public void CreateProductXml()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.XmlResolver = null;
            XmlDeclaration newChild = xmlDocument.CreateXmlDeclaration("1.0", "utf-8", null);

            xmlDocument.AppendChild(newChild);
            XmlElement xmlElement = xmlDocument.CreateElement("", "urlset", "http://www.sitemaps.org/schemas/sitemap/0.9");

            xmlDocument.AppendChild(xmlElement);
            int       num     = default(int);
            DbCommand command = (!int.TryParse(this.siteSettings.SiteMapNum, out num) || num <= 0) ? this.database.GetSqlStringCommand("select top  1000 productid from dbo.Hishop_Products where salestatus=1 order by productid desc") : this.database.GetSqlStringCommand("select top " + num + " productid from dbo.Hishop_Products where salestatus=1  order by productid desc");

            using (IDataReader dataReader = this.database.ExecuteReader(command))
            {
                while (dataReader.Read())
                {
                    XmlElement xmlElement2 = xmlDocument.CreateElement("url", xmlElement.NamespaceURI);
                    XmlElement xmlElement3 = xmlDocument.CreateElement("loc", xmlElement2.NamespaceURI);
                    XmlText    newChild2   = xmlDocument.CreateTextNode(this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "productDetails", new
                    {
                        ProductId = Convert.ToInt32(((IDataRecord)dataReader)["productid"])
                    }));
                    xmlElement3.AppendChild(newChild2);
                    XmlElement xmlElement4 = xmlDocument.CreateElement("lastmod", xmlElement2.NamespaceURI);
                    XmlText    newChild3   = xmlDocument.CreateTextNode(DateTime.Now.ToString("yyyy-MM-dd"));
                    xmlElement4.AppendChild(newChild3);
                    XmlElement xmlElement5 = xmlDocument.CreateElement("changefreq", xmlElement2.NamespaceURI);
                    xmlElement5.InnerText = "daily";
                    XmlElement xmlElement6 = xmlDocument.CreateElement("priority", xmlElement2.NamespaceURI);
                    xmlElement6.InnerText = "1.0";
                    XmlElement xmlElement7 = xmlDocument.CreateElement("data", xmlElement2.NamespaceURI);
                    XmlElement xmlElement8 = xmlDocument.CreateElement("display", xmlElement7.NamespaceURI);
                    XmlElement xmlElement9 = xmlDocument.CreateElement("html5_url", xmlElement8.NamespaceURI);
                    xmlElement9.InnerText = this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "productDetails", new
                    {
                        ProductId = Convert.ToInt32(((IDataRecord)dataReader)["productid"])
                    });
                    XmlElement xmlElement10 = xmlDocument.CreateElement("wml_url", xmlElement8.NamespaceURI);
                    xmlElement10.InnerText = this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "productDetails", new
                    {
                        ProductId = Convert.ToInt32(((IDataRecord)dataReader)["productid"])
                    });
                    XmlElement xmlElement11 = xmlDocument.CreateElement("xhtml_url", xmlElement8.NamespaceURI);
                    xmlElement11.InnerText = this.prourl + RouteConfig.GetRouteUrl(HttpContext.Current, "productDetails", new
                    {
                        ProductId = Convert.ToInt32(((IDataRecord)dataReader)["productid"])
                    });
                    xmlElement7.AppendChild(xmlElement8);
                    xmlElement8.AppendChild(xmlElement9);
                    xmlElement8.AppendChild(xmlElement10);
                    xmlElement8.AppendChild(xmlElement11);
                    xmlElement2.AppendChild(xmlElement3);
                    xmlElement2.AppendChild(xmlElement4);
                    xmlElement2.AppendChild(xmlElement5);
                    xmlElement2.AppendChild(xmlElement6);
                    xmlElement2.AppendChild(xmlElement7);
                    xmlElement.AppendChild(xmlElement2);
                }
            }
            if (File.Exists(this.webroot + "/sitemap2.xml"))
            {
                File.Delete(this.webroot + "/sitemap2.xml");
            }
            xmlDocument.Save(this.webroot + "/sitemap2.xml");
        }
 private void ProcessProductSearch(HttpContext context)
 {
     try
     {
         string       str          = "http://" + HttpContext.Current.Request.Url.Host;
         ProductQuery productQuery = new ProductQuery();
         productQuery.PageIndex   = int.Parse(context.Request.Form["pageIndex"]);
         productQuery.PageSize    = int.Parse(context.Request.Form["pageSize"]);
         productQuery.Keywords    = context.Request.Form["productName"];
         productQuery.ProductCode = context.Request.Form["productCode"];
         if (!string.IsNullOrEmpty(context.Request.Form["publishStatus"]))
         {
             productQuery.PublishStatus = (PublishStatus)int.Parse(context.Request.Form["publishStatus"]);
         }
         if (!string.IsNullOrEmpty(context.Request.Form["IsMakeTaobao"]))
         {
             productQuery.IsMakeTaobao = int.Parse(context.Request.Form["IsMakeTaobao"]);
         }
         if (!string.IsNullOrEmpty(context.Request.Form["startDate"]))
         {
             productQuery.StartDate = DateTime.Parse(context.Request.Form["startDate"]);
         }
         if (!string.IsNullOrEmpty(context.Request.Form["endDate"]))
         {
             productQuery.EndDate = DateTime.Parse(context.Request.Form["endDate"]);
         }
         Globals.EntityCoding(productQuery, true);
         DbQueryResult toTaobaoProducts = ProductHelper.GetToTaobaoProducts(productQuery);
         StringBuilder stringBuilder    = new StringBuilder();
         stringBuilder.Append("{");
         stringBuilder.Append("\"Products\":[");
         DataTable data = toTaobaoProducts.Data;
         if (data.Rows.Count > 0)
         {
             string text = "";
             foreach (DataRow row in data.Rows)
             {
                 stringBuilder.Append("{");
                 stringBuilder.AppendFormat("\"ProductId\":{0},", row["ProductId"]);
                 stringBuilder.AppendFormat("\"ProductDetailLink\":\"{0}\",", str + RouteConfig.GetRouteUrl(this.myContext, "productDetails", new
                 {
                     ProductId = row["ProductId"]
                 }));
                 stringBuilder.AppendFormat("\"DisplaySequence\":{0},", row["DisplaySequence"]);
                 text = ((row["ThumbnailUrl40"] == DBNull.Value) ? HiContext.Current.SiteSettings.DefaultProductImage : ((string)row["ThumbnailUrl40"]));
                 if (!text.StartsWith("http://") && !text.StartsWith("https://"))
                 {
                     text = str + text;
                 }
                 stringBuilder.AppendFormat("\"ThumbnailUrl40\":\"{0}\",", text);
                 stringBuilder.AppendFormat("\"ProductName\":\"{0}\",", HttpUtility.UrlEncode(row["ProductName"].ToString()));
                 stringBuilder.AppendFormat("\"ProductCode\":\"{0}\",", row["ProductCode"]);
                 stringBuilder.AppendFormat("\"Stock\":{0},", row["Stock"]);
                 stringBuilder.AppendFormat("\"MarketPrice\":{0},", (row["MarketPrice"] != DBNull.Value) ? ((decimal)row["MarketPrice"]).F2ToString("f2") : "0");
                 stringBuilder.AppendFormat("\"SalePrice\":{0},", (row["SalePrice"] != DBNull.Value) ? ((decimal)row["SalePrice"]).F2ToString("f2") : "0");
                 stringBuilder.AppendFormat("\"IsMakeTaobao\":{0},", (row["IsMakeTaobao"] != DBNull.Value) ? ((int)row["IsMakeTaobao"]) : 0);
                 stringBuilder.AppendFormat("\"TaobaoProductId\":{0}", (row["TaobaoProductId"] != DBNull.Value) ? ((long)row["TaobaoProductId"]) : 0);
                 stringBuilder.Append("},");
             }
             stringBuilder.Remove(stringBuilder.Length - 1, 1);
         }
         stringBuilder.Append("],");
         stringBuilder.AppendFormat("\"TotalResults\":{0}", toTaobaoProducts.TotalRecords);
         stringBuilder.Append("}");
         context.Response.Write(stringBuilder.ToString());
     }
     catch (Exception ex)
     {
         NameValueCollection nameValueCollection = new NameValueCollection
         {
             HttpContext.Current.Request.Form,
             HttpContext.Current.Request.QueryString
         };
         nameValueCollection.Add("ErrorMessage", ex.Message);
         nameValueCollection.Add("StackTrace", ex.StackTrace);
         if (ex.InnerException != null)
         {
             nameValueCollection.Add("InnerException", ex.InnerException.ToString());
         }
         if (ex.GetBaseException() != null)
         {
             nameValueCollection.Add("BaseException", ex.GetBaseException().Message);
         }
         if (ex.TargetSite != (MethodBase)null)
         {
             nameValueCollection.Add("TargetSite", ex.TargetSite.ToString());
         }
         nameValueCollection.Add("ExSource", ex.Source);
         Globals.AppendLog(nameValueCollection, "", "", HttpContext.Current.Request.Url.ToString(), "TaobaoProduct");
     }
 }