protected void Page_Load(object sender, EventArgs e) { string openIdType = "hishop.plugins.openid.alipay.alipayservice"; OpenIdSettingInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType); if (openIdSettings != null) { string value = base.Request.QueryString["alipaytoken"]; XmlDocument xmlDocument = new XmlDocument(); xmlDocument.XmlResolver = null; xmlDocument.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings)); SortedDictionary <string, string> sortedDictionary = new SortedDictionary <string, string>(); sortedDictionary.Add("service", "user.logistics.address.query"); sortedDictionary.Add("partner", xmlDocument.FirstChild.SelectSingleNode("Partner").InnerText); sortedDictionary.Add("_input_charset", "utf-8"); sortedDictionary.Add("return_url", Globals.FullPath("openid/LogisticsAddress_url")); sortedDictionary.Add("token", value); Dictionary <string, string> dictionary = OpenIdFunction.FilterPara(sortedDictionary); string value2 = OpenIdFunction.BuildMysign(dictionary, xmlDocument.FirstChild.SelectSingleNode("Key").InnerText, "MD5", "utf-8"); dictionary.Add("sign", value2); dictionary.Add("sign_type", "MD5"); StringBuilder stringBuilder = new StringBuilder(); foreach (KeyValuePair <string, string> item in dictionary) { stringBuilder.Append(OpenIdFunction.CreateField(item.Key, item.Value)); } sortedDictionary.Clear(); dictionary.Clear(); OpenIdFunction.Submit(OpenIdFunction.CreateForm(stringBuilder.ToString(), "https://mapi.alipay.com/gateway.do?_input_charset=utf-8")); } }
protected void Page_Load(object sender, EventArgs e) { string openIdType = "hishop.plugins.openid.alipay.alipayservice"; OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType); if (openIdSettings != null) { string str2 = base.Request.QueryString["alipaytoken"]; XmlDocument document = new XmlDocument(); document.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings)); SortedDictionary <string, string> dicArrayPre = new SortedDictionary <string, string>(); dicArrayPre.Add("service", "user.logistics.address.query"); dicArrayPre.Add("partner", document.FirstChild.SelectSingleNode("Partner").InnerText); dicArrayPre.Add("_input_charset", "utf-8"); dicArrayPre.Add("return_url", Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("LogisticsAddress_url"))); dicArrayPre.Add("token", str2); Dictionary <string, string> dicArray = OpenIdFunction.FilterPara(dicArrayPre); string str3 = OpenIdFunction.BuildMysign(dicArray, document.FirstChild.SelectSingleNode("Key").InnerText, "MD5", "utf-8"); dicArray.Add("sign", str3); dicArray.Add("sign_type", "MD5"); StringBuilder builder = new StringBuilder(); foreach (KeyValuePair <string, string> pair in dicArray) { builder.Append(OpenIdFunction.CreateField(pair.Key, pair.Value)); } dicArrayPre.Clear(); dicArray.Clear(); OpenIdFunction.Submit(OpenIdFunction.CreateForm(builder.ToString(), "https://mapi.alipay.com/gateway.do?_input_charset=utf-8")); } }
protected void Page_Load(object sender, System.EventArgs e) { string openIdType = "Ecdev.plugins.openid.alipay.alipayservice"; OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType); if (openIdSettings == null) { return; } string value = base.Request.QueryString["alipaytoken"]; System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument(); xmlDocument.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings)); System.Collections.Generic.SortedDictionary <string, string> sortedDictionary = new System.Collections.Generic.SortedDictionary <string, string>(); sortedDictionary.Add("service", "user.logistics.address.query"); sortedDictionary.Add("partner", xmlDocument.FirstChild.SelectSingleNode("Partner").InnerText); sortedDictionary.Add("_input_charset", "utf-8"); sortedDictionary.Add("return_url", Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("LogisticsAddress_url"))); sortedDictionary.Add("token", value); System.Collections.Generic.Dictionary <string, string> dictionary = OpenIdFunction.FilterPara(sortedDictionary); string value2 = OpenIdFunction.BuildMysign(dictionary, xmlDocument.FirstChild.SelectSingleNode("Key").InnerText, "MD5", "utf-8"); dictionary.Add("sign", value2); dictionary.Add("sign_type", "MD5"); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); foreach (System.Collections.Generic.KeyValuePair <string, string> current in dictionary) { stringBuilder.Append(OpenIdFunction.CreateField(current.Key, current.Value)); } sortedDictionary.Clear(); dictionary.Clear(); OpenIdFunction.Submit(OpenIdFunction.CreateForm(stringBuilder.ToString(), "https://mapi.alipay.com/gateway.do?_input_charset=utf-8")); }
/// <summary> /// 窗体加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { //获取产品ID号 int.TryParse(base.Request.QueryString["productId"], out productId); //获取记录集 DataSet taobaoProductDetails = ProductHelper.GetTaobaoProductDetails(productId); //第一个表 DataTable table = taobaoProductDetails.Tables[0]; SortedDictionary <string, string> dicArrayPre = new SortedDictionary <string, string>(); dicArrayPre.Add("SiteUrl", "demo2.shopefx.com");//"shopefx.china220.92hidc.net");//"localhost");//"www.92hi.com");//"shopefx.china220.92hidc.net");// HiContext.Current.SiteUrl);localhost//原来是这里在作怪 dicArrayPre.Add("_input_charset", "utf-8"); dicArrayPre.Add("return_url", Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("MakeTaobaoProductData_url"))); dicArrayPre.Add("ProductId", productId.ToString()); dicArrayPre.Add("HasSKU", table.Rows[0]["HasSKU"].ToString()); dicArrayPre.Add("ProductName", (string)table.Rows[0]["ProductName"]); dicArrayPre.Add("ProductCode", (string)table.Rows[0]["ProductCode"]); dicArrayPre.Add("CategoryName", (table.Rows[0]["CategoryName"] == DBNull.Value) ? "" : ((string)table.Rows[0]["CategoryName"])); dicArrayPre.Add("ProductLineName", (table.Rows[0]["ProductLineName"] == DBNull.Value) ? "" : ((string)table.Rows[0]["ProductLineName"])); dicArrayPre.Add("BrandName", (table.Rows[0]["BrandName"] == DBNull.Value) ? "" : ((string)table.Rows[0]["BrandName"])); dicArrayPre.Add("SalePrice", Convert.ToDecimal(table.Rows[0]["SalePrice"]).ToString("F2")); dicArrayPre.Add("MarketPrice", (table.Rows[0]["MarketPrice"] == DBNull.Value) ? "0" : Convert.ToDecimal(table.Rows[0]["MarketPrice"]).ToString("F2")); dicArrayPre.Add("CostPrice", Convert.ToDecimal(table.Rows[0]["CostPrice"]).ToString("F2")); dicArrayPre.Add("PurchasePrice", Convert.ToDecimal(table.Rows[0]["PurchasePrice"]).ToString("F2")); dicArrayPre.Add("Stock", table.Rows[0]["Stock"].ToString()); //第二个表 DataTable taobaoProductTB1 = taobaoProductDetails.Tables[1]; if (taobaoProductTB1.Rows.Count > 0) { string str = string.Empty; foreach (DataRow row in taobaoProductTB1.Rows) { //object obj2 = str; str = string.Concat(new object[] { str, row["AttributeName"], ":", row["ValueStr"], ";" });//(new object[] { obj2, row["AttributeName"], ":", row["ValueStr"], ";" }); } str = str.Remove(str.Length - 1); dicArrayPre.Add("Attributes", str); } //第三个表 DataTable taobaoProductTB2 = taobaoProductDetails.Tables[2]; if (taobaoProductTB2.Rows.Count > 0) { StringBuilder builder = new StringBuilder(); StringBuilder builder2 = new StringBuilder(); for (int i = taobaoProductTB2.Columns.Count - 1; i >= 0; i--) { builder2.Append(taobaoProductTB2.Columns[i].ColumnName).Append(";"); } foreach (DataRow row2 in taobaoProductTB2.Rows) { for (int j = taobaoProductTB2.Columns.Count - 1; j >= 0; j--) { builder.Append(row2[taobaoProductTB2.Columns[j].ColumnName]).Append(";"); } builder.Remove(builder.Length - 1, 1).Append(","); } builder2.Remove(builder2.Length - 1, 1).Append(",").Append(builder.Remove(builder.Length - 1, 1)); dicArrayPre.Add("skus", builder2.ToString()); } //第四个表 DataTable taobaoProductTB3 = taobaoProductDetails.Tables[3]; if (taobaoProductTB3.Rows.Count > 0) { dicArrayPre.Add("Cid", taobaoProductTB3.Rows[0]["Cid"].ToString()); if (taobaoProductTB3.Rows[0]["StuffStatus"] != DBNull.Value) { dicArrayPre.Add("StuffStatus", (string)taobaoProductTB3.Rows[0]["StuffStatus"]); } dicArrayPre.Add("ProTitle", (string)taobaoProductTB3.Rows[0]["ProTitle"]); dicArrayPre.Add("Num", taobaoProductTB3.Rows[0]["Num"].ToString()); dicArrayPre.Add("LocationState", (string)taobaoProductTB3.Rows[0]["LocationState"]); dicArrayPre.Add("LocationCity", (string)taobaoProductTB3.Rows[0]["LocationCity"]); dicArrayPre.Add("FreightPayer", (string)taobaoProductTB3.Rows[0]["FreightPayer"]); if (taobaoProductTB3.Rows[0]["PostFee"] != DBNull.Value) { dicArrayPre.Add("PostFee", taobaoProductTB3.Rows[0]["PostFee"].ToString()); } if (taobaoProductTB3.Rows[0]["ExpressFee"] != DBNull.Value) { dicArrayPre.Add("ExpressFee", taobaoProductTB3.Rows[0]["ExpressFee"].ToString()); } if (taobaoProductTB3.Rows[0]["EMSFee"] != DBNull.Value) { dicArrayPre.Add("EMSFee", taobaoProductTB3.Rows[0]["EMSFee"].ToString()); } dicArrayPre.Add("HasInvoice", taobaoProductTB3.Rows[0]["HasInvoice"].ToString()); dicArrayPre.Add("HasWarranty", taobaoProductTB3.Rows[0]["HasWarranty"].ToString()); dicArrayPre.Add("HasDiscount", taobaoProductTB3.Rows[0]["HasDiscount"].ToString()); if (taobaoProductTB3.Rows[0]["PropertyAlias"] != DBNull.Value) { dicArrayPre.Add("PropertyAlias", (string)taobaoProductTB3.Rows[0]["PropertyAlias"]); } if (taobaoProductTB3.Rows[0]["SkuProperties"] != DBNull.Value) { dicArrayPre.Add("SkuProperties", (string)taobaoProductTB3.Rows[0]["SkuProperties"]); } if (taobaoProductTB3.Rows[0]["SkuQuantities"] != DBNull.Value) { dicArrayPre.Add("SkuQuantities", (string)taobaoProductTB3.Rows[0]["SkuQuantities"]); } if (taobaoProductTB3.Rows[0]["SkuPrices"] != DBNull.Value) { dicArrayPre.Add("SkuPrices", (string)taobaoProductTB3.Rows[0]["SkuPrices"]); } if (taobaoProductTB3.Rows[0]["SkuOuterIds"] != DBNull.Value) { dicArrayPre.Add("SkuOuterIds", (string)taobaoProductTB3.Rows[0]["SkuOuterIds"]); } if (taobaoProductTB3.Rows[0]["inputpids"] != DBNull.Value) { dicArrayPre.Add("inputpids", (string)taobaoProductTB3.Rows[0]["inputpids"]); } if (taobaoProductTB3.Rows[0]["inputstr"] != DBNull.Value) { dicArrayPre.Add("inputstr", (string)taobaoProductTB3.Rows[0]["inputstr"]); } } Dictionary <string, string> dictionary2 = OpenIdFunction.FilterPara(dicArrayPre); StringBuilder builder3 = new StringBuilder(); foreach (KeyValuePair <string, string> pair in dictionary2) { builder3.Append(OpenIdFunction.CreateField(pair.Key, pair.Value)); } dicArrayPre.Clear(); dictionary2.Clear(); string action = "http://saas.92hi.com/MakeTaoBaoData.aspx"; if (taobaoProductTB3.Rows.Count > 0) { action = "http://saas.92hi.com/UpdateTaoBaoData.aspx"; } OpenIdFunction.Submit(OpenIdFunction.CreateForm(builder3.ToString(), action)); }
protected void Page_Load(object sender, System.EventArgs e) { int.TryParse(base.Request.QueryString["productId"], out this.productId); System.Data.DataSet taobaoProductDetails = ProductHelper.GetTaobaoProductDetails(this.productId); System.Data.DataTable dataTable = taobaoProductDetails.Tables[0]; System.Collections.Generic.SortedDictionary <string, string> sortedDictionary = new System.Collections.Generic.SortedDictionary <string, string>(); sortedDictionary.Add("SiteUrl", Hidistro.Membership.Context.HiContext.Current.SiteUrl); sortedDictionary.Add("_input_charset", "utf-8"); sortedDictionary.Add("return_url", Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("MakeTaobaoProductData_url"))); sortedDictionary.Add("ProductId", this.productId.ToString()); sortedDictionary.Add("HasSKU", dataTable.Rows[0]["HasSKU"].ToString()); sortedDictionary.Add("ProductName", (string)dataTable.Rows[0]["ProductName"]); sortedDictionary.Add("ProductCode", (string)dataTable.Rows[0]["ProductCode"]); sortedDictionary.Add("CategoryName", (dataTable.Rows[0]["CategoryName"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["CategoryName"])); sortedDictionary.Add("ProductLineName", (dataTable.Rows[0]["ProductLineName"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["ProductLineName"])); sortedDictionary.Add("BrandName", (dataTable.Rows[0]["BrandName"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["BrandName"])); sortedDictionary.Add("SalePrice", System.Convert.ToDecimal(dataTable.Rows[0]["SalePrice"]).ToString("F2")); sortedDictionary.Add("MarketPrice", (dataTable.Rows[0]["MarketPrice"] == System.DBNull.Value) ? "0" : System.Convert.ToDecimal(dataTable.Rows[0]["MarketPrice"]).ToString("F2")); sortedDictionary.Add("CostPrice", System.Convert.ToDecimal(dataTable.Rows[0]["CostPrice"]).ToString("F2")); sortedDictionary.Add("PurchasePrice", System.Convert.ToDecimal(dataTable.Rows[0]["PurchasePrice"]).ToString("F2")); sortedDictionary.Add("Stock", dataTable.Rows[0]["Stock"].ToString()); System.Data.DataTable dataTable2 = taobaoProductDetails.Tables[1]; if (dataTable2.Rows.Count > 0) { string text = string.Empty; foreach (System.Data.DataRow dataRow in dataTable2.Rows) { object obj = text; text = string.Concat(new object[] { obj, dataRow["AttributeName"], ":", dataRow["ValueStr"], ";" }); } text = text.Remove(text.Length - 1); sortedDictionary.Add("Attributes", text); } System.Data.DataTable dataTable3 = taobaoProductDetails.Tables[2]; if (dataTable3.Rows.Count > 0) { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); System.Text.StringBuilder stringBuilder2 = new System.Text.StringBuilder(); for (int i = dataTable3.Columns.Count - 1; i >= 0; i--) { stringBuilder2.Append(dataTable3.Columns[i].ColumnName).Append(";"); } foreach (System.Data.DataRow dataRow2 in dataTable3.Rows) { for (int j = dataTable3.Columns.Count - 1; j >= 0; j--) { stringBuilder.Append(dataRow2[dataTable3.Columns[j].ColumnName]).Append(";"); } stringBuilder.Remove(stringBuilder.Length - 1, 1).Append(","); } stringBuilder2.Remove(stringBuilder2.Length - 1, 1).Append(",").Append(stringBuilder.Remove(stringBuilder.Length - 1, 1)); sortedDictionary.Add("skus", stringBuilder2.ToString()); } System.Data.DataTable dataTable4 = taobaoProductDetails.Tables[3]; if (dataTable4.Rows.Count > 0) { sortedDictionary.Add("Cid", dataTable4.Rows[0]["Cid"].ToString()); if (dataTable4.Rows[0]["StuffStatus"] != System.DBNull.Value) { sortedDictionary.Add("StuffStatus", (string)dataTable4.Rows[0]["StuffStatus"]); } sortedDictionary.Add("ProTitle", (string)dataTable4.Rows[0]["ProTitle"]); sortedDictionary.Add("Num", dataTable4.Rows[0]["Num"].ToString()); sortedDictionary.Add("LocationState", (string)dataTable4.Rows[0]["LocationState"]); sortedDictionary.Add("LocationCity", (string)dataTable4.Rows[0]["LocationCity"]); sortedDictionary.Add("FreightPayer", (string)dataTable4.Rows[0]["FreightPayer"]); if (dataTable4.Rows[0]["PostFee"] != System.DBNull.Value) { sortedDictionary.Add("PostFee", dataTable4.Rows[0]["PostFee"].ToString()); } if (dataTable4.Rows[0]["ExpressFee"] != System.DBNull.Value) { sortedDictionary.Add("ExpressFee", dataTable4.Rows[0]["ExpressFee"].ToString()); } if (dataTable4.Rows[0]["EMSFee"] != System.DBNull.Value) { sortedDictionary.Add("EMSFee", dataTable4.Rows[0]["EMSFee"].ToString()); } sortedDictionary.Add("HasInvoice", dataTable4.Rows[0]["HasInvoice"].ToString()); sortedDictionary.Add("HasWarranty", dataTable4.Rows[0]["HasWarranty"].ToString()); sortedDictionary.Add("HasDiscount", dataTable4.Rows[0]["HasDiscount"].ToString()); if (dataTable4.Rows[0]["PropertyAlias"] != System.DBNull.Value) { sortedDictionary.Add("PropertyAlias", (string)dataTable4.Rows[0]["PropertyAlias"]); } if (dataTable4.Rows[0]["SkuProperties"] != System.DBNull.Value) { sortedDictionary.Add("SkuProperties", (string)dataTable4.Rows[0]["SkuProperties"]); } if (dataTable4.Rows[0]["SkuQuantities"] != System.DBNull.Value) { sortedDictionary.Add("SkuQuantities", (string)dataTable4.Rows[0]["SkuQuantities"]); } if (dataTable4.Rows[0]["SkuPrices"] != System.DBNull.Value) { sortedDictionary.Add("SkuPrices", (string)dataTable4.Rows[0]["SkuPrices"]); } if (dataTable4.Rows[0]["SkuOuterIds"] != System.DBNull.Value) { sortedDictionary.Add("SkuOuterIds", (string)dataTable4.Rows[0]["SkuOuterIds"]); } if (dataTable4.Rows[0]["inputpids"] != System.DBNull.Value) { sortedDictionary.Add("inputpids", (string)dataTable4.Rows[0]["inputpids"]); } if (dataTable4.Rows[0]["inputstr"] != System.DBNull.Value) { sortedDictionary.Add("inputstr", (string)dataTable4.Rows[0]["inputstr"]); } if (dataTable4.Rows[0]["FoodAttributes"] != System.DBNull.Value) { sortedDictionary.Add("FoodAttributes", System.Web.HttpUtility.UrlEncode((string)dataTable4.Rows[0]["FoodAttributes"])); } } System.Collections.Generic.Dictionary <string, string> dictionary = OpenIdFunction.FilterPara(sortedDictionary); System.Text.StringBuilder stringBuilder3 = new System.Text.StringBuilder(); foreach (System.Collections.Generic.KeyValuePair <string, string> current in dictionary) { stringBuilder3.Append(OpenIdFunction.CreateField(current.Key, current.Value)); } sortedDictionary.Clear(); dictionary.Clear(); string action = "http://order1.kuaidiangtong.com/MakeTaoBaoData.aspx"; if (dataTable4.Rows.Count > 0) { action = "http://order1.kuaidiangtong.com/UpdateTaoBaoData.aspx"; } OpenIdFunction.Submit(OpenIdFunction.CreateForm(stringBuilder3.ToString(), action)); }