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; namespace CY.WebForm.Pages.pay { //吴辉 //账户提现 public partial class CashAccountToBank : 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; //初始化 public CashAccountToBank() { bll_Pay_BankInfoBLL = new Pay_BankInfoBLL(); bll_Pay_CashApplyBLL = new Pay_CashApplyBLL(); bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); bll_Pay_PaymentAccountBLL = new Pay_PaymentAccountBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindAccountMoney(); } } //绑定页面数据 public void BindAccountMoney() { //this.spanMyAccountMoney.InnerText = "¥ " + CurrentPayAccount.SurplusMoney.ToString2().TrimEnd('0').TrimEnd('.'); //this.spanCanCashMoney.InnerText = "¥ " + (((int)(CurrentPayAccount.SurplusMoney / 100)) * 100).ToString(); this.RepClientList.DataSource = bll_Pay_BankInfoBLL.GetModelListByMemberId(CurrentUser.MemberId); this.RepClientList.DataBind(); } //提交提现申请 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? MyMoney = (((int)(CurrentPayAccount.SurplusMoney / 100)) * 100).ToDecimal2(); if (CashMoney > MyMoney || CashMoney < 100 || CashMoney == null || (CashMoney % 100) != 0) JavaScript.MessageBox("金额输入错误", this); else { Pay_CashApply m_Pay_CashApply = new Pay_CashApply(); m_Pay_CashApply.Payid = CurrentPayAccount.Keyid; m_Pay_CashApply.Money = CashMoney; m_Pay_CashApply.TargetBankId = this.txtTargetBankId.Value; m_Pay_CashApply.TargetBankName = this.txtTargetBankName.Value; m_Pay_CashApply.Cardholder = this.txtCardholder.Value; m_Pay_CashApply.Remark = "申请时间:" + DateTime.Now.ToString() + ",申请人:" + CurrentUser.ShortName; m_Pay_CashApply.State = 0; m_Pay_CashApply.CreateTime = DateTime.Now; m_Pay_CashApply.CashTypeId =0; if (bll_Pay_CashApplyBLL.InsertModel(m_Pay_CashApply)) JavaScript.MessageBox("申请成功,我们会尽快审核并转账", this,true,true); else JavaScript.MessageBox("申请失败", this); } } } } }