// TodayBar.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "TodayBar.h" #include "StaffAchievementShowAll.h" #include "SalarySet4.h" #include "SelExpendType.h" #include "DataUpdateCentrer.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // TodayBar dialog FillGrid4 TodayBar::TodayBar(CWnd* pParent /*=NULL*/) : CDialog(TodayBar::IDD, pParent) { //{{AFX_DATA_INIT(TodayBar) // NOTE: the ClassWizard will add member initialization here IDC_EDITbase m_name = _T(""); m_rate1 = _T(""); m_rate2 = _T(""); m_bz = _T(""); m_base = _T(""); m_salary = _T(""); m_rate3 = _T(""); m_rate4 = _T(""); m_rate5 = _T(""); m_money1 = _T(""); m_money2 = _T(""); m_money3 = _T(""); m_money4 = _T(""); m_money5 = _T(""); m_money6 = _T(""); m_bGet=0; //}}AFX_DATA_INIT } void TodayBar::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(TodayBar) // NOTE: the ClassWizard will add DDX and DDV calls here DDX_Control(pDX, IDC_LIST4, m_List4); DDX_Control(pDX, IDC_LIST2, m_List1); DDX_Control(pDX, IDC_LIST7, m_Listtake); DDX_Control(pDX, IDC_LIST8, m_Listdigital); DDX_Text(pDX, IDC_EDITname, m_name); DDX_Text(pDX, IDC_EDITrate1, m_rate1); DDX_Text(pDX, IDC_EDITrate2, m_rate2); DDX_Text(pDX, IDC_EDITbz, m_bz); DDX_Text(pDX, IDC_EDITbase, m_base); DDX_Text(pDX, IDC_EDITsalary, m_salary); DDX_Text(pDX, IDC_EDITrate3, m_rate3); DDX_Text(pDX, IDC_EDITrate4, m_rate4); DDX_Text(pDX, IDC_EDITrate6, m_rate5); DDX_Text(pDX, IDC_EDITmoney1, m_money1); DDX_Text(pDX, IDC_EDITmoney2, m_money2); DDX_Text(pDX, IDC_EDITmoney3, m_money3); DDX_Text(pDX, IDC_EDITmoney4, m_money4); DDX_Text(pDX, IDC_EDITmoney5, m_money5); DDX_Text(pDX, IDC_EDITmoney6, m_money6); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(TodayBar, CDialog) //{{AFX_MSG_MAP(TodayBar) ON_WM_PAINT() ON_WM_CTLCOLOR() ON_BN_CLICKED(IDC_BUTTON4, OnButton4) ON_BN_CLICKED(IDC_BUTTON5, OnButton5) ON_BN_CLICKED(IDC_BUTTON6, OnButton6) ON_BN_CLICKED(IDC_BUTTON7, OnButton7) ON_BN_CLICKED(IDC_BUTTON8, OnButton8) ON_BN_CLICKED(IDC_BUTTON14, OnButton14) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // TodayBar message handlers void TodayBar::OnCancel() { // TODO: Add extra cleanup here CDialog::OnCancel(); } void TodayBar::OnOK() { // TODO: Add extra validation here CDialog::OnOK(); } BOOL TodayBar::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here #ifdef CHILD_VERSION m_List1.SetHeadings("金额,100;日期,100;款项类别,100;家长姓名,100;宝宝姓名,100" ); m_List1.LoadColumnInfo (23); m_List4.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;提成金额,100;部门,100;内容,100;数量,100;单价,100;提成方式,100;套系价格,100;日期,100" ); m_List4.LoadColumnInfo (139); m_Listtake.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;套系,100;价格,100;景点,100;日期,100;摄影,100;助理,100;化妆师,100;助理,100" ); m_Listdigital.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;套系,100;价格,100;初修,100;日期1,100;精修,100;日期2,100;设计,100;日期3,100;初修,50;精修,50;设计,50;选片二销,50" ); m_Listtake.LoadColumnInfo (210); m_Listdigital.LoadColumnInfo (211); #else m_List1.SetHeadings("金额,100;日期,100;款项类别,100;男宾姓名,100;女宾姓名,100" ); m_List1.LoadColumnInfo (23); m_List4.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;提成金额,100;部门,100;内容,100;数量,100;单价,100;提成方式,100;套系价格,100;日期,100" ); m_List4.LoadColumnInfo (139); m_Listtake.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;套系,100;价格,100;景点,100;日期,100;摄影,100;助理,100;化妆师,100;助理,100" ); m_Listdigital.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;套系,100;价格,100;初修,100;日期1,100;精修,100;日期2,100;设计,100;日期3,100;初修,50;精修,50;设计,50;选片二销,50" ); m_Listtake.LoadColumnInfo (210); m_Listdigital.LoadColumnInfo (211); #endif if(g_bRedSkin) { m_brush.CreateSolidBrush (RGB(173, 27, 64)); m_brush2.CreateSolidBrush (RGB(181, 181, 181)); } else { m_brush.CreateSolidBrush (RGB(100, 100, 100)); m_brush2.CreateSolidBrush (RGB(181, 181, 181)); } CRect rc; int id[]={IDC_EDITname,IDC_EDITbz,IDC_EDITbase,IDC_EDITmoney1,IDC_EDITmoney2,IDC_EDITmoney6,IDC_EDITsalary,IDC_EDITbz2}; for(int i=0; i<8; i++) { GetDlgItem(id[i])->GetWindowRect(rc); ScreenToClient(rc); rc.bottom -=5; GetDlgItem(id[i])->MoveWindow(rc); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void TodayBar::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here CRect rc; GetClientRect(rc); if(g_bRedSkin) { dc.FillSolidRect (rc, RGB(173, 27, 64)); } else dc.FillSolidRect (rc, RGB(100, 100, 100)); int id[]={IDC_EDITname,IDC_EDITbz,IDC_EDITbase,IDC_EDITmoney1,IDC_EDITmoney2,IDC_EDITmoney6,IDC_EDITsalary,IDC_EDITbz2}; for(int i=0; i<8; i++) { GetDlgItem(id[i])->GetWindowRect(rc); ScreenToClient(rc); rc.InflateRect (3,3,1,1); dc.FillRect (rc, &m_brush2); rc.DeflateRect (1,1,1,1); dc.FillRect (rc, &m_brush); } // Do not call CDialog::OnPaint() for painting messages } void TodayBar::InitCtrl() { if(m_link1.m_hWnd==NULL) { CRect rc; GetClientRect(rc); int wid=rc.Width (); rc.top+=3; rc.left+=5; #ifdef CHILD_VERSION m_link1.Create ("今日拍照:1 今日选片:1 今日看设计:1 今日取件:1 ", WS_CHILD|WS_VISIBLE, rc, this, 100); #else m_link1.Create ("今日拍照:1 今日选片:1 今日看设计:1 今日取件:1 今日婚庆:1 ", WS_CHILD|WS_VISIBLE, rc, this, 100); #endif m_link1.PositionWindow(); m_link1.GetWindowRect (rc);ScreenToClient(rc); rc.left =rc.right ; rc.right +=200; m_link2.Create (" 我的业绩: 前期:0 后期:0 计件提成:0 ", WS_CHILD|WS_VISIBLE, rc, this, 100); m_link2.PositionWindow(); m_link2.m_bDisable =1; m_link2.GetWindowRect (rc);ScreenToClient(rc); rc.left =rc.right ; rc.right +=200; m_link3.Create ("查看详情", WS_CHILD|WS_VISIBLE, rc, this, 100); m_link3.PositionWindow(); m_link3.GetWindowRect (rc);ScreenToClient(rc); rc.left =rc.right ; rc.right +=200; m_link6.Create (" 其它同事", WS_CHILD|WS_VISIBLE, rc, this, 100); m_link6.PositionWindow(); rc.right =wid; rc.left =rc.right-200 ; m_link5.Create ("∨", WS_CHILD|WS_VISIBLE, rc, this, 100); m_link5.PositionWindow(); m_link5.GetWindowRect (rc);ScreenToClient(rc); rc.left =wid-rc.Width ()-5; rc.right =wid-5; m_link5.MoveWindow (rc); m_link4.Create ("安全退出 ", WS_CHILD|WS_VISIBLE, rc, this, 100); m_link4.PositionWindow(); m_link4.GetWindowRect (rc); wid=rc.Width (); m_link5.GetWindowRect (rc);ScreenToClient(rc); rc.left-=wid; rc.right =rc.left +wid; m_link4.MoveWindow (rc); //∧\r\n白\r\n∨ } GetData(); } extern float GetSalaryFromRule(float fmoney, CString rule); extern CString GetRule(CString name); void TodayBar::GetData() { if(m_bGet)return; m_bGet=1; g_bNoConnDlg=1; CString strdate,strdate2; strdate2=strdate=g_date; g_sendhead.code[0]=120; g_sendhead.code[1]=121; g_sendhead.code[2]=122; g_sendhead.code[3]=123; g_sendhead.code[4]=139; g_sendhead.code[5]=146; g_sendhead.tabcount=6; g_sendhead.bsql=0; CString sql; sql.Format ("bookingdate>='"+strdate+"' and bookingdate<='"+strdate2+"';time4>='"+strdate+"' and time4<='"+strdate2+"';time6>='"+strdate+"' and time6<='"+strdate2+"';time5>='"+strdate+"' and time5<='"+strdate2+"';hqdate>='"+strdate+"' and hqdate<='"+strdate2+"' and kind='2';;"); g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0)return; DataToArray(&m_TodayList1array,&m_TodayList2array,&m_TodayList3array,&m_TodayList4array,&m_TodayList5array,&m_Workratearray); // g_bNoConnDlg=1; CString str; #ifdef CHILD_VERSION str.Format("今日拍照:%d 今日选片:%d 今日看设计:%d 今日取件:%d ", m_TodayList1array.GetSize(), m_TodayList2array.GetSize(), m_TodayList3array.GetSize(), m_TodayList4array.GetSize()); #else str.Format("今日拍照:%d 今日选片:%d 今日看设计:%d 今日取件:%d 今日婚庆:%d ", m_TodayList1array.GetSize(), m_TodayList2array.GetSize(), m_TodayList3array.GetSize(), m_TodayList4array.GetSize(), m_TodayList5array.GetSize()); //modify by wangwenbin 2014-05-03 #endif m_link1.SetWindowText (str); m_link1.PositionWindow(); ///////////////// { CString name=g_user.name; CString date1,date2; date1.Format ("%s-%s-01", g_date.Mid (0, 4), g_date.Mid (5, 2)); date2.Format ("%s-%s-31", g_date.Mid (0, 4), g_date.Mid (5, 2)); int m_year=atoi(g_date.Mid (0, 4)); int m_month=atoi(g_date.Mid (5, 2)); 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); /////////////// CString filter="name='"+name+"' and dimission='在职';date>='"+date1+"' and date<='"+date2+"';;date>='"+date1+"' and date<='"+date2+"' and renyuan3='"+name+"';time2>='"+date1+"' and time2<='"+date2+"' and status='OK'***date<'"+date1+"';datetime>='"+date1+"' and datetime<='"+date2+"' and name='"+name+"'"; CString temp; temp=";[date]>='"+date1+"' and [date]<='"+date2+"' and [status]='OK' and ([waiter1]='"+name+"' or [waiter12]='"+name+"' or [waiter2]='"+name+"' or [waiter22]='"+name+"')"; filter+=temp; temp=";([time8]>='"+date1+"' and [time8]<='"+date2+"' and [status4]='OK' and [waiter5]='"+name+"') or ([time9]>='"+date1+"' and [time9]<='"+date2+"' and [status6]='OK' and [waiter7]='"+name+"') or ([time10]>='"+date1+"' and [time10]<='"+date2+"' and [status5]='OK' and [waiter4]='"+name+"')"; filter+=temp; g_sendhead.code[0]=34; g_sendhead.code[1]=59; g_sendhead.code[2]=60; g_sendhead.code[3]=198; g_sendhead.code[4]=61; g_sendhead.code[5]=142; g_sendhead.code[6]=192; g_sendhead.code[7]=193; g_sendhead.tabcount=8; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(filter); if(g_bSendOK==0) { g_nYearpos=g_nYearposTemp; return; } CArrayuserarray; CArraybukuanarray; CArraywaiterarray; CArraysingleincomearray; CArraybukuanarray2; CArraytakearray; CArraydigitalarray; DataToArray(&userarray,&bukuanarray,&waiterarray,&singleincomearray,&bukuanarray2,&m_List4array,&takearray,&digitalarray); /////////////////// if(bLastYear)//如果是去年, 则加今年的补款 { g_nYearpos=-1;//今年 filter="name='"+name+"' and dimission='在职';date>='"+date1+"' and date<='"+date2+"';;date>='"+date1+"' and date<='"+date2+"' and renyuan3='"+name+"';time2>='"+date1+"' and time2<='"+date2+"' and status='OK'***date<'"+date1+"';datetime>='"+date1+"' and datetime<='"+date2+"' and name='"+name+"'"; CString temp; temp=";[date]>='"+date1+"' and [date]<='"+date2+"' and [status]='OK' and ([waiter1]='"+name+"' or [waiter12]='"+name+"' or [waiter2]='"+name+"' or [waiter22]='"+name+"')"; filter+=temp; temp=";([time8]>='"+date1+"' and [time8]<='"+date2+"' and [status4]='OK' and [waiter5]='"+name+"') or ([time9]>='"+date1+"' and [time9]<='"+date2+"' and [status6]='OK' and [waiter7]='"+name+"') or ([time10]>='"+date1+"' and [time10]<='"+date2+"' and [status5]='OK' and [waiter4]='"+name+"')"; filter+=temp; g_sendhead.code[0]=34; g_sendhead.code[1]=59; g_sendhead.code[2]=60; g_sendhead.code[3]=198; g_sendhead.code[4]=61; g_sendhead.code[5]=142; g_sendhead.code[6]=192; g_sendhead.code[7]=193; g_sendhead.tabcount=8; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(filter); if(g_bSendOK==0) { g_nYearpos=g_nYearposTemp; return; } CArrayThisYearbukuanarray; CArrayThisYearwaiterarray; CArrayThisYearsingleincomearray; CArrayThisYearbukuanarray2; CArrayThisYearm_List4array; CArrayThisYeartakearray; CArrayThisYeardigitalarray; DataToArray(&userarray,&ThisYearbukuanarray,&ThisYearwaiterarray,&ThisYearsingleincomearray,&ThisYearbukuanarray2,&ThisYearm_List4array,&ThisYeartakearray,&ThisYeardigitalarray); int oldsize=bukuanarray.GetSize (); bukuanarray.SetSize(oldsize+ThisYearbukuanarray.GetSize ()); for(i=oldsize; i='"+date1+"' and date<='"+date2+"' and renyuan3='"+name+"';time2>='"+date1+"' and time2<='"+date2+"' and status='OK'***date<'"+date1+"';datetime>='"+date1+"' and datetime<='"+date2+"' and name='"+name+"'"; CString temp; temp=";[date]>='"+date1+"' and [date]<='"+date2+"' and [status]='OK' and ([waiter1]='"+name+"' or [waiter12]='"+name+"' or [waiter2]='"+name+"' or [waiter22]='"+name+"')"; filter+=temp; temp=";([time8]>='"+date1+"' and [time8]<='"+date2+"' and [status4]='OK' and [waiter5]='"+name+"') or ([time9]>='"+date1+"' and [time9]<='"+date2+"' and [status6]='OK' and [waiter7]='"+name+"') or ([time10]>='"+date1+"' and [time10]<='"+date2+"' and [status5]='OK' and [waiter4]='"+name+"')"; filter+=temp; g_sendhead.code[0]=59; g_sendhead.code[1]=60; g_sendhead.code[2]=198; g_sendhead.code[3]=61; g_sendhead.code[4]=142; g_sendhead.code[5]=192; g_sendhead.code[6]=193; g_sendhead.tabcount=7; g_sendhead.bsql=0; g_pMainWnd->ProcessChatMessageRequest2(filter); if(g_bSendOK==0) { g_nYearpos=g_nYearposTemp; return; } CArrayThisYearbukuanarray; CArrayThisYearwaiterarray; CArrayThisYearsingleincomearray; CArrayThisYearbukuanarray2; CArrayThisYearm_List4array; CArrayThisYeartakearray; CArrayThisYeardigitalarray; DataToArray(&ThisYearbukuanarray,&ThisYearwaiterarray,&ThisYearsingleincomearray,&ThisYearbukuanarray2,&ThisYearm_List4array,&ThisYeartakearray,&ThisYeardigitalarray); int oldsize=bukuanarray.GetSize (); bukuanarray.SetSize(oldsize+ThisYearbukuanarray.GetSize ()); for(i=oldsize; iarray; array.SetSize(bukuanarray.GetSize ()*4+bukuanarray2.GetSize ()*4+singleincomearray.GetSize ()); float money1=0; float money2=0; float money3=0; float money4=0; float money5=0; CArraymoneyarray; CStringArray typearray; int typepos; int arraypos=0; for(int ii=0; ii=date1 && field5<=date2) { sum1+=atof(field3); sum12+=atof(field10); count1++; } if(m_Listdigital.GetItemText (i, 12)=="OK" && field6==name && field7>=date1 && field7<=date2) { sum2+=atof(field3); sum22+=atof(field10); count2++; } if(m_Listdigital.GetItemText (i, 13)=="OK" && field8==name && field9>=date1 && field9<=date2) { sum3+=atof(field3); sum32+=atof(field10); count3++; } } str="修片与精修与设计\r\n"; totalstr+=str; str.Format ("初修: %d单 \r\n订单金额:%0.2f \r\n选片二销:%0.2f\r\n\r\n", count1, sum1, sum12);totalstr+=str; str.Format ("精修: %d单 \r\n订单金额:%0.2f \r\n选片二销:%0.2f\r\n\r\n", count2, sum2, sum22);totalstr+=str; str.Format ("设计: %d单 \r\n订单金额:%0.2f \r\n选片二销:%0.2f\r\n\r\n", count3, sum3, sum32);totalstr+=str; GetDlgItem(IDC_EDITbz2)->SetWindowText(totalstr); } g_bNoConnDlg=0; } CString TodayBar::GetPrice(CString name) { for(int i=0; i*array) { m_List1.DeleteAllItems2 (); int ii=0; m_List1.m_arLabels.SetSize( array->GetSize (), 1 ); int count=0; for(ii=0; iiElementAt (ii)); } m_List1.m_arLabels.SetSize(count, 1); ii=count; m_List1.m_LabelCount=ii; m_List1.SetItemCountEx (ii); } void TodayBar::FillGridTake(CArray*array) { m_Listtake.DeleteAllItems2 (); int ii=0; m_Listtake.m_arLabels.SetSize( array->GetSize (), 1 ); int count=0; for(ii=0; iiElementAt (ii)); } m_Listtake.m_arLabels.SetSize(count, 1); ii=count; m_Listtake.m_LabelCount=ii; m_Listtake.SetItemCountEx (ii); } void TodayBar::FillGridDigital(CArray*array) { m_Listdigital.DeleteAllItems2 (); int ii=0; m_Listdigital.m_arLabels.SetSize( array->GetSize (), 1 ); int count=0; for(ii=0; iiElementAt (ii)); } m_Listdigital.m_arLabels.SetSize(count, 1); ii=count; m_Listdigital.m_LabelCount=ii; m_Listdigital.SetItemCountEx (ii); } HBRUSH TodayBar::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); // TODO: Change any attributes of the DC here if(nCtlColor == CTLCOLOR_STATIC ) { if(pWnd->GetDlgCtrlID ()==100)return hbr; pDC->SetTextColor (RGB(181, 181, 181)); // pdc->setbkcolor(rgb(255,255,255)); pDC->SetBkMode(TRANSPARENT); return (HBRUSH)m_brush;//::GetStockObject(NULL_BRUSH); } else if(CTLCOLOR_EDIT == nCtlColor) { pDC->SetTextColor (RGB(181, 181, 181)); // pdc->setbkcolor(rgb(255,255,255)); pDC->SetBkMode(TRANSPARENT); return (HBRUSH)m_brush;//::GetStockObject(NULL_BRUSH); } // TODO: Return a different brush if the default is not desired return hbr; } void TodayBar::LinkClick(CString str) { if(str.Find ("今日")!=-1) { g_pMainWnd->OnCommandMenu(IDM_TAKECONTROL); } else if(str=="安全退出 ") { g_pMainWnd->OnCommandMenu(IDM_Logout); } else if(str=="隐藏详情") { LinkClick("∧"); } else if(str=="查看详情") { m_link3.ShowWindow (0); m_link3.SetWindowText ("隐藏详情"); m_link3.ShowWindow (1); CRect rc=g_rc; rc.left ++; rc.right -=2; MoveWindow(rc); rc.top +=30; int hei=rc.Height (); CRect rc2,rc3; GetDlgItem(IDC_STATIC12)->GetWindowRect(rc2); int hei2=rc2.Height (); GetDlgItem(IDC_LIST2)->GetWindowRect(rc2); ScreenToClient(rc2); rc2.bottom =rc2.top +hei/2-hei2*2; rc2.right =rc.Width ()-5; int wid=rc2.Width()/2; rc2.right-=wid; GetDlgItem(IDC_LIST2)->MoveWindow(rc2); GetDlgItem(IDC_BUTTON4)->GetWindowRect(rc3); int btnwid=rc3.Width(); int btnhei=rc3.Height(); rc3=rc2; rc3.top -=btnhei+2; rc3.bottom =rc3.top +btnhei; rc3.right-=5; rc3.left=rc3.right-btnwid; GetDlgItem(IDC_BUTTON4)->MoveWindow(rc3); rc3=rc2; rc3.left=rc3.right; rc3.right=rc3.left+wid; GetDlgItem(IDC_LIST7)->MoveWindow(rc3); rc3.top -=btnhei+2; rc3.bottom =rc3.top +btnhei; rc3.right-=5; rc3.left=rc3.right-btnwid; GetDlgItem(IDC_BUTTON7)->MoveWindow(rc3); GetDlgItem(IDC_LIST7)->GetWindowRect(rc3); ScreenToClient(rc3); rc3.top -=hei2; rc3.bottom =rc3.top +hei2; GetDlgItem(IDC_STATIC3)->MoveWindow(rc3); rc2.top =rc2.bottom +hei2*2; rc2.bottom =g_rc.Height (); GetDlgItem(IDC_LIST8)->MoveWindow(rc2); rc3=rc2; rc3.top -=btnhei+2; rc3.bottom =rc3.top +btnhei; rc3.right-=5; rc3.left=rc3.right-btnwid; GetDlgItem(IDC_BUTTON8)->MoveWindow(rc3); GetDlgItem(IDC_LIST8)->GetWindowRect(rc3); ScreenToClient(rc3); rc3.top -=hei2; rc3.bottom =rc3.top +hei2; GetDlgItem(IDC_STATIC10)->MoveWindow(rc3); rc3=rc2; rc3.left=rc3.right; rc3.right=rc3.left+wid; GetDlgItem(IDC_LIST4)->MoveWindow(rc3); rc3.top -=btnhei+2; rc3.bottom =rc3.top +btnhei; rc3.right-=5; rc3.left=rc3.right-btnwid; GetDlgItem(IDC_BUTTON14)->MoveWindow(rc3); GetDlgItem(IDC_LIST4)->GetWindowRect(rc3); ScreenToClient(rc3); rc3.top -=hei2; rc3.bottom =rc3.top +hei2; GetDlgItem(IDC_STATIC16)->MoveWindow(rc3); GetDlgItem(IDC_STATIC2)->GetWindowRect(rc3);ScreenToClient(rc3); rc3.bottom =g_rc.Height ()-hei2; GetDlgItem(IDC_STATIC2)->MoveWindow(rc3); GetDlgItem(IDC_EDITbz2)->GetWindowRect(rc3);ScreenToClient(rc3); rc3.bottom =g_rc.Height ()-hei2*2; GetDlgItem(IDC_EDITbz2)->MoveWindow(rc3); m_link5.ShowWindow (0); m_link5.SetWindowText ("∧"); m_link5.ShowWindow (1); } else if(str=="∨") { LinkClick("查看详情"); } else if(str=="∧") { m_link3.ShowWindow (0); m_link3.SetWindowText ("查看详情"); m_link3.ShowWindow (1); m_link5.ShowWindow (0); m_link5.SetWindowText ("∨"); m_link5.ShowWindow (1); CRect rc=g_rc;rc.bottom =rc.top +20; rc.left ++; rc.right -=2; MoveWindow (rc); } else if(str==" 其它同事") { StaffAchievementShowAll dlg; /*dlg.m_year=m_year; dlg.m_month=m_month; dlg.m_day=m_day; dlg.m_radio2=1; dlg.m_radio1=1;*/ dlg.DoModal (); } } BOOL TodayBar::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->message==WM_KEYDOWN) { g_pMainWnd->SetForegroundWindow (); return g_pMainWnd->PreTranslateMessage(pMsg); switch (pMsg->wParam) { case VK_F1: ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL); return 1; case VK_F2: { } } } return CDialog::PreTranslateMessage(pMsg); } //%0.2f void TodayBar::OnButton5() { // TODO: Add your control notification handler code here SelExpendType seldlg; seldlg.m_mode=2; if(seldlg.DoModal ()!=IDOK)return; SalarySet4 dlg; dlg.m_header ="$"+seldlg.m_sel+":"; dlg.DoModal (); } void TodayBar::OnButton6() { // TODO: Add your control notification handler code here SelExpendType seldlg; seldlg.m_bSecond =1; if(seldlg.DoModal ()!=IDOK)return; SalarySet4 dlg; dlg.m_header ="$"+seldlg.m_sel+":"; dlg.DoModal (); } void TodayBar::OnButton4() { // TODO: Add your control notification handler code here IDC_LIST2 CString name=g_user.name; CStdioFile fp; fp.Open ("c:\\"+name+".txt", CFile::modeCreate|CFile::modeWrite); CString str,field1,field2,field3,field4,field5,field6,field7,field8,field9,field10; int leng1=20; int leng2=15; int leng3=15; int leng4=15; int leng5=15; int leng6=15; int leng7=15; int leng8=15; int leng9=15; int leng10=15; field1="收款日期"; field2="收款金额"; field3="款项类别"; field4="客人姓名"; FillLength(field1, leng1); FillLength(field2, leng2); FillLength(field3, leng3); FillLength(field4, leng4); str=field1+field2+field3+field4+"\n"; fp.WriteString (str); CString m_name1,m_name2; float sum=0; for(int i=0; i='"+strdate+"' and bookingdate<='"+strdate2+"';time4>='"+strdate+"' and time4<='"+strdate2+"';time6>='"+strdate+"' and time6<='"+strdate2+"';time5>='"+strdate+"' and time5<='"+strdate2+"';hqdate>='"+strdate+"' and hqdate<='"+strdate2+"' and kind='2';;"); g_pMainWnd->ProcessChatMessageRequest2(sql); if(g_bSendOK==0)return; DataToArray(&m_TodayList1array,&m_TodayList2array,&m_TodayList3array,&m_TodayList4array,&m_TodayList5array,&m_Workratearray); #ifdef CHILD_VERSION str.Format("今日拍照:%d 今日选片:%d 今日看设计:%d 今日取件:%d ", m_TodayList1array.GetSize(), m_TodayList2array.GetSize(), m_TodayList3array.GetSize(), m_TodayList4array.GetSize()); #else str.Format("今日拍照:%d 今日选片:%d 今日看设计:%d 今日取件:%d 今日婚庆:%d ", m_TodayList1array.GetSize(), m_TodayList2array.GetSize(), m_TodayList3array.GetSize(), m_TodayList4array.GetSize(), m_TodayList5array.GetSize()); //1,1,1,1,1); //wangwenbin test #endif m_link1.SetWindowText (str); } void TodayBar::OnButton8() { // TODO: Add your control notification handler code here // TODO: Add your control notification handler code here // TODO: Add your control notification handler code here CString name=g_user.name; CString date1,date2; date1.Format ("%s-%s-01", g_date.Mid (0, 4), g_date.Mid (5, 2)); date2.Format ("%s-%s-31", g_date.Mid (0, 4), g_date.Mid (5, 2)); CStdioFile fp; fp.Open ("c:\\"+name+"(数码).txt", CFile::modeCreate|CFile::modeWrite); CString str,field1,field2,field3,field4,field5,field6,field7,field8,field9,field10; int leng1=20; int leng2=15; int leng3=15; int leng4=15; int leng5=15; int leng6=15; int leng7=15; int leng8=15; int leng9=15; int leng10=15; CString m_name1,m_name2; float sum1=0; float sum2=0; float sum3=0; float sum12=0; float sum22=0; float sum32=0; int count1=0; int count2=0; int count3=0; { leng1=18; leng2=20; leng3=12; leng4=10; leng5=15; leng6=10; leng7=15; leng8=10; leng9=15; field1="客人姓名"; field2="套系"; field3="套系金额"; field4="初修"; field5="日期"; field6="精修"; field7="日期"; field8="设计"; field9="日期"; field10="选片二销"; FillLength(field1, leng1); FillLength(field2, leng2); FillLength(field3, leng3); FillLength(field4, leng4); FillLength(field5, leng5); FillLength(field6, leng6); FillLength(field7, leng7); FillLength(field8, leng8); FillLength(field9, leng9); FillLength(field10, leng10); str=field1+field2+field3+field4+field5+field6+field7+field8+field9+field10+"\n"; fp.WriteString (str); for(int i=0; i=date1 && field5<=date2) { sum1+=atof(field3); sum12+=atof(field10); count1++; } if(m_Listdigital.GetItemText (i, 12)=="OK" && field6==name && field7>=date1 && field7<=date2) { sum2+=atof(field3); sum22+=atof(field10); count2++; } if(m_Listdigital.GetItemText (i, 13)=="OK" && field8==name && field9>=date1 && field9<=date2) { sum3+=atof(field3); sum32+=atof(field10); count3++; } FillLength(field1, leng1); FillLength(field2, leng2); FillLength(field3, leng3); FillLength(field4, leng4); FillLength(field5, leng5); FillLength(field6, leng6); FillLength(field7, leng7); FillLength(field8, leng8); FillLength(field9, leng9); FillLength(field10, leng10); str=field1+field2+field3+field4+field5+field6+field7+field8+field9+field10+"\n"; fp.WriteString (str); } fp.WriteString ("\n"); str="姓名: "+name; fp.WriteString (str);fp.WriteString ("\n"); str.Format ("初修: %d单 订单金额:%0.2f 选片二销:%0.2f\n", count1, sum1, sum12);fp.WriteString (str); str.Format ("精修: %d单 订单金额:%0.2f 选片二销:%0.2f\n", count2, sum2, sum22);fp.WriteString (str); str.Format ("设计: %d单 订单金额:%0.2f 选片二销:%0.2f\n", count3, sum3, sum32);fp.WriteString (str); } fp.Close (); MessageBox("资料已保存到c:\\"+name+"(数码).txt"); ShellExecute(NULL, _T("open"), _T("c:\\"+name+"(数码).txt"), NULL, NULL, SW_SHOWMAXIMIZED); }