123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- using System.IO;
- using LYFZ.ComponentLibrary;
- using LYFZ.Helper;
- using System.Web.UI.WebControls;
- namespace LYFZ.Software.MainBusiness.OAShopManagement
- {
- public partial class frmCallCenterList : LYFZ.Software.UI.OAShopManagement.frmCallCenterList
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- public frmCallCenterList()
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cbtCustomerSupportStaff, IsFirstNodeNull: true, IsShowAdmin: true);
- this.Load += frmCallCenterList_Load;
- this.btnClose.Click += btnClose_Click;
- this.btnSelect.Click += btnSelect_Click;
- this.btnAudioPlayback.Click += btnAudioPlayback_Click;
- this.comboBoxType.SelectedIndexChanged += comboBoxType_SelectedIndexChanged;
- this.Resize += frmCallCenterList_Resize;
- this.cbxConcreteMatters.SelectedIndexChanged += cbxConcreteMatters_SelectedIndexChanged;
- this.cbxTalkMode.SelectedIndexChanged += cbxTalkMode_SelectedIndexChanged;
- this.cbtCustomerSupportStaff.ComboBoxTree_NodeMouseClick += cbtCustomerSupportStaff_ComboBoxTree_NodeMouseClick;
- this.txtKey.KeyDown += txtKey_KeyDown;
- }
- /// <summary>
- /// 订单编号
- /// </summary>
- public string StrOrdNumber = "";
- /// <summary>
- /// 是否第一次加载运行
- /// </summary>
- bool IsFirstRun = true;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void frmCallCenterList_Load(object sender, EventArgs e)
- {
- this.dateTimePickerStart.DateValue = SDateTime.Now.ToString("yyyy-MM-01");
- this.dateTimePickerEnd.DateValue = Convert.ToDateTime(this.dateTimePickerStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
- this.PublicFunctionRows();
- this.IsFirstRun = false;
- this.frmCallCenterList_Resize(this, null);
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.通话中心);
- if (!b)
- {
- this.Close();
- return;
- }
- }
- /// <summary>
- /// 关键字查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtKey_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { this.btnSelect_Click(this, null); }
- }
- /// <summary>
- /// 客服人员下拉框选择查询事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cbtCustomerSupportStaff_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- this.btnSelect_Click(this, null);
- }
- /// <summary>
- /// 通话方式下拉框选择查询事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cbxTalkMode_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.btnSelect_Click(this, null);
- }
- /// <summary>
- /// 具体事项下拉框选择查询事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void cbxConcreteMatters_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.btnSelect_Click(this, null);
- }
- ListItem item;
- /// <summary>
- /// 选择下拉框
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void comboBoxType_SelectedIndexChanged(object sender, EventArgs e)
- {
- string selectValue = this.comboBoxType.SelectedItem.ToString();
- this.cbxConcreteMatters.Items.Clear();
- this.cbxConcreteMatters.Text = "";
- switch (selectValue)
- {
- case "流程把控":
- item = new ListItem();
- item.Text = "";
- item.Value = "";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已定未拍";
- item.Value = "已定未拍";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已拍未修";
- item.Value = "已拍未修";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已拍未选";
- item.Value = "已拍未选";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已修未选";
- item.Value = "已修未选";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已选未设计";
- item.Value = "已选未设计";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已选未发片";
- item.Value = "已选未发片";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已设计未看";
- item.Value = "已设计未看";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已看未发片";
- item.Value = "已看未发片";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已发未回件";
- item.Value = "已发未回件";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "已回件未取";
- item.Value = "已回件未取";
- this.cbxConcreteMatters.Items.Add(item);
- break;
- case "流程按排":
- item = new ListItem();
- item.Text = "";
- item.Value = "";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "按排摄影拍照";
- item.Value = "安排拍照";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "按排选片时间";
- item.Value = "安排选片";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "按排取件时间";
- item.Value = "安排取件";
- this.cbxConcreteMatters.Items.Add(item);
- break;
- case "业务咨询":
- item = new ListItem();
- item.Text = "";
- item.Value = "";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "婚纱套系";
- item.Value = "婚纱套系";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "写真套系";
- item.Value = "写真套系";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "最新活动";
- item.Value = "最新活动";
- this.cbxConcreteMatters.Items.Add(item);
- break;
- case "满意度调查":
- item = new ListItem();
- item.Text = "";
- item.Value = "";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "回访接单";
- item.Value = "回访接单";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "回访拍摄";
- item.Value = "回访拍摄";
- this.cbxConcreteMatters.Items.Add(item);
- break;
- case "意向跟踪":
- item = new ListItem();
- item.Text = "";
- item.Value = "";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "意向客户跟踪";
- item.Value = "意向客户跟踪";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "溜单追回";
- item.Value = "溜单追回";
- this.cbxConcreteMatters.Items.Add(item);
- break;
- case "关系维护":
- item = new ListItem();
- item.Text = "";
- item.Value = "";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "结婚纪念祝福";
- item.Value = "结婚纪念祝福";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "生日祝福";
- item.Value = "生日祝福";
- this.cbxConcreteMatters.Items.Add(item);
- item = new ListItem();
- item.Text = "节日问候";
- item.Value = "节日问候";
- this.cbxConcreteMatters.Items.Add(item);
- break;
- }
- this.btnSelect_Click(this, null);
- }
- /// <summary>
- /// 录音回放
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnAudioPlayback_Click(object sender, EventArgs e)
- {
- MessageBoxCustom.Show("暂时没有通话录音!");
- }
- /// <summary>
- /// 查询按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSelect_Click(object sender, EventArgs e)
- {
- this.dgvGridview.ClearSelection();
- if (string.IsNullOrEmpty(this.txtKey.Text.Trim()) && !string.IsNullOrEmpty(this.StrOrdNumber))
- { this.StrOrdNumber = ""; }
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 窗体大小发生变化事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void frmCallCenterList_Resize(object sender, EventArgs e)
- {
- if (!this.IsFirstRun)
- {
- int ControlsWidth = 0;
- int ForCount = 0;
- for (int i = 0; i < this.flowLayoutPanel1.Controls.Count; i++)
- {
- if (this.flowLayoutPanel1.Controls[i].Visible)
- {
- ForCount++;
- ControlsWidth += this.flowLayoutPanel1.Controls[i].Width;
- }
- }
- ControlsWidth += ForCount * 6;
- int strWidth = this.Width;
- int IntCount = ControlsWidth / strWidth;
- if ((ControlsWidth % strWidth) > 0)
- { IntCount++; }
- if (IntCount == 1)
- { this.flowLayoutPanel1.Height = 33; }
- else
- {
- ControlsWidth += 110;
- IntCount = ControlsWidth / strWidth;
- if ((ControlsWidth % strWidth) > 0)
- { IntCount++; }
- if (IntCount == 2)
- { this.flowLayoutPanel1.Height = 65; }
- else
- { this.flowLayoutPanel1.Height = 95; }
- }
- }
- }
- /// <summary>
- /// 创建行
- /// </summary>
- void PublicFunctionRows()
- {
- if (!string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()) && string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()))
- { MessageBoxCustom.Show("开始日期不能为空!"); return; }
- else if (string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()) && !string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()))
- { MessageBoxCustom.Show("结束日期不能为空!"); return; }
- if (string.IsNullOrEmpty(this.txtKey.Text.Trim()) && (string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()) || string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim())))
- { MessageBoxCustom.Show("开始日期不能为空!"); return; }
- string StrWhere = "";
- if (!string.IsNullOrEmpty(this.txtKey.Text.Trim()) || !String.IsNullOrEmpty(this.StrOrdNumber))
- {
- if (!String.IsNullOrEmpty(this.StrOrdNumber))
- {
- string StrSQL = "";
- string StrText = "";
- DataTable dt = orbll.GetView_Custom("select Cus_CustomerNumber,Cus_Name from tb_ErpCustomerGroupMembers Left Join tb_ErpCustomerGroup on GP_CustomerGroupID = GM_CustomerGroupID Left Join tb_ErpCustomer on Cus_CustomerNumber = GM_CustomerID where Cus_Type != '儿童' And Cus_CustomerNumber is not null And GP_OrderNumber = '" + StrOrdNumber + "'").Tables[0];
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- StrSQL += "'" + dt.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "',";
- StrText += dt.Rows[i]["Cus_Name"].ToString().Trim() + ",";
- }
- this.txtKey.Text = StrText.TrimEnd(',');
- if (!string.IsNullOrEmpty(StrSQL))
- { StrWhere += " And Cus_CustomerNumber in (" + StrSQL.TrimEnd(',') + ")"; }
- }
- else
- { StrWhere += " And (Cus_Telephone like '%" + this.txtKey.Text.Trim() + "%' or Cus_Name like '%" + this.txtKey.Text.Trim() + "%')"; }
- }
- else
- {
- StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("TR_TraceDateTime", this.dateTimePickerStart.DateValue.Trim(), this.dateTimePickerEnd.DateValue.Trim());
- if (!string.IsNullOrEmpty(this.comboBoxType.Text.Trim()))
- { StrWhere += " And TR_TraceType = '" + this.comboBoxType.Text.Trim() + "'"; }
- if (!string.IsNullOrEmpty(this.cbxConcreteMatters.Text.Trim()))
- {
- item = cbxConcreteMatters.SelectedItem as ListItem;
- StrWhere += " And TR_SpecificMatters = '" + item.Value.Trim() + "'";
- }
- if (!string.IsNullOrEmpty(this.cbxTalkMode.Text.Trim()))
- { StrWhere += " And TR_TraceWay = '" + this.cbxTalkMode.Text.Trim() + "'"; }
- if (!string.IsNullOrEmpty(this.cbtCustomerSupportStaff.Text.Trim()))
- { StrWhere += " And User_Name = '" + this.cbtCustomerSupportStaff.Text.Trim() + "'"; }
- }
- DataTable newTable = new DataTable();
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_StoreManagementCallCenter(StrWhere);
- });
- this.dgvGridview.DataSource(newTable, strHideField: "AutoID,客户编号");
- this.dgvGridview.FillLastColumn();
- }
- }
- }
|