outsourcing3.cpp 17 KB

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