outsourcing3.cpp 17 KB

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