public bool SwitchingMode(Chain.Model.SysParameter modelParameter) { string strStartGood = "66,67,69,76,87,91,113,114,118"; string strStartWeiXin = "98,120,121,122,123,124,125,126,127,128,129,130,131"; string strStartTimingProject = "87,110,111,113,114"; string strStartMemCount = "66,76,118"; string strStartGoodBar = "60"; string strStartWeiXinBar = "119"; List <bool> ststus = new List <bool> { PubFunction.curParameter.EnableGoods, PubFunction.curParameter.EnableGoods, modelParameter.IsStartWeiXin, modelParameter.IsStartWeiXin, modelParameter.IsStartTimingProject, modelParameter.IsStartMemCount }; List <string> moduleIDs = new List <string> { strStartGoodBar, strStartGood, strStartWeiXinBar, strStartWeiXin, strStartTimingProject, strStartMemCount }; Chain.BLL.SysParameter bllUpdateParameter = new Chain.BLL.SysParameter(); return(bllUpdateParameter.SwitchingMode(ststus, moduleIDs)); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { Chain.Model.SysParameter mdlSysParameter = new Chain.BLL.SysParameter().GetModel(1); this.selPay.Value = mdlSysParameter.Pay.ToString(); this.txtMchId.Value = mdlSysParameter.MchId; this.txtAPI.Attributes.Add("value", mdlSysParameter.Api); this.txtXiane.Value = Convert.ToInt32(mdlSysParameter.Xiane).ToString(); this.txtWeixXinType.Value = (this.curParameter.bolWeiXinType ? "1" : "0"); this.txtWeiXinVerified.Value = (this.curParameter.bolWeiXinVerified ? "1" : "0"); this.txtSignInPoint.Value = this.curParameter.intSignInPoint.ToString(); this.txtWeiXinToken.Value = this.curParameter.strWeiXinToken; this.txtEncodingAESKey.Value = this.curParameter.strWeiXinEncodingAESKey; this.txtWeiXinShopName.Value = this.curParameter.strWeiXinShopName; this.txtWeiXinSalutatory.Value = this.curParameter.strWeiXinSalutatory; this.txtAppId.Value = this.curParameter.strWeiXinAppID; this.txtAppSecret.Value = this.curParameter.strWeiXinAppSecret; this.chkWeiXinSMSVcode.Checked = this.curParameter.bolWeiXinSMSVcode; this.spanUrl.InnerText = base.Request.Url.AbsoluteUri.Substring(0, base.Request.Url.AbsoluteUri.IndexOf(base.Request.Url.AbsolutePath)) + "/Service/WeiXinHandler.ashx"; this.spanToken.InnerText = PubFunction.curParameter.strWeiXinToken; this.spanEncodingAESKey.InnerText = PubFunction.curParameter.strWeiXinEncodingAESKey; } if (base.Request["weixin"] != null) { if (base.Request["weixin"] != "0") { this.SetState("disabled"); } } else if (PubFunction.curParameter.istry != 1) { this.SetState("disabled"); } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { string code = ""; if (base.Request.QueryString["code"] != null) { code = base.Request.QueryString["code"].ToString(); } else { string RechargeUrl = string.Format("https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri=http://{1}/mobile/member/rechargeOnline.aspx&response_type=code&scope=snsapi_base&state=0#wechat_redirect", PubFunction.curParameter.strWeiXinAppID, PubFunction.curParameter.strDoMain); base.Response.Redirect(RechargeUrl); } if (code != "") { string getAuthorize = this.GetAuthorize(code); getAuthorize = "[" + getAuthorize + "]"; JavaScriptArray javascript = (JavaScriptArray)JavaScriptConvert.DeserializeObject(getAuthorize); JavaScriptObject obj = (JavaScriptObject)javascript[0]; if (obj["openid"] != null && obj["openid"].ToString() != "") { string openid = obj["openid"].ToString(); this.txtOpenID.Value = openid; } } if (this.Session["MemID"] != null) { int MemID = int.Parse(this.Session["MemID"].ToString()); this.txtMemID.Value = MemID.ToString(); this.BindMemInfo(MemID); } else { base.Response.Redirect("login.aspx"); } Chain.Model.SysParameter parameter = new Chain.BLL.SysParameter().GetModel(1); this.txtMaxMoney.Value = parameter.Xiane.ToString(); DateTime now = DateTime.Now; this.txtNow.Value = now.ToString(); DateTime utcnow = DateTime.UtcNow; string timestamp = Convert.ToInt64((utcnow - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds).ToString(); this.timestamps.Value = timestamp; string systemDomain = parameter.SystemDomain; this.appid.Value = parameter.WeiXinAppID; string nonceStr = Guid.NewGuid().ToString().Replace("-", ""); this.nonceStrs.Value = nonceStr; this.signTypes.Value = "MD5"; string url = base.Request.Url.ToString(); Sign sign = new Sign(); string jsapiTicket = sign.JsapiTicket(parameter.WeiXinAppID, parameter.WeiXinAppSecret); if (!(jsapiTicket == "")) { string signature = sign.ConfigSign(jsapiTicket, nonceStr, timestamp, url); this.signatures.Value = signature; } } }
private bool RETB_SQL(string type, string file) { bool result; try { string fileinfopath = string.Empty; if (type != null) { if (!(type == "A")) { if (!(type == "S")) { goto IL_53; } fileinfopath = base.Server.MapPath("../AppData/DataBase/"); } else { fileinfopath = base.Server.MapPath("../AppData/AutoDataBase/"); } if (File.Exists(fileinfopath + file)) { Chain.BLL.SysParameter par = new Chain.BLL.SysParameter(); try { par.ReductionDataBakUp(fileinfopath + file); } catch (Exception e) { this.Log(e.ToString()); result = false; return(result); } } result = true; return(result); } IL_53: result = false; } catch (Exception e) { PubFunction.SaveSysLog(-1, -1, "系统标志", e.ToString(), -1, DateTime.Now, PubFunction.ipAdress); result = false; } return(result); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { if (this.Session["MemID"] != null) { int MemID = int.Parse(this.Session["MemID"].ToString()); this.txtMemID.Value = MemID.ToString(); this.BindMemInfo(MemID); } else { base.Response.Redirect("login.aspx"); } Chain.Model.SysParameter parameter = new Chain.BLL.SysParameter().GetModel(1); this.txtMaxMoney.Value = parameter.Xiane.ToString(); } }
protected void btnExtraParameter_Click(object sender, EventArgs e) { Chain.Model.SysParameter modelParameter = new Chain.Model.SysParameter(); modelParameter.ParameterID = 1; modelParameter.Sms = this.chkSms.Checked; modelParameter.MoneySms = this.chkMoneySms.Checked; modelParameter.IsSmsShopName = this.chkIsSmsShopName.Checked; modelParameter.SmsShopName = this.txtSmsShopName.Text.Trim(); modelParameter.SmsSeries = this.txtNotificationSMS.Text.Trim(); modelParameter.SmsSerialPwd = ((this.txtNotificationSMSPwd.Text.Trim() == "") ? this.curParameter.strNotificationSMSPwd : this.txtNotificationSMSPwd.Text.Trim()); modelParameter.MMS = this.chkMMS.Checked; modelParameter.MMSSeries = this.txtMMSSeries.Text.Trim(); modelParameter.MMSSerialPwd = ((this.txtMMSSeriesPwd.Text.Trim() == "") ? this.curParameter.strMMSSerialPwd : this.txtMMSSeriesPwd.Text.Trim()); modelParameter.Tel = this.chkTel.Checked; modelParameter.TelNoMember = this.chkTelNoMember.Checked; modelParameter.IsAutoSendSMSByMemRegister = this.ckbIsAutoSendSMSByMemRegister.Checked; modelParameter.IsAutoSendMMSByMemRegister = this.ckbIsAutoSendMMSByMemRegister.Checked; modelParameter.IsAutoSendSMSByMemRecharge = this.ckbIsAutoSendSMSByMemRecharge.Checked; modelParameter.IsAutoSendSMSByMemWithdraw = this.ckbIsAutoSendSMSByMemWithdraw.Checked; modelParameter.IsAutoSendSMSByMemGiftExchange = this.ckbIsAutoSendSMSByMemGiftExchange.Checked; modelParameter.IsAutoSendSMSByMemPointChange = this.ckbIsAutoSendSMSByMemPointChange.Checked; modelParameter.IsAutoSendSMSByCommodityConsumption = this.ckbIsAutoSendSMSByCommodityConsumption.Checked; modelParameter.IsAutoSendSMSByFastConsumption = this.ckbIsAutoSendSMSByFastConsumption.Checked; modelParameter.IsAutoSendSMSByMemRedTimes = this.ckbIsAutoSendSMSByMemRedTimes.Checked; modelParameter.IsAutoSendSMSByTimingConsumption = this.ckbIsAutoSendSMSByTimingConsumption.Checked; modelParameter.IsAutoSendSMSByStorageTiming = this.ckbIsAutoSendSMSByStorageTiming.Checked; modelParameter.MarketingSMS = this.chkMarketingSMS.Checked; modelParameter.MarketingSmsSeries = this.txtMarketingSMS.Text.Trim(); modelParameter.MarketingSmsSerialPwd = ((this.txtMarketingSMSPwd.Text.Trim() == "") ? this.curParameter.strMarketingSmsSerialPwd : this.txtMarketingSMSPwd.Text.Trim()); Chain.BLL.SysParameter bllUpdateParameter = new Chain.BLL.SysParameter(); if (bllUpdateParameter.UpdateExtraParameter(modelParameter)) { PubFunction pub = new PubFunction(); PubFunction.curParameter = pub.LoadSysParameter(); this.curParameter = PubFunction.curParameter; PubFunction.SaveSysLog(this._UserID, 3, "增值服务-参数设置", "增值服务的参数设置成功", this._UserShopID, DateTime.Now, PubFunction.ipAdress); base.OutputWarn("保存成功!"); } else { base.OutputWarn("系统异常,未保存数据,请再次点击保存!"); } }
public void Execute(XmlNode node) { XmlAttribute attribute = node.Attributes["maxTries"]; if (attribute != null && !string.IsNullOrEmpty(attribute.Value)) { this._maxTries = int.Parse(attribute.Value); } List <string> bcc = new List <string>(); List <string> cc = new List <string>(); DataTable dtEmail = new Chain.BLL.EmailLog().GetList(1, " EmailState=0 and EmailCount <" + this._maxTries, " EmailSendTime asc ").Tables[0]; if (dtEmail.Rows.Count > 0) { EmailAccount account = new EmailAccount(); Chain.Model.SysParameter modelParameter = new Chain.BLL.SysParameter().GetModel(1); account.Email = modelParameter.EmailAdress; account.Username = modelParameter.EmailUserName; account.Password = modelParameter.EmailPwd; account.Host = modelParameter.EmailSMTP; account.Port = modelParameter.EnterpriseEmailPort; account.DisplayName = modelParameter.EnterpriseEmailDisplayName; account.EnableSSL = modelParameter.EnterpriseEmailEnableSSL; account.UseDefaultCredentials = modelParameter.EnterpriseEmailUseDefaultCredentials; try { if (dtEmail.Rows.Count > 0) { this.SendEmail(dtEmail.Rows[0]["EmailTitle"].ToString(), dtEmail.Rows[0]["EmailContent"].ToString(), new MailAddress(account.Email, account.DisplayName), new MailAddress(dtEmail.Rows[0]["EmailAdress"].ToString(), ""), bcc, cc, account); new Chain.BLL.EmailLog().UpdateEmail(int.Parse(dtEmail.Rows[0]["EmailID"].ToString()), 1); } } catch (Exception) { new Chain.BLL.EmailLog().UpdateEmailCount(int.Parse(dtEmail.Rows[0]["EmailID"].ToString())); if (int.Parse(dtEmail.Rows[0]["EmailCount"].ToString()) + 1 > this._maxTries) { new Chain.BLL.EmailLog().UpdateEmail(int.Parse(dtEmail.Rows[0]["EmailID"].ToString()), 2); } } } }
protected void btnSysParameter_Click(object sender, EventArgs e) { string pointnum = ""; pointnum = pointnum + this.Txthycz.Text + "$"; pointnum = pointnum + this.Txtjfbd.Text + "$"; pointnum = pointnum + this.Txtjfdh.Text + "$"; pointnum = pointnum + this.Txtsprk.Text + "$"; pointnum = pointnum + this.Txtspxf.Text + "$"; pointnum = pointnum + this.Txtjcxf.Text + "$"; pointnum = pointnum + this.Txtksxf.Text + "$"; pointnum = pointnum + this.Txthycc.Text + "$"; pointnum = pointnum + this.Txthycs.Text + "$"; pointnum = pointnum + this.Txtxfjl.Text + "$"; pointnum = pointnum + this.Txthyczbb.Text + "$"; pointnum = pointnum + this.Txtjfbdbb.Text + "$"; pointnum = pointnum + this.Txtjfdhbb.Text + "$"; pointnum = pointnum + this.Txtckrkmx.Text + "$"; pointnum = pointnum + this.AccountsToMoney.Text + "$"; Chain.BLL.SysParameter bllUpdateParameter = new Chain.BLL.SysParameter(); Chain.Model.SysParameter modelParameter = bllUpdateParameter.GetModel(1); modelParameter.ParameterID = 1; modelParameter.Pwd = this.chkPwd.Checked; modelParameter.RegNullPwd = this.ckbRegNullPwd.Checked; modelParameter.MoneyAndPoint = this.chkMoneyAndPoint.Checked; modelParameter.AutoLevel = this.chkAutoLevel.Checked; modelParameter.DegradeLevel = this.chkDegradeLevel.Checked; modelParameter.GiveMemMoneyRate = decimal.Parse(this.txtGiveMemMoneyRate.Text); modelParameter.PastTime = this.chkPastTime.Checked; string strRecommendPoint = this.txtRecommendPoint.Text.Trim(); decimal dclDrawMoneyPercent = 0m; int result = 0; if (!int.TryParse(this.txtStockCount.Text.Trim(), out result)) { base.OutputWarn("库存报警数量只能输入正整数!"); } else if (!int.TryParse(this.txtPointPeriod.Text.Trim(), out result)) { base.OutputWarn("积分到期清零周期只能输入正整数!"); } else if (!decimal.TryParse(this.txtDrawMoneyPercent.Text.Trim(), out dclDrawMoneyPercent)) { base.OutputWarn("账户提现折损率的取值范围只能是0至1之间的数字!"); } else { Regex regex = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); if (this.txtEmailAdress.Text != "" && !regex.IsMatch(this.txtEmailAdress.Text)) { if (this.chkEmail.Checked) { base.OutputWarn("邮箱格式不正确,请重新输入!"); return; } this.txtEmailAdress.Text = ""; } if (this.txtEmailAdress.Text != "" && (this.txtEmailPwd.Text == "" || this.txtEmailSMTP.Text == "" || this.txtEnterpriseEmailPort.Text == "")) { if (this.chkEmail.Checked) { base.OutputWarn("邮箱账号已经输入,请完善邮箱设置!"); return; } } if (!int.TryParse(this.txtEnterpriseEmailPort.Text.Trim(), out result)) { if (this.chkEmail.Checked) { base.OutputWarn("邮件端口只能输入正整数!"); return; } this.txtEnterpriseEmailPort.Text = "25"; } if (dclDrawMoneyPercent <= 0m || dclDrawMoneyPercent > 1m) { base.OutputWarn("账户提现折损率的取值范围只能是0至1之间的数字!"); } else if (!this.chkPayCard.Checked && (!this.chkPayCash.Checked & !this.chkPayBink.Checked & !this.chkPayCoupon.Checked)) { base.OutputWarn("*必须选择付费方式,否则无法结算!"); } else { modelParameter.DrawMoneyPercent = dclDrawMoneyPercent; modelParameter.RecommendPoint = ((strRecommendPoint != "") ? int.Parse(strRecommendPoint) : 0); modelParameter.PointPeriod = Convert.ToInt32(this.txtPointPeriod.Text); modelParameter.StockCount = Convert.ToInt32(this.txtStockCount.Text); modelParameter.ExpensePrefix = this.txtExpensePrefix.Text; modelParameter.GoodsExpensePrefix = this.txtGoodsExpensePrefix.Text; modelParameter.TimeExpensePrefix = this.txtTimeExpensePrefix.Text; modelParameter.MemCountPrefix = this.txtMemCountPrefix.Text; modelParameter.MemRechargePrefix = this.txtMemRechargePrefix.Text; modelParameter.GoodsInPrefix = this.txtGoodsInPrefix.Text; modelParameter.GoodsAllotPrefix = this.txtGoodsAllotPrefix.Text; modelParameter.MemDrawMoneyPrefix = this.txtMemDrawMoneyPrefix.Text; modelParameter.MemPointChangePrefix = this.txtMemPointChangePrefix.Text; modelParameter.GiftExchangePrefix = this.txtGiftExchangePrefix.Text; modelParameter.AllianceRebatePercent = decimal.Parse(this.txtAllianceRebatePercent.Text); modelParameter.CardShopRebatePercent = decimal.Parse(this.txtCardShopRebatePercent.Text); modelParameter.PointDrawPercent = decimal.Parse(this.txtPointDrawPercent.Text); modelParameter.Senseiccard = this.chkSenseiccard.Checked; modelParameter.Contacticcard = this.chkContacticcard.Checked; modelParameter.PointNumStr = pointnum; if (this.PrintPreview.Checked) { modelParameter.PrintPreview = 1; } else { modelParameter.PrintPreview = 0; } if (this.A4ShiZhi.Checked) { modelParameter.PrintPaperType = 0; } if (this.SanLianShiZhi.Checked) { modelParameter.PrintPaperType = 1; } if (this.POs58ShiZhi.Checked) { modelParameter.PrintPaperType = 2; } if (this.POs80ShiZhi.Checked) { modelParameter.PrintPaperType = 3; } if (this.CKautoBackup.Checked) { modelParameter.AutoBackupDB = true; } else { modelParameter.AutoBackupDB = false; } modelParameter.AutoBackupDay = Convert.ToInt32(this.TBautoBackupDay.Text); modelParameter.IsPayCard = this.chkPayCard.Checked; modelParameter.IsPayCash = this.chkPayCash.Checked; modelParameter.IsPayBink = this.chkPayBink.Checked; modelParameter.IsPayCoupon = this.chkPayCoupon.Checked; modelParameter.IsPayPoint = this.chkPayPoint.Checked; modelParameter.AutoPrint = this.chkAutoPrint.Checked; modelParameter.AccordPrint = this.chkAccordPrint.Checked; modelParameter.PrintTitle = this.txtPrintTitle.Text; modelParameter.PrintFootNote = this.txtPrintFootNote.Text; modelParameter.IsStaff = this.chkStaff.Checked; modelParameter.IsEmail = this.chkEmail.Checked; modelParameter.IsEmailNotice = this.chkMoneyEmail.Checked; modelParameter.EmailAdress = this.txtEmailAdress.Text; modelParameter.EmailPwd = this.txtEmailPwd.Text; modelParameter.EmailSMTP = this.txtEmailSMTP.Text; modelParameter.EnterpriseEmailPort = int.Parse(this.txtEnterpriseEmailPort.Text); modelParameter.EnterpriseEmailEnableSSL = this.chkEnterpriseEmailEnableSSL.Checked; modelParameter.EnterpriseEmailUseDefaultCredentials = this.chkEnterpriseEmailUseDefaultCredentials.Checked; modelParameter.EnterpriseEmailDisplayName = this.txtEnterpriseEmailDisplayName.Text; modelParameter.IsMustSlotCard = this.chkIsMustSlotCard.Checked; modelParameter.UnitList = ((this.txtUnitList.Text == "") ? "个" : this.txtUnitList.Text); if (this.chkStaff.Checked) { modelParameter.StaffType = this.rdStaff.Checked; } modelParameter.PointLevel = this.chkPointLevel.Checked; modelParameter.SellerAccount = this.txtSellerAccount.Text; modelParameter.PartnerID = this.txtPartnerID.Text; modelParameter.PartnerKey = this.txtPartnerKey.Text; modelParameter.IsEditPwdNeedOldPwd = this.chkIsNeedPwd.Checked; modelParameter.IsMemRegisterStaff = this.chkMemRegisterStaff.Checked; modelParameter.StorageTimingPrefix = this.txtStorageTimingPrefix.Text.Trim(); modelParameter.MemCountExpensePrefix = this.txtMemCountExpensePrefix.Text.Trim(); modelParameter.IsAutoSendSMSByMemPast = this.chkIsAutoSendSMSByMemPast.Checked; this.txtAutoSendSMSByMemPastForDay.Text = ((this.txtAutoSendSMSByMemPastForDay.Text.Trim() == "") ? "0" : this.txtAutoSendSMSByMemPastForDay.Text); if (modelParameter.IsAutoSendSMSByMemPast) { if (!int.TryParse(this.txtAutoSendSMSByMemPastForDay.Text.Trim(), out result) || Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim()) < 0 || Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim()) > 30) { base.OutputWarn("会员到期提醒提前天数只能是0到30之间的正整数!"); return; } modelParameter.AutoSendSMSByMemPastForDay = Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim()); } else { modelParameter.AutoSendSMSByMemPastForDay = 0; } modelParameter.IsAutoSendSMSByMemBirthday = this.chksAutoSendSMSByMemBirthday.Checked; this.txtAutoSendSMSByMemBirthdayForDay.Text = ((this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim() == "") ? "0" : this.txtAutoSendSMSByMemBirthdayForDay.Text); if (modelParameter.IsAutoSendSMSByMemBirthday) { if (!int.TryParse(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim(), out result) || Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim()) < 0 || Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim()) > 30) { base.OutputWarn("会员生日提醒提前天数只能是0到30之间的正整数!"); return; } modelParameter.AutoSendSMSByMemBirthdayForDay = Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim()); } else { modelParameter.AutoSendSMSByMemBirthdayForDay = 0; } modelParameter.IsStartWeiXin = this.chkIsStartWeiXin.Checked; modelParameter.IsStartTimingProject = this.chkIsStartTimingProject.Checked; modelParameter.IsStartMemCount = this.chkIsStartMemCount.Checked; modelParameter.EmailUserName = this.txtEmailUserName.Text; modelParameter.PointUsePercent = decimal.Parse(this.txtPointUsePercent.Text); modelParameter.PointDiscountPercent = decimal.Parse(this.txtPointDiscountPercent.Text); modelParameter.IsSendCard = this.chkIsSendCard.Checked; modelParameter.ShopSmsManage = this.chkShopSmsManage.Checked; modelParameter.ShopPointManage = this.chkShopPointManage.Checked; modelParameter.ShopSettlement = this.chkIsSettlement.Checked; if (!PubFunction.curParameter.EnableGoods) { modelParameter.IsStartTimingProject = (modelParameter.IsStartMemCount = false); } if (!this.SwitchingMode(modelParameter)) { base.OutputWarn("保存失败!"); } else { List <Chain.Model.SysGroup> list = new Chain.BLL.SysGroup().GetModelList(""); foreach (Chain.Model.SysGroup item in list) { PubFunction.UpdateGroupAuthority(item.GroupID); } if (bllUpdateParameter.Update(modelParameter)) { PubFunction pub = new PubFunction(); PubFunction.curParameter = pub.LoadSysParameter(); this.curParameter = PubFunction.curParameter; PubFunction.SaveSysLog(this._UserID, 3, "系统参数设置", "系统参数设置", this._UserShopID, DateTime.Now, PubFunction.ipAdress); base.OutputWarn("保存成功!"); } else { base.OutputWarn("系统异常,未保存数据,请再次点击保存!"); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { try { SortedDictionary <string, object> m_values = new SortedDictionary <string, object>(); Stream s = base.Request.InputStream; byte[] buffer = new byte[1024]; StringBuilder builder = new StringBuilder(); int count; while ((count = s.Read(buffer, 0, 1024)) > 0) { builder.Append(Encoding.UTF8.GetString(buffer, 0, count)); } s.Flush(); s.Close(); s.Dispose(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(builder.ToString()); XmlNode xmlNode = xmlDoc.FirstChild; XmlNodeList nodes = xmlNode.ChildNodes; foreach (XmlNode xn in nodes) { XmlElement xe = (XmlElement)xn; m_values[xe.Name] = xe.InnerText; } if (!(m_values["return_code"].ToString() != "SUCCESS")) { string out_trade_no = m_values["out_trade_no"].ToString(); string appid = m_values["appid"].ToString(); string mch_id = m_values["mch_id"].ToString(); string transaction_id = m_values["transaction_id"].ToString(); string nonce_str = m_values["nonce_str"].ToString(); string sign = m_values["sign"].ToString(); string time_end = m_values["time_end"].ToString(); string attach = m_values["attach"].ToString(); string[] sz = attach.Split(new char[] { ',' }); string type = sz[0]; string text = type; if (text != null) { if (text == "Membersrecharge") { Chain.BLL.MemRecharge bllMemRecharge = new Chain.BLL.MemRecharge(); DataSet ds = bllMemRecharge.GetList(string.Format(" RechargeAccount='{0}'", out_trade_no)); if (ds.Tables[0].Rows.Count > 0) { base.Response.Write(this.ToXml("SUCCESS", "")); base.Response.End(); } else { CheckOrder checkorder = new CheckOrder(); Sign signss = new Sign(); Chain.Model.SysParameter modelSysParameter = new Chain.BLL.SysParameter().GetModel(1); string ordertrackingsign = signss.OrderTrackingSign(appid, mch_id, nonce_str, out_trade_no, transaction_id, modelSysParameter.Api); XmlNode xmNode = checkorder.GetCheckOrder(appid, mch_id, transaction_id, out_trade_no, nonce_str, ordertrackingsign); string trade_state = xmNode["trade_state"].InnerText.ToUpper(); if (!(trade_state != "SUCCESS")) { int total_fee = Convert.ToInt32(sz[2]); int total_fees = Convert.ToInt32(m_values["total_fee"]); if (total_fee == total_fees) { text = type; if (text != null) { if (!(text == "Membersrecharge")) { if (text == "ShopMembersRecharge") { base.Response.Write(this.ToXml("SUCCESS", "")); base.Response.End(); } } else { this.Membersrecharge(sz[1], sz[2], sz[3], sz[4], out_trade_no, time_end); } } } } } } } } } catch (Exception) { } } }