username@email.com
2025-01-17 8d51a0762a43eedada5eb15bd24180d7204e63b3
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
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;
namespace CY.WebForm.Pages.business
{
    public partial class IntentionCustomerList : BasePage
    {
 
        public string Province = ""; //接收值 Request["selectProvince"].ToString2();
        public string City = "";//接收值 Request["selectCity"].ToString2();
        public string County = "";//接收值 Request["selectCounty"].ToString2();
        OA_IntentionCustomerBLL intentionCustomerBLL = null;
        OA_IntentionCustomer intentionCustomer = null;
        Sys_DictionaryBLL _Sys_DictionaryBLL = null;
        OA_StaffBLL bll_OA_StaffBLL = null;
        public IntentionCustomerList()
        {
            bll_OA_StaffBLL = new OA_StaffBLL();
            _Sys_DictionaryBLL = new Sys_DictionaryBLL(); 
            intentionCustomerBLL = new OA_IntentionCustomerBLL();
            intentionCustomer = new OA_IntentionCustomer();
 
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            
            UCPager1.AspNetPager.PageChanged += AspNetPager1_PageChanged;
            Province = Request["selectProvince"].ToString2();
            City = Request["selectCity"].ToString2();
            County = Request["selectCounty"].ToString2();
            if (!IsPostBack)
            {
                Province = CurrentUser.Province;
                InitialSelectData();
                if (Request["Keyid"].ToInt32() > 0)
                {
                    intentionCustomer = intentionCustomerBLL.getSingleIntentionCustomer(Request["Keyid"].ToString2());
                    if (intentionCustomerBLL.DeleteModel(intentionCustomer))
                        Response.Redirect("/Pages/business/IntentionCustomerList.aspx");
                    else
                        JavaScript.MessageBox("删除失败", this);
                }
                BindList();
                
            }
 
        }
 
        /// <summary>
        /// 加载全部数据
        /// </summary>
        private void BindList()
        {
            DateTime? beginTime = null;
            DateTime? endTime = null;
 
            Pagination pa = new Pagination();
            pa.PageSize = this.UCPager1.AspNetPager.PageSize;
            pa.PageIndex = this.UCPager1.AspNetPager.CurrentPageIndex;
 
            this.RepCustomerList.DataSource = intentionCustomerBLL.getAllIntentionCustomer(pa, CurrentUser.MemberId, this.txtquery_userName.Value, string.IsNullOrEmpty(this.txtRegTimeStart.Value) ? beginTime : Convert.ToDateTime(this.txtRegTimeStart.Value), string.IsNullOrEmpty(this.txtRegTimeEnd.Value) ? endTime : MyConvert.GetDateTime(this.txtRegTimeEnd.Value), this.selSourcesInfoId.Value, this.selCustomerIndustriesId.Value, this.selAccountManagerId.Value, this.selBusinessManagerId.Value, this.selCustomerTypeId.Value, this.selTurnoverIntentionId.Value, this.selCustomerStatusId.Value, this.selDegreeImportanId.Value, Province, City, County);
                                                                                           
            this.RepCustomerList.DataBind();
            UCPager1.AspNetPager.RecordCount = pa.RecordCount;
         
        }
 
        protected void InitialSelectData()
        {
            this.selSourcesInfoId.DataSource = _Sys_DictionaryBLL.GetDataByType("客户来源");
            this.selSourcesInfoId.DataBind();
            this.selSourcesInfoId.Items.Insert(0, new ListItem("全部", ""));
            this.selCustomerIndustriesId.DataSource = _Sys_DictionaryBLL.GetDataByType("客户所属行业");
            this.selCustomerIndustriesId.DataBind();
            this.selCustomerIndustriesId.Items.Insert(0, new ListItem("全部", ""));
            this.selCustomerTypeId.DataSource = _Sys_DictionaryBLL.GetDataByType("客户类型");
            this.selCustomerTypeId.DataBind();
            this.selCustomerTypeId.Items.Insert(0, new ListItem("全部", ""));
 
            this.selDegreeImportanId.DataSource = _Sys_DictionaryBLL.GetDataByType("客户重要程度");
            this.selDegreeImportanId.DataBind();
            this.selDegreeImportanId.Items.Insert(0, new ListItem("全部", ""));
 
 
            this.selCustomerStatusId.DataSource = _Sys_DictionaryBLL.GetDataByType("意向客户状态");
            this.selCustomerStatusId.DataBind();
            this.selCustomerStatusId.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.selAccountManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, false, true);
            this.selAccountManagerId.DataTextField = "Name";
            this.selAccountManagerId.DataValueField = "Keyid";
            this.selAccountManagerId.DataBind();
            this.selAccountManagerId.Items.Insert(0, new ListItem("全部", ""));
        }
 
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BindList();
        }
 
        protected void btn_Register_Click(object sender, EventArgs e)
        {
            Province = Request["selectProvince"].ToString2();
            City = Request["selectCity"].ToString2();
            County = Request["selectCounty"].ToString2();
            BindList();
        }
    }
}