DigitalWorkSet2.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. // DigitalWorkSet2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "DigitalWorkSet2.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // DigitalWorkSet2 dialog
  13. DigitalWorkSet2::DigitalWorkSet2(CWnd* pParent /*=NULL*/)
  14. : CDialog(DigitalWorkSet2::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(DigitalWorkSet2)
  17. m_filter = _T("");
  18. m_check1 = FALSE;
  19. m_check2 = FALSE;
  20. m_check3 = FALSE;
  21. //}}AFX_DATA_INIT
  22. m_mode=0;
  23. m_checkwork=0;
  24. m_nAdd=0;
  25. if(g_bAllBranch)
  26. {
  27. m_nAdd=1;
  28. }
  29. }
  30. void DigitalWorkSet2::DoDataExchange(CDataExchange* pDX)
  31. {
  32. CDialog::DoDataExchange(pDX);
  33. //{{AFX_DATA_MAP(DigitalWorkSet2)
  34. DDX_Control(pDX, IDC_LIST1, m_List1);
  35. DDX_Text(pDX, IDC_EDIT1, m_filter);
  36. DDX_Check(pDX, IDC_CHECK1, m_check1);
  37. DDX_Check(pDX, IDC_CHECK2, m_check2);
  38. DDX_Check(pDX, IDC_CHECK3, m_check3);
  39. //}}AFX_DATA_MAP
  40. }
  41. BEGIN_MESSAGE_MAP(DigitalWorkSet2, CDialog)
  42. //{{AFX_MSG_MAP(DigitalWorkSet2)
  43. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  44. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  45. ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  46. ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
  47. ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST1, OnCustomdrawList)
  48. ON_BN_CLICKED(IDC_CHECK3, OnCheck3)
  49. //}}AFX_MSG_MAP
  50. END_MESSAGE_MAP()
  51. /////////////////////////////////////////////////////////////////////////////
  52. // DigitalWorkSet2 message handlers
  53. extern BOOL CALLBACK EnumChildProc2(HWND hwnd,LPARAM lParam);
  54. BOOL DigitalWorkSet2::OnInitDialog()
  55. {
  56. CDialog::OnInitDialog();
  57. // TODO: Add extra initialization here
  58. if(m_mode)SetWindowText("我的工作");
  59. CRect rc2;
  60. GetWindowRect(rc2);
  61. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  62. g_WidthScale2 = (float)g_rc.Width()/(float)rc2.Width(); // new/Old
  63. g_HeightScale2 = (float)g_rc.Height()/(float)rc2.Height();
  64. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc2,0);
  65. if(g_bAllBranch==0)
  66. {
  67. #ifdef CHILD_VERSION
  68. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;初修,100;完成期限,100;精修,100;完成期限,100;设计,100;完成期限,100" );
  69. #else
  70. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;初修,100;完成期限,100;精修,100;完成期限,100;设计,100;完成期限,100" );
  71. #endif
  72. m_List1.LoadColumnInfo (170);
  73. }
  74. else
  75. {
  76. #ifdef CHILD_VERSION
  77. m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;初修,100;完成期限,100;精修,100;完成期限,100;设计,100;完成期限,100" );
  78. #else
  79. m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;初修,100;完成期限,100;精修,100;完成期限,100;设计,100;完成期限,100" );
  80. #endif
  81. m_List1.LoadColumnInfo (201);
  82. }
  83. if(g_bAllBranch==0)
  84. {
  85. if(g_bShowOK==0)
  86. {
  87. CString filter="status3='未取'";
  88. g_sendhead.bsql=0;
  89. g_sendhead.code[0]=137;
  90. g_sendhead.tabcount=1;
  91. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return false;
  92. }
  93. else
  94. {
  95. g_sendhead.bsql=0;
  96. g_sendhead.code[0]=137;
  97. g_sendhead.tabcount=1;
  98. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return false;
  99. }
  100. DataToArray(&m_List1array);
  101. }
  102. else
  103. {
  104. //////////////数据汇总
  105. m_List1array.RemoveAll ();
  106. CString branch;
  107. for(int i=-1; i<g_brancharray.GetSize ()-1; i++)
  108. {
  109. if(i!=-1)
  110. {
  111. branch=g_brancharray.ElementAt (i).ElementAt (0);
  112. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  113. g_pMainWnd->OnDisconnect();
  114. g_branchname=branch;
  115. g_bBranchModify=1;
  116. }
  117. else
  118. branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
  119. if(g_bShowOK==0)
  120. {
  121. CString filter="status3='未取'";
  122. g_sendhead.bsql=0;
  123. g_sendhead.code[0]=137;
  124. g_sendhead.tabcount=1;
  125. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
  126. }
  127. else
  128. {
  129. g_sendhead.bsql=0;
  130. g_sendhead.code[0]=137;
  131. g_sendhead.tabcount=1;
  132. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)continue;
  133. }
  134. CArray<CStringArray, CStringArray>List1array;
  135. DataToArray(&List1array);
  136. int size=m_List1array.GetSize ();
  137. for(int j=0; j<List1array.GetSize (); j++)
  138. {
  139. size++;
  140. m_List1array.SetSize(size , 1 );
  141. size--;
  142. m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
  143. m_List1array.ElementAt (size).InsertAt (0, branch);
  144. size++;
  145. }
  146. }
  147. g_pMainWnd->OnDisconnect();
  148. g_bBranchModify=0;g_branchip=g_branchname="";
  149. }
  150. FillGrid();
  151. if(m_checkwork )
  152. {
  153. if(m_List1.GetItemCount ()==0)
  154. CDialog::OnCancel ();
  155. else
  156. {
  157. BOOL bShow=0;
  158. CString str;
  159. for(int i=0; i<m_List1.GetItemCount (); i++)
  160. {
  161. str=m_List1.GetItemText (i, 3);
  162. if(str.Find (g_user.name )!=-1)
  163. {
  164. if(str.Find ("OK")==-1)
  165. {
  166. bShow=1;break;
  167. }
  168. }
  169. str=m_List1.GetItemText (i, 5);
  170. if(str.Find (g_user.name )!=-1)
  171. {
  172. if(str.Find ("OK")==-1)
  173. {
  174. bShow=1;break;
  175. }
  176. }
  177. str=m_List1.GetItemText (i, 7);
  178. if(str.Find (g_user.name )!=-1)
  179. {
  180. if(str.Find ("OK")==-1)
  181. {
  182. bShow=1;break;
  183. }
  184. }
  185. }
  186. if(bShow==0)CDialog::OnCancel ();
  187. }
  188. }
  189. return TRUE; // return TRUE unless you set the focus to a control
  190. // EXCEPTION: OCX Property Pages should return FALSE
  191. }
  192. void DigitalWorkSet2::OnButton1()
  193. {
  194. // TODO: Add your control notification handler code here
  195. // TODO: Add your control notification handler code here
  196. UpdateData();
  197. m_filter.TrimLeft ();
  198. m_filter.TrimRight ();
  199. FillGrid();
  200. }
  201. void DigitalWorkSet2::OnButton2()
  202. {
  203. // TODO: Add your control notification handler code here
  204. UpdateData();
  205. m_filter.TrimLeft ();
  206. m_filter.TrimRight ();
  207. FillGrid(1);
  208. }
  209. void DigitalWorkSet2::FillGrid(int bStatus)
  210. {
  211. UpdateData();
  212. bStatus=!m_check3;
  213. m_List1.DeleteAllItems2 ();
  214. int ii=0;
  215. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  216. int count=0;
  217. CString strdate,strdate2;
  218. CTime tm=CTime::GetCurrentTime ();
  219. strdate=tm.Format ("%Y-%m-%d");
  220. if(m_check1)
  221. {
  222. tm+=CTimeSpan(7, 0, 0, 0);
  223. strdate2=tm.Format ("%Y-%m-%d");
  224. }
  225. else if(m_check2)
  226. {
  227. tm+=CTimeSpan(15, 0, 0, 0);
  228. strdate2=tm.Format ("%Y-%m-%d");
  229. }
  230. if(m_filter.IsEmpty ())
  231. {
  232. if(bStatus)
  233. {
  234. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  235. {
  236. // if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find ("OK")==-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find ("OK")==-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find ("OK")==-1)
  237. if( CheckOK(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd))==0 || CheckOK(m_List1array.ElementAt (ii).ElementAt (5+m_nAdd))==0 || CheckOK(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd))==0)
  238. {
  239. if(m_check1||m_check2)
  240. {
  241. if( (m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)<=strdate2) )
  242. {
  243. if(m_mode)
  244. {
  245. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  246. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  247. }
  248. else
  249. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  250. }
  251. }
  252. else if(m_mode)
  253. {
  254. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  255. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  256. }
  257. else
  258. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  259. }
  260. }
  261. }
  262. else
  263. {
  264. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  265. {
  266. if(m_check1||m_check2)
  267. {
  268. if( (m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)<=strdate2) )
  269. {
  270. if(m_mode)
  271. {
  272. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  273. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  274. }
  275. else
  276. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  277. }
  278. }
  279. else if(m_mode)
  280. {
  281. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  282. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  283. }
  284. else
  285. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  286. }
  287. }
  288. }
  289. else
  290. {
  291. if(bStatus)
  292. {
  293. int type=GetType(m_filter);
  294. if(type==1)//电话
  295. {
  296. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  297. {
  298. if( (m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find ("OK")==-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find ("OK")==-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find ("OK")==-1) &&(m_List1array.ElementAt (ii).ElementAt (9+m_nAdd).Find (m_filter)!=-1 || \
  299. m_List1array.ElementAt (ii).ElementAt (10+m_nAdd).Find (m_filter)!=-1))
  300. {
  301. if(m_check1||m_check2)
  302. {
  303. if( (m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)<=strdate2) )
  304. {
  305. if(m_mode)
  306. {
  307. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  308. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  309. }
  310. else
  311. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  312. }
  313. }
  314. else if(m_mode)
  315. {
  316. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  317. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  318. }
  319. else
  320. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  321. }
  322. }
  323. }
  324. else if(type==2)//拼音
  325. {
  326. m_filter.MakeUpper ();
  327. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  328. {
  329. if( (m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find ("OK")==-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find ("OK")==-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find ("OK")==-1) &&(m_List1array.ElementAt (ii).ElementAt (11+m_nAdd).Find (m_filter)!=-1 || \
  330. m_List1array.ElementAt (ii).ElementAt (12+m_nAdd).Find (m_filter)!=-1))
  331. {
  332. if(m_check1||m_check2)
  333. {
  334. if( (m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)<=strdate2) )
  335. {
  336. if(m_mode)
  337. {
  338. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  339. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  340. }
  341. else
  342. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  343. }
  344. }
  345. else if(m_mode)
  346. {
  347. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  348. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  349. }
  350. else
  351. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  352. }
  353. }
  354. }
  355. else
  356. {
  357. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  358. {
  359. if( (m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find ("OK")==-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find ("OK")==-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find ("OK")==-1) &&(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  360. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
  361. m_List1array.ElementAt (ii).ElementAt (2+m_nAdd).Find (m_filter)!=-1 || \
  362. m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 ))
  363. {
  364. if(m_check1||m_check2)
  365. {
  366. if( (m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)<=strdate2) )
  367. {
  368. if(m_mode)
  369. {
  370. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  371. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  372. }
  373. else
  374. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  375. }
  376. }
  377. else if(m_mode)
  378. {
  379. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  380. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  381. }
  382. else
  383. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  384. }
  385. }
  386. }
  387. }
  388. else
  389. {
  390. int type=GetType(m_filter);
  391. if(type==1)//电话
  392. {
  393. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  394. {
  395. if(m_List1array.ElementAt (ii).ElementAt (9+m_nAdd).Find (m_filter)!=-1 || \
  396. m_List1array.ElementAt (ii).ElementAt (10+m_nAdd).Find (m_filter)!=-1)
  397. {
  398. if(m_check1||m_check2)
  399. {
  400. if( (m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)<=strdate2) )
  401. {
  402. if(m_mode)
  403. {
  404. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  405. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  406. }
  407. else
  408. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  409. }
  410. }
  411. else if(m_mode)
  412. {
  413. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  414. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  415. }
  416. else
  417. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  418. }
  419. }
  420. }
  421. else if(type==2)//拼音
  422. {
  423. m_filter.MakeUpper ();
  424. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  425. {
  426. if(m_List1array.ElementAt (ii).ElementAt (11+m_nAdd).Find (m_filter)!=-1 || \
  427. m_List1array.ElementAt (ii).ElementAt (12+m_nAdd).Find (m_filter)!=-1)
  428. {
  429. if(m_check1||m_check2)
  430. {
  431. if( (m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)<=strdate2) )
  432. {
  433. if(m_mode)
  434. {
  435. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  436. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  437. }
  438. else
  439. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  440. }
  441. }
  442. else if(m_mode)
  443. {
  444. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  445. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  446. }
  447. else
  448. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  449. }
  450. }
  451. }
  452. else
  453. {
  454. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  455. {
  456. if(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
  457. m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
  458. m_List1array.ElementAt (ii).ElementAt (2+m_nAdd).Find (m_filter)!=-1 || \
  459. m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 )
  460. {
  461. if(m_check1||m_check2)
  462. {
  463. if( (m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (6+m_nAdd)<=strdate2)||(m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)>=strdate && m_List1array.ElementAt (ii).ElementAt (8+m_nAdd)<=strdate2) )
  464. {
  465. if(m_mode)
  466. {
  467. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  468. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  469. }
  470. else
  471. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  472. }
  473. }
  474. else if(m_mode)
  475. {
  476. if(m_List1array.ElementAt (ii).ElementAt (3+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_user.name)!=-1 || m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_user.name)!=-1)
  477. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  478. }
  479. else
  480. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  481. }
  482. }
  483. }
  484. }
  485. }
  486. m_List1.m_arLabels.SetSize(count, 1);
  487. ii=count;
  488. m_List1.m_LabelCount=ii;
  489. m_List1.SetItemCountEx (ii);
  490. CString str;
  491. str.Format ("单数:%d", ii);
  492. SetDlgItemText(IDC_STATIC2, str);
  493. }
  494. void DigitalWorkSet2::OnOK()
  495. {
  496. // TODO: Add extra validation here
  497. OnButton1();
  498. }
  499. void DigitalWorkSet2::OnCheck1()
  500. {
  501. // TODO: Add your control notification handler code here
  502. UpdateData();
  503. m_check2=0; UpdateData(false); OnButton1();
  504. }
  505. void DigitalWorkSet2::OnCheck2()
  506. {
  507. // TODO: Add your control notification handler code here
  508. UpdateData();
  509. m_check1=0; UpdateData(false); OnButton1();
  510. }
  511. void DigitalWorkSet2::OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult )
  512. {
  513. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  514. // Take the default processing unless we set this to something else below.
  515. *pResult = 0;
  516. // First thing - check the draw stage. If it's the control's prepaint
  517. // stage, then tell Windows we want messages for every item.
  518. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  519. {
  520. *pResult = CDRF_NOTIFYITEMDRAW;
  521. }
  522. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  523. {
  524. // This is the prepaint stage for an item. Here's where we set the
  525. // item's text color. Our return value will tell Windows to draw the
  526. // item itself, but it will use the new color we set here.
  527. // We'll cycle the colors through red, green, and light blue.
  528. if(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (3).Find ("OK")==-1 || m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (5).Find ("OK")==-1 || m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7).Find ("OK")==-1)
  529. pLVCD->clrText = RGB(220,0,0);
  530. else
  531. pLVCD->clrText = RGB(20,133,20);
  532. if(pLVCD->nmcd.dwItemSpec%2)
  533. pLVCD->clrTextBk = g_gridcol1;
  534. else
  535. pLVCD->clrTextBk = g_gridcol2;
  536. // Store the color back in the NMLVCUSTOMDRAW struct.
  537. // Tell Windows to paint the control itself.
  538. *pResult = CDRF_DODEFAULT;
  539. }
  540. }
  541. void DigitalWorkSet2::OnCheck3()
  542. {
  543. // TODO: Add your control notification handler code here
  544. OnButton1();
  545. }
  546. BOOL DigitalWorkSet2::CheckOK(CString str)
  547. {
  548. int pos=str.Find ("\/");
  549. if(pos==-1)
  550. {
  551. return 1;
  552. }
  553. if(str.Left (pos)=="")
  554. {
  555. return 1;
  556. }
  557. if(str.Find ("OK")==-1)
  558. {
  559. return 0;
  560. }
  561. return 1;
  562. }