123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916 |
- // MonthForm2.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "MonthForm2.h"
- #include "MyMdi.H"
- #include "SelExpendType.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // MonthForm2
- IMPLEMENT_DYNCREATE(MonthForm2, MyFormView)
- MonthForm2::MonthForm2()
- : MyFormView(MonthForm2::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 = 3;
- m_bInit=0;
- m_timestmap=0;
- m_radio2 = 0;
- //}}AFX_DATA_INIT
- }
- MonthForm2::~MonthForm2()
- {
- }
- void MonthForm2::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(MonthForm2, 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)
- ON_BN_CLICKED(IDC_RADIO16, OnRadio16)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
- ON_BN_CLICKED(IDC_BUTprint6, OnBUTprint6)
- ON_BN_CLICKED(IDC_BUTprint7, OnBUTprint7)
- //}}AFX_MSG_MAP
- ON_NOTIFY(NM_CUSTOMDRAW, IDC_LIST2, OnCustomdrawList)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // MonthForm2 diagnostics
- #ifdef _DEBUG
- void MonthForm2::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void MonthForm2::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // MonthForm2 message handlers
- void MonthForm2::OnInitialUpdate()
- {
- //AfxMessageBox("void MonthForm2::OnInitialUpdate()");
- // LOG4C((LOG_NOTICE,"月财务报表2::OnInitialUpdate"));
- MyFormView::OnInitialUpdate();
- // TODO: Add your specialized code here and/or call the base class
- CMyMdi Mdi;
- Mdi.SetSubView((CWnd*)GetParent(), (CWnd*)this);
-
- // 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);
- int idarray[]={IDC_BUTprint5,IDC_BUTprint6,IDC_BUTprint7,IDC_BUTprint,IDC_BUTclose};
- int idcount=5;
- int btnwid;
- CRect prerc;
- for(int a=idcount-2; a>=0; a--)
- {
- GetDlgItem(idarray[a+1])->GetWindowRect (prerc);
- ScreenToClient(prerc);
- GetDlgItem(idarray[a])->GetWindowRect (rc2);
- ScreenToClient(rc2);
- btnwid=rc2.Width ();
- rc2.right =prerc.left ;
- rc2.left =rc2.right -btnwid;
- GetDlgItem(idarray[a])->MoveWindow (rc2);
- }
- GetDlgItem(IDC_BUTprint5)->SetWindowText("财务审核");
- GetDlgItem(IDC_BUTprint6)->SetWindowText("经理审核");
- GetDlgItem(IDC_BUTprint7)->SetWindowText("老总审核");
- m_List1.SetHeadings("id,0;项目名称,180;金额,100;日期,150;收银,90;发票/收据,100;财务审核,150;经理审核,150;老总审核,150" );
- m_List1.LoadColumnInfo (301);
-
- m_spinyear.SetRange (1900, 3000);
- m_spinmonth.SetRange (1, 12);
- m_spinday.SetRange (1, 31);
-
- m_bInit=1;
- DateChange();
- }
- void MonthForm2::FillGrid()
- {
- m_List1.DeleteAllItems2 ();
- int ii=0;
- m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
- int count=0;
- CString str;float payout=0;
- if(m_radio2==0)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- payout+=atof(m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- else if(m_radio2==1)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(atoi(m_List1array.ElementAt (ii).ElementAt (2))<10000)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
-
- payout+=atof(m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- else if(m_radio2==2)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(atoi(m_List1array.ElementAt (ii).ElementAt (2))>=10000)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
-
- payout+=atof(m_List1array.ElementAt (ii).ElementAt (2));
- }
- }
- }
- str.Format ("%d", count);
- SetDlgItemText(IDC_EDITmoney1, str);
- str.Format ("%0.2f", payout);
- ::ConvertToPrice (str);
- SetDlgItemText(IDC_EDITmoney2, str);
- 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 MonthForm2::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- void MonthForm2::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 MonthForm2::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 MonthForm2::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 MonthForm2::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 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]=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;
- }
- CArray<CStringArray, CStringArray>ThisYearList11array;
- CArray<CStringArray, CStringArray>ThisYearList3array;
- CArray<CStringArray, CStringArray>ThisYearList2array;
- CArray<CStringArray, CStringArray>ThisYearother2salearray;
- CArray<CStringArray, CStringArray>ThisYearmemberarray;
- DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray, &ThisYearmemberarray);
- int oldsize=List11array.GetSize ();
- List11array.SetSize(oldsize+ThisYearList11array.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearList11array.GetSize (); i++)
- {
- List11array.ElementAt (i).Copy(ThisYearList11array.ElementAt (i-oldsize));
- }
- oldsize=List3array.GetSize ();
- List3array.SetSize(oldsize+ThisYearList3array.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearList3array.GetSize (); i++)
- {
- List3array.ElementAt (i).Copy(ThisYearList3array.ElementAt (i-oldsize));
- }
- oldsize=List2array.GetSize ();
- List2array.SetSize(oldsize+ThisYearList2array.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearList2array.GetSize (); i++)
- {
- List2array.ElementAt (i).Copy(ThisYearList2array.ElementAt (i-oldsize));
- }
- oldsize=other2salearray.GetSize ();
- other2salearray.SetSize(oldsize+ThisYearother2salearray.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearother2salearray.GetSize (); i++)
- {
- other2salearray.ElementAt (i).Copy(ThisYearother2salearray.ElementAt (i-oldsize));
- }
- oldsize=memberarray.GetSize ();
- memberarray.SetSize(oldsize+ThisYearmemberarray.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearmemberarray.GetSize (); i++)
- {
- memberarray.ElementAt (i).Copy(ThisYearmemberarray.ElementAt (i-oldsize));
- }
- }
- if(g_nYearposPre!=-1)//如果是今年, 则加去年的补款
- {
- g_nYearpos=g_nYearposPre;//去年
- 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.tabcount=4;
- 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;
- }
- CArray<CStringArray, CStringArray>ThisYearList11array;
- CArray<CStringArray, CStringArray>ThisYearList3array;
- CArray<CStringArray, CStringArray>ThisYearList2array;
- CArray<CStringArray, CStringArray>ThisYearother2salearray;
- DataToArray(&ThisYearList2array, &ThisYearList3array, &ThisYearList11array, &ThisYearother2salearray);
- int oldsize=List11array.GetSize ();
- List11array.SetSize(oldsize+ThisYearList11array.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearList11array.GetSize (); i++)
- {
- List11array.ElementAt (i).Copy(ThisYearList11array.ElementAt (i-oldsize));
- }
- oldsize=List3array.GetSize ();
- List3array.SetSize(oldsize+ThisYearList3array.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearList3array.GetSize (); i++)
- {
- List3array.ElementAt (i).Copy(ThisYearList3array.ElementAt (i-oldsize));
- }
- oldsize=List2array.GetSize ();
- List2array.SetSize(oldsize+ThisYearList2array.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearList2array.GetSize (); i++)
- {
- List2array.ElementAt (i).Copy(ThisYearList2array.ElementAt (i-oldsize));
- }
- oldsize=other2salearray.GetSize ();
- other2salearray.SetSize(oldsize+ThisYearother2salearray.GetSize ());
- for(i=oldsize; i<oldsize+ThisYearother2salearray.GetSize (); i++)
- {
- other2salearray.ElementAt (i).Copy(ThisYearother2salearray.ElementAt (i-oldsize));
- }
- }
- g_nYearpos=g_nYearposTemp;
- KindChange();
- m_spinyear.EnableWindow(1);
- m_spinmonth.EnableWindow(1);
- m_spinday.EnableWindow(1);
- }
- void MonthForm2::KindChange()
- {
- 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;
- if(m_radio1==3)
- {
- /*if(payoutdlg.GetSafeHwnd ()==NULL)
- {
- payoutdlg.Create (IDD_DLGPayOutSet, this);
- CRect rc;
- m_List1.GetWindowRect (rc);
- payoutdlg.MoveWindow2 (rc);
- payoutdlg.m_pParent=this;
- payoutdlg.m_mode=1;
- }
- payoutdlg.ShowWindow (SW_SHOW);*/
- }
- else
- {
- m_filter.Empty ();
- if(payoutdlg.GetSafeHwnd ())payoutdlg.ShowWindow (SW_HIDE);
- }
-
- for(i=0; i<List3array.GetSize (); i++)
- {
- if(List3array.ElementAt (i).ElementAt (7).IsEmpty ())
- List3array.ElementAt (i).SetAt (7, "未审核");
- if(List3array.ElementAt (i).ElementAt (9).IsEmpty ())
- List3array.ElementAt (i).SetAt (9, "未审核");
- if(List3array.ElementAt (i).ElementAt (10).IsEmpty ())
- List3array.ElementAt (i).SetAt (10, "未审核");
- List3array.ElementAt (i).SetAt (0, List3array.ElementAt (i).ElementAt (0)+":1");
- }
-
-
- if(m_radio1==3)//支出
- {
- for( i=0; i<List3array.GetSize (); i++)
- {
- if(List3array.ElementAt (i).ElementAt (6).GetLength ()>120)
- 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(List3array.ElementAt (i).ElementAt (3)+" "+List3array.ElementAt (i).ElementAt (8));
-
- m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (5));
- m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (11));
- m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (7));
- m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (9));
- m_List1array.ElementAt (pos).Add(List3array.ElementAt (i).ElementAt (10));
- 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 MonthForm2::OnRadio3()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio4()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio5()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio6()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.Empty ();
- KindChange();
- }
- void MonthForm2::OnRadio7()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio8()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio9()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio10()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio11()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio12()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnRadio13()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- KindChange();
- }
- void MonthForm2::OnBUTprint()
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要查看的项目!", MB_ICONINFORMATION);return;
- }
- int iItem=m_List1.GetNextSelectedItem(pos);
- CString m_id=m_List1.GetItemText (iItem, 0);
- int pos2=m_id.Find (":");
- if(pos2==-1)return;
- m_id=m_id.Left (pos2);
-
- char no[100];
- memset(no, 0, 100);
- #ifdef VC60
- strcpy(no, m_id);
- #else
- strcpy_s(no, 100, m_id);
- #endif
- g_nSendCode=36;
- g_pMainWnd->ProcessChatMessageRequest2((BYTE*)no, 100);
- g_nSendCode=0;
- if(g_bSendOK==0)
- {
- return;
- }
-
-
- CString path=g_mainpath+"\\1.jpg";
- ::DeleteFile(path); // 删除1.jpg;
- CFile fp;
- fp.Open(path, CFile::modeCreate|CFile::modeWrite);
- fp.Write(g_pData, g_nLeng);
- fp.Close();
- ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
- }
- void MonthForm2::TypeChange(CString str)
- {
- m_filter=str;
- FillGrid();
- }
- void MonthForm2::OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult )
- {
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( 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.
- int cot=0;
- if(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (6).Find("已审核")!=-1)
- cot++;
- if(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (7).Find("已审核")!=-1)
- cot++;
- if(m_List1.m_arLabels.ElementAt (pLVCD->nmcd.dwItemSpec).ElementAt (8).Find("已审核")!=-1)
- cot++;
- if(cot==3)
- pLVCD->clrText = RGB(20,133,20);
- else if(cot==2)
- pLVCD->clrText = RGB(255,255,0);//RGB(138,194,10);
- else if(cot==1)
- pLVCD->clrText = RGB(255,255,0);
- else if(cot==0)
- pLVCD->clrText = RGB(220,0,0);
-
- 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 MonthForm2::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 MonthForm2::OnRadio14()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- FillGrid();
- }
- void MonthForm2::OnRadio15()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- FillGrid();
- }
- void MonthForm2::OnRadio16()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- FillGrid();
- }
- void MonthForm2::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- OnBUTprint();
- *pResult = 0;
- }
- void MonthForm2::OnBUTprint5()
- {
- // TODO: Add your control notification handler code here
- if(!IsHasRights2new(51))return;
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要审核的项目!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- CStringArray array;
- int count=0;
- while (pos)
- {
- count++;
- if(count>100)
- {
- AfxMessageBox("仅前100个项目生效,请选中少于100个项目!", MB_ICONINFORMATION);
- break;
- }
- iItem = m_List1.GetNextSelectedItem(pos);
-
- array.Add (m_List1.GetItemText (iItem, 0));
- }
- CString id,type,temp,sql;
- CString financecheck="已审核";
- if(AfxMessageBox(" 此单审核是否通过? \r\n", MB_YESNO|MB_ICONINFORMATION)!=IDYES)
- financecheck="未审核";
- financecheck+="\\"+g_user.name;
- financecheck.Replace("(", "(");
- financecheck.Replace(")", ")");
- int pos2;
- for(int i=0; i<array.GetSize (); i++)
- {
- temp=array.ElementAt (i);
- pos2=temp.Find (":");
- if(pos2==-1)continue;
- id=temp.Left (pos2);
- type=temp.Right (1);
-
- if(type=="1")
- {
- temp.Format ("***update gudingfeiyong set financecheck='%s' where id=%s", financecheck, id);
- }
-
- sql+=temp;
- }
- sql.TrimLeft ("***");
- g_sendhead.bsql=1;
-
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- DateChange();
- }
- void MonthForm2::OnBUTprint6()
- {
- // TODO: Add your control notification handler code here
- if(!IsHasRights2new(51))return;
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要审核的项目!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- CStringArray array;
- int count=0;
- while (pos)
- {
- count++;
- if(count>100)
- {
- AfxMessageBox("仅前100个项目生效,请选中少于100个项目!", MB_ICONINFORMATION);
- break;
- }
- iItem = m_List1.GetNextSelectedItem(pos);
-
- array.Add (m_List1.GetItemText (iItem, 0));
- }
- CString id,type,temp,sql;
- CString financecheck="已审核";
- if(AfxMessageBox(" 此单审核是否通过? \r\n", MB_YESNO|MB_ICONINFORMATION)!=IDYES)
- financecheck="未审核";
- financecheck+="\\"+g_user.name;
- financecheck.Replace("(", "(");
- financecheck.Replace(")", ")");
- int pos2;
- for(int i=0; i<array.GetSize (); i++)
- {
- temp=array.ElementAt (i);
- pos2=temp.Find (":");
- if(pos2==-1)continue;
- id=temp.Left (pos2);
- type=temp.Right (1);
-
- if(type=="1")
- {
- temp.Format ("***update gudingfeiyong set financecheck2='%s' where id=%s", financecheck, id);
- }
-
- sql+=temp;
- }
- sql.TrimLeft ("***");
- g_sendhead.bsql=1;
-
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- DateChange();
- }
- void MonthForm2::OnBUTprint7()
- {
- // TODO: Add your control notification handler code here
- if(!IsHasRights2new(51))return;
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要审核的项目!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- CStringArray array;
- int count=0;
- while (pos)
- {
- count++;
- if(count>100)
- {
- AfxMessageBox("仅前100个项目生效,请选中少于100个项目!", MB_ICONINFORMATION);
- break;
- }
- iItem = m_List1.GetNextSelectedItem(pos);
-
- array.Add (m_List1.GetItemText (iItem, 0));
- }
- CString id,type,temp,sql;
- CString financecheck="已审核";
- if(AfxMessageBox(" 此单审核是否通过? \r\n", MB_YESNO|MB_ICONINFORMATION)!=IDYES)
- financecheck="未审核";
- financecheck+="\\"+g_user.name;
- financecheck.Replace("(", "(");
- financecheck.Replace(")", ")");
- int pos2;
- for(int i=0; i<array.GetSize (); i++)
- {
- temp=array.ElementAt (i);
- pos2=temp.Find (":");
- if(pos2==-1)continue;
- id=temp.Left (pos2);
- type=temp.Right (1);
-
- if(type=="1")
- {
- temp.Format ("***update gudingfeiyong set financecheck3='%s' where id=%s", financecheck, id);
- }
-
- sql+=temp;
- }
- sql.TrimLeft ("***");
- g_sendhead.bsql=1;
-
- g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
- DateChange();
- }
|