Interestedbuyers.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Globalization;
  10. using LYFZ.ComponentLibrary;
  11. using System.Web.UI.WebControls;
  12. using LYFZ.DAL;
  13. using LYFZ.Software.MainBusiness.Customers.OldCustomer;
  14. using System.Collections;
  15. namespace LYFZ.Software.MainBusiness.Customers
  16. {
  17. public partial class Interestedbuyers : LYFZ.Software.UI.Customers.Interestedbuyers
  18. {
  19. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  20. public Interestedbuyers()
  21. {
  22. this.Shown += FrmOldCustomer_Shown;
  23. this.btnAdd.Click += btnAdd_Click;
  24. this.btnUpdate.Click += btnUpdate_Click;
  25. this.btnSlect.Click += btnSlect_Click;
  26. this.btnDelete.Click += btnDelete_Click;
  27. this.btnExport.Click += btnExport_Click;
  28. this.btnClose.Click += btnClose_Click;
  29. this.btnTexting.Click += btnTexting_Click;
  30. this.chkHs.Click += chkHs_Click;
  31. this.chkEt.Click += chkEt_Click;
  32. this.chkXz.Click += chkXz_Click;
  33. this.chkFw.Click += chkFw_Click;
  34. this.btnConditionQuery.Click += btnConditionQuery_Click;
  35. this.btnExcel.Click += btnExcel_Click;
  36. this.btnClientServiceAnPai.Click += btnClientServiceAnPai_Click;
  37. this.tabControlEx1.SelectedIndexChanged += tabControlEx1_SelectedIndexChanged;
  38. this.dgvData.CellDoubleClick += dgv_CellDoubleClick;
  39. this.cmbtreevClientStatusType.ComboBoxTree_NodeMouseClick += cmbtreevClientStatusType_ComboBoxTree_NodeMouseClick;
  40. this.Resize += Interestedbuyers_Resize;
  41. this.btnCommicRecord.Click += BtnCommicRecord_Click;
  42. this.chkWDKH.Click += ChkWDKH_Click;
  43. orbll.UpdateNullDataToLunar();
  44. }
  45. private void ChkWDKH_Click(object sender, EventArgs e)
  46. {
  47. PublicFunctionRows();
  48. }
  49. private void BtnCommicRecord_Click(object sender, EventArgs e)
  50. {
  51. if(dgvData.SelectedRows.Count>0)
  52. {
  53. if (dgvData.SelectedRows.Count == 0)
  54. {
  55. MessageBoxCustom.Show("请选择你要编辑的数据!");
  56. return;
  57. }
  58. LYFZ.Software.MainBusiness.Customers.OldCustomer.FrmAddInterestedBuyers frm = new FrmAddInterestedBuyers();
  59. frm.GMID = dgvData.CurrentRow.Cells["客户组编号"].Value.ToString().Trim();
  60. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  61. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  62. frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  63. frm.EditOnlyRead();
  64. if (frm.ShowDialog() == DialogResult.OK)
  65. {
  66. PublicFunctionRows();
  67. }
  68. }
  69. }
  70. /// <summary>
  71. /// 选择的项目
  72. /// </summary>
  73. public Hashtable htData = new Hashtable();
  74. List<LYFZ.Software.MainBusiness.EnumPermissions.BusinessType> Versions = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetBusinessTypeList();
  75. /// <summary>
  76. /// 窗体加载事件
  77. /// </summary>
  78. /// <param name="sender"></param>
  79. /// <param name="e"></param>
  80. void FrmOldCustomer_Shown( object sender, EventArgs e )
  81. {
  82. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrKeyCode: "qt002");
  83. this.chkEt.Visible = false;
  84. this.chkXz.Visible = false;
  85. this.chkHs.Visible = false;
  86. for ( int i = 0; i < Versions.Count; i++ )
  87. {
  88. LYFZ.Software.MainBusiness.EnumPermissions.BusinessType Version = Versions[i];
  89. if ( Version.ToString() == EnumPermissions.BusinessType.写真版.ToString() )
  90. {
  91. this.chkXz.Visible = true;
  92. }
  93. if ( Version.ToString() == EnumPermissions.BusinessType.婚纱版.ToString() )
  94. {
  95. this.chkHs.Visible = true;
  96. }
  97. if ( Version.ToString() == EnumPermissions.BusinessType.儿童版.ToString() )
  98. {
  99. this.chkEt.Visible = true;
  100. }
  101. }
  102. this.PublicFunctionRows();
  103. this.btnAdd.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Add );
  104. this.btnUpdate.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Update );
  105. this.btnDelete.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Delete );
  106. this.btnExport.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.DataExport );
  107. this.btnTexting.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.SMSSend );
  108. this.btnExcel.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, LYFZ.CustomAttributes.OperatingAuthority.DataImport );
  109. this.btnCommicRecord.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, LYFZ.CustomAttributes.OperatingAuthority.AddCommunicateRecord);
  110. this.lblText();
  111. this.GetOutflowType();
  112. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion( VersionControl.VersionFunctionEnum.客户管理意向客户 );
  113. if ( !b )
  114. {
  115. this.Close();
  116. }
  117. }
  118. string statisMsg = "";
  119. /// <summary>
  120. /// 设置 统计处的值
  121. /// </summary>
  122. void lblText()
  123. {
  124. try
  125. {
  126. DataTable dt = orbll.GetView_Custom( "select 客户组类型,客户状态 from view_InterestedBuyers" ).Tables[0];
  127. DataRow[] Genjin = dt.Select( "客户组类型 = 2 And 客户状态 = '意向'" );
  128. DataRow[] Chengjiao = dt.Select( "客户组类型 <> 2" );// ("客户状态 = '追回' or 客户状态 = '正常'");
  129. DataRow[] dtRow = dt.Select( "客户组类型 = 2 And 客户状态 = '流失'" );// ("客户状态 = '流失'");
  130. double percent = 0;
  131. if ( dt.Rows.Count != 0 )
  132. {
  133. percent = Convert.ToDouble( Chengjiao.Length ) / Convert.ToDouble( dt.Rows.Count );
  134. }
  135. statisMsg = "意向客户总人数:" + (Genjin.Length + Chengjiao.Length + dtRow.Length) + "人 跟进中意向客户人数:" + Genjin.Length + "人 意向客户成交人数:" + Chengjiao.Length + "人 流失:" + dtRow.Length + " 成交率:" + percent.ToString( "0%" );
  136. this.txtStatistics.Text = statisMsg + " (其中当前" + tabControlEx1.SelectedTab.Text + "人数:" + dgvData.Rows.Count+"人) ";
  137. }
  138. catch
  139. {
  140. }
  141. }
  142. /// <summary>
  143. /// 查询
  144. /// </summary>
  145. /// <param name="sender"></param>
  146. /// <param name="e"></param>
  147. void btnSlect_Click( object sender, EventArgs e )
  148. {
  149. PublicFunctionRows();
  150. }
  151. /// <summary>
  152. /// 条件查询
  153. /// </summary>
  154. /// <param name="sender"></param>
  155. /// <param name="e"></param>
  156. void btnConditionQuery_Click( object sender, EventArgs e )
  157. {
  158. LYFZ.Software.MainBusiness.Customers.SetSmallForm.ConditionQueryIntentClientSamllForm frm = new SetSmallForm.ConditionQueryIntentClientSamllForm();
  159. frm.ShowDialog();
  160. if ( frm.IsSaveed )
  161. {
  162. this.htData = frm.htData;
  163. this.PublicFunctionRows();
  164. }
  165. }
  166. /// <summary>
  167. /// 增加
  168. /// </summary>
  169. /// <param name="sender"></param>
  170. /// <param name="e"></param>
  171. void btnAdd_Click( object sender, EventArgs e )
  172. {
  173. FrmAddInterestedBuyers frm = new FrmAddInterestedBuyers();
  174. if ( frm.ShowDialog() == DialogResult.OK )
  175. {
  176. PublicFunctionRows();
  177. lblText();
  178. }
  179. }
  180. /// <summary>
  181. /// 修改
  182. /// </summary>
  183. /// <param name="sender"></param>
  184. /// <param name="e"></param>
  185. void dgv_CellDoubleClick( object sender, DataGridViewCellEventArgs e )
  186. {
  187. if ( e.RowIndex >= 0 && e.ColumnIndex >= 0 )
  188. {
  189. if ( this.dgvData.SelectedRows.Count > 0 )
  190. {
  191. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Update ) )
  192. {
  193. return;
  194. }
  195. this.btnUpdate_Click( this, null );
  196. }
  197. }
  198. }
  199. /// <summary>
  200. /// 修改按钮
  201. /// </summary>
  202. void btnUpdate_Click( object sender, EventArgs e )
  203. {
  204. if ( dgvData.SelectedRows.Count == 0 )
  205. {
  206. MessageBoxCustom.Show( "请选择你要编辑的数据!" );
  207. return;
  208. }
  209. LYFZ.Software.MainBusiness.Customers.OldCustomer.FrmAddInterestedBuyers frm = new FrmAddInterestedBuyers();
  210. frm.GMID = dgvData.CurrentRow.Cells["客户组编号"].Value.ToString().Trim();
  211. frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  212. frm.Location = new Point( LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y );
  213. frm.Size = new Size( LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height );
  214. if ( frm.ShowDialog() == DialogResult.OK )
  215. {
  216. PublicFunctionRows();
  217. }
  218. //LYFZ.Software.MainBusiness.Customers.OldCustomer.FrmAddInterestedBuyers frm = new FrmAddInterestedBuyers();
  219. //frm.GMID = dgv.CurrentRow.Cells["客户组编号"].Value.ToString().Trim();
  220. //if (frm.ShowDialog() == DialogResult.OK)
  221. //{ Bind(); }
  222. }
  223. /// <summary>
  224. /// 删除
  225. /// </summary>
  226. /// <param name="sender"></param>
  227. /// <param name="e"></param>
  228. void btnDelete_Click( object sender, EventArgs e )
  229. {
  230. try
  231. {
  232. if ( this.dgvData.SelectedRows.Count == 0 )
  233. {
  234. MessageBoxCustom.Show( "请选中你要删除的数据!" );
  235. return;
  236. }
  237. //批量删除 速度过慢
  238. if ( MessageBoxCustom.Show( "你确定要删除吗?", "删除提示", MessageBoxButtons.YesNo ) == DialogResult.Yes )
  239. {
  240. //批量删除 速度过慢
  241. List<Helper.CommandInfo> ctlist = new List<Helper.CommandInfo>();
  242. LYFZ.BLL.BLL_ErpCustomerGroup GPbll = new BLL.BLL_ErpCustomerGroup();
  243. LYFZ.BLL.BLL_ErpCustomerGroupMembers GMbll = new BLL.BLL_ErpCustomerGroupMembers();
  244. LYFZ.BLL.BLL_OldOrderHistory oohbll = new BLL.BLL_OldOrderHistory();
  245. List<string> datelist = new List<string>();
  246. List<string> namelist = new List<string>();
  247. foreach ( DataGridViewRow item in dgvData.SelectedRows )
  248. {
  249. ctlist.Add( GMbll.GetDeleteCommandInfo( whereStr: "GM_CustomerGroupID='" + item.Cells["客户组编号"].Value.ToString() + "' " ) );
  250. ctlist.Add( GPbll.GetDeleteCommandInfo( whereStr: "GP_CustomerGroupID='" + item.Cells["客户组编号"].Value.ToString() + "'" ) );
  251. ctlist.Add( oohbll.GetDeleteCommandInfo( whereStr: "History_ID='" + item.Cells["客户组编号"].Value.ToString() + "'" ) );
  252. datelist.Add( item.Cells["客户组编号"].Value.ToString() );
  253. namelist.Add( item.Cells["客户姓名"].Value.ToString() );
  254. }
  255. int DeleteCount = 0;
  256. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  257. {
  258. DeleteCount = LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( ctlist );
  259. if ( DeleteCount > 0 )
  260. {
  261. foreach ( string item in namelist )
  262. {
  263. //日志
  264. LYFZ.BLL.BLL_ErpSystemLogs.WriteSystemLog( LYFZ.EnumPublic.SystemLogsType.删除客户资料, "删除联系人资料:" + item + ",时间:" + SDateTime.Now, LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name );
  265. }
  266. foreach ( string item in datelist )
  267. {
  268. DAL_ErpCustomer.UpdateAggregationCustomer( item );
  269. }
  270. }
  271. } );
  272. if ( DeleteCount > 0 )
  273. {
  274. PublicFunctionRows();
  275. MessageBoxCustom.Show( "删除成功!" );
  276. }
  277. else
  278. {
  279. MessageBoxCustom.Show( "删除失败!" );
  280. }
  281. }
  282. }
  283. catch ( Exception ex )
  284. {
  285. MessageBoxCustom.Show( ex.Message );
  286. }
  287. }
  288. /// <summary>
  289. /// 安排客服
  290. /// </summary>
  291. /// <param name="sender"></param>
  292. /// <param name="e"></param>
  293. void btnClientServiceAnPai_Click( object sender, EventArgs e )
  294. {
  295. if ( this.dgvData.SelectedRows.Count > 0 )
  296. {
  297. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm();
  298. frm.ShowDialog();
  299. if ( frm.IsSaveed )
  300. {
  301. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ClientServiceAnPai( this.dgvData, LYFZ.EnumPublic.ClientServiceTaskType.意向跟踪, frm.model, LYFZ.EnumPublic.ClientServiceTaskItem.意向客户 );
  302. }
  303. }
  304. }
  305. /// <summary>
  306. /// 关闭
  307. /// </summary>
  308. /// <param name="sender"></param>
  309. /// <param name="e"></param>
  310. void btnClose_Click( object sender, EventArgs e )
  311. {
  312. this.Close();
  313. }
  314. /// <summary>
  315. /// 导出
  316. /// </summary>
  317. /// <param name="sender"></param>
  318. /// <param name="e"></param>
  319. void btnExport_Click( object sender, EventArgs e )
  320. {
  321. this.dgvData.ExportDataTable();
  322. }
  323. /// <summary>
  324. /// 发短信
  325. /// </summary>
  326. /// <param name="sender"></param>
  327. /// <param name="e"></param>
  328. void btnTexting_Click( object sender, EventArgs e )
  329. {
  330. string Cus_Telephone = "";
  331. string Sj1 = "";
  332. LYFZ.Software.MainBusiness.SMSManagement.SmsSend.FrmSendSms set = new SMSManagement.SmsSend.FrmSendSms();
  333. if ( dgvData.SelectedRows.Count == 0 )
  334. {
  335. MessageBoxCustom.Show( "选择你要发送短信的客户!" );
  336. return;
  337. }
  338. for ( int i = 0; i < dgvData.SelectedRows.Count; i++ )
  339. {
  340. Cus_Telephone = dgvData.SelectedRows[i].Cells["电话"].Value.ToString();
  341. //检查手机合法性
  342. string okPhones = "";
  343. LYFZ.WinAPI.CustomPublicMethod.ValidationPhones( Cus_Telephone.Replace( '/', ',' ), ref okPhones );
  344. if ( !string.IsNullOrEmpty( okPhones ) )
  345. {
  346. Sj1 += okPhones + ",";
  347. }
  348. }
  349. set.Phone = Sj1.Trim( ',' );
  350. set.ShowDialog();
  351. }
  352. /// <summary>
  353. /// 选项卡选择事件
  354. /// </summary>
  355. /// <param name="sender"></param>
  356. /// <param name="e"></param>
  357. void tabControlEx1_SelectedIndexChanged( object sender, EventArgs e )
  358. {
  359. if ( this.tabControlEx1.SelectedIndex == 1 )
  360. {
  361. this.btnClientServiceAnPai.Enabled = false;
  362. this.btnDelete.Enabled = false;
  363. this.lblClientStatusType.Visible = false;
  364. this.cmbtreevClientStatusType.Visible = false;
  365. }
  366. else if ( this.tabControlEx1.SelectedIndex == 2 )
  367. {
  368. this.btnClientServiceAnPai.Enabled = false;
  369. this.btnDelete.Enabled = false;
  370. this.lblClientStatusType.Visible = true;
  371. this.cmbtreevClientStatusType.Visible = true;
  372. }
  373. else
  374. {
  375. this.btnClientServiceAnPai.Enabled = true;
  376. this.btnDelete.Enabled = true;
  377. this.lblClientStatusType.Visible = false;
  378. this.cmbtreevClientStatusType.Visible = false;
  379. }
  380. this.PublicFunctionRows();
  381. }
  382. /// <summary>
  383. /// 把dgv放入所有选项卡
  384. /// </summary>
  385. /// <param name="pge">选项卡</param>
  386. void ShowDgvBulletinBoard( TabPage pge )
  387. {
  388. pge.Margin = new System.Windows.Forms.Padding( 0 );
  389. pge.Padding = new Padding( 0 );
  390. this.dgvData.Margin = new System.Windows.Forms.Padding( 0 );
  391. this.dgvData.Dock = DockStyle.Fill;
  392. this.dgvData.Location = new Point( 0, 0 );
  393. pge.Controls.Clear();
  394. pge.Controls.Add( this.dgvData );
  395. }
  396. /// <summary>
  397. /// 刷新dgv
  398. /// </summary>
  399. void PublicFunctionRows()
  400. {
  401. if ( dgvData.Rows.Count > 0 )
  402. {
  403. dgvData.Rows.Clear();
  404. }
  405. StringBuilder str = new StringBuilder();
  406. string keyword = this.txtkeyword.Text.Trim();
  407. #region 条件查询
  408. string StrShowColumnName = "";
  409. switch ( tabControlEx1.SelectedIndex )
  410. {
  411. case 0:
  412. StrShowColumnName = "客户组编号,客户编号,客户姓名,性别,生日,电话,区域,意向程度,意向类型,意向来源,客户来源,跟进人,录入时间,录入者";
  413. str.Append( " 客户组类型 = 2 And 客户状态 = '意向'" );
  414. if ( keyword.Trim() != "" )
  415. {
  416. str.Append( " and (客户姓名 like '%" + keyword.Trim() + "%' or 电话 like '%" + keyword.Trim() + "%' or 区域='" + keyword.Trim() + "')" );
  417. }
  418. if ( !LYFZ.BLL.BLL_ErpUser.GetRights( LYFZ.BLL.BLL_ErpUser.CurrentUserRights.IntentionCustomerCompetence, CustomAttributes.OperatingAuthority.Client_ShowAllIntentClient ) )
  419. {
  420. str.Append( " and Cus_CreateName = '" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID + "'" );
  421. }
  422. break;
  423. case 1:
  424. StrShowColumnName = "客户组编号,客户编号,订单号,客户姓名,性别,生日,电话,区域,意向程度,意向来源,客户来源,录入时间";
  425. str.Append( " 客户组类型 != 2 " );
  426. if ( keyword.Trim() != "" )
  427. {
  428. str.Append( " and (客户姓名 like '%" + keyword.Trim() + "%' or 电话 like '%" + keyword.Trim() + "%')" );
  429. }
  430. break;
  431. case 2:
  432. StrShowColumnName = "客户组编号,客户编号,客户姓名,性别,生日,电话,客户状态,流失类型,流失原因,区域,意向程度,意向类型,意向来源,客户来源,跟进人,录入时间";
  433. str.Append( " 客户组类型 = 2 And 客户状态 = '流失'" );
  434. if ( keyword.Trim() != "" )
  435. {
  436. str.Append( " and (客户姓名 like '%" + keyword.Trim() + "%' or 电话 like '%" + keyword.Trim() + "%')" );
  437. }
  438. if ( !string.IsNullOrEmpty( this.cmbtreevClientStatusType.Text.Trim() ) )
  439. {
  440. str.Append( " and 流失类型='" + this.cmbtreevClientStatusType.Text.Trim() + "' " );
  441. }
  442. break;
  443. }
  444. if ( chkEt.Checked )
  445. {
  446. str.Append( " and 意向类型='儿童意向'" );
  447. }
  448. else if ( chkFw.Checked )
  449. {
  450. str.Append( " and 意向类型='服务意向'" );
  451. }
  452. else if ( chkHs.Checked )
  453. {
  454. str.Append( " and 意向类型='婚纱意向'" );
  455. }
  456. else if ( chkXz.Checked )
  457. {
  458. str.Append( " and 意向类型='写真意向'" );
  459. }
  460. if(chkWDKH.Checked)
  461. {
  462. str.Append(" and User_Account='" + BLL.BLL_ErpUser.UsersModel.User_Account + "'");
  463. }
  464. if ( this.htData.Count > 0 )
  465. {
  466. if ( this.htData.ContainsKey( "PeopleFollow" ) )
  467. {
  468. str.Append( " and GP_BelongsPersonID = '" + this.htData["PeopleFollow"].ToString().Trim() + "'" );
  469. }
  470. if ( this.htData.ContainsKey( "CreatePerson" ) )
  471. {
  472. str.Append( " and Cus_CreateName = '" + this.htData["CreatePerson"].ToString().Trim() + "'" );
  473. }
  474. if ( this.htData.ContainsKey( "IntentSource" ) )
  475. {
  476. str.Append( " and 意向来源 = '" + this.htData["IntentSource"].ToString().Trim() + "'" );
  477. }
  478. if ( this.htData.ContainsKey( "IntentType" ) )
  479. {
  480. str.Append( " and 意向类型 = '" + this.htData["IntentType"].ToString().Trim() + "'" );
  481. }
  482. if ( this.htData.ContainsKey( "ClientRegion" ) )
  483. {
  484. str.Append( " and 区域 = '" + this.htData["ClientRegion"].ToString().Trim() + "'" );
  485. }
  486. if ( this.htData.ContainsKey( "IntentExtent" ) )
  487. {
  488. str.Append( " and 意向程度 = '" + this.htData["IntentExtent"].ToString().Trim() + "'" );
  489. }
  490. if ( this.htData.ContainsKey( "ClientSource" ) )
  491. {
  492. str.Append( " and 客户来源 = '" + this.htData["ClientSource"].ToString().Trim() + "'" );
  493. }
  494. if ( this.htData.ContainsKey( "DateTimeStart" ) && this.htData.ContainsKey( "DateTimeEnd" ) )
  495. {
  496. str.Append( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "录入时间", this.htData["DateTimeStart"].ToString().Trim(), this.htData["DateTimeEnd"].ToString().Trim() ) );
  497. }
  498. }
  499. //Ord_DividedShop
  500. if (!string.IsNullOrEmpty(Convert.ToString(cmbtreevStoreName.Tag)))
  501. {
  502. str.Append(" and GP_DividedShop = '" + cmbtreevStoreName.Tag + "'" );
  503. }
  504. //else
  505. //{
  506. // str.Append(" and ");
  507. // string treeWhere = "";
  508. // foreach (System.Windows.Forms.TreeNode treeNode in cmbtreevStoreName.TreeView.Nodes)
  509. // {
  510. // if (!string.IsNullOrEmpty(Convert.ToString((treeNode).Tag)))
  511. // {
  512. // if (treeWhere != "")
  513. // {
  514. // treeWhere += " or ";
  515. // }
  516. // treeWhere += " Ord_DividedShop = '" + (treeNode).Tag + "' ";
  517. // }
  518. // }
  519. // str.Append("(" + treeWhere + ")");
  520. //}
  521. this.htData.Clear();
  522. #endregion
  523. DataTable dt = new DataTable();
  524. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod( delegate ( object obj, BackgroundWorker backgroundWorker )
  525. {
  526. dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ClientManagementClientIntent( StrShowColumnName, str.ToString() );
  527. } );
  528. this.dgvData.DataSource( dt, strHideField: "客户组编号,客户编号" );
  529. this.txtStatistics.Text = statisMsg + " (其中当前" +tabControlEx1.SelectedTab.Text+"人数:"+ dt.Rows.Count +"人)";
  530. }
  531. /// <summary>
  532. /// 打开Excel 按钮
  533. /// </summary>
  534. void btnExcel_Click( object sender, EventArgs e )
  535. {
  536. ImportExcel excel = new ImportExcel();
  537. excel.Type = 2;
  538. if ( excel.ShowDialog() == DialogResult.OK )
  539. {
  540. PublicFunctionRows();
  541. }
  542. }
  543. /// <summary>
  544. /// 写真
  545. /// </summary>
  546. /// <param name="sender"></param>
  547. /// <param name="e"></param>
  548. void chkXz_Click( object sender, EventArgs e )
  549. {
  550. chkHs.Checked = false;
  551. chkEt.Checked = false;
  552. chkFw.Checked = false;
  553. PublicFunctionRows();
  554. }
  555. /// <summary>
  556. /// 儿童
  557. /// </summary>
  558. /// <param name="sender"></param>
  559. /// <param name="e"></param>
  560. void chkEt_Click( object sender, EventArgs e )
  561. {
  562. chkHs.Checked = false;
  563. chkFw.Checked = false;
  564. chkXz.Checked = false;
  565. PublicFunctionRows();
  566. }
  567. /// <summary>
  568. /// 婚纱
  569. /// </summary>
  570. /// <param name="sender"></param>
  571. /// <param name="e"></param>
  572. void chkHs_Click( object sender, EventArgs e )
  573. {
  574. chkEt.Checked = false;
  575. chkFw.Checked = false;
  576. chkXz.Checked = false;
  577. PublicFunctionRows();
  578. }
  579. /// <summary>
  580. /// 服务
  581. /// </summary>
  582. /// <param name="sender"></param>
  583. /// <param name="e"></param>
  584. void chkFw_Click( object sender, EventArgs e )
  585. {
  586. chkHs.Checked = false;
  587. chkEt.Checked = false;
  588. chkXz.Checked = false;
  589. PublicFunctionRows();
  590. }
  591. /// <summary>
  592. /// 获取流失类型
  593. /// </summary>
  594. void GetOutflowType()
  595. {
  596. DataTable dt = orbll.GetView_Custom( "tb_ErpCustomerGroup", StrWhere: "GP_LossType != ''", ShowColumnName: "GP_LossType", GroupBy: "GP_LossType" ).Tables[0];
  597. string StrText = "";
  598. for ( int i = 0; i < dt.Rows.Count; i++ )
  599. {
  600. StrText += dt.Rows[i]["GP_LossType"].ToString().Trim() + ",";
  601. }
  602. if ( StrText != "," )
  603. {
  604. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView( this.cmbtreevClientStatusType, StrText.TrimEnd( ',' ), IsFirstNodeNull: true );
  605. }
  606. }
  607. /// <summary>
  608. /// 选择流失类型
  609. /// </summary>
  610. /// <param name="sender"></param>
  611. /// <param name="e"></param>
  612. void cmbtreevClientStatusType_ComboBoxTree_NodeMouseClick( object sender, TreeNodeMouseClickEventArgs e )
  613. {
  614. this.PublicFunctionRows();
  615. }
  616. /// <summary>
  617. /// 窗体大小发生变化
  618. /// </summary>
  619. /// <param name="sender"></param>
  620. /// <param name="e"></param>
  621. void Interestedbuyers_Resize( object sender, EventArgs e )
  622. {
  623. switch ( this.panelFw.Location.Y )
  624. {
  625. case 2: this.flowLayoutPanel2.Height = 36; break;
  626. case 36: this.flowLayoutPanel2.Height = 68; break;
  627. }
  628. }
  629. private void InitializeComponent()
  630. {
  631. System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Interestedbuyers));
  632. this.plFormMainContent.SuspendLayout();
  633. this.SuspendLayout();
  634. //
  635. // tabControlEx1
  636. //
  637. this.tabControlEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(209)))), ((int)(((byte)(205)))), ((int)(((byte)(209)))));
  638. //
  639. // txtStatistics
  640. //
  641. this.txtStatistics.Lines = new string[0];
  642. //
  643. // txtkeyword
  644. //
  645. this.txtkeyword.Lines = new string[0];
  646. //
  647. // btnAppFormExit
  648. //
  649. this.btnAppFormExit.BackImg = null;
  650. //
  651. // btnAppFormMinimize
  652. //
  653. this.btnAppFormMinimize.BackImg = null;
  654. //
  655. // Interestedbuyers
  656. //
  657. this.BottomBgImage = ((System.Drawing.Bitmap)(resources.GetObject("$this.BottomBgImage")));
  658. this.ClientSize = new System.Drawing.Size(1757, 658);
  659. this.CustomBorderStyles.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(109)))), ((int)(((byte)(139)))));
  660. this.Name = "Interestedbuyers";
  661. this.TitleBgImage = ((System.Drawing.Bitmap)(resources.GetObject("$this.TitleBgImage")));
  662. this.Controls.SetChildIndex(this.btnAppFormMaximize, 0);
  663. this.Controls.SetChildIndex(this.btnAppFormExit, 0);
  664. this.Controls.SetChildIndex(this.btnAppFormMinimize, 0);
  665. this.Controls.SetChildIndex(this.btnAppFormMenu, 0);
  666. this.Controls.SetChildIndex(this.btnAppFormSkin, 0);
  667. this.Controls.SetChildIndex(this.plFormMainContent, 0);
  668. this.plFormMainContent.ResumeLayout(false);
  669. this.ResumeLayout(false);
  670. }
  671. }
  672. }