123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- // ClientWnd.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "ClientWnd.h"
- #include "JPEG.h"
- #include "StaffAchievementShowAll.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CClientWnd
- CClientWnd::CClientWnd()
- {
- m_bInit=1;
- }
- CClientWnd::~CClientWnd()
- {
- for(int i=0; i<50; i++)
- {
- if(m_label[i].GetSafeHwnd ())
- m_label[i].DestroyWindow ();
- }
- }
- BEGIN_MESSAGE_MAP(CClientWnd, CWnd)
- //{{AFX_MSG_MAP(CClientWnd)
- ON_WM_ERASEBKGND()
- ON_WM_CREATE()
- ON_CBN_SELCHANGE(100, OnSelchangeCOMBOid)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CClientWnd message handlers
- BOOL CClientWnd::OnEraseBkgnd(CDC* pDC)
- {
- // TODO: Add your message handler code here and/or call default
- CRect rc;
- GetClientRect (rc);
- pDC->FillSolidRect (rc, g_bkcol);
- return 1;
- #ifdef NEW_SKIN
- if(m_bInit)
- {
- m_bInit=0;
- /* CRect rc;
- rc=g_pMainWnd2->m_rcarray.ElementAt (17);
- ScreenToClient(rc);
- m_combobox.Create(WS_VSCROLL|WS_CHILD|CBS_DROPDOWN,rc,this,100);
- m_combobox.ShowWindow(SW_SHOW);
- rc.bottom +=260;
- m_combobox.MoveWindow (rc);
- tpFont.CreatePointFont (180, _T("黑体"));
- m_combobox.SetFont(&tpFont);
- m_acCombo.Init(&m_combobox);
- g_sendhead.bsql=0;
- g_sendhead.code[0]=30;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(21);if(g_bSendOK==0)return 0;
- DataToArray(&m_List1array);
- m_acCombo.m_pArray=&m_List1array;
- m_combobox.SetFocus ();
- CRect rcarray[50];
- int pos=0;
- rcarray[pos]=g_pMainWnd2->m_rcarray.ElementAt (18);ScreenToClient(rcarray[pos]);pos++;
- int dt=g_pMainWnd2->m_rcarray.ElementAt (20).left -g_pMainWnd2->m_rcarray.ElementAt (19).left ;
- for(int i=0; i<6; i++)
- {
- rc=g_pMainWnd2->m_rcarray.ElementAt (19);
- rc.left +=dt*i;
- rc.right +=dt*i;
- ScreenToClient(rc);
- rcarray[pos]=rc;pos++;
- }
-
- dt=g_pMainWnd2->m_rcarray.ElementAt (22).top -g_pMainWnd2->m_rcarray.ElementAt (21).top ;
- for(i=0; i<10; i++)
- {
- rc=g_pMainWnd2->m_rcarray.ElementAt (21);
- rc.top +=dt*i;
- rc.bottom +=dt*i;
- ScreenToClient(rc);
- rcarray[pos]=rc;pos++;
- }
- for(i=0; i<10; i++)
- {
- rc=g_pMainWnd2->m_rcarray.ElementAt (23);
- rc.top +=dt*i;
- rc.bottom +=dt*i;
- ScreenToClient(rc);
- rcarray[pos]=rc;pos++;
- }
- for(i=0; i<10; i++)
- {
- rc=g_pMainWnd2->m_rcarray.ElementAt (24);
- rc.top +=dt*i;
- rc.bottom +=dt*i;
- ScreenToClient(rc);
- rcarray[pos]=rc;pos++;
- }
-
- for(i=0; i<6; i++)
- {
- rc=g_pMainWnd2->m_rcarray.ElementAt (25);
- rc.top +=dt*i;
- rc.bottom +=dt*i;
- ScreenToClient(rc);
- rcarray[pos]=rc;pos++;
- }
- for(i=0; i<6; i++)
- {
- rc=g_pMainWnd2->m_rcarray.ElementAt (26);
- rc.top +=dt*i;
- rc.bottom +=dt*i;
- ScreenToClient(rc);
- rcarray[pos]=rc;pos++;
- }
- rc=g_pMainWnd2->m_rcarray.ElementAt (27);
- ScreenToClient(rc);
- rcarray[pos]=rc;pos++;
- CString str;
- for(i=0; i<pos; i++)
- {
- str.Format("%d", i);
- m_label[i].Create (str, WS_CHILD, rcarray[i], this, 101+i);
- m_label[i].SetTextColor(RGB(0,0,255));
- m_label[i].SetBorder(TRUE,RGB(0,255,0));
- m_label[i].SetBkColor(RGB(255,255,231));
- }*/
- }
- return CWnd::OnEraseBkgnd(pDC);
- #else
- return CWnd::OnEraseBkgnd(pDC);
- #endif
- return 1;//CWnd::OnEraseBkgnd(pDC);
- }
- void CClientWnd::OnSelchangeCOMBOid()
- {
- int pos=m_combobox.GetCurSel ();
- if(pos==-1)return;
- if(m_acCombo.m_posarray.GetSize ()<=pos)return;
- int pos2=m_acCombo.m_posarray .ElementAt (pos);
- CString id=m_List1array.ElementAt (pos2).ElementAt (0);
- CString name1=m_List1array.ElementAt (pos2).ElementAt (1);
- CString name2=m_List1array.ElementAt (pos2).ElementAt (2);
- CString phone1=m_List1array.ElementAt (pos2).ElementAt (12);
- CString phone2=m_List1array.ElementAt (pos2).ElementAt (13);
- CString filter="[id]='"+id+"';[id]='"+id+"';[id]='"+id+"';id='"+id+"' and kind<>'2'";
- g_sendhead.code[0]=11;
- g_sendhead.code[1]=27;
- g_sendhead.code[2]=38;
- g_sendhead.code[3]=56;
- g_sendhead.tabcount=4;
- g_sendhead.bsql=0;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>dindanarray;
- CArray<CStringArray, CStringArray>m_List1array;
- CArray<CStringArray, CStringArray>m_List2array;
- CArray<CStringArray, CStringArray>m_sparray;
- DataToArray(&dindanarray,&m_List1array,&m_List2array,&m_sparray);
- if(dindanarray.GetSize ()==0)return;
- CString str;
- str="单号: "+id;
- str+="\r\n";
- str+="男宾: "+name1;
- str+="\r\n";
- str+="女宾: "+name2;
- str+="\r\n";
- str+="男宾电话: "+phone1;
- str+="\r\n";
- str+="女宾电话: "+phone2;
- CString strarray[50];
- pos=0;
- strarray[pos]=str;pos++;
- str="拍照:"+dindanarray.ElementAt (0).ElementAt (25);
- strarray[pos]=str;pos++;
- str="初修:"+dindanarray.ElementAt (0).ElementAt (44);
- strarray[pos]=str;pos++;
- str="选片:"+dindanarray.ElementAt (0).ElementAt (32);
- strarray[pos]=str;pos++;
- str="精修:"+dindanarray.ElementAt (0).ElementAt (46);
- strarray[pos]=str;pos++;
- str="设计:"+dindanarray.ElementAt (0).ElementAt (45);
- strarray[pos]=str;pos++;
- str="取件:"+dindanarray.ElementAt (0).ElementAt (33);
- strarray[pos]=str;pos++;
- pos=37;
- for(int i=0; i<m_List1array.GetSize (); i++)
- {
- if(pos>42)break;
- str=m_List1array.ElementAt (i).ElementAt (5)+":"+m_List1array.ElementAt (i).ElementAt (1);
- strarray[pos]=str;pos++;
- }
- pos=43;
- str.Format ("套系价格:%s", dindanarray.ElementAt (0).ElementAt (8));
- strarray[pos]=str;pos++;
- for( i=0; i<m_List2array.GetSize (); i++)
- {
- if(pos>48)break;
- str=m_List2array.ElementAt (i).ElementAt (4)+":"+m_List2array.ElementAt (i).ElementAt (1);
- strarray[pos]=str;pos++;
- }
- pos=7;
- for( i=0; i<m_sparray.GetSize (); i++)
- {
- if(pos>16)
- {
- pos=16;
- str="...";
- strarray[pos]=str;
- strarray[pos+10]=str;
- strarray[pos+20]=str;
- break;
- }
- str=m_sparray.ElementAt (i).ElementAt (0);
- strarray[pos]=str;
- str=m_sparray.ElementAt (i).ElementAt (4);
- strarray[pos+10]=str;
- str=m_sparray.ElementAt (i).ElementAt (5);
- strarray[pos+20]=str;
- pos++;
- }
- CString m_taoxijiage = dindanarray.ElementAt (0).ElementAt (8);
- CString m_payed4 = dindanarray.ElementAt (0).ElementAt (19);
- CString m_payed5 = dindanarray.ElementAt (0).ElementAt (20);
- CString m_money1,m_money2,m_money3;
- m_money1 = dindanarray.ElementAt (0).ElementAt (1);
- m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
- m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
- m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
- ConvertToPrice(m_money3);
- pos=49;
- str.Format ("余款:%s", m_money3);
- strarray[pos]=str;pos++;
- for( i=0; i<50; i++)
- {
- // if(strarray[i].IsEmpty ())
- // strarray[i].Format ("%d", i);
- m_label[i].SetWindowText (strarray[i]);
- m_label[i].ShowWindow (SW_SHOW);
- m_label[i].Paint ();
- // m_label[i].Invalidate ();
- }
- m_combobox.SetFocus ();
- }
- void CClientWnd::ShowCtrls(BOOL bShow)
- {
- if(g_pMainWnd2)
- {
- g_pMainWnd2->UseRgn(bShow);
- }
- /* if(bShow==0)
- {
- for(int i=0; i<50; i++)
- {
- m_label[i].ShowWindow (bShow);
- }
- }
- m_combobox.SetWindowText ("");
- m_combobox.ShowWindow (bShow);*/
- }
|