123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353 |
- // BeautifySkinFrom.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "BeautifySkinFrom.h"
- #include "MyMdi.H"
- #include "ModifyDinDan.h"
- #include "ShowPic.h"
- #include "SelProvider.h"
- #include "CompressOption.h"
- #include "DlgFirstRepairDivision.h"
- #include "NetShareInfo.h"
- #include "DlgChuXiuInfo.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- //#pragma comment(lib, "Shlwapi.lib")
- /////////////////////////////////////////////////////////////////////////////
- // BeautifySkinFrom
- IMPLEMENT_DYNCREATE(BeautifySkinFrom, MyFormView)
- BeautifySkinFrom::BeautifySkinFrom()
- : MyFormView(BeautifySkinFrom::IDD)
- {
- //{{AFX_DATA_INIT(BeautifySkinFrom)
- m_filter = _T("");
- m_nAdd=0;
- //}}AFX_DATA_INIT
- if(g_bAllBranch)
- {
- m_nAdd=1;
- }
- }
- BeautifySkinFrom::~BeautifySkinFrom()
- {
- }
- void BeautifySkinFrom::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(BeautifySkinFrom)
- 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(BeautifySkinFrom, MyFormView)
- //{{AFX_MSG_MAP(BeautifySkinFrom)
- 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_BUTimportphoto, OnBUTimportphoto)
- ON_BN_CLICKED(IDC_BUTshowphoto, OnBUTshowphoto)
- ON_BN_CLICKED(IDC_BUTexportphoto, OnBUTexportphoto)
- ON_BN_CLICKED(IDC_BUTexportphoto2, OnBUTexportphoto2)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
- ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
- ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
- ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // BeautifySkinFrom diagnostics
- #ifdef _DEBUG
- void BeautifySkinFrom::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void BeautifySkinFrom::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // BeautifySkinFrom message handlers
- void BeautifySkinFrom::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_BUTprint3,IDC_BUTexportphoto,IDC_BUTimportphoto,IDC_BUTshowphoto,IDC_BUTexportphoto2,IDC_BUTclose};
- int idcount=6;
- 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" );
- #else
- m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;拍照,100;修片,100;修片日期,100;加急,100;选片日期,100;摄影师,100;修片人,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100" );
- #endif
- m_List1.LoadColumnInfo (118);
- }
- else
- {
- #ifdef CHILD_VERSION
- m_List1.SetHeadings("店名,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" );
- #endif
- m_List1.LoadColumnInfo (197);GetDlgItem(IDC_BUTprint3)->ShowWindow (1);
- }
- GetData();
- 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_BUTexportphoto)->EnableWindow(IsHasRights2new(8));
- GetDlgItem(IDC_BUTexportphoto2)->EnableWindow(IsHasRights2new(9));
- }
- void BeautifySkinFrom::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 (5+m_nAdd)<g_filterdate1 || m_List1array.ElementAt (ii).ElementAt (5+m_nAdd)>g_filterdate2)
- continue;
- }
- if(g_waiter1!="")
- {
- if(m_List1array.ElementAt (ii).ElementAt (9+m_nAdd)!=g_waiter1)
- 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)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if( (m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="OK"||m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="拍摄中") && m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)!="OK")
- 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)
- {
- int type=GetType(m_filter);
- if(type==1)//电话
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if((m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="OK"||m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="拍摄中")&&m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)!="OK" && (m_List1array.ElementAt (ii).ElementAt (13+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (14+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 (3+m_nAdd)=="OK"||m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="拍摄中")&&m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)!="OK" &&(m_List1array.ElementAt (ii).ElementAt (15+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (16+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 (3+m_nAdd)=="OK"||m_List1array.ElementAt (ii).ElementAt (3+m_nAdd)=="拍摄中")&&m_List1array.ElementAt (ii).ElementAt (4+m_nAdd)!="OK" &&(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 (8).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (9).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (10).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (11).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (13).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (14).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (15).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 (13+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (14+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 (15+m_nAdd).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (16+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 (8).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (9).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (10).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (11).Find (m_filter)!=-1|| \
- m_List1array.ElementAt (ii).ElementAt (13).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (14).Find (m_filter)!=-1 || \
- m_List1array.ElementAt (ii).ElementAt (15).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 BeautifySkinFrom::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- void BeautifySkinFrom::OnSelchangeCombo1()
- {
- // TODO: Add your control notification handler code here
- SetTimer(1, 100, NULL);
- }
- void BeautifySkinFrom::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- KillTimer(nIDEvent);
- OnButton1();
- }
- BOOL BeautifySkinFrom::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;
- }
- }
- return MyFormView::PreTranslateMessage(pMsg);
- }
- catch(...)
- {
- }
- return true;
- }
- BOOL GetFileNo2(CString dir, CString no)
- {
- int pos=no.Find("-");
- if(pos!=-1)no=no.Left(pos);
- CString path;
- CString path2;
- CString path3;
- CString path4;
- CString temp;
- CStringArray array;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(dir), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- temp=(*it).c_str();
- if(::FindArray (&array, temp)==-1)
- array.Add (temp);
- }
- for(int i=0; i<array.GetSize (); i++)
- {
- dir=array.ElementAt (i);
- path.Format ("%s%s.jpg", dir, no);
- path2.Format ("%s%s.raw", dir, no);
- path3.Format ("%s%s.cr2", dir, no);
- path4.Format ("%s%s.NEF", dir, no);
- if(PathFileExists (path) || PathFileExists (path2) || PathFileExists (path3) || PathFileExists (path4))
- {
- return 1;
- }
- }
- return 0;
- }
- void BeautifySkinFrom::OnBUTimportphoto() // 导入修好的片;
- {
- // 2015.11.10
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导入初修片的订单!"),MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- // 获取列表订单信息:域名、订单号、景点名、顾客信息……
- CString strBranchName = _T("");
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- CString strScenery = _T("");
- CString strCustomerInfo = _T(""); // 顾客信息;
- CString strXiupianDate = _T(""); // 修片日期;
- CString strXiupianRen = _T(""); // 修片人;
- CString strPhone = _T(""); // 顾客手机;
- CString strXiupianStatus = _T(""); // 初修状态;
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总时;
- strBranchName = m_List1.GetItemText( nSelectedItem, 0);
- strBranchId = GetDomainFromBranch( strBranchName );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchName = _T("");
- strBranchId = g_domain;
- }
- else
- {// 连接分店时;
- strBranchName = g_branchname;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // 获取订单号;
- strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- // 获取修片状态;
- strXiupianStatus = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd);
- // 获取修片人;
- strXiupianRen = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd);
- // 获取修片日期;
- strXiupianDate = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
- // 获取顾客信息;
- strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- CDlgChuXiuInfo xpdlg;
- xpdlg.m_strOrderNumber = strOrderNum;
- xpdlg.m_strXiupianRen = strXiupianRen;
- if ( strXiupianStatus == _T("OK") )
- xpdlg.m_nXiupianStatus = 0;
- else if ( strXiupianStatus == _T("修片中"))
- xpdlg.m_nXiupianStatus = 1;
- else if ( strXiupianStatus == _T("未修"))
- xpdlg.m_nXiupianStatus = 2;
- CString strSQL = _T("");
- if ( xpdlg.DoModal() == IDOK )
- {
- if ( xpdlg.m_bGrowthTx )
- strScenery = xpdlg.m_strScenery;
- if ( xpdlg.m_nXiupianStatus == 0 )
- strXiupianStatus = _T("OK");
- else if ( xpdlg.m_nXiupianStatus == 1)
- strXiupianStatus = _T("修片中");
- else if ( xpdlg.m_nXiupianStatus == 2 )
- strXiupianStatus = _T("未修");
- strXiupianRen = xpdlg.m_strXiupianRen;
- if (strXiupianDate.IsEmpty())
- strSQL.Format(_T("update dindan set waiter5 = '%s', status4 = '%s', time8 = '%s' where id = '%s'"), strXiupianRen, strXiupianStatus, g_date, strOrderNum);
- else
- strSQL.Format(_T("update dindan set waiter5 = '%s', status4 = '%s' where id = '%s'"), strXiupianRen, strXiupianStatus, strOrderNum);
- g_sendhead.bsql = TRUE;
- if( g_bAllBranch )
- {// 多店汇总时;
- g_branchip = GetBranchIPbyId(strBranchId);
- g_pMainWnd->OnDisconnect();
- g_branchname = strBranchName;
- g_bBranchModify = TRUE;
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- g_bBranchModify = FALSE;
- g_branchip = g_branchname = _T("");
- }
- else
- {// 连接分店或本店时;
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- }
- if( !g_bSendOK )
- {
- OutputDebugString(_T("连接服务器失败!\n"));
- return;
- }
- if( !g_bAllBranch )
- {
- GetData();
- }
- else
- {// 多店汇总时;
- for(int i = 0; i < m_List1array.GetSize(); i++ )
- {
- if( strOrderNum == m_List1array.ElementAt(i).ElementAt(1) && strBranchName == m_List1array.ElementAt(i).ElementAt(0) )
- {
- m_List1array.ElementAt(i).SetAt(4 + m_nAdd, strXiupianStatus);
- if(strXiupianDate.IsEmpty())
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, g_date);
- m_List1array.ElementAt(i).SetAt( 9 + m_nAdd, strXiupianRen);
- FillGrid();
- break;
- }
- }
- }
- }
- else
- {
- // 开始导入初修片;
- if ( MessageBox(_T("是否现在开始导入初修片!"), _T("导片提示:导入初修片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
- {// 是否马上导入相片;
- return;
- }
- if ( xpdlg.m_bGrowthTx )
- strScenery = xpdlg.m_strScenery;
- if ( xpdlg.m_bGrowthTx && strScenery.IsEmpty() )
- {
- AfxMessageBox(_T("儿童成长套系导片必须选择套系名!"));
- return;
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////////////////////////
- if ( g_pIMGProcess == NULL )
- {
- return ;
- }
- // 获取完信息,开始导入初修片;
- ImgImportInterface *pImport = NULL;
- g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
- if ( pImport )
- {
- pImport->ImportSecondaryImg(
- TRUE, // 相片源的类型:true = 选择文件夹形式; false = 选择文件形式;
- strBranchId, // 分店域名;
- strOrderNum, // 订单号;
- strCustomerInfo, // 顾客信息;
- !strScenery.IsEmpty(), // 导入时是否生成景点名;
- strScenery, // 要导入并生成的景点名;
- _T("*.jpg|*.jpeg"), // 要导入的扩展名;
- INVALID_COPY_PIX, // 要导入的相片的压缩像素大小;INVALID_COPY_PIX表示不压缩,原比例导入;
- _T("*.nef|*.cr2|*.raw|*.ra2"), // 导入相片时,附加要导入的扩展名;附加的相片不设置压缩像素;
- TRUE, // 导入操作时,是否生成缩略图;只生成lpImportExt的;
- SET_PIX(100,100), // 要生成的缩略图的像素大小;
- FALSE // 目标文件存在是否复制,只针对lpImportExt和lpImportWithExt对应的文件,缩略图直接覆盖;
- );
- g_pIMGProcess->Release();
- WriteOptLog(_T("导入初修,订单号:%s"),strOrderNum);
- }
- // 结束;
- }
- void BeautifySkinFrom::OnBUTshowphoto() // 查看修好的片;
- {
- // 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 branch;
- CString id=m_List1.GetItemText (iItem, 0+m_nAdd);
- if(g_bAllBranch)
- branch=m_List1.GetItemText (iItem, 0);
- CString name=m_List1.GetItemText (iItem, 1+m_nAdd)+","+m_List1.GetItemText (iItem, 2+m_nAdd);
- name.TrimLeft (",");
- name.TrimRight (",");
- name="客人:"+name;
- ShowPic dlg;
- dlg.m_id=id;
- dlg.m_name=name;
- dlg.m_mode=2;
- if(g_branchname == _T(""))
- dlg.m_path = g_path1 + "\\";
- else
- {
- dlg.m_branch = GetDomainFromBranch(g_branchname);
- CString branchpath = GetBranchPhotoPath(g_branchname);
- dlg.m_path = g_path1 + branchpath + "\\";
- }
- #ifndef USE_KERNEL_DLL
- #if USE_SHARE_FLORD
- // 根据域名,相片类型,订单号查找相片;
- dlg.m_aryOfShareDirectory.RemoveAll();
- CNetShareInfo::GetInstance()->LoadOrderImages(dlg.m_mode, dlg.m_id, g_domain, dlg.m_patharray1, &dlg.m_aryOfShareDirectory);
- #endif
- #endif
- dlg.m_path+=id;
- dlg.m_path +="\\";
- dlg.DoModal ();
- }
- void BeautifySkinFrom::OnBUTexportphoto() // 导出原片;
- {
- // 2015.11.10
- // 判断登陆用户是否有导出原片的权限;
- if ( !IsHasRights2new(8) )
- {
- AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
- return;
- }
- // 获取列表信息:域名、订单号、景点名、顾客信息;
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- // 初修列表不支持景点名,需要从其他地方获取;
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总时;
- strBranchId = GetDomainFromBranch( m_List1.GetItemText(nSelectedItem, 0) );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchId = g_domain;
- }
- else
- {// 连接分店时;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // 获取订单号;
- strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- // 获取顾客信息;
- strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
- IsGrowthTx IsGrowthtxdlg;
- IsGrowthtxdlg.m_mode = 1;
- IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
- IsGrowthtxdlg.DoModal();
- if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
- {
- return;
- }
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {
- // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
- strScenery = IsGrowthtxdlg.m_seltxname;
- if ( strScenery == _T("全部") )
- {
- strScenery.Empty();
- }
- }
- // 导出原片时,是否压缩导出;
- DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
- /////////////////////////////////////////////////////////////////////////////////////////////////
- if ( g_pIMGProcess == NULL )
- {
- return;
- }
- // 获取完信息,开始导出原片;
- ImgExportInterface *pExport = NULL;
- g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
- if ( pExport )
- {
- pExport->ExportOriginalImg(
- TRUE,
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- _T("*.jpg|*.jpeg"),
- dwExportPix,
- _T("*.nef|*.cr2|*.raw|*.ra2"),
- FALSE,
- FALSE
- );
- }
- g_pIMGProcess->Release();
- WriteOptLog(_T("导出原片,订单号:%s"),strOrderNum);
- // 结束;
- }
- void BeautifySkinFrom::OnBUTexportphoto2() // 导出修好的片;
- {
- // 2015.11.10
- // 判断登陆用户是否有导出原片的权限;
- if ( !IsHasRights2new(9) )
- {
- AfxMessageBox(_T("您无权限导出原片!"),MB_ICONINFORMATION);
- return;
- }
- // 获取列表信息:域名、订单号、景点名、顾客信息;
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("请选中您要导出原片的订单!"), MB_ICONINFORMATION);
- return;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- CString strBranchId = _T("");
- CString strOrderNum = _T("");
- // 初修列表不支持景点名,需要从其他地方获取;
- CString strScenery = _T("");
- CString strCustomerInfo = _T("");
- // 获取域名;
- if ( g_bAllBranch )
- {// 多店汇总时;
- strBranchId = GetDomainFromBranch( m_List1.GetItemText(nSelectedItem, 0) );
- }
- else
- {
- if ( g_branchname.IsEmpty() )
- {// 连接本店时;
- strBranchId = g_domain;
- }
- else
- {// 连接分店时;
- strBranchId = GetDomainFromBranch( g_branchname );
- }
- }
- // 获取订单号;
- strOrderNum = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- // 获取顾客信息;
- strCustomerInfo = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd) + _T(",") + m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- // 获取景点名,需要读取dindanjd表获取,目前只支持儿童成长套系订单;
- IsGrowthTx IsGrowthtxdlg;
- IsGrowthtxdlg.m_mode = 1;
- IsGrowthtxdlg.m_strOrderNumber = strOrderNum;
- IsGrowthtxdlg.DoModal();
- if( IsGrowthtxdlg.m_bReturnOK == 0 || (IsGrowthtxdlg.m_bGrowthTx && IsGrowthtxdlg.m_seltxname.IsEmpty()) )
- {
- return;
- }
- if ( IsGrowthtxdlg.m_bGrowthTx )
- {
- // 读取dindanjd表里的成长套系名,并返回选中的成长套系名;
- strScenery = IsGrowthtxdlg.m_seltxname;
- if ( strScenery == _T("全部") )
- {
- strScenery.Empty();
- }
- }
- // 导出原片时,是否压缩导出;
- DWORD dwExportPix = INVALID_COPY_PIX; // 通过其他对话框,选择导出时压缩的像素;
- /////////////////////////////////////////////////////////////////////////////////////////////////
- if ( g_pIMGProcess == NULL )
- {
- return ;
- }
- // 获取完信息,开始导出原片;
- ImgExportInterface *pExport = NULL;
- g_pIMGProcess->QueryInterface(IID_ImgExportInterface, (void**)&pExport);
- if ( pExport )
- {
- pExport->ExportSecondaryImg(
- TRUE,
- strBranchId,
- strOrderNum,
- strCustomerInfo,
- !strScenery.IsEmpty(),
- strScenery,
- _T("*.jpg|*.jpeg"),
- dwExportPix,
- _T("*.nef|*.cr2|*.raw|*.ra2"),
- FALSE,
- FALSE
- );
- }
- g_pIMGProcess->Release();
- WriteOptLog(_T("导出初修,订单号:%s"),strOrderNum);
- // 结束;
- }
- void BeautifySkinFrom::OnButton1()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid();
- }
- void BeautifySkinFrom::OnButton2()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft ();
- m_filter.TrimRight ();
- FillGrid(1);
- }
- void BeautifySkinFrom::OnItemchangedList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
- // TODO: Add your control notification handler code here
- POSITION pos;
- pos=m_List1.GetFirstSelectedItemPosition();
- if(pos==NULL)
- {
- return;
- }
- int iItem=m_List1.GetNextSelectedItem(pos);
- if(IsHasRights2new(5) || IsHasRights2new(49))
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
- }
- else
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
- *pResult = 0;
- }
- BOOL BeautifySkinFrom::CheckOK(CString name)
- {
- int pos=name.Find("-");
- if(pos!=-1)name=name.Left(pos);
- if(name.GetLength ()>4)return 0;
- for(int i=0; i<name.GetLength (); i++)
- {
- if(name.GetAt (i)<'0'||name.GetAt (i)>'9')return 0;
- }
- return 1;
- }
- void BeautifySkinFrom::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 BeautifySkinFrom::HidePrice()
- {
- }
- void BeautifySkinFrom::OnBtnsearchfilter()
- {
- // TODO: Add your control notification handler code here
- SearchFilter dlg;
- dlg.m_mode = 2;
- if(dlg.DoModal ()==IDOK)FillGrid();
- g_bSearchFilter=0;
- }
- void BeautifySkinFrom::GetData()
- {
- if(g_bAllBranch==0)
- {
- if(g_bShowOK==0)
- {
- #ifdef LKAY_VERSION
- CString filter="status3='未取' and (dindantype<>'意向客户' or dindantype is null)";
- #else
- CString filter="status3='未取'";
- #endif
- g_sendhead.bsql=0;
- g_sendhead.code[0]=184;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if(g_bSendOK==0)
- {
- return;
- }
- }
- else
- {
- g_sendhead.bsql=0;
- g_sendhead.code[0]=184;
- g_sendhead.tabcount=1;
- #ifdef LKAY_VERSION
- CString filter="dindantype<>'意向客户' or dindantype is null";
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- #else
- g_pMainWnd->ProcessChatMessageRequest2(1);
- #endif
- if(g_bSendOK==0)return;
- }
- DataToArray(&m_List1array);
- }
- else
- {
- //////////////数据汇总
- m_List1array.RemoveAll ();
- CString branch;
- for(int 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='未取'";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=184;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
-
- if(g_bSendOK==0)
- {
- continue;
- }
- }
- else
- {
- g_sendhead.bsql=0;
- g_sendhead.code[0]=184;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if(g_bSendOK==0)
- {
- continue;
- }
- }
- CArray<CStringArray, CStringArray>List1array;
- DataToArray(&List1array);
- int size=m_List1array.GetSize ();
- for(int 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++;
- }
- }
- g_pMainWnd->OnDisconnect();
- g_bBranchModify=0;g_branchip=g_branchname="";
- }
- HidePrice();
- FillGrid();
- }
- void BeautifySkinFrom::OnBUTprint3()
- {
- // TODO: Add your control notification handler code here
- GetData();
- }
- #if USE_SHARE_FLORD
- /************************************************************************/
- /*
- 函数:LoadAllImageSource
- 描述:加载所有原片相片,若景点名不为空或全部,则导出的只是该订单下的某个景点的相片(若是儿童版的成长套系,则只导出某个成长套系下的相片);
- 参数:
- IN:lpOrderNum 所选订单号;
- IN:lpDomain 订单所在域名,空则为本店;
- IN:bGrowTh 订单是否为成长套系;
- IN:strSelectName 若是成长套系,则为所选的套系名称;
- OUT:strArray 返回所有符合要求的相片路径;
- 返回:
- 调用约定:
- 注意:
- */
- /************************************************************************/
- void BeautifySkinFrom::LoadAllImageSource(IN LPCTSTR lpOrderNum, IN LPCTSTR lpDomain, IN BOOL bGrowTh, IN CString &strSelectName, OUT CStringArray &strArray)
- {
- // 1.需要判断域名有效性;
- if (lpDomain && strcmp(lpDomain, "") != 0)
- {
- CONST TCHAR *szResult = strstr(lpDomain,".ly.com");
- if(szResult == NULL)
- {
- // 传入的域名有误;
- return;
- }
- }
- // 2.先遍历原始的共享目录;
- int i , n ;
- TCHAR szShare[MAX_PATH] = {0};
- CNetShareInfo::GetInstance()->GetLoaclShareDirectory(1,szShare);
- // 存放所有存在订单文件夹的共享目录数组;
- CStringArray strArrayOfShareDirectory;
- // 3.如果订单号存在原始共享目录中;
- TCHAR szOrdePath[MAX_PATH] = {0};
- if ( lpDomain == NULL || strcmp(lpDomain,"") == 0)
- {
- // 分店域名为空,则为本店;
- #if defined(VC80) || defined(VC70) || defined(VC60)
- sprintf(szOrdePath,"%s\\%s", szShare, lpOrderNum);
- #else
- _stprintf_s(szOrdePath, MAX_PATH, _T("%s\\%s"), szShare, lpOrderNum);
- #endif
- }
- else
- {// 分店域名不为空;
- if ( strcmp(lpDomain, g_domain) == 0)
- {
- // 本店域名;
- #if defined(VC80) || defined(VC70) || defined(VC60)
- sprintf(szOrdePath,"%s\\%s", szShare, lpOrderNum);
- #else
- _stprintf_s(szOrdePath, MAX_PATH, "%s\\%s", szShare, lpOrderNum);
- #endif
- }
- else
- {
- sprintf(szOrdePath,"%s\\%s\\%s", szShare, lpDomain, lpOrderNum);
- }
- }
- if ( PathFileExists(szOrdePath) )
- {
- strArrayOfShareDirectory.Add(CString(szOrdePath));
- }
-
- // 4.遍历其他共享目录;
- int nSize = g_aryOfSharePathInfo.GetSize();
- for ( /*int*/ i = 0; i < nSize; i++)
- {
- if ( 1 != atoi(g_aryOfSharePathInfo.ElementAt(i).ElementAt(5)))
- continue;
-
- // 逐一加载其他共享目录;
- sprintf(szShare,"%s",g_aryOfSharePathInfo.ElementAt(i).ElementAt(2));
- if (lpDomain && strcmp(lpDomain,"") != 0)
- {
- sprintf(szOrdePath,"%s\\%s\\%s",szShare,lpDomain, lpOrderNum);
- }
- else
- {
- sprintf(szOrdePath,"%s\\%s",szShare, lpOrderNum);
- }
- if ( PathFileExists(szOrdePath) )
- {
- strArrayOfShareDirectory.Add(CString(szOrdePath));
- }
- }
- // 若是成长套系,可按一个套系来导出;
- if ( bGrowTh )
- {
- if ( strSelectName == "全部")
- strSelectName.Empty();
-
- nSize = strArrayOfShareDirectory.GetSize();
- for ( /*int*/ i = 0; i < nSize; i++)
- {
- // 逐一加载其他共享目录;
- sprintf(szOrdePath,"%s\\%s",strArrayOfShareDirectory.ElementAt(i), strSelectName);
- StoreImage(szOrdePath,strArray);
- }
- }
- else // 非成长套系,则按指定的景点名导出指定的相片,而不是全部订单下的相片都导出;
- {
- // 查找原片中已导片的景点目录,注:会否浪费太多性能,最好从数据库里读取?;
- CArray<STImageDirectory*,STImageDirectory*> vtImageDirectory;
- nSize = strArrayOfShareDirectory.GetSize();
- for ( /*int*/ i = 0; i < nSize; i++)
- {
- // 逐一加载其他共享目录;
- sprintf(szOrdePath,"%s",strArrayOfShareDirectory.ElementAt(i));
- // 只需要目录,不需要相片文件名;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(szOrdePath), LPCSTR("*.*"));
- ffsco::typeT cdir;
- ffsco::typeT::iterator it;
- cdir = o.co_dir();
- CString strTemp;
- for ( it = cdir.begin(); it != cdir.end(); it++)
- {
- // strTemp 结果如: "\\it-pc\客户原片(管理软件)$\20150522-001\内景大西街店B棚\";
- strTemp = it->c_str();
- strTemp.TrimRight('\\');
- if ( strTemp.CompareNoCase(szOrdePath) == 0)
- {
- continue;
- }
- // 子文件夹名称,如:"内景大西街店B棚";
- strTemp = strTemp.Mid(strTemp.ReverseFind('\\') + 1);
- // 把"景点名"和"景点名完整路径" 存入数组中;
- BOOL bExists = FALSE;
- for ( /*int*/ n = 0; n < vtImageDirectory.GetSize(); n++)
- {
- STImageDirectory *pImageDirectory = vtImageDirectory.ElementAt(n);
- if ( strTemp == pImageDirectory->strSelName )
- {
- bExists = TRUE;
- strTemp = it->c_str();
- pImageDirectory->strAryImagePath.Add(strTemp);
- break;
- }
- }
- if ( !bExists )
- {
- STImageDirectory *pImageDirectory = new STImageDirectory;
- pImageDirectory->strSelName = strTemp;
- pImageDirectory->strAryImagePath.Add(CString(it->c_str()));
- vtImageDirectory.Add(pImageDirectory);
- }
- }
- }
- // 提供选择景点名;
- SelProvider dlg;
- dlg.m_mode = 1;
- dlg.m_aryImageDirectory = &vtImageDirectory;
- if( dlg.DoModal() != IDOK )
- return;
- if( dlg.m_provider != _T("全部") )
- {
- nSize = vtImageDirectory.GetSize();
- for ( i = 0; i < nSize; i++)
- {
- if ( dlg.m_provider == vtImageDirectory.ElementAt(i)->strSelName )
- {
- int nSum = vtImageDirectory.ElementAt(i)->strAryImagePath.GetSize();
- for ( n = 0; n < nSum; n++)
- {
- // 逐一加载其他共享目录;
- sprintf(szOrdePath,"%s",vtImageDirectory.ElementAt(i)->strAryImagePath.ElementAt(n));
- StoreImage(szOrdePath,strArray);
- }
- break;
- }
- }
- }
- else
- {
- // 加载订单文件夹;
- nSize = strArrayOfShareDirectory.GetSize();
- for ( /*int*/ n = 0; n < nSize; n++)
- {
- // 逐一加载其他共享目录;
- sprintf(szOrdePath,"%s",strArrayOfShareDirectory.ElementAt(n));
- StoreImage(szOrdePath,strArray);
- }
- }
- // 释放内存;
- for ( i = 0; i < vtImageDirectory.GetSize(); i++)
- {
- STImageDirectory *pImageDirectory = vtImageDirectory.ElementAt(i);
- delete pImageDirectory;
- vtImageDirectory.RemoveAt(i);
- }
- }
- }
- /************************************************************************/
- /*
- 函数:StoreImage
- 描述:存储指定目录的相片到CStringArray数组中;
- 参数:
- IN: lpImagePath 遍历的目录;
- OUT: strStoreArray 存储相片的数组;
- 返回:
- 调用约定:LoadAllImageSource主调;
- 注意:
- */
- /************************************************************************/
- void BeautifySkinFrom::StoreImage(IN LPCTSTR lpImagePath, OUT CStringArray &strStoreArray)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(lpImagePath), LPCSTR("*.*"));
- ffsco::typeT cfs;
- ffsco::typeT::iterator it;
- cfs = o.co_file();
-
- CString strTemp;
- for ( it = cfs.begin(); it != cfs.end(); it++)
- {
- strTemp = it->c_str();
- if ( strTemp.Find('.') == -1)
- continue;
- else
- {
- CString str = strTemp.Mid( strTemp.ReverseFind('\\') + 1 );
- if ( str.Find('.') == -1)
- continue;
- }
- if ( strTemp.GetAt( strTemp.ReverseFind('\\') + 1 ) == 's' )continue;
- if ( strTemp.GetAt( strTemp.ReverseFind('\\') + 1 ) == 'm' )continue;
- #if 0
- strTemp.MakeLower();
- if ( strTemp.Find(".jpg") == -1 && strTemp.Find(".jpeg") == -1)
- continue;
- #else
- // 只要是图片格式的,都保留下来;
- CONST CString strImgExt = _T("*.jpg|*.jpeg|*.cr2|*.nef|*.png|*.bmp|*.raw");
- CString strImg = strTemp.Mid(strTemp.ReverseFind(_T('.')));
- strImg.MakeLower();
- if ( strImgExt.Find(strImg) == -1)
- continue;
- #endif
- BOOL bExist = FALSE;
- for (int i = 0; i < strStoreArray.GetSize(); i++)
- {
- if (strStoreArray.ElementAt(i).CompareNoCase(strTemp) == 0)
- {
- bExist = TRUE;
- break;
- }
- }
- if( !bExist && strcmp(strTemp,lpImagePath) != 0 )
- strStoreArray.Add(strTemp);
- }
- }
- #endif
|