using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.Infrastructure.Common; using CY.BLL; using CY.Model; using CY.BLL.Sys; using CY.Infrastructure.DESEncrypt; namespace CY.WebForm.Pages.pay { //吴辉 //推广转入账户 public partial class CashSpreadToAccount : BasePage { Pay_BankInfoBLL bll_Pay_BankInfoBLL = null; Pay_CashApplyBLL bll_Pay_CashApplyBLL = null; Sys_DictionaryBLL bll_Sys_DictionaryBLL = null; Pay_PaymentAccountBLL bll_Pay_PaymentAccountBLL = null; Pay_AccountedRecordBLL bll_Pay_AccountedRecordBLL = null; //初始化 public CashSpreadToAccount() { bll_Pay_BankInfoBLL = new Pay_BankInfoBLL(); bll_Pay_CashApplyBLL = new Pay_CashApplyBLL(); bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); bll_Pay_PaymentAccountBLL = new Pay_PaymentAccountBLL(); bll_Pay_AccountedRecordBLL = new Pay_AccountedRecordBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindAccountMoney(); } } //绑定页面数据 public void BindAccountMoney() { //this.spanMySpreadMoney.InnerText = "¥" + CurrentPayAccount.PromotionMoney.ToString2().TrimEnd('0').TrimEnd('.'); //this.spanCanCashMoney.InnerText = "¥" + (((int)(CurrentPayAccount.PromotionMoney / 100)) * 100).ToString(); //this.spanAccountMoney.InnerText = "¥" + CurrentPayAccount.SurplusMoney.ToString2().TrimEnd('0').TrimEnd('.'); } protected void Submit_Cash(object sender, EventArgs e) { string newPayPwd = Request["txtdwpteg"].ToString2(); string newRtslav = Request["txtrtslav"].ToString2(); //解码并与支付码匹配 if (!Pay_PaymentAccountBLL.EqualsPwd(HttpContext.Current.Server.UrlDecode(newPayPwd), CurrentPayAccount.PayPwd)) { JavaScript.MessageBox("支付码错误", this); } else { decimal? CashMoney = this.txtRechargeMoney.Value.ToDecimal2(); decimal? MyPromotionMoney = (((int)(CurrentPayAccount.PromotionMoney / 100)) * 100).ToDecimal2(); if (CashMoney > MyPromotionMoney || CashMoney <= 0 || CashMoney == null || (CashMoney % 100) != 0) JavaScript.MessageBox("金额输入错误", this); else { lock (this) { string RecordNumber = bll_Pay_AccountedRecordBLL.GetNewRecordNumber(); Pay_PaymentAccount m_Pay_PaymentAccount = CurrentPayAccount; m_Pay_PaymentAccount.PromotionMoney = m_Pay_PaymentAccount.PromotionMoney - CashMoney; CY.Model.Pay.Pay_Request m_Pay_Request = new Model.Pay.Pay_Request(); m_Pay_Request.Payeeid = CurrentPayAccount.Keyid.Value; m_Pay_Request.Payerid = AdminAccount.Keyid.Value; m_Pay_Request.Paymoney = CashMoney.Value; m_Pay_Request.Subject = "推广转账"; m_Pay_Request.BalanceAccount = 2; m_Pay_Request.UsedCredit = -1; Pay_PromotionRecord m_Pay_PromotionRecord = new Pay_PromotionRecord(); m_Pay_PromotionRecord.TradingMoney = CashMoney; m_Pay_PromotionRecord.TradingName = "推广金转入账户"; m_Pay_PromotionRecord.CreateTime = DateTime.Now; m_Pay_PromotionRecord.TradingType =-1; m_Pay_PromotionRecord.PayId = CurrentPayAccount.Keyid; m_Pay_PromotionRecord.ResidualMoney = CurrentPayAccount.PromotionMoney; m_Pay_PromotionRecord.TradingState = -1; m_Pay_PromotionRecord.Remark = CurrentUser.MemberId.ToString2(); m_Pay_PromotionRecord.TardingRemark = "推广金转入账户"; m_Pay_PromotionRecord.IsProxy = false; m_Pay_PromotionRecord.SendMemberId = CurrentUser.MemberId; m_Pay_PromotionRecord.GetMemberId = CurrentUser.MemberId; m_Pay_PromotionRecord.DataType = "推广"; m_Pay_PromotionRecord.RewardType = "推广金"; if (bll_Pay_PaymentAccountBLL.Cashucces(m_Pay_PaymentAccount, m_Pay_Request, m_Pay_PromotionRecord)) { JavaScript.MessageBox("提现成功", this, true, true); BindAccountMoney(); } else JavaScript.MessageBox("提现失败", this); } } } } } }