// 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 if(g_bAllBranch) { GetDlgItem(IDC_STATIC3)->ShowWindow(SW_SHOW); GetDlgItem(IDC_COMBObranch)->ShowWindow(SW_SHOW); // m_combobranch.AddString (""); for(int i=0; iProcessChatMessageRequest2(1); if(g_bSendOK==0) { CDialog::OnOK(); return 0; } CArrayg_List2array; DataToArray(&g_List1array, &m_List3array, &g_List2array); m_combosplb2.ResetContent (); m_combosplb2.AddString ("全部"); int i = 0; for( i=0; iOnDisconnect(); 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(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); 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; } CArrayThisYearList1array; DataToArray(&ThisYearList1array); int oldsize=m_List1array.GetSize (); m_List1array.SetSize(oldsize+ThisYearList1array.GetSize ()); for(i=oldsize; iProcessChatMessageRequest2(sql); if(g_bSendOK==0) { m_spinyear.EnableWindow(1); m_spinmonth.EnableWindow(1); m_spinday.EnableWindow(1); g_nYearpos=g_nYearposTemp; return; } CArrayThisYearList1array; DataToArray(&ThisYearList1array); int oldsize=m_List1array.GetSize (); m_List1array.SetSize(oldsize+ThisYearList1array.GetSize ()); for(i=oldsize; iShowWindow(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; iiProcessChatMessageRequest2(1); if(g_bSendOK==0) { return ; } CArrayg_List2array; DataToArray(&g_List1array, &m_List3array, &g_List2array); m_combosplb2.ResetContent (); m_combosplb2.AddString ("全部"); int i = 0; for( i=0; i