username@email.com
2025-05-15 6fe02a16e55f17e45a3997171e1b2284d45af25b
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
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.Infrastructure.Query;
using CY.Infrastructure.Common;
using CY.BLL.Sys;
using CY.Model;
 
namespace CY.WebForm.Pages.member
{
    public partial class AccountRecordNew : BasePage
    {
        Pay_IncExpRecordBLL bll_Pay_IncExpRecordBLL = null;
        Sys_DictionaryBLL _sys_DictionaryBLL = null;
 
        public string Province { get; set; }
        public string City { get; set; }
        public string County { get; set; }
 
        public AccountRecordNew()
        {
            bll_Pay_IncExpRecordBLL = new Pay_IncExpRecordBLL();
            _sys_DictionaryBLL = new Sys_DictionaryBLL();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            UCPager1.AspNetPager.PageChanged += AspNetPager1_PageChanged;
            if (!IsPostBack)
            {
                Province = CY.Config.WebInfo.Instance.WebProvinceName;
                City = CY.Config.WebInfo.Instance.WebCityName;
                this.hidFirmId.Value = this.CurrentUser.MemberId.ToString();
                BindDropDownList();
                BindList();
            }
        }
 
        private void BindDropDownList()
        {
            IsNotExsit(4);
            IEnumerable<Sys_Dictionary> dicList = null;
            dicList = _sys_DictionaryBLL.GetDataByType("收支科目").Where(p => IsNotExsit(p.MeanValue.Value));
            this.ddlBalanceAccount.DataSource = dicList;
            this.ddlBalanceAccount.DataTextField = "Name";
            this.ddlBalanceAccount.DataValueField = "MeanValue";
            this.ddlBalanceAccount.DataBind();
            this.ddlBalanceAccount.Items.Insert(0,new ListItem("请选择","-1"));
 
            this.ddlMemberType.DataSource = _sys_DictionaryBLL.GetDataByType("会员类型").Where(p=>p.MeanValue!=0);
            this.ddlMemberType.DataTextField = "Name";
            this.ddlMemberType.DataValueField = "Name";
            this.ddlMemberType.DataBind();
            this.ddlMemberType.Items.Insert(0, new ListItem("请选择", ""));
        }
 
        private bool IsNotExsit(int meanValue)
        {
            bool isNotExsit = true;
            IList<int> list = null;
            if (CurrentUser.MemberType == "管理员")
            {
                list = new List<int>()
                {
                    2,4,5,6,11
                };
            }
            else if (CurrentUser.MemberType == "印刷厂商" || CurrentUser.MemberType == "个人网店")
            {
                list = new List<int>()
                {
                   7,8
                };
            }
            else //买家会员
            {
                list = new List<int>()
                {
                   3,7,8,10,12
                };
            }
            if (list.Contains(meanValue))
            {
                isNotExsit = false;
            }
            return isNotExsit;
        }
 
        /// <summary>
        /// 收入
        /// </summary>
        /// <param name="meanValue"></param>
        /// <returns></returns>
        public bool IsExsitByIn(int meanValue)
        {
            bool isExsit = false;
            IList<int> list = null;
            if (CurrentUser.MemberType == "管理员")
            {
                list = new List<int>()
                {
                    12,13,15,7,3,10,14
                };
            }
            else if (CurrentUser.MemberType == "印刷厂商" || CurrentUser.MemberType == "个人网店")
            {
                list = new List<int>()
                {
                   0,1,2,4,5,6,9,11,15
                };
            }
            else //买家会员
            {
                list = new List<int>()
                {
                   0,1,2,9,11,15
                };
            }
            if (list.Contains(meanValue))
            {
                isExsit = true;
            }
            return isExsit;
        }
 
