PhoneRecordOut.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. // PhoneRecordOut.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "PhoneRecordOut.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. // PhoneRecordOut
  16. IMPLEMENT_DYNCREATE(PhoneRecordOut, MyFormView)
  17. PhoneRecordOut::PhoneRecordOut()
  18. : MyFormView(PhoneRecordOut::IDD)
  19. {
  20. //{{AFX_DATA_INIT(PhoneRecordOut)
  21. m_filter = _T("");
  22. //}}AFX_DATA_INIT
  23. bLoad1=bLoad2=bLoad3=bLoad4=0;
  24. }
  25. PhoneRecordOut::~PhoneRecordOut()
  26. {
  27. }
  28. void PhoneRecordOut::DoDataExchange(CDataExchange* pDX)
  29. {
  30. MyFormView::DoDataExchange(pDX);
  31. //{{AFX_DATA_MAP(PhoneRecordOut)
  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(PhoneRecordOut, MyFormView)
  43. //{{AFX_MSG_MAP(PhoneRecordOut)
  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. // PhoneRecordOut diagnostics
  58. #ifdef _DEBUG
  59. void PhoneRecordOut::AssertValid() const
  60. {
  61. MyFormView::AssertValid();
  62. }
  63. void PhoneRecordOut::Dump(CDumpContext& dc) const
  64. {
  65. MyFormView::Dump(dc);
  66. }
  67. #endif //_DEBUG
  68. /////////////////////////////////////////////////////////////////////////////
  69. // PhoneRecordOut message handlers
  70. void PhoneRecordOut::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. m_List1.SetHeadings("客人姓名,200;电话号码,200;拨出时间,200" );
  117. m_List1.LoadColumnInfo (155);
  118. m_List2.SetHeadings("客人姓名,200;电话号码,200;拨出时间,200" );
  119. m_List2.LoadColumnInfo (156);
  120. m_List3.SetHeadings("员工姓名,200;电话号码,200;拨出时间,200" );
  121. m_List3.LoadColumnInfo (157);
  122. m_List4.SetHeadings("电话号码,200;拨出时间,200" );
  123. m_List4.LoadColumnInfo (158);
  124. m_List5.SetHeadings("客人姓名,200;电话号码,200;拨出时间,200" );
  125. m_List5.LoadColumnInfo (156);
  126. m_combo1.GetWindowRect (rc2);
  127. ScreenToClient(rc2);
  128. rc2.bottom +=200;
  129. m_combo1.MoveWindow (rc2);
  130. GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
  131. SetComboHei(&m_combo1, rc2.Height ());
  132. OnButton1();
  133. }
  134. void PhoneRecordOut::OnBUTclose()
  135. {
  136. // TODO: Add your control notification handler code here
  137. GetParent()->SendMessage(WM_CLOSE);
  138. }
  139. void PhoneRecordOut::OnSelchangeCombo1()
  140. {
  141. // TODO: Add your control notification handler code here
  142. SetTimer(1, 100, NULL);
  143. }
  144. void PhoneRecordOut::OnTimer(UINT nIDEvent)
  145. {
  146. // TODO: Add your message handler code here and/or call default
  147. KillTimer(nIDEvent);
  148. // OnButton1();
  149. }
  150. BOOL PhoneRecordOut::PreTranslateMessage(MSG* pMsg)
  151. {
  152. // TODO: Add your specialized code here and/or call the base class
  153. try
  154. {
  155. if(pMsg->message==WM_KEYDOWN)
  156. {
  157. switch (pMsg->wParam)
  158. {
  159. case VK_RETURN:
  160. OnButton1();
  161. return 1;
  162. case 0x43: // copy
  163. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  164. {
  165. GetFocus()->SendMessage(WM_COPY);
  166. return TRUE;
  167. }
  168. break;
  169. case 0x56: //Ctrl + V:
  170. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  171. {
  172. GetFocus()->SendMessage(WM_PASTE);
  173. return TRUE;
  174. }
  175. break;
  176. case 0x58: // cut
  177. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  178. {
  179. GetFocus()->SendMessage(WM_CUT);
  180. return TRUE;
  181. }
  182. break;
  183. case 0x5A: //undo
  184. case 0x59: //redo
  185. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  186. {
  187. GetFocus()->SendMessage(WM_UNDO);
  188. return TRUE;
  189. }
  190. break;
  191. }
  192. }
  193. return MyFormView::PreTranslateMessage(pMsg);
  194. }
  195. catch(...)
  196. {
  197. }
  198. }
  199. void PhoneRecordOut::OnButton1()
  200. {
  201. // TODO: Add your control notification handler code here
  202. UpdateData();
  203. m_filter.TrimLeft ();
  204. m_filter.TrimRight ();
  205. if(!bLoad1)
  206. {
  207. bLoad1=1;
  208. g_sendhead.bsql=0;
  209. g_sendhead.code[0]=113;
  210. g_sendhead.tabcount=1;
  211. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  212. DataToArray(&m_List1array);
  213. }
  214. FillGrid();
  215. }
  216. void PhoneRecordOut::OnButton2()
  217. {
  218. // TODO: Add your control notification handler code here
  219. UpdateData();
  220. m_filter.TrimLeft ();
  221. m_filter.TrimRight ();
  222. if(!bLoad2)
  223. {bLoad2=1;
  224. g_sendhead.bsql=0;
  225. g_sendhead.code[0]=114;
  226. g_sendhead.tabcount=1;
  227. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  228. DataToArray(&m_List2array);
  229. }
  230. FillGrid2();
  231. }
  232. void PhoneRecordOut::OnButton3()
  233. {
  234. // TODO: Add your control notification handler code here
  235. UpdateData();
  236. m_filter.TrimLeft ();
  237. m_filter.TrimRight ();
  238. if(!bLoad3)
  239. {bLoad3=1;
  240. g_sendhead.bsql=0;
  241. g_sendhead.code[0]=115;
  242. g_sendhead.tabcount=1;
  243. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  244. DataToArray(&m_List3array);
  245. }
  246. FillGrid3();
  247. }
  248. void PhoneRecordOut::OnButton10()
  249. {
  250. // TODO: Add your control notification handler code here
  251. UpdateData();
  252. if(!bLoad4)
  253. {bLoad4=1;
  254. g_sendhead.bsql=0;
  255. g_sendhead.code[0]=116;
  256. g_sendhead.tabcount=1;
  257. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  258. DataToArray(&m_List4array);
  259. }
  260. FillGrid4();
  261. }
  262. void PhoneRecordOut::FillGrid(int mode)
  263. {
  264. m_List1.ShowWindow (SW_SHOW);
  265. m_List2.ShowWindow (SW_HIDE);
  266. m_List3.ShowWindow (SW_HIDE);
  267. m_List4.ShowWindow (SW_HIDE);
  268. m_List5.ShowWindow (SW_HIDE);
  269. m_List1.DeleteAllItems2 ();
  270. int ii=0;
  271. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  272. int count=0;
  273. if(m_filter.IsEmpty ())
  274. {
  275. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  276. {
  277. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  278. }
  279. }
  280. else
  281. {
  282. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  283. {
  284. if(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  285. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1)
  286. {
  287. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  288. }
  289. }
  290. }
  291. m_List1.m_arLabels.SetSize(count, 1);
  292. ii=count;
  293. m_List1.m_LabelCount=ii;
  294. m_List1.SetItemCountEx (ii);
  295. }
  296. void PhoneRecordOut::FillGrid2()
  297. {
  298. m_List2.ShowWindow (SW_SHOW);
  299. m_List1.ShowWindow (SW_HIDE);
  300. m_List3.ShowWindow (SW_HIDE);
  301. m_List4.ShowWindow (SW_HIDE);
  302. m_List5.ShowWindow (SW_HIDE);
  303. m_List2.DeleteAllItems2 ();
  304. int ii=0;
  305. m_List2.m_arLabels.SetSize( m_List2array.GetSize (), 1 );
  306. int count=0;
  307. if(m_filter.IsEmpty ())
  308. {
  309. for(ii=0; ii<m_List2.m_arLabels.GetSize (); ii++)
  310. {
  311. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  312. }
  313. }
  314. else
  315. {
  316. for(ii=0; ii<m_List2.m_arLabels.GetSize (); ii++)
  317. {
  318. if(m_List2array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  319. m_List2array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || m_List2array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1)
  320. {
  321. m_List2.m_arLabels.ElementAt (count++).Copy (m_List2array.ElementAt (ii));
  322. }
  323. }
  324. }
  325. m_List2.m_arLabels.SetSize(count, 1);
  326. ii=count;
  327. m_List2.m_LabelCount=ii;
  328. m_List2.SetItemCountEx (ii);
  329. }
  330. void PhoneRecordOut::FillGrid3()
  331. {
  332. m_List3.ShowWindow (SW_SHOW);
  333. m_List1.ShowWindow (SW_HIDE);
  334. m_List2.ShowWindow (SW_HIDE);
  335. m_List4.ShowWindow (SW_HIDE);
  336. m_List5.ShowWindow (SW_HIDE);
  337. m_List3.DeleteAllItems2 ();
  338. int ii=0;
  339. m_List3.m_arLabels.SetSize( m_List3array.GetSize (), 1 );
  340. int count=0;
  341. if(m_filter.IsEmpty ())
  342. {
  343. for(ii=0; ii<m_List3.m_arLabels.GetSize (); ii++)
  344. {
  345. m_List3.m_arLabels.ElementAt (count++).Copy (m_List3array.ElementAt (ii));
  346. }
  347. }
  348. else
  349. {
  350. for(ii=0; ii<m_List3.m_arLabels.GetSize (); ii++)
  351. {
  352. if(m_List3array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  353. m_List3array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || m_List3array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1)
  354. {
  355. m_List3.m_arLabels.ElementAt (count++).Copy (m_List3array.ElementAt (ii));
  356. }
  357. }
  358. }
  359. m_List3.m_arLabels.SetSize(count, 1);
  360. ii=count;
  361. m_List3.m_LabelCount=ii;
  362. m_List3.SetItemCountEx (ii);
  363. }
  364. void PhoneRecordOut::FillGrid4()
  365. {
  366. m_List4.ShowWindow (SW_SHOW);
  367. m_List1.ShowWindow (SW_HIDE);
  368. m_List2.ShowWindow (SW_HIDE);
  369. m_List3.ShowWindow (SW_HIDE);
  370. m_List5.ShowWindow (SW_HIDE);
  371. m_List4.DeleteAllItems2 ();
  372. int ii=0;
  373. m_List4.m_arLabels.SetSize( m_List4array.GetSize (), 1 );
  374. int count=0;
  375. if(m_filter.IsEmpty ())
  376. {
  377. for(ii=0; ii<m_List4.m_arLabels.GetSize (); ii++)
  378. {
  379. m_List4.m_arLabels.ElementAt (count++).Copy (m_List4array.ElementAt (ii));
  380. }
  381. }
  382. else
  383. {
  384. for(ii=0; ii<m_List4.m_arLabels.GetSize (); ii++)
  385. {
  386. if(m_List4array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  387. m_List4array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1)
  388. {
  389. m_List4.m_arLabels.ElementAt (count++).Copy (m_List4array.ElementAt (ii));
  390. }
  391. }
  392. }
  393. m_List4.m_arLabels.SetSize(count, 1);
  394. ii=count;
  395. m_List4.m_LabelCount=ii;
  396. m_List4.SetItemCountEx (ii);
  397. }
  398. void PhoneRecordOut::FillGrid5()
  399. {
  400. m_List5.ShowWindow (SW_SHOW);
  401. m_List1.ShowWindow (SW_HIDE);
  402. m_List2.ShowWindow (SW_HIDE);
  403. m_List3.ShowWindow (SW_HIDE);
  404. m_List4.ShowWindow (SW_HIDE);
  405. m_List5.DeleteAllItems2 ();
  406. int ii=0;
  407. m_List5.m_arLabels.SetSize( m_List5array.GetSize (), 1 );
  408. int count=0;
  409. if(m_filter.IsEmpty ())
  410. {
  411. for(ii=0; ii<m_List5.m_arLabels.GetSize (); ii++)
  412. {
  413. m_List5.m_arLabels.ElementAt (count++).Copy (m_List5array.ElementAt (ii));
  414. }
  415. }
  416. else
  417. {
  418. for(ii=0; ii<m_List5.m_arLabels.GetSize (); ii++)
  419. {
  420. if(m_List5array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  421. m_List5array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1)
  422. {
  423. m_List5.m_arLabels.ElementAt (count++).Copy (m_List5array.ElementAt (ii));
  424. }
  425. }
  426. }
  427. m_List5.m_arLabels.SetSize(count, 1);
  428. ii=count;
  429. m_List5.m_LabelCount=ii;
  430. m_List5.SetItemCountEx (ii);
  431. }
  432. void PhoneRecordOut::OnButton4()
  433. {
  434. // TODO: Add your control notification handler code here
  435. if(m_List1.IsWindowVisible ())
  436. {
  437. POSITION pos;
  438. pos=m_List1.GetFirstSelectedItemPosition();
  439. if(pos==NULL)
  440. {
  441. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  442. return;
  443. }
  444. int iItem=m_List1.GetNextSelectedItem(pos);
  445. CString phone=m_List1.GetItemText (iItem, 1);
  446. CString datetime=m_List1.GetItemText (iItem, 2);
  447. datetime.Replace (":", "");
  448. CString path=g_path6+"\\客户电话(拨出)\\"+phone+"\\"+datetime+".mp3";
  449. if(::PathFileExists (path))
  450. {
  451. CAVIPlayerDlg dlg;
  452. dlg.m_Path =path;
  453. dlg.DoModal ();
  454. }
  455. else
  456. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  457. }
  458. if(m_List2.IsWindowVisible ())
  459. {
  460. POSITION pos;
  461. pos=m_List2.GetFirstSelectedItemPosition();
  462. if(pos==NULL)
  463. {
  464. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  465. return;
  466. }
  467. int iItem=m_List2.GetNextSelectedItem(pos);
  468. CString phone=m_List2.GetItemText (iItem, 1);
  469. CString datetime=m_List2.GetItemText (iItem, 2);
  470. datetime.Replace (":", "");
  471. CString path=g_path6+"\\意向客户(拨出)\\"+phone+"\\"+datetime+".mp3";
  472. if(::PathFileExists (path))
  473. {
  474. CAVIPlayerDlg dlg;
  475. dlg.m_Path =path;
  476. dlg.DoModal ();
  477. }
  478. else
  479. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  480. }
  481. if(m_List3.IsWindowVisible ())
  482. {
  483. POSITION pos;
  484. pos=m_List3.GetFirstSelectedItemPosition();
  485. if(pos==NULL)
  486. {
  487. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  488. return;
  489. }
  490. int iItem=m_List3.GetNextSelectedItem(pos);
  491. CString name=m_List3.GetItemText (iItem, 0);
  492. CString datetime=m_List3.GetItemText (iItem, 2);
  493. datetime.Replace (":", "");
  494. CString path=g_path6+"\\员工电话(拨出)\\"+name+"\\"+datetime+".mp3";
  495. if(::PathFileExists (path))
  496. {
  497. CAVIPlayerDlg dlg;
  498. dlg.m_Path =path;
  499. dlg.DoModal ();
  500. }
  501. else
  502. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  503. }
  504. if(m_List4.IsWindowVisible ())
  505. {
  506. POSITION pos;
  507. pos=m_List4.GetFirstSelectedItemPosition();
  508. if(pos==NULL)
  509. {
  510. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  511. return;
  512. }
  513. int iItem=m_List4.GetNextSelectedItem(pos);
  514. CString phone=m_List4.GetItemText (iItem, 0);
  515. CString datetime=m_List4.GetItemText (iItem, 1);
  516. datetime.Replace (":", "");
  517. CString path=g_path6+"\\未知电话(拨出)\\"+phone+"\\"+datetime+".mp3";
  518. if(::PathFileExists (path))
  519. {
  520. CAVIPlayerDlg dlg;
  521. dlg.m_Path =path;
  522. dlg.DoModal ();
  523. }
  524. else
  525. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  526. }
  527. if(m_List5.IsWindowVisible ())
  528. {
  529. POSITION pos;
  530. pos=m_List5.GetFirstSelectedItemPosition();
  531. if(pos==NULL)
  532. {
  533. AfxMessageBox("请先选中您要回放的录音!", MB_ICONINFORMATION);
  534. return;
  535. }
  536. int iItem=m_List5.GetNextSelectedItem(pos);
  537. CString phone=m_List5.GetItemText (iItem, 1);
  538. CString datetime=m_List5.GetItemText (iItem, 2);
  539. datetime.Replace (":", "");
  540. CString path=g_path6+"\\老客户(拨出)\\"+phone+"\\"+datetime+".mp3";
  541. if(::PathFileExists (path))
  542. {
  543. CAVIPlayerDlg dlg;
  544. dlg.m_Path =path;
  545. dlg.DoModal ();
  546. }
  547. else
  548. AfxMessageBox("文件未找到!", MB_ICONINFORMATION);
  549. }
  550. }
  551. void PhoneRecordOut::OnBUTdel2()
  552. {
  553. // TODO: Add your control notification handler code here
  554. if(IsHasRights2new(49)==0)return;
  555. // TODO: Add your control notification handler code here
  556. if(m_List1.IsWindowVisible ())
  557. {
  558. POSITION pos;
  559. pos=m_List1.GetFirstSelectedItemPosition();
  560. if(pos==NULL)
  561. {
  562. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  563. return;
  564. }
  565. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  566. int iItem=m_List1.GetNextSelectedItem(pos);
  567. CString phone=m_List1.GetItemText (iItem, 1);
  568. CString datetime=m_List1.GetItemText (iItem, 2);
  569. CString sql;
  570. sql.Format ("delete from phonerecordout where datetime='%s' ", datetime);
  571. g_sendhead.bsql=1;
  572. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  573. datetime.Replace (":", "");
  574. CString path=g_path6+"\\客户电话(拨出)\\"+phone+"\\"+datetime+".mp3";
  575. ::DeleteFile (path);
  576. bLoad1=0;
  577. OnButton1();
  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. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  589. int iItem=m_List2.GetNextSelectedItem(pos);
  590. CString phone=m_List2.GetItemText (iItem, 1);
  591. CString datetime=m_List2.GetItemText (iItem, 2);
  592. CString sql;
  593. sql.Format ("delete from client2phonerecordout where datetime='%s' ", datetime);
  594. g_sendhead.bsql=1;
  595. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  596. datetime.Replace (":", "");
  597. CString path=g_path6+"\\意向客户(拨出)\\"+phone+"\\"+datetime+".mp3";
  598. ::DeleteFile (path);
  599. bLoad2=0;
  600. OnButton2();
  601. }
  602. if(m_List3.IsWindowVisible ())
  603. {
  604. POSITION pos;
  605. pos=m_List3.GetFirstSelectedItemPosition();
  606. if(pos==NULL)
  607. {
  608. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  609. return;
  610. }
  611. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  612. int iItem=m_List3.GetNextSelectedItem(pos);
  613. CString name=m_List3.GetItemText (iItem, 0);
  614. CString datetime=m_List3.GetItemText (iItem, 2);
  615. CString sql;
  616. sql.Format ("delete from employeephonerecordout where datetime='%s' ", datetime);
  617. g_sendhead.bsql=1;
  618. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  619. datetime.Replace (":", "");
  620. CString path=g_path6+"\\员工电话(拨出)\\"+name+"\\"+datetime+".mp3";
  621. ::DeleteFile (path);
  622. bLoad3=0;
  623. OnButton3();
  624. }
  625. if(m_List4.IsWindowVisible ())
  626. {
  627. POSITION pos;
  628. pos=m_List4.GetFirstSelectedItemPosition();
  629. if(pos==NULL)
  630. {
  631. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  632. return;
  633. }
  634. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  635. int iItem=m_List4.GetNextSelectedItem(pos);
  636. CString phone=m_List4.GetItemText (iItem, 0);
  637. CString datetime=m_List4.GetItemText (iItem, 1);
  638. CString sql;
  639. sql.Format ("delete from unknownphonerecordout where datetime='%s' ", datetime);
  640. g_sendhead.bsql=1;
  641. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  642. datetime.Replace (":", "");
  643. CString path=g_path6+"\\未知电话(拨出)\\"+phone+"\\"+datetime+".mp3";
  644. ::DeleteFile (path);
  645. bLoad4=0;
  646. OnButton10();
  647. }
  648. if(m_List5.IsWindowVisible ())
  649. {
  650. POSITION pos;
  651. pos=m_List5.GetFirstSelectedItemPosition();
  652. if(pos==NULL)
  653. {
  654. AfxMessageBox("请先选中您要删除的记录!", MB_ICONINFORMATION);
  655. return;
  656. }
  657. if(AfxMessageBox("删除后将无法恢复,是否继续?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  658. int iItem=m_List5.GetNextSelectedItem(pos);
  659. CString phone=m_List5.GetItemText (iItem, 1);
  660. CString datetime=m_List5.GetItemText (iItem, 2);
  661. CString sql;
  662. sql.Format ("delete from client3phonerecordout where datetime='%s' ", datetime);
  663. g_sendhead.bsql=1;
  664. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  665. datetime.Replace (":", "");
  666. CString path=g_path6+"\\老客户(拨出)\\"+phone+"\\"+datetime+".mp3";
  667. ::DeleteFile (path);
  668. bLoad5=0;
  669. OnButton6();
  670. }
  671. }
  672. void PhoneRecordOut::OnButton6()
  673. {
  674. // TODO: Add your control notification handler code here
  675. UpdateData();
  676. m_filter.TrimLeft ();
  677. m_filter.TrimRight ();
  678. if(!bLoad5)
  679. {bLoad5=1;
  680. g_sendhead.bsql=0;
  681. g_sendhead.code[0]=176;
  682. g_sendhead.tabcount=1;
  683. g_pMainWnd->ProcessChatMessageRequest2(15);if(g_bSendOK==0)return;
  684. DataToArray(&m_List5array);
  685. }
  686. FillGrid5();
  687. }