ClientMoney.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. // ClientMoney.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "LYFZIPManage.h"
  5. #include "ClientMoney.h"
  6. #include "MyMdi.H"
  7. #include "ModifyDinDan.h"
  8. #include "InputPsw.h"
  9. #include "ClientDlg.h"
  10. #include "ImportPhoto.h"
  11. #include "TakeMoney2.h"
  12. #include "ImportPhoto.h"
  13. #include "NeroDlg.h"
  14. #include "ClientRequirement.h"
  15. #include "ChoosePhotoSkin2.h"
  16. #include "./helper/ffsco.h"
  17. #include "TakeMoney3.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. #pragma comment(lib, "Shlwapi.lib")
  24. /////////////////////////////////////////////////////////////////////////////
  25. // ClientMoney
  26. IMPLEMENT_DYNCREATE(ClientMoney, CFormView)
  27. ClientMoney::ClientMoney()
  28. : CFormView(ClientMoney::IDD)
  29. {
  30. //{{AFX_DATA_INIT(ClientMoney)
  31. m_filter = _T("");
  32. //}}AFX_DATA_INIT
  33. }
  34. ClientMoney::~ClientMoney()
  35. {
  36. }
  37. void ClientMoney::DoDataExchange(CDataExchange* pDX)
  38. {
  39. CFormView::DoDataExchange(pDX);
  40. //{{AFX_DATA_MAP(ClientMoney)
  41. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  42. DDX_Control(pDX, IDC_LIST2, m_List1);
  43. DDX_Control(pDX, IDC_STATIC1, m_static1);
  44. DDX_CBString(pDX, IDC_COMBO1, m_filter);
  45. //}}AFX_DATA_MAP
  46. }
  47. BEGIN_MESSAGE_MAP(ClientMoney, CFormView)
  48. //{{AFX_MSG_MAP(ClientMoney)
  49. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  50. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  51. ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  52. ON_WM_TIMER()
  53. ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
  54. ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
  55. ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
  56. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  57. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
  58. ON_BN_CLICKED(IDC_BUTburncd, OnBUTClientMoney)
  59. ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
  60. //}}AFX_MSG_MAP
  61. END_MESSAGE_MAP()
  62. /////////////////////////////////////////////////////////////////////////////
  63. // ClientMoney diagnostics
  64. #ifdef _DEBUG
  65. void ClientMoney::AssertValid() const
  66. {
  67. CFormView::AssertValid();
  68. }
  69. void ClientMoney::Dump(CDumpContext& dc) const
  70. {
  71. CFormView::Dump(dc);
  72. }
  73. #endif //_DEBUG
  74. /////////////////////////////////////////////////////////////////////////////
  75. // ClientMoney message handlers
  76. void ClientMoney::OnInitialUpdate()
  77. {
  78. CFormView::OnInitialUpdate();
  79. // TODO: Add your specialized code here and/or call the base class
  80. CMyMdi Mdi;
  81. Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
  82. // Here we create the outbar control using the splitter as its parent
  83. // and setting its id to the first pane.
  84. CRect rc2;
  85. GetWindowRect(rc2);
  86. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  87. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0);
  88. m_static1.SetFont (&g_titlefont);
  89. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;是否取件,100;应付,100;已付,100;欠款,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
  90. m_List1.LoadColumnInfo (126);
  91. if(g_bShowOK==0)
  92. {
  93. CString filter="status3='未取'";
  94. g_sendhead.bsql=0;
  95. g_sendhead.code[0]=62;
  96. g_sendhead.tabcount=1;
  97. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  98. }
  99. else
  100. {
  101. g_sendhead.bsql=0;
  102. g_sendhead.code[0]=62;
  103. g_sendhead.tabcount=1;
  104. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  105. }
  106. DataToArray(&m_List1array);
  107. FillGrid();
  108. m_combo1.GetWindowRect (rc2);
  109. ScreenToClient(rc2);
  110. rc2.bottom +=200;
  111. m_combo1.MoveWindow (rc2);
  112. }
  113. void ClientMoney::FillGrid(BOOL bStatus)
  114. {
  115. m_List1.DeleteAllItems2 ();
  116. int ii=0;
  117. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  118. int count=0;
  119. if(m_filter.IsEmpty ())
  120. {
  121. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  122. {
  123. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  124. }
  125. }
  126. else
  127. {
  128. int type=GetType(m_filter);
  129. if(type==1)//电话
  130. {
  131. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  132. {
  133. if(m_List1array.ElementAt (ii).ElementAt (9).Find (m_filter)!=-1 || \
  134. m_List1array.ElementAt (ii).ElementAt (10).Find (m_filter)!=-1)
  135. {
  136. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  137. }
  138. }
  139. }
  140. else if(type==2)//拼音
  141. {
  142. m_filter.MakeUpper ();
  143. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  144. {
  145. if(m_List1array.ElementAt (ii).ElementAt (11).Find (m_filter)!=-1 || \
  146. m_List1array.ElementAt (ii).ElementAt (12).Find (m_filter)!=-1)
  147. {
  148. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  149. }
  150. }
  151. }
  152. else
  153. {
  154. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  155. {
  156. if(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  157. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
  158. m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
  159. m_List1array.ElementAt (ii).ElementAt (7).Find (m_filter)!=-1|| \
  160. m_List1array.ElementAt (ii).ElementAt (8).Find (m_filter)!=-1|| \
  161. m_List1array.ElementAt (ii).ElementAt (9).Find (m_filter)!=-1 || \
  162. m_List1array.ElementAt (ii).ElementAt (10).Find (m_filter)!=-1 || \
  163. m_List1array.ElementAt (ii).ElementAt (11).Find (m_filter)!=-1 || \
  164. m_List1array.ElementAt (ii).ElementAt (12).Find (m_filter)!=-1 )
  165. {
  166. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  167. }
  168. }
  169. }
  170. }
  171. m_List1.m_arLabels.SetSize(count, 1);
  172. ii=count;
  173. m_List1.m_LabelCount=ii;
  174. m_List1.SetItemCountEx (ii);
  175. CString str;
  176. str.Format ("单数:%d", ii);
  177. SetDlgItemText(IDC_STATIC2, str);
  178. }
  179. void ClientMoney::OnBUTclose()
  180. {
  181. // TODO: Add your control notification handler code here
  182. GetParent()->SendMessage(WM_CLOSE);
  183. }
  184. void ClientMoney::OnSelchangeCombo1()
  185. {
  186. // TODO: Add your control notification handler code here
  187. SetTimer(1, 100, NULL);
  188. }
  189. void ClientMoney::OnTimer(UINT nIDEvent)
  190. {
  191. // TODO: Add your message handler code here and/or call default
  192. KillTimer(nIDEvent);
  193. OnButton1();
  194. }
  195. BOOL ClientMoney::PreTranslateMessage(MSG* pMsg)
  196. {
  197. // TODO: Add your specialized code here and/or call the base class
  198. try
  199. {
  200. if(pMsg->message==WM_KEYDOWN)
  201. {
  202. switch (pMsg->wParam)
  203. {
  204. case VK_RETURN:
  205. OnButton1();
  206. return 1;
  207. case 0x43: // copy
  208. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  209. {
  210. GetFocus()->SendMessage(WM_COPY);
  211. return TRUE;
  212. }
  213. break;
  214. case 0x56: //Ctrl + V:
  215. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  216. {
  217. GetFocus()->SendMessage(WM_PASTE);
  218. return TRUE;
  219. }
  220. break;
  221. case 0x58: // cut
  222. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  223. {
  224. GetFocus()->SendMessage(WM_CUT);
  225. return TRUE;
  226. }
  227. break;
  228. case 0x5A: //undo
  229. case 0x59: //redo
  230. if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
  231. {
  232. GetFocus()->SendMessage(WM_UNDO);
  233. return TRUE;
  234. }
  235. break;
  236. }
  237. }
  238. return CFormView::PreTranslateMessage(pMsg);
  239. }
  240. catch(...)
  241. {
  242. }
  243. }
  244. extern int CALLBACK BrowseProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData);
  245. /*{
  246. switch(msg)
  247. {
  248. case BFFM_INITIALIZED:
  249. SendMessage(hwnd, BFFM_SETSELECTION, TRUE, NULL);
  250. break;
  251. case BFFM_SELCHANGED:
  252. {
  253. char szFileName[MAX_PATH];
  254. LPITEMIDLIST pidlCurrent = (LPITEMIDLIST)lParam;
  255. SHGetPathFromIDList(pidlCurrent, szFileName);
  256. SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szFileName);
  257. }
  258. break;
  259. }
  260. return 0;
  261. }*/
  262. void ClientMoney::GetSavePath(CString &path)
  263. {
  264. char lpszDisplayName[MAX_PATH], szFileName[MAX_PATH];
  265. LPITEMIDLIST pidlDesktop, pidlCurrent;
  266. if(SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidlDesktop)
  267. == NOERROR)
  268. {
  269. BROWSEINFO bi;
  270. bi.hwndOwner = this->m_hWnd;
  271. bi.pidlRoot = pidlDesktop;
  272. bi.pszDisplayName = lpszDisplayName;
  273. bi.lpszTitle = "\n文档保存的目录:";
  274. bi.ulFlags = BIF_STATUSTEXT&BIF_RETURNONLYFSDIRS ;
  275. bi.lpfn = BrowseProc;
  276. bi.lParam = 0;
  277. bi.iImage = 0;
  278. pidlCurrent = SHBrowseForFolder(&bi);
  279. SHGetPathFromIDList(pidlCurrent, szFileName);
  280. path = szFileName;
  281. }
  282. }
  283. int ClientMoney::FindArray(CStringArray *pArray, CString Str)
  284. {
  285. for(int i=0; i<pArray->GetSize (); i++)
  286. {
  287. if(pArray->ElementAt (i)==Str)
  288. return i;
  289. }
  290. return -1;
  291. }
  292. void ClientMoney::GetNo(CString str, CStringArray &array)
  293. {
  294. if(!str.IsEmpty ())
  295. {
  296. int pos=str.Find (",");
  297. while(pos!=-1)
  298. {
  299. if(FindArray(&array, str.Left (pos))==-1)
  300. array.Add (str.Left (pos));
  301. str=str.Right (str.GetLength ()-pos-1);
  302. pos=str.Find (",");
  303. }
  304. if(FindArray(&array, str)==-1)
  305. array.Add(str);
  306. }
  307. }
  308. CString ClientMoney::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
  309. {
  310. CString ret;
  311. name=","+name+",";
  312. CString str;
  313. for(int i=0; i<spnamearray.GetSize (); i++)
  314. {
  315. str=","+spnamearray.ElementAt (i).ElementAt (6)+",";
  316. if(str.Find (name)!=-1)
  317. {
  318. ret+=spnamearray.ElementAt (i).ElementAt (5);
  319. ret+=";";
  320. }
  321. }
  322. ret.TrimRight (";");
  323. ret.Replace ("*", "x");
  324. return ret;
  325. }
  326. void ClientMoney::OnBUTexportphoto()
  327. {
  328. if(IsHasRights2new(11)==0)return;
  329. // TODO: Add your control notification handler code here
  330. POSITION pos;
  331. pos=m_List1.GetFirstSelectedItemPosition();
  332. if(pos==NULL)
  333. {
  334. AfxMessageBox("请先选中您要导出片的定单!", MB_ICONINFORMATION);
  335. return;
  336. }
  337. int iItem=m_List1.GetNextSelectedItem(pos);
  338. CString id=m_List1.GetItemText (iItem, 0);
  339. CString path;
  340. path=g_path4+"\\";
  341. path+=id;
  342. path +="\\";
  343. CString temp;
  344. CStringArray array;
  345. using namespace helper_coffs;
  346. ffsco o;
  347. o.dirs(0);
  348. o.find(LPCSTR(path), LPCSTR("*.jpg"));
  349. ffsco::typeT coo;
  350. ffsco::typeT::iterator it;
  351. coo = o.co_file();
  352. for (it = coo.begin();
  353. coo.end() != it;
  354. it ++)
  355. {
  356. temp=(*it).c_str();
  357. if(temp.GetAt (temp.ReverseFind ('\\')+1)!='s')
  358. {
  359. array.Add (temp);
  360. }
  361. }
  362. if(array.GetSize ()==0)
  363. {
  364. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  365. return;
  366. }
  367. CString dir;
  368. GetSavePath(dir);
  369. if(dir.IsEmpty())
  370. {
  371. return;
  372. }
  373. CString name1=m_List1.GetItemText (iItem, 1);
  374. CString name2=m_List1.GetItemText (iItem, 2);
  375. dir.TrimRight ('\\');
  376. dir+="\\";
  377. dir+=id;
  378. dir+=name1;
  379. dir+=name2;
  380. dir+="精修好的片";
  381. dir+="\\";
  382. ::CreateDirectory (dir, NULL);
  383. ImportPhoto dlg;
  384. dlg.m_mode =1;
  385. dlg.m_pArray=&array;
  386. dlg.m_savepath =dir;
  387. dlg.DoModal (); AfxMessageBox("导片成功!", MB_ICONINFORMATION);
  388. }
  389. void ClientMoney::OnBUTimportphoto()
  390. {
  391. // TODO: Add your control notification handler code here
  392. POSITION pos;
  393. pos=m_List1.GetFirstSelectedItemPosition();
  394. if(pos==NULL)
  395. {
  396. AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
  397. return;
  398. }
  399. int iItem=m_List1.GetNextSelectedItem(pos);
  400. CString id=m_List1.GetItemText (iItem, 0);
  401. CString oldstatus=m_List1.GetItemText (iItem, 4);
  402. CString name=m_List1.GetItemText (iItem, 1)+","+m_List1.GetItemText (iItem, 2);
  403. name.TrimLeft (",");
  404. name.TrimRight (",");
  405. name="客人:"+name;
  406. CString phone=m_List1.GetItemText (iItem, 13)+","+m_List1.GetItemText (iItem, 14);
  407. phone.TrimLeft (",");
  408. phone.TrimRight (",");
  409. phone="电话:"+phone;
  410. if(g_path3.IsEmpty ())
  411. {
  412. AfxMessageBox("未设置设计片保存机器, 请通知系统管理员!", MB_ICONINFORMATION);
  413. return;
  414. }
  415. if(!::PathFileExists (g_path3))
  416. {
  417. AfxMessageBox("设计片保存机器目录未设置, 请通知系统管理员!", MB_ICONINFORMATION);
  418. return;
  419. }
  420. CString savepath=g_path3+"\\";
  421. savepath+=id+"\\";
  422. if(::PathFileExists (savepath)==0)
  423. ::CreateDirectory (savepath, NULL);
  424. CString srcdir;CString str;
  425. GetSavePath(srcdir);
  426. if(srcdir.IsEmpty())
  427. {
  428. CString status5;
  429. if(AfxMessageBox("客照是否全部设计完毕?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  430. status5="OK";
  431. else
  432. status5="设计中";
  433. CString sql;
  434. sql="update dindan set status5='"+status5+"' where id='"+id+"'";
  435. sql+=DINDAN_REF;
  436. g_sendhead.bsql=1;
  437. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  438. for(int i=0; i<m_List1array.GetSize (); i++)
  439. {
  440. if(id==m_List1array.ElementAt (i).ElementAt (0))
  441. {
  442. m_List1array.ElementAt (i).SetAt (4, status5);
  443. FillGrid();
  444. break;
  445. }
  446. }
  447. return;
  448. }
  449. if(srcdir.GetLength ()<4)
  450. {
  451. AfxMessageBox("请选择正确的您文件所在的目录!", MB_ICONSTOP);
  452. return;
  453. }
  454. if(oldstatus!="未设计")
  455. {
  456. CString str;
  457. str.Format ("%s\r\n%s\r\n此单已导入过设计片, 确认您选中的照片没有导入过吗? 否则会覆盖原来的照片, 是否继续?", name, phone );
  458. if(AfxMessageBox(str, MB_YESNO|MB_ICONSTOP)!=IDYES)
  459. return;
  460. }
  461. else
  462. {
  463. CString str;
  464. str.Format ("%s\r\n%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone );
  465. if(AfxMessageBox(str, MB_YESNO|MB_ICONINFORMATION)!=IDYES)
  466. return;
  467. }
  468. CStringArray array;
  469. CStringArray desarray;
  470. CStringArray dirarray;
  471. if(1)
  472. {
  473. using namespace helper_coffs;
  474. ffsco o;
  475. o.dirs(1);
  476. o.find(LPCSTR(srcdir), LPCSTR("*.*"));
  477. ffsco::typeT coo;
  478. ffsco::typeT::iterator it;
  479. coo = o.co_dir();
  480. for (it = coo.begin();
  481. coo.end() != it;
  482. it ++)
  483. {
  484. str=(*it).c_str();
  485. if(FindArray(&dirarray, str)==-1)
  486. {
  487. dirarray.Add (str);
  488. if(str!=dirarray.ElementAt (0))
  489. {
  490. str=savepath+str.Right (str.GetLength ()-dirarray.ElementAt (0).GetLength ());
  491. if(::PathFileExists (str)==0)
  492. ::CreateDirectory (str, NULL);
  493. }
  494. }
  495. }
  496. }
  497. if(1)
  498. {
  499. for(int i=0; i<dirarray.GetSize (); i++)
  500. {
  501. using namespace helper_coffs;
  502. ffsco o;
  503. o.dirs(0);
  504. o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
  505. ffsco::typeT coo;
  506. ffsco::typeT::iterator it;
  507. coo = o.co_file();
  508. for (it = coo.begin();
  509. coo.end() != it;
  510. it ++)
  511. {
  512. str=(*it).c_str();
  513. array.Add (str);
  514. desarray.Add (savepath+dirarray.ElementAt (i).Right (dirarray.ElementAt (i).GetLength ()-dirarray.ElementAt (0).GetLength ())+str.Right (str.GetLength ()-str.ReverseFind ('\\')-1));
  515. }
  516. }
  517. }
  518. if(array.GetSize ()==0)return;
  519. ImportPhoto dlg;
  520. dlg.m_pArray=&array;
  521. dlg.m_pDesArray=&desarray;
  522. dlg.m_savepath =savepath;
  523. dlg.DoModal ();
  524. CString status5;
  525. if(AfxMessageBox("客照是否全部设计完毕?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  526. status5="OK";
  527. else
  528. status5="设计中";
  529. CString sql;
  530. sql="update dindan set status5='"+status5+"',waiter4='"+g_user.name+"' where id='"+id+"'";
  531. sql+=DINDAN_REF;
  532. g_sendhead.bsql=1;
  533. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  534. savepath+="ok";
  535. ::DeleteFile (savepath);
  536. AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
  537. for(int i=0; i<m_List1array.GetSize (); i++)
  538. {
  539. if(id==m_List1array.ElementAt (i).ElementAt (0))
  540. {
  541. m_List1array.ElementAt (i).SetAt (4, status5);
  542. m_List1array.ElementAt (i).SetAt (10, g_user.name);
  543. FillGrid();
  544. break;
  545. }
  546. }
  547. }
  548. void ClientMoney::OnBUTshowphoto()
  549. {
  550. // TODO: Add your control notification handler code here
  551. POSITION pos;
  552. pos=m_List1.GetFirstSelectedItemPosition();
  553. if(pos==NULL)
  554. {
  555. AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
  556. return;
  557. }
  558. int iItem=m_List1.GetNextSelectedItem(pos);
  559. CString status=m_List1.GetItemText (iItem, 4);
  560. CString id=m_List1.GetItemText (iItem, 0);
  561. if(status=="未设计")
  562. {
  563. AfxMessageBox("此单未导片!", MB_ICONINFORMATION);
  564. return;
  565. }
  566. /* ShowPic dlg;
  567. dlg.m_path=g_path3+"\\";
  568. dlg.m_path+=id;
  569. dlg.m_path +="\\";
  570. dlg.DoModal ();*/
  571. ChoosePhotoSkin2 dlg;
  572. dlg.m_mode2 =1;
  573. dlg.SetLiaPath ("3.lia");
  574. dlg.m_id=id;
  575. dlg.m_path=g_path3+"\\";
  576. dlg.m_path+=id;
  577. dlg.m_path +="\\";
  578. dlg.DoModal ();
  579. for(int i=0; i<m_List1array.GetSize (); i++)
  580. {
  581. if(id==m_List1array.ElementAt (i).ElementAt (0))
  582. {
  583. m_List1array.ElementAt (i).SetAt (7, dlg.m_bz2);
  584. // FillGrid();
  585. break;
  586. }
  587. }
  588. }
  589. void ClientMoney::OnButton1()
  590. {
  591. // TODO: Add your control notification handler code here
  592. UpdateData();
  593. m_filter.TrimLeft ();
  594. m_filter.TrimRight ();
  595. FillGrid();
  596. }
  597. void ClientMoney::OnButton2()
  598. {
  599. // TODO: Add your control notification handler code here
  600. }
  601. void ClientMoney::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
  602. {
  603. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  604. // TODO: Add your control notification handler code here
  605. POSITION pos;
  606. pos=m_List1.GetFirstSelectedItemPosition();
  607. if(pos==NULL)
  608. {
  609. return;
  610. }
  611. int iItem=m_List1.GetNextSelectedItem(pos);
  612. CString waiter4=m_List1.GetItemText (iItem, 10);
  613. if(waiter4.IsEmpty () && IsHasRights2new(7) || IsHasRights2new(49) )
  614. {
  615. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  616. }
  617. else if(waiter4==g_user.name && IsHasRights2new(7) )
  618. {
  619. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
  620. }
  621. else
  622. GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
  623. *pResult = 0;
  624. }
  625. void ClientMoney::OnBUTClientMoney()
  626. {
  627. // TODO: Add your control notification handler code here
  628. POSITION pos;
  629. pos=m_List1.GetFirstSelectedItemPosition();
  630. if(pos==NULL)
  631. {
  632. return;
  633. }
  634. int iItem=m_List1.GetNextSelectedItem(pos);
  635. CString id=m_List1.GetItemText (iItem, 0);
  636. TakeMoney3 dlg;
  637. dlg.m_mode =5;
  638. dlg.m_id =id;
  639. dlg.m_name1 =m_List1.GetItemText (iItem, 1);
  640. dlg.m_name2 =m_List1.GetItemText (iItem, 2);
  641. if(dlg.DoModal ()!=IDOK)return;
  642. }
  643. void ClientMoney::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
  644. {
  645. // TODO: Add your control notification handler code here
  646. OnBUTClientMoney();
  647. *pResult = 0;
  648. }