DigitalWorkSet2.cpp 22 KB

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