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); } } }