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, EventArgs e) { openIdType = base.Request.QueryString["t"]; if (string.IsNullOrEmpty(openIdType) || (openIdType.Trim().Length == 0)) { base.GotoResourceNotFound(); } PluginItem pluginItem = OpenIdPlugins.Instance().GetPluginItem(openIdType); if (pluginItem == null) { base.GotoResourceNotFound(); } if (!Page.IsPostBack) { txtName.Text = pluginItem.DisplayName; lblDisplayName.Text = pluginItem.DisplayName; txtSelectedName.Value = openIdType; OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType); if (openIdSettings != null) { ConfigData data = new ConfigData(Cryptographer.Decrypt(openIdSettings.Settings)); txtConfigData.Value = data.SettingsXml; txtName.Text = openIdSettings.Name; fcContent.Text = openIdSettings.Description; } } }
public override OpenIdSettingsInfo GetOpenIdSettings(string openIdType) { OpenIdSettingsInfo openIdSettingsInfo = null; System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM distro_OpenIdSettings WHERE LOWER(OpenIdType)=LOWER(@OpenIdType) AND UserId=@UserId"); this.database.AddInParameter(sqlStringCommand, "OpenIdType", System.Data.DbType.String, openIdType.ToLower()); this.database.AddInParameter(sqlStringCommand, "UserId", System.Data.DbType.Int32, HiContext.Current.User.UserId); using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand)) { if (dataReader.Read()) { openIdSettingsInfo = new OpenIdSettingsInfo { OpenIdType = openIdType, Name = (string)dataReader["Name"], Settings = (string)dataReader["Settings"] }; if (dataReader["Description"] != DBNull.Value) { openIdSettingsInfo.Description = (string)dataReader["Description"]; } } } return(openIdSettingsInfo); }
protected void Page_Load(object sender, System.EventArgs e) { if (this.Context.Request.IsAuthenticated) { System.Web.Security.FormsAuthentication.SignOut(); System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(HiContext.Current.User.Username, true); IUserCookie userCookie = HiContext.Current.User.GetUserCookie(); if (userCookie != null) { userCookie.DeleteCookie(authCookie); } RoleHelper.SignOut(HiContext.Current.User.Username); } string text = base.Request.QueryString["ot"]; if (OpenIdPlugins.Instance().GetPluginItem(text) == null) { this.lblMsg.Text = "没有找到对应的插件,<a href=\"" + Globals.GetSiteUrls().Home + "\">返回首页</a>。"; return; } OpenIdSettingsInfo openIdSettings = MemberProcessor.GetOpenIdSettings(text); if (openIdSettings == null) { this.lblMsg.Text = "请先配置此插件所需的信息,<a href=\"" + Globals.GetSiteUrls().Home + "\">返回首页</a>。"; return; } string returnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("OpenIdEntry_url", new object[] { text })); OpenIdService openIdService = OpenIdService.CreateInstance(text, HiCryptographer.Decrypt(openIdSettings.Settings), returnUrl); openIdService.Post(); }
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")); }
public override OpenIdSettingsInfo GetOpenIdSettings(string openIdType) { OpenIdSettingsInfo info = null; DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM distro_OpenIdSettings WHERE LOWER(OpenIdType)=LOWER(@OpenIdType) AND UserId=@UserId"); this.database.AddInParameter(sqlStringCommand, "OpenIdType", DbType.String, openIdType.ToLower()); this.database.AddInParameter(sqlStringCommand, "UserId", DbType.Int32, HiContext.Current.User.UserId); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { if (!reader.Read()) { return(info); } OpenIdSettingsInfo info2 = new OpenIdSettingsInfo(); info2.OpenIdType = openIdType; info2.Name = (string)reader["Name"]; info2.Settings = (string)reader["Settings"]; info = info2; if (reader["Description"] != DBNull.Value) { info.Description = (string)reader["Description"]; } } return(info); }
public override void SaveSettings(OpenIdSettingsInfo settings) { System.Data.Common.DbCommand storedProcCommand = this.database.GetStoredProcCommand("aspnet_OpenIdSettings_Save"); this.database.AddInParameter(storedProcCommand, "OpenIdType", System.Data.DbType.String, settings.OpenIdType.ToLower()); this.database.AddInParameter(storedProcCommand, "Name", System.Data.DbType.String, settings.Name); this.database.AddInParameter(storedProcCommand, "Description", System.Data.DbType.String, settings.Description); this.database.AddInParameter(storedProcCommand, "Settings", System.Data.DbType.String, settings.Settings); this.database.ExecuteNonQuery(storedProcCommand); }
public override void SaveSettings(OpenIdSettingsInfo settings) { DbCommand storedProcCommand = this.database.GetStoredProcCommand("distro_OpenIdSettings_Save"); this.database.AddInParameter(storedProcCommand, "OpenIdType", DbType.String, settings.OpenIdType.ToLower()); this.database.AddInParameter(storedProcCommand, "Name", DbType.String, settings.Name); this.database.AddInParameter(storedProcCommand, "Description", DbType.String, settings.Description); this.database.AddInParameter(storedProcCommand, "Settings", DbType.String, settings.Settings); this.database.AddInParameter(storedProcCommand, "UserId", DbType.Int32, HiContext.Current.User.UserId); this.database.ExecuteNonQuery(storedProcCommand); }
public static OpenIdSettingsInfo PopulateOpenIdSettings(IDataReader reader) { OpenIdSettingsInfo openIdSettingsInfo = new OpenIdSettingsInfo { OpenIdType = (string)reader["OpenIdType"], Name = (string)reader["Name"], Settings = (string)reader["Settings"] }; if (reader["Description"] != DBNull.Value) { openIdSettingsInfo.Description = (string)reader["Description"]; } return(openIdSettingsInfo); }
private void btnSave_Click(object sender, EventArgs e) { ConfigData data; if (ValidateValues(out data)) { OpenIdSettingsInfo settings = new OpenIdSettingsInfo(); settings.Name = txtName.Text.Trim(); settings.Description = fcContent.Text; settings.OpenIdType = openIdType; settings.Settings = Cryptographer.Encrypt(data.SettingsXml); OpenIdHelper.SaveSettings(settings); Response.Redirect("openidservices.aspx"); } }
public override OpenIdSettingsInfo GetOpenIdSettings(string openIdType) { OpenIdSettingsInfo result = null; System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM aspnet_OpenIdSettings WHERE LOWER(OpenIdType)=LOWER(@OpenIdType)"); this.database.AddInParameter(sqlStringCommand, "OpenIdType", System.Data.DbType.String, openIdType.ToLower()); using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand)) { if (dataReader.Read()) { result = MemberProvider.PopulateOpenIdSettings(dataReader); } } return(result); }
public override IList <OpenIdSettingsInfo> GetConfigedItems() { IList <OpenIdSettingsInfo> list = new List <OpenIdSettingsInfo>(); DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM aspnet_OpenIdSettings"); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { while (reader.Read()) { OpenIdSettingsInfo item = MemberProvider.PopulateOpenIdSettings(reader); list.Add(item); } } return(list); }
public static OpenIdSettingsInfo PopulateOpenIdSettings(IDataReader reader) { OpenIdSettingsInfo info2 = new OpenIdSettingsInfo(); info2.OpenIdType = (string)reader["OpenIdType"]; info2.Name = (string)reader["Name"]; info2.Settings = (string)reader["Settings"]; OpenIdSettingsInfo info = info2; if (reader["Description"] != DBNull.Value) { info.Description = (string)reader["Description"]; } return(info); }
public override OpenIdSettingsInfo GetOpenIdSettings(string openIdType) { OpenIdSettingsInfo info = null; DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM aspnet_OpenIdSettings WHERE LOWER(OpenIdType)=LOWER(@OpenIdType)"); this.database.AddInParameter(sqlStringCommand, "OpenIdType", DbType.String, openIdType.ToLower()); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { if (reader.Read()) { info = MemberProvider.PopulateOpenIdSettings(reader); } } return(info); }
public override IList <OpenIdSettingsInfo> GetConfigedItems() { IList <OpenIdSettingsInfo> list = new List <OpenIdSettingsInfo>(); System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM distro_OpenIdSettings WHERE UserId=@UserId"); this.database.AddInParameter(sqlStringCommand, "UserId", System.Data.DbType.Int32, HiContext.Current.SiteSettings.UserId.Value); using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand)) { while (dataReader.Read()) { OpenIdSettingsInfo item = MemberProvider.PopulateOpenIdSettings(dataReader); list.Add(item); } } return(list); }
public override OpenIdSettingsInfo GetOpenIdSettings(string openIdType) { OpenIdSettingsInfo result = null; System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM distro_OpenIdSettings WHERE UserId=@UserId AND LOWER(OpenIdType)=LOWER(@OpenIdType)"); this.database.AddInParameter(sqlStringCommand, "OpenIdType", System.Data.DbType.String, openIdType.ToLower()); this.database.AddInParameter(sqlStringCommand, "UserId", System.Data.DbType.Int32, HiContext.Current.SiteSettings.UserId.Value); using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand)) { if (dataReader.Read()) { result = MemberProvider.PopulateOpenIdSettings(dataReader); } } return(result); }
private void btnSave_Click(object sender, EventArgs e) { ConfigData data; if (this.ValidateValues(out data)) { OpenIdSettingsInfo info2 = new OpenIdSettingsInfo(); info2.Name = this.txtName.Text.Trim(); info2.Description = this.fcContent.Text; info2.OpenIdType = this.openIdType; info2.Settings = HiCryptographer.Encrypt(data.SettingsXml); OpenIdSettingsInfo settings = info2; SubSiteOpenIdHelper.SaveSettings(settings); base.Response.Redirect("openidservices.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (Context.Request.IsAuthenticated) { FormsAuthentication.SignOut(); HttpCookie authCookie = FormsAuthentication.GetAuthCookie(HiContext.Current.User.Username, true); IUserCookie userCookie = HiContext.Current.User.GetUserCookie(); if (userCookie != null) { userCookie.DeleteCookie(authCookie); } RoleHelper.SignOut(HiContext.Current.User.Username); } openIdType = Page.Request.QueryString["HIGW"]; OpenIdSettingsInfo openIdSettings = MemberProcessor.GetOpenIdSettings(openIdType); if (openIdSettings == null) { Response.Write("登录失败,没有找到对应的插件配置信息。"); } else { NameValueCollection values = new NameValueCollection(); values.Add(Page.Request.Form); values.Add(Page.Request.QueryString); parameters = values; OpenIdNotify notify = OpenIdNotify.CreateInstance(openIdType, parameters); notify.Authenticated += new EventHandler <AuthenticatedEventArgs>(Notify_Authenticated); notify.Failed += new EventHandler <FailedEventArgs>(Notify_Failed); notify.Verify(0x7530, Cryptographer.Decrypt(openIdSettings.Settings)); } }
private void btnSave_Click(object sender, System.EventArgs e) { ConfigData configData; if (!this.ValidateValues(out configData)) { return; } OpenIdSettingsInfo settings = new OpenIdSettingsInfo { Name = this.txtName.Text.Trim(), Description = this.fcContent.Text, OpenIdType = this.openIdType, Settings = HiCryptographer.Encrypt(configData.SettingsXml) }; SubSiteOpenIdHelper.SaveSettings(settings); base.Response.Redirect("openidservices.aspx"); }
protected void Page_Load(object sender, System.EventArgs e) { if (this.Context.Request.IsAuthenticated) { System.Web.Security.FormsAuthentication.SignOut(); System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(HiContext.Current.User.Username, true); IUserCookie userCookie = HiContext.Current.User.GetUserCookie(); if (userCookie != null) { userCookie.DeleteCookie(authCookie); } RoleHelper.SignOut(HiContext.Current.User.Username); } this.openIdType = this.Page.Request.QueryString["HIGW"]; OpenIdSettingsInfo openIdSettings = MemberProcessor.GetOpenIdSettings(this.openIdType); if (openIdSettings == null) { base.Response.Write("登录失败,没有找到对应的插件配置信息。"); return; } this.parameters = new System.Collections.Specialized.NameValueCollection { this.Page.Request.Form, this.Page.Request.QueryString }; OpenIdNotify openIdNotify = OpenIdNotify.CreateInstance(this.openIdType, this.parameters); openIdNotify.Authenticated += new System.EventHandler <AuthenticatedEventArgs>(this.Notify_Authenticated); openIdNotify.Failed += new System.EventHandler <FailedEventArgs>(this.Notify_Failed); try { openIdNotify.Verify(30000, HiCryptographer.Decrypt(openIdSettings.Settings)); } catch { this.Page.Response.Redirect(Globals.GetSiteUrls().Home); } }
public OpenIdSettingsInfo GetOpenIdSettings(string openIdType) { OpenIdSettingsInfo openIdSettingsInfo = null; DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM aspnet_OpenIdSettings WHERE LOWER(OpenIdType)=LOWER(@OpenIdType)"); this.database.AddInParameter(sqlStringCommand, "OpenIdType", DbType.String, openIdType.ToLower()); using (IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand)) { if (dataReader.Read()) { openIdSettingsInfo = new OpenIdSettingsInfo { OpenIdType = openIdType, Name = (string)dataReader["Name"], Settings = (string)dataReader["Settings"] }; if (dataReader["Description"] != DBNull.Value) { openIdSettingsInfo.Description = (string)dataReader["Description"]; } } } return(openIdSettingsInfo); }
protected void Page_Load(object sender, System.EventArgs e) { int num = 0; System.Collections.Generic.SortedDictionary <string, string> requestPost = this.GetRequestPost(); if (requestPost.Count > 0) { string openIdType = "Ecdev.plugins.openid.alipay.alipayservice"; OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType); if (openIdSettings == null) { base.Response.Write("登录失败,没有找到对应的插件配置信息。"); return; } System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument(); xmlDocument.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings)); AliPayNotify aliPayNotify = new AliPayNotify(requestPost, base.Request.Form["notify_id"], xmlDocument.FirstChild.SelectSingleNode("Partner").InnerText, xmlDocument.FirstChild.SelectSingleNode("Key").InnerText); string responseTxt = aliPayNotify.ResponseTxt; string a = base.Request.Form["sign"]; string mysign = aliPayNotify.Mysign; if (responseTxt == "true" && a == mysign) { string text = base.Request.Form["receive_address"]; if (!string.IsNullOrEmpty(text)) { System.Xml.XmlDocument xmlDocument2 = new System.Xml.XmlDocument(); xmlDocument2.LoadXml(text); ShippingAddressInfo shippingAddressInfo = new ShippingAddressInfo(); shippingAddressInfo.UserId = HiContext.Current.User.UserId; if (xmlDocument2.SelectSingleNode("/receiveAddress/address") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/address").InnerText)) { shippingAddressInfo.Address = Globals.HtmlEncode(xmlDocument2.SelectSingleNode("/receiveAddress/address").InnerText); } if (xmlDocument2.SelectSingleNode("/receiveAddress/fullname") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/fullname").InnerText)) { shippingAddressInfo.ShipTo = Globals.HtmlEncode(xmlDocument2.SelectSingleNode("/receiveAddress/fullname").InnerText); } if (xmlDocument2.SelectSingleNode("/receiveAddress/post") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/post").InnerText)) { shippingAddressInfo.Zipcode = xmlDocument2.SelectSingleNode("/receiveAddress/post").InnerText; } if (xmlDocument2.SelectSingleNode("/receiveAddress/mobile_phone") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/mobile_phone").InnerText)) { shippingAddressInfo.CellPhone = xmlDocument2.SelectSingleNode("/receiveAddress/mobile_phone").InnerText; } if (xmlDocument2.SelectSingleNode("/receiveAddress/phone") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/phone").InnerText)) { shippingAddressInfo.TelPhone = xmlDocument2.SelectSingleNode("/receiveAddress/phone").InnerText; } string text2 = string.Empty; string text3 = string.Empty; string text4 = string.Empty; if (xmlDocument2.SelectSingleNode("/receiveAddress/area") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/area").InnerText)) { text2 = xmlDocument2.SelectSingleNode("/receiveAddress/area").InnerText; } if (xmlDocument2.SelectSingleNode("/receiveAddress/city") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/city").InnerText)) { text3 = xmlDocument2.SelectSingleNode("/receiveAddress/city").InnerText; } if (xmlDocument2.SelectSingleNode("/receiveAddress/prov") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/prov").InnerText)) { text4 = xmlDocument2.SelectSingleNode("/receiveAddress/prov").InnerText; } if (string.IsNullOrEmpty(text2) && string.IsNullOrEmpty(text3) && string.IsNullOrEmpty(text4)) { shippingAddressInfo.RegionId = 0; } else { shippingAddressInfo.RegionId = RegionHelper.GetRegionId(text2, text3, text4); } SiteSettings arg_371_0 = HiContext.Current.SiteSettings; if (MemberProcessor.GetShippingAddressCount() < HiContext.Current.Config.ShippingAddressQuantity) { num = MemberProcessor.AddShippingAddress(shippingAddressInfo); } } } } this.Page.Response.Redirect(Globals.ApplicationPath + "/SubmmitOrder.aspx?shippingId=" + num); }
public static void SaveSettings(OpenIdSettingsInfo settings) { new OpenIdSettingDao().SaveSettings(settings); }
public static void SaveSettings(OpenIdSettingsInfo settings) { OpenIdProvider.Instance().SaveSettings(settings); }
public abstract void SaveSettings(OpenIdSettingsInfo settings);
protected void Page_Load(object sender, EventArgs e) { int num = 0; SortedDictionary <string, string> requestPost = this.GetRequestPost(); if (requestPost.Count > 0) { string openIdType = "hishop.plugins.openid.alipay.alipayservice"; OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType); if (openIdSettings == null) { base.Response.Write("登录失败,没有找到对应的插件配置信息。"); return; } XmlDocument document = new XmlDocument(); document.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings)); AliPayNotify notify = new AliPayNotify(requestPost, base.Request.Form["notify_id"], document.FirstChild.SelectSingleNode("Partner").InnerText, document.FirstChild.SelectSingleNode("Key").InnerText); string responseTxt = notify.ResponseTxt; string str3 = base.Request.Form["sign"]; string mysign = notify.Mysign; if ((responseTxt == "true") && (str3 == mysign)) { string str5 = base.Request.Form["receive_address"]; if (!string.IsNullOrEmpty(str5)) { XmlDocument document2 = new XmlDocument(); document2.LoadXml(str5); ShippingAddressInfo shippingAddress = new ShippingAddressInfo(); shippingAddress.UserId = HiContext.Current.User.UserId; if ((document2.SelectSingleNode("/receiveAddress/address") != null) && !string.IsNullOrEmpty(document2.SelectSingleNode("/receiveAddress/address").InnerText)) { shippingAddress.Address = Globals.HtmlEncode(document2.SelectSingleNode("/receiveAddress/address").InnerText); } if ((document2.SelectSingleNode("/receiveAddress/fullname") != null) && !string.IsNullOrEmpty(document2.SelectSingleNode("/receiveAddress/fullname").InnerText)) { shippingAddress.ShipTo = Globals.HtmlEncode(document2.SelectSingleNode("/receiveAddress/fullname").InnerText); } if ((document2.SelectSingleNode("/receiveAddress/post") != null) && !string.IsNullOrEmpty(document2.SelectSingleNode("/receiveAddress/post").InnerText)) { shippingAddress.Zipcode = document2.SelectSingleNode("/receiveAddress/post").InnerText; } if ((document2.SelectSingleNode("/receiveAddress/mobile_phone") != null) && !string.IsNullOrEmpty(document2.SelectSingleNode("/receiveAddress/mobile_phone").InnerText)) { shippingAddress.CellPhone = document2.SelectSingleNode("/receiveAddress/mobile_phone").InnerText; } if ((document2.SelectSingleNode("/receiveAddress/phone") != null) && !string.IsNullOrEmpty(document2.SelectSingleNode("/receiveAddress/phone").InnerText)) { shippingAddress.TelPhone = document2.SelectSingleNode("/receiveAddress/phone").InnerText; } string innerText = string.Empty; string str7 = string.Empty; string str8 = string.Empty; if ((document2.SelectSingleNode("/receiveAddress/area") != null) && !string.IsNullOrEmpty(document2.SelectSingleNode("/receiveAddress/area").InnerText)) { innerText = document2.SelectSingleNode("/receiveAddress/area").InnerText; } if ((document2.SelectSingleNode("/receiveAddress/city") != null) && !string.IsNullOrEmpty(document2.SelectSingleNode("/receiveAddress/city").InnerText)) { str7 = document2.SelectSingleNode("/receiveAddress/city").InnerText; } if ((document2.SelectSingleNode("/receiveAddress/prov") != null) && !string.IsNullOrEmpty(document2.SelectSingleNode("/receiveAddress/prov").InnerText)) { str8 = document2.SelectSingleNode("/receiveAddress/prov").InnerText; } if ((string.IsNullOrEmpty(innerText) && string.IsNullOrEmpty(str7)) && string.IsNullOrEmpty(str8)) { shippingAddress.RegionId = 0; } else { shippingAddress.RegionId = RegionHelper.GetRegionId(innerText, str7, str8); } SiteSettings siteSettings = HiContext.Current.SiteSettings; if (PersonalHelper.GetShippingAddressCount(HiContext.Current.User.UserId) < HiContext.Current.Config.ShippingAddressQuantity) { num = PersonalHelper.AddShippingAddress(shippingAddress); } } } } this.Page.Response.Redirect(Globals.ApplicationPath + "/SubmmitOrder.aspx?shippingId=" + num); }