username@email.com
2025-01-20 dc7b6c75f98b6924b7e091ee7ac6551470652d78
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
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.Sys;
using CY.Model;
using CY.BLL.OA;
using CY.BLL;
namespace CY.WebForm.Pages.business
{
    //吴辉
    //客户管理-转移客户
    public partial class ShiftIntOrCus : BasePage
    {
        OA_StaffBLL bll_OA_StaffBLL = null;
        OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null;
 
        //初始化
        public ShiftIntOrCus()
        {
            bll_OA_StaffBLL = new OA_StaffBLL();
            bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitialSelData();
            }
        }
 
        //绑定数据
        protected void InitialSelData()
        {
 
            //业务经理
            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("请选择", "0"));
 
            //客户经理
            this.selCustomManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId,false,true);
            this.selCustomManagerId.DataTextField = "Name";
            this.selCustomManagerId.DataValueField = "Keyid";
            this.selCustomManagerId.DataBind();
            this.selCustomManagerId.Items.Insert(0, new ListItem("请选择", "0"));
 
            string[] ids = Request["Keyid"].ToString2().Trim('|').Split('|');
            this.spanNum.InnerText = ids.Length.ToString2();
        }
 
        //提交事件
        protected void btn_config_Click(object sender, EventArgs e)
        {
            try
            {
                string condition = "";
                if (Request["type"].ToString2() == "cor")
                {
                    condition = "WHERE CustomerId IN (" + Request["Keyid"].ToString2().Trim('|').Replace("|", ",") + ") And FirmId ='" + CurrentUser.MemberId + "'";
                }
                else
                {
                    condition = "WHERE Keyid IN (" + Request["Keyid"].ToString2().Trim('|').Replace("|", ",") + ") And FirmId ='"+CurrentUser.MemberId+"'";
                }
                if (bll_OA_CorporateClientsBLL.ShiftIntOrCus(this.selBusinessManagerId.Value.ToInt32(), this.selCustomManagerId.Value.ToInt32(), Request["type"].ToString2(), condition))
                    JavaScript.RefreshDIVOpener(this);
                else
                    JavaScript.MessageBox("转移失败", this);
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("操作失败",this);
            }
        }
    }
}