PhoneRecordOut.cpp 19 KB

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