PhoneRecord.cpp 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. // PhoneRecord.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "PhoneRecord.h"
  6. #include "MyMdi.H"
  7. #include "SendMsgDlg.h"
  8. #include "AVIPlayerDlg.h"
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14. /////////////////////////////////////////////////////////////////////////////
  15. // PhoneRecord
  16. IMPLEMENT_DYNCREATE(PhoneRecord, MyFormView)
  17. PhoneRecord::PhoneRecord()
  18. : MyFormView(PhoneRecord::IDD)
  19. {
  20. //{{AFX_DATA_INIT(PhoneRecord)
  21. m_filter = _T("");
  22. //}}AFX_DATA_INIT
  23. bLoad1=bLoad2=bLoad3=bLoad4=bLoad5=0;
  24. }
  25. PhoneRecord::~PhoneRecord()
  26. {
  27. }
  28. void PhoneRecord::DoDataExchange(CDataExchange* pDX)
  29. {
  30. MyFormView::DoDataExchange(pDX);
  31. //{{AFX_DATA_MAP(PhoneRecord)
  32. DDX_Control(pDX, IDC_LIST8, m_List5);
  33. DDX_Control(pDX, IDC_LIST7, m_List4);
  34. DDX_Control(pDX, IDC_LIST6, m_List3);
  35. DDX_Control(pDX, IDC_LIST4, m_List2);
  36. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  37. DDX_Control(pDX, IDC_LIST2, m_List1);
  38. DDX_Control(pDX, IDC_STATIC1, m_static1);
  39. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  40. //}}AFX_DATA_MAP
  41. }
  42. BEGIN_MESSAGE_MAP(PhoneRecord, MyFormView)
  43. //{{AFX_MSG_MAP(PhoneRecord)
  44. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  45. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  46. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  47. ON_WM_TIMER()
  48. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  49. ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
  50. ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
  51. ON_BN_CLICKED(IDC_BUTTON10, OnButton10)
  52. ON_BN_CLICKED(IDC_BUTdel2, OnBUTdel2)
  53. ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
  54. //}}AFX_MSG_MAP
  55. END_MESSAGE_MAP()
  56. /////////////////////////////////////////////////////////////////////////////
  57. // PhoneRecord diagnostics
  58. #ifdef _DEBUG
  59. void PhoneRecord::AssertValid() const
  60. {
  61. MyFormView::AssertValid();
  62. }
  63. void PhoneRecord::Dump(CDumpContext& dc) const
  64. {
  65. MyFormView::Dump(dc);
  66. }
  67. #endif //_DEBUG
  68. /////////////////////////////////////////////////////////////////////////////
  69. // PhoneRecord message handlers
  70. void PhoneRecord::OnInitialUpdate()
  71. {
  72. MyFormView::OnInitialUpdate();
  73. // TODO: Add your specialized code here and/or call the base class
  74. GetDlgItem(IDC_BUTTON4)->EnableWindow(IsHasRights2new(49));
  75. CMyMdi Mdi;
  76. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  77. // Here we create the outbar control using the splitter as its parent
  78. // and setting its id to the first pane.
  79. CRect rc2;
  80. GetWindowRect(rc2);
  81. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  82. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
  83. int idarray[]={IDC_BUTdel2,IDC_BUTTON4,IDC_BUTclose};
  84. int idcount=3;
  85. int btnwid;
  86. CRect prerc;
  87. for(int a=idcount-2; a>=0; a--)
  88. {
  89. GetDlgItem(idarray[a+1])->GetWindowRect (prerc);
  90. ScreenToClient(prerc);
  91. GetDlgItem(idarray[a])->GetWindowRect (rc2);
  92. ScreenToClient(rc2);
  93. btnwid=rc2.Width ();
  94. rc2.right =prerc.left ;
  95. rc2.left =rc2.right -btnwid;
  96. GetDlgItem(idarray[a])->MoveWindow (rc2);
  97. }
  98. {
  99. int idarray[]={IDC_BUTTON1,IDC_BUTTON6,IDC_BUTTON2,IDC_BUTTON3,IDC_BUTTON10};
  100. int idcount=5;
  101. int btnwid;
  102. CRect prerc;
  103. for(int a=1; a<idcount; a++)
  104. {
  105. GetDlgItem(idarray[a-1])->GetWindowRect (prerc);
  106. ScreenToClient(prerc);
  107. GetDlgItem(idarray[a])->GetWindowRect (rc2);
  108. ScreenToClient(rc2);
  109. btnwid=rc2.Width ();
  110. rc2.left =prerc.right ;
  111. rc2.right =rc2.left +btnwid;
  112. GetDlgItem(idarray[a])->MoveWindow (rc2);
  113. }
  114. }
  115. m_static1.SetFont (&g_titlefont);
  116. #ifdef CHILD_VERSION
  117. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;手机,100;固定电话,100;来电号码,100;来电时间,150" );
  118. #else
  119. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;男宾电话,100;女宾电话,100;来电号码,100;来电时间,150" );
  120. #endif
  121. m_List1.LoadColumnInfo (151);
  122. m_List2.SetHeadings("客人姓名,150;性别,100;电话,150;来电时间,200" );
  123. m_List2.LoadColumnInfo (152);
  124. m_List3.SetHeadings("员工姓名,150;电话,100;来电时间,200" );
  125. m_List3.LoadColumnInfo (153);
  126. m_List4.SetHeadings("电话,200;来电时间,200" );
  127. m_List4.LoadColumnInfo (154);
  128. m_List5.SetHeadings("客人姓名,150;电话,100;来电时间,200" );
  129. m_List5.LoadColumnInfo (153);
  130. m_combo1.GetWindowRect (rc2);
  131. ScreenToClient(rc2);
  132. rc2.bottom +=200;
  133. m_combo1.MoveWindow (rc2);
  134. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  135. SetComboHei(&m_combo1, rc2.Height ());
  136. OnButton1();
  137. }
  138. void PhoneRecord::OnBUTclose()
  139. {
  140. // TODO: Add your control notification handler code here
  141. GetParent()->SendMessage(WM_CLOSE);
  142. }
  143. void PhoneRecord::OnSelchangeCombo1()
  144. {
  145. // TODO: Add your control notification handler code here
  146. SetTimer(1, 100, NULL);
  147. }
  148. void PhoneRecord::OnTimer(UINT nIDEvent)
  149. {
  150. // TODO: Add your message handler code here and/or call default
  151. KillTimer(nIDEvent);
  152. // OnButton1();
  153. }
  154. BOOL PhoneRecord::PreTranslateMessage(MSG* pMsg)
  155. {
  156. // TODO: Add your specialized code here and/or call the base class
  157. try
  158. {
  159. if(pMsg->message==WM_KEYDOWN)
  160. {
  161. switch (pMsg->wParam)
  162. {
  163. case VK_RETURN:
  164. OnButton1();
  165. return 1;
  166. case 0x43: // copy
  167. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  168. {
  169. GetFocus()->SendMessage(WM_COPY);
  170. return TRUE;
  171. }
  172. break;
  173. case 0x56: //Ctrl + V:
  174. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  175. {
  176. GetFocus()->SendMessage(WM_PASTE);
  177. return TRUE;
  178. }
  179. break;
  180. case 0x58: // cut
  181. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  182. {
  183. GetFocus()->SendMessage(WM_CUT);
  184. return TRUE;
  185. }
  186. break;
  187. case 0x5A: //undo
  188. case 0x59: //redo
  189. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  190. {
  191. GetFocus()->SendMessage(WM_UNDO);
  192. return TRUE;
  193. }
  194. break;
  195. }
  196. }
  197. return MyFormView::PreTranslateMessage(pMsg);
  198. }
  199. catch(...)
  200. {
  201. }
  202. }
  203. void PhoneRecord::OnButton1()
  204. {
  205. // TODO: Add your control notification handler code here
  206. UpdateData();
  207. m_filter.TrimLeft ();
  208. m_filter.TrimRight ();
  209. if(!bLoad1)
  210. {
  211. bLoad1=1;
  212. g_sendhead.bsql=0;
  213. g_sendhead.code[0]=109;
  214. g_sendhead.tabcount=1;
  215. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  216. DataToArray(&m_List1array);
  217. }
  218. FillGrid();
  219. }
  220. void PhoneRecord::OnButton2()
  221. {
  222. // TODO: Add your control notification handler code here
  223. UpdateData();
  224. m_filter.TrimLeft ();
  225. m_filter.TrimRight ();
  226. if(!bLoad2)
  227. {bLoad2=1;
  228. g_sendhead.bsql=0;
  229. g_sendhead.code[0]=110;
  230. g_sendhead.tabcount=1;
  231. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  232. DataToArray(&m_List2array);
  233. }
  234. FillGrid2();
  235. }
  236. void PhoneRecord::OnButton3()
  237. {
  238. // TODO: Add your control notification handler code here
  239. UpdateData();
  240. m_filter.TrimLeft ();
  241. m_filter.TrimRight ();
  242. if(!bLoad3)
  243. {bLoad3=1;
  244. g_sendhead.bsql=0;
  245. g_sendhead.code[0]=111;
  246. g_sendhead.tabcount=1;
  247. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  248. DataToArray(&m_List3array);
  249. }
  250. FillGrid3();
  251. }
  252. void PhoneRecord::OnButton10()
  253. {
  254. // TODO: Add your control notification handler code here
  255. UpdateData();
  256. if(!bLoad4)
  257. {bLoad4=1;
  258. g_sendhead.bsql=0;
  259. g_sendhead.code[0]=112;
  260. g_sendhead.tabcount=1;
  261. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  262. DataToArray(&m_List4array);
  263. }
  264. FillGrid4();
  265. }
  266. void PhoneRecord::FillGrid(int mode)
  267. {
  268. m_List1.ShowWindow (SW_SHOW);
  269. m_List2.ShowWindow (SW_HIDE);
  270. m_List3.ShowWindow (SW_HIDE);
  271. m_List4.ShowWindow (SW_HIDE);
  272. m_List5.ShowWindow (SW_HIDE);
  273. m_List1.DeleteAllItems2 ();
  274. int ii=0;
  275. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  276. int count=0;
  277. if(m_filter.IsEmpty ())
  278. {
  279. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  280. {
  281. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  282. }
  283. }
  284. else
  285. {
  286. int type=GetType(m_filter);
  287. if(type==1)//电话
  288. {BOOL bFinded=0;
  289. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  290. {
  291. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  292. {
  293. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  294. continue;
  295. }
  296. if(m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1\
  297. || m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 )
  298. {
  299. bFinded=1;
  300. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  301. }
  302. else
  303. {
  304. bFinded=0;
  305. }
  306. }
  307. }
  308. else if(type==2)//拼音
  309. {BOOL bFinded=0;
  310. m_filter.MakeUpper ();
  311. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  312. {
  313. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  314. {
  315. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  316. continue;
  317. }
  318. if(m_List1array.ElementAt (ii).ElementAt (7).Find (m_filter)!=-1\
  319. || m_List1array.ElementAt (ii).ElementAt (8).Find (m_filter)!=-1 )
  320. {
  321. bFinded=1;
  322. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  323. }
  324. else
  325. {
  326. bFinded=0;
  327. }
  328. }
  329. }
  330. else
  331. {
  332. BOOL bFinded=0;
  333. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  334. {
  335. if(bFinded && m_List1array.ElementAt (ii).ElementAt (0).IsEmpty ())
  336. {
  337. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  338. continue;
  339. }
  340. if(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1\
  341. || m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1\
  342. || m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1\
  343. || m_List1array.ElementAt (ii).ElementAt (6).Find (m_filter)!=-1 )
  344. {
  345. bFinded=1;
  346. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  347. }
  348. else
  349. {
  350. bFinded=0;
  351. }
  352. }
  353. }
  354. }
  355. m_List1.m_arLabels.SetSize(count, 1);
  356. ii=count;
  357. m_List1.m_LabelCount=ii;
  358. m_List1.SetItemCountEx (ii);
  359. }
  360. void PhoneRecord::FillGrid2()
  361. {
  362. m_List2.ShowWindow (SW_SHOW);
  363. m_List1.ShowWindow (SW_HIDE);
  364. m_List3.ShowWindow (SW_HIDE);
  365. m_List4.ShowWindow (SW_HIDE);
  366. m_List5.ShowWindow (SW_HIDE);
  367. m_List2.DeleteAllItems2 ();
  368. int ii=0;
  369. m_List2.m_arLabels.SetSize( m_List2array.GetSize (), 1 );
  370. int count=0;
  371. if(m_filter.IsEmpty ())
  372. {
  373. for(ii=0; ii<m_List2.m_arLabels.GetSize (); ii++)
  374. {
  375. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  376. }
  377. }
  378. else
  379. {
  380. int type=GetType(m_filter);
  381. if(type==1)//电话
  382. {BOOL bFinded=0;
  383. for(ii=0; ii<m_List2.m_arLabels.GetSize (); ii++)
  384. {
  385. if(bFinded && m_List2array.ElementAt (ii).ElementAt (0).IsEmpty ())
  386. {
  387. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  388. continue;
  389. }
  390. if(m_List2array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 )
  391. {
  392. bFinded=1;
  393. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  394. }
  395. else
  396. {
  397. bFinded=0;
  398. }
  399. }
  400. }
  401. else if(type==2)//拼音
  402. {BOOL bFinded=0;
  403. m_filter.MakeUpper ();
  404. for(ii=0; ii<m_List2.m_arLabels.GetSize (); ii++)
  405. {
  406. if(bFinded && m_List2array.ElementAt (ii).ElementAt (0).IsEmpty ())
  407. {
  408. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  409. continue;
  410. }
  411. if(m_List2array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 )
  412. {
  413. bFinded=1;
  414. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  415. }
  416. else
  417. {
  418. bFinded=0;
  419. }
  420. }
  421. }
  422. else
  423. {
  424. BOOL bFinded=0;
  425. for(ii=0; ii<m_List2.m_arLabels.GetSize (); ii++)
  426. {
  427. if(bFinded && m_List2array.ElementAt (ii).ElementAt (0).IsEmpty ())
  428. {
  429. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  430. continue;
  431. }
  432. if(m_List2array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||m_List2array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || m_List2array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || m_List2array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1)
  433. {
  434. bFinded=1;
  435. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  436. }
  437. else
  438. {
  439. bFinded=0;
  440. }
  441. }
  442. }
  443. }
  444. m_List2.m_arLabels.SetSize(count, 1);
  445. ii=count;
  446. m_List2.m_LabelCount=ii;
  447. m_List2.SetItemCountEx (ii);
  448. }
  449. void PhoneRecord::FillGrid3()
  450. {
  451. m_List3.ShowWindow (SW_SHOW);
  452. m_List1.ShowWindow (SW_HIDE);
  453. m_List2.ShowWindow (SW_HIDE);
  454. m_List4.ShowWindow (SW_HIDE);
  455. m_List5.ShowWindow (SW_HIDE);
  456. m_List3.DeleteAllItems2 ();
  457. int ii=0;
  458. m_List3.m_arLabels.SetSize( m_List3array.GetSize (), 1 );
  459. int count=0;
  460. if(m_filter.IsEmpty ())
  461. {
  462. for(ii=0; ii<m_List3.m_arLabels.GetSize (); ii++)
  463. {
  464. m_List3.m_arLabels.ElementAt (count++).Copy (m_List3array.ElementAt (ii));
  465. }
  466. }
  467. else
  468. {
  469. int type=GetType(m_filter);
  470. if(type==1)//电话
  471. {BOOL bFinded=0;
  472. for(ii=0; ii<m_List3.m_arLabels.GetSize (); ii++)
  473. {
  474. if(bFinded && m_List3array.ElementAt (ii).ElementAt (0).IsEmpty ())
  475. {
  476. m_List3.m_arLabels.ElementAt (count++).Copy (m_List3array.ElementAt (ii));
  477. continue;
  478. }
  479. if(m_List3array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 )
  480. {
  481. bFinded=1;
  482. m_List3.m_arLabels.ElementAt (count++).Copy (m_List3array.ElementAt (ii));
  483. }
  484. else
  485. {
  486. bFinded=0;
  487. }
  488. }
  489. }
  490. else
  491. {
  492. BOOL bFinded=0;
  493. for(ii=0; ii<m_List3.m_arLabels.GetSize (); ii++)
  494. {
  495. if(bFinded && m_List3array.ElementAt (ii).ElementAt (0).IsEmpty ())
  496. {
  497. m_List3.m_arLabels.ElementAt (count++).Copy (m_List3array.ElementAt (ii));
  498. continue;
  499. }
  500. if(m_List3array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||m_List3array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || m_List3array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1)
  501. {
  502. bFinded=1;
  503. m_List3.m_arLabels.ElementAt (count++).Copy (m_List3array.ElementAt (ii));
  504. }
  505. else
  506. {
  507. bFinded=0;
  508. }
  509. }
  510. }
  511. }
  512. m_List3.m_arLabels.SetSize(count, 1);
  513. ii=count;
  514. m_List3.m_LabelCount=ii;
  515. m_List3.SetItemCountEx (ii);
  516. }
  517. void PhoneRecord::FillGrid4()
  518. {
  519. m_List4.ShowWindow (SW_SHOW);
  520. m_List1.ShowWindow (SW_HIDE);
  521. m_List2.ShowWindow (SW_HIDE);
  522. m_List3.ShowWindow (SW_HIDE);
  523. m_List5.ShowWindow (SW_HIDE);
  524. m_List4.DeleteAllItems2 ();
  525. int ii=0;
  526. m_List4.m_arLabels.SetSize( m_List4array.GetSize (), 1 );
  527. int count=0;
  528. if(m_filter.IsEmpty ())
  529. {
  530. for(ii=0; ii<m_List4.m_arLabels.GetSize (); ii++)
  531. {
  532. m_List4.m_arLabels.ElementAt (count++).Copy (m_List4array.ElementAt (ii));
  533. }
  534. }
  535. else
  536. {
  537. for(ii=0; ii<m_List4.m_arLabels.GetSize (); ii++)
  538. {
  539. if(m_List4array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  540. m_List4array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1)
  541. {
  542. m_List4.m_arLabels.ElementAt (count++).Copy (m_List4array.ElementAt (ii));
  543. }
  544. }
  545. }
  546. m_List4.m_arLabels.SetSize(count, 1);
  547. ii=count;
  548. m_List4.m_LabelCount=ii;
  549. m_List4.SetItemCountEx (ii);
  550. }
  551. void PhoneRecord::OnButton4()
  552. {
  553. // TODO: Add your control notification handler code here
  554. if(m_List1.IsWindowVisible ())
  555. {
  556. POSITION pos;
  557. pos=m_List1.GetFirstSelectedItemPosition();
  558. if(pos==NULL)
  559. {
  560. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  561. return;
  562. }
  563. int iItem=m_List1.GetNextSelectedItem(pos);
  564. CString id=m_List1.GetItemText (iItem, 0);
  565. CString datetime=m_List1.GetItemText (iItem, 6);
  566. datetime.Replace (":", "");
  567. CString path=g_path6+"\\客户电话\\"+id+"\\"+datetime+".mp3";
  568. if(::PathFileExists (path)==0)
  569. path=g_path6+"\\客户电话\\"+id+"\\"+datetime+".wav";
  570. if(::CheckFileExist (path))
  571. {
  572. CAVIPlayerDlg dlg;
  573. dlg.m_Path =path;
  574. dlg.DoModal ();
  575. }
  576. else
  577. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  578. }
  579. if(m_List2.IsWindowVisible ())
  580. {
  581. POSITION pos;
  582. pos=m_List2.GetFirstSelectedItemPosition();
  583. if(pos==NULL)
  584. {
  585. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  586. return;
  587. }
  588. int iItem=m_List2.GetNextSelectedItem(pos);
  589. CString phone=m_List2.GetItemText (iItem, 2);
  590. CString datetime=m_List2.GetItemText (iItem, 3);
  591. datetime.Replace (":", "");
  592. CString path=g_path6+"\\意向客户\\"+phone+"\\"+datetime+".mp3";
  593. if(::CheckFileExist (path)==0)
  594. path=g_path6+"\\意向客户\\"+phone+"\\"+datetime+".wav";
  595. if(::CheckFileExist (path))
  596. {
  597. CAVIPlayerDlg dlg;
  598. dlg.m_Path =path;
  599. dlg.DoModal ();
  600. }
  601. else
  602. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  603. }
  604. if(m_List3.IsWindowVisible ())
  605. {
  606. POSITION pos;
  607. pos=m_List3.GetFirstSelectedItemPosition();
  608. if(pos==NULL)
  609. {
  610. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  611. return;
  612. }
  613. int iItem=m_List3.GetNextSelectedItem(pos);
  614. CString name=m_List3.GetItemText (iItem, 0);
  615. CString datetime=m_List3.GetItemText (iItem, 2);
  616. datetime.Replace (":", "");
  617. CString path=g_path6+"\\员工电话\\"+name+"\\"+datetime+".mp3";
  618. if(::CheckFileExist (path)==0)
  619. path=g_path6+"\\员工电话\\"+name+"\\"+datetime+".wav";
  620. if(::CheckFileExist (path))
  621. {
  622. CAVIPlayerDlg dlg;
  623. dlg.m_Path =path;
  624. dlg.DoModal ();
  625. }
  626. else
  627. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  628. }
  629. if(m_List4.IsWindowVisible ())
  630. {
  631. POSITION pos;
  632. pos=m_List4.GetFirstSelectedItemPosition();
  633. if(pos==NULL)
  634. {
  635. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  636. return;
  637. }
  638. int iItem=m_List4.GetNextSelectedItem(pos);
  639. CString phone=m_List4.GetItemText (iItem, 0);
  640. CString datetime=m_List4.GetItemText (iItem, 1);
  641. datetime.Replace (":", "");
  642. CString path=g_path6+"\\未知电话\\"+phone+"\\"+datetime+".mp3";
  643. if(::CheckFileExist (path)==0)
  644. path=g_path6+"\\未知电话\\"+phone+"\\"+datetime+".wav";
  645. if(::CheckFileExist (path))
  646. {
  647. CAVIPlayerDlg dlg;
  648. dlg.m_Path =path;
  649. dlg.DoModal ();
  650. }
  651. else
  652. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  653. }
  654. if(m_List5.IsWindowVisible ())
  655. {
  656. POSITION pos;
  657. pos=m_List5.GetFirstSelectedItemPosition();
  658. if(pos==NULL)
  659. {
  660. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  661. return;
  662. }
  663. int iItem=m_List5.GetNextSelectedItem(pos);
  664. CString phone=m_List5.GetItemText (iItem, 1);
  665. CString datetime=m_List5.GetItemText (iItem, 2);
  666. datetime.Replace (":", "");
  667. CString path=g_path6+"\\老客户\\"+phone+"\\"+datetime+".mp3";
  668. if(::CheckFileExist (path)==0)
  669. path=g_path6+"\\老客户\\"+phone+"\\"+datetime+".wav";
  670. if(::CheckFileExist (path))
  671. {
  672. CAVIPlayerDlg dlg;
  673. dlg.m_Path =path;
  674. dlg.DoModal ();
  675. }
  676. else
  677. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  678. }
  679. }
  680. void PhoneRecord::OnBUTdel2()
  681. {
  682. // TODO: Add your control notification handler code here
  683. if(IsHasRights2new(49)==0)return;
  684. // TODO: Add your control notification handler code here
  685. if(m_List1.IsWindowVisible ())
  686. {
  687. POSITION pos;
  688. pos=m_List1.GetFirstSelectedItemPosition();
  689. if(pos==NULL)
  690. {
  691. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  692. return;
  693. }
  694. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  695. int iItem=m_List1.GetNextSelectedItem(pos);
  696. CString datetime=m_List1.GetItemText (iItem, 6);
  697. CString id=m_List1.GetItemText (iItem, 0);
  698. CString sql;
  699. sql.Format ("delete from phonerecord where datetime='%s' ", datetime);
  700. g_sendhead.bsql=1;
  701. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  702. datetime.Replace (":", "");
  703. CString path=g_path6+"\\客户电话\\"+id+"\\"+datetime+".mp3";
  704. ::DeleteFile (path);
  705. path=g_path6+"\\客户电话\\"+id+"\\"+datetime+".wav";
  706. ::DeleteFile (path);
  707. bLoad1=0;
  708. OnButton1();
  709. }
  710. if(m_List2.IsWindowVisible ())
  711. {
  712. POSITION pos;
  713. pos=m_List2.GetFirstSelectedItemPosition();
  714. if(pos==NULL)
  715. {
  716. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  717. return;
  718. }
  719. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  720. int iItem=m_List2.GetNextSelectedItem(pos);
  721. CString datetime=m_List2.GetItemText (iItem, 3);
  722. CString phone=m_List2.GetItemText (iItem, 2);
  723. CString sql;
  724. sql.Format ("delete from client2phonerecord where datetime='%s' ", datetime);
  725. g_sendhead.bsql=1;
  726. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  727. datetime.Replace (":", "");
  728. CString path=g_path6+"\\意向客户\\"+phone+"\\"+datetime+".mp3";
  729. ::DeleteFile (path);
  730. path=g_path6+"\\意向客户\\"+phone+"\\"+datetime+".wav";
  731. ::DeleteFile (path);
  732. bLoad2=0;
  733. OnButton2();
  734. }
  735. if(m_List3.IsWindowVisible ())
  736. {
  737. POSITION pos;
  738. pos=m_List3.GetFirstSelectedItemPosition();
  739. if(pos==NULL)
  740. {
  741. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  742. return;
  743. }
  744. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  745. int iItem=m_List3.GetNextSelectedItem(pos);
  746. CString datetime=m_List3.GetItemText (iItem, 2);
  747. CString name=m_List3.GetItemText (iItem, 0);
  748. CString sql;
  749. sql.Format ("delete from employeephonerecord where datetime='%s' ", datetime);
  750. g_sendhead.bsql=1;
  751. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  752. datetime.Replace (":", "");
  753. CString path=g_path6+"\\员工电话\\"+name+"\\"+datetime+".mp3";
  754. ::DeleteFile (path);
  755. path=g_path6+"\\员工电话\\"+name+"\\"+datetime+".wav";
  756. ::DeleteFile (path);
  757. bLoad3=0;
  758. OnButton3();
  759. }
  760. if(m_List4.IsWindowVisible ())
  761. {
  762. POSITION pos;
  763. pos=m_List4.GetFirstSelectedItemPosition();
  764. if(pos==NULL)
  765. {
  766. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  767. return;
  768. }
  769. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  770. int iItem=m_List4.GetNextSelectedItem(pos);
  771. CString datetime=m_List4.GetItemText (iItem, 1);
  772. CString phone=m_List4.GetItemText (iItem, 0);
  773. CString sql;
  774. sql.Format ("delete from unknownphonerecord where datetime='%s' ", datetime);
  775. g_sendhead.bsql=1;
  776. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  777. datetime.Replace (":", "");
  778. CString path=g_path6+"\\未知电话\\"+phone+"\\"+datetime+".mp3";
  779. ::DeleteFile (path);
  780. path=g_path6+"\\未知电话\\"+phone+"\\"+datetime+".wav";
  781. ::DeleteFile (path);
  782. bLoad4=0;
  783. OnButton10();
  784. }
  785. if(m_List5.IsWindowVisible ())
  786. {
  787. POSITION pos;
  788. pos=m_List5.GetFirstSelectedItemPosition();
  789. if(pos==NULL)
  790. {
  791. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  792. return;
  793. }
  794. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  795. int iItem=m_List5.GetNextSelectedItem(pos);
  796. CString datetime=m_List5.GetItemText (iItem, 2);
  797. CString phone=m_List5.GetItemText (iItem, 1);
  798. CString sql;
  799. sql.Format ("delete from client3phonerecord where datetime='%s' ", datetime);
  800. g_sendhead.bsql=1;
  801. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  802. datetime.Replace (":", "");
  803. CString path=g_path6+"\\老客户\\"+phone+"\\"+datetime+".mp3";
  804. ::DeleteFile (path);
  805. path=g_path6+"\\老客户\\"+phone+"\\"+datetime+".wav";
  806. ::DeleteFile (path);
  807. bLoad5=0;
  808. OnButton6();
  809. }
  810. }
  811. void PhoneRecord::OnButton6()
  812. {
  813. // TODO: Add your control notification handler code here
  814. UpdateData();
  815. m_filter.TrimLeft ();
  816. m_filter.TrimRight ();
  817. if(!bLoad5)
  818. {bLoad5=1;
  819. g_sendhead.bsql=0;
  820. g_sendhead.code[0]=175;
  821. g_sendhead.tabcount=1;
  822. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  823. DataToArray(&m_List5array);
  824. }
  825. FillGrid5();
  826. }
  827. void PhoneRecord::FillGrid5()
  828. {
  829. m_List5.ShowWindow (SW_SHOW);
  830. m_List1.ShowWindow (SW_HIDE);
  831. m_List2.ShowWindow (SW_HIDE);
  832. m_List4.ShowWindow (SW_HIDE);
  833. m_List3.ShowWindow (SW_HIDE);
  834. m_List5.DeleteAllItems2 ();
  835. int ii=0;
  836. m_List5.m_arLabels.SetSize( m_List5array.GetSize (), 1 );
  837. int count=0;
  838. if(m_filter.IsEmpty ())
  839. {
  840. for(ii=0; ii<m_List5.m_arLabels.GetSize (); ii++)
  841. {
  842. m_List5.m_arLabels.ElementAt (count++).Copy (m_List5array.ElementAt (ii));
  843. }
  844. }
  845. else
  846. {
  847. int type=GetType(m_filter);
  848. if(type==1)//电话
  849. {BOOL bFinded=0;
  850. for(ii=0; ii<m_List5.m_arLabels.GetSize (); ii++)
  851. {
  852. if(bFinded && m_List5array.ElementAt (ii).ElementAt (0).IsEmpty ())
  853. {
  854. m_List5.m_arLabels.ElementAt (count++).Copy (m_List5array.ElementAt (ii));
  855. continue;
  856. }
  857. if(m_List5array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 )
  858. {
  859. bFinded=1;
  860. m_List5.m_arLabels.ElementAt (count++).Copy (m_List5array.ElementAt (ii));
  861. }
  862. else
  863. {
  864. bFinded=0;
  865. }
  866. }
  867. }
  868. else
  869. {
  870. BOOL bFinded=0;
  871. for(ii=0; ii<m_List5.m_arLabels.GetSize (); ii++)
  872. {
  873. if(bFinded && m_List5array.ElementAt (ii).ElementAt (0).IsEmpty ())
  874. {
  875. m_List5.m_arLabels.ElementAt (count++).Copy (m_List5array.ElementAt (ii));
  876. continue;
  877. }
  878. if(m_List5array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||m_List5array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || m_List5array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1)
  879. {
  880. bFinded=1;
  881. m_List5.m_arLabels.ElementAt (count++).Copy (m_List5array.ElementAt (ii));
  882. }
  883. else
  884. {
  885. bFinded=0;
  886. }
  887. }
  888. }
  889. }
  890. m_List5.m_arLabels.SetSize(count, 1);
  891. ii=count;
  892. m_List5.m_LabelCount=ii;
  893. m_List5.SetItemCountEx (ii);
  894. }