username@email.com
2025-05-21 a980cd04341d71216e0f59bd4b7327fe9fc50032
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
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.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure.Common;
using CY.BLL.Sys;
using CY.BLL.OA;
using CY.BLL.EC;
 
namespace CY.WebForm.Pages.business
{
    public partial class XiaoshoujixiaoList : BasePage
    {
        EC_OrderBLL bll_EC_OrderBLL = null;
        Sys_DictionaryBLL _Sys_DictionaryBLL = null;
        OA_StaffBLL bll_OA_StaffBLL = null;
        OA_CustomerApplyBLL bll_OA_CustomerApplyBLL = null;
        EC_MemberBasicBLL bll_EC_MemberBasicBLL = null;
        Sys_CitySiteBLL bll_Sys_CitySiteBLL = null;
 
        //初始化
        public XiaoshoujixiaoList()
        {
            _Sys_DictionaryBLL = new Sys_DictionaryBLL();
            bll_EC_OrderBLL = new EC_OrderBLL();
            bll_OA_StaffBLL = new OA_StaffBLL();
            bll_OA_CustomerApplyBLL = new OA_CustomerApplyBLL();
            bll_EC_MemberBasicBLL = new EC_MemberBasicBLL();
            bll_Sys_CitySiteBLL = new Sys_CitySiteBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            UCPager1.AspNetPager.PageChanged += AspNetPager1_PageChanged;
            if (!IsPostBack)
            {
                BindProvince();
                BindList();
                InitialSelectData();
            }
 
            
        }
 
        //加载查询条件
        protected void InitialSelectData()
        {
            
 
            this.selDegreeImportanId.DataSource = _Sys_DictionaryBLL.GetDataByType("客户重要程度");
            this.selDegreeImportanId.DataBind();
            this.selDegreeImportanId.Items.Insert(0, new ListItem("全部", ""));
 
            this.selTurnoverIntentionId.DataSource = _Sys_DictionaryBLL.GetDataByType("客户信誉");
            this.selTurnoverIntentionId.DataBind();
            this.selTurnoverIntentionId.Items.Insert(0, new ListItem("全部", ""));
 
            //业务经理  
            this.selBusinessManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, true, false);
            this.selBusinessManagerId.DataTextField = "Name";
            this.selBusinessManagerId.DataValueField = "Keyid";
            this.selBusinessManagerId.DataBind();
            this.selBusinessManagerId.Items.Insert(0, new ListItem("全部", ""));
 
 
            //完结状态
            this.selShifouwanjie.DataSource = _Sys_DictionaryBLL.GetDataByType("客户完结状态").OrderByDescending(x => x.MeanValue);
            this.selShifouwanjie.DataTextField = "Name";
            this.selShifouwanjie.DataValueField = "MeanValue";
            this.selShifouwanjie.DataBind();
            this.selShifouwanjie.Items.Insert(0, new ListItem("全部", ""));
 
        }
 
        //绑定列表
        private void BindList()
        {
             
            Pagination pa = new Pagination();
            pa.PageSize = UCPager1.AspNetPager.PageSize;
            pa.PageIndex = UCPager1.AspNetPager.CurrentPageIndex;
            this.RepClientList.DataSource = bll_EC_OrderBLL.GetxiaoshouchaxunList(pa,
                CurrentUser.MemberId,
                 this.selectProvince.SelectedItem.Text.Replace("全部", ""),
                this.selectCity.SelectedItem.Text.Replace("全部", ""),
                this.selectCounty.SelectedItem.Text.Replace("全部", ""),
                this.selDegreeImportanId.Value,
                this.txtquery_userName.Value,
                this.selBusinessManagerId.Value,
                this.selTurnoverIntentionId.Value,
                 this.selShifouwanjie.Value,
                 this.selLastOrderTime.Value,
                this.selOrderCount.Value,
                this.selOrderMoney.Value,
                 this.txtOrderCount.Value,
                this.txtOrderMoney.Value,
                this.txtLastOrderTime.Value
               );
            this.RepClientList.DataBind();
            UCPager1.AspNetPager.RecordCount = pa.RecordCount;
        }
 
        //分页事件
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BindList();
        }
 
        //查询事件
        protected void btn_Search_Click(object sender, EventArgs e)
        {
            BindList();
        }
 
        //绑定省
        protected void BindProvince()
        {
            this.selectProvince.Items.Clear();
            if (CurrentUser.TrueType == "员工")
                this.selectProvince.DataSource = bll_Sys_CitySiteBLL.SelectStaffManageProvinceList(CurrentUser.TrueMemberId);
            else
                this.selectProvince.DataSource = bll_Sys_CitySiteBLL.SelectAllNextModel(0, 0, 1);
 
            this.selectProvince.DataTextField = "Name";
            this.selectProvince.DataValueField = "Keyid";
            this.selectProvince.DataBind();
            this.selectProvince.Items.Insert(0, new ListItem("全部", ""));
            this.selectCity.Items.Insert(0, new ListItem("全部", ""));
            this.selectCounty.Items.Insert(0, new ListItem("全部", ""));
        }
 
        //改变省绑定市
        protected void ChangeProvince(object sender, EventArgs e)
        {
            this.selectCity.Items.Clear();
            this.selectCounty.Items.Clear();
            Sys_CitySite m_Sys_CitySite = bll_Sys_CitySiteBLL.GetModelByKeyid(this.selectProvince.SelectedValue.ToInt32() ?? 0);
            if (m_Sys_CitySite != null)
            {
                if (CurrentUser.TrueType == "员工")
                    this.selectCity.DataSource = bll_Sys_CitySiteBLL.SelectStaffManageCityList(m_Sys_CitySite.Keyid, CurrentUser.TrueMemberId);
                else
                    this.selectCity.DataSource = bll_Sys_CitySiteBLL.SelectAllNextModel(m_Sys_CitySite.Keyid, 0, 2);
 
                this.selectCity.DataTextField = "Name";
                this.selectCity.DataValueField = "Keyid";
                this.selectCity.DataBind();
            }
            this.selectCity.Items.Insert(0, new ListItem("全部", ""));
            this.selectCounty.Items.Insert(0, new ListItem("全部", ""));
        }
 
        //改变市绑定区
        protected void ChangeCity(object sender, EventArgs e)
        {
            this.selectCounty.Items.Clear();
            Sys_CitySite m_Sys_CitySite = bll_Sys_CitySiteBLL.GetModelByKeyid(this.selectCity.SelectedValue.ToInt32() ?? 0);
            if (m_Sys_CitySite != null)
            {
                if (CurrentUser.TrueType == "员工")
                    this.selectCounty.DataSource = bll_Sys_CitySiteBLL.SelectStaffManageCountryList(m_Sys_CitySite.ProvinceId, m_Sys_CitySite.Keyid, CurrentUser.TrueMemberId);
                else
                    this.selectCounty.DataSource = bll_Sys_CitySiteBLL.SelectProxyNextModel(m_Sys_CitySite.ProvinceId, m_Sys_CitySite.Keyid, 3);
 
                this.selectCounty.DataTextField = "Name";
                this.selectCounty.DataValueField = "Keyid";
                this.selectCounty.DataBind();
            }
            this.selectCounty.Items.Insert(0, new ListItem("全部", ""));
        }
    }
}