LR-20210131IOQH\Administrator
2021-09-17 8d824926bbb3346eb1046b9f1ab8d95b6a60ba17
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
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 IntentionCustomerBatchAccess : BasePage
    {
        Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
        OA_CustomerAccessRecordBLL bll_OA_CustomerAccessRecordBLL = null;
        OA_StaffBLL bll_OA_StaffBLL = null;
 
        //初始化
        public IntentionCustomerBatchAccess()
        {
            bll_OA_CustomerAccessRecordBLL = new OA_CustomerAccessRecordBLL();
            bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
            bll_OA_StaffBLL = new OA_StaffBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitialSelData();
            }
        }
 
        //绑定数据
        protected void InitialSelData()
        {
            //成交意向选择
            this.dwTurnoverIntention.DataSource = bll_Sys_DictionaryBLL.GetDataByType("成交意向");
            this.dwTurnoverIntention.DataTextField = "Name";
            this.dwTurnoverIntention.DataValueField = "Name";
            this.dwTurnoverIntention.DataBind();
            this.dwTurnoverIntention.SelectedValue = "不确定";
 
            //访问类型
            this.dwAcessType.Items.Insert(0, new ListItem("电话", "2"));
            this.dwAcessType.Items.Insert(1, new ListItem("上门", "1"));
            this.dwAcessType.Items.Insert(2, new ListItem("QQ", "3"));
            this.dwAcessType.DataBind();
 
            //访问人
            this.selBusinessManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId,true,true);
            this.selBusinessManagerId.DataTextField = "Name";
            this.selBusinessManagerId.DataValueField = "Keyid";
            this.selBusinessManagerId.DataBind();
            this.selBusinessManagerId.Items.Insert(0, new ListItem("请选择", ""));
 
            this.txtStartTime.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
            this.txtEndTime.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }
 
        //提交事件
        protected void btn_config_Click(object sender, EventArgs e)
        {
            string[] Keys = Request["Keyid"].ToString2().Trim('|').Split('|');
            OA_CustomerAccessRecord m_OA_CustomerAccessRecord = new OA_CustomerAccessRecord();
 
            m_OA_CustomerAccessRecord.AccessContent = this.txtContent.Value;
            m_OA_CustomerAccessRecord.AccesserId = this.selBusinessManagerId.Value.ToInt32();
            m_OA_CustomerAccessRecord.AccessTypeId = this.dwAcessType.SelectedValue.ToInt32();
            m_OA_CustomerAccessRecord.CreateTime = DateTime.Now;
            m_OA_CustomerAccessRecord.CustomerId = "";
            m_OA_CustomerAccessRecord.CutomerType = (Request["type"]=="cor");
            m_OA_CustomerAccessRecord.EndTime = this.txtEndTime.Value.ToDateTime2() ?? DateTime.Now;
            m_OA_CustomerAccessRecord.LastUpdateTime = DateTime.Now;
            m_OA_CustomerAccessRecord.Operator = CurrentUser.ShortName;
            m_OA_CustomerAccessRecord.Receiver = this.txtReciver.Value.ToString2();
            m_OA_CustomerAccessRecord.Remark = CurrentUser.MemberId.ToString2();
            m_OA_CustomerAccessRecord.StartTime = this.txtStartTime.Value.ToDateTime2() ?? DateTime.Now;
            m_OA_CustomerAccessRecord.StuffId = this.selBusinessManagerId.Value.ToInt32();
            m_OA_CustomerAccessRecord.TurnoverIntention = this.dwTurnoverIntention.SelectedValue.ToString2();
 
            if (bll_OA_CustomerAccessRecordBLL.InsertModelList(Keys, m_OA_CustomerAccessRecord))
                JavaScript.RefreshDIVOpener(this);
            else
                JavaScript.MessageBox("批量访问失败", this);
            
        }
    }
}