123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709 |
- // outsourcing4.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "outsourcing4.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // outsourcing4
- outsourcing4::outsourcing4(CWnd* pParent /*=NULL*/)
- : CDialog(outsourcing4::IDD)
- {
- //{{AFX_DATA_INIT(outsourcing4)
- m_year = atoi(g_date.Mid(0, 4));
- m_month = atoi(g_date.Mid(5, 2));
- m_day = atoi(g_date.Mid(8, 2));
- m_check1 = FALSE;
- m_bInit = 0;
- m_timestmap = 0;
- m_radio = 0;
- //}}AFX_DATA_INIT
- }
- void outsourcing4::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(outsourcing4)
- DDX_Control(pDX, IDC_COMBObranch, m_combobranch);
- DDX_Control(pDX, IDC_COMBOsplb3, m_waiter1);
- DDX_Control(pDX, IDC_COMBOsplb2, m_combosplb2);
- DDX_Control(pDX, IDC_COMBOsp2, m_combosp2);
- DDX_Control(pDX, IDC_COMBOsp, m_combosp);
- DDX_Control(pDX, IDC_COMBOsplb, m_combosplb);
- DDX_Control(pDX, IDC_SPIN3, m_spinday);
- DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
- DDX_Control(pDX, IDC_SPIN1, m_spinyear);
- DDX_Control(pDX, IDC_LIST2, m_List1);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_Text(pDX, IDC_EDITyear, m_year);
- DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
- DDX_Text(pDX, IDC_EDITmonth, m_month);
- DDV_MinMaxUInt(pDX, m_month, 1, 12);
- DDX_Text(pDX, IDC_EDITday, m_day);
- DDV_MinMaxUInt(pDX, m_day, 1, 31);
- DDX_Check(pDX, IDC_CHECK1, m_check1);
- DDX_Radio(pDX, IDC_RADIO3, m_radio);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(outsourcing4, CDialog)
- //{{AFX_MSG_MAP(outsourcing4)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
- ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
- ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
- ON_CBN_SELCHANGE(IDC_COMBOsplb, OnSelchangeCOMBOsplb)
- ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
- ON_CBN_SELCHANGE(IDC_COMBOsplb2, OnSelchangeCOMBOsplb2)
- ON_CBN_SELCHANGE(IDC_COMBOsp2, OnSelchangeCOMBOsp2)
- ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
- ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
- ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
- ON_CBN_SELCHANGE(IDC_COMBOsplb3, OnSelchangeCOMBOsplb3)
- ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
- ON_CBN_CLOSEUP(IDC_COMBOsplb3, OnCloseupCOMBOsplb3)
- ON_CBN_SELCHANGE(IDC_COMBObranch, OnSelchangeCOMBObranch)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // outsourcing4 diagnostics
- #ifdef _DEBUG
- void outsourcing4::AssertValid() const
- {
- CDialog::AssertValid();
- }
- void outsourcing4::Dump(CDumpContext& dc) const
- {
- CDialog::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // outsourcing4 message handlers
- extern BOOL CALLBACK EnumChildProc2(HWND hwnd, LPARAM lParam);
- BOOL outsourcing4::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add your specialized code here and/or call the base class
- int i = 0;
- if (g_bAllBranch)
- {
- GetDlgItem(IDC_STATIC3)->ShowWindow(SW_SHOW);
- GetDlgItem(IDC_COMBObranch)->ShowWindow(SW_SHOW);
- // m_combobranch.AddString ("");
- for ( i = 0; i < g_brancharray.GetSize(); i++)
- {
- m_combobranch.AddString(g_brancharray.ElementAt(i).ElementAt(0));
- }
- }
- CRect rc2;
- GetWindowRect(rc2);
- ::MoveWindow(m_hWnd, g_rc.left, g_rc.top, g_rc.Width(), g_rc.Height(), TRUE);
- g_WidthScale2 = (float)g_rc.Width() / (float)rc2.Width(); // new/Old
- g_HeightScale2 = (float)g_rc.Height() / (float)rc2.Height();
- EnumChildWindows(m_hWnd, (WNDENUMPROC)EnumChildProc2, 0);
- m_waiter1.RefDroppedWidth();
- m_combosplb.GetWindowRect(rc2);
- ScreenToClient(rc2);
- rc2.bottom += 200;
- m_combosplb.MoveWindow(rc2);
- m_combosp.GetWindowRect(rc2);
- ScreenToClient(rc2);
- rc2.bottom += 200;
- m_combosp.MoveWindow(rc2);
- m_combosplb2.GetWindowRect(rc2);
- ScreenToClient(rc2);
- rc2.bottom += 200;
- m_combosplb2.MoveWindow(rc2);
- m_combosp2.GetWindowRect(rc2);
- ScreenToClient(rc2);
- rc2.bottom += 200;
- m_combosp2.MoveWindow(rc2);
- m_static1.SetFont(&g_titlefont);
- #ifdef CHILD_VERSION // 2015-05-18 添加制作费;
- m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;产品名称,100;制作费,100;数量,100;是否发出,100;是否返工,100;返工日期,100;是否完成,100;完成日期,100" );
- #else
- m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;产品名称,100;制作费,100;数量,100;是否发出,100;是否返工,100;返工日期,100;是否完成,100;完成日期,100");
- #endif
- m_List1.m_bSortSupport = 0;
- m_List1.LoadColumnInfo(180);
- m_spinyear.SetRange(1900, 3000);
- m_spinmonth.SetRange(1, 12);
- m_spinday.SetRange(1, 31);
- m_bInit = 1;
- DateChange();
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 2; // 商品类别表;
- g_sendhead.code[1] = 4; // 商品表;
- g_sendhead.code[2] = 9; // 供应商表;
- g_sendhead.tabcount = 3;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if (g_bSendOK == 0)
- {
- CDialog::OnOK();
- return 0;
- }
- CArray<CStringArray, CStringArray>g_List2array;
- DataToArray(&g_List1array, &m_List3array, &g_List2array);
- m_combosplb2.ResetContent();
- m_combosplb2.AddString("全部");
- for ( i = 0; i < g_List1array.GetSize(); i++)
- m_combosplb2.AddString(g_List1array.ElementAt(i).ElementAt(0));
- m_combosplb.ResetContent();
- m_combosplb.AddString("全部");
- for (i = 0; i < g_List2array.GetSize(); i++)
- {
- m_combosplb.AddString(g_List2array.ElementAt(i).ElementAt(1));
- }
- m_combosplb.SetCurSel(0);
- return TRUE;
- }
- void outsourcing4::FillGrid()
- {
- UpdateData();
- if (m_radio == 1)
- {
- FillGrid2();
- return;
- }
- else if (m_radio == 2)
- {
- FillGrid3();
- return;
- }
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- CString str;
- CString splb = "全部";
- int pos = m_combosplb.GetCurSel();
- if (pos != -1)
- {
- m_combosplb.GetLBText(pos, splb);
- }
- if (splb == "全部")
- {
- if (!m_check1)
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- else
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- //if (m_List1array.ElementAt(ii).ElementAt(7) == "OK")continue;
- if (m_List1array.ElementAt(ii).ElementAt(8) == "OK")continue;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
- {
- int aa = ii;
- while (aa)
- {
- if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
- aa--;
- }
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
- }
- }
- }
- }
- else
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (m_List1array.ElementAt(ii).ElementAt(6).GetLength() < 4)continue;
- if (m_List1array.ElementAt(ii).ElementAt(6).Right(m_List1array.ElementAt(ii).ElementAt(6).GetLength() - 4) != splb)continue;
- if (m_List1array.ElementAt(ii).ElementAt(7).Find("工厂") == -1)continue;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
- {
- int aa = ii;
- while (aa)
- {
- if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
- aa--;
- }
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List1.m_LabelCount = ii;
- m_List1.SetItemCountEx(ii);
- str.Format("项目:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- void outsourcing4::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- CDialog::OnCancel();
- }
- void outsourcing4::OnChangeEDITyear()
- {
- DateChange();
- }
- void outsourcing4::OnChangeEDITmonth()
- {
- DateChange();
- }
- void outsourcing4::OnChangeEDITday()
- {
- }
- void outsourcing4::DateChange()
- {
- if (m_bInit == 0)return;
- m_spinyear.EnableWindow(0);
- m_spinmonth.EnableWindow(0);
- m_spinday.EnableWindow(0);
- UpdateData();
- if (m_branch != "")
- {
- g_pMainWnd->OnDisconnect();
- g_branchip = GetIP(m_branch);
- g_pMainWnd->OnDisconnect();
- g_branchname = m_branch;
- g_bBranchModify = 1;
- }
- int i;
- int g_nYearposTemp = g_nYearpos;
- BOOL bLastYear = 0;
- BOOL bThisYear = 0;
- #if JEFF_TEST_ON // 2015开始禁用跨年数据;
- int g_nYearposPre = -1;
- if (m_year >= 2014 && m_year <= atoi(g_date.Left(4)) && g_hisyeararray.GetSize())
- {
- g_nYearpos = -1;
- bThisYear = 1;
- if (m_year == 2014)
- {
- g_nYearposPre = GetYearPos(m_year - 1);
- }
- }
- else if (m_year <= 2013 && g_hisyeararray.GetSize())
- {
- g_nYearpos = GetYearPos(m_year);
- if (g_nYearpos != -1)
- g_nYearposPre = GetYearPos(m_year - 1);
- bLastYear = 1;
- }
- #else
- if(m_year==atoi(g_date.Left (4)) && g_hisyeararray.GetSize () )
- bThisYear=1;
- else if(m_year<=atoi(g_date.Left (4))-1 && g_hisyeararray.GetSize ())
- bLastYear=1;
- g_nYearpos=GetYearPos(m_year);
- int g_nYearposPre=GetYearPos(m_year-1);
- #endif
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 219;
- g_sendhead.tabcount = 1;
- CString sql, strdate, strdate2;
- strdate.Format("%04d-%02d-%02d", m_year, m_month, 1);
- strdate2.Format("%04d-%02d-%02d", m_year, m_month, 31);
- m_static1.SetWindowText(strdate.Left(7) + "返工资料");
- sql.Format("[date2]>='" + strdate + "' and [date2]<='" + strdate2 + "' and [status4] like '返';");
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- m_spinyear.EnableWindow(1);
- m_spinmonth.EnableWindow(1);
- m_spinday.EnableWindow(1);
- g_nYearpos = g_nYearposTemp;
- return;
- }
- DataToArray(&m_List1array);
- if (bLastYear)//如果是去年, 则加今年的补款
- {
- g_nYearpos = -1;//今年
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 219;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- m_spinyear.EnableWindow(1);
- m_spinmonth.EnableWindow(1);
- m_spinday.EnableWindow(1);
- g_nYearpos = g_nYearposTemp;
- return;
- }
- CArray<CStringArray, CStringArray>ThisYearList1array;
- DataToArray(&ThisYearList1array);
- int oldsize = m_List1array.GetSize();
- m_List1array.SetSize(oldsize + ThisYearList1array.GetSize());
- for (i = oldsize; i < oldsize + ThisYearList1array.GetSize(); i++)
- {
- m_List1array.ElementAt(i).Copy(ThisYearList1array.ElementAt(i - oldsize));
- }
- }
- if (g_nYearposPre != -1)//如果是今年, 则加去年的补款
- {
- g_nYearpos = g_nYearposPre;//去年
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 219;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- {
- m_spinyear.EnableWindow(1);
- m_spinmonth.EnableWindow(1);
- m_spinday.EnableWindow(1);
- g_nYearpos = g_nYearposTemp;
- return;
- }
- CArray<CStringArray, CStringArray>ThisYearList1array;
- DataToArray(&ThisYearList1array);
- int oldsize = m_List1array.GetSize();
- m_List1array.SetSize(oldsize + ThisYearList1array.GetSize());
- for (i = oldsize; i < oldsize + ThisYearList1array.GetSize(); i++)
- {
- m_List1array.ElementAt(i).Copy(ThisYearList1array.ElementAt(i - oldsize));
- }
- }
- g_nYearpos = g_nYearposTemp;
- FillGrid();
- m_spinyear.EnableWindow(1);
- m_spinmonth.EnableWindow(1);
- m_spinday.EnableWindow(1);
- }
- void outsourcing4::OnSelchangeCOMBOsplb()
- {
- // TODO: Add your control notification handler code here
- FillGrid();
- }
- void outsourcing4::OnCheck1()
- {
- // TODO: Add your control notification handler code here
- FillGrid();
- }
- void outsourcing4::OnSelchangeCOMBOsplb2()
- {
- // TODO: Add your control notification handler code here
- int pos = m_combosplb2.GetCurSel();
- if (pos == -1)return;
- CString str;
- m_combosplb2.GetLBText(pos, str);
- m_combosp2.ResetContent();
- m_combosp2.AddString("全部");
- for (int ii = 0; ii < m_List3array.GetSize(); ii++)
- {
- if (m_List3array.ElementAt(ii).ElementAt(6) == str)
- {
- m_combosp2.AddString(m_List3array.ElementAt(ii).ElementAt(1));
- }
- }
- m_combosp2.SetCurSel(0);
- FillGrid();
- }
- void outsourcing4::FillGrid2()
- {
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- CString str;
- CString splb = "全部";
- CString sp = "全部";
- int pos = m_combosplb2.GetCurSel();
- if (pos != -1)
- {
- m_combosplb2.GetLBText(pos, splb);
- }
- pos = m_combosp2.GetCurSel();
- if (pos != -1)
- {
- m_combosp2.GetLBText(pos, sp);
- }
- if (splb == "全部")
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (m_check1)
- {
- if (m_List1array.ElementAt(ii).ElementAt(8) == "OK")continue;
- }
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- else
- {
- if (sp != "全部")
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (sp != m_List1array.ElementAt(ii).ElementAt(3))continue;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
- {
- int aa = ii;
- while (aa)
- {
- if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
- aa--;
- }
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
- }
- }
- }
- else
- {
- CStringArray cursparray;
- for (int aa = 0; aa < m_combosp2.GetCount(); aa++)
- {
- m_combosp2.GetLBText(aa, str);
- cursparray.Add(str);
- }
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- BOOL bFind = 0;
- for (int aa = 0; aa < cursparray.GetSize(); aa++)
- {
- if (cursparray.ElementAt(aa) == m_List1array.ElementAt(ii).ElementAt(3))
- {
- bFind = 1; break;
- }
- }
- if (bFind == 0)continue;
- if (m_check1)
- {
- if (m_List1array.ElementAt(ii).ElementAt(8) == "OK")continue;
- }
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
- {
- int aa = ii;
- while (aa)
- {
- if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
- aa--;
- }
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
- }
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List1.m_LabelCount = ii;
- m_List1.SetItemCountEx(ii);
- str.Format("项目:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- void outsourcing4::OnSelchangeCOMBOsp2()
- {
- // TODO: Add your control notification handler code here
- FillGrid();
- }
- void outsourcing4::OnRadio3()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- GetDlgItem(IDC_STATIC5)->ShowWindow(m_radio == 0);
- GetDlgItem(IDC_COMBOsplb)->ShowWindow(m_radio == 0);
- GetDlgItem(IDC_STATIC6)->ShowWindow(m_radio == 1);
- GetDlgItem(IDC_STATIC7)->ShowWindow(m_radio == 1);
- GetDlgItem(IDC_COMBOsplb2)->ShowWindow(m_radio == 1);
- GetDlgItem(IDC_COMBOsp2)->ShowWindow(m_radio == 1);
- GetDlgItem(IDC_STATIC8)->ShowWindow(m_radio == 2);
- GetDlgItem(IDC_COMBOsplb3)->ShowWindow(m_radio == 2);
- FillGrid();
- }
- void outsourcing4::OnRadio4()
- {
- // TODO: Add your control notification handler code here
- OnRadio3();
- }
- void outsourcing4::OnBUTprint()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- CString str;
- str.Format("c:\\%d%02d返工资料.xls", m_year, m_month);
- ListToXLS(&m_List1, str, 0);
- }
- void outsourcing4::OnSelchangeCOMBOsplb3()
- {
- // TODO: Add your control notification handler code here
- }
- void outsourcing4::OnCloseupCOMBOsplb3()
- {
- // TODO: Add your control notification handler code here
- FillGrid();
- }
- void outsourcing4::OnRadio5()
- {
- // TODO: Add your control notification handler code here
- OnRadio3();
- }
- void outsourcing4::FillGrid3()
- {
- UpdateData();
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- CString str;
- CString splb = "全部";
- int pos = m_waiter1.GetCurSel();
- if (pos != -1)
- {
- m_waiter1.GetLBText(pos, splb);
- }
- if (splb == "全部" || splb == "")
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- else
- {
- splb = "员工:" + splb;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- // if(m_List1array.ElementAt (ii).ElementAt (5).GetLength ()<4)continue;
- // if(m_List1array.ElementAt (ii).ElementAt (5).Right (m_List1array.ElementAt (ii).ElementAt (5).GetLength ()-4)!=splb)continue;
- if (m_List1array.ElementAt(ii).ElementAt(7).Find(splb) == -1)continue;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- if (m_List1.m_arLabels.ElementAt(count - 1).ElementAt(0) == "")
- {
- int aa = ii;
- while (aa)
- {
- if (m_List1array.ElementAt(aa).ElementAt(0) != "")break;
- aa--;
- }
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(0, m_List1array.ElementAt(aa).ElementAt(0));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(1, m_List1array.ElementAt(aa).ElementAt(1));
- m_List1.m_arLabels.ElementAt(count - 1).SetAt(2, m_List1array.ElementAt(aa).ElementAt(2));
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii = count;
- m_List1.m_LabelCount = ii;
- m_List1.SetItemCountEx(ii);
- str.Format("项目:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- void outsourcing4::OnSelchangeCOMBObranch()
- {
- int pos = m_combobranch.GetCurSel();
- if (pos == -1)return;
- m_combobranch.GetLBText(pos, m_branch);
- DateChange();
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 2;
- g_sendhead.code[1] = 4;
- g_sendhead.code[2] = 9;
- g_sendhead.tabcount = 3;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if (g_bSendOK == 0)
- {
- return;
- }
- CArray<CStringArray, CStringArray>g_List2array;
- DataToArray(&g_List1array, &m_List3array, &g_List2array);
- m_combosplb2.ResetContent();
- m_combosplb2.AddString("全部");
- int i = 0;
- for ( i = 0; i < g_List1array.GetSize(); i++)
- m_combosplb2.AddString(g_List1array.ElementAt(i).ElementAt(0));
- m_combosplb.ResetContent();
- m_combosplb.AddString("全部");
- for (i = 0; i < g_List2array.GetSize(); i++)
- {
- m_combosplb.AddString(g_List2array.ElementAt(i).ElementAt(1));
- }
- m_combosplb.SetCurSel(0);
- }
|