12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474 |
- // TakeFrom.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "TakeFrom.h"
- #include "MyMdi.H"
- #include "ModifyDinDan.h"
- #include "ImportPhoto.h"
- #include "ShowPic.h"
- #include "TakeMoney2.h"
- #include "SelWaiter2.h"
- #include "TakeStautsSel.h"
- #include "SalaryRateSet2.h"
- #include "UploadPhoto.h"
- #include "NetShareInfo.h"
- #include "SetOrderInfo.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- #pragma comment(lib, "Shlwapi.lib")
- IMPLEMENT_DYNCREATE(TakeFrom, MyFormView)
- TakeFrom::TakeFrom() : MyFormView(TakeFrom::IDD)
- {
- m_filter = _T("");
- m_nAdd = 0;
- if (g_bAllBranch)
- {
- m_nAdd = 1;
- }
- }
- TakeFrom::~TakeFrom()
- {
- }
- void TakeFrom::DoDataExchange(CDataExchange* pDX)
- {
- MyFormView::DoDataExchange(pDX);
- 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);
- }
- BEGIN_MESSAGE_MAP(TakeFrom, MyFormView)
- 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_BUTmoney, OnBUTmoney)
- ON_BN_CLICKED(IDC_BTNaddsp, OnBTNaddsp)
- ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST2, OnItemchangedList2)
- ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
- ON_NOTIFY(NM_CLICK, IDC_LIST2, OnClickList2)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST2, OnDblclkList2)
- ON_BN_CLICKED(IDC_BTNSEARCHFILTER, OnBtnsearchfilter)
- ON_BN_CLICKED(IDC_BUTprint3, OnBUTprint3)
- ON_BN_CLICKED(Btn_MicroShare, OnBnClickedMicroshare)
- ON_MESSAGE(MSG_KERNEL_CALLBACK, OnKernelCallBack)
- END_MESSAGE_MAP()
- #ifdef _DEBUG
- void TakeFrom::AssertValid() const
- {
- MyFormView::AssertValid();
- }
- void TakeFrom::Dump(CDumpContext& dc) const
- {
- MyFormView::Dump(dc);
- }
- #endif //_DEBUG
- LRESULT TakeFrom::OnKernelCallBack(WPARAM wp,LPARAM lp)
- {
- GetData();
- return 0;
- }
- void TakeFrom::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_BUTimportphoto, IDC_BUTshowphoto, IDC_BUTTON2, IDC_BUTclose };
- int idcount = 5;
- int btnwid;
- CRect prerc;
- for (int a = idcount - 2; a >= 0; a--)
- {
- GetDlgItem(idarray[a + 1])->GetWindowRect(prerc);
- ScreenToClient(prerc);
- GetDlgItem(idarray[a])->GetWindowRect(rc2);
- ScreenToClient(rc2);
- btnwid = rc2.Width();
- rc2.right = prerc.left;
- rc2.left = rc2.right - btnwid;
- GetDlgItem(idarray[a])->MoveWindow(rc2);
- }
- m_static1.SetFont(&g_titlefont);
- if (g_bAllBranch == 0)
- {
- #ifdef CHILD_VERSION
- #ifdef LKAY_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
- #else
- m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;相片张数,100;景点,100;拍照,100;拍照日期,100;摄影师,100;助理,100;化妆师,100;助理,100;接单人,100;套系名称,100;套系价格,100;男宾电话,100;女宾电话,100");
- #endif
- m_List1.LoadColumnInfo(114);
- }
- else
- {
- #ifdef CHILD_VERSION
- m_List1.SetHeadings("店名,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");
- #endif
- m_List1.LoadColumnInfo(196);
- GetDlgItem(IDC_BUTprint3)->ShowWindow(1);
- }
- #if JEFF_DELETE_OFF // 多景点时排序有问题!
- m_List1.m_bSortSupport = 0;
- #endif
- 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());
- }
- void TakeFrom::FillGrid(BOOL bStatus/*=0*/)
- {
- if (g_bSearchFilter) // 1.按钮:条件查询;
- {
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (g_filterdate1 != "") // Jeff.查询过滤条件:日期;
- {
- if (m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) < g_filterdate1 || m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) > g_filterdate2)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_waiter1 != "") // Jeff.查询过滤条件:门市;
- {
- if (m_List1array.ElementAt(ii).ElementAt(11 + m_nAdd) != g_waiter1)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_waiter2 != "") // Jeff.查询过滤条件:摄影师;
- {
- if (m_List1array.ElementAt(ii).ElementAt(7 + m_nAdd) != g_waiter2)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_waiter3 != "") // Jeff.查询过滤条件:化妆师;
- {
- if (m_List1array.ElementAt(ii).ElementAt(9 + m_nAdd) != g_waiter3)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_waiter4 != "") // Jeff.查询套系类别;
- {
- if (m_List1array.ElementAt(ii).ElementAt(3) != g_waiter4)
- {
- bFinded = 0;
- continue;
- }
- }
- if (g_bAllBranch && g_filterbranch != "") // Jeff.集团版查询过滤条件:分店名称;
- {
- if (m_List1array.ElementAt(ii).ElementAt(0) != g_filterbranch)
- {
- bFinded = 0;
- continue;
- }
- }
- // 2015.03.30
- // Jeff:上面已有判断,这里必须判断订单号非空才能添加,否则会添加其他空的选项;
- if (!m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- bFinded = 1;
- }
- }
- }
- 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 // 2.其他显示;
- {
- m_List1.DeleteAllItems2();
- int ii = 0;
- m_List1.m_arLabels.SetSize(m_List1array.GetSize(), 1);
- int count = 0;
- if (m_filter.IsEmpty()) // 2.1.没有查询关键字;
- {
- if (bStatus == 1) // bStatus==1,没用到;
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else if (bStatus == 2) // 今拍按钮用到;
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK" && m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else // bStatus==0;默认使用的值;
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- }
- }
- else // 2.2.指定查询条件 ;
- {
- if (bStatus == 1)
- {
- BOOL bFinded = 0;
- int type = GetType(m_filter);
- if (type == 1)//电话
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else if (type == 2)//拼音
- {
- BOOL bFinded = 0;
- m_filter.MakeUpper();
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && (m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) != "OK"&&\
- m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd).IsEmpty() == 0 && \
- (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(6).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(7).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(14).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15).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(13).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- }
- else if (bStatus == 2)
- {
- BOOL bFinded = 0;
- int type = GetType(m_filter);
- if (type == 1)//电话
- {
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date && (m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else if (type == 2)//拼音
- {
- BOOL bFinded = 0;
- m_filter.MakeUpper();
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date && (m_List1array.ElementAt(ii).ElementAt(17 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(16 + m_nAdd).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(5 + m_nAdd) == "OK"&&m_List1array.ElementAt(ii).ElementAt(6 + m_nAdd) == g_date &&\
- (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(6).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(7).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(14).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15).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(13).Find(m_filter) != -1))
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- }
- else
- {
- int type = GetType(m_filter);
- if (type == 1)//电话
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- if (m_List1array.ElementAt(ii).ElementAt(14 + m_nAdd).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15 + m_nAdd).Find(m_filter) != -1)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else if (type == 2)//拼音
- {
- BOOL bFinded = 0;
- m_filter.MakeUpper();
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- 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)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- else
- {
- BOOL bFinded = 0;
- for (ii = 0; ii < m_List1.m_arLabels.GetSize(); ii++)
- {
- if (bFinded && m_List1array.ElementAt(ii).ElementAt(0 + m_nAdd).IsEmpty())
- {
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- continue;
- }
- 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(6).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(7).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(14).Find(m_filter) != -1 || \
- m_List1array.ElementAt(ii).ElementAt(15).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(13).Find(m_filter) != -1)
- {
- bFinded = 1;
- m_List1.m_arLabels.ElementAt(count++).Copy(m_List1array.ElementAt(ii));
- }
- else
- {
- bFinded = 0;
- }
- }
- }
- }
- }
- 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 TakeFrom::OnBUTclose()
- {
- // TODO: Add your control notification handler code here
- GetParent()->SendMessage(WM_CLOSE);
- }
- void TakeFrom::OnSelchangeCombo1()
- {
- // TODO: Add your control notification handler code here
- SetTimer(1, 100, NULL);
- }
- void TakeFrom::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- KillTimer(nIDEvent);
- OnButton1();
- }
- BOOL TakeFrom::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;
- }
- // Jeff.remark.
- // 1.弹出"拍照状态确认"对话框前,需要获取订单的拍照状态,以此来确定是否需要禁用check状态框;
- //
- void TakeFrom::OnBUTimportphoto() // 导入原片按钮;
- {
- #ifdef USE_KERNEL_DLL
- INT nFirstItem = 0;
- INT nEndofItem = 0;
- STOrederInfo tagOrderInfo;
- INT nSelectedItem = GetSelectedOrderInfo(tagOrderInfo, nFirstItem, nEndofItem);
- // 有多少拍照OK的景点;
- INT nOKSize = 0;
- // 有多少景点未拍的;
- INT nUnOKSize = 0;
- vector<STSceneryInfo>::iterator it;
- for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
- {
- if ( it->strStatus == _T("OK") )
- nOKSize++;
-
- if ( it->strStatus == _T("未拍"))
- nUnOKSize++;
- }
- CSetOrderInfo dlg;
- for ( it = tagOrderInfo.vtOrderScenery.begin(); it != tagOrderInfo.vtOrderScenery.end(); it++ )
- {
- // 当前选中的景点列;
- if ( it->bSelected == TRUE )
- {
- dlg.waiter1 = it->strLensman;
- dlg.waiter12 = it->strLensmanAssistant;
- dlg.waiter2 = it->strBootDivision;
- dlg.waiter22 = it->strBootDivisionAssistant;
- // 让对话窗口弹出时,显示当前景点的拍照状态;
- if(it->strStatus == _T("OK"))
- dlg.m_nStatus = 0;
- else if( it->strStatus == _T("拍摄中") )
- dlg.m_nStatus = 1;
- else if( it->strStatus == _T("未拍") )
- dlg.m_nStatus = 2;
- break;
- }
- }
- if ( dlg.DoModal() == IDOK )
- {
- it->strLensman = dlg.waiter1;
- it->strLensmanAssistant = dlg.waiter12;
- it->strBootDivision = dlg.waiter2;
- it->strBootDivisionAssistant = dlg.waiter22;
- // m_nStatus:
- // 0:此景点拍照OK; 1:此景点拍照中; 2:此景点未拍照; 3:全部景点拍照OK;
- if ( dlg.m_nStatus == 0 )
- {// 所选景点设置OK,nOKSize加;
- if ( it->strStatus != _T("OK"))
- {
- nOKSize++;
- if ( it->strStatus == _T("未拍"))
- nUnOKSize--;
- }
- it->strStatus = _T("OK");
- }
- else if ( dlg.m_nStatus == 1 )
- {// 所选景点设置拍照中; 若原本景点OK,nOKSize减;
- if ( it->strStatus == _T("OK"))
- nOKSize--;
- if (it->strStatus == _T("未拍"))
- nUnOKSize--;
- it->strStatus = _T("拍摄中");
- }
- else if ( dlg.m_nStatus == 2 )
- {// 所选景点设置未拍照;若原本景点OK,nOKSize加;
- if ( it->strStatus == _T("OK"))
- {
- nOKSize--;
- nUnOKSize++;
- }
- if ( it->strStatus == _T("拍摄中"))
- nUnOKSize++;
- it->strStatus = _T("未拍");
- }
- else if ( dlg.m_nStatus == 3 )
- {// 全部景点设置OK;
- nOKSize = tagOrderInfo.vtOrderScenery.size();
- nUnOKSize = 0;
- it->strStatus = _T("OK");
- }
- //////////////////////////////////////////////////////////////////////////
- // SQL语句;
- CString strSQL = _T("");
- CString strSQL2 = _T("");
- if ( nOKSize == 0 )
- {// 全部景点未拍照 (若已全部景点OK,不改变订单的拍照状态和订单的拍照日期);
- if ( nUnOKSize == 0)
- strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '拍摄中' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
- else
- strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '未拍' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
- }
- else if ( nOKSize == tagOrderInfo.vtOrderScenery.size() )
- {// 全部景点都OK,设置所有dindanjd表的订单景点拍照状态OK,且设置订单的拍照日期(原本状态OK的,不改变拍照日期);
- strSQL.Format(_T("update dindan set [status] = 'OK', [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
- strSQL2.Format(_T("***update dindanjd set [status] = 'OK' where id = '%s'"),tagOrderInfo.strOrderNumber);
- strSQL += strSQL2;
- //////////////////////////////////////////////////////////////////////////
- // 全部景点拍照OK时,判断是否需要生成短信;
- if ( atoi(g_cominfoarray.ElementAt(0).ElementAt(101)) )
- {
- CString strTimeStamp = _T("msgtimestamp");
- CString strSMSContent = CString(g_cominfoarray.ElementAt(0).ElementAt(105));
- // 获取用户手机号码;
- CString strPhone1 = tagOrderInfo.strPhone;
- CString strPhone2 = tagOrderInfo.strTelPhone;
- if ( strPhone1.Find(_T("***")) != -1 )
- {//若用户权限不足以获取手机号码,重新获取;
- CString strBranchName = GetBranchNamebyId(tagOrderInfo.strBranchId);
- if ( g_bAllBranch )
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && strBranchName == m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if (tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- strPhone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- strPhone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- break;
- }
- }
- }
- }
- // 生成短信内容;
- CString strtemp = _T("");
- #ifdef CHILD_VERSION
- if ( !tagOrderInfo.strName1.IsEmpty() )
- strtemp = tagOrderInfo.strName1 + _T(",");
- strtemp += tagOrderInfo.strName2;
- strtemp.TrimRight(_T(","));
- if( !strtemp.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(strtemp,0) )
- {
- strtemp += strSMSContent;
- strtemp.Replace(_T("xxx小朋友"), _T(""));
- int nCount = GetLengthEx(strtemp)/MSG_LENGTH;
- if( GetLengthEx(strtemp)%MSG_LENGTH )
- nCount++;
- strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- strSQL += _T("***") + strSQL2;
- }
- #else
- if ( strSMSContent.Find(_T("xxx先生/女士")) != -1 )
- {
- int nCount = 0;
- // 男士短信;
- if ( !tagOrderInfo.strName1.IsEmpty() && CheckPhoneType(strPhone1) != -1 && CheckBadWords(tagOrderInfo.strName1, 0) )
- {
- strtemp = strSMSContent;
- strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName1 + _T("先生"));
- nCount = GetLengthEx(strtemp) / MSG_LENGTH;
- if ( GetLengthEx(strtemp) % MSG_LENGTH )
- nCount++;
- strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone1, strtemp, strTimeStamp, nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- strSQL += _T("***") + strSQL2;
- }
- // 女士短信;
- if ( !tagOrderInfo.strName2.IsEmpty() && CheckPhoneType(strPhone2) != -1 && CheckBadWords(tagOrderInfo.strName2, 0) )
- {
- strtemp = strSMSContent;
- strtemp.Replace(_T("xxx先生/女士"), tagOrderInfo.strName2 + _T("女士"));
- nCount = GetLengthEx(strtemp) / MSG_LENGTH;
- if ( GetLengthEx(strtemp) % MSG_LENGTH )
- nCount++;
- strSQL2.Format(INSERT_SENDREG_MC, _T("11"), strPhone2, strtemp, _T("msgtimexxstamp"), nCount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- strSQL += _T("***") + strSQL2;
- }
- }
- #endif
- }
- }
- else
- {// 部分景点拍照;拍照中(若订单的拍照状态已OK,不修改状态);
- strSQL.Format(_T("update dindan set [status] = case when status <> 'OK' then '拍摄中' else status end, [time2] = case when status <> 'OK' then '%s' else time2 end where id = '%s'"), g_date, tagOrderInfo.strOrderNumber);
- }
- // 最多4个景点,4组摄影师+化妆师;
- if ( nSelectedItem == nFirstItem )
- {
- strSQL2.Format(_T("***update dindan set waiter1 = '%s', waiter2 = '%s' where id = '%s'"),
- it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
- }
- else if ( nSelectedItem == nFirstItem + 1)
- {
- strSQL2.Format(_T("***update dindan set waiter12 = '%s', waiter22 = '%s' where id = '%s'"),
- it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
- }
- else if ( nSelectedItem == nFirstItem + 2)
- {
- strSQL2.Format(_T("***update dindan set waiter13 = '%s', waiter23 = '%s' where id = '%s'"),
- it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
- }
- else if ( nSelectedItem == nFirstItem + 3)
- {
- strSQL2.Format(_T("***update dindan set waiter14 = '%s', waiter24 = '%s' where id = '%s'"),
- it->strLensman,it->strBootDivision,tagOrderInfo.strOrderNumber);
- }
- strSQL += strSQL2;
- strSQL2.Format(_T("***update dindanjd set [date]= '%s', [status] = '%s', [waiter1] = '%s', [waiter12] = '%s', [waiter2] = '%s',[waiter22] ='%s' where id = '%s' and [name] = '%s' "),
- g_date, it->strStatus, it->strLensman, it->strLensmanAssistant, it->strBootDivision, it->strBootDivisionAssistant, tagOrderInfo.strOrderNumber, it->strScenery);
- strSQL += strSQL2;
- strSQL2.Format(_T("***gentakecontent:"),tagOrderInfo.strOrderNumber);//拍照OK时记录客人预定内容
- strSQL += strSQL2;
- //////////////////////////////////////////////////////////////////////////
- // 构建发送给服务器的包;
- g_sendhead.bsql = TRUE;
- if ( g_bAllBranch )
- {
- // 多店汇总;
- g_branchip = GetIP(tagOrderInfo.strBranchId);
- g_pMainWnd->OnDisconnect();
- g_branchname = tagOrderInfo.strBranchId;
- g_bBranchModify = TRUE;
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = FALSE;
- g_branchip = g_branchname = _T("");
- }
- else
- {
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- }
- //////////////////////////////////////////////////////////////////////////
- // 接收服务器返回的数据;
- if (g_bSendOK == 0)
- {
- OutputDebugString(_T("\n服务器返回数据失败!\n"));
- return;
- }
- if (g_bAllBranch == 0)
- {// 连接本店或分店时;
- GetData();
- }
- else
- {// 多店汇总时;
- BOOL bFind = 0;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (bFind && m_List1array.ElementAt(i).ElementAt(1) != _T(""))break;
- if (tagOrderInfo.strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1array.ElementAt(i).ElementAt(0))
- {
- bFind = 1;
- }
- if (bFind && it->strScenery == m_List1array.ElementAt(i).ElementAt(4))
- {
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, it->strLensman);
- m_List1array.ElementAt(i).SetAt(8 + m_nAdd, it->strLensmanAssistant);
- m_List1array.ElementAt(i).SetAt(9 + m_nAdd, it->strBootDivision);
- m_List1array.ElementAt(i).SetAt(10 + m_nAdd, it->strBootDivisionAssistant);
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, it->strStatus);
- m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
- //m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
- FillGrid();
- break;
- }
- }
- }
- }
- // 开始导入初修片;
- if ( MessageBox(_T("是否现在开始导入原片!"), _T("导片提示:导入原片"), MB_TOPMOST|MB_YESNO|MB_ICONWARNING ) != IDYES )
- {// 是否马上导入相片;
- return;
- }
- //////////////////////////////////////////////////////////////////////////
- INT nImgNum = atoi(tagOrderInfo.strImageNumber);
- if ( nImgNum <= 0)
- nImgNum = 1;
- else
- ++nImgNum;
- ImgImportInterface *pImport = NULL;
- if ( g_pIMGProcess == NULL )
- {
- AfxMessageBox(_T("lyfzIMGProcess模块加载失败!"));
- return;
- }
- g_pIMGProcess->QueryInterface(IID_ImgImportInterface, (void**)&pImport);
- if ( pImport )
- {
- pImport->ImportOriginalImg(
- TRUE, // 文件夹形式打开源或多选文件形式;
- !g_bOriginal, // 相片是否需要重命名;
- nImgNum, // 相片数字编号;
- tagOrderInfo.strBranchId, // 分店域名;
- tagOrderInfo.strOrderNumber, // 订单号;
- tagOrderInfo.strName1 + _T(",") + tagOrderInfo.strName2, // 顾客信息,可任意组合;
- TRUE, // 导入时,是否生成景点名文件夹;
- it->strScenery, // 导入时,景点名;
- _T("*.jpg|*.jpeg"), // 导入时,主扩展名相片;
- INVALID_COPY_PIX, // 导入时,主扩展名相片的压缩像素;
- _T("*.nef|*.cr2|*.raw"), // 导入时,附加的扩展名相片;
- TRUE, // 导入时,是否生成缩略图;
- SET_PIX(100,100), // 导入时,生成的缩略图像素大小;
- FALSE // 导入时,文件存在时是否覆盖;
- );
- g_pIMGProcess->Release();
- }
- //////////////////////////////////////////////////////////////////////////
- #else
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要导片的定单!", MB_ICONINFORMATION);
- return;
- }
- // 1.选中的起始行号;
- int iItem = m_List1.GetNextSelectedItem(pos);
- // 2.选中的行数;
- int itemcount = m_List1.GetItemCount();
- int iItemBak = iItem;
- CString status2 = "OK";
- CString branch;
- CString strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd); // .OrderNumber订单号;
- int beginno = atoi(m_List1.GetItemText(iItem, 3 + m_nAdd)) + 1; // .Jeff.起始编号,即下一次相片命名的号码数;由服务器减1,客户端加1;
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- // Jeff.多景点时,选择了不是第一个景点,订单是空的;
- while (strOrderNumber == "")
- {
- iItem--;
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- beginno = atoi(m_List1.GetItemText(iItem, 3 + m_nAdd)) + 1; // 由服务器减1,客户端加1;
- }
- int nTopItem = iItem;// Jeff add:记录第一个有订单号的项;
- //int nNotOkItem = -1; // Jeff add:第一个被记录未拍照ok的子景点项;如果是头景点呢?
- // .jdpos景点位置;并不能用来判断该订单是否多个景点,因为如果iItem是有订单号的话,无效;
- int jdpos = iItemBak - iItem;
- // .订单拍摄如果不是ok状态,设置为拍摄中;
- BOOL bOK = TRUE; //Jeff.add;
- #if 1 // Jeff.用于判断是否只剩下一个 未OK 状态时,拍照确认对话框的复选是否需要勾上;
- // 此时iItem为有订单号的头景点;
- if (m_List1.GetItemText(iItem, 5 + m_nAdd) != "OK")
- {
- status2 = "拍摄中";
- //bOK = FALSE;
- }
- // .子景点(如果有的话);
- ++iItem;
- while (iItem < itemcount && m_List1.GetItemText(iItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
- {
- if (m_List1.GetItemText(iItem, 5 + m_nAdd) != "OK" && iItemBak != iItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
- {
- status2 = "拍摄中";
- //bOK = FALSE;
- //nNotOkItem = iItem;
- break;
- }
- iItem++;
- }
- // printf("Jeff:对话框前的状态:%s\n\n",status2);
- #endif //#if 1
- iItem = iItemBak;
- CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
- CString waiter1 = m_List1.GetItemText(iItem, 7 + m_nAdd);
- CString waiter12 = m_List1.GetItemText(iItem, 8 + m_nAdd);
- CString waiter2 = m_List1.GetItemText(iItem, 9 + m_nAdd);
- CString waiter22 = m_List1.GetItemText(iItem, 10 + m_nAdd);
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- while (strOrderNumber == "")
- {
- iItem--;
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- CString name = m_List1.GetItemText(iItem, 1 + m_nAdd) + "," + m_List1.GetItemText(iItem, 2 + m_nAdd);
- name.TrimLeft(",");
- name.TrimRight(",");
- name = "客人:" + name;
- CString phone = m_List1.GetItemText(iItem, 14 + m_nAdd) + "," + m_List1.GetItemText(iItem, 15 + m_nAdd);
- phone.TrimLeft(",");
- phone.TrimRight(",");
- phone = "电话:" + phone;
- CString strDomain = _T("");
- CString savepath = _T("");
- if (g_bAllBranch)
- strDomain = GetDomainFromBranch(branch);
- else
- {
- if(g_branchname != _T(""))
- strDomain = GetDomainFromBranch(g_branchname);
- }
- //////////////////////////////////////////////////////////////////////////
- // 获取可用的共享目录;
- #if USE_SHARE_FLORD // 2015.04.13
- TCHAR szSharePath[MAX_PATH] = {0};
- if ( CNetShareInfo::GetInstance()->GetEnableShareDirectory(1, strOrderNumber, strDomain, szSharePath) )
- {
- savepath.Format("%s\\",szSharePath);
- }
- else
- {
- AfxMessageBox(_T("没有可用的共享目录!"));
- return;
- }
- #else
- savepath += strOrderNumber + "\\";
- #endif //#if USE_SHARE_FLORD
- //////////////////////////////////////////////////////////////////////////
-
- if ( !CheckFolderFileExist(savepath) )
- {
- if( !CreateDirectory(savepath, NULL) )
- {
- AfxMessageBox(_T("无法创建订单目录,确认权限充足"));
- return;
- }
- }
- CString calnopath = savepath;
- savepath += dindanjd + "\\";
- if (::CheckFolderFileExist(savepath) == 0)
- ::CreateDirectory(savepath, NULL);
- CString Filter = "图片文件 (*.jpg)|*.jpg|原始格式RAW (*.raw)|*.raw|原始格式NEF (*.nef)|*.nef|原始格式CR2 (*.cr2)|*.cr2||";
- // .选择要导入的相片,可多选;
- CFileDialog fdlg(true, NULL, "openfile", OFN_ALLOWMULTISELECT, Filter);
- TCHAR szBuffer[60000] = { 0 };
- fdlg.m_ofn.lpstrFile = szBuffer;
- fdlg.m_ofn.nMaxFile = 60000;
- if (fdlg.DoModal() != IDOK)
- {
- // .拍摄人员确认 SelWaiter2;
- SelWaiter2 waiterdlg;
- waiterdlg.waiter1 = waiter1;
- waiterdlg.waiter12 = waiter12;
- waiterdlg.waiter2 = waiter2;
- waiterdlg.waiter22 = waiter22;
- waiterdlg.beginno = beginno;// Jeff,实际上SelWaiter::beginno并没有任何作用,这里放置具有误导性!
- if (waiterdlg.DoModal() != IDOK)return;
- waiter1 = waiterdlg.waiter1;
- waiter12 = waiterdlg.waiter12;
- waiter2 = waiterdlg.waiter2;
- waiter22 = waiterdlg.waiter22;
- beginno = waiterdlg.beginno;
- CString status;
- // .拍照状态确认.对话框.
- TakeStautsSel dlg2;
- if (status2 == "OK") // .拍照状态为ok时;
- {
- dlg2.m_check1 = 1;
- // Jeff.add:已经是ok的拍照状态,禁用用户修改该状态;IDC_CHECK1
- //dlg2.DisEnableCheck();
- dlg2.m_bCheckEnalbe = FALSE;
- }
- dlg2.DoModal();
- if (dlg2.m_radio1 == 0)
- {
- status = "OK";
- }
- else if (dlg2.m_radio1 == 1)
- {
- status = "拍摄中";
- //dlg2.CheckChange();
- }
- else
- {
- status = "未拍";
- //dlg2.CheckChange();
- }
- #if 1
- //本次选择ok时,需要再检查一下,看是否全部都已经ok;
- // 此时iItem为有订单号的头景点;
- // printf("Jeff:景点拍照完成,nTopItem=%d\n\n",nTopItem);
- bOK = TRUE;
- status2 = "OK";
- int nItem = nTopItem;
- if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK")
- {
- if (nItem != iItemBak)
- {
- status2 = "拍摄中";
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- bOK = FALSE;
- }
- else if (status != "OK")
- {
- status2 = "拍摄中";
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- bOK = FALSE;
- }
- }
- // .子景点(如果有的话);
- ++nItem;
- while (nItem < itemcount && m_List1.GetItemText(nItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
- {
- if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK" && iItemBak != nItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
- {
- status2 = "拍摄中";
- bOK = FALSE;
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- break;
- }
- else
- {
- if (status != "OK")
- {
- status2 = "拍摄中";
- bOK = FALSE;
- }
- }
- ++nItem;
- }
- if (bOK) status2 = "OK";
- #endif
- #if 1
- //if ( !bOK )
- // status2 = "拍摄中";
- //else if(dlg2.m_check1) // .拍照景点全部ok状态;
- // status2 = "OK";
- CString sql;
- if (dlg2.m_check1)
- {
- status2 = "OK";
- // Jeff:如果有多个景点,全部设置为拍照ok;
- // 需要遍历处理;
- sql.Format("update dindanjd set [status]='OK' where id='%s'", strOrderNumber);
- // printf("Jeff:全部景点选择拍照OK,SQL=%s\n\n",sql);
- }
- #endif //#if 1
- //CString sql;
- //sql="update dindanjd set [status]='"+status+"',[waiter1]='"+waiter1+"',[waiter12]='"+waiter12+"',[waiter2]='"+waiter2+"',[waiter22]='"+waiter22+"' where [id]='"+id+"' and [name]='"+dindanjd+"'";
- sql += "***update dindanjd set [status]='" + status + "',[waiter1]='" + waiter1 + "',[waiter12]='" + waiter12 + "',[waiter2]='" + waiter2 + "',[waiter22]='" + waiter22 + "' where [id]='" + strOrderNumber + "' and [name]='" + dindanjd + "'";
- #ifndef LYFZ_VERSION
- if (jdpos == 0)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
- else if (jdpos == 1)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
- else if (jdpos == 2)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
- else if (jdpos == 3)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "' where [id]='" + strOrderNumber + "'";
- else
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end where [id]='" + strOrderNumber + "'";
- #else
- sql+="***update dindan set [status]=case when [status]<>'OK' then '"+status2+"' else [status] end where [id]='"+strOrderNumber+"'";
- #endif //#ifndef LYFZ_VERSION
- CString sql2;
- if (1)
- {
- sql2 = "***gentakecontent:" + strOrderNumber;
- sql += sql2;
- }
- g_sendhead.bsql = 1;
- if (g_bAllBranch)
- {
- g_branchip = GetIP(branch);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- else
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)return;
- if (g_bAllBranch == 0)
- {
- GetData();
- }
- else
- {
- BOOL bFind = 0;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (bFind && m_List1array.ElementAt(i).ElementAt(1) != "")break;
- if (strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- bFind = 1;
- }
- if (bFind && dindanjd == m_List1array.ElementAt(i).ElementAt(4))
- {
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, waiter1);
- m_List1array.ElementAt(i).SetAt(8 + m_nAdd, waiter12);
- m_List1array.ElementAt(i).SetAt(9 + m_nAdd, waiter2);
- m_List1array.ElementAt(i).SetAt(10 + m_nAdd, waiter22);
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, status);
- FillGrid();
- break;
- }
- }
- }
- return;
- }
- pos = fdlg.GetStartPosition();
- CStringArray array;
- while (pos != NULL)
- {
- array.Add(fdlg.GetNextPathName(pos));
- }
- if (array.GetSize() == 0)return;
- if (1)
- {
- CString str;
- str.Format("%s\r\n%s\r\n景点:%s\r\n确认您选中的照片与客户资料相符吗? 是否继续?", name, phone, dindanjd);
- if (AfxMessageBox(str, MB_YESNO | MB_ICONINFORMATION) != IDYES)
- return;
- }
- SelWaiter2 waiterdlg;
- waiterdlg.waiter1 = waiter1;
- waiterdlg.waiter12 = waiter12;
- waiterdlg.waiter2 = waiter2;
- waiterdlg.waiter22 = waiter22;
- waiterdlg.beginno = beginno;
- if (waiterdlg.DoModal() != IDOK)return;
- waiter1 = waiterdlg.waiter1;
- waiter12 = waiterdlg.waiter12;
- waiter2 = waiterdlg.waiter2;
- waiter22 = waiterdlg.waiter22;
- beginno = waiterdlg.beginno;
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------
- // 导入拍照好的相片;
- ImportPhoto dlg;
- #if USE_SHARE_FLORD
- dlg.m_id = strOrderNumber; // add by 2015-07-06 Jeff;
- #endif //#if USE_SHARE_FLORD
- dlg.beginno = beginno; // 当前订单相片编号;
- dlg.m_bOfmat = 1; // 是否导入或导出同名的原始格式相片;
- dlg.m_branch = branch; // 分店名称;
- dlg.m_nphototype = 0; // 相片类型,==0表示原片;
- dlg.m_calnopath = calnopath; // 未知;
- dlg.m_mode = 2; // 未知;
- dlg.m_bOrigin = 1; // 未知;
- dlg.m_pArray = &array; // 要导入的相片路径集合;
- dlg.m_savepath = savepath; // 保存相片的目录;
- #ifdef ENTERPRISE_VERSION
- // if(!g_branchname.IsEmpty())
- {
- dlg.m_id = strOrderNumber;
- dlg.m_bSaveUploadTask = g_bSaveUploadTask1;
- dlg.m_sel = g_cominfoarraylocal.ElementAt(0).ElementAt(78);
- dlg.m_uploadtaskarray.Add(strOrderNumber + ";" + name);
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("1"); // 索引5表示相片类型;
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- dlg.m_uploadtaskarray.Add("");
- }
- #endif //#ifdef ENTERPRISE_VERSION
- dlg.DoModal();
- // Jeff.每次重新导入相片时,都删除ok文件;
- beginno = dlg.beginno;
- savepath += "ok";
- ::DeleteFile(savepath); // 删除ok文件;
- CString status;
- TakeStautsSel dlg2;
- if (status2 == "OK")
- {
- dlg2.m_check1 = 1;
- dlg2.m_bCheckEnalbe = FALSE;
- }
- dlg2.DoModal();
- if (dlg2.m_radio1 == 0)
- {
- status = "OK";
- }
- else if (dlg2.m_radio1 == 1)
- {
- status = "拍摄中";
- //dlg2.CheckChange();
- }
- else
- {
- status = "未拍";
- //dlg2.CheckChange();
- }
- #if 1
- //本次选择ok时,需要再检查一下,看是否全部都已经ok;
- // 此时iItem为有订单号的头景点;
- // printf("Jeff:景点拍照完成,nTopItem=%d\n\n",nTopItem);
- bOK = TRUE;
- status2 = "OK";
- int nItem = nTopItem;
- if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK")
- {
- if (nItem != iItemBak)
- {
- status2 = "拍摄中";
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- bOK = FALSE;
- }
- else if (status != "OK")
- {
- status2 = "拍摄中";
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- bOK = FALSE;
- }
- }
- // .子景点(如果有的话);
- ++nItem;
- while (nItem < itemcount && m_List1.GetItemText(nItem, 0 + m_nAdd) == "" && status2 != "拍摄中")
- {
- if (m_List1.GetItemText(nItem, 5 + m_nAdd) != "OK" && iItemBak != nItem) // Jeff.如果只有两个景点这里出错:第一个ok,第二个未拍;这里会跳出;
- {
- status2 = "拍摄中";
- bOK = FALSE;
- // printf("Jeff:景点%d拍照完成\n\n",nItem);
- break;
- }
- else
- {
- if (status != "OK")
- {
- status2 = "拍摄中";
- bOK = FALSE;
- }
- }
- ++nItem;
- }
- if (bOK) status2 = "OK";
- #endif //#if 1
- #if 1
- //if ( !bOK )
- // status2 = "拍摄中";
- //else if(dlg2.m_check1) // .拍照景点全部ok状态;
- // status2 = "OK";
- CString sql;
- if (dlg2.m_check1)
- {
- status2 = "OK";
- // Jeff:如果有多个景点,全部设置为拍照ok;
- // 需要遍历处理?;
- // 批量处理某个订单的就可以了;
- // SQL:update dindanjd set [status]='OK' where id='';
- // CString SQL;
- sql.Format("update dindanjd set [status]='OK' where id='%s'", strOrderNumber);
- // printf("Jeff:全部景点选择拍照OK,SQL=%s\n\n",sql);
- }
- #endif //#if 1
- //CString sql;
- //sql="update dindanjd set [status]='"+status+"',[date]='"+g_date+"',[waiter1]='"+waiter1+"',[waiter12]='"+waiter12+"',[waiter2]='"+waiter2+"',[waiter22]='"+waiter22+"' where [id]='"+id+"' and [name]='"+dindanjd+"'";
- sql += "***update dindanjd set [status]='" + status + "',[date]='" + g_date + "',[waiter1]='" + waiter1 + "',[waiter12]='" + waiter12 + "',[waiter2]='" + waiter2 + "',[waiter22]='" + waiter22 + "' where [id]='" + strOrderNumber + "' and [name]='" + dindanjd + "'";
- CString sbeginno;
- sbeginno.Format("%d", beginno);
- #ifdef LYFZ_VERSION
- //sql+="***update dindan set [status]='"+status2+"' where [id]='"+id+"'";//旧文;
- sql+="***update dindan set [status]=case when [status]<>'OK' then '"+status2+"' else [status] end"+" where [id]='"+id+"'";
- #else
- /* dindan time2为拍照时间,在第一次ok时,这个时间不能再修改;
- // Jeff.SQL参考例子:
- // update dindan set time2='2014-06-28' where id='20140628-007' and isnull(time2,'')=''
- if(jdpos==0)
- sql+="***update dindan set [status]='"+status2+"',[waiter1]='"+waiter1+"',[waiter2]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- else if(jdpos==1)
- sql+="***update dindan set [status]='"+status2+"',[waiter12]='"+waiter1+"',[waiter22]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- else if(jdpos==2)
- sql+="***update dindan set [status]='"+status2+"',[waiter13]='"+waiter1+"',[waiter23]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- else if(jdpos==3)
- sql+="***update dindan set [status]='"+status2+"',[waiter14]='"+waiter1+"',[waiter24]='"+waiter2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- else
- sql+="***update dindan set [status]='"+status2+"',[time2]='"+g_date+"',[curno]='"+sbeginno+"' where [id]='"+id+"'";
- */
- //--------------------------------------------------------------------------
- // Jeff.SQL参考语句示例:
- // update dindan set time2=case when isnull(time2,'')='' then '2014-07-28' else time2 end , name2='OK',time3='2015-01-01',time1='2014-05-30' where id='20140628-007'
- //---------------------------------------------------------------------
- // printf("Jeff:拍照状态=%s\n\n",status2);
- if (status2 != "OK") // !=ok,不记录拍照时间;--这样是否合理?
- {
- // 当数据库原本status不为OK时,可以修改时间和状态;否则状态和时间都不能修改,保持原样;
- if (jdpos == 0)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 1)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 2)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 3)
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else
- sql += "***update dindan set [status]=case when [status]<>'OK' then '" + status2 + "' else [status] end,[curno]='" + sbeginno + "' where [id]='" + strOrderNumber + "'";
- // printf("Jeff:拍照中,SQL=%s\n\n",sql);
- }
- else // ==ok时,才记录拍照时间;
- {
- /*if(jdpos==0)
- sql+="***update dindan set [status]='"+status2+"',[waiter1]='"+waiter1+"',[waiter2]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
- else if(jdpos==1)
- sql+="***update dindan set [status]='"+status2+"',[waiter12]='"+waiter1+"',[waiter22]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" +" where [id]='"+id+"'";
- else if(jdpos==2)
- sql+="***update dindan set [status]='"+status2+"',[waiter13]='"+waiter1+"',[waiter23]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
- else if(jdpos==3)
- sql+="***update dindan set [status]='"+status2+"',[waiter14]='"+waiter1+"',[waiter24]='"+waiter2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";
- else
- sql+="***update dindan set [status]='"+status2+"',[curno]='"+sbeginno+ "', [time2]=case when isnull([time2],'')='' then '" +g_date+"' else [time2] end" + " where [id]='"+id+"'";*/
- // 当数据库原本status为OK时,不可修改时间;否则可以修改时间;
- if (jdpos == 0)
- sql += "***update dindan set [status]='" + status2 + "',[waiter1]='" + waiter1 + "',[waiter2]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 1)
- sql += "***update dindan set [status]='" + status2 + "',[waiter12]='" + waiter1 + "',[waiter22]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 2)
- sql += "***update dindan set [status]='" + status2 + "',[waiter13]='" + waiter1 + "',[waiter23]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else if (jdpos == 3)
- sql += "***update dindan set [status]='" + status2 + "',[waiter14]='" + waiter1 + "',[waiter24]='" + waiter2 + "',[curno]='" + sbeginno + "', [time2]=case when [status]<>'OK' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- else
- sql += "***update dindan set [status]='" + status2 + "',[curno]='" + sbeginno + "', [time2]=case when isnull([time2],'')='' then '" + g_date + "' else [time2] end" + " where [id]='" + strOrderNumber + "'";
- // printf("Jeff:拍照OK,SQL=%s\n\n",sql);
- }
- #endif
- /////////////////////////
- CString m_name1 = m_List1.GetItemText(iItem, 1 + m_nAdd);
- CString m_name2 = m_List1.GetItemText(iItem, 2 + m_nAdd);
- CString m_phone1 = m_List1.GetItemText(iItem, 14 + m_nAdd);
- CString m_phone2 = m_List1.GetItemText(iItem, 15 + m_nAdd);
- if (g_bAllBranch)
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if (strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && branch == m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- m_phone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- m_phone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- }
- }
- }
- else
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if (strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0))
- {
- m_phone1 = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- m_phone2 = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- }
- }
- }
- CString sql2;
- BOOL msgcheck = atoi(g_cominfoarray.ElementAt(0).ElementAt(101));
- CString msgcontent = g_cominfoarray.ElementAt(0).ElementAt(105);
- if (status != "OK")msgcheck = 0;
- #ifdef CHILD_VERSION
- if(msgcheck )
- {
- CString m_content3 = msgcontent;
- CString str,timestamp;
- timestamp="msgtimestamp";
- {
- CString name;
- if(!m_name1.IsEmpty ())
- name=m_name1+",";
- name+=m_name2;
- name.TrimRight (",");
- if(name.IsEmpty ()==0 && CheckPhoneType(m_phone1)!=-1 && CheckBadWords(name,0) )
- {
- str=name+m_content3;
- str.Replace ("xxx小朋友", "");
- int count=GetLengthEx(str)/MSG_LENGTH;
- if(GetLengthEx(str)%MSG_LENGTH)
- count++;
- CString scount;
- scount.Format ("%d", count);
- #if JEFF_TEST_ON
- sql2.Format(INSERT_SENDREG, _T("11"), m_phone1, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- sql += _T("***") + sql2;
- #else
- sql2="***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('"+m_phone1+"','"+str+"','"+timestamp+"','"+scount+"','0','0','0','系统自动发送')";
- sql+=sql2;
- #endif //#if JEFF_TEST_ON
- }
- }
- }
- #else
- if (msgcheck)
- {
- CString m_content3 = msgcontent;
- CString str, timestamp;
- timestamp = "msgtimestamp";
- int pos = m_content3.Find("xxx先生/女士");
- if (pos != -1)
- {
- if (m_name1.IsEmpty() == 0 && CheckPhoneType(m_phone1) != -1 && CheckBadWords(m_name1, 0) )
- {
- str = m_content3;
- str.Replace("xxx先生/女士", m_name1 + "先生");
- int count = GetLengthEx(str) / MSG_LENGTH;
- if (GetLengthEx(str) % MSG_LENGTH)
- count++;
- CString scount;
- scount.Format("%d", count);
- #if JEFF_TEST_ON
- sql2.Format(INSERT_SENDREG, _T("11"), m_phone1, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- sql += _T("***") + sql2;
- #else
- sql2 = "***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('" + m_phone1 + "','" + str + "','" + timestamp + "','" + scount + "','0','0','0','系统自动发送')";
- sql += sql2;
- #endif //#if JEFF_TEST_ON
- }
- if (m_name2.IsEmpty() == 0 && CheckPhoneType(m_phone2) != -1 && CheckBadWords(m_name2, 0) )
- {
- str = m_content3;
- str.Replace("xxx先生/女士", m_name2 + "女士");
- int count = GetLengthEx(str) / MSG_LENGTH;
- if (GetLengthEx(str) % MSG_LENGTH)
- count++;
- CString scount;
- scount.Format("%d", count);
- CTime tm = CTime::GetCurrentTime();
- tm += CTimeSpan(0, 0, 0, 3);
- timestamp = tm.Format("%Y%m%d%H%M%S");
- timestamp = "msgtimexxstamp";
- #if JEFF_TEST_ON
- sql2.Format(INSERT_SENDREG, _T("11"), m_phone2, str, timestamp, scount, _T("0"), _T("0"), _T("0"), _T("系统自动发送"));
- sql += _T("***") + sql2;
- #else
- sql2 = "***insert into sendreg([phones],[content],[timestamp],[msgcount],[status],[issended],[isautosend],[ren]) values('" + m_phone2 + "','" + str + "','" + timestamp + "','" + scount + "','0','0','0','系统自动发送')";
- sql += sql2;
- #endif //#if JEFF_TEST_ON
- }
- }
- }
- #endif //#ifdef CHILD_VERSION
- /////////////////////////
- if (1)//拍照OK时记录客人预定内容
- {
- sql2 = "***gentakecontent:" + strOrderNumber;
- sql += sql2;
- }
- g_sendhead.bsql = 1;
- if (g_bAllBranch)
- {
- g_branchip = GetIP(branch);
- g_pMainWnd->OnDisconnect();
- g_branchname = branch;
- g_bBranchModify = 1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = "";
- }
- else
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- if (g_bSendOK == 0)
- return;
- AfxMessageBox("导入客照成功!", MB_ICONINFORMATION);
- WriteLog(_T("拍照导入"), _T("拍照导入相片"));
- if (g_bAllBranch == 0)
- {
- GetData();
- }
- else
- {
- BOOL bFind = 0;
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (bFind && m_List1array.ElementAt(i).ElementAt(1) != "")break;
- if (strOrderNumber == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- bFind = 1;
- }
- if (bFind && dindanjd == m_List1array.ElementAt(i).ElementAt(4))
- {
- m_List1array.ElementAt(i).SetAt(7 + m_nAdd, waiter1);
- m_List1array.ElementAt(i).SetAt(8 + m_nAdd, waiter12);
- m_List1array.ElementAt(i).SetAt(9 + m_nAdd, waiter2);
- m_List1array.ElementAt(i).SetAt(10 + m_nAdd, waiter22);
- m_List1array.ElementAt(i).SetAt(5 + m_nAdd, status);
- m_List1array.ElementAt(i).SetAt(6 + m_nAdd, g_date);
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, sbeginno);
- FillGrid();
- break;
- }
- }
- }
- #endif
- }
- void TakeFrom::OnBUTshowphoto() // 查看原片
- {
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- CString dindanjd = m_List1.GetItemText(iItem, 4 + m_nAdd);
- CString branch;
- CString id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- branch = m_List1.GetItemText(iItem, 0);
- while (id == "")
- {
- iItem--;
- id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- 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 = 1;
- 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
- dlg.m_path += id;
- dlg.m_path += "\\";
- if (g_pMainWnd->IsCtrlDown() == 0 && g_pMainWnd->IsShiftDown() == 0 && dindanjd != "")
- {
- if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
- {
- if (dindanjd == "系统默认景点")
- {
- if (::PathFileExists(dlg.m_path + dindanjd))
- {
- dlg.m_path += dindanjd;
- dlg.m_path += "\\";
- }
- }
- else
- {
- dlg.m_path += dindanjd;
- dlg.m_path += "\\";
- }
- }
- }
- else if (g_pMainWnd->IsCtrlDown())
- {
- if (dindanjd == "系统默认景点")
- {
- if (::PathFileExists(dlg.m_path + dindanjd))
- {
- dlg.m_path += dindanjd;
- dlg.m_path += "\\";
- }
- }
- else
- {
- dlg.m_path += dindanjd;
- dlg.m_path += "\\";
- }
- }
- #endif
- dlg.DoModal();
- if (dlg.m_bdelall)
- {
- for (int i = 0; i < m_List1array.GetSize(); i++)
- {
- if (g_bAllBranch)
- {
- if (id == m_List1array.ElementAt(i).ElementAt(1) && branch == m_List1array.ElementAt(i).ElementAt(0))
- {
- #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
- #else
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
- #endif
- FillGrid();
- break;
- }
- }
- else
- {
- if (id == m_List1array.ElementAt(i).ElementAt(0))
- {
- #if JEFF_TEST_ON // 全部删除后,这里显示的值应该为0;
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "0");
- #else
- m_List1array.ElementAt(i).SetAt(3 + m_nAdd, "1");
- #endif
- FillGrid();
- break;
- }
- }
- }
- }
- }
- void TakeFrom::OnBUTmoney() // 今拍 按钮;
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft();
- m_filter.TrimRight();
- FillGrid(2);
- }
- void TakeFrom::OnBTNaddsp()
- {
- }
- void TakeFrom::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(4) || IsHasRights2new(49))
- {
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(1);
- }
- else
- GetDlgItem(IDC_BUTimportphoto)->EnableWindow(0);
- *pResult = 0;
- }
- void TakeFrom::OnButton1() // 查询按钮;
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- m_filter.TrimLeft();
- m_filter.TrimRight();
- FillGrid();
- }
- void TakeFrom::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);
- while (g_id == "")
- {
- iItem--;
- g_id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- *pResult = 0;
- }
- void TakeFrom::OnDblclkList2(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- OnBUTshowphoto();
- *pResult = 0;
- }
- void TakeFrom::HidePrice()
- {
- int i = 0;
- m_List1arrayBak.RemoveAll();
- m_List1arrayBak.SetSize(m_List1array.GetSize());
- for ( i = 0; i < m_List1array.GetSize(); i++)
- {
- m_List1arrayBak.ElementAt(i).Copy(m_List1array.ElementAt(i));
- }
- #ifdef LKAY_VERSION
- if(IsHasRights2new(31))return;
- for( i=0; i<m_List1array.GetSize (); i++)
- {
- m_List1array.ElementAt (i).SetAt (11+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (12+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (13+m_nAdd, "***");
- m_List1array.ElementAt (i).SetAt (14+m_nAdd, "***");
- }
- #else
- if (IsHasRights2new(31))return;
- for (i = 0; i < m_List1array.GetSize(); i++)
- {
- m_List1array.ElementAt(i).SetAt(14 + m_nAdd, "***");
- m_List1array.ElementAt(i).SetAt(15 + m_nAdd, "***");
- }
- #endif
- }
- void TakeFrom::OnBtnsearchfilter() // 条件查询按钮;
- {
- SearchFilter dlg;
- dlg.m_mode = 1;
- if (dlg.DoModal() == IDOK)
- FillGrid();
- g_bSearchFilter = 0;
- }
- void TakeFrom::OnBUTprint3()
- {
- GetData();
- }
- void TakeFrom::OnButton2() // 客人头像按钮;
- {
- 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);
- while (id == "")
- {
- iItem--;
- id = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- UploadPhoto dlg;
- if (g_bAllBranch)
- {
- CString branchpath = GetBranchPhotoPath(branch);
- dlg.m_path = g_path1 + branchpath + "\\";
- if (::CheckFolderFileExist(dlg.m_path) == 0)
- ::CreateDirectory(dlg.m_path, NULL);
- }
- else
- dlg.m_path = g_path1 + "\\";
- dlg.m_path += "客人头像\\";
- if (::CheckFolderFileExist(dlg.m_path) == 0)
- ::CreateDirectory(dlg.m_path, NULL);
- dlg.m_path += id + "\\";
- if (::CheckFolderFileExist(dlg.m_path) == 0)
- ::CreateDirectory(dlg.m_path, NULL);
- dlg.DoModal();
- }
- void TakeFrom::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] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- }
- else
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
- 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] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0) continue;
- }
- else
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 25; // Jeff.case 25对应的表为takeview视图:订单景点表;
- 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 TakeFrom::OnBnClickedMicroshare() // 微分享;
- {
- // 定义变量;
- CString strOrderNumber = _T(""); // 订单号;
- CString strScenery = _T(""); // 景点名;
- CString strCustomer = _T(""); // 顾客名;
- CString strMakeupArtist = _T(""); // 化妆师;
- CString strSourcePath = _T(""); // 相片根目录;
- CString strBranchName = _T(""); // 分店名;
- CString strBranchDomain = _T(""); // 分店域名;
- TCHAR szShareId[MAX_PATH] = _T(""); // 微分享相册ID;
- // 获取变量值;
- POSITION pos;
- pos = m_List1.GetFirstSelectedItemPosition();
- if (pos == NULL)
- {
- AfxMessageBox("请先选中您要查看的定单!", MB_ICONINFORMATION);
- return;
- }
- int iItem = m_List1.GetNextSelectedItem(pos);
- strScenery = m_List1.GetItemText(iItem, 4 + m_nAdd);
- strMakeupArtist = m_List1.GetItemText(iItem, 9 + m_nAdd);
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- if (g_bAllBranch)
- strBranchName = m_List1.GetItemText(iItem, 0);
- while (strOrderNumber == "")
- {
- iItem--;
- strOrderNumber = m_List1.GetItemText(iItem, 0 + m_nAdd);
- }
- #if 0
- if (g_bAllBranch)
- {
- strBranchDomain = GetBranchPhotoPath(strBranchName);
- strSourcePath = g_path1 + strBranchDomain + "\\";
- }
- else
- {
- strSourcePath = g_path1 + "\\";
- }
- strSourcePath += strOrderNumber;
- strSourcePath += "\\";
- if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
- {
- if (::PathFileExists(strSourcePath + strScenery))
- {
- strSourcePath += strScenery;
- strSourcePath += "\\";
- }
- }
- #else
- CString str;
- CStringArray AryOrderPath;
- int nSize = g_aryOfSharePathInfo.GetSize();
- for ( int i = 0; i < nSize; i++ )
- {
- if ( 1 == atoi(g_aryOfSharePathInfo.ElementAt(i).ElementAt(5)) )
- {
- str = g_aryOfSharePathInfo.ElementAt(i).ElementAt(2);
- if ( g_bAllBranch )
- {
- strBranchDomain = GetBranchPhotoPath(strBranchName);
- str += strBranchDomain;
- }
-
- str += _T("\\");
- str += strOrderNumber;
- str += _T("\\");
- if ( PathFileExists(str) )
- {
- AryOrderPath.Add(str);
- }
- }
- }
- str = g_path1;
- if ( g_bAllBranch )
- {
- strBranchDomain = GetBranchPhotoPath(strBranchName);
- str += strBranchDomain + "\\";
- }
- str += _T("\\");
- str += strOrderNumber;
- str += _T("\\");
- if ( PathFileExists(str) )
- {
- AryOrderPath.Add(str);
- }
- if (AfxMessageBox("是否查看全部景点?", MB_YESNO | MB_ICONINFORMATION) != IDYES)
- {
- int n = AryOrderPath.GetSize();
- for ( int j = 0; j < n; j++ )
- {
- if ( PathFileExists(AryOrderPath.ElementAt(j) + strScenery) )
- {
- strSourcePath = AryOrderPath.ElementAt(j) + strScenery;
- strSourcePath += _T("\\");
- strSourcePath += _T("#");
- }
- }
- }
- else
- {
- for ( int k = 0; k < AryOrderPath.GetSize(); k++ )
- {
- strSourcePath = AryOrderPath.ElementAt(k) ;
- strSourcePath += _T("#");
- }
- }
-
- #endif
- // 加载动态库;
- if (LoadMicroShareLibrary() == FALSE)
- return;
- if ( g_lyfzCreateShare )
- {
- g_lyfzCreateShare(
- g_cominfoarray.ElementAt(0).ElementAt(147), // 微分享的登录账号;
- g_cominfoarray.ElementAt(0).ElementAt(148), // 微分享的登录账号密码;
- strSourcePath, // 相片根级目录;
- strBranchDomain.Mid(1), // 分店域名;
- strOrderNumber, // 订单号,用于生成二维码文件名;
- strScenery, // 景点名;
- strSourcePath,
- m_List1.GetItemText(iItem, 1 + m_nAdd), // 客人姓名1 ;
- m_List1.GetItemText(iItem, 2 + m_nAdd), // 客人姓名2
- strMakeupArtist, // 化妆师;
- szShareId // 返回微相册ID;
- );
- }
- FreeMicroShareLibrary();
- }
- /************************************************************************/
- /*
- 函数:GetSelectedOrderInfo
- 描述:获取选中的列表项的订单信息;
- 参数:
- [OUT] tagOrderInfo
- [OUT] nFirstItem 第一个景点项索引;
- [OUT] nEndofItem 最后一个景点项索引;
- 返回:空
- 注意:
- 要求:
- 示例:
- 修改:
- 日期:
- 内容:
- */
- /************************************************************************/
- INT TakeFrom::GetSelectedOrderInfo( OUT STOrederInfo &tagOrderInfo, OUT INT& nFirstItem, OUT INT& nEndofItem )
- {
- POSITION pos = m_List1.GetFirstSelectedItemPosition();
- if ( pos == NULL )
- {
- AfxMessageBox(_T("未选中要导入相片的订单!"),MB_ICONINFORMATION);
- return -1;
- }
- INT nItemCount = m_List1.GetItemCount();
- INT nSelectedItem = m_List1.GetNextSelectedItem(pos);
- //INT nFirstItem = 0; // 记录第一个景点项索引;
- //INT nEndofItem = 0; // 记录最后一个景点项索引;
- INT nSceneryItem = nSelectedItem;
- if ( m_List1.GetItemText(nSelectedItem, 0 + m_nAdd) == _T("") )
- {
- STSceneryInfo tagSceneryInfo;
- tagSceneryInfo.bSelected = TRUE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- // 查找所有下行;
- nSceneryItem++;
- if ( nSceneryItem < nItemCount )
- {
- while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
- {
- tagSceneryInfo.bSelected = FALSE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- nSceneryItem++;
- if ( nSceneryItem >= nItemCount )
- break;
- }
- // 记录最后一个景点项索引;
- nEndofItem = nSceneryItem - 1;
- }
- // 查找所有上行;
- nSceneryItem = nSelectedItem - 1;
- if ( nSceneryItem >= 0)
- {
- while( m_List1.GetItemText(nSceneryItem, 0 + m_nAdd) == _T("") )
- {
- tagSceneryInfo.bSelected = FALSE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- nSceneryItem--;
- if ( nSceneryItem < 0 )
- break;
- }
- }
- // 上行结束后,是头位置;
- if ( nSceneryItem >= 0 )
- {
- // 记录第一个景点项索引;
- nFirstItem = nSceneryItem;
- // 用头景点行初始化订单信息;
- if ( g_bAllBranch ) // 是否多店汇总;
- {
- tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
- }
- else
- {
- if ( g_branchname == _T(""))
- tagOrderInfo.strBranchId = g_domain;
- else
- tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
- }
- tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSceneryItem, 0 + m_nAdd);
- tagOrderInfo.strName1 = m_List1.GetItemText(nSceneryItem, 1 + m_nAdd);
- tagOrderInfo.strName2 = m_List1.GetItemText(nSceneryItem, 2 + m_nAdd);
- tagOrderInfo.strImageNumber = m_List1.GetItemText(nSceneryItem, 3 + m_nAdd);
- tagOrderInfo.strClerk = m_List1.GetItemText(nSceneryItem, 11 + m_nAdd);
- // 如果用户权限不足,13和14显示的是"*"符号;
- #if 1
- tagOrderInfo.strPhone = m_List1.GetItemText(nSceneryItem, 14 + m_nAdd);
- tagOrderInfo.strTelPhone = m_List1.GetItemText(nSceneryItem, 15 + m_nAdd);
- #else
- if ( g_bAllBranch )
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(1) && tagOrderInfo.strBranchId == m_List1arrayBak.ElementAt(i).ElementAt(0) )
- {
- tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- break;
- }
- }
- }
- else
- {
- for (int i = 0; i < m_List1arrayBak.GetSize(); i++)
- {
- if ( tagOrderInfo.strOrderNumber == m_List1arrayBak.ElementAt(i).ElementAt(0) )
- {
- tagOrderInfo.strPhone = m_List1arrayBak.ElementAt(i).ElementAt(14 + m_nAdd);
- tagOrderInfo.strTelPhone = m_List1arrayBak.ElementAt(i).ElementAt(15 + m_nAdd);
- break;
- }
- }
- }
- #endif
- // 同时push头景点;
- tagSceneryInfo.bSelected = FALSE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- }
- }
- else
- {
- // 记录第一个景点项索引;
- nFirstItem = nSceneryItem;
- // 用头景点行初始化订单信息;
- if ( g_bAllBranch ) // 是否多店汇总;
- {
- tagOrderInfo.strBranchId = GetDomainFromBranch(m_List1.GetItemText(nSceneryItem, 0 ));
- }
- else
- {
- if ( g_branchname == _T(""))
- tagOrderInfo.strBranchId = g_domain;
- else
- tagOrderInfo.strBranchId = GetDomainFromBranch(g_branchname);
- }
- tagOrderInfo.strOrderNumber = m_List1.GetItemText(nSelectedItem, 0 + m_nAdd);
- tagOrderInfo.strName1 = m_List1.GetItemText(nSelectedItem, 1 + m_nAdd);
- tagOrderInfo.strName2 = m_List1.GetItemText(nSelectedItem, 2 + m_nAdd);
- tagOrderInfo.strImageNumber = m_List1.GetItemText(nSelectedItem, 3 + m_nAdd);
- tagOrderInfo.strClerk = m_List1.GetItemText(nSelectedItem, 11 + m_nAdd);
- tagOrderInfo.strPhone = m_List1.GetItemText(nSelectedItem, 14 + m_nAdd);
- tagOrderInfo.strTelPhone = m_List1.GetItemText(nSelectedItem, 15 + m_nAdd);
- // push头景点;
- STSceneryInfo tagSceneryInfo;
- tagSceneryInfo.bSelected = TRUE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSelectedItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSelectedItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSelectedItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSelectedItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSelectedItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSelectedItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSelectedItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- // 读取下一行,看是否属于本订单的景点;
- nSceneryItem++;
- if ( nSceneryItem < nItemCount )
- {
- while( m_List1.GetItemText( nSceneryItem, 0 + m_nAdd ) == _T("") )
- {
- tagSceneryInfo.bSelected = FALSE;
- tagSceneryInfo.strScenery = m_List1.GetItemText(nSceneryItem, 4 + m_nAdd);
- tagSceneryInfo.strStatus = m_List1.GetItemText(nSceneryItem, 5 + m_nAdd);
- tagSceneryInfo.strTime = m_List1.GetItemText(nSceneryItem, 6 + m_nAdd);
- tagSceneryInfo.strLensman = m_List1.GetItemText(nSceneryItem, 7 + m_nAdd);
- tagSceneryInfo.strLensmanAssistant = m_List1.GetItemText(nSceneryItem, 8 + m_nAdd);
- tagSceneryInfo.strBootDivision = m_List1.GetItemText(nSceneryItem, 9 + m_nAdd);
- tagSceneryInfo.strBootDivisionAssistant = m_List1.GetItemText(nSceneryItem, 10 + m_nAdd);
- tagOrderInfo.vtOrderScenery.push_back(tagSceneryInfo);
- nSceneryItem++;
- if ( nSceneryItem >= nItemCount )
- break;
- }
- // 记录最后一个景点项索引;
- nEndofItem = nSceneryItem - 1;
- }
- }
- return nSelectedItem;
- }
|