outsourcing4.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. // outsourcing4.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "outsourcing4.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // outsourcing4
  13. outsourcing4::outsourcing4(CWnd* pParent /*=NULL*/)
  14. : CDialog(outsourcing4::IDD)
  15. {
  16. //{{AFX_DATA_INIT(outsourcing4)
  17. m_year = atoi(g_date.Mid (0,4));
  18. m_month = atoi(g_date.Mid (5,2));
  19. m_day = atoi(g_date.Mid (8,2));
  20. m_check1 = FALSE;
  21. m_bInit=0;
  22. m_timestmap=0;
  23. m_radio = 0;
  24. //}}AFX_DATA_INIT
  25. }
  26. void outsourcing4::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CDialog::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(outsourcing4)
  30. DDX_Control(pDX, IDC_COMBObranch, m_combobranch);
  31. DDX_Control(pDX, IDC_COMBOsplb3, m_waiter1);
  32. DDX_Control(pDX, IDC_COMBOsplb2, m_combosplb2);
  33. DDX_Control(pDX, IDC_COMBOsp2, m_combosp2);
  34. DDX_Control(pDX, IDC_COMBOsp, m_combosp);
  35. DDX_Control(pDX, IDC_COMBOsplb, m_combosplb);
  36. DDX_Control(pDX, IDC_SPIN3, m_spinday);
  37. DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
  38. DDX_Control(pDX, IDC_SPIN1, m_spinyear);
  39. DDX_Control(pDX, IDC_LIST2, m_List1);
  40. DDX_Control(pDX, IDC_STATIC1, m_static1);
  41. DDX_Text(pDX, IDC_EDITyear, m_year);
  42. DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
  43. DDX_Text(pDX, IDC_EDITmonth, m_month);
  44. DDV_MinMaxUInt(pDX, m_month, 1, 12);
  45. DDX_Text(pDX, IDC_EDITday, m_day);
  46. DDV_MinMaxUInt(pDX, m_day, 1, 31);
  47. DDX_Check(pDX, IDC_CHECK1, m_check1);
  48. DDX_Radio(pDX, IDC_RADIO3, m_radio);
  49. //}}AFX_DATA_MAP
  50. }
  51. BEGIN_MESSAGE_MAP(outsourcing4, CDialog)
  52. //{{AFX_MSG_MAP(outsourcing4)
  53. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  54. ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
  55. ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
  56. ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
  57. ON_CBN_SELCHANGE(IDC_COMBOsplb, OnSelchangeCOMBOsplb)
  58. ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  59. ON_CBN_SELCHANGE(IDC_COMBOsplb2, OnSelchangeCOMBOsplb2)
  60. ON_CBN_SELCHANGE(IDC_COMBOsp2, OnSelchangeCOMBOsp2)
  61. ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
  62. ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
  63. ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
  64. ON_CBN_SELCHANGE(IDC_COMBOsplb3, OnSelchangeCOMBOsplb3)
  65. ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
  66. ON_CBN_CLOSEUP(IDC_COMBOsplb3, OnCloseupCOMBOsplb3)
  67. ON_CBN_SELCHANGE(IDC_COMBObranch, OnSelchangeCOMBObranch)
  68. //}}AFX_MSG_MAP
  69. END_MESSAGE_MAP()
  70. /////////////////////////////////////////////////////////////////////////////
  71. // outsourcing4 diagnostics
  72. #ifdef _DEBUG
  73. void outsourcing4::AssertValid() const
  74. {
  75. CDialog::AssertValid();
  76. }
  77. void outsourcing4::Dump(CDumpContext& dc) const
  78. {
  79. CDialog::Dump(dc);
  80. }
  81. #endif //_DEBUG
  82. /////////////////////////////////////////////////////////////////////////////
  83. // outsourcing4 message handlers
  84. extern BOOL CALLBACK EnumChildProc2(HWND hwnd,LPARAM lParam);
  85. extern float m_WidthScale2;
  86. extern float m_HeightScale2;
  87. BOOL outsourcing4::OnInitDialog()
  88. {
  89. CDialog::OnInitDialog();
  90. // TODO: Add your specialized code here and/or call the base class
  91. if(g_bAllBranch)
  92. {
  93. GetDlgItem(IDC_STATIC3)->ShowWindow(SW_SHOW);
  94. GetDlgItem(IDC_COMBObranch)->ShowWindow(SW_SHOW);
  95. // m_combobranch.AddString ("");
  96. for(int i=0; i<g_brancharray.GetSize (); i++)
  97. {
  98. m_combobranch.AddString (g_brancharray.ElementAt (i).ElementAt (0));
  99. }
  100. }
  101. CRect rc2;
  102. GetWindowRect(rc2);
  103. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  104. m_WidthScale2 = (float)g_rc.Width()/(float)rc2.Width(); // new/Old
  105. m_HeightScale2 = (float)g_rc.Height()/(float)rc2.Height();
  106. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc2,0);
  107. m_waiter1.RefDroppedWidth();
  108. m_combosplb.GetWindowRect (rc2);
  109. ScreenToClient(rc2);
  110. rc2.bottom +=200;
  111. m_combosplb.MoveWindow (rc2);
  112. m_combosp.GetWindowRect (rc2);
  113. ScreenToClient(rc2);
  114. rc2.bottom +=200;
  115. m_combosp.MoveWindow (rc2);
  116. m_combosplb2.GetWindowRect (rc2);
  117. ScreenToClient(rc2);
  118. rc2.bottom +=200;
  119. m_combosplb2.MoveWindow (rc2);
  120. m_combosp2.GetWindowRect (rc2);
  121. ScreenToClient(rc2);
  122. rc2.bottom +=200;
  123. m_combosp2.MoveWindow (rc2);
  124. m_static1.SetFont (&g_titlefont);
  125. #ifdef CHILD_VERSION
  126. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;产品名称,100;数量,100;是否发出,100;是否返工,100;返工日期,100;是否完成,100;完成日期,100" );
  127. #else
  128. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;产品名称,100;数量,100;是否发出,100;是否返工,100;返工日期,100;是否完成,100;完成日期,100" );
  129. #endif
  130. m_List1.m_bSortSupport=0;
  131. m_List1.LoadColumnInfo (180);
  132. m_spinyear.SetRange (1900, 3000);
  133. m_spinmonth.SetRange (1, 12);
  134. m_spinday.SetRange (1, 31);
  135. m_bInit=1;
  136. DateChange();
  137. g_sendhead.bsql=0;
  138. g_sendhead.code[0]=2;
  139. g_sendhead.code[1]=4;
  140. g_sendhead.code[2]=9;
  141. g_sendhead.tabcount=3;
  142. g_pMainWnd->ProcessChatMessageRequest2(1);
  143. if(g_bSendOK==0)
  144. {
  145. CDialog::OnOK();
  146. return 0;
  147. }
  148. CArray<CStringArray, CStringArray>g_List2array;
  149. DataToArray(&g_List1array, &m_List3array, &g_List2array);
  150. m_combosplb2.ResetContent ();
  151. m_combosplb2.AddString ("全部");
  152. int i = 0;
  153. for( i=0; i<g_List1array.GetSize (); i++)
  154. m_combosplb2.AddString (g_List1array.ElementAt (i).ElementAt (0));
  155. m_combosplb.ResetContent ();m_combosplb.AddString("全部");
  156. for( i=0; i<g_List2array.GetSize (); i++)
  157. {
  158. m_combosplb.AddString (g_List2array.ElementAt (i).ElementAt (1));
  159. }
  160. m_combosplb.SetCurSel (0);
  161. return TRUE; // return TRUE unless you set the focus to a control
  162. // EXCEPTION: OCX Property Pages should return FALSE
  163. }
  164. void outsourcing4::FillGrid()
  165. {
  166. UpdateData();
  167. if(m_radio==1)
  168. {
  169. FillGrid2();return;
  170. }
  171. else if(m_radio==2)
  172. {
  173. FillGrid3();return;
  174. }
  175. m_List1.DeleteAllItems2 ();
  176. int ii=0;
  177. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  178. int count=0;
  179. CString str;
  180. CString splb="全部";
  181. int pos=m_combosplb.GetCurSel ();
  182. if(pos!=-1)
  183. {
  184. m_combosplb.GetLBText (pos, splb);
  185. }
  186. if(splb=="全部")
  187. {
  188. if(!m_check1)
  189. {
  190. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  191. {
  192. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  193. }
  194. }
  195. else
  196. {
  197. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  198. {
  199. if(m_List1array.ElementAt (ii).ElementAt (7) =="OK")continue;
  200. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  201. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  202. {
  203. int aa=ii;
  204. while(aa)
  205. {
  206. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  207. aa--;
  208. }
  209. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  210. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  211. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  212. }
  213. }
  214. }
  215. }
  216. else
  217. {
  218. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  219. {
  220. if(m_List1array.ElementAt (ii).ElementAt (5).GetLength ()<4)continue;
  221. if(m_List1array.ElementAt (ii).ElementAt (5).Right (m_List1array.ElementAt (ii).ElementAt (5).GetLength ()-4)!=splb)continue;
  222. if(m_List1array.ElementAt (ii).ElementAt (6).Find("工厂")==-1)continue;
  223. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  224. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  225. {
  226. int aa=ii;
  227. while(aa)
  228. {
  229. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  230. aa--;
  231. }
  232. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  233. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  234. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  235. }
  236. }
  237. }
  238. m_List1.m_arLabels.SetSize(count, 1);
  239. ii=count;
  240. m_List1.m_LabelCount=ii;
  241. m_List1.SetItemCountEx (ii);
  242. str.Format ("项目:%d", ii);
  243. SetDlgItemText(IDC_STATIC2, str);
  244. }
  245. void outsourcing4::OnBUTclose()
  246. {
  247. // TODO: Add your control notification handler code here
  248. CDialog::OnCancel ();
  249. }
  250. void outsourcing4::OnChangeEDITyear()
  251. {
  252. // TODO: If this is a RICHEDIT control, the control will not
  253. // send this notification unless you override the CDialog::OnInitDialog()
  254. // function and call CRichEditCtrl().SetEventMask()
  255. // with the ENM_CHANGE flag ORed into the mask.
  256. DateChange();
  257. // TODO: Add your control notification handler code here
  258. }
  259. void outsourcing4::OnChangeEDITmonth()
  260. {
  261. // TODO: If this is a RICHEDIT control, the control will not
  262. // send this notification unless you override the CDialog::OnInitDialog()
  263. // function and call CRichEditCtrl().SetEventMask()
  264. // with the ENM_CHANGE flag ORed into the mask.
  265. DateChange();
  266. // TODO: Add your control notification handler code here
  267. }
  268. void outsourcing4::OnChangeEDITday()
  269. {
  270. // TODO: If this is a RICHEDIT control, the control will not
  271. // send this notification unless you override the CDialog::OnInitDialog()
  272. // function and call CRichEditCtrl().SetEventMask()
  273. // with the ENM_CHANGE flag ORed into the mask.
  274. // DateChange();
  275. // TODO: Add your control notification handler code here
  276. }
  277. void outsourcing4::DateChange()
  278. {
  279. if(m_bInit==0)return;
  280. m_spinyear.EnableWindow(0);
  281. m_spinmonth.EnableWindow(0);
  282. m_spinday.EnableWindow(0);
  283. UpdateData();
  284. if(m_branch!="")
  285. {
  286. g_pMainWnd->OnDisconnect();
  287. g_branchip=GetIP(m_branch);
  288. g_pMainWnd->OnDisconnect();
  289. g_branchname=m_branch;
  290. g_bBranchModify=1;
  291. }
  292. int i;
  293. int g_nYearposTemp=g_nYearpos;
  294. BOOL bLastYear=0;
  295. BOOL bThisYear=0;
  296. if(m_year==atoi(g_date.Left (4)) && g_hisyeararray.GetSize () )
  297. bThisYear=1;
  298. else if(m_year<=atoi(g_date.Left (4))-1 && g_hisyeararray.GetSize ())
  299. bLastYear=1;
  300. g_nYearpos=GetYearPos(m_year);
  301. int g_nYearposPre=GetYearPos(m_year-1);
  302. g_sendhead.bsql=0;
  303. g_sendhead.code[0]=219;
  304. g_sendhead.tabcount=1;
  305. CString sql,strdate,strdate2;
  306. strdate.Format ("%04d-%02d-%02d", m_year, m_month, 1);
  307. strdate2.Format ("%04d-%02d-%02d", m_year, m_month, 31);
  308. m_static1.SetWindowText (strdate.Left (7)+"返工资料");
  309. sql.Format ("[date2]>='"+strdate+"' and [date2]<='"+strdate2+"' and [status4] like '返';");
  310. g_pMainWnd->ProcessChatMessageRequest2(sql);
  311. if(g_bSendOK==0)
  312. {
  313. m_spinyear.EnableWindow(1);
  314. m_spinmonth.EnableWindow(1);
  315. m_spinday.EnableWindow(1);
  316. g_nYearpos=g_nYearposTemp;
  317. return;
  318. }
  319. DataToArray(&m_List1array);
  320. if(bLastYear)//如果是去年, 则加今年的补款
  321. {
  322. g_nYearpos=-1;//今年
  323. g_sendhead.bsql=0;
  324. g_sendhead.code[0]=219;
  325. g_sendhead.tabcount=1;
  326. g_pMainWnd->ProcessChatMessageRequest2(sql);
  327. if(g_bSendOK==0)
  328. {
  329. m_spinyear.EnableWindow(1);
  330. m_spinmonth.EnableWindow(1);
  331. m_spinday.EnableWindow(1);
  332. g_nYearpos=g_nYearposTemp;
  333. return;
  334. }
  335. CArray<CStringArray, CStringArray>ThisYearList1array;
  336. DataToArray(&ThisYearList1array);
  337. int oldsize=m_List1array.GetSize ();
  338. m_List1array.SetSize(oldsize+ThisYearList1array.GetSize ());
  339. for(i=oldsize; i<oldsize+ThisYearList1array.GetSize (); i++)
  340. {
  341. m_List1array.ElementAt (i).Copy(ThisYearList1array.ElementAt (i-oldsize));
  342. }
  343. }
  344. if(g_nYearposPre!=-1)//如果是今年, 则加去年的补款
  345. {
  346. g_nYearpos=g_nYearposPre;//去年
  347. g_sendhead.bsql=0;
  348. g_sendhead.code[0]=219;
  349. g_sendhead.tabcount=1;
  350. g_pMainWnd->ProcessChatMessageRequest2(sql);
  351. if(g_bSendOK==0)
  352. {
  353. m_spinyear.EnableWindow(1);
  354. m_spinmonth.EnableWindow(1);
  355. m_spinday.EnableWindow(1);
  356. g_nYearpos=g_nYearposTemp;
  357. return;
  358. }
  359. CArray<CStringArray, CStringArray>ThisYearList1array;
  360. DataToArray(&ThisYearList1array);
  361. int oldsize=m_List1array.GetSize ();
  362. m_List1array.SetSize(oldsize+ThisYearList1array.GetSize ());
  363. for(i=oldsize; i<oldsize+ThisYearList1array.GetSize (); i++)
  364. {
  365. m_List1array.ElementAt (i).Copy(ThisYearList1array.ElementAt (i-oldsize));
  366. }
  367. }
  368. g_nYearpos=g_nYearposTemp;
  369. FillGrid();
  370. m_spinyear.EnableWindow(1);
  371. m_spinmonth.EnableWindow(1);
  372. m_spinday.EnableWindow(1);
  373. }
  374. void outsourcing4::OnSelchangeCOMBOsplb()
  375. {
  376. // TODO: Add your control notification handler code here
  377. FillGrid();
  378. }
  379. void outsourcing4::OnCheck1()
  380. {
  381. // TODO: Add your control notification handler code here
  382. FillGrid();
  383. }
  384. void outsourcing4::OnSelchangeCOMBOsplb2()
  385. {
  386. // TODO: Add your control notification handler code here
  387. int pos=m_combosplb2.GetCurSel ();
  388. if(pos==-1)return;
  389. CString str;
  390. m_combosplb2.GetLBText (pos, str);
  391. m_combosp2.ResetContent ();
  392. m_combosp2.AddString ("全部");
  393. for(int ii=0; ii<m_List3array.GetSize (); ii++)
  394. {
  395. if(m_List3array.ElementAt (ii).ElementAt (6)==str)
  396. {
  397. m_combosp2.AddString (m_List3array.ElementAt (ii).ElementAt (1));
  398. }
  399. }
  400. m_combosp2.SetCurSel (0); FillGrid();
  401. }
  402. void outsourcing4::FillGrid2()
  403. {
  404. m_List1.DeleteAllItems2 ();
  405. int ii=0;
  406. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  407. int count=0;
  408. CString str;
  409. CString splb="全部";
  410. CString sp="全部";
  411. int pos=m_combosplb2.GetCurSel ();
  412. if(pos!=-1)
  413. {
  414. m_combosplb2.GetLBText (pos, splb);
  415. }
  416. pos=m_combosp2.GetCurSel ();
  417. if(pos!=-1)
  418. {
  419. m_combosp2.GetLBText (pos, sp);
  420. }
  421. if(splb=="全部")
  422. {
  423. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  424. {
  425. if(m_check1)
  426. {
  427. if(m_List1array.ElementAt (ii).ElementAt (7) =="OK")continue;
  428. }
  429. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  430. }
  431. }
  432. else
  433. {
  434. if(sp!="全部")
  435. {
  436. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  437. {
  438. if(sp!=m_List1array.ElementAt (ii).ElementAt (3))continue;
  439. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  440. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  441. {
  442. int aa=ii;
  443. while(aa)
  444. {
  445. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  446. aa--;
  447. }
  448. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  449. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  450. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  451. }
  452. }
  453. }
  454. else
  455. {
  456. CStringArray cursparray;
  457. for(int aa=0; aa<m_combosp2.GetCount (); aa++)
  458. {
  459. m_combosp2.GetLBText (aa, str);
  460. cursparray.Add(str);
  461. }
  462. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  463. {
  464. BOOL bFind=0;
  465. for(int aa=0; aa<cursparray.GetSize(); aa++)
  466. {
  467. if(cursparray.ElementAt(aa)==m_List1array.ElementAt (ii).ElementAt (3))
  468. {
  469. bFind=1;break;
  470. }
  471. }
  472. if(bFind==0)continue;
  473. if(m_check1)
  474. {
  475. if(m_List1array.ElementAt (ii).ElementAt (7) =="OK")continue;
  476. }
  477. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  478. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  479. {
  480. int aa=ii;
  481. while(aa)
  482. {
  483. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  484. aa--;
  485. }
  486. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  487. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  488. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  489. }
  490. }
  491. }
  492. }
  493. m_List1.m_arLabels.SetSize(count, 1);
  494. ii=count;
  495. m_List1.m_LabelCount=ii;
  496. m_List1.SetItemCountEx (ii);
  497. str.Format ("项目:%d", ii);
  498. SetDlgItemText(IDC_STATIC2, str);
  499. }
  500. void outsourcing4::OnSelchangeCOMBOsp2()
  501. {
  502. // TODO: Add your control notification handler code here
  503. FillGrid();
  504. }
  505. void outsourcing4::OnRadio3()
  506. {
  507. // TODO: Add your control notification handler code here
  508. UpdateData();
  509. GetDlgItem(IDC_STATIC5)->ShowWindow(m_radio==0);
  510. GetDlgItem(IDC_COMBOsplb)->ShowWindow(m_radio==0);
  511. GetDlgItem(IDC_STATIC6)->ShowWindow(m_radio==1);
  512. GetDlgItem(IDC_STATIC7)->ShowWindow(m_radio==1);
  513. GetDlgItem(IDC_COMBOsplb2)->ShowWindow(m_radio==1);
  514. GetDlgItem(IDC_COMBOsp2)->ShowWindow(m_radio==1);
  515. GetDlgItem(IDC_STATIC8)->ShowWindow(m_radio==2);
  516. GetDlgItem(IDC_COMBOsplb3)->ShowWindow(m_radio==2);
  517. FillGrid();
  518. }
  519. void outsourcing4::OnRadio4()
  520. {
  521. // TODO: Add your control notification handler code here
  522. OnRadio3();
  523. }
  524. void outsourcing4::OnBUTprint()
  525. {
  526. // TODO: Add your control notification handler code here
  527. UpdateData();
  528. CString str;
  529. str.Format ("c:\\%d%02d返工资料.xls", m_year, m_month);
  530. ListToXLS(&m_List1, str, 0);
  531. }
  532. void outsourcing4::OnSelchangeCOMBOsplb3()
  533. {
  534. // TODO: Add your control notification handler code here
  535. }
  536. void outsourcing4::OnCloseupCOMBOsplb3()
  537. {
  538. // TODO: Add your control notification handler code here
  539. FillGrid();
  540. }
  541. void outsourcing4::OnRadio5()
  542. {
  543. // TODO: Add your control notification handler code here
  544. OnRadio3();
  545. }
  546. void outsourcing4::FillGrid3()
  547. {
  548. UpdateData();
  549. m_List1.DeleteAllItems2 ();
  550. int ii=0;
  551. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  552. int count=0;
  553. CString str;
  554. CString splb="全部";
  555. int pos=m_waiter1.GetCurSel ();
  556. if(pos!=-1)
  557. {
  558. m_waiter1.GetLBText (pos, splb);
  559. }
  560. if(splb=="全部"||splb=="")
  561. {
  562. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  563. {
  564. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  565. }
  566. }
  567. else
  568. {
  569. splb="员工:"+splb;
  570. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  571. {
  572. // if(m_List1array.ElementAt (ii).ElementAt (5).GetLength ()<4)continue;
  573. // if(m_List1array.ElementAt (ii).ElementAt (5).Right (m_List1array.ElementAt (ii).ElementAt (5).GetLength ()-4)!=splb)continue;
  574. if(m_List1array.ElementAt (ii).ElementAt (6).Find(splb)==-1)continue;
  575. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  576. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  577. {
  578. int aa=ii;
  579. while(aa)
  580. {
  581. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  582. aa--;
  583. }
  584. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  585. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  586. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  587. }
  588. }
  589. }
  590. m_List1.m_arLabels.SetSize(count, 1);
  591. ii=count;
  592. m_List1.m_LabelCount=ii;
  593. m_List1.SetItemCountEx (ii);
  594. str.Format ("项目:%d", ii);
  595. SetDlgItemText(IDC_STATIC2, str);
  596. }
  597. void outsourcing4::OnSelchangeCOMBObranch()
  598. {
  599. // TODO: Add your control notification handler code here
  600. int pos=m_combobranch.GetCurSel();
  601. if(pos==-1)return;
  602. m_combobranch.GetLBText(pos, m_branch);
  603. DateChange();
  604. g_sendhead.bsql=0;
  605. g_sendhead.code[0]=2;
  606. g_sendhead.code[1]=4;
  607. g_sendhead.code[2]=9;
  608. g_sendhead.tabcount=3;
  609. g_pMainWnd->ProcessChatMessageRequest2(1);
  610. if(g_bSendOK==0)
  611. {
  612. return ;
  613. }
  614. CArray<CStringArray, CStringArray>g_List2array;
  615. DataToArray(&g_List1array, &m_List3array, &g_List2array);
  616. m_combosplb2.ResetContent ();
  617. m_combosplb2.AddString ("全部");
  618. int i = 0;
  619. for( i=0; i<g_List1array.GetSize (); i++)
  620. m_combosplb2.AddString (g_List1array.ElementAt (i).ElementAt (0));
  621. m_combosplb.ResetContent ();m_combosplb.AddString("全部");
  622. for( i=0; i<g_List2array.GetSize (); i++)
  623. {
  624. m_combosplb.AddString (g_List2array.ElementAt (i).ElementAt (1));
  625. }
  626. m_combosplb.SetCurSel (0);
  627. }