12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028 |
- // DigitalWork.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "DigitalWork.h"
- #include "MyMdi.H"
- #include "ModifyDinDan.h"
- #include "ClientRequirement.h"
- #include "./helper/ffsco.h"
- #include "DigitalWorkSet.h"
- #include "DigitalWorkSet2.h"
- #include "SearchFilter3.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- #pragma comment(lib, "Shlwapi.lib")
- /////////////////////////////////////////////////////////////////////////////
- // DigitalWork
- IMPLEMENT_DYNCREATE(DigitalWork, MyFormView)
- DigitalWork::DigitalWork()
- : MyFormView(DigitalWork::IDD)
- {
- //{{AFX_DATA_INIT(DigitalWork)
- m_filter = _T("");
- m_nAdd=0;
- //}}AFX_DATA_INIT
- if(g_bAllBranch)
- {
- m_nAdd=1;
- }
- }
- DigitalWork::~DigitalWork()
- {
- }
- void DigitalWork::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(DigitalWork)
- DDX_Control(pDX, IDC_COMBO1, m_combo1);
- DDX_Control(pDX, IDC_LIST2, m_List1);
- DDX_Control(pDX, IDC_STATIC1, m_static1);
- DDX_CBString(pDX, IDC_COMBO1, m_filter);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(DigitalWork, MyFormView)
- //{{AFX_MSG_MAP(DigitalWork)
- ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
- ON_WM_TIMER()
- ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
- ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
- ON_BN_CLICKED(IDC_BUTimportphoto, OnBUTimportphoto)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
- ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
- ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
- ON_BN_CLICKED(IDC_BUTimportphoto2, OnBUTimportphoto2)
- ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
- ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // DigitalWork diagnostics
- #ifdef _DEBUG
- void DigitalWork::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void DigitalWork::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // DigitalWork message handlers
- void DigitalWork::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);
- int idarray[]={IDC_BUTimportphoto,IDC_BUTexportphoto,IDC_BUTshowphoto,IDC_BUTclose};
- int idcount=4;
- 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);
- }
- m_static1.SetFont (&g_titlefont);
- if(g_bAllBranch==0)
- {
- #ifdef CHILD_VERSION
- m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
- #else
- m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
- #endif
- m_List1.LoadColumnInfo (169);
- }
- else
- {
- #ifdef CHILD_VERSION
- m_List1.SetHeadings("店名,100;订单号,100;家长姓名,100;宝宝姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;手机,100;固定电话,100" );
- #else
- m_List1.SetHeadings("店名,100;订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;初修,100;选片,100;精修,100;设计,100;加急,100;取件日期,100;拍照日期,100;选片日期,100;看设计日期,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
- #endif
- m_List1.LoadColumnInfo (200);
- }
- m_combo1.AddString (g_user.name);
- m_combo1.GetWindowRect (rc2);
- ScreenToClient(rc2);
- rc2.bottom +=200;
- m_combo1.MoveWindow (rc2);
- GetDlgItem(IDC_BUTclose)->GetWindowRect(rc2);
- SetComboHei(&m_combo1, rc2.Height ());
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(IsHasRights2new(14));
- GetData();
- }
- int DigitalWork::FindName(CString name, CArray<CStringArray, CStringArray>*List1array)
- {
- for(int i=0; i<List1array->GetSize (); i++)
- {
- if(name==List1array->ElementAt (i).ElementAt (0))return i;
- }
- return -1;
- }
- void DigitalWork::FillGrid(BOOL bStatus)
- {
- if(g_bSearchFilter)
- {
- m_List1.DeleteAllItems2 ();
- int ii=0;
- m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
- int count=0;
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(g_filterdate1!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (11+m_nAdd)<g_filterdate1 || m_List1array.ElementAt (ii).ElementAt (11+m_nAdd)>g_filterdate2)
- continue;
- }
- if(g_filterdate3!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (12+m_nAdd)<g_filterdate3 || m_List1array.ElementAt (ii).ElementAt (12+m_nAdd)>g_filterdate4)
- continue;
- }
- if(g_filterdate5!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (9+m_nAdd)<g_filterdate5 || m_List1array.ElementAt (ii).ElementAt (9+m_nAdd)>g_filterdate6)
- continue;
- }
- if(g_waiter1!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find (g_waiter1)==-1 )
- continue;
- }
- if(g_waiter2!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (5+m_nAdd).Find (g_waiter2)==-1 )
- continue;
- }
- if(g_waiter3!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find (g_waiter3)==-1 )
- continue;
- }
- if(g_waiter4!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find (g_waiter4)==-1 )
- continue;
- }
- if(g_bAllBranch && g_filterbranch!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (0)!=g_filterbranch)
- continue;
- }
- if(1)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii=count;
- m_List1.m_LabelCount=ii;
- m_List1.SetItemCountEx (ii);
- CString str;
- str.Format ("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- else
- {
- m_List1.DeleteAllItems2 ();
- int ii=0;
- m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
- int count=0;
- if(m_filter.IsEmpty ())
- {
- if(bStatus==1)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find("OK")==-1)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- else if(bStatus==2)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find("OK")==-1)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- else if(bStatus==3)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find("OK")==-1)
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else
- {
- if(bStatus==1)
- {
- int type=GetType(m_filter);
- if(type==1)//电话
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (16+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (17+m_nAdd).Find (m_filter)!=-1))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else if(type==2)//拼音
- {
- m_filter.MakeUpper ();
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find("OK")==-1 && (m_List1array.ElementAt (ii).ElementAt (18+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (19+m_nAdd).Find (m_filter)!=-1))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (4+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
- m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (16).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (17).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (18).Find (m_filter)!=-1 ))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- }
- else if(bStatus==2)
- {
- int type=GetType(m_filter);
- if(type==1)//电话
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (16+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (17+m_nAdd).Find (m_filter)!=-1))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else if(type==2)//拼音
- {
- m_filter.MakeUpper ();
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find("OK")==-1 && (m_List1array.ElementAt (ii).ElementAt (18+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (19+m_nAdd).Find (m_filter)!=-1))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (6+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
- m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (16).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (17).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (18).Find (m_filter)!=-1 ))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- }
- else if(bStatus==3)
- {
- int type=GetType(m_filter);
- if(type==1)//电话
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (16+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (17+m_nAdd).Find (m_filter)!=-1))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else if(type==2)//拼音
- {
- m_filter.MakeUpper ();
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find("OK")==-1 && (m_List1array.ElementAt (ii).ElementAt (18+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (19+m_nAdd).Find (m_filter)!=-1))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (7+m_nAdd).Find("OK")==-1 &&(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
- m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (16).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (17).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (18).Find (m_filter)!=-1 ))
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- }
- else
- {
- int type=GetType(m_filter);
- if(type==1)//电话
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (16+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (17+m_nAdd).Find (m_filter)!=-1)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else if(type==2)//拼音
- {
- m_filter.MakeUpper ();
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (18+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (19+m_nAdd).Find (m_filter)!=-1)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (0).Find (m_filter)!=-1 ||\
- m_List1array.ElementAt (ii).ElementAt (1).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (2).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (3).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (4).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (5).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (16).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (17).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (18).Find (m_filter)!=-1 )
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- }
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii=count;
- m_List1.m_LabelCount=ii;
- m_List1.SetItemCountEx (ii);
- CString str;
- str.Format ("单数:%d", ii);
- SetDlgItemText(IDC_STATIC2, str);
- }
- if(!g_id.IsEmpty ())
- {
- for(int i=0; i<m_List1.GetItemCount (); i++)
- {
- if(g_id==m_List1.GetItemText (i, 0+m_nAdd))
- {
- m_List1.SetItemState(i,LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED);
- m_List1.EnsureVisible(i,FALSE);
- break;
- }
- }
- }
- }
- void DigitalWork::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- void DigitalWork::OnSelchangeCombo1()
- {
- // TODO: Add your control notification handler code here
- SetTimer(1, 100, NULL);
- }
- void DigitalWork::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- KillTimer(nIDEvent);
- OnButton1();
- }
- BOOL DigitalWork::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- try
- {
- if(pMsg->message==WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_RETURN:
- OnButton1();
- return 1;
- case 0x43: // copy
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_COPY);
- return TRUE;
- }
- break;
- case 0x56: //Ctrl + V:
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_PASTE);
- return TRUE;
- }
- break;
- case 0x58: // cut
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_CUT);
- return TRUE;
- }
- break;
- case 0x5A: //undo
- case 0x59: //redo
- if ( ( GetKeyState( VK_CONTROL ) & 0x80 ) )
- {
- GetFocus()->SendMessage(WM_UNDO);
- return TRUE;
- }
- break;
- }
- }
- else if(pMsg->message==WM_LBUTTONDBLCLK)
- {
- CPoint pt;
- CRect rc,rc2;
- ::GetCursorPos (&pt);
- m_List1.GetWindowRect (rc2);
- if(rc2.PtInRect (pt)==0) return MyFormView::PreTranslateMessage(pMsg);
- pt.x-=rc2.left ;
- pt.y-=rc2.top ;
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)return MyFormView::PreTranslateMessage(pMsg);
- int iItem=m_List1.GetNextSelectedItem(pos);
- m_List1.GetSubItemRect( iItem, 8, LVIR_BOUNDS, rc);
- if(rc.PtInRect (pt))
- {
- CClientRequirement dlg;
- dlg.m_bz2=m_List1.GetItemText (iItem, 8);
- dlg.m_bSave =0;
- dlg.DoModal ();
- }
- }
- return MyFormView::PreTranslateMessage(pMsg);
- }
- catch(...)
- {
- }
- return TRUE;
- }
- void DigitalWork::GetSavePath(CString &path)
- {
- }
- int DigitalWork::FindArray(CStringArray *pArray, CString Str)
- {
- return -1;
- }
- void DigitalWork::GetNo(CString str, CStringArray &array)
- {
- }
- CString DigitalWork::GetSelName(CString name, CArray<CStringArray, CStringArray>&spnamearray)
- {
- return "";
- }
- void DigitalWork::OnButton1()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid();
- }
- void DigitalWork::OnButton2()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid(1);
- }
- void DigitalWork::OnButton3()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid(2);
- }
- void DigitalWork::OnButton4()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid(3);
- }
- void DigitalWork::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
- // TODO: Add your control notification handler code here
- *pResult = 0;
- }
- void DigitalWork::OnBUTimportphoto2()
- {
- }
- void DigitalWork::OnBUTimportphoto()
- {
- if(IsHasRights2new(14)==0)return;
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- AfxMessageBox("请先选中您要安排的客人!", MB_ICONINFORMATION);
- return;
- }
- int iItem;
- CStringArray idarray;
- CStringArray brancharray;
- CStringArray namearray1;
- CStringArray namearray2;
- while (pos)
- {
- iItem = m_List1.GetNextSelectedItem(pos);
- idarray.Add (m_List1.GetItemText (iItem, 0+m_nAdd));
- namearray1.Add (m_List1.GetItemText (iItem, 1+m_nAdd));
- namearray2.Add (m_List1.GetItemText (iItem, 2+m_nAdd));
- if(g_bAllBranch)
- brancharray.Add (m_List1.GetItemText (iItem, 0));
- }
- if(idarray.GetSize()>20)
- {
- AfxMessageBox("一次最多安排20个客人!", MB_ICONINFORMATION);
- return;
- }
- DigitalWorkSet dlg;
- dlg.m_pArray=&idarray;
- dlg.m_pArrayBranch=&brancharray;
- dlg.m_pArrayName1=&namearray1;
- dlg.m_pArrayName2=&namearray2;
- dlg.m_pExistWorkArray=&m_workarray;
- if(dlg.DoModal()==IDOK)
- {
- if(g_bAllBranch)
- {
- if(AfxMessageBox("是否实时更新数据?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
- }
- GetData();
- }
- }
- void DigitalWork::OnBUTexportphoto()
- {
- DigitalWorkSet2 dlg;
- dlg.DoModal ();
- }
- void DigitalWork::OnBUTshowphoto()
- {
- DigitalWorkSet2 dlg;
- dlg.m_mode=1;
- dlg.DoModal ();
- }
- void DigitalWork::OnClickList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)return;
- int iItem=m_List1.GetNextSelectedItem(pos);
- g_id = m_List1.GetItemText (iItem, 0+m_nAdd);
- *pResult = 0;
- }
- void DigitalWork::GetData()
- {
- if(g_bAllBranch)
- {
- GetData2();
- return;
- }
- if(g_bShowOK==0)
- {
- #ifdef LKAY_VERSION
- CString filter="status3='未取' and status<>'未拍' and (dindantype<>'意向客户' or dindantype is null);";
- #else
- CString filter="status3='未取' and status<>'未拍';";
- #endif
- g_sendhead.bsql=0;
- g_sendhead.code[0]=135;
- g_sendhead.code[1]=136;
- g_sendhead.tabcount=2;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- }
- else
- {
- #ifdef LKAY_VERSION
- CString filter="status<>'未拍' and (dindantype<>'意向客户' or dindantype is null);";
- #else
- CString filter="status<>'未拍';";
- #endif
- g_sendhead.bsql=0;
- g_sendhead.code[0]=135;
- g_sendhead.code[1]=136;
- g_sendhead.tabcount=2;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- }
- DataToArray(&m_List1array,&g_List1array);
- HidePrice();
- int i = 0;
- for( i=0; i<g_List1array.GetSize (); i++)
- {
- for(int j=0; j<m_List1array.GetSize (); j++)
- {
- if(g_List1array.ElementAt (i).ElementAt (0)==m_List1array.ElementAt (j).ElementAt (0))
- {
- m_List1array.ElementAt (j).SetAt (4, m_List1array.ElementAt (j).ElementAt (4)+g_List1array.ElementAt (i).ElementAt (1));
- m_List1array.ElementAt (j).SetAt (6, m_List1array.ElementAt (j).ElementAt (6)+g_List1array.ElementAt (i).ElementAt (3));
- m_List1array.ElementAt (j).SetAt (7, m_List1array.ElementAt (j).ElementAt (7)+g_List1array.ElementAt (i).ElementAt (5));
- }
- }
- }
- FillGrid();
- m_workarray.RemoveAll ();
- //m_workarray
- CString str,name;
- int pos;
- for( i=0; i<m_List1array.GetSize (); i++)
- {
- str=m_List1array.ElementAt (i).ElementAt (4);
- if(str.Find ("OK")==-1)
- {
- pos=str.Find ("/");
- str=str.Right (str.GetLength ()-pos-1);
- if(str!="")
- {
- pos=FindName(str, &m_workarray);
- if(pos==-1)
- {
- pos=m_workarray.GetSize ()+1;
- m_workarray.SetSize(pos, 1);
- pos--;
- m_workarray.ElementAt (pos).Add (str);
- m_workarray.ElementAt (pos).Add ("1");
- m_workarray.ElementAt (pos).Add ("0");
- m_workarray.ElementAt (pos).Add ("0");
- }
- else
- {
- str=m_workarray.ElementAt (pos).ElementAt (1);
- str.Format ("%d", atoi(str)+1);
- m_workarray.ElementAt (pos).SetAt (1, str);
- }
- }
- }
- str=m_List1array.ElementAt (i).ElementAt (6);
- if(str.Find ("OK")==-1)
- {
- pos=str.Find ("/");
- str=str.Right (str.GetLength ()-pos-1);
- if(str!="")
- {
- pos=FindName(str, &m_workarray);
- if(pos==-1)
- {
- pos=m_workarray.GetSize ()+1;
- m_workarray.SetSize(pos, 1);
- pos--;
- m_workarray.ElementAt (pos).Add (str);
- m_workarray.ElementAt (pos).Add ("0");
- m_workarray.ElementAt (pos).Add ("1");
- m_workarray.ElementAt (pos).Add ("0");
- }
- else
- {
- str=m_workarray.ElementAt (pos).ElementAt (2);
- str.Format ("%d", atoi(str)+1);
- m_workarray.ElementAt (pos).SetAt (2, str);
- }
- }
- }
- str=m_List1array.ElementAt (i).ElementAt (7);
- if(str.Find ("OK")==-1)
- {
- pos=str.Find ("/");
- str=str.Right (str.GetLength ()-pos-1);
- if(str!="")
- {
- pos=FindName(str, &m_workarray);
- if(pos==-1)
- {
- pos=m_workarray.GetSize ()+1;
- m_workarray.SetSize(pos, 1);
- pos--;
- m_workarray.ElementAt (pos).Add (str);
- m_workarray.ElementAt (pos).Add ("0");
- m_workarray.ElementAt (pos).Add ("0");
- m_workarray.ElementAt (pos).Add ("1");
- }
- else
- {
- str=m_workarray.ElementAt (pos).ElementAt (3);
- str.Format ("%d", atoi(str)+1);
- m_workarray.ElementAt (pos).SetAt (3, str);
- }
- }
- }
- }
- }
- void DigitalWork::HidePrice()
- {
- }
- void DigitalWork::GetData2()
- {
- g_List1array.RemoveAll ();
- m_List1array.RemoveAll ();
- CString branch;
- int i = 0;
- int j = 0;
- for( i=-1; i<g_brancharray.GetSize ()-1; i++)
- {
- if(i!=-1)
- {
- branch=g_brancharray.ElementAt (i).ElementAt (0);
- g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
- g_pMainWnd->OnDisconnect();
- g_branchname=branch;
- g_bBranchModify=1;
- }
- else
- branch=g_brancharray.ElementAt (g_brancharray.GetSize ()-1).ElementAt (0);
- if(g_bShowOK==0)
- {
- CString filter="status3='未取' and status<>'未拍';";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=135;
- g_sendhead.code[1]=136;
- g_sendhead.tabcount=2;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
- }
- else
- {
- CString filter="status<>'未拍';";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=135;
- g_sendhead.code[1]=136;
- g_sendhead.tabcount=2;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)continue;
- }
- CArray<CStringArray, CStringArray>List1array;
- CArray<CStringArray, CStringArray>List2array;
- DataToArray(&List1array,&List2array);
- int size=m_List1array.GetSize ();
- for( j=0; j<List1array.GetSize (); j++)
- {
- size++;
- m_List1array.SetSize(size , 1 );
- size--;
- m_List1array.ElementAt (size).Copy (List1array.ElementAt (j));
- m_List1array.ElementAt (size).InsertAt (0, branch);
- size++;
- }
- size=g_List1array.GetSize ();
- for( j=0; j<List2array.GetSize (); j++)
- {
- size++;
- g_List1array.SetSize(size , 1 );
- size--;
- g_List1array.ElementAt (size).Copy (List2array.ElementAt (j));
- g_List1array.ElementAt (size).InsertAt (0, branch);
- size++;
- }
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify=0;g_branchip=g_branchname="";
- HidePrice();
- for( i=0; i<g_List1array.GetSize (); i++)
- {
- for( j=0; j<m_List1array.GetSize (); j++)
- {
- if(g_List1array.ElementAt (i).ElementAt (0)==m_List1array.ElementAt (j).ElementAt (0) && g_List1array.ElementAt (i).ElementAt (1)==m_List1array.ElementAt (j).ElementAt (1))
- {
- m_List1array.ElementAt (j).SetAt (4+m_nAdd, m_List1array.ElementAt (j).ElementAt (4+m_nAdd)+g_List1array.ElementAt (i).ElementAt (1+m_nAdd));
- m_List1array.ElementAt (j).SetAt (6+m_nAdd, m_List1array.ElementAt (j).ElementAt (6+m_nAdd)+g_List1array.ElementAt (i).ElementAt (3+m_nAdd));
- m_List1array.ElementAt (j).SetAt (7+m_nAdd, m_List1array.ElementAt (j).ElementAt (7+m_nAdd)+g_List1array.ElementAt (i).ElementAt (5+m_nAdd));
- }
- }
- }
- FillGrid();
- m_workarray.RemoveAll ();
- //m_workarray
- CString str,name;
- int pos;
- for( i=0; i<m_List1array.GetSize (); i++)
- {
- str=m_List1array.ElementAt (i).ElementAt (4+m_nAdd);
- if(str.Find ("OK")==-1)
- {
- pos=str.Find ("/");
- str=str.Right (str.GetLength ()-pos-1);
- if(str!="")
- {
- pos=FindName(str, &m_workarray);
- if(pos==-1)
- {
- pos=m_workarray.GetSize ()+1;
- m_workarray.SetSize(pos, 1);
- pos--;
- m_workarray.ElementAt (pos).Add (str);
- m_workarray.ElementAt (pos).Add ("1");
- m_workarray.ElementAt (pos).Add ("0");
- m_workarray.ElementAt (pos).Add ("0");
- }
- else
- {
- str=m_workarray.ElementAt (pos).ElementAt (1);
- str.Format ("%d", atoi(str)+1);
- m_workarray.ElementAt (pos).SetAt (1, str);
- }
- }
- }
- str=m_List1array.ElementAt (i).ElementAt (6+m_nAdd);
- if(str.Find ("OK")==-1)
- {
- pos=str.Find ("/");
- str=str.Right (str.GetLength ()-pos-1);
- if(str!="")
- {
- pos=FindName(str, &m_workarray);
- if(pos==-1)
- {
- pos=m_workarray.GetSize ()+1;
- m_workarray.SetSize(pos, 1);
- pos--;
- m_workarray.ElementAt (pos).Add (str);
- m_workarray.ElementAt (pos).Add ("0");
- m_workarray.ElementAt (pos).Add ("1");
- m_workarray.ElementAt (pos).Add ("0");
- }
- else
- {
- str=m_workarray.ElementAt (pos).ElementAt (2);
- str.Format ("%d", atoi(str)+1);
- m_workarray.ElementAt (pos).SetAt (2, str);
- }
- }
- }
- str=m_List1array.ElementAt (i).ElementAt (7+m_nAdd);
- if(str.Find ("OK")==-1)
- {
- pos=str.Find ("/");
- str=str.Right (str.GetLength ()-pos-1);
- if(str!="")
- {
- pos=FindName(str, &m_workarray);
- if(pos==-1)
- {
- pos=m_workarray.GetSize ()+1;
- m_workarray.SetSize(pos, 1);
- pos--;
- m_workarray.ElementAt (pos).Add (str);
- m_workarray.ElementAt (pos).Add ("0");
- m_workarray.ElementAt (pos).Add ("0");
- m_workarray.ElementAt (pos).Add ("1");
- }
- else
- {
- str=m_workarray.ElementAt (pos).ElementAt (3);
- str.Format ("%d", atoi(str)+1);
- m_workarray.ElementAt (pos).SetAt (3, str);
- }
- }
- }
- }
- }
- void DigitalWork::OnBtnsearchfilter()
- {
- // TODO: Add your control notification handler code here
- SearchFilter3 dlg;
- if(dlg.DoModal ()==IDOK)
- {
- FillGrid();
- }
- g_bSearchFilter=0;
- }
|