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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.BLL.Sys;
using CY.Model;
using CY.Infrastructure.Common;
using CY.Model.Pay;
using CY.Infrastructure.Query;
 
namespace CY.WebForm.Pages.member
{
    public partial class MemberAccountNew : BasePage
    {
        EC_MemberBasicBLL bll_EC_MemberBasicBLL = null;
        Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;//字典业务逻辑操作类对象
        Pay_CreditLineLevelRuleBLL bll_Pay_CreditLineLevelRuleBLL = null;
        public int LevelCount = 0;
        public Pay_CreditLineLevelRule m_Pay_CreditLineLevelRule = null;
        public Pay_PaymentAccount n_m_Pay_PaymentAccount = null;
 
        //初始化
        public MemberAccountNew()
        {
            bll_EC_MemberBasicBLL = new EC_MemberBasicBLL();
            bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
            bll_Pay_CreditLineLevelRuleBLL = new Pay_CreditLineLevelRuleBLL();
            m_Pay_CreditLineLevelRule = new Pay_CreditLineLevelRule();
            n_m_Pay_PaymentAccount = new Pay_PaymentAccount();
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid nowGuid = CurrentUser.MemberId;
            n_m_Pay_PaymentAccount = bll_EC_MemberBasicBLL.GetPaymentAccountByMemberId(nowGuid);
            m_Pay_CreditLineLevelRule = bll_Pay_CreditLineLevelRuleBLL.GetModel(n_m_Pay_PaymentAccount.LevelRule);
 
            this.BtnSearch.Visible = false;
            if (!IsPostBack)
            {
                DataBindToPage();
            }
        }
 
        //数据绑定
        public void DataBindToPage()
        {
            
 
            Pagination pa = new Pagination();
            pa.PageSize = 500;
            pa.PageIndex = 1;
            this.RepCreditLineList.DataSource = bll_Pay_CreditLineLevelRuleBLL.GetModelPageList(pa);
            this.RepCreditLineList.DataBind();
            LevelCount = this.RepCreditLineList.Items.Count;
            LevelCount = (LevelCount == 0 ? 1 : LevelCount);
 
            
 
            #region 账户信息表赋值
            if (n_m_Pay_PaymentAccount != null)
            {
                this.spanPaymentAccountPayLevel.InnerText = n_m_Pay_PaymentAccount.PayLevel.ToString2();
                this.spanPaymentAccountPayMoney.InnerText = "¥ " + n_m_Pay_PaymentAccount.PayMoney.ToDecimal2Yen().ToString2();
                this.spanPaymentAccountCreditLine.InnerText = n_m_Pay_PaymentAccount.CreditLine.ToDecimal2Yen().ToString2();
                this.spanPaymentAccountSurplusCredit.InnerText = n_m_Pay_PaymentAccount.SurplusCredit.ToDecimal2Yen().ToString2();
                this.spanPaymentAccountCreditUsed.InnerText = (n_m_Pay_PaymentAccount.CreditLine.Value - n_m_Pay_PaymentAccount.SurplusCredit.Value).ToDecimal2Yen().ToString2();
                //this.spanPaymentAccountSurplusMoney.InnerText = m_Pay_PaymentAccount.SurplusMoney.ToDecimal2Yen().ToString2();
                this.spanPaymentAccountOrderCommissionMoney.InnerText = n_m_Pay_PaymentAccount.OrderCommissionMoney.ToDecimal2Yen().ToString2();
                this.spanPaymentAccountScore.InnerText = n_m_Pay_PaymentAccount.Score.ToString2();
                this.spanPaymentAccountPromotionMoney.InnerText = n_m_Pay_PaymentAccount.PromotionMoney.ToDecimal2Yen().ToString2();
                this.spanProxyMoney.InnerText = n_m_Pay_PaymentAccount.ProxyMoney.ToDecimal2Yen().ToString2();
                this.spanProxyMoneyCash.InnerText = n_m_Pay_PaymentAccount.ProxyMoneyCash.ToDecimal2Yen().ToString2();
                this.spanProxyMoneyAudit.InnerText = n_m_Pay_PaymentAccount.ProxyMoneyAudit.ToDecimal2Yen().ToString2();
                if (CurrentUser.MemberType == "买家会员")
                {
                    this.ShowComission.Visible = false;
                }
                else
                {
                    this.HideComission.Visible = false;
                }
            }
            #endregion
        }
 
