BeautifySkinFrom.cpp 17 KB

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