outsourcing4.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  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. ON_WM_CTLCOLOR()
  70. END_MESSAGE_MAP()
  71. /////////////////////////////////////////////////////////////////////////////
  72. // outsourcing4 diagnostics
  73. #ifdef _DEBUG
  74. void outsourcing4::AssertValid() const
  75. {
  76. CDialog::AssertValid();
  77. }
  78. void outsourcing4::Dump(CDumpContext& dc) const
  79. {
  80. CDialog::Dump(dc);
  81. }
  82. #endif //_DEBUG
  83. /////////////////////////////////////////////////////////////////////////////
  84. // outsourcing4 message handlers
  85. extern BOOL CALLBACK EnumChildProc2(HWND hwnd, LPARAM lParam);
  86. BOOL outsourcing4::OnInitDialog()
  87. {
  88. CDialog::OnInitDialog();
  89. // TODO: Add your specialized code here and/or call the base class
  90. int i = 0;
  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 ( 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. g_WidthScale2 = (float)g_rc.Width() / (float)rc2.Width(); // new/Old
  105. g_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 // 2015-05-18 添加制作费;
  126. m_List1.SetHeadings("订单号,100;家长姓名,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;完成日期,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. for ( i = 0; i < g_List1array.GetSize(); i++)
  153. m_combosplb2.AddString(g_List1array.ElementAt(i).ElementAt(0));
  154. m_combosplb.ResetContent();
  155. 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;
  162. }
  163. void outsourcing4::FillGrid()
  164. {
  165. UpdateData();
  166. if (m_radio == 1)
  167. {
  168. FillGrid2();
  169. return;
  170. }
  171. else if (m_radio == 2)
  172. {
  173. FillGrid3();
  174. return;
  175. }
  176. m_List1.DeleteAllItems2();
  177. int ii = 0;
  178. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  179. int count = 0;
  180. CString str;
  181. CString splb = "全部";
  182. int pos = m_combosplb.GetCurSel();
  183. if (pos != -1)
  184. {
  185. m_combosplb.GetLBText(pos, splb);
  186. }
  187. if (splb == "全部")
  188. {
  189. if (!m_check1)
  190. {
  191. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  192. {
  193. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  194. }
  195. }
  196. else
  197. {
  198. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  199. {
  200. //if (m_List1array.ElementAt(ii).ElementAt(7) == "OK")continue;
  201. if (m_List1array.ElementAt(ii).ElementAt(8) == "OK")continue;
  202. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  203. if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
  204. {
  205. int aa = ii;
  206. while (aa)
  207. {
  208. if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
  209. aa--;
  210. }
  211. m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
  212. m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
  213. m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
  214. }
  215. }
  216. }
  217. }
  218. else
  219. {
  220. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  221. {
  222. if (m_List1array.ElementAt(ii).ElementAt(6).GetLength() < 4)continue;
  223. if (m_List1array.ElementAt(ii).ElementAt(6).Right(m_List1array.ElementAt(ii).ElementAt(6).GetLength() - 4) != splb)continue;
  224. if (m_List1array.ElementAt(ii).ElementAt(7).Find("工厂") == -1)continue;
  225. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  226. if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
  227. {
  228. int aa = ii;
  229. while (aa)
  230. {
  231. if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
  232. aa--;
  233. }
  234. m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
  235. m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
  236. m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
  237. }
  238. }
  239. }
  240. m_List1.m_arLabels.SetSize(count, 1);
  241. ii = count;
  242. m_List1.m_LabelCount = ii;
  243. m_List1.SetItemCountEx(ii);
  244. str.Format("项目:%d", ii);
  245. SetDlgItemText(IDC_STATIC2, str);
  246. }
  247. void outsourcing4::OnBUTclose()
  248. {
  249. // TODO: Add your control notification handler code here
  250. CDialog::OnCancel();
  251. }
  252. void outsourcing4::OnChangeEDITyear()
  253. {
  254. DateChange();
  255. }
  256. void outsourcing4::OnChangeEDITmonth()
  257. {
  258. DateChange();
  259. }
  260. void outsourcing4::OnChangeEDITday()
  261. {
  262. }
  263. void outsourcing4::DateChange()
  264. {
  265. if (m_bInit == 0)return;
  266. m_spinyear.EnableWindow(0);
  267. m_spinmonth.EnableWindow(0);
  268. m_spinday.EnableWindow(0);
  269. UpdateData();
  270. if (m_branch != "")
  271. {
  272. g_pMainWnd->OnDisconnect();
  273. g_branchip = GetIP(m_branch);
  274. g_pMainWnd->OnDisconnect();
  275. g_branchname = m_branch;
  276. g_bBranchModify = 1;
  277. }
  278. int i;
  279. int g_nYearposTemp = g_nYearpos;
  280. BOOL bLastYear = 0;
  281. BOOL bThisYear = 0;
  282. #if JEFF_TEST_ON // 2015开始禁用跨年数据;
  283. int g_nYearposPre = -1;
  284. if (m_year >= 2014 && m_year <= atoi(g_date.Left(4)) && g_hisyeararray.GetSize())
  285. {
  286. g_nYearpos = -1;
  287. bThisYear = 1;
  288. if (m_year == 2014)
  289. {
  290. g_nYearposPre = GetYearPos(m_year - 1);
  291. }
  292. }
  293. else if (m_year <= 2013 && g_hisyeararray.GetSize())
  294. {
  295. g_nYearpos = GetYearPos(m_year);
  296. if (g_nYearpos != -1)
  297. g_nYearposPre = GetYearPos(m_year - 1);
  298. bLastYear = 1;
  299. }
  300. #else
  301. if(m_year==atoi(g_date.Left (4)) && g_hisyeararray.GetSize () )
  302. bThisYear=1;
  303. else if(m_year<=atoi(g_date.Left (4))-1 && g_hisyeararray.GetSize ())
  304. bLastYear=1;
  305. g_nYearpos=GetYearPos(m_year);
  306. int g_nYearposPre=GetYearPos(m_year-1);
  307. #endif
  308. g_sendhead.bsql = 0;
  309. g_sendhead.code[0] = 219;
  310. g_sendhead.tabcount = 1;
  311. CString sql, strdate, strdate2;
  312. strdate.Format("%04d-%02d-%02d", m_year, m_month, 1);
  313. strdate2.Format("%04d-%02d-%02d", m_year, m_month, 31);
  314. m_static1.SetWindowText(strdate.Left(7) + "返工资料");
  315. sql.Format("[date2]>='" + strdate + "' and [date2]<='" + strdate2 + "' and [status4] like '返';");
  316. g_pMainWnd->ProcessChatMessageRequest2(sql);
  317. if (g_bSendOK == 0)
  318. {
  319. m_spinyear.EnableWindow(1);
  320. m_spinmonth.EnableWindow(1);
  321. m_spinday.EnableWindow(1);
  322. g_nYearpos = g_nYearposTemp;
  323. return;
  324. }
  325. DataToArray(&m_List1array);
  326. if (bLastYear)//如果是去年, 则加今年的补款
  327. {
  328. g_nYearpos = -1;//今年
  329. g_sendhead.bsql = 0;
  330. g_sendhead.code[0] = 219;
  331. g_sendhead.tabcount = 1;
  332. g_pMainWnd->ProcessChatMessageRequest2(sql);
  333. if (g_bSendOK == 0)
  334. {
  335. m_spinyear.EnableWindow(1);
  336. m_spinmonth.EnableWindow(1);
  337. m_spinday.EnableWindow(1);
  338. g_nYearpos = g_nYearposTemp;
  339. return;
  340. }
  341. CArray<CStringArray, CStringArray>ThisYearList1array;
  342. DataToArray(&ThisYearList1array);
  343. int oldsize = m_List1array.GetSize();
  344. m_List1array.SetSize(oldsize + ThisYearList1array.GetSize());
  345. for (i = oldsize; i < oldsize + ThisYearList1array.GetSize(); i++)
  346. {
  347. m_List1array.ElementAt(i).Copy(ThisYearList1array.ElementAt(i - oldsize));
  348. }
  349. }
  350. if (g_nYearposPre != -1)//如果是今年, 则加去年的补款
  351. {
  352. g_nYearpos = g_nYearposPre;//去年
  353. g_sendhead.bsql = 0;
  354. g_sendhead.code[0] = 219;
  355. g_sendhead.tabcount = 1;
  356. g_pMainWnd->ProcessChatMessageRequest2(sql);
  357. if (g_bSendOK == 0)
  358. {
  359. m_spinyear.EnableWindow(1);
  360. m_spinmonth.EnableWindow(1);
  361. m_spinday.EnableWindow(1);
  362. g_nYearpos = g_nYearposTemp;
  363. return;
  364. }
  365. CArray<CStringArray, CStringArray>ThisYearList1array;
  366. DataToArray(&ThisYearList1array);
  367. int oldsize = m_List1array.GetSize();
  368. m_List1array.SetSize(oldsize + ThisYearList1array.GetSize());
  369. for (i = oldsize; i < oldsize + ThisYearList1array.GetSize(); i++)
  370. {
  371. m_List1array.ElementAt(i).Copy(ThisYearList1array.ElementAt(i - oldsize));
  372. }
  373. }
  374. g_nYearpos = g_nYearposTemp;
  375. FillGrid();
  376. m_spinyear.EnableWindow(1);
  377. m_spinmonth.EnableWindow(1);
  378. m_spinday.EnableWindow(1);
  379. }
  380. void outsourcing4::OnSelchangeCOMBOsplb()
  381. {
  382. // TODO: Add your control notification handler code here
  383. FillGrid();
  384. }
  385. void outsourcing4::OnCheck1()
  386. {
  387. // TODO: Add your control notification handler code here
  388. FillGrid();
  389. }
  390. void outsourcing4::OnSelchangeCOMBOsplb2()
  391. {
  392. // TODO: Add your control notification handler code here
  393. int pos = m_combosplb2.GetCurSel();
  394. if (pos == -1)return;
  395. CString str;
  396. m_combosplb2.GetLBText(pos, str);
  397. m_combosp2.ResetContent();
  398. m_combosp2.AddString("全部");
  399. for (int ii = 0; ii < m_List3array.GetSize(); ii++)
  400. {
  401. if (m_List3array.ElementAt(ii).ElementAt(6) == str)
  402. {
  403. m_combosp2.AddString(m_List3array.ElementAt(ii).ElementAt(1));
  404. }
  405. }
  406. m_combosp2.SetCurSel(0);
  407. FillGrid();
  408. }
  409. void outsourcing4::FillGrid2()
  410. {
  411. m_List1.DeleteAllItems2();
  412. int ii = 0;
  413. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  414. int count = 0;
  415. CString str;
  416. CString splb = "全部";
  417. CString sp = "全部";
  418. int pos = m_combosplb2.GetCurSel();
  419. if (pos != -1)
  420. {
  421. m_combosplb2.GetLBText(pos, splb);
  422. }
  423. pos = m_combosp2.GetCurSel();
  424. if (pos != -1)
  425. {
  426. m_combosp2.GetLBText(pos, sp);
  427. }
  428. if (splb == "全部")
  429. {
  430. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  431. {
  432. if (m_check1)
  433. {
  434. if (m_List1array.ElementAt(ii).ElementAt(8) == "OK")continue;
  435. }
  436. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  437. }
  438. }
  439. else
  440. {
  441. if (sp != "全部")
  442. {
  443. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  444. {
  445. if (sp != m_List1array.ElementAt(ii).ElementAt(3))continue;
  446. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  447. if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
  448. {
  449. int aa = ii;
  450. while (aa)
  451. {
  452. if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
  453. aa--;
  454. }
  455. m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
  456. m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
  457. m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
  458. }
  459. }
  460. }
  461. else
  462. {
  463. CStringArray cursparray;
  464. for (int aa = 0; aa < m_combosp2.GetCount(); aa++)
  465. {
  466. m_combosp2.GetLBText(aa, str);
  467. cursparray.Add(str);
  468. }
  469. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  470. {
  471. BOOL bFind = 0;
  472. for (int aa = 0; aa < cursparray.GetSize(); aa++)
  473. {
  474. if (cursparray.ElementAt(aa) == m_List1array.ElementAt(ii).ElementAt(3))
  475. {
  476. bFind = 1; break;
  477. }
  478. }
  479. if (bFind == 0)continue;
  480. if (m_check1)
  481. {
  482. if (m_List1array.ElementAt(ii).ElementAt(8) == "OK")continue;
  483. }
  484. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  485. if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
  486. {
  487. int aa = ii;
  488. while (aa)
  489. {
  490. if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
  491. aa--;
  492. }
  493. m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
  494. m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
  495. m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
  496. }
  497. }
  498. }
  499. }
  500. m_List1.m_arLabels.SetSize(count, 1);
  501. ii = count;
  502. m_List1.m_LabelCount = ii;
  503. m_List1.SetItemCountEx(ii);
  504. str.Format("项目:%d", ii);
  505. SetDlgItemText(IDC_STATIC2, str);
  506. }
  507. void outsourcing4::OnSelchangeCOMBOsp2()
  508. {
  509. // TODO: Add your control notification handler code here
  510. FillGrid();
  511. }
  512. void outsourcing4::OnRadio3()
  513. {
  514. // TODO: Add your control notification handler code here
  515. UpdateData();
  516. GetDlgItem(IDC_STATIC5)->ShowWindow(m_radio == 0);
  517. GetDlgItem(IDC_COMBOsplb)->ShowWindow(m_radio == 0);
  518. GetDlgItem(IDC_STATIC6)->ShowWindow(m_radio == 1);
  519. GetDlgItem(IDC_STATIC7)->ShowWindow(m_radio == 1);
  520. GetDlgItem(IDC_COMBOsplb2)->ShowWindow(m_radio == 1);
  521. GetDlgItem(IDC_COMBOsp2)->ShowWindow(m_radio == 1);
  522. GetDlgItem(IDC_STATIC8)->ShowWindow(m_radio == 2);
  523. GetDlgItem(IDC_COMBOsplb3)->ShowWindow(m_radio == 2);
  524. FillGrid();
  525. }
  526. void outsourcing4::OnRadio4()
  527. {
  528. // TODO: Add your control notification handler code here
  529. OnRadio3();
  530. }
  531. void outsourcing4::OnBUTprint()
  532. {
  533. // TODO: Add your control notification handler code here
  534. UpdateData();
  535. CString str;
  536. str.Format("c:\\%d%02d返工资料.xls", m_year, m_month);
  537. ListToXLS(&m_List1, str, 0);
  538. }
  539. void outsourcing4::OnSelchangeCOMBOsplb3()
  540. {
  541. // TODO: Add your control notification handler code here
  542. }
  543. void outsourcing4::OnCloseupCOMBOsplb3()
  544. {
  545. // TODO: Add your control notification handler code here
  546. FillGrid();
  547. }
  548. void outsourcing4::OnRadio5()
  549. {
  550. // TODO: Add your control notification handler code here
  551. OnRadio3();
  552. }
  553. void outsourcing4::FillGrid3()
  554. {
  555. UpdateData();
  556. m_List1.DeleteAllItems2();
  557. int ii = 0;
  558. m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
  559. int count = 0;
  560. CString str;
  561. CString splb = "全部";
  562. int pos = m_waiter1.GetCurSel();
  563. if (pos != -1)
  564. {
  565. m_waiter1.GetLBText(pos, splb);
  566. }
  567. if (splb == "全部" || splb == "")
  568. {
  569. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  570. {
  571. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  572. }
  573. }
  574. else
  575. {
  576. splb = "员工:" + splb;
  577. for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
  578. {
  579. // if(m_List1array.ElementAt (ii).ElementAt (5).GetLength ()<4)continue;
  580. // if(m_List1array.ElementAt (ii).ElementAt (5).Right (m_List1array.ElementAt (ii).ElementAt (5).GetLength ()-4)!=splb)continue;
  581. if (m_List1array.ElementAt(ii).ElementAt(7).Find(splb) == -1)continue;
  582. m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
  583. if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
  584. {
  585. int aa = ii;
  586. while (aa)
  587. {
  588. if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
  589. aa--;
  590. }
  591. m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
  592. m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
  593. m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
  594. }
  595. }
  596. }
  597. m_List1.m_arLabels.SetSize(count, 1);
  598. ii = count;
  599. m_List1.m_LabelCount = ii;
  600. m_List1.SetItemCountEx(ii);
  601. str.Format("项目:%d", ii);
  602. SetDlgItemText(IDC_STATIC2, str);
  603. }
  604. void outsourcing4::OnSelchangeCOMBObranch()
  605. {
  606. int pos = m_combobranch.GetCurSel();
  607. if (pos == -1)return;
  608. m_combobranch.GetLBText(pos, m_branch);
  609. DateChange();
  610. g_sendhead.bsql = 0;
  611. g_sendhead.code[0] = 2;
  612. g_sendhead.code[1] = 4;
  613. g_sendhead.code[2] = 9;
  614. g_sendhead.tabcount = 3;
  615. g_pMainWnd->ProcessChatMessageRequest2(1);
  616. if (g_bSendOK == 0)
  617. {
  618. return;
  619. }
  620. CArray<CStringArray, CStringArray>g_List2array;
  621. DataToArray(&g_List1array, &m_List3array, &g_List2array);
  622. m_combosplb2.ResetContent();
  623. m_combosplb2.AddString("全部");
  624. int i = 0;
  625. for ( i = 0; i < g_List1array.GetSize(); i++)
  626. m_combosplb2.AddString(g_List1array.ElementAt(i).ElementAt(0));
  627. m_combosplb.ResetContent();
  628. m_combosplb.AddString("全部");
  629. for (i = 0; i < g_List2array.GetSize(); i++)
  630. {
  631. m_combosplb.AddString(g_List2array.ElementAt(i).ElementAt(1));
  632. }
  633. m_combosplb.SetCurSel(0);
  634. }
  635. HBRUSH outsourcing4::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  636. {
  637. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  638. // TODO: 在此更改 DC 的任何属性
  639. if ( nCtlColor == CTLCOLOR_DLG )
  640. return g_dlgBrush;
  641. else if ( nCtlColor == CTLCOLOR_STATIC )
  642. {
  643. //pDC->SetBkColor(g_bkcol);
  644. pDC->SetBkMode(TRANSPARENT);
  645. hbr=(HBRUSH)g_dlgBrush;
  646. }
  647. // TODO: 如果默认的不是所需画笔,则返回另一个画笔
  648. return hbr;
  649. }