// MonthForm.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "MonthForm.h" #include "MyMdi.H" #include "SelExpendType.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // MonthForm IMPLEMENT_DYNCREATE(MonthForm, MyFormView) MonthForm::MonthForm() : MyFormView(MonthForm::IDD) { 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_radio1 = 0; m_bInit=0; m_timestmap=0; m_radio2 = 0; m_bForKF=0; //}}AFX_DATA_INIT } MonthForm::~MonthForm() { } void MonthForm::DoDataExchange(CDataExchange* pDX) { MyFormView::DoDataExchange(pDX); 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_Radio(pDX, IDC_RADIO3, m_radio1); DDX_Radio(pDX, IDC_RADIO14, m_radio2); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(MonthForm, MyFormView) 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_BN_CLICKED(IDC_RADIO3, OnRadio3) ON_BN_CLICKED(IDC_RADIO4, OnRadio4) ON_BN_CLICKED(IDC_RADIO5, OnRadio5) ON_BN_CLICKED(IDC_RADIO6, OnRadio6) ON_BN_CLICKED(IDC_RADIO7, OnRadio7) ON_BN_CLICKED(IDC_RADIO8, OnRadio8) ON_BN_CLICKED(IDC_RADIO9, OnRadio9) ON_BN_CLICKED(IDC_RADIO10, OnRadio10) ON_BN_CLICKED(IDC_RADIO11, OnRadio11) ON_BN_CLICKED(IDC_RADIO12, OnRadio12) ON_BN_CLICKED(IDC_RADIO13, OnRadio13) ON_BN_CLICKED(IDC_BUTprint, OnBUTprint) ON_BN_CLICKED(IDC_BUTprint5, OnBUTprint5) ON_BN_CLICKED(IDC_BUTprint4, OnBUTprint4) ON_BN_CLICKED(IDC_RADIO14, OnRadio14) ON_BN_CLICKED(IDC_RADIO15, OnRadio15) //}}AFX_MSG_MAP ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // MonthForm diagnostics #ifdef _DEBUG void MonthForm::AssertValid() const { MyFormView::AssertValid(); } void MonthForm::Dump(CDumpContext& dc) const { MyFormView::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // MonthForm message handlers void MonthForm::OnInitialUpdate() { // LOG4C((LOG_NOTICE,"MonthForm::OnInitialUpdate")); MyFormView::OnInitialUpdate(); // TODO: Add your specialized code here and/or call the base class CMyMdi Mdi; Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this); #ifdef DDF_VERSION GetDlgItem(IDC_STATIC10)->ShowWindow(SW_SHOW); GetDlgItem(IDC_RADIO14)->ShowWindow(SW_SHOW); GetDlgItem(IDC_RADIO15)->ShowWindow(SW_SHOW); #endif // Here we create the outbar control using the splitter as its parent // and setting its id to the first pane. CRect rc2; GetWindowRect(rc2); ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE); EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc,0); m_static1.SetFont (&g_titlefont); if(atoi(g_cominfoarray.ElementAt(0).ElementAt(115))) GetDlgItem(IDC_BUTprint4)->ShowWindow(SW_SHOW); if(atoi(g_cominfoarray.ElementAt(0).ElementAt(115))) m_List1.SetHeadings("id,0;项目名称,300;金额,100;项目类别,100;收入/支出,100;日期,100;支付方式,100;收银,100;财务审核,100;接单点,100" ); else m_List1.SetHeadings("id,0;项目名称,300;金额,100;项目类别,100;收入/支出,100;日期,100;支付方式,100;收银,100;财务审核,100" ); m_List1.LoadColumnInfo (107); m_spinyear.SetRange (1900, 3000); m_spinmonth.SetRange (1, 12); m_spinday.SetRange (1, 31); m_bInit=1; DateChange(); } void MonthForm::FillGrid() { m_List1.DeleteAllItems2 (); int ii=0; m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 ); int count=0; CString str; if(m_filter.IsEmpty () && m_jdd.IsEmpty ()) { for(ii=0; iiGetWindowRect (rc); ScreenToClient(rc); InvalidateRect(rc); } void MonthForm::OnBUTclose() { // TODO: Add your control notification handler code here GetParent()->SendMessage(WM_CLOSE); } void MonthForm::OnChangeEDITyear() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. DateChange(); // TODO: Add your control notification handler code here } void MonthForm::OnChangeEDITmonth() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. DateChange(); // TODO: Add your control notification handler code here } void MonthForm::OnChangeEDITday() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the MyFormView::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. // DateChange(); // TODO: Add your control notification handler code here } void MonthForm::DateChange() { if(m_bInit==0) return; m_spinyear.EnableWindow(0); m_spinmonth.EnableWindow(0); m_spinday.EnableWindow(0); UpdateData(); 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]=14; g_sendhead.code[1]=13; g_sendhead.code[2]=16; g_sendhead.code[3]=198; g_sendhead.code[4]=216; g_sendhead.tabcount=5; CString sql,strdate,strdate2; strdate.Format ("%04d-%02d-%02d", m_year, m_month, 1); strdate2.Format ("%04d-%02d-%02d", m_year, m_month, 31); CRect rc; m_static1.GetWindowRect (rc); ScreenToClient(rc); InvalidateRect(rc); m_static1.SetWindowText (strdate.Left (7)+"月财务表"); sql.Format ("dat>='"+strdate+"' and dat<='"+strdate2+"' and (sale2type is null or sale2type='');dat>='"+strdate+"' and dat<='"+strdate2+"';date>='"+strdate+"' and date<='"+strdate2+"';date>='"+strdate+"' and date<='"+strdate2+"';date>='"+strdate+"' and date<='"+strdate2+"'"); g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0) { g_nYearpos=g_nYearposTemp; m_spinyear.EnableWindow(1); m_spinmonth.EnableWindow(1); m_spinday.EnableWindow(1); return; } DataToArray(&List2array,&List3array,&List11array,&other2salearray,&memberarray); if(bLastYear)//如果是去年, 则加今年的补款 { g_nYearpos=-1;//今年 g_sendhead.bsql=0; g_sendhead.code[0]=14; g_sendhead.code[1]=13; g_sendhead.code[2]=16; g_sendhead.code[3]=198; g_sendhead.code[4]=216; g_sendhead.tabcount=5; g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0) { g_nYearpos=g_nYearposTemp; m_spinyear.EnableWindow(1); m_spinmonth.EnableWindow(1); m_spinday.EnableWindow(1); return; } CArrayThisYearList11array; CArrayThisYearList3array; CArrayThisYearList2array; CArrayThisYearother2salearray; CArrayThisYearmemberarray; DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray, &ThisYearmemberarray); int oldsize=List11array.GetSize (); List11array.SetSize(oldsize+ThisYearList11array.GetSize ()); for(i=oldsize; iProcessChatMessageRequest2(sql); if(g_bSendOK==0) { g_nYearpos=g_nYearposTemp; m_spinyear.EnableWindow(1); m_spinmonth.EnableWindow(1); m_spinday.EnableWindow(1); return; } CArrayThisYearList11array; CArrayThisYearList3array; CArrayThisYearList2array; CArrayThisYearother2salearray; DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray); int oldsize=List11array.GetSize (); List11array.SetSize(oldsize+ThisYearList11array.GetSize ()); for(i=oldsize; i120) List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+".."); str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7); str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List2array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); #if 0 income+=atof(str); #else if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款") { income+=atof(str); } #endif if(List2array.ElementAt (i).ElementAt (8)!="") { income2+=atof(str); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (8)); } else m_List1array.ElementAt (pos).Add("其它收入"); m_List1array.ElementAt (pos).Add("收入"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10)); m_List1array.ElementAt (pos).Add(" "); pos++; } for( i=0; i120) List3array.ElementAt (i).SetAt (6, List3array.ElementAt (i).ElementAt (6).Left (120)+".."); str=List3array.ElementAt (i).ElementAt (1)+";"+List3array.ElementAt (i).ElementAt (4)+";"+List3array.ElementAt (i).ElementAt (6); str.Replace (";;;;", ";");str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List3array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); payout+=atof(str); m_List1array.ElementAt (pos).Add("固定费用"); m_List1array.ElementAt (pos).Add("支出"); m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (3)+" "+List3array.ElementAt (i).ElementAt (8)); m_List1array.ElementAt (pos).Add("现金"); m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (7)); m_List1array.ElementAt (pos).Add(" "); pos++; } for( i=0; i120) List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+".."); str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7); str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List2array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); #if 0 income+=atof(str); #else if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款") { income+=atof(str); } #endif if(List2array.ElementAt (i).ElementAt (8)!="") { income2+=atof(str); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (8)); } else m_List1array.ElementAt (pos).Add("其它收入"); m_List1array.ElementAt (pos).Add("收入"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10)); m_List1array.ElementAt (pos).Add(" "); pos++; } for( i=0; i120) List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+".."); str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7); str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List2array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); #if 0 income+=atof(str); income2+=atof(str); #else if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款") { income+=atof(str); } income2+=atof(str); #endif m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (8)); m_List1array.ElementAt (pos).Add("收入"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10)); m_List1array.ElementAt (pos).Add(" "); pos++; } } for( i=0; i120) List3array.ElementAt (i).SetAt (6, List3array.ElementAt (i).ElementAt (6).Left (120)+".."); str=List3array.ElementAt (i).ElementAt (1)+";"+List3array.ElementAt (i).ElementAt (4)+";"+List3array.ElementAt (i).ElementAt (6); str.Replace (";;;;", ";");str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List3array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); payout+=atof(str); m_List1array.ElementAt (pos).Add("固定费用"); m_List1array.ElementAt (pos).Add("支出"); m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (3)+" "+List3array.ElementAt (i).ElementAt (8)); m_List1array.ElementAt (pos).Add("现金"); m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (7)); m_List1array.ElementAt (pos).Add(" "); pos++; } } else if(m_radio1==4)//定单 { for( i=0; i120) List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+".."); str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7); str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List2array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); #if 0 income+=atof(str); income2+=atof(str); #else if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款") { income+=atof(str); } income2+=atof(str); #endif m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (8)); m_List1array.ElementAt (pos).Add("收入"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10)); m_List1array.ElementAt (pos).Add(" "); pos++; } } for( i=0; i120) List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+".."); str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7); str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List2array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); #if 0 income+=atof(str); income2+=atof(str); #else if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款") { income+=atof(str); } income2+=atof(str); #endif m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (8)); m_List1array.ElementAt (pos).Add("收入"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10)); m_List1array.ElementAt (pos).Add(" "); pos++; } } for( i=0; i120) List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+".."); str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7); str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List2array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); income+=atof(str); income2+=atof(str); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (8)); m_List1array.ElementAt (pos).Add("收入"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10)); m_List1array.ElementAt (pos).Add(" "); pos++; } } for( i=0; i120) List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+".."); str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7); str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List2array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); #if 0 income+=atof(str); income2+=atof(str); #else if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款") { income+=atof(str); } income2+=atof(str); #endif m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (8)); m_List1array.ElementAt (pos).Add("收入"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10)); m_List1array.ElementAt (pos).Add(" "); pos++; } } for( i=0; i120) List2array.ElementAt (i).SetAt (7, List2array.ElementAt (i).ElementAt (7).Left (120)+".."); str=List2array.ElementAt (i).ElementAt (1)+";"+List2array.ElementAt (i).ElementAt (4)+";"+List2array.ElementAt (i).ElementAt (6)+";"+List2array.ElementAt (i).ElementAt (7); str.Replace (";;;", ";");str.Replace (";;", ";"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (0)); m_List1array.ElementAt (pos).Add(str); str=List2array.ElementAt (i).ElementAt (2); m_List1array.ElementAt (pos).Add(str); #if 0 income+=atof(str); #else if (List2array.ElementAt(i).ElementAt(9) != "储值卡扣款") { income+=atof(str); } #endif m_List1array.ElementAt (pos).Add("其它收入"); m_List1array.ElementAt (pos).Add("收入"); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (3)+" "+List2array.ElementAt (i).ElementAt (11)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (9)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (5)); m_List1array.ElementAt (pos).Add(List2array.ElementAt (i).ElementAt (10)); m_List1array.ElementAt (pos).Add(" "); pos++; } } m_List1array.SetSize(pos); str.Format ("%0.2f", income); ::ConvertToPrice (str); SetDlgItemText(IDC_EDITmoney1, str); str.Format ("%0.2f", income2); ::ConvertToPrice (str); SetDlgItemText(IDC_EDITmoney5, str); str.Format ("%0.2f", payout); ::ConvertToPrice (str); SetDlgItemText(IDC_EDITmoney2, str); str.Format ("%0.2f", income-payout); ::ConvertToPrice (str); SetDlgItemText(IDC_EDITmoney3, str); str.Format ("%d", dindanshu); SetDlgItemText(IDC_EDITmoney4, str); FillGrid(); } void MonthForm::OnRadio3() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio4() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio5() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio6() { // TODO: Add your control notification handler code here UpdateData(); m_filter.Empty (); KindChange(); } void MonthForm::OnRadio7() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio8() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio9() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio10() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio11() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio12() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnRadio13() { // TODO: Add your control notification handler code here UpdateData(); KindChange(); } void MonthForm::OnBUTprint() { // TODO: Add your control notification handler code here if(m_List1.GetItemCount ()==0) { AfxMessageBox("无内容!", MB_ICONINFORMATION); return; } CArrayListarray; CString str,temp; m_static1.GetWindowText (str); CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+str; int count=m_List1.GetItemCount ()/45; if(m_List1.GetItemCount ()%45)count++; Listarray.SetSize(m_List1.GetItemCount ()+count, 1); int pos=0; float otherpaytype1=0; float otherpaytype2=0; float otherpaytype3=0; int addpos=1; for(int i=0; iPrintDailyForm(&Listarray, title, str); } void MonthForm::TypeChange(CString str) { m_filter=str; FillGrid(); } void MonthForm::OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult ) { NMLVCUSTOMDRAW* pLVCD = reinterpret_cast( pNMHDR ); // Take the default processing unless we set this to something else below. *pResult = 0; // First thing - check the draw stage. If it's the control's prepaint // stage, then tell Windows we want messages for every item. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage ) { *pResult = CDRF_NOTIFYITEMDRAW; } else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage ) { // This is the prepaint stage for an item. Here's where we set the // item's text color. Our return value will tell Windows to draw the // item itself, but it will use the new color we set here. // We'll cycle the colors through red, green, and light blue. if(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (8).Find("已审核")==-1) pLVCD->clrText = RGB(220,0,0); else pLVCD->clrText = RGB(20,133,20); if(pLVCD->nmcd.dwItemSpec%2) pLVCD->clrTextBk = g_gridcol1; else pLVCD->clrTextBk = g_gridcol2; // Store the color back in the NMLVCUSTOMDRAW struct. // Tell Windows to paint the control itself. *pResult = CDRF_DODEFAULT; } } void MonthForm::OnBUTprint5() { // TODO: Add your control notification handler code here // LOG4C((LOG_NOTICE,"MonthForm导出xls")); CString str; m_static1.GetWindowText(str); ListToXLS(&m_List1, "c:\\"+str+".xls", 1); } void MonthForm::OnBUTprint4() { // TODO: Add your control notification handler code here if(atoi(g_cominfoarray.ElementAt(0).ElementAt(115))) { SelExpendType dlg; dlg.m_mode=3; if(dlg.DoModal()==IDOK) { m_jdd=dlg.m_sel; FillGrid(); } } } void MonthForm::OnRadio14() { // TODO: Add your control notification handler code here UpdateData(); if(m_radio2==0)m_bForKF=0; else { m_bForKF=1; } KindChange(); } void MonthForm::OnRadio15() { // TODO: Add your control notification handler code here OnRadio14(); } void MonthForm::KindChange2() { m_jdd=""; CString str; int pos=0; int dindanshu=0; float income=0; float income2=0; float payout=0; int count=List2array.GetSize ()+List3array.GetSize ()+List11array.GetSize ()+other2salearray.GetSize ()+memberarray.GetSize (); m_List1array.RemoveAll (); m_List1array.SetSize(count); int i=0; { m_filter.Empty (); if(payoutdlg.GetSafeHwnd ())payoutdlg.ShowWindow (SW_HIDE); } for(i=0; i