ChoosePhotoSkin2.cpp 125 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192
  1. // ChoosePhotoSkin2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ChoosePhotoSkin2.h"
  5. #include "YLGL.h"
  6. #include "./helper/ffsco.h"
  7. #include ".\MenuBarXP\MenuXP.h"
  8. #include "ChoosePhotoSkin3.h"
  9. #include "ShowPic22.h"
  10. #include "ClientRequirement.h"
  11. #include "MyLock.h"
  12. #include "Time5.h"
  13. #include "ComparePhoto.h"
  14. #include "ReplaceDesignNo.h"
  15. #include "Login2.h"
  16. #include "ImportPhoto.h"
  17. #include "TimeOutDlg.h"
  18. #include "ShowEffect.h"
  19. #include "SelBrunDevice.h"
  20. #include "ProductChooseFilter.h"
  21. #define THUMBNAIL_WIDTH 100
  22. #define THUMBNAIL_HEIGHT 90
  23. extern HCURSOR g_cursorhand;
  24. //mode
  25. //0 全部
  26. //1 选中
  27. //2 未选
  28. //3 删除
  29. //4 入册
  30. //5 入底
  31. /////////////////////////////////////////////////////////////////////////////
  32. //extern void WriteClientLog(CString str); // Jeff写客户端日志;
  33. // ChoosePhotoSkin2 dialog IDC_EDITzs
  34. ChoosePhotoSkin2::ChoosePhotoSkin2(CWnd* pParent /*=NULL*/)
  35. : CDialog(ChoosePhotoSkin2::IDD, pParent)
  36. {
  37. //{{AFX_DATA_INIT(ChoosePhotoSkin2)
  38. // NOTE: the ClassWizard will add member initialization here
  39. //}}AFX_DATA_INIT
  40. m_pBk=NULL;
  41. m_pParent=NULL;
  42. m_name1 = _T("");
  43. m_name2 = _T("");
  44. m_time4 = g_date;
  45. m_waiter3 = _T("");
  46. m_takezs = _T("");
  47. m_taoxizs = _T("");
  48. m_choosezs = _T("");
  49. m_strOrderNumber = _T("");
  50. m_money3 = _T("");
  51. m_bz3 = _T("");
  52. //}}AFX_DATA_INIT
  53. m_bTerminate=false;
  54. m_bRunning=false;
  55. m_hThread = NULL;
  56. m_bSave=0;
  57. m_bModify=0;
  58. m_mode=0;
  59. m_showpichwd=NULL;
  60. m_mode2=0;
  61. g_pMainWnd->GetSkin();
  62. m_bSort=0;
  63. m_bHide=atoi(g_cominfoarray.ElementAt(0).ElementAt(59));
  64. m_pArray=NULL;
  65. m_bShowTimeOut=1;
  66. m_bCanSave=1;
  67. m_bGrowthTX=0;
  68. m_nChoosePhotoType=0;
  69. m_bChooseBig=0;
  70. m_bFromLocal=0;
  71. }
  72. ChoosePhotoSkin2::ChoosePhotoSkin2(DWORD id, CWnd* pParent)
  73. : CDialog(id, pParent)
  74. {
  75. //{{AFX_DATA_INIT(ChoosePhotoSkin2)
  76. // NOTE: the ClassWizard will add member initialization here
  77. //}}AFX_DATA_INIT
  78. m_pBk=NULL;
  79. m_pParent=NULL;
  80. }
  81. void ChoosePhotoSkin2::DoDataExchange(CDataExchange* pDX)
  82. {
  83. CDialog::DoDataExchange(pDX);
  84. //{{AFX_DATA_MAP(ChoosePhotoSkin2)
  85. DDX_Control(pDX, IDC_COMBO1, m_combo1);
  86. DDX_Control(pDX, IDC_EDITzs3, m_editnum4);
  87. DDX_Control(pDX, IDC_EDITzs2, m_editnum3);
  88. DDX_Control(pDX, IDC_EDITzs, m_editnum2);
  89. DDX_Control(pDX, IDC_EDITmoney3, m_editnum1);
  90. DDX_Control(pDX, IDC_LIST3, m_List3);
  91. DDX_Control(pDX, IDC_LIST2, m_List2);
  92. DDX_Control(pDX, IDC_LIST1, m_List1);
  93. DDX_Text(pDX, IDC_EDITname1, m_name1);
  94. DDX_Text(pDX, IDC_EDITname2, m_name2);
  95. DDX_Text(pDX, IDC_EDITtime4, m_time4);
  96. DDX_Text(pDX, IDC_EDITwaiter3, m_waiter3);
  97. DDX_Text(pDX, IDC_EDITzs, m_takezs);
  98. DDX_Text(pDX, IDC_EDITzs2, m_taoxizs);
  99. DDX_Text(pDX, IDC_EDITzs3, m_choosezs);
  100. DDX_Text(pDX, IDC_EDITmoney3, m_money3);
  101. DDX_Text(pDX, IDC_EDITid, m_strOrderNumber);
  102. DDX_Text(pDX, IDC_EDITbz3, m_bz3);
  103. //}}AFX_DATA_MAP}
  104. }
  105. BEGIN_MESSAGE_MAP(ChoosePhotoSkin2, CDialog)
  106. //{{AFX_MSG_MAP(ChoosePhotoSkin2)
  107. ON_WM_PAINT()
  108. ON_WM_DESTROY()
  109. ON_WM_ERASEBKGND()
  110. ON_NOTIFY(NM_DBLCLK, IDC_LIST1, OnDblclkList1)
  111. ON_WM_CLOSE()
  112. ON_NOTIFY(NM_RCLICK, IDC_LIST1, OnRclickList1)
  113. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  114. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  115. ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
  116. ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
  117. ON_NOTIFY(NM_CLICK, IDC_LIST1, OnClickList1)
  118. ON_WM_TIMER()
  119. ON_BN_CLICKED(IDC_BUTTON7, OnSpBox)
  120. ON_BN_CLICKED(IDC_BUTTON8, OnButton8)
  121. ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
  122. ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
  123. //}}AFX_MSG_MAP
  124. ON_MESSAGE(WM_USER+1101,OnBtnClick)
  125. ON_COMMAND_RANGE(IDM_MENUsp1-1, IDM_MENUsp1+200, OnCommandMenu)
  126. ON_MESSAGE(WM_USER+200, UpdateTakeZS)
  127. END_MESSAGE_MAP()
  128. /////////////////////////////////////////////////////////////////////////////
  129. // ChoosePhotoSkin2 message handlers
  130. extern void SizeToContent(HWND hwnd, Image *img);
  131. #ifdef VC60
  132. void ChoosePhotoSkin2::OnBtnClick (WPARAM wParam, LPARAM lParam) // F5按键,显示删除相片
  133. {
  134. int id=lParam;
  135. id-=99;
  136. switch(id)
  137. {
  138. case 1:
  139. case 2:
  140. case 4:
  141. if(m_mode==id-1 && m_mode!=1)return;
  142. m_mode=id-1;
  143. LoadPhotos();
  144. break;
  145. case 3://查看未选
  146. if(m_mode==id-1)return;
  147. m_sChooseFilter="";
  148. UpdateChooseZS();
  149. GetNoSelPhoto();
  150. m_mode=id-1;
  151. LoadPhotos();
  152. break;
  153. case 13:
  154. GetAlbumPhoto();
  155. break;
  156. case 14:
  157. GetDiskPhoto();
  158. break;
  159. case 15:
  160. {
  161. ShowEffectDlg dlg;
  162. dlg.m_pPhotopatharray=this->GetCurArray ();
  163. dlg.DoModal();
  164. }
  165. break;
  166. case 5:
  167. OnButton4();
  168. break;
  169. case 9:
  170. {
  171. if(((MyBmpButton2*)m_picarray.ElementAt (8))->GetPushDown ())
  172. ((MyBmpButton2*)m_picarray.ElementAt (8))->SetPushDown (0);
  173. else
  174. ((MyBmpButton2*)m_picarray.ElementAt (8))->SetPushDown (1);
  175. ReLoadPhoto();
  176. /* if(AfxMessageBox("删除后将无法恢复, 确认删除吗?", MB_YESNO|MB_ICONSTOP)!=IDYES)return ;
  177. CString sql;
  178. sql="update dindansp set [no2]='' where [id]='"+m_strOrderNumber+"'";
  179. g_sendhead.bsql=1;
  180. g_pMainWnd->ProcessChatMessageRequest2(sql);
  181. if(g_bSendOK==0)return;
  182. CString path=m_path;
  183. path.TrimRight ('\\');
  184. DeleteDirectory(path);
  185. GetPhotos();
  186. LoadPhotos();*/
  187. }
  188. break;
  189. case 10:
  190. {
  191. POSITION pos;
  192. pos=m_List1.GetFirstSelectedItemPosition();
  193. if(pos==NULL)
  194. {
  195. AfxMessageBox("请先选中您要删除的照片!", MB_ICONINFORMATION);
  196. return;
  197. }
  198. if(AfxMessageBox("删除后将无法恢复, 确认删除吗?", MB_YESNO|MB_ICONSTOP)!=IDYES)return;
  199. while (pos)
  200. {
  201. int iItem=m_List1.GetNextSelectedItem(pos);
  202. CString title=m_List1.GetItemText (iItem, 0);
  203. int pos=title.Find ("\r\n");
  204. if(pos!=-1)title=title.Left (pos);
  205. if(m_mode2==1)//看设计
  206. {
  207. if(title.Find ("Flash")!=-1)
  208. {
  209. title.Replace ("Flash", "delgabook");
  210. CString str=m_path+title;
  211. DeleteDirectory(str);
  212. GetPhotos();
  213. LoadPhotos();
  214. return;
  215. }
  216. }
  217. ::DeleteFile (m_path+title+".jpg");
  218. ::DeleteFile (m_path+"s"+title+".jpg");
  219. ////////////////
  220. CStringArray *pArray=GetCurArray();
  221. CString path=pArray->ElementAt (iItem);
  222. path=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  223. path=path.Left (path.ReverseFind ('.'));
  224. if(CheckName(path))
  225. {
  226. path=","+path+",";
  227. for(int i=0; i<m_List2.GetItemCount (); i++)
  228. {
  229. CString no=m_noarray.ElementAt (i);
  230. if(no.Find (path)!=-1)
  231. {
  232. path.TrimRight(",");
  233. no.Delete (no.Find (path), path.GetLength ());
  234. no.TrimLeft (",");no.TrimRight(",");
  235. m_List2.SetItemText (i, 4, no);
  236. no=","+no+",";
  237. m_noarray.SetAt (i, no);
  238. }
  239. }
  240. }
  241. }
  242. GetPhotos();
  243. LoadPhotos();
  244. }
  245. break;
  246. case 6:
  247. // AfxMessageBox("退出");
  248. if(m_bModify && m_bCanSave)
  249. {
  250. if(AfxMessageBox("提醒, 选片修改未保存, 是否保存后再退出?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  251. {
  252. OnButton4();
  253. if(m_bSaveFail)
  254. {
  255. AfxMessageBox("连接服务器失败, 保存失败, 您可以在本机上重新进入选片恢复到选中状态!");
  256. CDialog::OnCancel ();return;
  257. }
  258. return;
  259. }
  260. else
  261. {
  262. CString savepath;
  263. savepath.Format ("%s\\%s.dat", g_mainpath, m_strOrderNumber);
  264. if(m_mode2)savepath.Format ("%s\\%s-2.dat", g_mainpath, m_strOrderNumber);
  265. ::DeleteFile (savepath);
  266. }
  267. }
  268. CDialog::OnCancel ();
  269. break;
  270. case 11:
  271. if(m_selphotownd.GetSafeHwnd ()==NULL)
  272. {
  273. m_selphotownd.m_id=m_strOrderNumber;
  274. m_selphotownd.m_rc=m_rcarray.ElementAt (6);
  275. m_selphotownd.Create (IDD_DLGShowSelPhoto, this);
  276. }
  277. m_selphotownd.ShowWindow (1);
  278. break;
  279. case 12:
  280. if(m_mode2)
  281. {
  282. ReplaceDesignNo dlg;
  283. dlg.m_id=this->m_strOrderNumber ;
  284. dlg.DoModal ();
  285. }
  286. /* if(m_selphotownd2.GetSafeHwnd ()==NULL)
  287. {
  288. m_selphotownd2.m_id=m_id;
  289. m_selphotownd2.m_rc=m_rcarray.ElementAt (6);
  290. m_selphotownd2.Create (IDD_DLGShowSelPhoto2, this);
  291. }
  292. m_selphotownd2.ShowWindow (1);*/
  293. break;
  294. }
  295. }
  296. #else
  297. LRESULT ChoosePhotoSkin2::OnBtnClick (WPARAM wParam, LPARAM lParam) // F5按键,显示删除相片
  298. {
  299. int id=lParam;
  300. id-=99;
  301. switch(id)
  302. {
  303. case 1:
  304. case 2:
  305. case 4:
  306. if(m_mode==id-1 && m_mode!=1)return 0;
  307. m_mode=id-1;
  308. LoadPhotos();
  309. break;
  310. case 3://查看未选
  311. if(m_mode==id-1)return 0;
  312. m_sChooseFilter="";
  313. UpdateChooseZS();
  314. GetNoSelPhoto();
  315. m_mode=id-1;
  316. LoadPhotos();
  317. break;
  318. case 13:
  319. GetAlbumPhoto();
  320. break;
  321. case 14:
  322. GetDiskPhoto();
  323. break;
  324. case 15:
  325. {
  326. ShowEffectDlg dlg;
  327. dlg.m_pPhotopatharray=this->GetCurArray ();
  328. dlg.DoModal();
  329. }
  330. break;
  331. case 5:
  332. OnButton4();
  333. break;
  334. case 9:
  335. {
  336. if(((MyBmpButton2*)m_picarray.ElementAt (8))->GetPushDown ())
  337. ((MyBmpButton2*)m_picarray.ElementAt (8))->SetPushDown (0);
  338. else
  339. ((MyBmpButton2*)m_picarray.ElementAt (8))->SetPushDown (1);
  340. ReLoadPhoto();
  341. /* if(AfxMessageBox("删除后将无法恢复, 确认删除吗?", MB_YESNO|MB_ICONSTOP)!=IDYES)return ;
  342. CString sql;
  343. sql="update dindansp set [no2]='' where [id]='"+m_strOrderNumber+"'";
  344. g_sendhead.bsql=1;
  345. g_pMainWnd->ProcessChatMessageRequest2(sql);
  346. if(g_bSendOK==0)return;
  347. CString path=m_path;
  348. path.TrimRight ('\\');
  349. DeleteDirectory(path);
  350. GetPhotos();
  351. LoadPhotos();*/
  352. }
  353. break;
  354. case 10:
  355. {
  356. POSITION pos;
  357. pos=m_List1.GetFirstSelectedItemPosition();
  358. if(pos==NULL)
  359. {
  360. AfxMessageBox("请先选中您要删除的照片!", MB_ICONINFORMATION);
  361. return 0;
  362. }
  363. if(AfxMessageBox("删除后将无法恢复, 确认删除吗?", MB_YESNO|MB_ICONSTOP)!=IDYES)return 0;
  364. while (pos)
  365. {
  366. int iItem=m_List1.GetNextSelectedItem(pos);
  367. CString title=m_List1.GetItemText (iItem, 0);
  368. int pos=title.Find ("\r\n");
  369. if(pos!=-1)title=title.Left (pos);
  370. if(m_mode2==1)//看设计
  371. {
  372. if(title.Find ("Flash")!=-1)
  373. {
  374. title.Replace ("Flash", "delgabook");
  375. CString str=m_path+title;
  376. DeleteDirectory(str);
  377. GetPhotos();
  378. LoadPhotos();
  379. return 0;
  380. }
  381. }
  382. ::DeleteFile (m_path+title+".jpg");
  383. ::DeleteFile (m_path+"s"+title+".jpg");
  384. ////////////////
  385. CStringArray *pArray=GetCurArray();
  386. CString path=pArray->ElementAt (iItem);
  387. path=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  388. path=path.Left (path.ReverseFind ('.'));
  389. if(CheckName(path))
  390. {
  391. path=","+path+",";
  392. for(int i=0; i<m_List2.GetItemCount (); i++)
  393. {
  394. CString no=m_noarray.ElementAt (i);
  395. if(no.Find (path)!=-1)
  396. {
  397. path.TrimRight(",");
  398. no.Delete (no.Find (path), path.GetLength ());
  399. no.TrimLeft (",");no.TrimRight(",");
  400. m_List2.SetItemText (i, 4, no);
  401. no=","+no+",";
  402. m_noarray.SetAt (i, no);
  403. }
  404. }
  405. }
  406. }
  407. GetPhotos();
  408. LoadPhotos();
  409. }
  410. break;
  411. case 6:
  412. // AfxMessageBox("退出");
  413. if(m_bModify && m_bCanSave)
  414. {
  415. if(AfxMessageBox("提醒, 选片修改未保存, 是否保存后再退出?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  416. {
  417. OnButton4();
  418. if(m_bSaveFail)
  419. {
  420. AfxMessageBox("连接服务器失败, 保存失败, 您可以在本机上重新进入选片恢复到选中状态!");
  421. CDialog::OnCancel ();return 0;
  422. }
  423. return 0;
  424. }
  425. else
  426. {
  427. CString savepath;
  428. savepath.Format ("%s\\%s.dat", g_mainpath, m_strOrderNumber);
  429. if(m_mode2)savepath.Format ("%s\\%s-2.dat", g_mainpath, m_strOrderNumber);
  430. ::DeleteFile (savepath);
  431. }
  432. }
  433. CDialog::OnCancel ();
  434. break;
  435. case 11:
  436. if(m_selphotownd.GetSafeHwnd ()==NULL)
  437. {
  438. m_selphotownd.m_id=m_strOrderNumber;
  439. m_selphotownd.m_rc=m_rcarray.ElementAt (6);
  440. m_selphotownd.Create (IDD_DLGShowSelPhoto, this);
  441. }
  442. m_selphotownd.ShowWindow (1);
  443. break;
  444. case 12:
  445. if(m_mode2)
  446. {
  447. ReplaceDesignNo dlg;
  448. dlg.m_id=this->m_strOrderNumber ;
  449. dlg.DoModal ();
  450. }
  451. /* if(m_selphotownd2.GetSafeHwnd ()==NULL)
  452. {
  453. m_selphotownd2.m_id=m_id;
  454. m_selphotownd2.m_rc=m_rcarray.ElementAt (6);
  455. m_selphotownd2.Create (IDD_DLGShowSelPhoto2, this);
  456. }
  457. m_selphotownd2.ShowWindow (1);*/
  458. break;
  459. }
  460. }
  461. #endif
  462. BOOL ChoosePhotoSkin2::OnInitDialog() //初始化选片*看设计
  463. {
  464. //AfxMessageBox("Jeff");
  465. CDialog::OnInitDialog();
  466. #if 1
  467. g_bInSkin=1;
  468. m_ticks=::GetTickCount ();
  469. // TODO: Add extra initialization here
  470. if(g_cursorhand==NULL)
  471. g_cursorhand=AfxGetApp()->LoadCursor(IDC_CURSORHAND);
  472. BYTE *pData=NULL;
  473. BYTE *pDataBegin;
  474. //printf("Jeff:loadLia路径:%s\n\n",g_mainpath+"\\skin\\"+m_liapath);//Jeff Printf;
  475. if(!LoadLia(g_mainpath+"\\skin\\"+m_liapath, &pData, &pDataBegin, &m_pBk, m_hWnd))
  476. {
  477. EndDialog(0);
  478. return false;
  479. }
  480. //printf("Jeff:g_resdata2.nPicCount=%d\n\n",g_resdata2.nPicCount); // Jeff Printf,这个nPicCount好像一直是15;
  481. for(int i=0; i<g_resdata2.nPicCount; i++)
  482. {
  483. g_resdata2.rect[i].left *=g_fscalex;
  484. g_resdata2.rect[i].right *=g_fscalex;
  485. g_resdata2.rect[i].top *=g_fscaley;
  486. g_resdata2.rect[i].bottom *=g_fscaley;
  487. if(i==8)
  488. g_resdata2.rect[i]=g_resdata2.rect[2];
  489. else if(i==9)
  490. g_resdata2.rect[i]=g_resdata2.rect[3];
  491. else if(i==10)
  492. g_resdata2.rect[i]=g_resdata2.rect[1];
  493. if(g_resdata2.nPicBmpCount[i])
  494. {
  495. MyBmpButton2 *pic=new MyBmpButton2;
  496. m_picarray.Add((DWORD)pic);
  497. CRect rc=g_resdata2.rect[i];
  498. CString str;
  499. str.Format (_T("%d"), i+1);
  500. pic->Create(str, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW , rc, this, i+100);
  501. pic->m_bmpcount =g_resdata2.nPicBmpCount [i];
  502. pic->ReadBmp (&pData, NULL, this);
  503. #ifdef SZWNS_VERSION
  504. if(i==3 && m_mode2==0)
  505. {
  506. Image *img=NULL;
  507. LoadImageFromRes(&img, MAKEINTRESOURCE(IDR_JPG6), _T("JPG") );
  508. delete pic->m_bmp;
  509. pic->m_bmp=img->Clone();
  510. delete img;
  511. img=NULL;
  512. LoadImageFromRes(&img, MAKEINTRESOURCE(IDR_JPG7), _T("JPG") );
  513. delete pic->m_bmpfocus;
  514. pic->m_bmpfocus=img->Clone();
  515. delete img;
  516. img=NULL;
  517. LoadImageFromRes(&img, MAKEINTRESOURCE(IDR_JPG8), _T("JPG") );
  518. delete pic->m_bmpfocused;
  519. pic->m_bmpfocused=img->Clone();
  520. delete img;
  521. }
  522. #endif
  523. }
  524. else
  525. m_picarray.Add (NULL);
  526. m_rcarray.Add(g_resdata2.rect[i]);
  527. }
  528. delete []pDataBegin;
  529. if(m_mode2)//看设计
  530. {
  531. m_bHide=0;
  532. // printf("Jeff:g_cominfoarray.ElementAt(0).ElementAt(86)=%s\n\n",g_cominfoarray.ElementAt(0).ElementAt(86)); // Jeff Printf;
  533. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86)))
  534. {
  535. ((MyBmpButton2*)m_picarray.ElementAt (3))->ShowWindow (SW_HIDE);
  536. CRect rc,rc2;
  537. ((MyBmpButton2*)m_picarray.ElementAt (3))->GetWindowRect(rc);
  538. ((MyBmpButton2*)m_picarray.ElementAt (1))->GetWindowRect(rc2);
  539. int dtx=rc.right -rc2.right ;
  540. ScreenToClient(rc2);
  541. rc2.left +=dtx;
  542. rc2.right +=dtx;
  543. ((MyBmpButton2*)m_picarray.ElementAt (1))->MoveWindow(rc2);
  544. ((MyBmpButton2*)m_picarray.ElementAt (0))->GetWindowRect(rc2);
  545. ScreenToClient(rc2);
  546. rc2.left +=dtx;
  547. rc2.right +=dtx;
  548. ((MyBmpButton2*)m_picarray.ElementAt (0))->MoveWindow(rc2);
  549. }
  550. CRect rc,rc2;
  551. ((MyBmpButton2*)m_picarray.ElementAt (5))->GetWindowRect(rc);
  552. ((MyBmpButton2*)m_picarray.ElementAt (4))->GetWindowRect(rc2);
  553. int dtx=rc.right -rc2.right ;
  554. rc2=rc;
  555. // if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86))==0)
  556. {
  557. float scale=0.9;
  558. dtx*=scale;
  559. int wid=rc2.Width ()*scale;
  560. int hei=rc2.Height ()*scale;
  561. int dty=rc2.Height ()-hei;
  562. dty/=2;
  563. rc2.left =rc2.right -wid;
  564. rc2.top +=dty;
  565. rc2.bottom =rc2.top +hei;
  566. }
  567. ScreenToClient(rc2);
  568. ((MyBmpButton2*)m_picarray.ElementAt (5))->MoveWindow(rc2);
  569. rc2.left -=dtx;
  570. rc2.right -=dtx;
  571. ((MyBmpButton2*)m_picarray.ElementAt (4))->MoveWindow(rc2);
  572. rc2.left -=dtx;
  573. rc2.right -=dtx;
  574. ((MyBmpButton2*)m_picarray.ElementAt (14))->MoveWindow(rc2);
  575. rc2.left -=dtx;
  576. rc2.right -=dtx;
  577. ((MyBmpButton2*)m_picarray.ElementAt (2))->MoveWindow(rc2);
  578. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86))==0)
  579. {
  580. rc2.left -=dtx;
  581. rc2.right -=dtx;
  582. ((MyBmpButton2*)m_picarray.ElementAt (3))->MoveWindow(rc2);
  583. }
  584. rc2.left -=dtx;
  585. rc2.right -=dtx;
  586. ((MyBmpButton2*)m_picarray.ElementAt (1))->MoveWindow(rc2);
  587. rc2.left -=dtx;
  588. rc2.right -=dtx;
  589. ((MyBmpButton2*)m_picarray.ElementAt (0))->MoveWindow(rc2);
  590. rc2.left -=dtx;
  591. rc2.right -=dtx;
  592. ((MyBmpButton2*)m_picarray.ElementAt (8))->MoveWindow(rc2);
  593. ((MyBmpButton2*)m_picarray.ElementAt (11))->ShowWindow (SW_HIDE);
  594. }
  595. else
  596. {
  597. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86)))
  598. {
  599. ((MyBmpButton2*)m_picarray.ElementAt (3))->ShowWindow (SW_HIDE);
  600. CRect rc,rc2;
  601. ((MyBmpButton2*)m_picarray.ElementAt (3))->GetWindowRect(rc);
  602. ((MyBmpButton2*)m_picarray.ElementAt (1))->GetWindowRect(rc2);
  603. int dtx=rc.right -rc2.right ;
  604. ScreenToClient(rc2);
  605. rc2.left +=dtx;
  606. rc2.right +=dtx;
  607. ((MyBmpButton2*)m_picarray.ElementAt (1))->MoveWindow(rc2);
  608. ((MyBmpButton2*)m_picarray.ElementAt (0))->GetWindowRect(rc2);
  609. ScreenToClient(rc2);
  610. rc2.left +=dtx;
  611. rc2.right +=dtx;
  612. ((MyBmpButton2*)m_picarray.ElementAt (0))->MoveWindow(rc2);
  613. }
  614. }
  615. if(1)//m_mode2==0)
  616. {
  617. ((MyBmpButton2*)m_picarray.ElementAt (7))->ShowWindow (SW_HIDE);
  618. ((MyBmpButton2*)m_picarray.ElementAt (8))->ShowWindow (SW_HIDE);
  619. ((MyBmpButton2*)m_picarray.ElementAt (9))->ShowWindow (SW_HIDE);
  620. ((MyBmpButton2*)m_picarray.ElementAt (10))->ShowWindow (SW_HIDE);
  621. ((MyBmpButton2*)m_picarray.ElementAt (11))->ShowWindow (SW_HIDE);
  622. }
  623. else
  624. {
  625. ((MyBmpButton2*)m_picarray.ElementAt (7))->EnableWindow (0);
  626. ((MyBmpButton2*)m_picarray.ElementAt (0))->ShowWindow (SW_HIDE);
  627. ((MyBmpButton2*)m_picarray.ElementAt (1))->ShowWindow (SW_HIDE);
  628. ((MyBmpButton2*)m_picarray.ElementAt (2))->ShowWindow (SW_HIDE);
  629. ((MyBmpButton2*)m_picarray.ElementAt (3))->ShowWindow (SW_HIDE);
  630. ((MyBmpButton2*)m_picarray.ElementAt (11))->ShowWindow (SW_HIDE);
  631. if(IsHasRights2new(37)==0)
  632. {
  633. ((MyBmpButton2*)m_picarray.ElementAt (8))->ShowWindow (SW_HIDE);
  634. ((MyBmpButton2*)m_picarray.ElementAt (9))->ShowWindow (SW_HIDE);
  635. }
  636. }
  637. if(m_mode2)
  638. {
  639. ((MyBmpButton2*)m_picarray.ElementAt (8))->ShowWindow (SW_SHOW);
  640. // ((MyBmpButton2*)m_picarray.ElementAt (8))->SetPushDown (1);
  641. ((MyBmpButton2*)m_picarray.ElementAt (12))->ShowWindow (SW_HIDE);
  642. ((MyBmpButton2*)m_picarray.ElementAt (13))->ShowWindow (SW_HIDE);
  643. }
  644. else//移按钮位置
  645. {
  646. CRect rc,rc2;
  647. ((MyBmpButton2*)m_picarray.ElementAt (5))->GetWindowRect(rc);
  648. ((MyBmpButton2*)m_picarray.ElementAt (4))->GetWindowRect(rc2);
  649. int dtx=rc.right -rc2.right ;
  650. rc2=rc;
  651. // if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86))==0)
  652. {
  653. float scale=0.9;
  654. dtx*=scale;
  655. int wid=rc2.Width ()*scale;
  656. int hei=rc2.Height ()*scale;
  657. int dty=rc2.Height ()-hei;
  658. dty/=2;
  659. rc2.left =rc2.right -wid;
  660. rc2.top +=dty;
  661. rc2.bottom =rc2.top +hei;
  662. }
  663. ScreenToClient(rc2);
  664. ((MyBmpButton2*)m_picarray.ElementAt (5))->MoveWindow(rc2);
  665. rc2.left -=dtx;
  666. rc2.right -=dtx;
  667. ((MyBmpButton2*)m_picarray.ElementAt (4))->MoveWindow(rc2);
  668. rc2.left -=dtx;
  669. rc2.right -=dtx;
  670. ((MyBmpButton2*)m_picarray.ElementAt (14))->MoveWindow(rc2);
  671. rc2.left -=dtx;
  672. rc2.right -=dtx;
  673. ((MyBmpButton2*)m_picarray.ElementAt (2))->MoveWindow(rc2);
  674. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86))==0)
  675. {
  676. rc2.left -=dtx;
  677. rc2.right -=dtx;
  678. ((MyBmpButton2*)m_picarray.ElementAt (3))->MoveWindow(rc2);
  679. }
  680. rc2.left -=dtx;
  681. rc2.right -=dtx;
  682. ((MyBmpButton2*)m_picarray.ElementAt (12))->MoveWindow(rc2);
  683. rc2.left -=dtx;
  684. rc2.right -=dtx;
  685. ((MyBmpButton2*)m_picarray.ElementAt (13))->MoveWindow(rc2);
  686. rc2.left -=dtx;
  687. rc2.right -=dtx;
  688. ((MyBmpButton2*)m_picarray.ElementAt (1))->MoveWindow(rc2);
  689. rc2.left -=dtx;
  690. rc2.right -=dtx;
  691. ((MyBmpButton2*)m_picarray.ElementAt (0))->MoveWindow(rc2);
  692. }
  693. #ifndef MNLS_VERSION
  694. ((MyBmpButton2*)m_picarray.ElementAt (7))->ShowWindow (SW_HIDE);
  695. ((MyBmpButton2*)m_picarray.ElementAt (7))->EnableWindow (0);
  696. Graphics graph(m_pBk);
  697. Image *img=NULL;
  698. if(m_mode2==0)
  699. ::LoadImageFromBuf (&img, g_mainpath+"\\图片\\标题-选片.jpg");
  700. else
  701. ::LoadImageFromBuf (&img, g_mainpath+"\\图片\\标题-看设计.jpg");
  702. if(img)
  703. {
  704. if(img->GetWidth()==2000)
  705. {
  706. graph.SetSmoothingMode(SmoothingModeHighQuality);
  707. graph.DrawImage(img, 0,0);
  708. }
  709. delete img;
  710. }
  711. #endif
  712. CRect listrc=m_rcarray.ElementAt (6);
  713. CRect rc;
  714. GetClientRect(rc);
  715. rc.top=listrc.top;
  716. m_List1.MoveWindow (rc);
  717. CString path,str;
  718. if(m_mode2)
  719. {
  720. m_path=g_path3+"\\";
  721. m_path+=m_strOrderNumber;
  722. m_path +="\\";
  723. // printf("Jeff:m_path=%s\n\n",m_path); // Jeff Printf;
  724. }
  725. if(m_mode2)//看设计
  726. {
  727. GetPhotos();
  728. }
  729. else // 开始选片
  730. {
  731. //AfxMessageBox("789");
  732. IsGrowthTx growthtxdlg;
  733. growthtxdlg.m_mode=1;
  734. growthtxdlg.m_strOrderNumber=m_strOrderNumber;
  735. growthtxdlg.DoModal ();
  736. m_bGrowthTX=growthtxdlg.m_bGrowthTx;
  737. m_seltxname=growthtxdlg.m_seltxname;
  738. /*if(!growthtxdlg.m_seltxname.IsEmpty ())
  739. {
  740. if(growthtxdlg.m_seltxname!="全部")
  741. {
  742. path+=growthtxdlg.m_seltxname;
  743. path+="\\";
  744. }
  745. }*/
  746. // HC:缓存,checkHC检查在本机是否存在缓存的相片;
  747. if( CheckHC() ) // (一般返回0)这一步是查看C:\WINDOWS\System32\有没有lyfz的文件夹,以及该文件夹下是否有订单号文件夹和相片;
  748. {
  749. //AfxMessageBox("789");
  750. m_bFromLocal=1;
  751. char path[MAX_PATH];
  752. ::GetSystemDirectory (path, MAX_PATH);
  753. CString sysdir=path;
  754. sysdir+="\\lyfz";
  755. ::CreateDirectory (sysdir, NULL);
  756. sysdir+="\\";
  757. sysdir+=m_strOrderNumber;
  758. using namespace helper_coffs;
  759. ffsco o;
  760. o.dirs(1);
  761. o.find(LPCSTR(sysdir), LPCSTR("*.jpg"));
  762. ffsco::typeT coo;
  763. ffsco::typeT::iterator it;
  764. coo = o.co_file();
  765. for (it = coo.begin();coo.end() != it;it ++)
  766. {
  767. str=(*it).c_str();
  768. // printf("Jeff:str=%s\n\n",str);// Jeff Printf
  769. if(str.GetAt (str.ReverseFind ('\\')+1)!='s' && str.GetAt (str.ReverseFind ('\\')+1)!='m')
  770. {
  771. m_patharray1.Add (str);
  772. }
  773. }
  774. }
  775. //printf("Jeff:m_patharray1.GetSize()=%d\n\n",m_patharray1.GetSize());// Jeff Printf;
  776. if(m_patharray1.GetSize() == 0) // m_patharray1:查看全部相片.
  777. {
  778. if(IsPhoto2Exist())//如果订单文件夹存在;
  779. {
  780. SelBrunDevice dlg;
  781. dlg.m_mode=1;
  782. if(dlg.DoModal()==IDOK) // m_nChoosePhotoType=0:原片+修片; =1:修片; =2:原片
  783. m_nChoosePhotoType=dlg.m_sel;
  784. else
  785. m_nChoosePhotoType=0;
  786. }
  787. else AfxMessageBox("温馨提示:\r\n未找到初修片,将使用原片选片", MB_ICONINFORMATION);
  788. CString path2;
  789. m_path=g_path1+"\\";
  790. m_path+=m_strOrderNumber;
  791. m_path +="\\";
  792. if(m_seltxname != "" && m_seltxname != "全部")
  793. {
  794. m_path+=m_seltxname;
  795. m_path +="\\";
  796. //printf("Jeff:m_path1=%s\n\n",m_path);// Jeff Printf;
  797. }
  798. if(m_nChoosePhotoType==1) // 选片:选择修片文件夹;
  799. {
  800. m_path=g_path2+"\\";
  801. m_path+=m_strOrderNumber;
  802. m_path +="\\";
  803. //printf("Jeff:m_path2=%s\n\n",m_path);// Jeff Printf;
  804. }
  805. // 查找m_path下所有文件o.find(...);
  806. CString filename;
  807. using namespace helper_coffs;
  808. ffsco o;
  809. o.dirs(1);
  810. o.find(LPCSTR(m_path), LPCSTR("*.*"));
  811. //printf("Jeff:文件夹=%d, m_path=%s\n\n",m_nChoosePhotoType,m_path);//Jeff Printf;
  812. ffsco::typeT coo;
  813. ffsco::typeT::iterator it;
  814. coo = o.co_file();
  815. for (it = coo.begin(); coo.end() != it; it ++) // 遍历文件夹;
  816. {
  817. path=(*it).c_str();
  818. //printf("Jeff:path=%s\n\n",path);//Jeff Printf;
  819. if(path.GetAt(path.ReverseFind ('\\')+1) != 's' && path.GetAt(path.ReverseFind ('\\')+1) != 'm')
  820. {
  821. path.MakeLower ();
  822. filename=path.Right(path.GetLength()-path.ReverseFind ('\\')-1);
  823. if(filename.Find(".")!=-1)
  824. filename=filename.Left(filename.Find("."));
  825. if(!myisdigit(filename))continue;
  826. if(m_nChoosePhotoType==1) // m_patharray1只添加修片文件夹;
  827. {
  828. m_patharray1.Add(path);
  829. //printf("Jeff:修片:m_patharray1.Add(%s)=%s\n\n",path);//Jeff Printf;
  830. }
  831. else // m_nChoosePhotoType=0,2
  832. {
  833. path2 = path;
  834. if(m_nChoosePhotoType==0) // 原片+修片;
  835. {
  836. path2.Replace("客户原片", "修好的片");
  837. //printf("Jeff:原片+修片 path2=%s\n\n",path2); // Jeff Printf;
  838. }
  839. if(m_bGrowthTX==0)
  840. {
  841. int pos = path2.Find(m_strOrderNumber);
  842. pos += m_strOrderNumber.GetLength();
  843. int pos2 = path2.ReverseFind('\\');
  844. path2 = path2.Left(pos)+path2.Right(path2.GetLength()-pos2);
  845. }
  846. if(m_nChoosePhotoType==0 && ::PathFileExists(path2)) // 原片+修片;
  847. {
  848. m_patharray1.Add(path2);
  849. //printf("Jeff:原片+修片:m_patharray1.Add(%s)=%s\n\n",path2);//Jeff Printf;
  850. }
  851. else //if( m_nChoosePhotoType == 2 ) // 只有原片;
  852. {
  853. path2.Replace(".raw", ".jpg");
  854. if(::PathFileExists (path2))
  855. {
  856. m_patharray1.Add(path2);continue;
  857. }
  858. path2.Replace (".nef", ".jpg");
  859. if(::PathFileExists(path2))
  860. {
  861. m_patharray1.Add(path2);continue;
  862. }
  863. path2.Replace (".cr2", ".jpg");
  864. if(::PathFileExists(path2))
  865. {
  866. m_patharray1.Add(path2);continue;
  867. }
  868. else
  869. {
  870. if(path.Right(3)!="jpg")continue;
  871. m_patharray1.Add (path);
  872. }
  873. }
  874. }
  875. }
  876. }
  877. if( m_nChoosePhotoType != 2) // Jeff:如果不是只查看原片;
  878. {//多种修好的效果
  879. CString path2;
  880. path2=g_path2+"\\";
  881. path2+=m_strOrderNumber;
  882. path2 +="\\"; //printf("Jeff:****paht2=%s\n\n",path2);//Jeff Printf;path2="修好的片"
  883. using namespace helper_coffs;
  884. ffsco o;
  885. o.dirs(0);
  886. o.find(LPCSTR(path2), LPCSTR("*.jpg"));
  887. ffsco::typeT coo;
  888. ffsco::typeT::iterator it;
  889. coo = o.co_file();
  890. for (it = coo.begin(); coo.end() != it;it ++)
  891. {
  892. path=(*it).c_str();
  893. if(path.GetAt (path.ReverseFind ('\\')+1)!='s' && path.GetAt (path.ReverseFind ('\\')+1)!='m')
  894. {
  895. path.MakeLower ();
  896. path2=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  897. if(path2.Find ("-")!=-1)
  898. {
  899. m_patharray1.Add (path);
  900. }
  901. }
  902. }
  903. }
  904. /////////////////
  905. if(0)//atoi(g_cominfoarray.ElementAt(0).ElementAt(109))==0)
  906. {
  907. char path[MAX_PATH];
  908. ::GetSystemDirectory (path, MAX_PATH);
  909. CString sysdir=path;
  910. sysdir+="\\lyfz";
  911. ::CreateDirectory (sysdir, NULL);
  912. sysdir+="\\";
  913. sysdir+=m_strOrderNumber;
  914. ::CreateDirectory (sysdir, NULL);
  915. sysdir+="\\";
  916. ImportPhoto dlg;
  917. dlg.m_bCopyToLocal=1;
  918. dlg.m_mode =1;
  919. dlg.m_pArray=&m_patharray1;
  920. dlg.m_savepath =sysdir;
  921. dlg.DoModal ();
  922. CStringArray temparray;
  923. CString filename;
  924. for(int i=0; i<m_patharray1.GetSize(); i++)
  925. {
  926. filename=m_patharray1.ElementAt(i);
  927. filename=filename.Right (filename.GetLength ()-filename.ReverseFind ('\\')-1);
  928. temparray.Add(sysdir+filename);
  929. }
  930. m_patharray1.RemoveAll();
  931. m_patharray1.Copy(temparray);
  932. }
  933. }
  934. if(m_patharray1.GetSize () && atoi(g_cominfoarray.ElementAt(0).ElementAt(61)))
  935. {
  936. int size=m_patharray1.GetSize ()-1;
  937. CString sTemp;
  938. int nPos;
  939. for(int i=0;i<size;i++)
  940. {
  941. nPos=rand()%(size-i);
  942. sTemp=m_patharray1.ElementAt (size-i);
  943. m_patharray1.SetAt (size-i, m_patharray1.ElementAt (nPos));
  944. m_patharray1.SetAt (nPos, sTemp);
  945. }
  946. }
  947. }
  948. m_ImageListThumb.Create(THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, ILC_COLOR24, 0, 1);
  949. m_List1.SetImageList(&m_ImageListThumb, LVSIL_NORMAL);
  950. m_List2.InitStyle();
  951. m_List2.InsertColumn(0,_T("编号"),LVCFMT_LEFT,45);
  952. m_List2.InsertColumn(1,_T("商品名称"),LVCFMT_LEFT,150);
  953. m_List2.InsertColumn(2,_T("数量"),LVCFMT_LEFT,45);
  954. m_List3.InitStyle();
  955. m_List3.InsertColumn(0,_T("autoid"),LVCFMT_LEFT,0);
  956. m_List3.InsertColumn(1,_T("编号"),LVCFMT_LEFT,45);
  957. m_List3.InsertColumn(2,_T("商品名称"),LVCFMT_LEFT,150);
  958. m_List3.InsertColumn(3,_T("价格"),LVCFMT_LEFT,45);
  959. m_List3.InsertColumn(4,_T("数量"),LVCFMT_LEFT,45);
  960. #ifdef LKAY_VERSION
  961. m_List3.InsertColumn(5,_T("P数"),LVCFMT_LEFT,55);
  962. m_List3.InsertColumn(6,_T("张数"),LVCFMT_LEFT,55);
  963. m_List3.InsertColumn(7,_T("照片编号"),LVCFMT_LEFT,365);
  964. #else
  965. m_List3.InsertColumn(5,_T("照片编号"),LVCFMT_LEFT,365);
  966. #endif
  967. #else
  968. if( FALSE==InitializeUI() ) return FALSE;
  969. #endif
  970. if(m_mode2==0)
  971. {
  972. GetData();
  973. if(m_checkstatus=="OK")
  974. {
  975. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(85)) && IsHasRights2new(20)==0 )
  976. {
  977. Login2 dlg;
  978. if(dlg.DoModal ()!=IDOK)
  979. {
  980. MyBmpButton2 *btn=((MyBmpButton2*)m_picarray.ElementAt (4));
  981. btn->m_bmpdisable=btn->m_bmp->Clone();
  982. Graphics graph(btn->m_bmpdisable);
  983. CPoint pt1,pt2,pt3;
  984. pt1.x=0;
  985. pt1.y=0;
  986. pt2.x=btn->m_bmp->GetWidth();
  987. pt2.y=0;
  988. pt3.x=0;
  989. pt3.y=btn->m_bmp->GetHeight();
  990. Point destinationPoints[] = {
  991. Point(pt1.x, pt1.y), // destination for upper-left point of original
  992. Point(pt2.x, pt2.y), // destination for upper-right point of original
  993. Point(pt3.x, pt3.y)}; // destination for lower-left point of original
  994. ColorMatrix colorMatrix = \
  995. {0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  996. 0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  997. 0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  998. 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
  999. 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
  1000. ImageAttributes imageAtt;
  1001. imageAtt.SetColorMatrix(&colorMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
  1002. graph.DrawImage(btn->m_bmp,
  1003. destinationPoints,
  1004. 3,
  1005. 0,
  1006. 0,
  1007. btn->m_bmp->GetWidth(),
  1008. btn->m_bmp->GetHeight(),
  1009. UnitPixel,
  1010. &imageAtt);
  1011. btn->EnableWindow (0);
  1012. m_bCanSave=0;
  1013. // CDialog::OnCancel ();
  1014. // return 1;
  1015. }
  1016. else if(IsHasRightsnew2(20, dlg.m_rights)==0)
  1017. {
  1018. MyBmpButton2 *btn=((MyBmpButton2*)m_picarray.ElementAt (4));
  1019. btn->m_bmpdisable=btn->m_bmp->Clone();
  1020. Graphics graph(btn->m_bmpdisable);
  1021. CPoint pt1,pt2,pt3;
  1022. pt1.x=0;
  1023. pt1.y=0;
  1024. pt2.x=btn->m_bmp->GetWidth();
  1025. pt2.y=0;
  1026. pt3.x=0;
  1027. pt3.y=btn->m_bmp->GetHeight();
  1028. Point destinationPoints[] = {
  1029. Point(pt1.x, pt1.y), // destination for upper-left point of original
  1030. Point(pt2.x, pt2.y), // destination for upper-right point of original
  1031. Point(pt3.x, pt3.y)}; // destination for lower-left point of original
  1032. ColorMatrix colorMatrix = \
  1033. {0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1034. 0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1035. 0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1036. 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
  1037. 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
  1038. ImageAttributes imageAtt;
  1039. imageAtt.SetColorMatrix(&colorMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
  1040. graph.DrawImage(btn->m_bmp,
  1041. destinationPoints,
  1042. 3,
  1043. 0,
  1044. 0,
  1045. btn->m_bmp->GetWidth(),
  1046. btn->m_bmp->GetHeight(),
  1047. UnitPixel,
  1048. &imageAtt);
  1049. btn->EnableWindow (0);m_bCanSave=0;
  1050. // CDialog::OnCancel ();
  1051. // return 1;
  1052. }
  1053. }
  1054. }
  1055. if(!m_delphotos.IsEmpty ())
  1056. {
  1057. m_delphotos.TrimLeft (";");
  1058. m_delphotos.TrimRight (";");
  1059. m_delphotos=";"+m_delphotos;
  1060. m_delphotos+=";";
  1061. for(int i=m_patharray1.GetSize ()-1; i>=0; i--)
  1062. {
  1063. CString no;
  1064. no=m_patharray1.ElementAt (i);
  1065. no=no.Right (no.GetLength ()-no.ReverseFind ('\\')-1);
  1066. no=no.Left (no.Find ('.'));
  1067. no=";"+no;
  1068. no+=";";
  1069. if(m_delphotos.Find(no)!=-1)
  1070. {
  1071. no=m_patharray1.ElementAt (i);
  1072. m_patharray1.RemoveAt (i);
  1073. m_patharray4.Add (no);
  1074. }
  1075. }
  1076. }
  1077. if(m_pArray)
  1078. {
  1079. for(int i=0; i<m_pArray->GetSize (); i+=2)
  1080. {
  1081. int j = 0;
  1082. for( j=0; j<m_List2.GetItemCount (); j++)
  1083. {
  1084. if(m_pArray->ElementAt (i)==m_List2.GetItemText (j, 0))
  1085. {
  1086. CString name=m_pArray->ElementAt (i+1);
  1087. int pos=name.Find ("$");
  1088. if(pos!=0)continue;
  1089. name.Delete (0,1);
  1090. pos=name.Find (".");
  1091. while(pos!=-1)
  1092. {
  1093. if(CheckOK(name.Left (pos)))
  1094. {
  1095. CString str=m_noarray.ElementAt (j);
  1096. CString temp=name.Left (pos);
  1097. temp=","+temp+",";
  1098. if(str.Find (temp)==-1)
  1099. {
  1100. str+=name.Left (pos);
  1101. str.TrimLeft (","); str=","+str+",";
  1102. m_noarray.SetAt (j, str);
  1103. str.TrimLeft (",");
  1104. str.TrimRight (",");
  1105. m_List2.SetItemText (j, 4, str);
  1106. }
  1107. }
  1108. name=name.Right (name.GetLength ()-pos-1);
  1109. pos=name.Find (".");
  1110. }
  1111. if(CheckOK(name))
  1112. {
  1113. CString str=m_noarray.ElementAt (j);
  1114. CString temp=name;
  1115. temp=","+temp+",";
  1116. if(str.Find (temp)==-1)
  1117. {
  1118. str+=name;
  1119. str.TrimLeft (","); str=","+str+",";
  1120. m_noarray.SetAt (j, str);
  1121. str.TrimLeft (",");
  1122. str.TrimRight (",");
  1123. m_List2.SetItemText (j, 4, str);
  1124. }
  1125. }
  1126. }
  1127. }
  1128. for( j=0; j<m_List3.GetItemCount (); j++)
  1129. {
  1130. if(m_pArray->ElementAt (i)==m_List3.GetItemText (j, 0))
  1131. {
  1132. CString name=m_pArray->ElementAt (i+1);
  1133. int pos=name.Find ("$");
  1134. if(pos!=0)continue;
  1135. name.Delete (0,1);
  1136. pos=name.Find (".");
  1137. while(pos!=-1)
  1138. {
  1139. if(CheckOK(name.Left (pos)))
  1140. {
  1141. CString str=m_no2array.ElementAt (j);
  1142. CString temp=name.Left (pos);
  1143. temp=","+temp+",";
  1144. if(str.Find (temp)==-1)
  1145. {
  1146. str+=name.Left (pos);
  1147. str.TrimLeft (","); str=","+str+",";
  1148. m_no2array.SetAt (j, str);
  1149. str.TrimLeft (",");
  1150. str.TrimRight (",");
  1151. #ifdef LKAY_VERSION
  1152. m_List3.SetItemText (j, 7, str);
  1153. #else
  1154. m_List3.SetItemText (j, 5, str);
  1155. #endif
  1156. }
  1157. }
  1158. name=name.Right (name.GetLength ()-pos-1);
  1159. pos=name.Find (".");
  1160. }
  1161. if(CheckOK(name))
  1162. {
  1163. CString str=m_no2array.ElementAt (j);
  1164. CString temp=name;
  1165. temp=","+temp+",";
  1166. if(str.Find (temp)==-1)
  1167. {
  1168. str+=name;
  1169. str.TrimLeft (","); str=","+str+",";
  1170. m_no2array.SetAt (j, str);
  1171. str.TrimLeft (",");
  1172. str.TrimRight (",");
  1173. #ifdef LKAY_VERSION
  1174. m_List3.SetItemText (j, 7, str);
  1175. #else
  1176. m_List3.SetItemText (j, 5, str);
  1177. #endif
  1178. }
  1179. }
  1180. }
  1181. }
  1182. }
  1183. }
  1184. }
  1185. else
  1186. {
  1187. GetData2();
  1188. if(m_checkstatus!="未看")
  1189. {
  1190. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(85)) && IsHasRights2new(20)==0 )
  1191. {
  1192. Login2 dlg;
  1193. if(dlg.DoModal ()!=IDOK)
  1194. {
  1195. MyBmpButton2 *btn=((MyBmpButton2*)m_picarray.ElementAt (4));
  1196. btn->m_bmpdisable=btn->m_bmp->Clone();
  1197. Graphics graph(btn->m_bmpdisable);
  1198. CPoint pt1,pt2,pt3;
  1199. pt1.x=0;
  1200. pt1.y=0;
  1201. pt2.x=btn->m_bmp->GetWidth();
  1202. pt2.y=0;
  1203. pt3.x=0;
  1204. pt3.y=btn->m_bmp->GetHeight();
  1205. Point destinationPoints[] = {
  1206. Point(pt1.x, pt1.y), // destination for upper-left point of original
  1207. Point(pt2.x, pt2.y), // destination for upper-right point of original
  1208. Point(pt3.x, pt3.y)}; // destination for lower-left point of original
  1209. ColorMatrix colorMatrix = \
  1210. {0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1211. 0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1212. 0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1213. 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
  1214. 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
  1215. ImageAttributes imageAtt;
  1216. imageAtt.SetColorMatrix(&colorMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
  1217. graph.DrawImage(btn->m_bmp,
  1218. destinationPoints,
  1219. 3,
  1220. 0,
  1221. 0,
  1222. btn->m_bmp->GetWidth(),
  1223. btn->m_bmp->GetHeight(),
  1224. UnitPixel,
  1225. &imageAtt);
  1226. btn->EnableWindow (0);
  1227. m_bCanSave=0;
  1228. // CDialog::OnCancel ();
  1229. // return 1;
  1230. }
  1231. else if(IsHasRightsnew2(20, dlg.m_rights)==0)
  1232. {
  1233. MyBmpButton2 *btn=((MyBmpButton2*)m_picarray.ElementAt (4));
  1234. btn->m_bmpdisable=btn->m_bmp->Clone();
  1235. Graphics graph(btn->m_bmpdisable);
  1236. CPoint pt1,pt2,pt3;
  1237. pt1.x=0;
  1238. pt1.y=0;
  1239. pt2.x=btn->m_bmp->GetWidth();
  1240. pt2.y=0;
  1241. pt3.x=0;
  1242. pt3.y=btn->m_bmp->GetHeight();
  1243. Point destinationPoints[] = {
  1244. Point(pt1.x, pt1.y), // destination for upper-left point of original
  1245. Point(pt2.x, pt2.y), // destination for upper-right point of original
  1246. Point(pt3.x, pt3.y)}; // destination for lower-left point of original
  1247. ColorMatrix colorMatrix = \
  1248. {0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1249. 0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1250. 0.33f, 0.33f, 0.33f, 0.0f, 0.0f,
  1251. 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
  1252. 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
  1253. ImageAttributes imageAtt;
  1254. imageAtt.SetColorMatrix(&colorMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
  1255. graph.DrawImage(btn->m_bmp,
  1256. destinationPoints,
  1257. 3,
  1258. 0,
  1259. 0,
  1260. btn->m_bmp->GetWidth(),
  1261. btn->m_bmp->GetHeight(),
  1262. UnitPixel,
  1263. &imageAtt);
  1264. btn->EnableWindow (0);m_bCanSave=0;
  1265. // CDialog::OnCancel ();
  1266. // return 1;
  1267. }
  1268. }
  1269. }
  1270. if(!m_delphotos.IsEmpty()) // add by Jeff:在加载时,先将已删除的相片从欲查看的相片中删除;
  1271. {
  1272. m_delphotos.TrimLeft (";");
  1273. m_delphotos.TrimRight (";");
  1274. m_delphotos=";"+m_delphotos;
  1275. m_delphotos+=";";
  1276. for(int i=m_patharray1.GetSize ()-1; i>=0; i--)
  1277. {
  1278. CString no;
  1279. no=m_patharray1.ElementAt (i);
  1280. no=no.Right (no.GetLength ()-no.ReverseFind ('\\')-1);
  1281. no=no.Left (no.Find ('.'));
  1282. no=";"+no;
  1283. no+=";";
  1284. if(m_delphotos.Find (no)!=-1)
  1285. {
  1286. no=m_patharray1.ElementAt (i);
  1287. m_patharray1.RemoveAt(i);
  1288. m_patharray4.Add (no);
  1289. }
  1290. }
  1291. }
  1292. }
  1293. LoadPhotos();//在界面上显示图片;
  1294. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(95)) || g_cominfoarray.ElementAt(0).ElementAt(95)=="" )
  1295. {
  1296. int timer1=atoi(g_cominfoarray.ElementAt(0).ElementAt(96));
  1297. m_timer=atoi(g_cominfoarray.ElementAt(0).ElementAt(97));
  1298. if(timer1==0)timer1=60;
  1299. if(m_timer==0)m_timer=20;
  1300. SetTimer(1, timer1*60000, NULL);
  1301. }
  1302. return false; // return TRUE unless you set the focus to a control
  1303. // EXCEPTION: OCX Property Pages should return FALSE
  1304. }
  1305. BOOL ChoosePhotoSkin2::InitializeUI()
  1306. {
  1307. g_bInSkin=1;
  1308. m_ticks=::GetTickCount ();
  1309. // TODO: Add extra initialization here
  1310. if(g_cursorhand==NULL)
  1311. g_cursorhand=AfxGetApp()->LoadCursor(IDC_CURSORHAND);
  1312. BYTE *pData=NULL;
  1313. BYTE *pDataBegin;
  1314. //printf("Jeff:loadLia路径:%s\n\n",g_mainpath+"\\skin\\"+m_liapath);//Jeff Printf;
  1315. if(!LoadLia(g_mainpath+"\\skin\\"+m_liapath, &pData, &pDataBegin, &m_pBk, m_hWnd))
  1316. {
  1317. EndDialog(0);
  1318. return false;
  1319. }
  1320. //printf("Jeff:g_resdata2.nPicCount=%d\n\n",g_resdata2.nPicCount); // Jeff Printf,这个nPicCount好像一直是15;
  1321. for(int i=0; i<g_resdata2.nPicCount; i++)
  1322. {
  1323. g_resdata2.rect[i].left *=g_fscalex;
  1324. g_resdata2.rect[i].right *=g_fscalex;
  1325. g_resdata2.rect[i].top *=g_fscaley;
  1326. g_resdata2.rect[i].bottom *=g_fscaley;
  1327. if(i==8)
  1328. g_resdata2.rect[i]=g_resdata2.rect[2];
  1329. else if(i==9)
  1330. g_resdata2.rect[i]=g_resdata2.rect[3];
  1331. else if(i==10)
  1332. g_resdata2.rect[i]=g_resdata2.rect[1];
  1333. if(g_resdata2.nPicBmpCount[i])
  1334. {
  1335. MyBmpButton2 *pic=new MyBmpButton2;
  1336. m_picarray.Add((DWORD)pic);
  1337. CRect rc=g_resdata2.rect[i];
  1338. CString str;
  1339. str.Format (_T("%d"), i+1);
  1340. pic->Create(str, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW , rc, this, i+100);
  1341. pic->m_bmpcount =g_resdata2.nPicBmpCount [i];
  1342. pic->ReadBmp (&pData, NULL, this);
  1343. #ifdef SZWNS_VERSION
  1344. if(i==3 && m_mode2==0)
  1345. {
  1346. Image *img=NULL;
  1347. LoadImageFromRes(&img, MAKEINTRESOURCE(IDR_JPG6), _T("JPG") );
  1348. delete pic->m_bmp;
  1349. pic->m_bmp=img->Clone();
  1350. delete img;
  1351. img=NULL;
  1352. LoadImageFromRes(&img, MAKEINTRESOURCE(IDR_JPG7), _T("JPG") );
  1353. delete pic->m_bmpfocus;
  1354. pic->m_bmpfocus=img->Clone();
  1355. delete img;
  1356. img=NULL;
  1357. LoadImageFromRes(&img, MAKEINTRESOURCE(IDR_JPG8), _T("JPG") );
  1358. delete pic->m_bmpfocused;
  1359. pic->m_bmpfocused=img->Clone();
  1360. delete img;
  1361. }
  1362. #endif
  1363. }
  1364. else
  1365. m_picarray.Add (NULL);
  1366. m_rcarray.Add(g_resdata2.rect[i]);
  1367. }
  1368. delete []pDataBegin;
  1369. if(m_mode2)//看设计
  1370. {
  1371. m_bHide=0;
  1372. // printf("Jeff:g_cominfoarray.ElementAt(0).ElementAt(86)=%s\n\n",g_cominfoarray.ElementAt(0).ElementAt(86)); // Jeff Printf;
  1373. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86)))
  1374. {
  1375. ((MyBmpButton2*)m_picarray.ElementAt (3))->ShowWindow (SW_HIDE);
  1376. CRect rc,rc2;
  1377. ((MyBmpButton2*)m_picarray.ElementAt (3))->GetWindowRect(rc);
  1378. ((MyBmpButton2*)m_picarray.ElementAt (1))->GetWindowRect(rc2);
  1379. int dtx=rc.right -rc2.right ;
  1380. ScreenToClient(rc2);
  1381. rc2.left +=dtx;
  1382. rc2.right +=dtx;
  1383. ((MyBmpButton2*)m_picarray.ElementAt (1))->MoveWindow(rc2);
  1384. ((MyBmpButton2*)m_picarray.ElementAt (0))->GetWindowRect(rc2);
  1385. ScreenToClient(rc2);
  1386. rc2.left +=dtx;
  1387. rc2.right +=dtx;
  1388. ((MyBmpButton2*)m_picarray.ElementAt (0))->MoveWindow(rc2);
  1389. }
  1390. CRect rc,rc2;
  1391. ((MyBmpButton2*)m_picarray.ElementAt (5))->GetWindowRect(rc);
  1392. ((MyBmpButton2*)m_picarray.ElementAt (4))->GetWindowRect(rc2);
  1393. int dtx=rc.right -rc2.right ;
  1394. rc2=rc;
  1395. // if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86))==0)
  1396. {
  1397. float scale=0.9;
  1398. dtx*=scale;
  1399. int wid=rc2.Width ()*scale;
  1400. int hei=rc2.Height ()*scale;
  1401. int dty=rc2.Height ()-hei;
  1402. dty/=2;
  1403. rc2.left =rc2.right -wid;
  1404. rc2.top +=dty;
  1405. rc2.bottom =rc2.top +hei;
  1406. }
  1407. ScreenToClient(rc2);
  1408. ((MyBmpButton2*)m_picarray.ElementAt (5))->MoveWindow(rc2);
  1409. rc2.left -=dtx;
  1410. rc2.right -=dtx;
  1411. ((MyBmpButton2*)m_picarray.ElementAt (4))->MoveWindow(rc2);
  1412. rc2.left -=dtx;
  1413. rc2.right -=dtx;
  1414. ((MyBmpButton2*)m_picarray.ElementAt (14))->MoveWindow(rc2);
  1415. rc2.left -=dtx;
  1416. rc2.right -=dtx;
  1417. ((MyBmpButton2*)m_picarray.ElementAt (2))->MoveWindow(rc2);
  1418. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86))==0)
  1419. {
  1420. rc2.left -=dtx;
  1421. rc2.right -=dtx;
  1422. ((MyBmpButton2*)m_picarray.ElementAt (3))->MoveWindow(rc2);
  1423. }
  1424. rc2.left -=dtx;
  1425. rc2.right -=dtx;
  1426. ((MyBmpButton2*)m_picarray.ElementAt (1))->MoveWindow(rc2);
  1427. rc2.left -=dtx;
  1428. rc2.right -=dtx;
  1429. ((MyBmpButton2*)m_picarray.ElementAt (0))->MoveWindow(rc2);
  1430. rc2.left -=dtx;
  1431. rc2.right -=dtx;
  1432. ((MyBmpButton2*)m_picarray.ElementAt (8))->MoveWindow(rc2);
  1433. ((MyBmpButton2*)m_picarray.ElementAt (11))->ShowWindow (SW_HIDE);
  1434. }
  1435. else
  1436. {
  1437. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86)))
  1438. {
  1439. ((MyBmpButton2*)m_picarray.ElementAt (3))->ShowWindow (SW_HIDE);
  1440. CRect rc,rc2;
  1441. ((MyBmpButton2*)m_picarray.ElementAt (3))->GetWindowRect(rc);
  1442. ((MyBmpButton2*)m_picarray.ElementAt (1))->GetWindowRect(rc2);
  1443. int dtx=rc.right -rc2.right ;
  1444. ScreenToClient(rc2);
  1445. rc2.left +=dtx;
  1446. rc2.right +=dtx;
  1447. ((MyBmpButton2*)m_picarray.ElementAt (1))->MoveWindow(rc2);
  1448. ((MyBmpButton2*)m_picarray.ElementAt (0))->GetWindowRect(rc2);
  1449. ScreenToClient(rc2);
  1450. rc2.left +=dtx;
  1451. rc2.right +=dtx;
  1452. ((MyBmpButton2*)m_picarray.ElementAt (0))->MoveWindow(rc2);
  1453. }
  1454. }
  1455. if(1)//m_mode2==0)
  1456. {
  1457. ((MyBmpButton2*)m_picarray.ElementAt (7))->ShowWindow (SW_HIDE);
  1458. ((MyBmpButton2*)m_picarray.ElementAt (8))->ShowWindow (SW_HIDE);
  1459. ((MyBmpButton2*)m_picarray.ElementAt (9))->ShowWindow (SW_HIDE);
  1460. ((MyBmpButton2*)m_picarray.ElementAt (10))->ShowWindow (SW_HIDE);
  1461. ((MyBmpButton2*)m_picarray.ElementAt (11))->ShowWindow (SW_HIDE);
  1462. }
  1463. else
  1464. {
  1465. ((MyBmpButton2*)m_picarray.ElementAt (7))->EnableWindow (0);
  1466. ((MyBmpButton2*)m_picarray.ElementAt (0))->ShowWindow (SW_HIDE);
  1467. ((MyBmpButton2*)m_picarray.ElementAt (1))->ShowWindow (SW_HIDE);
  1468. ((MyBmpButton2*)m_picarray.ElementAt (2))->ShowWindow (SW_HIDE);
  1469. ((MyBmpButton2*)m_picarray.ElementAt (3))->ShowWindow (SW_HIDE);
  1470. ((MyBmpButton2*)m_picarray.ElementAt (11))->ShowWindow (SW_HIDE);
  1471. if(IsHasRights2new(37)==0)
  1472. {
  1473. ((MyBmpButton2*)m_picarray.ElementAt (8))->ShowWindow (SW_HIDE);
  1474. ((MyBmpButton2*)m_picarray.ElementAt (9))->ShowWindow (SW_HIDE);
  1475. }
  1476. }
  1477. if(m_mode2)
  1478. {
  1479. ((MyBmpButton2*)m_picarray.ElementAt (8))->ShowWindow (SW_SHOW);
  1480. // ((MyBmpButton2*)m_picarray.ElementAt (8))->SetPushDown (1);
  1481. ((MyBmpButton2*)m_picarray.ElementAt (12))->ShowWindow (SW_HIDE);
  1482. ((MyBmpButton2*)m_picarray.ElementAt (13))->ShowWindow (SW_HIDE);
  1483. }
  1484. else//移按钮位置
  1485. {
  1486. CRect rc,rc2;
  1487. ((MyBmpButton2*)m_picarray.ElementAt (5))->GetWindowRect(rc);
  1488. ((MyBmpButton2*)m_picarray.ElementAt (4))->GetWindowRect(rc2);
  1489. int dtx=rc.right -rc2.right ;
  1490. rc2=rc;
  1491. // if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86))==0)
  1492. {
  1493. float scale=0.9;
  1494. dtx*=scale;
  1495. int wid=rc2.Width ()*scale;
  1496. int hei=rc2.Height ()*scale;
  1497. int dty=rc2.Height ()-hei;
  1498. dty/=2;
  1499. rc2.left =rc2.right -wid;
  1500. rc2.top +=dty;
  1501. rc2.bottom =rc2.top +hei;
  1502. }
  1503. ScreenToClient(rc2);
  1504. ((MyBmpButton2*)m_picarray.ElementAt (5))->MoveWindow(rc2);
  1505. rc2.left -=dtx;
  1506. rc2.right -=dtx;
  1507. ((MyBmpButton2*)m_picarray.ElementAt (4))->MoveWindow(rc2);
  1508. rc2.left -=dtx;
  1509. rc2.right -=dtx;
  1510. ((MyBmpButton2*)m_picarray.ElementAt (14))->MoveWindow(rc2);
  1511. rc2.left -=dtx;
  1512. rc2.right -=dtx;
  1513. ((MyBmpButton2*)m_picarray.ElementAt (2))->MoveWindow(rc2);
  1514. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86))==0)
  1515. {
  1516. rc2.left -=dtx;
  1517. rc2.right -=dtx;
  1518. ((MyBmpButton2*)m_picarray.ElementAt (3))->MoveWindow(rc2);
  1519. }
  1520. rc2.left -=dtx;
  1521. rc2.right -=dtx;
  1522. ((MyBmpButton2*)m_picarray.ElementAt (12))->MoveWindow(rc2);
  1523. rc2.left -=dtx;
  1524. rc2.right -=dtx;
  1525. ((MyBmpButton2*)m_picarray.ElementAt (13))->MoveWindow(rc2);
  1526. rc2.left -=dtx;
  1527. rc2.right -=dtx;
  1528. ((MyBmpButton2*)m_picarray.ElementAt (1))->MoveWindow(rc2);
  1529. rc2.left -=dtx;
  1530. rc2.right -=dtx;
  1531. ((MyBmpButton2*)m_picarray.ElementAt (0))->MoveWindow(rc2);
  1532. }
  1533. #ifndef MNLS_VERSION
  1534. ((MyBmpButton2*)m_picarray.ElementAt (7))->ShowWindow (SW_HIDE);
  1535. ((MyBmpButton2*)m_picarray.ElementAt (7))->EnableWindow (0);
  1536. Graphics graph(m_pBk);
  1537. Image *img=NULL;
  1538. if(m_mode2==0)
  1539. ::LoadImageFromBuf (&img, g_mainpath+"\\图片\\标题-选片.jpg");
  1540. else
  1541. ::LoadImageFromBuf (&img, g_mainpath+"\\图片\\标题-看设计.jpg");
  1542. if(img)
  1543. {
  1544. if(img->GetWidth()==2000)
  1545. {
  1546. graph.SetSmoothingMode(SmoothingModeHighQuality);
  1547. graph.DrawImage(img, 0,0);
  1548. }
  1549. delete img;
  1550. }
  1551. #endif
  1552. CRect listrc=m_rcarray.ElementAt (6);
  1553. CRect rc;
  1554. GetClientRect(rc);
  1555. rc.top=listrc.top;
  1556. m_List1.MoveWindow (rc);
  1557. CString path,str;
  1558. if(m_mode2)
  1559. {
  1560. m_path=g_path3+"\\";
  1561. m_path+=m_strOrderNumber;
  1562. m_path +="\\";
  1563. // printf("Jeff:m_path=%s\n\n",m_path); // Jeff Printf;
  1564. }
  1565. if(m_mode2)//看设计
  1566. {
  1567. GetPhotos();
  1568. }
  1569. else
  1570. {
  1571. //AfxMessageBox("789");
  1572. IsGrowthTx growthtxdlg;
  1573. growthtxdlg.m_mode=1;
  1574. growthtxdlg.m_strOrderNumber=m_strOrderNumber;
  1575. growthtxdlg.DoModal ();
  1576. m_bGrowthTX=growthtxdlg.m_bGrowthTx;
  1577. m_seltxname=growthtxdlg.m_seltxname;
  1578. /*if(!growthtxdlg.m_seltxname.IsEmpty ())
  1579. {
  1580. if(growthtxdlg.m_seltxname!="全部")
  1581. {
  1582. path+=growthtxdlg.m_seltxname;
  1583. path+="\\";
  1584. }
  1585. }*/
  1586. if(CheckHC())
  1587. {
  1588. m_bFromLocal=1;
  1589. char path[MAX_PATH];
  1590. ::GetSystemDirectory (path, MAX_PATH);
  1591. CString sysdir=path;
  1592. sysdir+="\\lyfz";
  1593. ::CreateDirectory (sysdir, NULL);
  1594. sysdir+="\\";
  1595. sysdir+=m_strOrderNumber;
  1596. using namespace helper_coffs;
  1597. ffsco o;
  1598. o.dirs(1);
  1599. o.find(LPCSTR(sysdir), LPCSTR("*.jpg"));
  1600. ffsco::typeT coo;
  1601. ffsco::typeT::iterator it;
  1602. coo = o.co_file();
  1603. for (it = coo.begin();coo.end() != it;it ++)
  1604. {
  1605. str=(*it).c_str();
  1606. // printf("Jeff:str=%s\n\n",str);// Jeff Printf
  1607. if(str.GetAt (str.ReverseFind ('\\')+1)!='s' && str.GetAt (str.ReverseFind ('\\')+1)!='m')
  1608. {
  1609. m_patharray1.Add (str);
  1610. }
  1611. }
  1612. }
  1613. if(m_patharray1.GetSize ()==0)
  1614. {
  1615. if(IsPhoto2Exist())
  1616. {
  1617. SelBrunDevice dlg;
  1618. dlg.m_mode=1;
  1619. if(dlg.DoModal ()==IDOK)
  1620. m_nChoosePhotoType=dlg.m_sel;
  1621. else
  1622. m_nChoosePhotoType=0;
  1623. //m_nChoosePhotoType=0 原片+修片 1:修片 2:原片
  1624. }
  1625. else
  1626. AfxMessageBox("温馨提示:\r\n未找到初修片,将使用原片选片", MB_ICONINFORMATION);
  1627. {
  1628. CString path2;
  1629. m_path=g_path1+"\\";
  1630. m_path+=m_strOrderNumber;
  1631. m_path +="\\";
  1632. if(m_seltxname!="" && m_seltxname!="全部")
  1633. {
  1634. m_path+=m_seltxname; m_path +="\\";
  1635. }
  1636. if(m_nChoosePhotoType==1)
  1637. {
  1638. m_path=g_path2+"\\";
  1639. m_path+=m_strOrderNumber;
  1640. m_path +="\\";
  1641. }
  1642. CString filename;
  1643. using namespace helper_coffs;
  1644. ffsco o;
  1645. o.dirs(1);
  1646. o.find(LPCSTR(m_path), LPCSTR("*.*"));
  1647. ffsco::typeT coo;
  1648. ffsco::typeT::iterator it;
  1649. coo = o.co_file();
  1650. for (it = coo.begin(); coo.end() != it; it ++)
  1651. {
  1652. path=(*it).c_str();
  1653. if(path.GetAt (path.ReverseFind ('\\')+1)!='s' && path.GetAt (path.ReverseFind ('\\')+1)!='m')
  1654. {
  1655. path.MakeLower ();
  1656. filename=path.Right(path.GetLength()-path.ReverseFind ('\\')-1);
  1657. if(filename.Find(".")!=-1)
  1658. filename=filename.Left(filename.Find("."));
  1659. if(!myisdigit(filename))continue;
  1660. if(m_nChoosePhotoType==1)
  1661. {
  1662. m_patharray1.Add (path);
  1663. }
  1664. else
  1665. {
  1666. path2=path;
  1667. if(m_nChoosePhotoType==0)
  1668. path2.Replace ("客户原片", "修好的片");
  1669. if(m_bGrowthTX==0)
  1670. {
  1671. int pos=path2.Find (m_strOrderNumber);
  1672. pos+=m_strOrderNumber.GetLength ();
  1673. int pos2=path2.ReverseFind ('\\');
  1674. path2=path2.Left (pos)+path2.Right (path2.GetLength ()-pos2);
  1675. }
  1676. if(m_nChoosePhotoType==0 && ::PathFileExists (path2))
  1677. {
  1678. m_patharray1.Add (path2);
  1679. }
  1680. else
  1681. {
  1682. path2.Replace (".raw", ".jpg");
  1683. if(::PathFileExists (path2))
  1684. {
  1685. m_patharray1.Add (path2);continue;
  1686. }
  1687. path2.Replace (".nef", ".jpg");
  1688. if(::PathFileExists (path2))
  1689. {
  1690. m_patharray1.Add (path2);continue;
  1691. }
  1692. path2.Replace (".cr2", ".jpg");
  1693. if(::PathFileExists (path2))
  1694. {
  1695. m_patharray1.Add (path2);continue;
  1696. }
  1697. else
  1698. {
  1699. if(path.Right(3)!="jpg")continue;
  1700. m_patharray1.Add (path);
  1701. }
  1702. }
  1703. }
  1704. }
  1705. }
  1706. }
  1707. // if(0)
  1708. {//多种修好的效果
  1709. CString path2;
  1710. path2=g_path2+"\\";
  1711. path2+=m_strOrderNumber;
  1712. path2 +="\\";
  1713. using namespace helper_coffs;
  1714. ffsco o;
  1715. o.dirs(0);
  1716. o.find(LPCSTR(path2), LPCSTR("*.jpg"));
  1717. ffsco::typeT coo;
  1718. ffsco::typeT::iterator it;
  1719. coo = o.co_file();
  1720. for (it = coo.begin();
  1721. coo.end() != it;
  1722. it ++)
  1723. {
  1724. path=(*it).c_str();
  1725. if(path.GetAt (path.ReverseFind ('\\')+1)!='s' && path.GetAt (path.ReverseFind ('\\')+1)!='m')
  1726. {
  1727. path.MakeLower ();
  1728. path2=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  1729. if(path2.Find ("-")!=-1)
  1730. {
  1731. m_patharray1.Add (path);
  1732. }
  1733. }
  1734. }
  1735. }
  1736. /////////////////
  1737. if(0)//atoi(g_cominfoarray.ElementAt(0).ElementAt(109))==0)
  1738. {
  1739. char path[MAX_PATH];
  1740. ::GetSystemDirectory (path, MAX_PATH);
  1741. CString sysdir=path;
  1742. sysdir+="\\lyfz";
  1743. ::CreateDirectory (sysdir, NULL);
  1744. sysdir+="\\";
  1745. sysdir+=m_strOrderNumber;
  1746. ::CreateDirectory (sysdir, NULL);
  1747. sysdir+="\\";
  1748. ImportPhoto dlg;
  1749. dlg.m_bCopyToLocal=1;
  1750. dlg.m_mode =1;
  1751. dlg.m_pArray=&m_patharray1;
  1752. dlg.m_savepath =sysdir;
  1753. dlg.DoModal ();
  1754. CStringArray temparray;
  1755. CString filename;
  1756. for(int i=0; i<m_patharray1.GetSize(); i++)
  1757. {
  1758. filename=m_patharray1.ElementAt(i);
  1759. filename=filename.Right (filename.GetLength ()-filename.ReverseFind ('\\')-1);
  1760. temparray.Add(sysdir+filename);
  1761. }
  1762. m_patharray1.RemoveAll();
  1763. m_patharray1.Copy(temparray);
  1764. }
  1765. }
  1766. if(m_patharray1.GetSize () && atoi(g_cominfoarray.ElementAt(0).ElementAt(61)))
  1767. {
  1768. int size=m_patharray1.GetSize ()-1;
  1769. CString sTemp;
  1770. int nPos;
  1771. for(int i=0;i<size;i++)
  1772. {
  1773. nPos=rand()%(size-i);
  1774. sTemp=m_patharray1.ElementAt (size-i);
  1775. m_patharray1.SetAt (size-i, m_patharray1.ElementAt (nPos));
  1776. m_patharray1.SetAt (nPos, sTemp);
  1777. }
  1778. }
  1779. }
  1780. m_ImageListThumb.Create(THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, ILC_COLOR24, 0, 1);
  1781. m_List1.SetImageList(&m_ImageListThumb, LVSIL_NORMAL);
  1782. m_List2.InitStyle();
  1783. m_List2.InsertColumn(0,_T("编号"),LVCFMT_LEFT,45);
  1784. m_List2.InsertColumn(1,_T("商品名称"),LVCFMT_LEFT,150);
  1785. m_List2.InsertColumn(2,_T("数量"),LVCFMT_LEFT,45);
  1786. m_List3.InitStyle();
  1787. m_List3.InsertColumn(0,_T("autoid"),LVCFMT_LEFT,0);
  1788. m_List3.InsertColumn(1,_T("编号"),LVCFMT_LEFT,45);
  1789. m_List3.InsertColumn(2,_T("商品名称"),LVCFMT_LEFT,150);
  1790. m_List3.InsertColumn(3,_T("价格"),LVCFMT_LEFT,45);
  1791. m_List3.InsertColumn(4,_T("数量"),LVCFMT_LEFT,45);
  1792. #ifdef LKAY_VERSION
  1793. m_List3.InsertColumn(5,_T("P数"),LVCFMT_LEFT,55);
  1794. m_List3.InsertColumn(6,_T("张数"),LVCFMT_LEFT,55);
  1795. m_List3.InsertColumn(7,_T("照片编号"),LVCFMT_LEFT,365);
  1796. #else
  1797. m_List3.InsertColumn(5,_T("照片编号"),LVCFMT_LEFT,365);
  1798. #endif
  1799. }
  1800. void ChoosePhotoSkin2::OnPaint()
  1801. {
  1802. try
  1803. {
  1804. CPaintDC dc(this); // device context for painting
  1805. // TODO: Add your message handler code here
  1806. if(m_pBk==NULL)
  1807. {
  1808. return ;
  1809. }
  1810. CRect rc;
  1811. GetClientRect(rc);
  1812. Graphics graph(dc.GetSafeHdc ());
  1813. Rect destinationRect(0,0,rc.Width (), rc.Height ());
  1814. int width=m_pBk->GetWidth() ;
  1815. int height=m_pBk->GetHeight() ;
  1816. graph.SetSmoothingMode(SmoothingModeHighQuality);
  1817. graph.DrawImage(m_pBk, destinationRect, 0,0,width,height,UnitPixel);
  1818. // Do not call CDialog::OnPaint() for painting messages
  1819. }
  1820. catch(...)
  1821. {
  1822. }
  1823. }
  1824. void ChoosePhotoSkin2::OnPaint2(CWnd *pWnd)
  1825. {
  1826. try
  1827. {
  1828. CPaintDC dc(pWnd); // device context for painting
  1829. // TODO: Add your message handler code here
  1830. CRect rc;
  1831. GetClientRect(rc);
  1832. if(m_pBk==NULL)
  1833. {
  1834. return ;
  1835. }
  1836. int width=m_pBk->GetWidth() ;
  1837. int height=m_pBk->GetHeight() ;
  1838. Graphics graph(dc.GetSafeHdc ());
  1839. Rect destinationRect(0,0,rc.Width (), rc.Height ());
  1840. graph.SetSmoothingMode(SmoothingModeHighQuality);
  1841. graph.DrawImage(m_pBk, destinationRect, 0,0,width,height,UnitPixel);
  1842. }
  1843. catch(...)
  1844. {
  1845. }
  1846. }
  1847. void ChoosePhotoSkin2::OnDestroy()
  1848. {
  1849. try
  1850. {
  1851. TerminateThread();
  1852. if(m_pBk)delete m_pBk;
  1853. MyBmpButton2 *pic=NULL;
  1854. for(int i=0; i<m_picarray.GetSize(); i++)
  1855. {
  1856. pic=(MyBmpButton2*)m_picarray.ElementAt(i);
  1857. if(pic)
  1858. {
  1859. pic->DestroyWindow();
  1860. delete pic;
  1861. }
  1862. }
  1863. m_picarray.RemoveAll();
  1864. if(m_selphotownd.GetSafeHwnd ())
  1865. {
  1866. m_selphotownd.DestroyWindow ();
  1867. }
  1868. if(m_selphotownd2.GetSafeHwnd ())
  1869. {
  1870. m_selphotownd2.DestroyWindow ();
  1871. }
  1872. /* char path[MAX_PATH];
  1873. ::GetSystemDirectory (path, MAX_PATH);
  1874. CString sysdir=path;
  1875. sysdir+="\\lyfz";
  1876. ::DeleteDirectory (sysdir);*/
  1877. CDialog::OnDestroy();
  1878. }
  1879. catch(...)
  1880. {
  1881. }
  1882. }
  1883. BOOL ChoosePhotoSkin2::OnEraseBkgnd(CDC* pDC)
  1884. {
  1885. // TODO: Add your message handler code here and/or call default
  1886. return 1;
  1887. }
  1888. void ChoosePhotoSkin2::SetLiaPath(CString path)
  1889. {
  1890. m_liapath=path;
  1891. }
  1892. BEGIN_EVENTSINK_MAP(ChoosePhotoSkin2, CDialog)
  1893. //{{AFX_EVENTSINK_MAP(ChoosePhotoSkin2)
  1894. ON_EVENT(ChoosePhotoSkin2, 100, 150 /* FSCommand */, OnFSCommandShockwaveflash1, VTS_BSTR VTS_BSTR)
  1895. //}}AFX_EVENTSINK_MAP
  1896. END_EVENTSINK_MAP()
  1897. void ChoosePhotoSkin2::OnFSCommandShockwaveflash1(LPCTSTR command, LPCTSTR args)
  1898. {
  1899. // TODO: Add your control notification handler code here
  1900. }
  1901. unsigned __stdcall LoadThumbNail3(LPVOID lpParam)
  1902. {
  1903. ChoosePhotoSkin2 *pDlg=(ChoosePhotoSkin2*)lpParam;
  1904. CListCtrl *ListCtrl=&pDlg->m_List1;
  1905. try
  1906. {
  1907. CImageList* pImgList=&pDlg->m_ImageListThumb;
  1908. // reset our image list
  1909. for(int i=0; i<pImgList->GetImageCount(); i++)
  1910. pImgList->Remove(i);
  1911. // remove all items from list view
  1912. ListCtrl->DeleteAllItems();
  1913. pImgList->SetImageCount(pDlg->m_vFileName.size());
  1914. // TCHAR path[MAX_PATH];
  1915. vector<CString>::iterator iter;
  1916. // Set redraw to FALSE to avoid flickering during adding new items
  1917. ListCtrl->SetRedraw(FALSE);
  1918. int nIndex=0;
  1919. CString str,spath;
  1920. if(pDlg->m_mode2==0) // 选片;
  1921. {
  1922. for(iter=pDlg->m_vFileName.begin(); iter!=pDlg->m_vFileName.end() && pDlg->m_bTerminate!=true; iter++, nIndex++)
  1923. {
  1924. str=*iter;
  1925. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  1926. str=str.Left (str.Find ('.'));
  1927. str+=pDlg->GetSelName(str);
  1928. ListCtrl->InsertItem(nIndex, str, nIndex);
  1929. }
  1930. }
  1931. else // 看设计;
  1932. {
  1933. for(iter=pDlg->m_vFileName.begin(); iter!=pDlg->m_vFileName.end() && pDlg->m_bTerminate!=true; iter++, nIndex++)
  1934. {
  1935. str=*iter;
  1936. spath.Empty ();
  1937. if(str.Left (str.ReverseFind ('\\')+1)!=pDlg->m_path)
  1938. {
  1939. spath=str.Left (str.ReverseFind ('\\')+1);
  1940. spath= spath.Right (spath.GetLength ()-pDlg->m_path.GetLength ());
  1941. }
  1942. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  1943. if(str.Find("delgabook")!=-1)
  1944. {
  1945. str.TrimRight ("\\");
  1946. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  1947. str.Replace ("delgabook", "Flash");
  1948. ListCtrl->InsertItem(nIndex, str, nIndex);
  1949. }
  1950. else
  1951. {
  1952. str=spath+str.Left (str.GetLength ()-4);
  1953. CString temp=pDlg->GetSelName(str);
  1954. ListCtrl->InsertItem(nIndex, str+temp, nIndex);
  1955. }
  1956. }
  1957. }
  1958. ListCtrl->SetRedraw(TRUE);
  1959. ListCtrl->Invalidate();
  1960. const float fRatio=(float)THUMBNAIL_HEIGHT/THUMBNAIL_WIDTH;
  1961. int XDest, YDest, nDestWidth, nDestHeight;
  1962. nIndex=0;
  1963. SolidBrush whitebrush(Color(255,255,255,255));
  1964. Image *pHideImg=NULL;
  1965. Bitmap *pNULLBmp=new Bitmap(THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, PixelFormat24bppRGB );
  1966. Graphics graph2(pNULLBmp);
  1967. graph2.Clear(Color(255,0,0,0));
  1968. for(iter=pDlg->m_vFileName.begin(); iter!=pDlg->m_vFileName.end() && pDlg->m_bTerminate!=true; iter++, nIndex++)
  1969. {
  1970. // Load Image File
  1971. Image *image=NULL;
  1972. Bitmap *pBmp=NULL;
  1973. str=*iter;
  1974. spath=str.Left (str.ReverseFind ('\\')+1);
  1975. spath+="s";
  1976. spath+=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  1977. // if(pDlg->m_mode2==0 && pDlg->m_bHide && pHideImg==NULL)
  1978. if( pDlg->m_bHide && pHideImg==NULL)
  1979. {
  1980. LoadImageFromRes(&pHideImg, MAKEINTRESOURCE(IDR_JPG5), _T("JPG") );
  1981. }
  1982. BOOL bNullimg=0;
  1983. if(pHideImg==NULL)
  1984. {
  1985. // if(atoi(g_cominfoarray.ElementAt(0).ElementAt(109))==0 && pDlg->m_mode2==0)
  1986. if(0)//pDlg->m_bFromLocal && pDlg->m_mode2==0)
  1987. {
  1988. spath=spath.Right (spath.GetLength ()-spath.ReverseFind ('\\'));
  1989. CString stemp;
  1990. stemp=g_path2+"\\";
  1991. stemp+=pDlg->m_strOrderNumber;
  1992. stemp +="\\";
  1993. stemp+=spath;
  1994. if(::CheckFileExist (stemp))
  1995. spath=stemp;
  1996. else
  1997. {
  1998. stemp=g_path1+"\\";
  1999. stemp+=pDlg->m_strOrderNumber;
  2000. stemp +="\\";
  2001. stemp+=spath;
  2002. spath=stemp;
  2003. }
  2004. }
  2005. if(::CheckFileExist (spath))
  2006. {
  2007. ::LoadImageFromBuf (&image, spath);
  2008. }
  2009. else if(::CheckFileExist (str))
  2010. ::LoadImageFromBuf (&image, str);
  2011. else
  2012. {
  2013. bNullimg=1;
  2014. image=pNULLBmp;
  2015. }
  2016. if(image==NULL)continue;
  2017. if(image->GetWidth()==0)
  2018. continue;
  2019. int orientation=GetOrientation(image);
  2020. if(orientation==8)
  2021. image->RotateFlip( Rotate270FlipNone );
  2022. else if(orientation==6)
  2023. image->RotateFlip( Rotate90FlipNone );
  2024. }
  2025. else
  2026. image=pHideImg;
  2027. // Calculate Rect to fit to canvas
  2028. const float fImgRatio=(float)image->GetHeight()/image->GetWidth();
  2029. if(fImgRatio > fRatio)
  2030. {
  2031. nDestWidth=THUMBNAIL_HEIGHT/fImgRatio;
  2032. XDest=(THUMBNAIL_WIDTH-nDestWidth)/2;
  2033. YDest=0;
  2034. nDestHeight=THUMBNAIL_HEIGHT;
  2035. }
  2036. else
  2037. {
  2038. XDest=0;
  2039. nDestWidth=THUMBNAIL_WIDTH;
  2040. nDestHeight=THUMBNAIL_WIDTH*fImgRatio;
  2041. YDest=(THUMBNAIL_HEIGHT-nDestHeight)/2;
  2042. }
  2043. pBmp=new Bitmap(THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, PixelFormat24bppRGB );
  2044. Graphics graph2(pBmp);
  2045. graph2.Clear(Color(255,192,192,192));
  2046. graph2.FillRectangle (&whitebrush,1, 1, THUMBNAIL_WIDTH-2, THUMBNAIL_HEIGHT-2);
  2047. Graphics graph(pBmp);
  2048. Rect desRect(XDest, YDest, nDestWidth, nDestHeight);
  2049. // Draw Image
  2050. graph.DrawImage(image, desRect, 0,0,image->GetWidth(),image->GetHeight(),UnitPixel);
  2051. if(pHideImg==NULL && bNullimg==0)
  2052. delete image;
  2053. // Attach to Bitmap and Replace image in CImageList
  2054. CBitmap bitmap;
  2055. HBITMAP hbmp;
  2056. pBmp->GetHBITMAP(Color(255,255,255,255), &hbmp);
  2057. bitmap.Attach(hbmp);
  2058. pImgList->Replace(nIndex, &bitmap, NULL);
  2059. delete pBmp;
  2060. // Redraw only a current item for removing flickering and fast speed.
  2061. ListCtrl->RedrawItems(nIndex, nIndex);
  2062. // Release used DC and Object
  2063. }
  2064. delete pNULLBmp;
  2065. if(pHideImg)delete pHideImg;
  2066. ListCtrl->Invalidate();
  2067. pDlg->m_bRunning=false;
  2068. pDlg->m_bTerminate=false;
  2069. pDlg->PostMessage(WM_USER+200, 0, 0);
  2070. _endthreadex( 0 );
  2071. return 0;
  2072. }
  2073. catch(...)
  2074. {
  2075. ListCtrl->Invalidate();
  2076. pDlg->m_bRunning=false;
  2077. pDlg->m_bTerminate=false;
  2078. pDlg->PostMessage(WM_USER+200, 0, 0);
  2079. _endthreadex( 0 );
  2080. }
  2081. }
  2082. void ChoosePhotoSkin2::LoadThumbImages()
  2083. {
  2084. TerminateThread();
  2085. m_hThread = (HANDLE)_beginthreadex(NULL,0, LoadThumbNail3,(LPVOID)this,0/* CREATE_SUSPENDED*/,&m_dwThreadID);
  2086. m_bRunning=true;
  2087. }
  2088. BOOL ChoosePhotoSkin2::TerminateThread()
  2089. {
  2090. if ( !m_bRunning )
  2091. return TRUE;
  2092. m_bTerminate=true;
  2093. for( ; ; )
  2094. {
  2095. if ( ::WaitForSingleObject(m_hThread, 0) == WAIT_OBJECT_0 )
  2096. break;
  2097. MSG msg;
  2098. while (::PeekMessage(&msg,NULL,0,0,PM_NOREMOVE))
  2099. {
  2100. if (!AfxGetApp()->PumpMessage())
  2101. break;
  2102. }
  2103. }
  2104. ::CloseHandle(m_hThread);
  2105. return TRUE;
  2106. }
  2107. void ChoosePhotoSkin2::OnDblclkList1()
  2108. {
  2109. POSITION pos;
  2110. pos=m_List1.GetFirstSelectedItemPosition();
  2111. if(pos==NULL)
  2112. {
  2113. return;
  2114. }
  2115. CArray<int,int>posarray;
  2116. int iItem=m_List1.GetNextSelectedItem(pos);
  2117. posarray.Add (iItem);
  2118. while (pos)
  2119. {
  2120. int iItem=m_List1.GetNextSelectedItem(pos);
  2121. posarray.Add (iItem);
  2122. if(posarray.GetSize ()>3)break;
  2123. }
  2124. if(posarray.GetSize ()>=2)
  2125. {
  2126. CStringArray *m_pPtahArray=GetCurArray();
  2127. CComparePhoto dlg;
  2128. dlg.m_path1=m_pPtahArray->ElementAt (posarray.ElementAt(0));
  2129. dlg.m_path2=m_pPtahArray->ElementAt (posarray.ElementAt(1));
  2130. if(posarray.GetSize ()>2)
  2131. dlg.m_path3=m_pPtahArray->ElementAt (posarray.ElementAt(2));
  2132. if(posarray.GetSize ()>3)
  2133. dlg.m_path4=m_pPtahArray->ElementAt (posarray.ElementAt(3));
  2134. dlg.DoModal();
  2135. return;
  2136. }
  2137. if(m_mode2==1)//看设计
  2138. {
  2139. CString title=m_List1.GetItemText (iItem, 0);
  2140. if(title.Find ("Flash")!=-1)
  2141. {
  2142. title.Replace ("Flash", "delgabook");
  2143. CString str=m_path+title+"\\delgaBook.exe";
  2144. ShellExecute(NULL, _T("open"), str, NULL, NULL, SW_SHOWNORMAL);
  2145. return;
  2146. }
  2147. }
  2148. m_showpichwd=NULL;
  2149. ShowPic22 dlg;
  2150. if(m_mode2==1)
  2151. dlg.m_bShowName=1;
  2152. dlg.m_pParent =this;
  2153. dlg.m_pos=iItem;
  2154. if(m_mode2==0 && atoi(g_cominfoarray.ElementAt(0).ElementAt(100)))
  2155. {
  2156. CStringArray array;
  2157. CStringArray arraymsize;
  2158. CStringArray *pArray=GetCurArray();
  2159. array.Copy(*pArray);
  2160. for(int i=0; i<array.GetSize(); i++)
  2161. {
  2162. CString str=array.ElementAt(i);
  2163. CString spath=str.Left (str.ReverseFind ('\\')+1);
  2164. spath+="m";
  2165. spath+=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  2166. if(::PathFileExists(spath))
  2167. arraymsize.Add(spath);
  2168. else
  2169. arraymsize.Add(str);
  2170. }
  2171. dlg.m_pPathArray=&arraymsize;
  2172. dlg.m_pPathArrayBigsize=&array;
  2173. dlg.DoModal ();
  2174. }
  2175. else
  2176. {
  2177. dlg.m_pPathArray=GetCurArray();
  2178. dlg.DoModal ();
  2179. }
  2180. m_showpichwd=NULL;
  2181. }
  2182. void ChoosePhotoSkin2::OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult)
  2183. {
  2184. // TODO: Add your control notification handler code here
  2185. OnDblclkList1();
  2186. *pResult = 0;
  2187. }
  2188. CString GetModifyTime2(CString path)
  2189. {
  2190. HANDLE hFile;
  2191. WIN32_FIND_DATA wfd;
  2192. SYSTEMTIME systime;
  2193. FILETIME localtime;
  2194. CString stime; //输出时间
  2195. memset(&wfd, 0, sizeof(wfd));
  2196. if((hFile=FindFirstFile(path, &wfd))==INVALID_HANDLE_VALUE)
  2197. return "";
  2198. //ok,转换时间
  2199. FileTimeToLocalFileTime(&wfd.ftLastWriteTime,&localtime);
  2200. FileTimeToSystemTime(&localtime,&systime);
  2201. stime.Format("%4d%02d%02d",
  2202. systime.wYear,systime.wMonth,systime.wDay);
  2203. return stime;
  2204. }
  2205. BOOL ChoosePhotoSkin2::GetData()//选片模式;
  2206. {
  2207. m_List2.DeleteAllItems ();
  2208. m_List3.DeleteAllItems ();
  2209. m_noarray.RemoveAll ();
  2210. m_no2array.RemoveAll ();
  2211. #ifdef CHILD_VERSION
  2212. CString filter="id='"+m_strOrderNumber+"';id='"+m_strOrderNumber+"';;id='"+m_strOrderNumber+"'";
  2213. if(m_seltxname!="" && m_seltxname!="全部")
  2214. {
  2215. filter="id='"+m_strOrderNumber+"' and growthtxname='"+m_seltxname+"';id='"+m_strOrderNumber+"';;id='"+m_strOrderNumber+"'";
  2216. }
  2217. #else
  2218. CString filter="id='"+m_strOrderNumber+"' and kind<>'2';id='"+m_strOrderNumber+"';;id='"+m_strOrderNumber+"'";
  2219. #endif
  2220. g_sendhead.code[0]=50;
  2221. g_sendhead.code[1]=11;
  2222. g_sendhead.code[2]=4;
  2223. g_sendhead.code[3]=182;
  2224. g_sendhead.tabcount=4;
  2225. g_sendhead.bsql=0;
  2226. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return 0;
  2227. CArray<CStringArray, CStringArray>sparray;
  2228. DataToArray(&sparray, &g_List1array, &m_sparray, &oldsparray);
  2229. m_patharray2.RemoveAll ();
  2230. CString str,kind;
  2231. int nchoosezs=0;
  2232. int list2pos=0;
  2233. int list3pos=0;
  2234. CString savepath;
  2235. savepath.Format ("%s\\%s.dat", g_mainpath, m_strOrderNumber);
  2236. CString stm1=GetModifyTime2(savepath);
  2237. CTime tm1=CTime::GetCurrentTime ();
  2238. tm1-=CTimeSpan(2, 0, 0, 0);
  2239. CString stm2=tm1.Format ("%Y%m%d");
  2240. BOOL bLoadHistory=0;
  2241. if(::CheckFileExist (savepath) && stm1>stm2)
  2242. {
  2243. if(AfxMessageBox("提醒:请谨慎操作\r\n上次选片未正常退出, 是否还原到上次选片状态?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  2244. bLoadHistory=1;
  2245. }
  2246. if(bLoadHistory)
  2247. {
  2248. CArray<CStringArray, CStringArray>List1array;
  2249. CFile fp;
  2250. fp.Open (savepath, CFile::modeRead);
  2251. DWORD nMessageLen=fp.GetLength ();
  2252. BYTE *szChatMessage = new BYTE[nMessageLen];
  2253. fp.Read (szChatMessage, nMessageLen);
  2254. fp.Close ();
  2255. int count;
  2256. memcpy(&count, szChatMessage+(nMessageLen-sizeof(int)), sizeof(int));
  2257. CMemFile memfile;
  2258. memfile.Attach (szChatMessage, nMessageLen);
  2259. CArchive ar(&memfile, CArchive::load);
  2260. List1array.SetSize(count);
  2261. int i = 0;
  2262. for( i=0; i<List1array.GetSize (); i++)
  2263. {
  2264. List1array.ElementAt (i).Serialize (ar);
  2265. }
  2266. ar.Close();
  2267. memfile.Detach ();
  2268. delete []szChatMessage;
  2269. list2pos=0;
  2270. list3pos=0;
  2271. for( i=0; i<List1array.GetSize (); i++)
  2272. {
  2273. if(0)//List1array.ElementAt (i).GetSize ()==6)
  2274. {
  2275. kind="0";
  2276. m_List2.InsertItem(list2pos, List1array.ElementAt (i).ElementAt (1));
  2277. m_List2.SetItemText(list2pos, 1, List1array.ElementAt (i).ElementAt (2));
  2278. m_List2.SetItemText(list2pos, 2, List1array.ElementAt (i).ElementAt (3));
  2279. m_List2.SetItemText(list2pos, 3, List1array.ElementAt (i).ElementAt (4));
  2280. m_List2.SetItemText(list2pos, 4, List1array.ElementAt (i).ElementAt (5));
  2281. str=List1array.ElementAt (i).ElementAt (5);
  2282. list2pos++;
  2283. }
  2284. else
  2285. {
  2286. kind="4";
  2287. m_List3.InsertItem(list3pos, List1array.ElementAt (i).ElementAt (1));
  2288. m_List3.SetItemText(list3pos, 1, List1array.ElementAt (i).ElementAt (2));
  2289. m_List3.SetItemText(list3pos, 2, List1array.ElementAt (i).ElementAt (3));
  2290. m_List3.SetItemText(list3pos, 3, List1array.ElementAt (i).ElementAt (4));
  2291. m_List3.SetItemText(list3pos, 4, List1array.ElementAt (i).ElementAt (5));
  2292. m_List3.SetItemText(list3pos, 5, List1array.ElementAt (i).ElementAt (6));
  2293. #ifdef LKAY_VERSION
  2294. m_List3.SetItemText(list3pos, 6, List1array.ElementAt (i).ElementAt (7));
  2295. m_List3.SetItemText(list3pos, 7, List1array.ElementAt (i).ElementAt (8));
  2296. str=List1array.ElementAt (i).ElementAt (8);
  2297. #else
  2298. str=List1array.ElementAt (i).ElementAt (6);
  2299. #endif
  2300. list3pos++;
  2301. }
  2302. nchoosezs+=GetZS(str);
  2303. GetPath(str);
  2304. if(!str.IsEmpty ())
  2305. str=","+str+",";
  2306. str.MakeLower ();
  2307. if(kind=="4")
  2308. m_no2array.Add (str);
  2309. else
  2310. m_noarray.Add (str);
  2311. }
  2312. }
  2313. else
  2314. {
  2315. for(int i=0; i<sparray.GetSize (); i++)
  2316. {
  2317. kind="4";//sparray.ElementAt (i).ElementAt (4);
  2318. if(kind=="4")
  2319. {
  2320. m_List3.InsertItem(list3pos, sparray.ElementAt (i).ElementAt (7));
  2321. m_List3.SetItemText(list3pos, 1, sparray.ElementAt (i).ElementAt (1));
  2322. m_List3.SetItemText(list3pos, 2, sparray.ElementAt (i).ElementAt (5));
  2323. m_List3.SetItemText(list3pos, 3, sparray.ElementAt (i).ElementAt (2));
  2324. m_List3.SetItemText(list3pos, 4, sparray.ElementAt (i).ElementAt (3));
  2325. #ifdef LKAY_VERSION
  2326. m_List3.SetItemText(list3pos, 5, sparray.ElementAt (i).ElementAt (9));
  2327. m_List3.SetItemText(list3pos, 6, sparray.ElementAt (i).ElementAt (10));
  2328. m_List3.SetItemText(list3pos, 7, sparray.ElementAt (i).ElementAt (6));
  2329. #else
  2330. m_List3.SetItemText(list3pos, 5, sparray.ElementAt (i).ElementAt (6));
  2331. #endif
  2332. list3pos++;
  2333. }
  2334. else
  2335. {
  2336. m_List2.InsertItem(list2pos, sparray.ElementAt (i).ElementAt (7));
  2337. m_List2.SetItemText(list2pos, 1, sparray.ElementAt (i).ElementAt (1));
  2338. m_List2.SetItemText(list2pos, 2, sparray.ElementAt (i).ElementAt (5));
  2339. m_List2.SetItemText(list2pos, 3, sparray.ElementAt (i).ElementAt (3));
  2340. m_List2.SetItemText(list2pos, 4, sparray.ElementAt (i).ElementAt (6));
  2341. list2pos++;
  2342. }
  2343. str=sparray.ElementAt (i).ElementAt (6);
  2344. str.MakeLower ();
  2345. nchoosezs+=GetZS(str);
  2346. GetPath(str);
  2347. if(!str.IsEmpty ())
  2348. str=","+str+",";
  2349. if(kind=="4")
  2350. m_no2array.Add (str);
  2351. else
  2352. m_noarray.Add (str);
  2353. }
  2354. CheckForAlbum();
  2355. CheckForDisk();
  2356. }
  2357. if(g_List1array.GetSize())
  2358. {
  2359. m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  2360. m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  2361. m_phone1 = g_List1array.ElementAt (0).ElementAt (61);
  2362. m_phone2 = g_List1array.ElementAt (0).ElementAt (62);
  2363. if(!m_name1.IsEmpty ())
  2364. m_name=m_name1+",";
  2365. m_name+=m_name2;
  2366. m_name.TrimRight (",");
  2367. m_waiter3 = g_user.name ;
  2368. m_taoxizs = g_List1array.ElementAt (0).ElementAt (9);
  2369. m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  2370. m_takezs = g_List1array.ElementAt (0).ElementAt (23);
  2371. m_choosezs = g_List1array.ElementAt (0).ElementAt (24);
  2372. m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  2373. m_oldmoney3=m_money3;
  2374. m_bz3 = g_List1array.ElementAt (0).ElementAt (39);
  2375. m_bz4 = g_List1array.ElementAt (0).ElementAt (75);
  2376. m_urgent = g_List1array.ElementAt (0).ElementAt (40);
  2377. m_delphotos = g_List1array.ElementAt (0).ElementAt (53); // Jeff开始选片时,获取dindan表的字段delphotos.读取正常。
  2378. m_time6 = g_List1array.ElementAt (0).ElementAt (48);
  2379. m_time5old=m_time5;
  2380. m_time6old=m_time6;
  2381. taoxiname = g_List1array.ElementAt (0).ElementAt (7);
  2382. m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  2383. m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  2384. m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  2385. m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  2386. ren = g_List1array.ElementAt (0).ElementAt (14);
  2387. m_size= g_List1array.ElementAt (0).ElementAt (60);
  2388. m_checkstatus= g_List1array.ElementAt (0).ElementAt (32);
  2389. UpdateData(false);
  2390. }
  2391. else
  2392. {
  2393. m_name1 = "";
  2394. m_name2 = "";
  2395. m_waiter3 = "";
  2396. m_taoxizs = "";
  2397. m_time5 = "";
  2398. m_takezs = "";
  2399. m_choosezs = "";
  2400. m_money3 = "";
  2401. m_bz3 = "";
  2402. m_bz4 = "";
  2403. m_urgent = "";
  2404. UpdateData(false);
  2405. }
  2406. return 1;
  2407. }
  2408. void ChoosePhotoSkin2::OnOK()
  2409. {
  2410. // TODO: Add extra validation here
  2411. }
  2412. void ChoosePhotoSkin2::OnCancel()
  2413. {
  2414. // TODO: Add extra cleanup here
  2415. }
  2416. void ChoosePhotoSkin2::OnClose()
  2417. {
  2418. // TODO: Add your message handler code here and/or call default
  2419. if(m_bModify)
  2420. {
  2421. if(AfxMessageBox("提醒, 选片修改未保存, 是否保存后再退出?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  2422. {
  2423. OnButton4();
  2424. }
  2425. }
  2426. CDialog::OnCancel();
  2427. }
  2428. BOOL ChoosePhotoSkin2::PreTranslateMessage(MSG* pMsg)
  2429. {
  2430. // TODO: Add your specialized code here and/or call the base class
  2431. if(pMsg->message==WM_LBUTTONDOWN)
  2432. {
  2433. g_bNeedDrawParent=2;
  2434. if(0)
  2435. {//list3
  2436. CPoint pt;
  2437. CRect rc,rc2;
  2438. ::GetCursorPos (&pt);
  2439. m_List3.GetWindowRect (rc2);
  2440. if(rc2.PtInRect (pt)==0) return CDialog::PreTranslateMessage(pMsg);
  2441. SetTimer(3, 300, NULL);
  2442. }
  2443. }
  2444. /* else if(pMsg->message==WM_PAINT && pMsg->hwnd ==this->m_hWnd )
  2445. {
  2446. SetTimer(1, 100, NULL);
  2447. }
  2448. else if(pMsg->message==WM_TIMER&& pMsg->hwnd ==this->m_hWnd)
  2449. {
  2450. KillTimer(1);
  2451. DrawLogin();
  2452. }*/
  2453. else if(0)//pMsg->message==WM_LBUTTONDBLCLK)
  2454. {
  2455. {//list1
  2456. CPoint pt;
  2457. CRect rc,rc2;
  2458. ::GetCursorPos (&pt);
  2459. m_List2.GetWindowRect (rc2);
  2460. if(rc2.PtInRect (pt))
  2461. return 1;
  2462. }
  2463. {//list3
  2464. CPoint pt;
  2465. CRect rc,rc2;
  2466. ::GetCursorPos (&pt);
  2467. m_List3.GetWindowRect (rc2);
  2468. if(rc2.PtInRect (pt)==0)return CDialog::PreTranslateMessage(pMsg);
  2469. pt.x-=rc2.left ;
  2470. pt.y-=rc2.top ;
  2471. int iItem=m_List3.GetItemCount ()-1;
  2472. if(iItem<0)
  2473. {
  2474. m_List3.GetHeaderCtrl()->GetItemRect (0, rc);
  2475. int hei=rc.Height ();
  2476. rc.top +=hei;
  2477. rc.bottom +=hei;
  2478. if(rc.PtInRect (pt))
  2479. {
  2480. m_List3.InsertItem(m_List3.GetItemCount (), "");
  2481. }
  2482. }
  2483. else
  2484. {
  2485. m_List3.GetSubItemRect( iItem, 0, LVIR_BOUNDS, rc);
  2486. int hei=rc.Height ();
  2487. rc.top +=hei;
  2488. rc.bottom +=hei;
  2489. if(rc.PtInRect (pt))
  2490. {
  2491. if(m_List3.GetItemText (iItem, 1).IsEmpty ()&&m_List3.GetItemText (iItem, 2).IsEmpty ())
  2492. return CDialog::PreTranslateMessage(pMsg);
  2493. m_List3.InsertItem(m_List3.GetItemCount (), "");
  2494. }
  2495. POSITION pos;
  2496. pos=m_List3.GetFirstSelectedItemPosition();
  2497. if(pos)
  2498. {
  2499. iItem=m_List3.GetNextSelectedItem(pos);
  2500. m_List3.GetSubItemRect( iItem, 4, LVIR_BOUNDS, rc);
  2501. if(rc.PtInRect (pt))return 1;
  2502. }
  2503. }
  2504. }
  2505. }
  2506. else if(pMsg->message==WM_KEYDOWN)
  2507. {
  2508. if(m_showpichwd)return 1;
  2509. switch (pMsg->wParam)
  2510. {
  2511. case VK_DELETE:
  2512. OnDel();
  2513. return 1;
  2514. case VK_RETURN:
  2515. OnDblclkList1();
  2516. return 1;
  2517. case VK_F4:
  2518. if(m_mode2 && m_bChooseBig==0)return 1;
  2519. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(62)))
  2520. {
  2521. if(m_mode==1)UpdateChooseZS();
  2522. SortArray();
  2523. }
  2524. return 1;
  2525. case VK_F5:
  2526. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(86)))
  2527. {
  2528. OnBtnClick(0, 99+4);
  2529. }
  2530. /* if(m_mode2==0)return 1;
  2531. {
  2532. ReplaceDesignNo dlg;
  2533. dlg.m_id=this->m_id ;
  2534. dlg.DoModal ();
  2535. }*/
  2536. return 1;
  2537. case VK_F1:
  2538. {
  2539. if(m_selphotownd2.GetSafeHwnd ()==NULL)
  2540. {
  2541. m_selphotownd2.m_id=m_strOrderNumber;
  2542. m_selphotownd2.m_rc=m_rcarray.ElementAt (6);
  2543. m_selphotownd2.Create (IDD_DLGShowSelPhoto2, this);
  2544. }
  2545. m_selphotownd2.ShowWindow (1);
  2546. }
  2547. return 1;
  2548. case VK_F2:
  2549. if(m_mode2 && m_bChooseBig==0)return 1;
  2550. if(0)
  2551. {
  2552. return 1;
  2553. CStringArray array;
  2554. for(int i=0; i<m_List2.GetItemCount (); i++)
  2555. {
  2556. if(m_List2.GetItemText (i, 4).IsEmpty ()==0)
  2557. {
  2558. array.Add ( m_List2.GetItemText (i, 0) );
  2559. array.Add ( m_List2.GetItemText (i, 4) );
  2560. }
  2561. }
  2562. if(array.GetSize ()==0)return 1;
  2563. ChoosePhotoSkin2 dlg;
  2564. dlg.SetLiaPath ("3.lia");
  2565. dlg.m_strOrderNumber=m_strOrderNumber;
  2566. dlg.m_pArray=&array;
  2567. dlg.m_path=g_path2+"\\";
  2568. dlg.m_path+=dlg.m_strOrderNumber;
  2569. dlg.m_path +="\\";
  2570. dlg.DoModal ();
  2571. return 1;
  2572. }
  2573. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(60)))
  2574. {
  2575. m_bHide=!m_bHide;
  2576. LoadPhotos();
  2577. }
  2578. return 1;
  2579. case VK_F6:
  2580. {
  2581. if(m_mode2)
  2582. {
  2583. ReplaceDesignNo dlg;
  2584. dlg.m_id=this->m_strOrderNumber ;
  2585. dlg.DoModal ();
  2586. }
  2587. }
  2588. return 1;
  2589. }
  2590. }
  2591. return CDialog::PreTranslateMessage(pMsg);
  2592. }
  2593. void ChoosePhotoSkin2::OnRclickList1()// 右键选片模式;
  2594. {
  2595. // 1.Jeff:看设计模式;
  2596. if(m_mode2)
  2597. {
  2598. OnRclickList2();
  2599. return;
  2600. }
  2601. // 2.Jeff:开始选片模式;
  2602. if(m_bRunning)return;
  2603. POSITION pos;
  2604. pos=m_List1.GetFirstSelectedItemPosition();
  2605. if(pos==NULL)
  2606. {
  2607. return;
  2608. }
  2609. int iItem=m_List1.GetNextSelectedItem(pos);
  2610. CString scount;
  2611. // .获取当前查看的相片;
  2612. CStringArray *pArray=GetCurArray();
  2613. CString path=pArray->ElementAt (iItem);
  2614. path=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  2615. path=path.Left (path.ReverseFind ('.'));
  2616. if(m_mode2)// Jeff:第1步时就退出了,这里判断有意义????? 这一段代码永远不会执行;
  2617. {
  2618. if(!CheckName(path))
  2619. {
  2620. CMenuXP *pPopup;
  2621. pPopup = new CMenuXP;
  2622. pPopup->CYBUTTONMARGIN=3;
  2623. pPopup->CreatePopupMenu();
  2624. pPopup->SetMenuStyle(CMenuXP::STYLE_XP);
  2625. pPopup->AppendODMenu2(0, new CMenuXPText(32794, "修改要求", NULL));
  2626. CPoint pt;
  2627. ::GetCursorPos (&pt);
  2628. pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this, 0);
  2629. delete pPopup;
  2630. return;
  2631. }
  2632. }
  2633. path=","+path+",";
  2634. // TODO: Add your control notification handler code here
  2635. CMenuXP *pPopup;
  2636. pPopup = new CMenuXP;
  2637. pPopup->CYBUTTONMARGIN=3;
  2638. pPopup->CreatePopupMenu();
  2639. pPopup->SetMenuStyle(CMenuXP::STYLE_XP);
  2640. int i = 0;
  2641. int maxleng=1;
  2642. {
  2643. CString name,no;
  2644. int count=0;
  2645. for( i=0; i<m_List2.GetItemCount (); i++)
  2646. {
  2647. name=m_List2.GetItemText (i, 2);
  2648. // Jeff,no里为商品名称选中的相片
  2649. no=m_noarray.ElementAt(i);
  2650. maxleng=max(maxleng, name.GetLength ());
  2651. }
  2652. count=i;
  2653. for(; i<count+m_no2array.GetSize (); i++)
  2654. {
  2655. name=m_List3.GetItemText (i-count, 2);
  2656. maxleng=max(maxleng, name.GetLength ());
  2657. }
  2658. }
  2659. maxleng+=3;
  2660. CString name,no;
  2661. int count=0;
  2662. for( i=0; i<m_List2.GetItemCount (); i++)
  2663. {
  2664. name=m_List2.GetItemText (i, 2);
  2665. ::FillLength (name, maxleng);
  2666. // Jeff,no里为商品名称选中的相片
  2667. no=m_noarray.ElementAt (i);
  2668. GetSelCountFromName(no,scount);
  2669. pPopup->AppendODMenu2(0, new CMenuXPText(IDM_MENUsp1+i, name+scount, NULL));
  2670. if(no.Find (path)!=-1)
  2671. pPopup->CheckMenuItem(IDM_MENUsp1+i, MF_BYCOMMAND | MF_CHECKED);
  2672. }
  2673. count=i;
  2674. for(; i<count+m_no2array.GetSize(); i++)
  2675. {
  2676. name=m_List3.GetItemText (i-count, 2);
  2677. ::FillLength (name, maxleng);
  2678. no=m_no2array.ElementAt (i-count);
  2679. GetSelCountFromName(no,scount);
  2680. pPopup->AppendODMenu2(0, new CMenuXPText(IDM_MENUsp1+i, name+scount, NULL));
  2681. if(no.Find (path)!=-1)
  2682. pPopup->CheckMenuItem(IDM_MENUsp1+i, MF_BYCOMMAND | MF_CHECKED);
  2683. }
  2684. pPopup->AppendODMenu2(0, new CMenuXPText(32794, "修改要求", NULL));
  2685. CPoint pt;
  2686. ::GetCursorPos (&pt);
  2687. pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this, 0);
  2688. delete pPopup;
  2689. }
  2690. void ChoosePhotoSkin2::OnRclickList2()// 右键看设计模式;
  2691. {
  2692. if(m_bRunning)return;
  2693. POSITION pos;
  2694. pos=m_List1.GetFirstSelectedItemPosition();
  2695. if(pos==NULL)
  2696. {
  2697. return;
  2698. }
  2699. int iItem=m_List1.GetNextSelectedItem(pos);
  2700. CString scount;
  2701. CStringArray *pArray=GetCurArray(); //获取当前查看的内容;
  2702. CString path=pArray->ElementAt(iItem); //path//打印出相片完整路径名;
  2703. if(m_bChooseBig)//选放大
  2704. path=path.Right(path.GetLength()-path.ReverseFind('\\')-1);
  2705. else//选设计
  2706. path=path.Right(path.GetLength()-m_path.GetLength());
  2707. path=path.Left(path.ReverseFind('.'));
  2708. path=","+path+","; //
  2709. // TODO: Add your control notification handler code here
  2710. // 1.创建菜单对象;
  2711. CMenuXP *pPopup;
  2712. pPopup = new CMenuXP;
  2713. pPopup->CYBUTTONMARGIN=3; // 1.0.按钮范围0~3; 4个菜单;
  2714. pPopup->CreatePopupMenu(); // 1.1.弹出式菜单;
  2715. pPopup->SetMenuStyle(CMenuXP::STYLE_XP);// 1.2.弹出菜单样式;
  2716. // Jeff:m_List2有三列头:编号、商品名称、商品数量;
  2717. int i = 0;
  2718. int maxleng=1;
  2719. {
  2720. CString name,no;
  2721. int count=0;
  2722. for( i=0; i<m_List2.GetItemCount (); i++)
  2723. {
  2724. // name商品名称
  2725. name=m_List2.GetItemText(i, 2);
  2726. no=m_noarray.ElementAt(i);
  2727. maxleng=max(maxleng, name.GetLength ());
  2728. }
  2729. count=i;
  2730. for(; i<count+m_no2array.GetSize(); i++)
  2731. {
  2732. name=m_List3.GetItemText(i-count, 2);
  2733. maxleng=max(maxleng, name.GetLength ());
  2734. }
  2735. }
  2736. maxleng+=3;
  2737. // Jeff:m_List2有三列头:编号、商品名称、商品数量;
  2738. CString name,no;
  2739. int count=0;
  2740. for( i=0; i<m_List2.GetItemCount(); i++)
  2741. {
  2742. name=m_List2.GetItemText(i, 2);
  2743. ::FillLength(name, maxleng);// Jeff:有这样的API函数么???怎么查也查不到
  2744. no=m_noarray.ElementAt(i);
  2745. GetSelCountFromName(no,scount);
  2746. pPopup->AppendODMenu2(0, new CMenuXPText(IDM_MENUsp1+i, name+scount, NULL));// 2.使用AppendODMenu2添加子菜单项;
  2747. if(no.Find (path)!=-1)
  2748. pPopup->CheckMenuItem(IDM_MENUsp1+i, MF_BYCOMMAND | MF_CHECKED);
  2749. }
  2750. count=i;
  2751. for(; i<count+m_no2array.GetSize(); i++)
  2752. {
  2753. name=m_List3.GetItemText(i-count, 2);
  2754. ::FillLength(name, maxleng);
  2755. no=m_no2array.ElementAt(i-count);
  2756. GetSelCountFromName(no,scount);
  2757. pPopup->AppendODMenu2(0, new CMenuXPText(IDM_MENUsp1+i, name+scount, NULL));
  2758. if(no.Find (path)!=-1)
  2759. pPopup->CheckMenuItem(IDM_MENUsp1+i, MF_BYCOMMAND | MF_CHECKED);
  2760. }
  2761. pPopup->AppendODMenu2(0, new CMenuXPText(32794, "修改要求", NULL));
  2762. CPoint pt;
  2763. ::GetCursorPos (&pt);
  2764. pPopup->TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this, 0);// 3.使用TrackPopupMenu,正常弹出菜单;
  2765. delete pPopup;
  2766. }
  2767. void ChoosePhotoSkin2::OnRclickList1(NMHDR* pNMHDR, LRESULT* pResult)
  2768. {
  2769. if( m_showpichwd)return;
  2770. OnRclickList1();
  2771. *pResult = 0;
  2772. }
  2773. void SortArray2(CArray<int,int>&datearray)
  2774. {
  2775. int strtemp;
  2776. int last = datearray.GetSize () - 1;
  2777. bool sorted = true;
  2778. do {
  2779. sorted = true;
  2780. for (int i = 0; i < last; i++)
  2781. {
  2782. if (datearray[i] < datearray[i + 1])
  2783. {
  2784. strtemp = datearray[i];
  2785. datearray[i] = datearray[i + 1];
  2786. datearray[i + 1] = strtemp;
  2787. sorted = false;
  2788. }
  2789. }
  2790. last--;
  2791. } while (!sorted);
  2792. }
  2793. void ChoosePhotoSkin2::OnCommandMenu(UINT nID)//弹出菜单处理;
  2794. {
  2795. if(m_mode2)//看设计;
  2796. {
  2797. OnCommandMenu2(nID);
  2798. return;
  2799. }
  2800. if(32794==nID)
  2801. {
  2802. if(m_mode2)//Jeff不会执行的代码;
  2803. {
  2804. OnButton4();
  2805. }
  2806. else
  2807. {
  2808. POSITION pos;
  2809. pos=m_List1.GetFirstSelectedItemPosition();
  2810. if(pos==NULL)
  2811. {
  2812. return;
  2813. }
  2814. int iItem=m_List1.GetNextSelectedItem(pos);
  2815. CStringArray *pArray=GetCurArray();
  2816. CString path=pArray->ElementAt (iItem);
  2817. path=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  2818. path=path.Left (path.Find ('.'));
  2819. if(m_bz4.GetLength()>4080)
  2820. {
  2821. AfxMessageBox("备注太长,可在保存界面选中备注内容,按Delete键清除");
  2822. return;
  2823. }
  2824. UpdateData();
  2825. CClientRequirement dlg;
  2826. dlg.m_no="当前照片:"+path;
  2827. // dlg.m_bz2=m_bz3;
  2828. CString header,left,right,cur;
  2829. header=path+":";
  2830. int pos2=m_bz4.Find(header);
  2831. if(pos2!=-1)
  2832. {
  2833. left=m_bz4.Left(pos2);
  2834. m_bz4=m_bz4.Right(m_bz4.GetLength()-pos2);
  2835. pos2=m_bz4.Find(" ");
  2836. if(pos2!=-1)
  2837. {
  2838. cur=m_bz4.Left(pos2);
  2839. int pos3=cur.Find(":");
  2840. if(pos3!=-1)
  2841. cur=cur.Right(cur.GetLength()-pos3-1);
  2842. right=m_bz4.Right(m_bz4.GetLength()-pos2-2);
  2843. }
  2844. }
  2845. else
  2846. left=m_bz4;
  2847. dlg.m_bz2=cur;
  2848. dlg.m_bSave =0;
  2849. dlg.m_nMode =2;
  2850. if(dlg.DoModal ()==IDOK)
  2851. {
  2852. // m_bz3=dlg.m_bz2 ;
  2853. dlg.m_bz2.TrimLeft();
  2854. dlg.m_bz2.TrimRight();
  2855. if(dlg.m_bz2!="")
  2856. cur=header+dlg.m_bz2+" " ;
  2857. else
  2858. cur="";
  2859. m_bz4=left+cur+right;
  2860. UpdateData(false);
  2861. }
  2862. else
  2863. {
  2864. if(cur!="")
  2865. m_bz4=left+header+cur+" "+right;
  2866. else
  2867. m_bz4=left+right;
  2868. }
  2869. }
  2870. return;
  2871. }
  2872. POSITION pos;
  2873. pos=m_List1.GetFirstSelectedItemPosition();
  2874. if(pos==NULL)
  2875. {
  2876. return;
  2877. }
  2878. CString temp;
  2879. m_combo1.ResetContent ();
  2880. int aa=0;
  2881. while(pos)
  2882. {
  2883. // if(aa && m_mode==1)break;//m_mode=1查看选中
  2884. // if(aa && m_mode==2)break;
  2885. aa++;
  2886. int iItem=m_List1.GetNextSelectedItem(pos);
  2887. CStringArray *pArray=GetCurArray();
  2888. CString path=pArray->ElementAt (iItem);
  2889. path=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  2890. path=path.Left (path.ReverseFind ('.'));
  2891. path=","+path+",";
  2892. int idpos=nID-IDM_MENUsp1;
  2893. BOOL bSel=0;//选中还是取消
  2894. if(idpos<m_noarray.GetSize ())
  2895. {
  2896. CString no=m_noarray.ElementAt (idpos);
  2897. if(no.Find (path)!=-1)
  2898. {
  2899. int pos=no.Find (path);
  2900. no.Delete (pos, path.GetLength ()-1);
  2901. }
  2902. else if(no.GetLength()>4000)
  2903. {
  2904. AfxMessageBox("编号太长,选择失败!", MB_ICONSTOP);return;
  2905. }
  2906. else
  2907. {
  2908. bSel=1;
  2909. no.TrimRight (",");
  2910. no+=path;
  2911. }
  2912. no.TrimLeft (",");
  2913. no.TrimRight (",");
  2914. m_List2.SetItemText (idpos, 4, no);
  2915. if(no.IsEmpty ())
  2916. m_noarray.SetAt (idpos, no);
  2917. else
  2918. m_noarray.SetAt (idpos, ","+no+",");
  2919. }
  2920. else
  2921. {
  2922. idpos-=m_noarray.GetSize ();
  2923. CString no=m_no2array.ElementAt (idpos);
  2924. if(no.Find (path)!=-1)
  2925. {
  2926. int pos=no.Find (path);
  2927. no.Delete (pos, path.GetLength ()-1);
  2928. }
  2929. else if(no.GetLength()>4000)
  2930. {
  2931. AfxMessageBox("编号太长,选择失败!", MB_ICONSTOP);return;
  2932. }
  2933. else
  2934. {
  2935. bSel=1;
  2936. no.TrimRight (",");
  2937. no+=path;
  2938. }
  2939. no.TrimLeft (",");
  2940. no.TrimRight (",");
  2941. #ifdef LKAY_VERSION
  2942. m_List3.SetItemText (idpos, 7, no);
  2943. #else
  2944. m_List3.SetItemText (idpos, 5, no);
  2945. #endif
  2946. if(no.IsEmpty ())
  2947. m_no2array.SetAt (idpos, no);
  2948. else
  2949. m_no2array.SetAt (idpos, ","+no+",");
  2950. }
  2951. m_bModify=1;
  2952. if(bSel==0 && m_mode==1 && IsSelPhoto(path)==0)
  2953. {
  2954. temp.Format("%d", iItem);
  2955. m_combo1.AddString (temp);
  2956. continue;
  2957. }
  2958. else if(bSel==1 && m_mode==2)
  2959. {
  2960. temp.Format("%d", iItem);
  2961. m_combo1.AddString (temp);
  2962. continue;
  2963. }
  2964. else if(bSel==1 && m_mode==3)
  2965. {
  2966. temp.Format("%d", iItem);
  2967. m_combo1.AddString (temp);
  2968. continue;
  2969. }
  2970. else if(bSel==0 && m_mode==4 && IsSelAlbumPhoto(path)==0)
  2971. {
  2972. temp.Format("%d", iItem);
  2973. m_combo1.AddString (temp);
  2974. continue;
  2975. }
  2976. else if(bSel==0 && m_mode==5 && IsSelDiskPhoto(path)==0)
  2977. {
  2978. temp.Format("%d", iItem);
  2979. m_combo1.AddString (temp);
  2980. continue;
  2981. }
  2982. /////////////////////////
  2983. CString no,dir;
  2984. no=pArray->ElementAt (iItem);
  2985. if(m_mode2)
  2986. {
  2987. if(no.Left (no.ReverseFind ('\\')+1)!=m_path)
  2988. {
  2989. dir=no.Left (no.ReverseFind ('\\')+1);
  2990. dir= dir.Right (dir.GetLength ()-m_path.GetLength ());
  2991. }
  2992. }
  2993. no=no.Right (no.GetLength ()-no.ReverseFind ('\\')-1);
  2994. no=no.Left (no.ReverseFind ('.'));
  2995. no+=GetSelName(no);
  2996. m_List1.SetItemText (iItem, 0, dir+no);
  2997. }
  2998. CArray<int,int>posarray;
  2999. for(int i=m_combo1.GetCount ()-1; i>=0; i--)
  3000. {
  3001. m_combo1.GetLBText (i, temp);
  3002. posarray.Add(atoi(temp));
  3003. }
  3004. SortArray2(posarray);
  3005. if(posarray.GetSize ())
  3006. {
  3007. if(m_mode==1)
  3008. {
  3009. for(int i=0; i<posarray.GetSize(); i++)
  3010. {
  3011. m_List1.DeleteItem(posarray.ElementAt(i));
  3012. m_patharray3.Add(m_patharray2.ElementAt (posarray.ElementAt(i)));
  3013. m_patharray2.RemoveAt(posarray.ElementAt(i));
  3014. }
  3015. if( m_showpichwd)
  3016. ::SendMessage (m_showpichwd, WM_CLOSE, 0, 0);
  3017. }
  3018. else if(m_mode==2)
  3019. {
  3020. for(int i=0; i<posarray.GetSize(); i++)
  3021. {
  3022. m_List1.DeleteItem (posarray.ElementAt(i));
  3023. m_patharray3.RemoveAt (posarray.ElementAt(i));
  3024. }
  3025. if( m_showpichwd)
  3026. ::SendMessage (m_showpichwd, WM_CLOSE, 0, 0);
  3027. }
  3028. else if(m_mode==3)
  3029. {
  3030. for(int i=0; i<posarray.GetSize(); i++)
  3031. {
  3032. m_List1.DeleteItem (posarray.ElementAt(i));
  3033. m_patharray1.Add (m_patharray4.ElementAt (posarray.ElementAt(i)));
  3034. m_patharray4.RemoveAt (posarray.ElementAt(i));
  3035. }
  3036. if( m_showpichwd)
  3037. ::SendMessage (m_showpichwd, WM_CLOSE, 0, 0);
  3038. }
  3039. else if(m_mode==4)
  3040. {
  3041. for(int i=0; i<posarray.GetSize(); i++)
  3042. {
  3043. m_List1.DeleteItem (posarray.ElementAt(i));
  3044. m_patharray5.RemoveAt (posarray.ElementAt(i));
  3045. }
  3046. if( m_showpichwd)
  3047. ::SendMessage (m_showpichwd, WM_CLOSE, 0, 0);
  3048. }
  3049. else if(m_mode==5)
  3050. {
  3051. for(int i=0; i<posarray.GetSize(); i++)
  3052. {
  3053. m_List1.DeleteItem (posarray.ElementAt(i));
  3054. m_patharray6.RemoveAt (posarray.ElementAt(i));
  3055. }
  3056. if( m_showpichwd)
  3057. ::SendMessage (m_showpichwd, WM_CLOSE, 0, 0);
  3058. }
  3059. }
  3060. if(m_mode2==0)
  3061. {
  3062. Save();
  3063. DrawLogin();
  3064. if( m_showpichwd)
  3065. ::SendMessage (m_showpichwd, WM_USER+200, 0, 0);
  3066. }
  3067. }
  3068. void ChoosePhotoSkin2::OnCommandMenu2(UINT nID)//看设计,弹出菜单处理;
  3069. {
  3070. if(32794==nID)// 处理菜单荐:修改要求;
  3071. {
  3072. POSITION pos;
  3073. pos=m_List1.GetFirstSelectedItemPosition();
  3074. if(pos==NULL)
  3075. {
  3076. return;
  3077. }
  3078. int iItem=m_List1.GetNextSelectedItem(pos);
  3079. CStringArray *pArray=GetCurArray();
  3080. CString path=pArray->ElementAt (iItem);
  3081. path=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  3082. path=path.Left (path.Find ('.'));
  3083. UpdateData();
  3084. CClientRequirement dlg;
  3085. dlg.m_no="当前照片:"+path;
  3086. dlg.m_bz2=m_bz3;
  3087. dlg.m_bSave =0;
  3088. dlg.m_nMode =2;
  3089. if(dlg.DoModal ()==IDOK)
  3090. {
  3091. m_bz3=dlg.m_bz2 ;
  3092. UpdateData(false);
  3093. }
  3094. return;
  3095. }
  3096. POSITION pos;
  3097. pos=m_List1.GetFirstSelectedItemPosition();
  3098. if(pos==NULL)
  3099. {
  3100. return;
  3101. }
  3102. CString temp;
  3103. m_combo1.ResetContent();
  3104. int aa=0;
  3105. while(pos) // 开始获取相片;
  3106. {
  3107. // if(aa && m_mode==1)break;
  3108. // if(aa && m_mode==2)break;
  3109. aa++;
  3110. int iItem=m_List1.GetNextSelectedItem(pos);
  3111. CStringArray *pArray=GetCurArray();
  3112. // path:
  3113. CString path=pArray->ElementAt(iItem);
  3114. //AfxMessageBox(path);//Jeff box
  3115. if(m_bChooseBig)//选放大
  3116. path=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  3117. else//选设计
  3118. path=path.Right (path.GetLength ()-m_path.GetLength ());
  3119. path=path.Left (path.ReverseFind ('.'));
  3120. path=","+path+",";
  3121. int idpos=nID-IDM_MENUsp1;
  3122. BOOL bSel=0;//选中还是取消
  3123. if(idpos<m_noarray.GetSize ())
  3124. {
  3125. //MessageBox("1");
  3126. CString no=m_noarray.ElementAt (idpos); // no:为dindansp字段no;
  3127. //AfxMessageBox(no);//Jeff box
  3128. if(no.Find (path)!=-1)
  3129. {
  3130. int pos=no.Find (path);
  3131. no.Delete (pos, path.GetLength ()-1);
  3132. }
  3133. else if(no.GetLength()>4000)
  3134. {
  3135. AfxMessageBox("编号太长,选择失败!", MB_ICONSTOP);return;
  3136. }
  3137. else
  3138. {
  3139. bSel=1;
  3140. no.TrimRight (",");
  3141. no+=path;
  3142. }
  3143. no.TrimLeft (",");
  3144. no.TrimRight (",");
  3145. m_List2.SetItemText (idpos, 4, no);
  3146. if(no.IsEmpty ())
  3147. m_noarray.SetAt (idpos, no);
  3148. else
  3149. m_noarray.SetAt (idpos, ","+no+",");
  3150. }
  3151. else
  3152. {
  3153. idpos-=m_noarray.GetSize ();
  3154. CString no=m_no2array.ElementAt (idpos);
  3155. if(no.Find (path)!=-1)
  3156. {
  3157. int pos=no.Find (path);
  3158. no.Delete (pos, path.GetLength ()-1);
  3159. }
  3160. else if(no.GetLength()>4000)
  3161. {
  3162. AfxMessageBox("编号太长,选择失败!", MB_ICONSTOP);return;
  3163. }
  3164. else
  3165. {
  3166. bSel=1;
  3167. no.TrimRight (",");
  3168. no+=path;
  3169. }
  3170. no.TrimLeft (",");
  3171. no.TrimRight (",");
  3172. #ifdef LKAY_VERSION
  3173. m_List3.SetItemText (idpos, 7, no);
  3174. #else
  3175. m_List3.SetItemText (idpos, 5, no);
  3176. #endif
  3177. if(no.IsEmpty ())
  3178. m_no2array.SetAt (idpos, no);
  3179. else
  3180. m_no2array.SetAt (idpos, ","+no+",");
  3181. }
  3182. m_bModify=1;
  3183. if(bSel==0 && m_mode==1 && IsSelPhoto(path)==0)
  3184. {
  3185. temp.Format("%d", iItem);
  3186. m_combo1.AddString (temp);
  3187. continue;
  3188. }
  3189. else if(bSel==1 && m_mode==2)
  3190. {
  3191. temp.Format("%d", iItem);
  3192. m_combo1.AddString (temp);
  3193. continue;
  3194. }
  3195. else if(bSel==1 && m_mode==3)
  3196. {
  3197. temp.Format("%d", iItem);
  3198. m_combo1.AddString (temp);
  3199. continue;
  3200. }
  3201. /////////////////////////
  3202. CString no,dir;
  3203. no=pArray->ElementAt (iItem);
  3204. if(m_bChooseBig)//选放大
  3205. no=no.Right (no.GetLength ()-no.ReverseFind ('\\')-1);
  3206. else//选设计
  3207. no=no.Right (no.GetLength ()-m_path.GetLength ());
  3208. no=no.Left (no.ReverseFind ('.'));
  3209. no+=GetSelName(no);
  3210. m_List1.SetItemText (iItem, 0, no);
  3211. }
  3212. CArray<int,int>posarray;
  3213. for(int i=m_combo1.GetCount ()-1; i>=0; i--)
  3214. {
  3215. m_combo1.GetLBText (i, temp);
  3216. posarray.Add(atoi(temp));
  3217. }
  3218. SortArray2(posarray);
  3219. if(posarray.GetSize ())
  3220. {
  3221. if(m_mode==1)
  3222. {
  3223. for(int i=0; i<posarray.GetSize(); i++)
  3224. {
  3225. m_List1.DeleteItem (posarray.ElementAt(i));
  3226. m_patharray3.Add (m_patharray2.ElementAt (posarray.ElementAt(i)));
  3227. m_patharray2.RemoveAt (posarray.ElementAt(i));
  3228. }
  3229. if( m_showpichwd)
  3230. ::SendMessage (m_showpichwd, WM_CLOSE, 0, 0);
  3231. }
  3232. else if(m_mode==2)
  3233. {
  3234. for(int i=0; i<posarray.GetSize(); i++)
  3235. {
  3236. m_List1.DeleteItem (posarray.ElementAt(i));
  3237. m_patharray3.RemoveAt (posarray.ElementAt(i));
  3238. }
  3239. if( m_showpichwd)
  3240. ::SendMessage (m_showpichwd, WM_CLOSE, 0, 0);
  3241. }
  3242. else if(m_mode==3)
  3243. {
  3244. for(int i=0; i<posarray.GetSize(); i++)
  3245. {
  3246. m_List1.DeleteItem (posarray.ElementAt(i));
  3247. m_patharray1.Add (m_patharray4.ElementAt (posarray.ElementAt(i)));
  3248. m_patharray4.RemoveAt (posarray.ElementAt(i));
  3249. }
  3250. if( m_showpichwd)
  3251. ::SendMessage (m_showpichwd, WM_CLOSE, 0, 0);
  3252. }
  3253. }
  3254. Save();DrawLogin();
  3255. if( m_showpichwd)
  3256. ::SendMessage (m_showpichwd, WM_USER+200, 0, 0);
  3257. }
  3258. int ChoosePhotoSkin2::GetZS(CString str)
  3259. {
  3260. str.TrimLeft (",");
  3261. str.TrimRight (",");
  3262. if(str.IsEmpty ())return 0;
  3263. int pos=str.Find (',');
  3264. int count=1;
  3265. while(pos!=-1)
  3266. {
  3267. str.Delete (pos);
  3268. pos=str.Find (',');
  3269. count++;
  3270. }
  3271. return count;
  3272. }
  3273. long ChoosePhotoSkin2::UpdateTakeZS(WPARAM inWParam, LPARAM inLParam)
  3274. {
  3275. if(m_mode==0 && m_List1.GetItemCount ()>atoi(m_takezs))
  3276. {
  3277. UpdateData();
  3278. m_takezs.Format ("%d", m_List1.GetItemCount () );
  3279. UpdateData(false);
  3280. }
  3281. DrawLogin();
  3282. return 1;
  3283. }
  3284. void ChoosePhotoSkin2::OnButton1() // null
  3285. {
  3286. // TODO: Add your control notification handler code here
  3287. }
  3288. void ChoosePhotoSkin2::UpdateChooseZS()
  3289. {
  3290. m_patharray2.RemoveAll ();
  3291. CString str;
  3292. int i = 0;
  3293. if(m_sChooseFilter!="" && m_sChooseFilter!="全部")
  3294. {
  3295. for( i=0; i<m_List3.GetItemCount (); i++)
  3296. {
  3297. if(m_List3.GetItemText (i, 2)!=m_sChooseFilter)continue;
  3298. str=m_no2array.ElementAt (i);
  3299. GetPath(str);
  3300. }
  3301. return;
  3302. }
  3303. for( i=0; i<m_noarray.GetSize (); i++)
  3304. {
  3305. str=m_noarray.ElementAt (i);
  3306. GetPath(str);
  3307. }
  3308. for( i=0; i<m_no2array.GetSize (); i++)
  3309. {
  3310. str=m_no2array.ElementAt (i);
  3311. GetPath(str);
  3312. }
  3313. }
  3314. void ChoosePhotoSkin2::OnButton2() //null
  3315. {
  3316. // TODO: Add your control notification handler code here
  3317. }
  3318. void ChoosePhotoSkin2::OnButton3() //null
  3319. {
  3320. // TODO: Add your control notification handler code here
  3321. }
  3322. // 保存按钮;
  3323. void ChoosePhotoSkin2::OnButton4() // 保存按钮;
  3324. {
  3325. // AfxMessageBox("保存按钮");
  3326. // TODO: Add your control notification handler code here
  3327. if(m_mode2==0) //选片时的保存;
  3328. {
  3329. UpdateData();
  3330. if(m_mode!=1)
  3331. {
  3332. CalChooseZS();
  3333. }
  3334. CString zs = m_taoxizs;
  3335. int pos=zs.Find ("\\");
  3336. if(pos!=-1)
  3337. {
  3338. zs=zs.Left (pos);
  3339. }
  3340. m_choosezs.Format ("%d", max(0,m_patharray2.GetSize()-atoi(zs)) );
  3341. m_bSaveFail=0;
  3342. ChoosePhotoSkin3 dlg;
  3343. dlg.m_pParent =this;
  3344. dlg.DoModal ();
  3345. if(dlg.m_bSave )
  3346. m_bModify=0;
  3347. if(dlg.m_bPushedSave==0 && dlg.m_bSaveFail==0)
  3348. {
  3349. CString savepath;
  3350. savepath.Format ("%s\\%s.dat", g_mainpath, m_strOrderNumber);
  3351. if(m_mode2)savepath.Format ("%s\\%s-2.dat", g_mainpath, m_strOrderNumber);
  3352. ::DeleteFile (savepath);
  3353. }
  3354. m_bSaveFail=dlg.m_bSaveFail;
  3355. if(dlg.m_bExit)
  3356. {
  3357. m_bModify=0;
  3358. CDialog::OnCancel ();
  3359. }
  3360. }
  3361. else if(m_mode2==1) // 看设计时的保存,delphotos2的保存需要重新定向;
  3362. {
  3363. UpdateData();
  3364. if(m_mode!=1)
  3365. {
  3366. CalChooseZS();
  3367. }
  3368. CString zs = m_taoxizs;
  3369. int pos=zs.Find ("\\");
  3370. if(pos!=-1)
  3371. {
  3372. zs=zs.Left (pos);
  3373. }
  3374. m_choosezs.Format ("%d", max(0,m_patharray2.GetSize()-atoi(zs)) );
  3375. m_bSaveFail=0;
  3376. ChoosePhotoSkin3 dlg;
  3377. dlg.m_pParent =this;
  3378. dlg.DoModal ();
  3379. if(dlg.m_bSave )
  3380. m_bModify=0;
  3381. if(dlg.m_bPushedSave==0 && dlg.m_bSaveFail==0)
  3382. {
  3383. CString savepath;
  3384. savepath.Format ("%s\\%s.dat", g_mainpath, m_strOrderNumber);
  3385. if(m_mode2)savepath.Format ("%s\\%s-2.dat", g_mainpath, m_strOrderNumber);
  3386. ::DeleteFile (savepath);
  3387. }
  3388. m_bSaveFail=dlg.m_bSaveFail;
  3389. if(dlg.m_bExit)
  3390. {
  3391. m_bModify=0;
  3392. CDialog::OnCancel ();
  3393. }
  3394. }
  3395. }
  3396. // 删除相片;
  3397. BOOL ChoosePhotoSkin2::OnDel() // 删除相片;
  3398. {
  3399. // printf("Jeff:m_mode=%d,m_mode2=%d.\n\n",m_mode,m_mode2);//Jeff Printf
  3400. if(m_mode==1)
  3401. {
  3402. AfxMessageBox("选中照片不能删除, 请先取消选中状态!", MB_ICONINFORMATION);
  3403. return 0;
  3404. }
  3405. else if(m_mode==3)
  3406. {
  3407. return 0;
  3408. }
  3409. POSITION pos;
  3410. pos=m_List1.GetFirstSelectedItemPosition();
  3411. if(pos==NULL)
  3412. {
  3413. return 0;
  3414. }
  3415. if(m_bRunning)
  3416. return 0;
  3417. int iItem=m_List1.GetNextSelectedItem(pos);
  3418. CString no;//=m_List1.GetItemText (iItem, 0);
  3419. CStringArray *pArray=GetCurArray(); // Jeff:按钮选择返回(查看全部、查看选中、查看未选……)
  3420. no=pArray->ElementAt(iItem);
  3421. //printf("Jeff:pos=%d,iItem=%d,no=%s \n\n",pos,iItem,no);// Jeff Printf;
  3422. no=no.Right (no.GetLength ()-no.ReverseFind ('\\')-1);
  3423. no=no.Left (no.Find ('.'));
  3424. if(IsSelPhoto(no)) // Jeff 这里有问题,有些订单删除未选中的相片时,会提示box内容。状态:未处理;
  3425. {
  3426. AfxMessageBox("选中的照片不能删除, 请先取消选中状态!", MB_ICONINFORMATION);
  3427. return 0;
  3428. }
  3429. if(AfxMessageBox("是否删除此照片?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)
  3430. return 0;
  3431. m_List1.DeleteItem(iItem);
  3432. CString name=pArray->ElementAt(iItem);
  3433. m_patharray4.Add(name);
  3434. // printf("Jeff:将要删除的相片=%s\n\n",name);// Jeff Printf;
  3435. for(int i=0; i<pArray->GetSize(); i++)
  3436. {
  3437. if(name.CollateNoCase(pArray->ElementAt(i))==0)
  3438. {
  3439. pArray->RemoveAt (i);
  3440. if(m_mode==2)
  3441. {
  3442. DelNo(no);
  3443. // MessageBox(no);
  3444. // m_patharray1.RemoveAt (i);
  3445. }
  3446. break;
  3447. }
  3448. }
  3449. if(iItem>=pArray->GetSize ())
  3450. iItem=0;
  3451. m_List1.SetItemState (iItem, LVIS_SELECTED, LVIS_SELECTED);
  3452. DrawLogin();
  3453. return 1;
  3454. }
  3455. extern int GetOrientation(Image *image);
  3456. void ChoosePhotoSkin2::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult)
  3457. {
  3458. // TODO: Add your control notification handler code here
  3459. *pResult = 0;
  3460. }
  3461. void ChoosePhotoSkin2::OnTimer(UINT nIDEvent)
  3462. {
  3463. // TODO: Add your message handler code here and/or call default
  3464. if(nIDEvent==1)
  3465. {
  3466. KillTimer(nIDEvent);
  3467. if( m_showpichwd)
  3468. ::SendMessage (m_showpichwd, WM_USER+200, 1, 0);
  3469. TimeOutDlg dlg;
  3470. dlg.m_ticks =m_ticks;
  3471. dlg.DoModal ();
  3472. SetTimer(2, m_timer*60000, NULL);
  3473. }
  3474. else if(nIDEvent==2)
  3475. {
  3476. KillTimer(nIDEvent);
  3477. if( m_showpichwd)
  3478. ::SendMessage (m_showpichwd, WM_USER+200, 1, 0);
  3479. TimeOutDlg dlg;
  3480. dlg.m_ticks =m_ticks;
  3481. dlg.DoModal ();
  3482. SetTimer(2, m_timer*60000, NULL);
  3483. }
  3484. else if(nIDEvent==3)
  3485. {
  3486. KillTimer(nIDEvent);
  3487. SetSPName3();
  3488. }
  3489. }
  3490. float ChoosePhotoSkin2::GetSPPriceFromId(CString id)
  3491. {
  3492. for(int i=0; i<m_sparray.GetSize (); i++)
  3493. {
  3494. if(id==m_sparray.ElementAt (i).ElementAt (0))
  3495. return atof(m_sparray.ElementAt (i).ElementAt (4));
  3496. }
  3497. return 0;
  3498. }
  3499. CString ChoosePhotoSkin2::GetSPNameFromId(CString id)
  3500. {
  3501. int i =0;
  3502. for( i=0; i<m_sparray.GetSize (); i++)
  3503. {
  3504. if(id==m_sparray.ElementAt (i).ElementAt (0))
  3505. return m_sparray.ElementAt (i).ElementAt (1);
  3506. }
  3507. id.TrimLeft ("0");
  3508. for( i=0; i<m_sparray.GetSize (); i++)
  3509. {
  3510. if(id==m_sparray.ElementAt (i).ElementAt (0))
  3511. return m_sparray.ElementAt (i).ElementAt (1);
  3512. }
  3513. return "";
  3514. }
  3515. void ChoosePhotoSkin2::SetSPName3()
  3516. {
  3517. }
  3518. void ChoosePhotoSkin2::OnSpBox() //null
  3519. {
  3520. }
  3521. void ChoosePhotoSkin2::OnButton8() //null
  3522. {
  3523. // TODO: Add your control notification handler code here
  3524. /* POSITION pos;
  3525. pos=m_List3.GetFirstSelectedItemPosition();
  3526. if(pos==NULL)
  3527. {
  3528. AfxMessageBox("请先选中您要删除的项目!", MB_ICONINFORMATION);
  3529. return;
  3530. }
  3531. int iItem=m_List3.GetNextSelectedItem(pos);
  3532. m_List3.DeleteItem (iItem);
  3533. SetSPName3();*/
  3534. }
  3535. void ChoosePhotoSkin2::OnButton5() //null
  3536. {
  3537. // TODO: Add your control notification handler code here
  3538. }
  3539. void ChoosePhotoSkin2::OnButton6() //null
  3540. {
  3541. // TODO: Add your control notification handler code here
  3542. }
  3543. CString GetPathFromNo(CString dir, CString no, CStringArray *pArray)
  3544. {
  3545. CString sRet;
  3546. dir.TrimRight('\\');
  3547. dir+="\\";
  3548. CStringArray dirarray;
  3549. CString temp;
  3550. if(pArray->GetSize ()==0)
  3551. {
  3552. using namespace helper_coffs;
  3553. ffsco o;
  3554. o.dirs(1);
  3555. o.find(LPCSTR(dir), LPCSTR("*.*"));
  3556. ffsco::typeT coo;
  3557. ffsco::typeT::iterator it;
  3558. coo = o.co_dir();
  3559. for (it = coo.begin();coo.end() != it;it ++)
  3560. {
  3561. temp=(*it).c_str();
  3562. if(::FindArray (&dirarray, temp)==-1 && temp!=dir)
  3563. {
  3564. dirarray.Add (temp);
  3565. }
  3566. }
  3567. }
  3568. else
  3569. dirarray.Copy (*pArray);
  3570. for(int i=0; i<dirarray.GetSize(); i++)
  3571. {
  3572. temp=dirarray.ElementAt(i);
  3573. sRet.Format("%s%s.jpg", temp, no);
  3574. if(::PathFileExists (sRet))return sRet;
  3575. }
  3576. return dir+no+".jpg";
  3577. }
  3578. CString GetPathFromNo2(CString dir, CString no, CStringArray *pArray)
  3579. {
  3580. CString path;
  3581. for(int i=0; i<pArray->GetSize(); i++)
  3582. {
  3583. path=pArray->ElementAt(i);
  3584. path=path.Right(path.GetLength()-path.ReverseFind('\\')-1);
  3585. if(path.Find(".")!=-1)
  3586. path=path.Left(path.Find("."));
  3587. if(no==path)return pArray->ElementAt(i);
  3588. }
  3589. return "";
  3590. }
  3591. void ChoosePhotoSkin2::GetPath(CString str)
  3592. {// if(atoi(g_cominfoarray.ElementAt(0).ElementAt(109))==0 && m_mode2==0)
  3593. if(m_bFromLocal && m_mode2==0)
  3594. {
  3595. str.TrimLeft (",");
  3596. str.TrimRight (",");
  3597. if(str.IsEmpty ())return;
  3598. int pos=str.Find (',');
  3599. CString path,path2;
  3600. char spath[MAX_PATH];
  3601. ::GetSystemDirectory (spath, MAX_PATH);
  3602. CString sysdir=spath;
  3603. sysdir+="\\lyfz";
  3604. sysdir+="\\";
  3605. sysdir+=m_strOrderNumber;
  3606. sysdir+="\\";
  3607. while(pos!=-1)
  3608. {
  3609. path=sysdir+str.Left (pos)+".jpg";
  3610. if(::FindArray(&m_patharray2, path)==-1)
  3611. {
  3612. m_patharray2.Add (path);
  3613. // MessageBox(path);
  3614. }
  3615. str=str.Right (str.GetLength ()-pos-1);
  3616. pos=str.Find (',');
  3617. }
  3618. path=sysdir+str+".jpg";
  3619. if(::FindArray(&m_patharray2, path)==-1)
  3620. {
  3621. m_patharray2.Add (path);//MessageBox(path);
  3622. }
  3623. }
  3624. else if(m_mode2 && m_bChooseBig==0)//看设计
  3625. {
  3626. str.TrimLeft (",");
  3627. str.TrimRight (",");
  3628. if(str.IsEmpty ())return;
  3629. int pos=str.Find (',');
  3630. CString path,path2;
  3631. while(pos!=-1)
  3632. {
  3633. path=m_path+str.Left (pos)+".jpg";
  3634. if(::FindArray(&m_patharray2, path)==-1)
  3635. {
  3636. m_patharray2.Add (path);
  3637. }
  3638. str=str.Right (str.GetLength ()-pos-1);
  3639. pos=str.Find (',');
  3640. }
  3641. path=m_path+str+".jpg";
  3642. if(::FindArray(&m_patharray2, path)==-1)
  3643. {
  3644. m_patharray2.Add (path);
  3645. }
  3646. }
  3647. else
  3648. {
  3649. if(m_DirArrayBuf.GetSize ()==0)
  3650. {
  3651. CString dir=m_path;
  3652. dir.TrimRight('\\');
  3653. dir+="\\";
  3654. CString temp;
  3655. using namespace helper_coffs;
  3656. ffsco o;
  3657. o.dirs(1);
  3658. o.find(LPCSTR(dir), LPCSTR("*.*"));
  3659. ffsco::typeT coo;
  3660. ffsco::typeT::iterator it;
  3661. coo = o.co_dir();
  3662. for (it = coo.begin();coo.end() != it;it ++)
  3663. {
  3664. temp=(*it).c_str();
  3665. if(::FindArray (&m_DirArrayBuf, temp)==-1 && temp!=dir)
  3666. {
  3667. m_DirArrayBuf.Add (temp);
  3668. }
  3669. }
  3670. }
  3671. str.TrimLeft (",");
  3672. str.TrimRight (",");
  3673. if(str.IsEmpty ())return;
  3674. int pos=str.Find (',');
  3675. CString path,path2;
  3676. while(pos!=-1)
  3677. {
  3678. path=GetPathFromNo2(m_path, str.Left (pos), &m_patharray1);
  3679. path2=path;
  3680. if(m_nChoosePhotoType==0)
  3681. {
  3682. path2.Replace ("客户原片", "修好的片");
  3683. int pos1=path2.Find (m_strOrderNumber);
  3684. pos1+=m_strOrderNumber.GetLength ();
  3685. int pos2=path2.ReverseFind ('\\');
  3686. path2=path2.Left (pos1)+path2.Right (path2.GetLength ()-pos2);
  3687. if(::PathFileExists (path2))
  3688. path=path2;
  3689. }
  3690. if(::FindArray(&m_patharray2, path)==-1)
  3691. {
  3692. m_patharray2.Add (path);
  3693. }
  3694. str=str.Right (str.GetLength ()-pos-1);
  3695. pos=str.Find (',');
  3696. }
  3697. path=GetPathFromNo2(m_path, str, &m_patharray1);//+".jpg";
  3698. path2=path;
  3699. if(m_nChoosePhotoType==0)
  3700. {
  3701. path2.Replace ("客户原片", "修好的片");
  3702. int pos1=path2.Find (m_strOrderNumber);
  3703. pos1+=m_strOrderNumber.GetLength ();
  3704. int pos2=path2.ReverseFind ('\\');
  3705. path2=path2.Left (pos1)+path2.Right (path2.GetLength ()-pos2);
  3706. if(::PathFileExists (path2))
  3707. path=path2;
  3708. }
  3709. if(::FindArray(&m_patharray2, path)==-1)
  3710. m_patharray2.Add (path);
  3711. }
  3712. }
  3713. void ChoosePhotoSkin2::LoadPhotos()//加载图片;
  3714. {
  3715. if(m_mode==1)
  3716. {
  3717. ProductChooseFilter dlg;
  3718. CString name;
  3719. int i = 0;
  3720. for( i=0; i<m_List2.GetItemCount (); i++)
  3721. {
  3722. name=m_List2.GetItemText (i, 2);
  3723. dlg.m_array.Add(name);
  3724. }
  3725. for(i=0; i<m_List3.GetItemCount (); i++)
  3726. {
  3727. name=m_List3.GetItemText (i, 2);
  3728. dlg.m_array.Add(name);
  3729. }
  3730. dlg.DoModal();
  3731. m_sChooseFilter=dlg.m_sChooseFilter;
  3732. UpdateChooseZS();
  3733. }
  3734. TerminateThread();
  3735. CStringArray *pArray=GetCurArray();
  3736. /* CString ss;
  3737. ss.Format("%d", pArray->GetSize());
  3738. MessageBox(ss);*/
  3739. m_vFileName.clear();
  3740. for(int i=0; i<pArray->GetSize (); i++)
  3741. {
  3742. CString filePath=pArray->ElementAt (i);
  3743. filePath.MakeLower();
  3744. m_vFileName.push_back(filePath);
  3745. }
  3746. LoadThumbImages();
  3747. }
  3748. void ChoosePhotoSkin2::GetNoSelPhoto()
  3749. {
  3750. m_patharray3.RemoveAll();
  3751. CString str1, str2;
  3752. for(int i=0; i<m_patharray1.GetSize(); i++)
  3753. {
  3754. BOOL bFind=0;
  3755. for(int j=0; j<m_patharray2.GetSize(); j++)
  3756. {
  3757. str1=m_patharray1.ElementAt(i);
  3758. str2=m_patharray2.ElementAt(j);
  3759. // MessageBox(str1);
  3760. // MessageBox(str2);
  3761. if(str1.CollateNoCase(str2)==0)
  3762. {
  3763. bFind=1;
  3764. break;
  3765. }
  3766. }
  3767. if(bFind==0)m_patharray3.Add (m_patharray1.ElementAt (i));
  3768. }
  3769. }
  3770. int ChoosePhotoSkin2::GetNoSelPhotoCount()
  3771. {
  3772. int nRet=0;
  3773. CString str1, str2;
  3774. for(int i=0; i<m_patharray1.GetSize (); i++)
  3775. {
  3776. BOOL bFind=0;
  3777. for(int j=0; j<m_patharray2.GetSize (); j++)
  3778. {
  3779. str1=m_patharray1.ElementAt (i);
  3780. str2=m_patharray2.ElementAt (j);
  3781. if(str1.CollateNoCase (str2)==0)
  3782. {
  3783. bFind=1;
  3784. break;
  3785. }
  3786. }
  3787. if(bFind==0)nRet++;
  3788. }
  3789. return nRet;
  3790. }
  3791. CStringArray* ChoosePhotoSkin2::GetCurArray()
  3792. {
  3793. CStringArray *pArray;
  3794. switch(m_mode)
  3795. {
  3796. case 0:
  3797. pArray=&m_patharray1;//全部
  3798. break;
  3799. case 1:
  3800. pArray=&m_patharray2;//选中
  3801. break;
  3802. case 2:
  3803. pArray=&m_patharray3;//未选
  3804. break;
  3805. case 3:
  3806. pArray=&m_patharray4;//删除
  3807. break;
  3808. case 4:
  3809. pArray=&m_patharray5;//入册
  3810. break;
  3811. case 5:
  3812. pArray=&m_patharray6;//入底
  3813. break;
  3814. }
  3815. return pArray;
  3816. }
  3817. BOOL ChoosePhotoSkin2::IsSelPhoto(CString path)
  3818. {
  3819. //path.MakeLower ();
  3820. int i = 0;
  3821. for( i=0; i<m_no2array.GetSize (); i++)
  3822. {
  3823. //m_no2array.ElementAt (i).MakeLower ();
  3824. if(m_no2array.ElementAt (i).Find (path)!=-1)
  3825. return 1;
  3826. }
  3827. for( i=0; i<m_noarray.GetSize (); i++)
  3828. {
  3829. //m_noarray.ElementAt (i).MakeLower ();
  3830. if(m_noarray.ElementAt (i).Find (path)!=-1)
  3831. return 1;
  3832. }
  3833. return 0;
  3834. }
  3835. BOOL ChoosePhotoSkin2::IsSelAlbumPhoto(CString path)
  3836. {
  3837. CString photosno;
  3838. for(int i=0; i<m_List3.GetItemCount (); i++)
  3839. {
  3840. if(m_List3.GetItemText (i, 2)!="入册")continue;
  3841. photosno=m_no2array.ElementAt (i);break;
  3842. }
  3843. photosno=","+photosno+",";
  3844. if(photosno.Find (path)!=-1)
  3845. {
  3846. return 1;
  3847. }
  3848. return 0;
  3849. }
  3850. BOOL ChoosePhotoSkin2::IsSelDiskPhoto(CString path)
  3851. {
  3852. CString photosno;
  3853. for(int i=0; i<m_List3.GetItemCount (); i++)
  3854. {
  3855. if(m_List3.GetItemText (i, 2)!="入底")continue;
  3856. photosno=m_no2array.ElementAt (i);break;
  3857. }
  3858. photosno=","+photosno+",";
  3859. if(photosno.Find (path)!=-1)
  3860. {
  3861. return 1;
  3862. }
  3863. return 0;
  3864. }
  3865. CString ChoosePhotoSkin2::GetSelName(CString name)//获取选中相片;
  3866. {
  3867. int i = 0;
  3868. CString ret;
  3869. name=","+name+",";
  3870. for( i=0; i<m_List2.GetItemCount (); i++)
  3871. {
  3872. if(m_noarray.ElementAt (i).Find (name)!=-1)
  3873. {
  3874. ret+=m_List2.GetItemText (i, 2);
  3875. ret+="\r\n";
  3876. }
  3877. }
  3878. for( i=0; i<m_List3.GetItemCount (); i++)
  3879. {
  3880. if(m_no2array.ElementAt (i).Find (name)!=-1)
  3881. {
  3882. ret+=m_List3.GetItemText (i, 2);
  3883. ret+="\r\n";
  3884. }
  3885. }
  3886. if(!ret.IsEmpty ())
  3887. {
  3888. ret="\r\n"+ret;
  3889. ret.TrimRight ("\r\n");
  3890. }
  3891. return ret;
  3892. }
  3893. // Jeff获取选设计的数据;
  3894. BOOL ChoosePhotoSkin2::GetData2()//选设计模式;
  3895. {
  3896. m_List2.DeleteAllItems ();
  3897. m_List3.DeleteAllItems ();
  3898. m_noarray.RemoveAll ();
  3899. m_no2array.RemoveAll ();
  3900. #ifdef CHILD_VERSION
  3901. CString filter="id='"+m_strOrderNumber+"';id='"+m_strOrderNumber+"';;;id='"+m_strOrderNumber+"'";
  3902. #else
  3903. CString filter="id='"+m_strOrderNumber+"' and kind<>'2';id='"+m_strOrderNumber+"';;;id='"+m_strOrderNumber+"'";
  3904. #endif
  3905. g_sendhead.code[0]=50; // dindansp;
  3906. g_sendhead.code[1]=11; // dindan.
  3907. g_sendhead.code[2]=4;
  3908. g_sendhead.code[3]=8;
  3909. g_sendhead.code[4]=182;
  3910. g_sendhead.tabcount=5;
  3911. g_sendhead.bsql=0;
  3912. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return 0;
  3913. CArray<CStringArray, CStringArray>sparray;
  3914. DataToArray(&sparray, &g_List1array, &m_sparray, &m_List2array, &oldsparray);
  3915. m_patharray2.RemoveAll ();
  3916. CString str,kind;
  3917. int nchoosezs=0;
  3918. int list2pos=0;
  3919. int list3pos=0;
  3920. CString savepath;
  3921. savepath.Format ("%s\\%s-2.dat", g_mainpath, m_strOrderNumber);
  3922. CString stm1=GetModifyTime2(savepath);
  3923. CTime tm1=CTime::GetCurrentTime ();
  3924. tm1-=CTimeSpan(60, 0, 0, 0);
  3925. CString stm2=tm1.Format ("%Y%m%d");
  3926. BOOL bLoadHistory=0;
  3927. if(::CheckFileExist (savepath) && stm1>stm2)
  3928. {
  3929. if(AfxMessageBox("提醒:请谨慎操作\r\n上次选片未正常退出, 是否还原到上次选片状态?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  3930. bLoadHistory=1;
  3931. }
  3932. if(bLoadHistory)
  3933. {
  3934. CArray<CStringArray, CStringArray>List1array;
  3935. CFile fp;
  3936. fp.Open (savepath, CFile::modeRead);
  3937. DWORD nMessageLen=fp.GetLength ();
  3938. BYTE *szChatMessage = new BYTE[nMessageLen];
  3939. fp.Read (szChatMessage, nMessageLen);
  3940. fp.Close ();
  3941. int count;
  3942. memcpy(&count, szChatMessage+(nMessageLen-sizeof(int)), sizeof(int));
  3943. CMemFile memfile;
  3944. memfile.Attach (szChatMessage, nMessageLen);
  3945. CArchive ar(&memfile, CArchive::load);
  3946. List1array.SetSize(count);
  3947. int i = 0;
  3948. for( i=0; i<List1array.GetSize (); i++)
  3949. {
  3950. List1array.ElementAt (i).Serialize (ar);
  3951. }
  3952. ar.Close();
  3953. memfile.Detach ();
  3954. delete []szChatMessage;
  3955. list2pos=0;
  3956. list3pos=0;
  3957. for( i=0; i<List1array.GetSize (); i++)
  3958. {
  3959. if(0)//List1array.ElementAt (i).GetSize ()==6)
  3960. {
  3961. kind="0";
  3962. m_List2.InsertItem(list2pos, List1array.ElementAt(i).ElementAt(1));
  3963. m_List2.SetItemText(list2pos, 1, List1array.ElementAt(i).ElementAt(2));
  3964. m_List2.SetItemText(list2pos, 2, List1array.ElementAt(i).ElementAt(3));
  3965. m_List2.SetItemText(list2pos, 3, List1array.ElementAt(i).ElementAt(4));
  3966. m_List2.SetItemText(list2pos, 4, List1array.ElementAt(i).ElementAt(5));
  3967. str=List1array.ElementAt (i).ElementAt (5);
  3968. list2pos++;
  3969. }
  3970. else
  3971. {
  3972. kind="4";
  3973. m_List3.InsertItem(list3pos, List1array.ElementAt (i).ElementAt (1));
  3974. m_List3.SetItemText(list3pos, 1, List1array.ElementAt (i).ElementAt (2));
  3975. m_List3.SetItemText(list3pos, 2, List1array.ElementAt (i).ElementAt (3));
  3976. m_List3.SetItemText(list3pos, 3, List1array.ElementAt (i).ElementAt (4));
  3977. m_List3.SetItemText(list3pos, 4, List1array.ElementAt (i).ElementAt (5));
  3978. m_List3.SetItemText(list3pos, 5, List1array.ElementAt (i).ElementAt (6));
  3979. #ifdef LKAY_VERSION
  3980. m_List3.SetItemText(list3pos, 6, List1array.ElementAt (i).ElementAt (7));
  3981. m_List3.SetItemText(list3pos, 7, List1array.ElementAt (i).ElementAt (8));
  3982. str=List1array.ElementAt (i).ElementAt (8);
  3983. #else
  3984. str=List1array.ElementAt (i).ElementAt (6);
  3985. #endif
  3986. list3pos++;
  3987. }
  3988. nchoosezs+=GetZS(str);
  3989. GetPath(str);
  3990. if(!str.IsEmpty ())
  3991. str=","+str+",";
  3992. str.MakeLower ();
  3993. if(kind=="4")
  3994. m_no2array.Add (str);
  3995. else
  3996. m_noarray.Add (str);
  3997. }
  3998. }
  3999. else
  4000. {
  4001. for(int i=0; i<sparray.GetSize (); i++)
  4002. {
  4003. kind="4";//sparray.ElementAt (i).ElementAt (4);
  4004. if(kind=="4")
  4005. {
  4006. m_List3.InsertItem(list3pos, sparray.ElementAt (i).ElementAt (7));
  4007. m_List3.SetItemText(list3pos, 1, sparray.ElementAt (i).ElementAt (1));
  4008. m_List3.SetItemText(list3pos, 2, sparray.ElementAt (i).ElementAt (5));
  4009. m_List3.SetItemText(list3pos, 3, sparray.ElementAt (i).ElementAt (2));
  4010. m_List3.SetItemText(list3pos, 4, sparray.ElementAt (i).ElementAt (3));
  4011. #ifdef LKAY_VERSION
  4012. m_List3.SetItemText(list3pos, 5, sparray.ElementAt (i).ElementAt (9));
  4013. m_List3.SetItemText(list3pos, 6, sparray.ElementAt (i).ElementAt (10));
  4014. m_List3.SetItemText(list3pos, 7, sparray.ElementAt (i).ElementAt (8));
  4015. #else
  4016. m_List3.SetItemText(list3pos, 5, sparray.ElementAt (i).ElementAt (8)); // 8 dindansp:no2
  4017. #endif
  4018. list3pos++;
  4019. }
  4020. else
  4021. {
  4022. m_List2.InsertItem(list2pos, sparray.ElementAt (i).ElementAt (7));
  4023. m_List2.SetItemText(list2pos, 1, sparray.ElementAt (i).ElementAt (1));
  4024. m_List2.SetItemText(list2pos, 2, sparray.ElementAt (i).ElementAt (5));
  4025. m_List2.SetItemText(list2pos, 3, sparray.ElementAt (i).ElementAt (3));
  4026. m_List2.SetItemText(list2pos, 4, sparray.ElementAt (i).ElementAt (8)); // 8 dindansp:no2
  4027. list2pos++;
  4028. }
  4029. str=sparray.ElementAt (i).ElementAt (8); // 8 dindansp:no2
  4030. str.MakeLower ();
  4031. nchoosezs+=GetZS(str);
  4032. GetPath(str);
  4033. if(!str.IsEmpty ())
  4034. str=","+str+",";
  4035. if(kind=="4")
  4036. m_no2array.Add (str);
  4037. else
  4038. m_noarray.Add (str);
  4039. }
  4040. }
  4041. if(g_List1array.GetSize())
  4042. {
  4043. m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  4044. m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  4045. m_phone1 = g_List1array.ElementAt (0).ElementAt (61);
  4046. m_phone2 = g_List1array.ElementAt (0).ElementAt (62);
  4047. if(!m_name1.IsEmpty ())
  4048. m_name=m_name1+",";
  4049. m_name+=m_name2;
  4050. m_name.TrimRight (",");
  4051. m_waiter3 = g_user.name ;
  4052. m_taoxizs = g_List1array.ElementAt (0).ElementAt (9);
  4053. m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  4054. m_takezs = g_List1array.ElementAt (0).ElementAt (23);
  4055. m_choosezs = g_List1array.ElementAt (0).ElementAt (24);
  4056. m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  4057. m_oldmoney3=m_money3;
  4058. m_bz3 = g_List1array.ElementAt (0).ElementAt (57);
  4059. m_urgent = g_List1array.ElementAt (0).ElementAt (40);
  4060. m_delphotos = g_List1array.ElementAt (0).ElementAt (56);// Jeff获取选设计时,被删除的相片,选取的字段delphotos2;.读取正常,保存时未能正确保存到delphotos2字段;
  4061. //printf("Jeff:看设计:delphotos2=%s\n\n",m_delphotos);//Jeff Printf
  4062. m_status8 = g_List1array.ElementAt (0).ElementAt (55);
  4063. m_time6 = g_List1array.ElementAt (0).ElementAt (48);
  4064. m_time5old=m_time5;
  4065. m_time6old=m_time6;
  4066. m_checkstatus= g_List1array.ElementAt (0).ElementAt (55);
  4067. UpdateData(false);
  4068. }
  4069. else
  4070. {
  4071. m_name1 = "";
  4072. m_name2 = "";
  4073. m_waiter3 = "";
  4074. m_taoxizs = "";
  4075. m_time5 = "";
  4076. m_takezs = "";
  4077. m_choosezs = "";
  4078. m_money3 = "";
  4079. m_bz3 = "";
  4080. m_urgent = "";
  4081. UpdateData(false);
  4082. }
  4083. return 1;
  4084. }
  4085. void ChoosePhotoSkin2::SortArray()
  4086. {
  4087. // if(m_mode2)return;
  4088. m_bSort=!m_bSort;
  4089. CStringArray *pArray[6]={&m_patharray1,&m_patharray2,&m_patharray3,&m_patharray4,&m_patharray5,&m_patharray6};
  4090. if(m_bSort==0)
  4091. {
  4092. for(int i=0; i<6; i++)
  4093. {
  4094. if(pArray[i]->GetSize ())
  4095. {
  4096. int size=pArray[i]->GetSize ()-1;
  4097. CString sTemp;
  4098. int nPos;
  4099. for(int ii=0;ii<size;ii++)
  4100. {
  4101. nPos=rand()%(size-ii);
  4102. sTemp=pArray[i]->ElementAt (size-ii);
  4103. pArray[i]->SetAt (size-ii, pArray[i]->ElementAt (nPos));
  4104. pArray[i]->SetAt (nPos, sTemp);
  4105. }
  4106. }
  4107. }
  4108. }
  4109. else
  4110. {
  4111. for(int i=0; i<6; i++)
  4112. {
  4113. m_combo1.ResetContent ();
  4114. CString Temp;
  4115. int j = 0;
  4116. for( j=0; j<pArray[i]->GetSize (); j++)
  4117. {
  4118. m_combo1.AddString (pArray[i]->ElementAt (j));
  4119. }
  4120. for( j=0; j<pArray[i]->GetSize (); j++)
  4121. {
  4122. m_combo1.GetLBText (j, Temp);
  4123. pArray[i]->SetAt (j, Temp);
  4124. }
  4125. }
  4126. }
  4127. {
  4128. TerminateThread();
  4129. CStringArray *pArray=GetCurArray();
  4130. m_vFileName.clear();
  4131. for(int i=0; i<pArray->GetSize (); i++)
  4132. {
  4133. CString filePath=pArray->ElementAt (i);
  4134. filePath.MakeLower();
  4135. m_vFileName.push_back(filePath);
  4136. }
  4137. LoadThumbImages();
  4138. }
  4139. }
  4140. void ChoosePhotoSkin2::CheckForDisk() // 检查入底;
  4141. {
  4142. int i = 0;
  4143. for( i=0; i<m_List2.GetItemCount (); i++)
  4144. {
  4145. if("入底"==m_List2.GetItemText (i, 2))return;
  4146. }
  4147. for( i=0; i<m_List3.GetItemCount (); i++)
  4148. {
  4149. if("入底"==m_List3.GetItemText (i, 2))return;
  4150. }
  4151. i=m_List3.GetItemCount ();
  4152. m_List3.InsertItem(i, "");
  4153. m_List3.SetItemText(i, 2, "入底");
  4154. m_no2array.Add ("");
  4155. }
  4156. void ChoosePhotoSkin2::CheckForAlbum() // 检查入册;
  4157. {
  4158. int i = 0;
  4159. for( i=0; i<m_List2.GetItemCount (); i++)
  4160. {
  4161. if("入册"==m_List2.GetItemText (i, 2))return;
  4162. }
  4163. for( i=0; i<m_List3.GetItemCount (); i++)
  4164. {
  4165. if("入册"==m_List3.GetItemText (i, 2))return;
  4166. }
  4167. i=m_List3.GetItemCount ();
  4168. m_List3.InsertItem(i, "");
  4169. m_List3.SetItemText(i, 2, "入册");
  4170. m_no2array.Add ("");
  4171. }
  4172. void ChoosePhotoSkin2::GetPhotos()//得看设计
  4173. {
  4174. m_patharray1.RemoveAll ();
  4175. m_path.MakeLower();
  4176. CStringArray dirarray;
  4177. CString str;
  4178. if(1)
  4179. {
  4180. using namespace helper_coffs;
  4181. ffsco o;
  4182. o.dirs(1);
  4183. o.find(LPCSTR(m_path), LPCSTR("*.*"));
  4184. ffsco::typeT coo;
  4185. ffsco::typeT::iterator it;
  4186. coo = o.co_dir();
  4187. for (it = coo.begin();coo.end() != it;it ++)
  4188. {
  4189. str=(*it).c_str();
  4190. str.TrimRight ("\\");
  4191. CString dirname=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4192. if(dirname.Find("DelgaBook")!=-1)
  4193. {
  4194. if(FindArray(&m_patharray1, str)==-1)
  4195. {
  4196. m_patharray1.Add(str);
  4197. }
  4198. }
  4199. if(FindArray(&dirarray, str)==-1)
  4200. {
  4201. dirarray.Add(str);
  4202. }
  4203. }
  4204. }
  4205. if(1)
  4206. {
  4207. for(int i=0; i<dirarray.GetSize (); i++)
  4208. {
  4209. using namespace helper_coffs;
  4210. ffsco o;
  4211. o.dirs(0);
  4212. o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
  4213. ffsco::typeT coo;
  4214. ffsco::typeT::iterator it;
  4215. coo = o.co_file();
  4216. for (it = coo.begin(); coo.end() != it;it ++)
  4217. {
  4218. str=(*it).c_str();
  4219. if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
  4220. if(str.GetAt (str.ReverseFind ('\\')+1)=='m')continue;
  4221. str.MakeLower ();
  4222. m_patharray1.Add (str);
  4223. }
  4224. }
  4225. }
  4226. CStringArray *pArray[1]={&m_patharray1};
  4227. for(int i=0; i<1; i++)
  4228. {
  4229. m_combo1.ResetContent ();
  4230. CString Temp;
  4231. int j = 0;
  4232. for( j=0; j<pArray[i]->GetSize (); j++)
  4233. {
  4234. m_combo1.AddString (pArray[i]->ElementAt (j));
  4235. }
  4236. for( j=0; j<pArray[i]->GetSize (); j++)
  4237. {
  4238. m_combo1.GetLBText (j, Temp);
  4239. pArray[i]->SetAt (j, Temp);
  4240. }
  4241. }
  4242. }
  4243. void ChoosePhotoSkin2::Save()
  4244. {
  4245. CString sql;
  4246. CArray<CStringArray, CStringArray>sparray;
  4247. sparray.SetSize(m_List2.GetItemCount ()+m_no2array.GetSize ());
  4248. int i = 0;
  4249. for( i=0; i<m_List2.GetItemCount (); i++)
  4250. {
  4251. sparray.ElementAt (i).Add ( m_strOrderNumber );
  4252. sparray.ElementAt (i).Add ( m_List2.GetItemText (i, 0) );
  4253. sparray.ElementAt (i).Add ( m_List2.GetItemText (i, 1) );
  4254. sparray.ElementAt (i).Add ( m_List2.GetItemText (i, 2) );
  4255. sparray.ElementAt (i).Add ( m_List2.GetItemText (i, 3) );
  4256. sparray.ElementAt (i).Add ( m_List2.GetItemText (i, 4) );
  4257. }
  4258. for( int j=0; j<m_no2array.GetSize (); j++)
  4259. {
  4260. sparray.ElementAt (i).Add ( m_strOrderNumber );
  4261. sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 0) );
  4262. sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 1) );
  4263. sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 2) );
  4264. sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 3) );
  4265. sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 4) );
  4266. sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 5) );
  4267. #ifdef LKAY_VERSION
  4268. sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 6) );
  4269. sparray.ElementAt (i).Add ( m_List3.GetItemText (j, 7) );
  4270. #endif
  4271. sparray.ElementAt (i).Add ( "4" );
  4272. i++;
  4273. }
  4274. if(sparray.GetSize ()==0)
  4275. {
  4276. sparray.SetSize(1);
  4277. sparray.ElementAt (0).Add (m_strOrderNumber);
  4278. }
  4279. CMemFile memfile;
  4280. CArchive ar(&memfile, CArchive::store);
  4281. for(int ii=0; ii<sparray.GetSize (); ii++)
  4282. {
  4283. sparray.ElementAt (ii).Serialize (ar);
  4284. }
  4285. ar.Close();
  4286. int length=memfile.GetLength ();
  4287. BYTE *pData = memfile.Detach();
  4288. int size=sparray.GetSize ();
  4289. BYTE *pData2=new BYTE[length+sizeof(int)];
  4290. memcpy(pData2, pData, length);
  4291. memcpy(pData2+length, &size, sizeof(int));
  4292. delete []pData;
  4293. length+=sizeof(int);
  4294. CString savepath;
  4295. savepath.Format ("%s\\%s.dat", g_mainpath, m_strOrderNumber);
  4296. if(m_mode2)savepath.Format ("%s\\%s-2.dat", g_mainpath, m_strOrderNumber);
  4297. if(1)
  4298. {
  4299. CFile fp;
  4300. fp.Open (savepath, CFile::modeCreate|CFile::modeWrite);
  4301. fp.Write (pData2, length);
  4302. fp.Close ();
  4303. }
  4304. delete []pData2;
  4305. }
  4306. void ChoosePhotoSkin2::DrawLogin()
  4307. {
  4308. CRect rc;
  4309. ((MyBmpButton2*)m_picarray.ElementAt (3))->GetWindowRect (rc);
  4310. ScreenToClient(rc);
  4311. rc.right -=rc.left ;
  4312. rc.left =5;
  4313. rc.right +=5;
  4314. rc.top +=20;
  4315. rc.right -=15;
  4316. CDC *pDC=GetDC();
  4317. Graphics graph(pDC->GetSafeHdc());
  4318. Rect destinationRect(rc.left,rc.top,rc.Width (), rc.Height ());
  4319. RectF layoutRect(rc.left , rc.top, rc.Width (), rc.Height ());
  4320. rc.left /=g_fscalex;
  4321. rc.right /=g_fscalex;
  4322. rc.top /=g_fscaley;
  4323. rc.bottom /=g_fscaley;
  4324. // graph.SetSmoothingMode(SmoothingModeHighQuality);
  4325. graph.DrawImage(m_pBk, destinationRect, rc.left , rc.top ,rc.Width (), rc.Height (),UnitPixel);
  4326. StringFormat format;
  4327. format.SetAlignment(StringAlignmentNear );
  4328. SolidBrush *Brush=new SolidBrush(Color(255,255,255,255));
  4329. CString str;
  4330. str.Format ("张数:%d", m_List1.GetItemCount ());
  4331. int leng=GetLengthEx(str);
  4332. BSTR bstr= str.AllocSysString();
  4333. Gdiplus::Font *g_TimerFont=new Gdiplus::Font(L"黑体", 13);
  4334. graph.SetTextRenderingHint(TextRenderingHintAntiAlias);
  4335. graph.DrawString(
  4336. bstr,
  4337. leng,
  4338. g_TimerFont,
  4339. layoutRect,
  4340. &format,
  4341. Brush);
  4342. delete Brush;
  4343. delete g_TimerFont;
  4344. SysFreeString(bstr);
  4345. ReleaseDC(pDC);
  4346. }
  4347. BOOL ChoosePhotoSkin2::CheckOK(CString name)
  4348. {
  4349. if(name.GetLength ()>4)return 0;
  4350. for(int i=0; i<name.GetLength (); i++)
  4351. {
  4352. if(name.GetAt (i)<'0'||name.GetAt (i)>'9')return 0;
  4353. }
  4354. return 1;
  4355. }
  4356. BOOL ChoosePhotoSkin2::CheckName(CString name)
  4357. {//$001.002.003
  4358. int pos=name.Find ("$");
  4359. if(pos!=0)return 0;
  4360. name.Delete (0,1);
  4361. pos=name.Find (".");
  4362. while(pos!=-1)
  4363. {
  4364. if(CheckOK(name.Left (pos))==0)return 0;
  4365. name=name.Right (name.GetLength ()-pos-1);
  4366. pos=name.Find (".");
  4367. }
  4368. return CheckOK(name);
  4369. }
  4370. void ChoosePhotoSkin2::DelNo(CString no)
  4371. {
  4372. CString no2;
  4373. for(int i=0; i<m_patharray1.GetSize(); i++)
  4374. {
  4375. no2=m_patharray1.ElementAt (i);
  4376. no2=no2.Right (no2.GetLength ()-no2.ReverseFind ('\\')-1);
  4377. no2=no2.Left (no2.Find ('.'));
  4378. if(no==no2)
  4379. {
  4380. m_patharray1.RemoveAt(i);
  4381. return;
  4382. }
  4383. }
  4384. }
  4385. CString ChoosePhotoSkin2::GetZSInfo(int iItem)
  4386. {
  4387. if(m_mode!=1)
  4388. CalChooseZS();
  4389. CString str;
  4390. // str.Format("%d/%d %d+", m_patharray2.GetSize(), atoi(m_taoxizs), max(0,m_patharray2.GetSize()-atoi(m_taoxizs)));
  4391. CString scount=m_List1.GetItemText (iItem, 0);
  4392. int ncount=0;
  4393. int npos=scount.Find ("\r\n");
  4394. while(npos!=-1)
  4395. {
  4396. ncount++;
  4397. scount=scount.Right (scount.GetLength ()-npos-2);
  4398. npos=scount.Find ("\r\n");
  4399. }
  4400. /* if(m_mode2)
  4401. str.Format("X:%d", ncount);
  4402. else
  4403. str.Format("X:%d %d/%d %d+ S:%d/%d", ncount, m_patharray2.GetSize(), atoi(m_taoxizs), max(0,m_patharray2.GetSize()-atoi(m_taoxizs)), GetNoSelPhotoCount(), max(0, atoi(m_taoxizs)-m_patharray2.GetSize()));
  4404. */
  4405. CString zs = m_taoxizs;
  4406. int pos=zs.Find ("\\");
  4407. if(pos!=-1)
  4408. {
  4409. zs=zs.Left (pos);
  4410. }
  4411. if(m_mode2)
  4412. str.Format("X:%d", ncount);
  4413. else
  4414. str.Format("选中次数:%d 已选/应选:%d/%d\r\n加选:%d+ 未选/剩余:%d/%d", ncount, m_patharray2.GetSize(), atoi(zs), max(0,m_patharray2.GetSize()-atoi(zs)), max(0, atoi(zs)-m_patharray2.GetSize()), GetNoSelPhotoCount());
  4415. return str;
  4416. }
  4417. // GetSelCountFromName
  4418. // 描述:返回相片数量;
  4419. // 参数:
  4420. // [IN]name:
  4421. // dindansp表字段no里的内容;(example:001,002,003(陈天,入册),004)
  4422. // [OUT]scount
  4423. //
  4424. //
  4425. void ChoosePhotoSkin2::GetSelCountFromName(CString name, CString &scount)
  4426. {
  4427. name.TrimLeft(",");
  4428. name.TrimRight(",");
  4429. if(name.GetLength()==0)
  4430. {
  4431. scount="0";
  4432. return;
  4433. }
  4434. // Jeff:处理有问题,若相片名为:003(陈天,入册),这就会多计数一次;
  4435. // 需要完成的一个处理;
  4436. int ncount=0;
  4437. int npos=name.Find(",");
  4438. while(npos!=-1)
  4439. {
  4440. ncount++;
  4441. name=name.Right(name.GetLength()-npos-1);
  4442. npos=name.Find(",");
  4443. }
  4444. ncount++;
  4445. scount.Format("%d", ncount);
  4446. }
  4447. void ChoosePhotoSkin2::CalChooseZS()
  4448. {
  4449. m_patharray2.RemoveAll ();
  4450. CString str;
  4451. int i = 0;
  4452. for( i=0; i<m_noarray.GetSize (); i++)
  4453. {
  4454. str=m_noarray.ElementAt (i);
  4455. GetPath(str);
  4456. }
  4457. for( i=0; i<m_no2array.GetSize (); i++)
  4458. {
  4459. str=m_no2array.ElementAt (i);
  4460. GetPath(str);
  4461. }
  4462. }
  4463. //入册
  4464. //
  4465. void ChoosePhotoSkin2::GetAlbumPhoto()//查看入册相片;
  4466. {
  4467. if(m_mode==4)return;
  4468. m_mode=4;
  4469. m_patharray5.RemoveAll ();
  4470. CString photosno;
  4471. int i = 0;
  4472. for( i=0; i<m_List3.GetItemCount (); i++)
  4473. {
  4474. if(m_List3.GetItemText (i, 2)!="入册")continue;
  4475. photosno=m_no2array.ElementAt (i);break;
  4476. }
  4477. photosno=","+photosno+",";
  4478. for(i=m_patharray1.GetSize ()-1; i>=0; i--)
  4479. {
  4480. CString no;
  4481. no=m_patharray1.ElementAt (i);
  4482. no=no.Right (no.GetLength ()-no.ReverseFind ('\\')-1);
  4483. no=no.Left (no.Find ('.'));
  4484. no=","+no;
  4485. no+=",";
  4486. if(photosno.Find (no)!=-1)
  4487. {
  4488. no=m_patharray1.ElementAt (i);
  4489. m_patharray5.Add (no);
  4490. }
  4491. }
  4492. LoadPhotos();
  4493. }
  4494. void ChoosePhotoSkin2::GetDiskPhoto()//查看入底相片;
  4495. {
  4496. if(m_mode==5)return;
  4497. m_mode=5;
  4498. m_patharray6.RemoveAll ();
  4499. CString photosno;
  4500. int i = 0;
  4501. for( i=0; i<m_List3.GetItemCount (); i++)
  4502. {
  4503. if(m_List3.GetItemText (i, 2)!="入底")continue;
  4504. photosno=m_no2array.ElementAt (i);break;
  4505. }
  4506. photosno=","+photosno+",";
  4507. for(i=m_patharray1.GetSize ()-1; i>=0; i--)
  4508. {
  4509. CString no;
  4510. no=m_patharray1.ElementAt (i);
  4511. no=no.Right (no.GetLength ()-no.ReverseFind ('\\')-1);
  4512. no=no.Left (no.Find ('.'));
  4513. no=","+no;
  4514. no+=",";
  4515. if(photosno.Find (no)!=-1)
  4516. {
  4517. no=m_patharray1.ElementAt (i);
  4518. m_patharray6.Add (no);
  4519. }
  4520. }
  4521. LoadPhotos();
  4522. }
  4523. BOOL ChoosePhotoSkin2::ReLoad()
  4524. {
  4525. if(m_mode2==0)
  4526. return GetData();
  4527. else
  4528. return GetData2();
  4529. }
  4530. BOOL ChoosePhotoSkin2::IsPhoto2Exist()
  4531. {
  4532. CString path2;
  4533. CString path=g_path2+"\\";
  4534. path+=m_strOrderNumber;
  4535. path +="\\";
  4536. using namespace helper_coffs;
  4537. ffsco o;
  4538. o.dirs(0);
  4539. o.find(LPCSTR(path), LPCSTR("*.jpg"));
  4540. ffsco::typeT coo;
  4541. coo = o.co_file();
  4542. return coo.size();
  4543. }
  4544. void ChoosePhotoSkin2::ReLoadPhoto()
  4545. {
  4546. if(!((MyBmpButton2*)m_picarray.ElementAt (8))->GetPushDown ())
  4547. {
  4548. m_path=g_path3+"\\";
  4549. m_path+=m_strOrderNumber;
  4550. m_path +="\\";
  4551. GetPhotos();
  4552. m_bChooseBig=0;
  4553. }
  4554. else
  4555. {
  4556. m_bChooseBig=1;
  4557. IsGrowthTx growthtxdlg;
  4558. growthtxdlg.m_mode=1;
  4559. growthtxdlg.m_strOrderNumber=m_strOrderNumber;
  4560. growthtxdlg.DoModal ();
  4561. m_bGrowthTX=growthtxdlg.m_bGrowthTx;
  4562. m_seltxname=growthtxdlg.m_seltxname;
  4563. m_patharray1.RemoveAll();
  4564. if(CheckHC()) //
  4565. {
  4566. CString str;
  4567. m_bFromLocal=1;
  4568. char path[MAX_PATH];
  4569. ::GetSystemDirectory (path, MAX_PATH);
  4570. CString sysdir=path;
  4571. sysdir+="\\lyfz";
  4572. ::CreateDirectory (sysdir, NULL);
  4573. sysdir+="\\";
  4574. sysdir+=m_strOrderNumber;
  4575. using namespace helper_coffs;
  4576. ffsco o;
  4577. o.dirs(1);
  4578. o.find(LPCSTR(sysdir), LPCSTR("*.jpg"));
  4579. ffsco::typeT coo;
  4580. ffsco::typeT::iterator it;
  4581. coo = o.co_file();
  4582. for (it = coo.begin();coo.end() != it;it ++)
  4583. {
  4584. str=(*it).c_str();
  4585. if(str.GetAt (str.ReverseFind ('\\')+1)!='s' && str.GetAt (str.ReverseFind ('\\')+1)!='m')
  4586. {
  4587. m_patharray1.Add (str);
  4588. }
  4589. }
  4590. }
  4591. if(m_patharray1.GetSize ()==0)
  4592. {
  4593. if(IsPhoto2Exist())
  4594. {
  4595. SelBrunDevice dlg;
  4596. dlg.m_mode=1;
  4597. if(dlg.DoModal ()==IDOK)
  4598. m_nChoosePhotoType=dlg.m_sel;
  4599. else
  4600. m_nChoosePhotoType=0;
  4601. //m_nChoosePhotoType=0 原片+修片 1:修片 2:原片
  4602. }
  4603. else AfxMessageBox("温馨提示:\r\n未找到初修片,将使用原片选片", MB_ICONINFORMATION);
  4604. {
  4605. CString path,path2;
  4606. m_path=g_path1+"\\";
  4607. m_path+=m_strOrderNumber;
  4608. m_path +="\\";
  4609. if(m_seltxname!="" && m_seltxname!="全部")
  4610. {
  4611. m_path+=m_seltxname;
  4612. m_path +="\\";
  4613. }
  4614. if(m_nChoosePhotoType==1) // 选片:修片
  4615. {
  4616. m_path=g_path2+"\\";
  4617. m_path+=m_strOrderNumber;
  4618. m_path +="\\";
  4619. }
  4620. CString filename;
  4621. using namespace helper_coffs;
  4622. ffsco o;
  4623. o.dirs(1);
  4624. o.find(LPCSTR(m_path), LPCSTR("*.*"));
  4625. ffsco::typeT coo;
  4626. ffsco::typeT::iterator it;
  4627. coo = o.co_file();
  4628. for (it = coo.begin();coo.end() != it;it ++)
  4629. {
  4630. path=(*it).c_str();
  4631. if(path.GetAt (path.ReverseFind ('\\')+1)!='s' && path.GetAt (path.ReverseFind ('\\')+1)!='m')
  4632. {
  4633. path.MakeLower ();
  4634. filename=path.Right(path.GetLength()-path.ReverseFind ('\\')-1);
  4635. if(filename.Find(".")!=-1)
  4636. filename=filename.Left(filename.Find("."));
  4637. if(!myisdigit(filename))continue;
  4638. if(m_nChoosePhotoType==1)
  4639. {
  4640. m_patharray1.Add (path);
  4641. }
  4642. else
  4643. {
  4644. path2=path;
  4645. if(m_nChoosePhotoType==0)
  4646. path2.Replace ("客户原片", "修好的片");
  4647. if(m_bGrowthTX==0)
  4648. {
  4649. int pos=path2.Find (m_strOrderNumber);
  4650. pos+=m_strOrderNumber.GetLength ();
  4651. int pos2=path2.ReverseFind ('\\');
  4652. path2=path2.Left (pos)+path2.Right (path2.GetLength ()-pos2);
  4653. }
  4654. if(m_nChoosePhotoType==0 && ::PathFileExists (path2))
  4655. {
  4656. m_patharray1.Add (path2);
  4657. }
  4658. else
  4659. {
  4660. path2.Replace (".raw", ".jpg");
  4661. if(::PathFileExists (path2))
  4662. {
  4663. m_patharray1.Add (path2);continue;
  4664. }
  4665. path2.Replace (".nef", ".jpg");
  4666. if(::PathFileExists (path2))
  4667. {
  4668. m_patharray1.Add (path2);continue;
  4669. }
  4670. path2.Replace (".cr2", ".jpg");
  4671. if(::PathFileExists (path2))
  4672. {
  4673. m_patharray1.Add (path2);continue;
  4674. }
  4675. else
  4676. {
  4677. if(path.Right(3)!="jpg")continue;
  4678. m_patharray1.Add (path);
  4679. }
  4680. }
  4681. }
  4682. }
  4683. }
  4684. }
  4685. // if(0)
  4686. {//多种修好的效果
  4687. CString path,path2;
  4688. path2=g_path2+"\\";
  4689. path2+=m_strOrderNumber;
  4690. path2 +="\\";
  4691. using namespace helper_coffs;
  4692. ffsco o;
  4693. o.dirs(0);
  4694. o.find(LPCSTR(path2), LPCSTR("*.jpg"));
  4695. ffsco::typeT coo;
  4696. ffsco::typeT::iterator it;
  4697. coo = o.co_file();
  4698. for (it = coo.begin(); coo.end() != it; it ++)
  4699. {
  4700. path=(*it).c_str();
  4701. if(path.GetAt (path.ReverseFind ('\\')+1)!='s' && path.GetAt (path.ReverseFind ('\\')+1)!='m')
  4702. {
  4703. path.MakeLower();
  4704. path2=path.Right (path.GetLength ()-path.ReverseFind ('\\')-1);
  4705. if(path2.Find ("-")!=-1)
  4706. {
  4707. m_patharray1.Add (path);
  4708. }
  4709. }
  4710. }
  4711. }
  4712. /////////////////
  4713. if(0)//atoi(g_cominfoarray.ElementAt(0).ElementAt(109))==0)
  4714. {
  4715. char path[MAX_PATH];
  4716. ::GetSystemDirectory (path, MAX_PATH);
  4717. CString sysdir=path;
  4718. sysdir+="\\lyfz";
  4719. ::CreateDirectory (sysdir, NULL);
  4720. sysdir+="\\";
  4721. sysdir+=m_strOrderNumber;
  4722. ::CreateDirectory (sysdir, NULL);
  4723. sysdir+="\\";
  4724. ImportPhoto dlg;
  4725. dlg.m_bCopyToLocal=1;
  4726. dlg.m_mode =1;
  4727. dlg.m_pArray=&m_patharray1;
  4728. dlg.m_savepath =sysdir;
  4729. dlg.DoModal ();
  4730. CStringArray temparray;
  4731. CString filename;
  4732. for(int i=0; i<m_patharray1.GetSize(); i++)
  4733. {
  4734. filename=m_patharray1.ElementAt(i);
  4735. filename=filename.Right (filename.GetLength ()-filename.ReverseFind ('\\')-1);
  4736. temparray.Add(sysdir+filename);
  4737. }
  4738. m_patharray1.RemoveAll();
  4739. m_patharray1.Copy(temparray);
  4740. }
  4741. }
  4742. if(m_patharray1.GetSize () && atoi(g_cominfoarray.ElementAt(0).ElementAt(61)))
  4743. {
  4744. int size=m_patharray1.GetSize ()-1;
  4745. CString sTemp;
  4746. int nPos;
  4747. for(int i=0;i<size;i++)
  4748. {
  4749. nPos=rand()%(size-i);
  4750. sTemp=m_patharray1.ElementAt (size-i);
  4751. m_patharray1.SetAt (size-i, m_patharray1.ElementAt (nPos));
  4752. m_patharray1.SetAt (nPos, sTemp);
  4753. }
  4754. }
  4755. }
  4756. m_mode=0;
  4757. LoadPhotos();
  4758. }
  4759. BOOL ChoosePhotoSkin2::CheckHC()//检查本机上是否有缓存的相片;
  4760. {
  4761. char path[MAX_PATH];
  4762. ::GetSystemDirectory (path, MAX_PATH); //printf("Jeff:CheckHC::path=%s\n\n",path);//Jeff Printf
  4763. CString sysdir=path;
  4764. sysdir+="\\lyfz";
  4765. ::CreateDirectory (sysdir, NULL); //printf("Jeff:CheckHC::sysdir1=%s\n\n",sysdir);//Jeff Printf
  4766. sysdir+="\\";
  4767. sysdir+=m_strOrderNumber; //printf("Jeff:CheckHC::sysdir2=%s\n\n",sysdir);//Jeff Printf
  4768. using namespace helper_coffs;
  4769. ffsco o;
  4770. o.dirs(0);
  4771. o.find(LPCSTR(sysdir), LPCSTR("*.jpg"));
  4772. ffsco::typeT coo;
  4773. coo = o.co_file();
  4774. if( coo.size())
  4775. {
  4776. if(AfxMessageBox("提醒, 此客人有本机缓存片,是否使用缓存片?", MB_YESNO|MB_ICONINFORMATION)==IDYES)
  4777. return 1;
  4778. }
  4779. return 0;
  4780. }