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