username@email.com
2025-05-14 99ddfbcecf0fa2881eb3a91028257eef87dab6de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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);
                    }
                }
            }
        }
    }
}