        protected void btn_Query_Click(object sender, EventArgs e)
        {
            this.BtnSearch.Visible = true;
            string startDate = this.txtBeginData.Value;
            string endDate = this.txtEndDate.Value;
            PaymentAccountQueryModel model = bll_EC_MemberBasicBLL.GetPaymentAccountQueryResult(startDate, endDate, CurrentPayAccount.Keyid.Value);
            if (model != null)
            {
                this.spanAllScore.InnerText = model.AllScore.ToString2();
                this.spanUsedScore.InnerText = model.UsedScore.ToString2();
                this.spanSurplusScore.InnerText = model.SurplusScore.ToString2();
                this.spanAllPromotionMoney.InnerText = model.AllPromotionMoney.ToDecimal2Yen().ToString2();
                this.spanUsedPromotionMoney.InnerText = model.UsedPromotionMoney.ToDecimal2Yen().ToString2();
                this.spanSurplusPromotionMoney.InnerText = model.SurplusPromotionMoney.ToDecimal2Yen().ToString2();
                this.spanAllCommissionMoney.InnerText = model.AllCommissionMoney.ToDecimal2Yen().ToString2();
                this.spanUsedCommissionMoney.InnerText = model.UsedCommissionMoney.ToDecimal2Yen().ToString2();
                this.spanSurplusCommissionMoney.InnerText = model.SurplusCommissionMoney.ToDecimal2Yen().ToString2();
                this.spanAllPayMoney.InnerText = model.AllPayMoney.ToDecimal2Yen().ToString2();
                this.spanPayMoneyByPrint.InnerText = model.PayMoneyByPrint.ToDecimal2Yen().ToString2();
            }
        }
 
        protected void btnReSet_Click(object sender, EventArgs e)
        {
            this.BtnSearch.Visible = true;
            this.txtBeginData.Value = string.Empty;
            this.txtEndDate.Value = string.Empty;
            PaymentAccountQueryModel model = bll_EC_MemberBasicBLL.GetPaymentAccountQueryResult(string.Empty, string.Empty, CurrentPayAccount.Keyid.Value);
            if (model != null)
            {
                this.spanAllScore.InnerText = model.AllScore.ToString2();
                this.spanUsedScore.InnerText = model.UsedScore.ToString2();
                this.spanSurplusScore.InnerText = model.SurplusScore.ToString2();
                this.spanAllPromotionMoney.InnerText = model.AllPromotionMoney.ToDecimal2Yen().ToString2();
                this.spanUsedPromotionMoney.InnerText = model.UsedPromotionMoney.ToDecimal2Yen().ToString2();
                this.spanSurplusPromotionMoney.InnerText = model.SurplusPromotionMoney.ToDecimal2Yen().ToString2();
                this.spanAllCommissionMoney.InnerText = model.AllCommissionMoney.ToDecimal2Yen().ToString2();
                this.spanUsedCommissionMoney.InnerText = model.UsedCommissionMoney.ToDecimal2Yen().ToString2();
                this.spanSurplusCommissionMoney.InnerText = model.SurplusCommissionMoney.ToDecimal2Yen().ToString2();
                this.spanAllPayMoney.InnerText = model.AllPayMoney.ToDecimal2Yen().ToString2();
                this.spanPayMoneyByPrint.InnerText = model.PayMoneyByPrint.ToDecimal2Yen().ToString2();
            }
        }
    }
}