BurnCD.cpp 16 KB

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