123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778 |
- 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;
- namespace LYFZ.Software.MainBusiness.CameraControlBook
- {
- public partial class A_EventAideFormMain : LYFZ.Software.UI.CameraControlBook.A_EventAideFormMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- public A_EventAideFormMain()
- {
- this.Shown += A_EventAideFormMain_Shown;
- this.Load += A_EventAideFormMain_Load;
- this.butnAddRecord.Click += butnAddRecord_Click;
- this.butnColse.Click += butnColse_Click;
- this.butnQuery.Click += butnQuery_Click;
- this.buttonEx1.Click += buttonEx1_Click;
- this.btnClientServiceAnPai.Click += btnClientServiceAnPai_Click;
- this.butnRecordingsPlay.Click += butnRecordingsPlay_Click;
- this.tabPanel.SelectedIndexChanged += tabPanel_SelectedIndexChanged;
- this.dgvData.MouseDoubleClick += dgvMarry_MouseDoubleClick;
- this.btnHighSelect.Click += btnHighSelect_Click;
- this.txtPointsEnd.KeyPress += txtPointsEnd_KeyPress;
- this.txtPointsStart.KeyPress += txtPointsStart_KeyPress;
- this.dtMonthStart.ValueChanged += dtMonthStart_ValueChanged;
- this.dtMonthEnd.ValueChanged += dtMonthEnd_ValueChanged;
- this.butnAddRecord.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CommunicationAide, CustomAttributes.OperatingAuthority.Add);
- this.butnRecordingsPlay.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CommunicationAide, CustomAttributes.OperatingAuthority.AudioPlayback);
- this.btnExport.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CommunicationAide, CustomAttributes.OperatingAuthority.DataExport);
- this.btnExport.Click += btnExport_Click;
- this.Resize += A_EventAideFormMain_Resize;
- this.chkAvailablePoints.Click += chkAvailablePoints_Click;
- this.chkTotalPoints.Click += chkTotalPoints_Click;
- //this.btnClientServiceAnPai.Visible = false;
- #region 门店选择;
- this.cmbtreevStoreName.ComboBoxTree_NodeMouseClick += CmbtreevStoreName_ComboBoxTree_NodeMouseClick;
- #endregion
- this.lab_ChildBirth.Click += Lab_ChildBirth_Click;
- }
- private void Lab_ChildBirth_Click(object sender, EventArgs e)
- {
- if( this.lab_ChildBirth.BackColor == System.Drawing.Color.DodgerBlue)
- {
- this.lab_ChildBirth.BackColor = System.Drawing.Color.Red;
- labelEx5.Text = "出生日期:";
- this.dtYearStart.Enabled = true;
- this.dtYearEnd.Enabled = true;
- }
- else
- {
- this.lab_ChildBirth.BackColor = System.Drawing.Color.DodgerBlue;
- labelEx5.Text = "宝宝生日:";
- this.dtYearStart.Enabled = false;
- this.dtYearEnd.Enabled = false;
- this.dtYearStart.Value = SDateTime.Now.Year;
- this.dtYearEnd.Value = SDateTime.Now.Year;
- }
- }
- private void CmbtreevStoreName_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
- {
- //throw new NotImplementedException();
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 安排任务的任务类型
- /// </summary>
- public string StrClientServiceType = "";
- /// <summary>
- /// 高级查询返回的信息
- /// </summary>
- Hashtable htData = new Hashtable();
- /// <summary>
- /// 员工工号ID
- /// </summary>
- string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void A_EventAideFormMain_Shown(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "st071", StrKeyCode: "st0703");
- if (this.cmbtreevStoreName.Nodes.Count <= 0)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: LYFZ.Model.Model_UserRights.GetQuickToolsPet(), StrKeyCode: "st0703");
- }
- ///版本权限控制
- Dictionary<VersionControl.VersionFunctionEnum, TabPage> dicPageList = new Dictionary<VersionControl.VersionFunctionEnum, TabPage>();
- dicPageList.Add(VersionControl.VersionFunctionEnum.客服中心沟通助手结婚客人, this.tabPanel.TabPages[0]);
- dicPageList.Add(VersionControl.VersionFunctionEnum.客服中心沟通助手纪念日客人, this.tabPanel.TabPages[1]);
- dicPageList.Add(VersionControl.VersionFunctionEnum.客服中心沟通助手客户生日, this.tabPanel.TabPages[2]);
- dicPageList.Add(VersionControl.VersionFunctionEnum.客服中心沟通助手宝宝生日, this.tabPanel.TabPages[3]);
- dicPageList.Add(VersionControl.VersionFunctionEnum.客服中心沟通助手转介绍客人, this.tabPanel.TabPages[4]);
- dicPageList.Add(VersionControl.VersionFunctionEnum.客服中心沟通助手会员积分, this.tabPanel.TabPages[5]);
- dicPageList.Add(VersionControl.VersionFunctionEnum.客服中心沟通助手孕妇周期, this.tabPanel.TabPages[6]);
- foreach (var key in dicPageList.Keys)
- {
- List<TabPage> hideControls = new List<TabPage>();
- hideControls.Add(dicPageList[key]);
- LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideTabControl(key, this.tabPanel, hideControls);
- }
- if (this.tabPanel.TabCount == 0)
- {
- MessageBoxCustom.Show("当前版本无 沟通助手 模块的功能!");
- this.Close();
- return;
- }
- this.dtYearStart.Value = SDateTime.Now.Year;
- this.dtYearEnd.Value = SDateTime.Now.Year;
- this.dtYearStart.Enabled = false;
- this.dtYearEnd.Enabled = false;
- this.dtMonthStart.Value = 1;
- this.dtDayStart.Value = DateTime.DaysInMonth(SDateTime.Now.Year, 1);
- this.dtMonthEnd.Value = 12;
- this.dtDayEnd.Value = DateTime.DaysInMonth(SDateTime.Now.Year, 12);
- if (this.StrClientServiceType.Trim().Length > 0)
- {
- TabPage strTabName = null;
- switch (this.StrClientServiceType.Trim())
- {
- case "结婚客人": strTabName = this.tb_Marry; break;
- case "结婚纪念日": strTabName = this.tb_MemorialDay; break;
- case "客户生日": strTabName = this.tb_Birthday; break;
- case "宝宝生日": strTabName = this.tb_ChildBirthday; break;
- case "转介绍客户": strTabName = this.tb_Referral; break;
- case "会员积分": strTabName = this.tb_Points; break;
- case "孕妇周期": strTabName = this.tb_PregnantCycle; break;
- }
- if (strTabName != null && this.tabPanel.Contains(strTabName))
- {
- this.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- this.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- this.tabPanel.SelectedTab = strTabName;
- }
- }
- this.PublicFunctionRows();
- /*foreach(TabPage page in this.tabPanel.TabPages)
- {
- if(page)
- }*/
- }
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void A_EventAideFormMain_Load(object sender, EventArgs e)
- {
- this.lab_ChildBirth.Visible = false;
- this.panelDateTime.Visible = false;
- this.dgvData.Columns.Clear();
- this.dgvData.Rows.Clear();
- string strColumn = "订单号,客户类型,客户姓名,手机号码,性别,结婚日期,地区,套系类别,套系名称,套系价格,消费总额,订单类型,客户来源,沟通状态,跟踪人员姓名,沟通日期,沟通时长,备注";
- this.dgvData.DataColumns(strColumn);
- }
- /// <summary>
- /// 积分限制输入
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtPointsEnd_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 积分限制输入
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void txtPointsStart_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 月离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dtMonthStart_ValueChanged(object sender, EventArgs e)
- {
- this.dtDayStart.Value = DateTime.DaysInMonth(SDateTime.Now.Year, Convert.ToInt32(this.dtMonthStart.Value));
- this.dtDayStart.Maximum = this.dtDayStart.Value;
- }
- /// <summary>
- /// 月离开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dtMonthEnd_ValueChanged(object sender, EventArgs e)
- {
- this.dtDayEnd.Value = DateTime.DaysInMonth(SDateTime.Now.Year, Convert.ToInt32(this.dtMonthEnd.Value));
- this.dtDayEnd.Maximum = this.dtDayEnd.Value;
- }
- /// <summary>
- /// 窗体大小发生变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void A_EventAideFormMain_Resize(object sender, EventArgs e)
- {
- switch (this.butnColse.Location.Y)
- {
- case 2: this.flowLayoutPanel1.Height = 34; break;
- case 35: this.flowLayoutPanel1.Height = 68; break;
- }
- }
- /// <summary>
- /// 高级查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnHighSelect_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.SMSManagement.ShortSmsMessage.FrmHigehrSelect frm = new SMSManagement.ShortSmsMessage.FrmHigehrSelect();
- if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- htData["StrPackages"] = frm.CtvPak_PackagesClass.Text;
- htData["StrOrderCategory"] = frm.cmbtreevOrdeClass.Text;
- htData["StrConsumptionBind"] = Convert.ToInt32(frm.numTaoxijiageA.Value);
- htData["StrConsumptionEnd"] = Convert.ToInt32(frm.numTaoxijiageZ.Value);
- htData["StrAppointmentBind"] = frm.txtyuyueshijianA.Text;
- htData["StrAppointmentEnd"] = frm.txtyuyueshijianZ.Text;
- htData["StrCustomerArea"] = frm.cmbCus_Region.Text;
- htData["StrCustomerSource"] = frm.cmbtreevCustomerSource.Text;
- htData["StrBirthday"] = frm.cmbAnshenri.Text;
- htData["StrMarriage"] = frm.cmbAnhungqi.Text;
- htData["StryearBind"] = frm.numShuiA.Value;
- htData["StryearEnd"] = frm.numShuiZ.Value;
- htData["StrDayBind"] = frm.numTianA.Value;
- htData["StrDayEnd"] = frm.numTianZ.Value;
- htData["IsYears"] = frm.rdoanshui.Checked;
- this.PublicFunctionRows();
- }
- }
- /// <summary>
- /// 添加记录
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void butnAddRecord_Click(object sender, EventArgs e)
- {
- string StrClientGroupNumber = "";
- string StrClientNumber = "";
- string StrMemberNumber = "";
- string StrHctOddnumber = "";
- LYFZ.EnumPublic.ClientServiceTaskItem EnumbInputType = EnumPublic.ClientServiceTaskItem.结婚客人;
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tb_Marry":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- {
- StrClientGroupNumber = this.dgvData.CurrentRow.Cells["客户组编号"].Value.ToString();
- EnumbInputType = LYFZ.EnumPublic.ClientServiceTaskItem.结婚客人;
- }
- break;
- case "tb_MemorialDay":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- {
- StrClientGroupNumber = this.dgvData.CurrentRow.Cells["客户组编号"].Value.ToString();
- EnumbInputType = LYFZ.EnumPublic.ClientServiceTaskItem.结婚纪念日;
- }
- break;
- case "tb_Birthday":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- {
- StrClientNumber = this.dgvData.CurrentRow.Cells["客户编号"].Value.ToString();
- EnumbInputType = LYFZ.EnumPublic.ClientServiceTaskItem.客户生日;
- }
- break;
- case "tb_ChildBirthday":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- {
- StrClientNumber = this.dgvData.CurrentRow.Cells["客户编号"].Value.ToString();
- EnumbInputType = LYFZ.EnumPublic.ClientServiceTaskItem.宝贝生日;
- }
- break;
- case "tb_Referral":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- {
- StrClientNumber = this.dgvData.CurrentRow.Cells["客户编号"].Value.ToString();
- EnumbInputType = LYFZ.EnumPublic.ClientServiceTaskItem.转介绍客户;
- }
- break;
- case "tb_Points":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- {
- StrClientNumber = this.dgvData.CurrentRow.Cells["客户编号"].Value.ToString();
- StrMemberNumber = this.dgvData.CurrentRow.Cells["Mc_Number"].Value.ToString();
- EnumbInputType = LYFZ.EnumPublic.ClientServiceTaskItem.会员积分;
- }
- break;
- case "tb_PregnantCycle":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- {
- StrHctOddnumber = this.dgvData.CurrentRow.Cells["来单批号"].Value.ToString();
- EnumbInputType = LYFZ.EnumPublic.ClientServiceTaskItem.孕妇周期;
- }
- break;
- }
- if (string.IsNullOrEmpty(StrClientNumber) && string.IsNullOrEmpty(StrClientGroupNumber) && string.IsNullOrEmpty(StrMemberNumber) && string.IsNullOrEmpty(StrHctOddnumber))
- { MessageBoxCustom.Show("请选择要添加的数据"); return; }
- LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.A_AddCommunicateRecords frm = new SuperSmallForm.A_AddCommunicateRecords();
- frm.StrClientNumber = StrClientGroupNumber;
- frm.StrClientName = StrClientNumber;
- frm.StrMemberNumber = StrMemberNumber;
- frm.StrHctOddnumber = StrHctOddnumber;
- frm.EnumClientServiceTaskItem = EnumbInputType;
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.PublicFunctionRows(); }
- }
- /// <summary>
- /// 安排客服
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClientServiceAnPai_Click(object sender, EventArgs e)
- {
- if (this.dgvData.SelectedRows.Count > 0)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm();
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- LYFZ.EnumPublic.ClientServiceTaskItem ClientServiceAnPai;
- switch (this.tabPanel.SelectedTab.Name.Trim())
- {
- case "tb_MemorialDay":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.结婚纪念日;
- break;
- case "tb_Birthday":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.客户生日;
- break;
- case "tb_ChildBirthday":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.宝贝生日;
- break;
- case "tb_Referral":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.转介绍客户;
- break;
- case "tb_Points":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.会员积分;
- break;
- case "tb_PregnantCycle":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.孕妇周期;
- break;
- default:
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.结婚客人;
- break;
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ClientServiceAnPai(this.dgvData, LYFZ.EnumPublic.ClientServiceTaskType.沟通助手, frm.model, ClientServiceAnPai);
- }
- }
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnExport_Click(object sender, EventArgs e)
- {
- this.dgvData.ExportDataTable();
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void butnColse_Click(object sender, EventArgs e)
- { this.Close(); }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void butnQuery_Click(object sender, EventArgs e)
- { this.PublicFunctionRows(); }
- /// <summary>
- /// 录音回放
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void butnRecordingsPlay_Click(object sender, EventArgs e)
- {
- MessageBoxCustom.Show("未找到录音文件!");
- //LYFZ.BLL.BLL_ErpCustomersTrackRecord bll = new BLL.BLL_ErpCustomersTrackRecord();
- //if (this.dgvMarry.SelectedRows.Count == 0)
- //{
- // MessageBoxCustom.Show("请选中你要录音回放的数据!");
- // return;
- //}
- //int id = Convert.ToInt32(this.dgvMarry.CurrentRow.Cells["ID"].Value);
- //DataTable dt = bll.GetList("id=" + id + "").Tables[0];
- //if (dt.Rows.Count > 0)
- //{
- // string Callw_SoundRecording = dt.Rows[0]["TR_CallRecording"].ToString();
- // if (!string.IsNullOrEmpty(Callw_SoundRecording))
- // {
- // //播放
- // LYFZ.Software.MainBusiness.CallerWizard.FrmPlayer set = new CallerWizard.FrmPlayer();
- // set.Path = Callw_SoundRecording;
- // set.ShowDialog();
- // }
- // else { MessageBoxCustom.Show("文件未找到!"); }
- //}
- }
- /// <summary>
- /// 沟通详情按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void buttonEx1_Click(object sender, EventArgs e)
- {
- string StrOrdNumber = "";
- string StrClientNumber = "";
- string StrHctOddnumber = "";
- string StrClientGroupNumber = "";
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tb_Marry":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- { StrClientGroupNumber = this.dgvData.CurrentRow.Cells["客户组编号"].Value.ToString(); }
- break;
- case "tb_MemorialDay":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- { StrClientGroupNumber = this.dgvData.CurrentRow.Cells["客户组编号"].Value.ToString(); }
- break;
- case "tb_Birthday":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- { StrClientNumber = this.dgvData.CurrentRow.Cells["客户编号"].Value.ToString(); }
- break;
- case "tb_ChildBirthday":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- {
- // StrClientNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString();
- #region 2017-03-31 刘工修改
- StrOrdNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString();
- #endregion
- }
- break;
- case "tb_Referral":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- { StrClientNumber = this.dgvData.CurrentRow.Cells["客户编号"].Value.ToString(); }
- break;
- case "tb_Points":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- { StrClientNumber = this.dgvData.CurrentRow.Cells["客户编号"].Value.ToString(); }
- break;
- case "tb_PregnantCycle":
- if (this.dgvData.SelectedRows != null && this.dgvData.SelectedRows.Count > 0)
- { StrHctOddnumber = this.dgvData.CurrentRow.Cells["来单批号"].Value.ToString(); }
- break;
- }
- //if (string.IsNullOrEmpty(StrOrdNumber) && string.IsNullOrEmpty(StrClientNumber) && string.IsNullOrEmpty(StrHctOddnumber) && string.IsNullOrEmpty(StrClientGroupNumber))
- //{ MessageBoxCustom.Show("请选择要查看的数据"); return; }
- LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.A_CommunicationDetails frm = new SuperSmallForm.A_CommunicationDetails();
- frm.StrNumber = StrOrdNumber;
- frm.StrClientNumber = StrClientNumber;
- frm.StrHctOddnumber = StrHctOddnumber;
- frm.StrClientGroupNumber = StrClientGroupNumber;
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.PublicFunctionRows(); }
- }
- /// <summary>
- /// 选项卡选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void tabPanel_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (this.tabPanel.SelectedIndex==-1)
- {
- return;
- }
- this.lab_ChildBirth.Visible = false;
- this.txtQuery.Text = "";
- this.txtPointsStart.Text = "";
- this.txtPointsEnd.Text = "";
- this.butnQuery.Visible = true;
- this.btnHighSelect.Visible = true;
- this.dtYearStart.Enabled = false;
- this.dtYearEnd.Enabled = false;
- this.dtYearStart.Value = SDateTime.Now.Year;
- this.dtYearEnd.Value = SDateTime.Now.Year;
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tb_Marry":
- case "tb_MemorialDay":
- this.txtQuery.WaterText = "客户名";
- this.panelClientName.Visible = true;
- this.panelPoints.Visible = false;
- this.panelMonthDay.Visible = true;
- this.panelDateTime.Visible = false;
- break;
- case "tb_Birthday":
- case "tb_ChildBirthday":
- this.txtQuery.WaterText = "客户名";
- this.panelClientName.Visible = true;
- this.panelPoints.Visible = false;
- this.panelMonthDay.Visible = true;
- this.panelDateTime.Visible = false;
- this.lab_ChildBirth.Visible = true;
- this.lab_ChildBirth.BackColor = System.Drawing.Color.DodgerBlue;
- break;
- case "tb_Referral":
- this.txtQuery.WaterText = "客户名/介绍人";
- this.panelPoints.Visible = false;
- this.panelMonthDay.Visible = false;
- this.panelClientName.Visible = true;
- this.panelDateTime.Visible = true;
- break;
- case "tb_Points":
- this.txtQuery.WaterText = "客户名";
- this.panelClientName.Visible = true;
- this.panelMonthDay.Visible = false;
- this.panelPoints.Visible = true;
- this.panelDateTime.Visible = false;
- break;
- case "tb_PregnantCycle":
- this.txtQuery.WaterText = "客户名";
- this.panelClientName.Visible = true;
- this.panelMonthDay.Visible = false;
- this.panelPoints.Visible = false;
- this.butnQuery.Visible = false;
- this.btnHighSelect.Visible = false;
- this.panelDateTime.Visible = false;
- break;
- }
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tb_Marry": this.labelEx5.Text = "结婚日期:"; break;
- case "tb_MemorialDay": this.labelEx5.Text = "结婚纪念日:"; break;
- case "tb_Birthday": this.labelEx5.Text = "客户生日:"; break;
- case "tb_ChildBirthday": this.labelEx5.Text = "宝宝生日:"; break;
- }
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 结婚客人
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvMarry_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- if (e.Location.Y > this.dgvData.ColumnHeadersHeight)
- {
- if (this.dgvData.Rows.Count > 0)
- {
- if (this.dgvData.CurrentRow.Index >= 0 && this.dgvData.CurrentCell.ColumnIndex >= 0)
- { this.butnAddRecord_Click(this, e); }
- }
- }
- }
- /// <summary>
- /// 可用积分点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkAvailablePoints_Click(object sender, EventArgs e)
- {
- this.chkAvailablePoints.Checked = true;
- this.chkTotalPoints.Checked = false;
- }
- /// <summary>
- /// 总积分点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void chkTotalPoints_Click(object sender, EventArgs e)
- {
- this.chkAvailablePoints.Checked = false;
- this.chkTotalPoints.Checked = true;
- }
- /// <summary>
- /// 创建行
- /// </summary>
- void PublicFunctionRows()
- {
- string StrWhere = "";
- string StrColumns = "";
- DataTable newTable = new DataTable();
- string StrDateTimeStart = dtYearStart.Value + "-" + Convert.ToInt32(this.dtMonthStart.Value).ToString("d2") + "-" + Convert.ToInt32(this.dtDayStart.Value).ToString("d2");
- string StrDateTimeEnd = dtYearEnd.Value + "-" + Convert.ToInt32(this.dtMonthEnd.Value).ToString("d2") + "-" + Convert.ToInt32(this.dtDayEnd.Value).ToString("d2");
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tb_Marry":
- StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("dbo.fn_ConvertDate(GregorianCalendar_DayForMarriage)", StrDateTimeStart, StrDateTimeEnd) + this.GetStrWhere();
- StrColumns = "客户编号,客户组编号,订单号,客户姓名,客户类型,手机号码,性别,结婚日期,地区,套系类别,套系名称,套系价格,消费总额,订单类别,客户来源,沟通状态,客服人员,沟通日期,沟通时长,沟通备注";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientMarriage(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by dbo.fn_ConvertDate(GregorianCalendar_DayForMarriage)");
- this.dgvData.DataSource(newTable, strHideField: "客户编号,客户组编号");
- break;
- case "tb_MemorialDay":
- StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTimeNowYear("dbo.fn_ConvertDate(GregorianCalendar_NowYearDayForMarriage)", StrDateTimeStart, StrDateTimeEnd) + this.GetStrWhere();
- StrColumns = "客户编号,客户组编号,订单号,客户姓名,客户类型,手机号码,性别,结婚日期,结婚纪念日,地区,套系类别,套系名称,套系价格,消费总额,订单类别,客户来源,沟通状态,客服人员,沟通日期,沟通时长,沟通备注";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientMarriageMemorial(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by dbo.fn_ConvertDate(GregorianCalendar_NowYearDayForMarriage)");
- this.dgvData.DataSource(newTable, strHideField: "客户编号,客户组编号");
- break;
- case "tb_Birthday":
- StrColumns = "客户编号,客户组编号,订单号,客户类型,客户姓名,手机号码,性别,客户出生日期,客户今年生日,地区,套系类别,订单类别,套系名称,套系价格,消费总额,客户来源,沟通状态,客服人员,沟通日期,沟通时长,沟通备注";
- if (this.lab_ChildBirth.BackColor == System.Drawing.Color.DodgerBlue)
- {
- StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTimeNowYear("dbo.Fun_GetGregorianCalendarNowYearBirthday(Cus_Birthday,Cus_BirthdayLunar)", StrDateTimeStart, StrDateTimeEnd) + this.GetStrWhere();
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientBirthday(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by dbo.Fun_GetGregorianCalendarNowYearBirthday(Cus_Birthday,Cus_BirthdayLunar)");
- }
- else
- {
- StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime(" Cus_Birthday ", StrDateTimeStart, StrDateTimeEnd) + this.GetStrWhere();
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientBirthday(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by Cus_Birthday ");
- }
- this.dgvData.DataSource(newTable, strHideField: "客户编号,客户组编号");
- break;
- case "tb_ChildBirthday":
- #if IGNORE
- StrColumns = "客户编号,客户组编号,订单号,客户姓名,客户类型,手机号码,性别,宝宝出生日期,宝宝今年生日,年龄,地区,接单人,套系类别,套系名称,套系价格,消费总额,订单类别,客户来源,沟通状态,客服人员,沟通日期,沟通时长,沟通备注";//,宝宝生日
- #else
- StrColumns = "客户编号,客户组编号,订单号,客户姓名,客户类型,手机号码,性别,宝宝出生日期,宝宝今年生日,拍摄场景,拍照日期,拍照状态,年龄,地区,接单人,套系类别,套系名称,套系价格,消费总额,订单类别,客户来源,沟通状态,客服人员,沟通日期,沟通时长,沟通备注";//,宝宝生日
- #endif
- if (this.lab_ChildBirth.BackColor == System.Drawing.Color.DodgerBlue)
- {
- StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTimeNowYear("dbo.fn_ConvertDate(GregorianCalendar_NowYearBirthday)", StrDateTimeStart, StrDateTimeEnd) + this.GetStrWhere();
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientBabyBirthday(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by Ord_SinceOrderNumber, dbo.fn_ConvertDate(GregorianCalendar_NowYearBirthday)");
- }
- else
- {
- StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Cus_Birthday", StrDateTimeStart, StrDateTimeEnd) + this.GetStrWhere();
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientBabyBirthday(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by Ord_SinceOrderNumber, Cus_Birthday ");
- }
- string ordNumber = "";
- foreach(DataRow dr in newTable.Rows)
- {
- if(dr["订单号"].ToString_s()!= ordNumber)
- {
- ordNumber = dr["订单号"].ToString_s();
- }
- else
- {
- dr["订单号"] = "";
- dr["客户姓名"] = "";
- dr["客户类型"] = "";
- dr["手机号码"] = "";
- dr["性别"] = "";
- dr["宝宝出生日期"] = "";
- dr["宝宝今年生日"] = "";
- }
- }
- this.dgvData.DataSource(newTable, strHideField: "客户编号,客户组编号");
- break;
- case "tb_Referral":
- StrWhere = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTimeNowYear("Ord_CreateDateTime", this.dtpDateStrat.DateValue.Trim(), this.dtDateEnd.DateValue.Trim()) + this.GetStrWhere();
- StrColumns = "Ord_Number,客户编号,订单日期,介绍类型,订单号,套系名称,订单客户姓名,介绍人姓名,性别,介绍人电话,成交状态,沟通状态,客服人员,沟通日期,沟通时长,沟通备注";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientReferral(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by Ord_CreateDateTime");
- this.dgvData.DataSource(newTable, strHideField: "Ord_Number,客户编号");
- this.dgvData.Columns["订单日期"].Width = 110;
- this.dgvData.FillLastColumn();
- break;
- case "tb_Points":
- StrWhere = this.GetStrWhere();
- StrColumns = "Mc_Number,客户编号,会员卡号,总积分,可用积分,客户姓名,客户电话,沟通状态,客服人员,沟通日期,沟通时长,沟通备注";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientMemberPoints(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by Mc_Number");
- this.dgvData.DataSource(newTable, strHideField: "Mc_Number,客户编号");
- this.dgvData.FillLastColumn();
- break;
- case "tb_PregnantCycle":
- StrWhere = this.GetStrWhere();
- StrColumns = "来单批号,客户姓名,预产期,怀孕天数,怀孕周期,沟通状态,客服人员,沟通日期,沟通时长,沟通备注";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CommunicationAssistantClientPregnancyCycle(LYFZ.DAL.DAL_GridViewDisplayIndex.GetdictColumns(StrColumns), StrWhere, " order by 来单批号");
- this.dgvData.DataSource(newTable, strHideField: "");
- this.dgvData.FillLastColumn();
- break;
- }
- this.dataGridViewStatisticsCount1.LocationX = this.dgvData.RowHeadersWidth;
- this.dataGridViewStatisticsCount1.CurrenQuantity = newTable.Rows.Count;
- this.dataGridViewStatisticsCount1.TotalQuantity = newTable.Rows.Count;
- }
- /// <summary>
- /// 获取查询条件
- /// </summary>
- /// <returns></returns>
- string GetStrWhere()
- {
- //string StrWhere = "";
- string StrWhere = DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop");
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tb_Marry":
- StrWhere += " And (Cus_Name like '%" + this.txtQuery.Text.Trim() + "%' or Cus_Name_py like '%" + this.txtQuery.Text.Trim() + "%' ) ";
- // StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("结婚日期查询", this.dtpDateStrat.DateValue.Trim(), this.dtDateEnd.DateValue.Trim());
- break;
- case "tb_MemorialDay":
- //StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTimeNowYear("结婚纪念日查询", this.dtpDateStrat.DateValue.Trim(), this.dtDateEnd.DateValue.Trim());
- StrWhere += " And (Cus_Name like '%" + this.txtQuery.Text.Trim() + "%' or Cus_Name_py like '%" + this.txtQuery.Text.Trim() + "%' ) And GregorianCalendar_DayForMarriage < '" + (SDateTime.Now.Year + "-01-01") + "'";
- break;
- case "tb_Birthday":
- StrWhere += " And (Cus_Name like '%" + this.txtQuery.Text.Trim() + "%' ) ";
- // StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTimeNowYear("客户生日查询", this.dtpDateStrat.DateValue.Trim(), this.dtDateEnd.DateValue.Trim());
- break;
- case "tb_ChildBirthday":
- StrWhere += " And (Cus_Name like '%" + this.txtQuery.Text.Trim() + "%' or Cus_Name_py like '%" + this.txtQuery.Text.Trim() + "%' ) ";
- // StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTimeNowYear("宝宝生日查询", this.dtpDateStrat.DateValue.Trim(), this.dtDateEnd.DateValue.Trim());
- if (htData.ContainsKey("IsYears"))
- {
- if (Convert.ToBoolean(htData["IsYears"]))
- {
- if (Convert.ToInt32(htData["StryearBind"]) > 0 && Convert.ToInt32(htData["StryearEnd"]) > 0)
- { StrWhere += " and (Age_Year between " + Convert.ToInt32(htData["StryearBind"]) + " and " + Convert.ToInt32(htData["StryearEnd"]) + ")"; }
- }
- else
- {
- if (Convert.ToInt32(htData["StrDayBind"]) > 0 && Convert.ToInt32(htData["StrDayEnd"]) > 0)
- { StrWhere += " and (Age_Day between " + Convert.ToInt32(htData["StrDayBind"]) + " and " + Convert.ToInt32(htData["StrDayEnd"]) + ")"; }
- }
- }
- break;
- case "tb_Referral":
- // StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("订单日期", this.dtpDateStrat.DateValue.Trim(), this.dtDateEnd.DateValue.Trim()) + " and (Cus_NamePinyin like '%" + this.txtQuery.Text.Trim() + "%' or 介绍人姓名 like '%" + this.txtQuery.Text.Trim() + "%')";
- if (this.txtQuery.Text.Trim().Length > 0)
- { StrWhere += " and (tb_ErpCustomer.Cus_NamePinyin like '%" + this.txtQuery.Text.Trim() + "%' or tb_ErpCustomer.Cus_Name like '%" + this.txtQuery.Text.Trim() + "%' or tempTB_AggregationCustomer.Cus_Name like '%" + this.txtQuery.Text.Trim() + "%' or tempTB_AggregationCustomer.Cus_Name_py like '%" + this.txtQuery.Text.Trim() + "%')"; }
- break;
- case "tb_Points":
- StrWhere += " And (Cus_Name like '%" + this.txtQuery.Text.Trim() + "%' ) ";
- if (this.txtPointsStart.Text.Trim() != "" && this.txtPointsEnd.Text.Trim() != "")
- { StrWhere += " and (Mcps_AvailablePoints between '" + this.txtPointsStart.Text.Trim() + "' and '" + this.txtPointsEnd.Text.Trim() + "')"; }
- else if (this.txtPointsStart.Text.Trim() != "" && this.txtPointsEnd.Text.Trim() == "")
- { StrWhere += " and (Mcps_AvailablePoints = '" + this.txtPointsStart.Text.Trim() + "')"; }
- else if (this.txtPointsStart.Text.Trim() == "" && this.txtPointsEnd.Text.Trim() != "")
- { StrWhere += " and (Mcps_AvailablePoints = '" + this.txtPointsEnd.Text.Trim() + "')"; }
- if (this.chkTotalPoints.Checked)
- { StrWhere = StrWhere.Replace("Mcps_AvailablePoints", "Mcps_TotalPoints"); }
- // StrWhere += " and Mc_Status = '1'";
- break;
- case "tb_PregnantCycle":
- StrWhere += " And (Hct_CustomerName like '%" + this.txtQuery.Text.Trim() + "%' ) ";
- break;
- }
- if (htData.Count > 0)
- {
- if (htData["StrPackages"].ToString().Trim().Length > 0)
- { StrWhere += " and Ord_PhotographyCategory='" + htData["StrPackages"].ToString().Trim() + "'"; }
- if (htData["StrOrderCategory"].ToString().Trim().Length > 0)
- { StrWhere += " and Ord_Type='" + htData["StrOrderCategory"].ToString().Trim() + "'"; }
- if (htData["StrConsumptionBind"].ToString().Trim().Length > 0 && Convert.ToDecimal(htData["StrConsumptionBind"]) > 0 && htData["StrConsumptionEnd"].ToString().Trim().Length > 0 && Convert.ToDecimal(htData["StrConsumptionEnd"]) > 0)
- { StrWhere += " and ((isnull(Plu_Amount,0)+isnull(Ord_SeriesPrice,0)) between " + Convert.ToDecimal(htData["StrConsumptionBind"]) + " and " + Convert.ToDecimal(htData["StrConsumptionEnd"]) + ")"; }
- //if (htData["StrAppointmentBind"].ToString().Trim().Length > 0 && Convert.ToDecimal(htData["StrAppointmentBind"]) > 0 && htData["StrAppointmentEnd"].ToString().Trim().Length > 0 && Convert.ToDecimal(htData["StrAppointmentEnd"]) > 0)
- //{ StrWhere += " and (预约时间 between '" + Convert.ToDecimal(htData["StrAppointmentBind"]) + "' and '" + Convert.ToDecimal(htData["StrAppointmentEnd"]) + "' ) "; }
- if (htData["StrCustomerArea"].ToString().Trim().Length > 0)
- { StrWhere += " and M_Cus_Region = '" + htData["StrCustomerArea"].ToString().Trim() + "'"; }
- if (htData["StrCustomerSource"].ToString().Trim().Length > 0)
- { StrWhere += " and GP_CustomerSource = '" + htData["StrCustomerSource"].ToString().Trim() + "'"; }
- }
- this.htData.Clear();
- return StrWhere;
- }
- }
- }
|