outsourcing3.cpp 17 KB

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