public NotifyPage() { if (!EPayments.CheckPayment(DNTRequest.GetString("notify_id"))) { HttpContext.Current.Response.Write("fail"); return; } int status = EPayments.ConvertAlipayTradeStatus(DNTRequest.GetString("trade_status")); string outTradeNo = DNTRequest.GetString("out_trade_no", true); string tradeNo = DNTRequest.GetString("trade_no", true); if (string.IsNullOrEmpty(outTradeNo) || string.IsNullOrEmpty(tradeNo) || status <= 0) { return; } //var ci = CreditOrders.GetCreditOrderInfoByOrderCode(outTradeNo); var ci = Order.FindByCode(outTradeNo); if (ci != null && ci.Status < 2) { float[] array = new float[8]; array[ci.Credit - 1] = (float)ci.Amount; if (CreditsFacade.UpdateUserExtCredits(ci.Uid, array, true) != 1) { status = 0; } //CreditsLogs.AddCreditsLog(ci.Uid, ci.Uid, ci.Credit, ci.Credit, 0f, (float)ci.Amount, Utils.GetDateTime(), 3); CreditsLog.Add(ci.Uid, ci.Uid, ci.Credit, ci.Credit, 0, ci.Amount, 3); var notice = new Notice { PostDateTime = DateTime.Now, Type = (Int32)NoticeType.GoodsTradeNotice, Poster = "系统", PosterID = 0, Uid = ci.Uid, Note = string.Format("您购买的积分 {0} 已经成功充值,请<a href=\"usercpcreaditstransferlog.aspx\">查收</a>!(支付宝订单号:{1})", ForumUtils.ConvertCreditAndAmountToWord(ci.Credit, ci.Amount), tradeNo) }; notice.Insert(); //CreditOrders.UpdateCreditOrderInfo(ci.OrderId, tradeNo, num, Utils.GetDateTime()); ci.TradeNo = tradeNo; ci.Status = status; ci.ConfirmedTime = DateTime.Now; ci.Update(); } if (DNTRequest.IsPost()) { HttpContext.Current.Response.Write("success"); return; } HttpContext.Current.Response.Redirect("../usercpcreaditstransferlog.aspx?paysuccess=true"); }
protected override void ShowPage() { this.pagetitle = "用户控制面板"; if (!base.IsLogin()) { return; } if (this.isshowmsg) { base.SetUrl("usercpcreaditstransferlog.aspx"); base.SetMetaRefresh(5); base.SetShowBackLink(false); base.AddMsgLine("积分充值操作完成,充值成功后会发送站内通知告知"); return; } //this.creditslogcount = CreditsLogs.GetCreditsLogRecordCount(this.userid); this.creditslogcount = CreditsLog.SearchCount(this.userid); base.BindItems(this.creditslogcount); //this.creditsloglist = CreditsLogs.GetCreditsLogList(16, this.pageid, this.userid); this.creditsloglist = CreditsLog.Search(this.userid, (pageid - 1) * 16, 16).ToDataTable(false); }
protected override void ShowPage() { this.pagetitle = "用户控制面板"; if (!base.IsLogin()) { return; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } bool flag = true; //switch (this.config.Passwordmode) //{ // case 0: flag = Utils.MD5(DNTRequest.GetString("password")).EqualIgnoreCase(this.password); // break; // case 1: // flag = (Utils.MD5(DNTRequest.GetString("password")) != this.password); // break; // default: // if (PasswordModeProvider.GetInstance() != null) // { // flag = !PasswordModeProvider.GetInstance().CheckPassword(this.user, DNTRequest.GetString("password")); // } // break; //} if (flag) { base.AddErrLine("密码错误"); return; } int paynum = DNTRequest.GetInt("paynum", 0); if (paynum <= 0) { base.AddErrLine("数量必须是大于等于0的整数"); return; } int userId = Users.GetUserId(DNTRequest.GetString("fromto").Trim()); if (userId <= 0) { base.AddErrLine("指定的转帐接受人不存在"); return; } int int2 = DNTRequest.GetInt("extcredits", 0); if (int2 < 1 || int2 > 8) { base.AddErrLine("请正确选择要转帐的积分类型!"); return; } string text = Scoresets.GetScoreSet(int2).Name.Trim(); if (text.IsNullOrEmpty()) { base.AddErrLine("错误的输入!"); return; } if (Users.GetUserExtCredits(this.userid, int2) - (float)paynum < (float)Scoresets.GetTransferMinCredits()) { base.AddErrLine(string.Format("抱歉, 您的 \"{0}\" 不足.系统当前规定转帐余额不得小于{1}", text, Scoresets.GetTransferMinCredits().ToString())); return; } var num = (Int32)Math.Round((double)((float)paynum * (1f - this.creditstax)), 2); BBX.Entity.User.UpdateUserExtCredits(this.userid, int2, (float)(paynum * -1)); BBX.Entity.User.UpdateUserExtCredits(userId, int2, num); //CreditsLogs.AddCreditsLog(this.userid, userId, int2, int2, (float)@int, num, Utils.GetDateTime(), 2); CreditsLog.Add(this.userid, userId, int2, int2, paynum, num, 2); base.SetUrl("usercpcreaditstransferlog.aspx"); base.SetMetaRefresh(); base.SetShowBackLink(false); base.AddMsgLine("积分转帐完毕, 正在返回积分兑换与转帐记录"); } }
protected override void ShowPage() { this.pagetitle = "用户控制面板"; string text = ""; foreach (DataRow dataRow in Scoresets.GetScorePaySet(0).Rows) { object obj = text; text = obj + "creditsrate[" + dataRow["id"] + "] = " + dataRow["rate"] + ";\r\n"; } this.jscreditsratearray = string.Format(this.jscreditsratearray, text); if (!base.IsLogin()) { return; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } bool flag = true; //switch (this.config.Passwordmode) //{ // case 0: flag = Utils.MD5(DNTRequest.GetString("password")).EqualIgnoreCase(this.password); // break; // case 1: // flag = (Utils.MD5(DNTRequest.GetString("password")) != this.password); // break; // default: // if (PasswordModeProvider.GetInstance() != null) // { // flag = !PasswordModeProvider.GetInstance().CheckPassword(this.user, DNTRequest.GetString("password")); // } // break; //} if (flag) { base.AddErrLine("密码错误"); return; } int paynum = DNTRequest.GetInt("paynum", 0); if (paynum <= 0) { base.AddErrLine("数量必须是大于0的整数"); return; } if (DNTRequest.GetInt("extcredits1", 0) < 1 || DNTRequest.GetInt("extcredits2", 0) < 1 || DNTRequest.GetInt("extcredits1", 0) > 8 || DNTRequest.GetInt("extcredits2", 0) > 8) { base.AddErrLine("请正确选择要兑换的积分类型!"); return; } if (DNTRequest.GetInt("extcredits1", 0) == DNTRequest.GetInt("extcredits2", 0)) { base.AddErrLine("不能兑换相同类型的积分"); return; } var scoreSet = Scoresets.GetScoreSet(DNTRequest.GetInt("extcredits1", 0)); var scoreSet2 = Scoresets.GetScoreSet(DNTRequest.GetInt("extcredits2", 0)); if (scoreSet.Name.IsNullOrEmpty() || scoreSet2.Name.IsNullOrEmpty()) { base.AddErrLine("错误的输入!"); return; } if (Users.GetUserExtCredits(this.userid, DNTRequest.GetInt("extcredits1", 0)) - (float)paynum < (float)Scoresets.GetExchangeMinCredits()) { base.AddErrLine("抱歉, 您的 \"" + scoreSet.Name + "\" 不足.系统当前规定转帐余额不得小于" + Scoresets.GetExchangeMinCredits()); return; } Users.GetUserInfo(this.userid); var num = (Int32)Math.Round((double)((float)paynum * (scoreSet.Rate / scoreSet2.Rate) * (1f - this.creditstax)), 2); BBX.Entity.User.UpdateUserExtCredits(this.userid, DNTRequest.GetInt("extcredits1", 0), paynum * -1); BBX.Entity.User.UpdateUserExtCredits(this.userid, DNTRequest.GetInt("extcredits2", 0), num); //CreditsLogs.AddCreditsLog(this.userid, this.userid, DNTRequest.GetInt("extcredits1", 0), DNTRequest.GetInt("extcredits2", 0), (float)@int, num, Utils.GetDateTime(), 1); CreditsLog.Add(userid, userid, DNTRequest.GetInt("extcredits1", 0), DNTRequest.GetInt("extcredits2", 0), paynum, num, 1); base.SetUrl("usercpcreaditstransferlog.aspx"); base.SetMetaRefresh(); base.SetShowBackLink(false); base.AddMsgLine("积分兑换完毕, 正在返回积分兑换与转帐记录"); } }