        /// <summary>
        /// 支出
        /// </summary>
        /// <param name="meanValue"></param>
        /// <returns></returns>
        public bool IsExsitByOut(int meanValue)
        {
            bool isExsit = false;
            IList<int> list = null;
            if (CurrentUser.MemberType == "管理员")
            {
                list = new List<int>()
                {
                    0,8,1,16,9
                };
            }
            else if (CurrentUser.MemberType == "印刷厂商" || CurrentUser.MemberType == "个人网店")
            {
                list = new List<int>()
                {
                   3,4,5,6,10,12,13,14,16
                };
            }
            else //买家会员
            {
                list = new List<int>()
                {
                   4,5,6,13,14,16
                };
            }
            if (list.Contains(meanValue))
            {
                isExsit = true;
            }
            return isExsit;
        }
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindList()
        {
            Pagination pa = new Pagination();
            pa.PageSize = UCPager1.AspNetPager.PageSize;
            pa.PageIndex = UCPager1.AspNetPager.CurrentPageIndex;
            string startDate = this.txtBeginData.Value.ToString();
            string endDate=string.Empty;
            if (!string.IsNullOrEmpty(this.txtEndDate.Value.ToString()))
            {
                endDate = DateTime.Parse(this.txtEndDate.Value.ToString()).AddDays(1).ToString();
            }
            int tradingType = ddlTradingType.SelectedValue.ToString().ToInt32().Value;
            int balanceAccount = ddlBalanceAccount.SelectedValue.ToString().ToInt32().Value;
            string memberType = ddlMemberType.SelectedValue.ToString();
            string memberName = this.txtMemberName.Text;
            if (Request["selectProvince"] != null)
            {
                Province = Request["selectProvince"].ToString();
            }
            if (Request["selectCity"] != null)
            {
                City = Request["selectCity"].ToString();
            }
            if (Request["selectCounty"] != null)
            {
                County = Request["selectCounty"].ToString();
            }
 
            this.RepClientList.DataSource = bll_Pay_IncExpRecordBLL.SelectAllModelByPaging(pa, CurrentPayAccount.Keyid,startDate,endDate,tradingType,balanceAccount,memberType,memberName,Province,City,County);
            this.RepClientList.DataBind();
            UCPager1.AspNetPager.RecordCount = pa.RecordCount;
 
        }
 
        //分页事件
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BindList();
        }
 
        protected void btn_Query_Click(object sender, EventArgs e)
        {
            BindList();
        }
 
        protected void btnReSet_Click(object sender, EventArgs e)
        {
            this.txtBeginData.Value = string.Empty;
            this.txtEndDate.Value = string.Empty;
            this.ddlTradingType.SelectedValue = "0";
            this.ddlBalanceAccount.SelectedValue = "-1";
            this.ddlMemberType.SelectedValue = "";
            this.txtMemberName.Text = string.Empty;
            UCPager1.AspNetPager.CurrentPageIndex = 1;
            Province = CY.Config.WebInfo.Instance.WebProvinceName;
            City = CY.Config.WebInfo.Instance.WebCityName;
            BindList();
        }
 
        protected void ddlTradingType_SelectedIndexChanged(object sender, EventArgs e)
        {
                IEnumerable<Sys_Dictionary> dicList = null;
                if(ddlTradingType.SelectedValue=="0")
                {
                    dicList = _sys_DictionaryBLL.GetDataByType("收支科目").Where(p=>IsNotExsit(p.MeanValue.Value));
                }
                else if (ddlTradingType.SelectedValue == "1")
                {
                    dicList = _sys_DictionaryBLL.GetDataByType("收支科目").Where(p => IsExsitByIn(p.MeanValue.Value));
                }
                else
                {
                    dicList = _sys_DictionaryBLL.GetDataByType("收支科目").Where(p => IsExsitByOut(p.MeanValue.Value));
                }
                this.ddlBalanceAccount.DataSource = dicList;
                this.ddlBalanceAccount.DataTextField = "Name";
                this.ddlBalanceAccount.DataValueField = "MeanValue";
                this.ddlBalanceAccount.DataBind();
                this.ddlBalanceAccount.Items.Insert(0, new ListItem("请选择", "-1"));
                BindList();
        }
 
        protected void ddlBalanceAccount_SelectedIndexChanged(object sender, EventArgs e)
        {
            BindList();
        }
 
        protected void ddlMemberType_SelectedIndexChanged(object sender, EventArgs e)
        {
            BindList();
        }
 
        protected void txtMemberName_TextChanged(object sender, EventArgs e)
        {
            BindList();
        }
    }
}