MainFrm.cpp 441 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895
  1. // MainFrm.cpp : implementation of the CMainFrame class 员工工作
  2. #include "stdafx.h"
  3. #include "YLGL.h"
  4. #include "resource.h"
  5. #include "MainFrm.h"
  6. #include <afxinet.h>
  7. #include "ConnectDlg.h"
  8. #include "SendDataDlg.h"
  9. #include "DinDanHistroy.h"
  10. #include "ShangPin.h"
  11. #include "SPLBDlg.h"
  12. #include "BuMenDlg.h"
  13. #include "Worker.h"
  14. #include "ShowPic3.h"
  15. #include "TXDlg.h"
  16. #include "TXSPDlg.h"
  17. #include "MsgReg2.h"
  18. #include "ProviderDlg.h"
  19. #include "Booking.h"
  20. #include "Booking2.h"
  21. #include "PayOutSet.h"
  22. #include "PayOutInput.h"
  23. #include "IncomeInput.h"
  24. #include "IncomeInput2.h"
  25. #include "IncomeInput3.h"
  26. #include "IncomeInput4.h"
  27. #include "DressEarlyWarning.h"
  28. #include "annualfee.h"
  29. #include "DailyForm.h"
  30. #include "MonthForm.h"
  31. #include "ProcessAlarm.h"
  32. #include "MonthForm2.h"
  33. #include "YearForm.h"
  34. #include "ClientForm.h"
  35. #include "ClientForm2.h"
  36. #include "ClientForm3.h"
  37. #include "DinDanFrom.h"
  38. #include "Satisfaction.h"
  39. #include "SatisfactionForm.h"
  40. #include "TodayForm.h"
  41. #include "WorkerReport.h"
  42. #include "TodayForm2.h"
  43. #include "SendInsideMsg2.h"
  44. #include "StoreInfoChart.h"
  45. #include "FixedAssets.h"
  46. #include "SPForm.h"
  47. #include "ShowMsg.h"
  48. #include "Account.h"
  49. #include "Login.h"
  50. #include "Login3.h"
  51. #include "Psw.h"
  52. #include "AreaDlg.h"
  53. #include "TakeFrom.h"
  54. #include "ChoosePhotoForm.h"
  55. #include "BeautifySkinFrom.h"
  56. #include "DesignFrom.h"
  57. #include "outsourcing.h"
  58. #include "ChoosePhotoSkin.h"
  59. #include "SalarySet.h"
  60. #include "SalarySet2.h"
  61. #include "MySalary.h"
  62. #include "PrintRX.h"
  63. #include "LoadRect.h"
  64. #include "PrintPreview.h"
  65. #include "SearchClient.h"
  66. #include "BeautifySkinFrom2.h"
  67. #include "FinanceForm.h"
  68. #include "PhotoPrintFrom.h"
  69. #include "SqlDlg.h"
  70. #include "YearForm2.h"
  71. #include "AreaClient.h"
  72. #include "DBConfig.h"
  73. #include "SetPathDlg2.h"
  74. #include "StaffAchievement.h"
  75. #include "BurnCD.h"
  76. #include "StaffAchievementSet.h"
  77. #include "StaffAchievementShowAll.h"
  78. #include "SelContent.h"
  79. #include "ClientMoney.h"
  80. #include "DelPhotoSet.h"
  81. #include "ompanyInfo.h"
  82. #include "ClientForm.h"
  83. #include "PhotoBak.h"
  84. #include "MsgReg.h"
  85. #include "SendMsg.h"
  86. #include "MsgSet.h"
  87. #include "ShowMember.h"
  88. #include "ShowMember2.h"
  89. #include "MemberSet.h"
  90. #include "DressManage.h"
  91. #include "ShowDress.h"
  92. #include "ShowPic.h"
  93. #include "ShowHireReg.h"
  94. #include "InputGoods.h"
  95. #include "ShowGoods.h"
  96. #include "CostCal.h"
  97. #include "Welcome.h"
  98. #include "EmployeeMsg.h"
  99. #include "TXFG.h"
  100. #include "EmployeeForm.h"
  101. #include "EmployeeForm2.h"
  102. #include "Client2Form.h"
  103. #include "Client2FormLYFZ.h"
  104. #include "OldClient.h"
  105. #include "ClientReasonChart.h"
  106. #include "ClientFromChart.h"
  107. #include "WorkMsg.h"
  108. #include "SetLoginTime.h"
  109. #include "SetLoginBan.h"
  110. #include "LoginReg.h"
  111. #include "LoginReg2.h"
  112. #include "PhoneRecord.h"
  113. #include "PhoneRecordOut.h"
  114. #include "MissCall.h"
  115. #include "InsideMsg.h"
  116. #include "Card2Reg.h"
  117. #include "Card2RegChart.h"
  118. #include "ShowMemberBlue.h"
  119. #include "Card2RegBlue.h"
  120. #include "Card2RegChartBlue.h"
  121. #include "DigitalWork.h"
  122. #include "HideWindow.h"
  123. #include "SalarySet3.h"
  124. #include "YearFormBranch.h"
  125. #include "YearFormBranch2.h"
  126. #include "Set.h"
  127. #include "DinDanFromBranch.h"
  128. #include "MemberChart.h"
  129. #include "ShowMemberMsg.h"
  130. #include "ShowBakState.h"
  131. #include "DinDanForm.h"
  132. #include "CalendarConvert.h"
  133. #include "ShowLOg.h"
  134. #include "HospitalClient.h"
  135. #include "HospitalClientAlarm.h"
  136. #include "HospitalInfoSet.h"
  137. #include "AddHospitalClient.h"
  138. #include "HospitalClientMsg.h"
  139. #if 1
  140. #include "FileManage.h"
  141. #endif
  142. #ifdef _DEBUG
  143. #define new DEBUG_NEW
  144. #undef THIS_FILE
  145. static char THIS_FILE[] = __FILE__;
  146. #endif
  147. #ifndef WINVER
  148. #define WINVER 0x0400
  149. #endif
  150. #ifndef _WIN32_WINNT
  151. #define _WIN32_WINNT 0x0400
  152. #endif
  153. #ifndef _WIN32_WINDOWS
  154. #define _WIN32_WINDOWS 0x0410
  155. #endif
  156. #ifndef _WIN32_IE
  157. #define _WIN32_IE 0x0400
  158. #endif
  159. #include "uxtheme.h "
  160. typedef HTHEME (__stdcall * POPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
  161. typedef HRESULT (__stdcall * PCLOSETHEMEDATA)(HTHEME hTheme);
  162. /************************************************************************/
  163. /*
  164. Jeff:g_conntype
  165. g_conntype == 0 :表示正常连接?(或是连接普通服务器?)
  166. g_conntype == 1 :表示连接公司服务器
  167. g_conntype == 2 :http://www.lyfz.net/download/ip.txt
  168. g_conntype == 3 :http://photo.bjlyfz.com/download/ip.txt
  169. g_conntype == 4 :
  170. */
  171. /************************************************************************/
  172. HHOOK g_hmouse=NULL; //g_sendhead zx.dll
  173. //extern void WriteClientLog(CString str); // Jeff写客户端日志;
  174. // Jeff.remark;
  175. // 函数:MouseProc
  176. // 参数:
  177. // nCode hook code
  178. // wParam message identifier
  179. // lParam mouse coordinates
  180. // 返回:
  181. //
  182. LRESULT CALLBACK MouseProc(int nCode,WPARAM wParam,LPARAM lParam)
  183. {
  184. if(g_pMainWnd)
  185. {
  186. if( atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
  187. {
  188. g_pMainWnd->KillTimer (5);
  189. g_pMainWnd->SetTimer (5, atoi(g_cominfoarray.ElementAt(0).ElementAt(134))*60*1000, NULL);
  190. }
  191. if(g_bSendLYFZ)
  192. {
  193. g_pMainWnd->KillTimer (7);
  194. g_pMainWnd->SetTimer (7, 5*60*1000, NULL);
  195. }
  196. }
  197. return CallNextHookEx(g_hmouse, nCode, wParam, lParam);
  198. }
  199. CRect g_rc;
  200. CMainFrame *g_pMainWnd=NULL;
  201. extern HWND g_hSendWnd;
  202. extern HWND g_hConnectWnd;
  203. /////////////////////////////////////////////////////////////////////////////
  204. // CMainFrame客人付款
  205. /////////////////////////////////////////////////////////////////////////////
  206. /////////////////////////////////////////////////////////////////////////////
  207. static void HandleClientNetEvent(IN SOCKET hSocket,
  208. IN ETransportEvent eEvent,
  209. IN void *pDataBuf,
  210. IN unsigned long nDataLen,
  211. IN int nError,
  212. IN void *pContext)
  213. {
  214. if( nError != TRANSPORT_OK )
  215. return;
  216. CMainFrame *pDlg = (CMainFrame *)pContext;
  217. if( NULL == pDlg )
  218. return;
  219. pDlg->ProcessNetEvent(eEvent, pDataBuf, nDataLen);
  220. }
  221. BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam)
  222. {
  223. CRect rtCtrl,rtWnd; // 子窗口,父窗口;
  224. if(hwnd)
  225. {
  226. ::GetWindowRect(hwnd,&rtCtrl); // 获取控件大小;
  227. ::GetWindowRect(GetParent(hwnd),&rtWnd); // 获取父窗口大小;
  228. // printf("Jeff:g_WidthScale=%d,g_HeightScale=%d,rtWnd.left=%d,rtWnd.top=%d\n\n",g_WidthScale,g_HeightScale,rtWnd.left,rtWnd.top);
  229. // printf("Jeff:old:ctrl.left=%d,ctrl.top=%d,ctrl.right=%d,ctrl.bottom=%d\n\n",rtCtrl.left,rtCtrl.top,rtCtrl.right,rtCtrl.bottom);
  230. rtCtrl.OffsetRect(-rtWnd.left,-rtWnd.top);
  231. float temp;
  232. temp= (float)rtCtrl.left*g_WidthScale;
  233. rtCtrl.left = (int)temp+g_dx;
  234. temp= (float)rtCtrl.top*g_HeightScale;
  235. rtCtrl.top = (int)temp+g_dy;
  236. temp = (float)rtCtrl.right*g_WidthScale;
  237. rtCtrl.right = (int)temp+g_dx;
  238. temp =(float)rtCtrl.bottom*g_HeightScale;
  239. rtCtrl.bottom =(int)temp+g_dy;
  240. //printf("Jeff:new:ctrl.left=%d,ctrl.top=%d,ctrl.right=%d,ctrl.bottom=%d\n\n",rtCtrl.left,rtCtrl.top,rtCtrl.right,rtCtrl.bottom);
  241. ::MoveWindow(hwnd,rtCtrl.left,rtCtrl.top,rtCtrl.Width(),rtCtrl.Height(),TRUE);
  242. return TRUE;
  243. }
  244. else
  245. {
  246. return FALSE;
  247. }
  248. }
  249. IMPLEMENT_DYNCREATE(CMainFrame, CMDIFrameWnd)
  250. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  251. //{{AFX_MSG_MAP(CMainFrame)
  252. ON_WM_CREATE()
  253. ON_WM_DESTROY()
  254. ON_WM_CLOSE()
  255. ON_WM_TIMER()
  256. ON_COMMAND(IDM_choosephotoskin, Onchoosephotoskin)
  257. ON_COMMAND(IDM_PATH, OnPath)
  258. ON_COMMAND(IDM_SERVER, OnServer)
  259. ON_COMMAND(IDM_SHOWHIS, OnShowhis)
  260. ON_COMMAND(IDM_StaffAchievementShow, OnStaffAchievementShow)
  261. ON_COMMAND(IDM_AUTODELPHOTO, OnAutodelphoto)
  262. ON_COMMAND(IDM_PHOTOMANAGE, Onphotomanage)
  263. ON_COMMAND(IDM_COMPANYINFO, OnCompanyinfo)
  264. ON_COMMAND(IDM_HELPFILE, OnHelpfile)
  265. ON_COMMAND(IDM_PHOTOBAK, OnPhotobak)
  266. ON_COMMAND(IDM_TAOXIFG, OnTaoxifg)
  267. ON_COMMAND(IDM_ShowBakState, OnShowBakState)
  268. ON_WM_NCLBUTTONDBLCLK()
  269. ON_WM_NCHITTEST()
  270. ON_COMMAND(IDM_LOG, OnLog)
  271. //}}AFX_MSG_MAP
  272. ON_COMMAND_RANGE(0, 50000, OnCommandMenu)
  273. END_MESSAGE_MAP()
  274. static UINT indicators[] =
  275. {
  276. ID_SEPARATOR, // status line indicator
  277. ID_INDICATOR_CAPS,
  278. ID_INDICATOR_NUM,
  279. ID_INDICATOR_SCRL,
  280. };
  281. /////////////////////////////////////////////////////////////////////////////
  282. // CMainFrame construction/destruction
  283. UINT CMainFrame::OnNcHitTest(CPoint point)
  284. {
  285. if(CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
  286. return HTCLIENT;
  287. return CWnd::OnNcHitTest(point);
  288. }
  289. void CMainFrame::OnNcLButtonDblClk(UINT nFlags, CPoint point)
  290. {
  291. if(nFlags != HTCAPTION)
  292. CMDIFrameWnd::OnNcLButtonDblClk(nFlags, point);
  293. }
  294. CMainFrame::CMainFrame()
  295. {
  296. // TODO: add member initialization code here
  297. SetConnectionID(INVALID_SOCKET);
  298. m_pMainFrimDlg2=NULL;
  299. CString version = _T ("Version 1.0");
  300. m_bCheckF2F3=AfxGetApp()->GetProfileInt (version, "f2f3", 0);
  301. if(0==::PathFileExists(g_mainpath+"\\skin\\5.lia"))
  302. {
  303. g_bNoLoginLia=1;
  304. }
  305. }
  306. CMainFrame::~CMainFrame()
  307. {
  308. if(m_pMainFrimDlg2)
  309. {
  310. m_pMainFrimDlg2->DestroyWindow ();
  311. delete m_pMainFrimDlg2;
  312. }
  313. }
  314. void InTheMe(HWND m_hWnd)
  315. {
  316. BOOL bXpVisualStyle=FALSE;
  317. OSVERSIONINFO osvi;
  318. osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  319. ::GetVersionEx (&osvi);
  320. if((osvi.dwPlatformId==VER_PLATFORM_WIN32_NT)&&(osvi.dwMajorVersion>=5)&&(osvi.dwMinorVersion>=1))
  321. {
  322. HMODULE hUxTheme=::LoadLibrary(_T( "UxTheme.dll"));
  323. POPENTHEMEDATA pOpenThemeData;
  324. PCLOSETHEMEDATA pCloseThemeData;
  325. if(hUxTheme!=NULL)
  326. {
  327. pOpenThemeData=(POPENTHEMEDATA)::GetProcAddress(hUxTheme, "OpenThemeData");
  328. pCloseThemeData=(PCLOSETHEMEDATA)::GetProcAddress (hUxTheme, "CloseThemeData");
  329. HTHEME hButtonTheme=(*pOpenThemeData)(m_hWnd,L"BUTTON");
  330. if(hButtonTheme!=NULL)
  331. bXpVisualStyle=TRUE;
  332. (*pCloseThemeData)(hButtonTheme);
  333. }
  334. ::FreeLibrary(hUxTheme);
  335. }
  336. if(bXpVisualStyle)
  337. AfxMessageBox(_T( "正在使用视觉主题 "));
  338. else
  339. AfxMessageBox(_T( "没有使用视觉主题 "));
  340. }
  341. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  342. {
  343. if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  344. {
  345. // Jeff.创建失败的可能性小,加日志输出;
  346. return -1;
  347. }
  348. if(g_server.Find (".ly.com")!=-1)
  349. {
  350. g_ntimeout=30000;
  351. }
  352. if(::PathFileExists (g_mainpath+"\\logo.ico"))
  353. {
  354. Bitmap *bmp=NULL;
  355. LoadImageFromFile (&bmp, g_mainpath+"\\logo.ico");
  356. // m_hIcon = AfxGetApp()->LoadIcon(g_mainpath+"\\logo.ico");
  357. bmp->GetHICON(&m_hIcon);
  358. delete bmp;
  359. SetIcon(m_hIcon, TRUE); // Set big icon
  360. SetIcon(m_hIcon, FALSE); // Set small icon
  361. }
  362. if(!m_wndClient.SubclassWindow (m_hWndMDIClient))
  363. {
  364. // Jeff.创建失败的可能性小,加日志输出;
  365. return -1;
  366. }
  367. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  368. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  369. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  370. {
  371. // Jeff.创建失败的可能性小,加日志输出;
  372. TRACE0("Failed to create toolbar\n");
  373. return -1; // fail to create
  374. }
  375. m_wndToolBar.LoadTrueColorToolBar(90, IDB_NORMAL, 0, IDB_DISABLE);
  376. // second toolbar must have different ID
  377. if (!m_wndToolBar2.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT | CBRS_NOALIGN,
  378. AFX_IDW_CONTROLBAR_FIRST + 32) ||
  379. !m_wndToolBar2.LoadToolBar(IDR_TOOLBAR1))
  380. {
  381. // Jeff.创建失败的可能性小,加日志输出;
  382. TRACE0("Failed to create toolbar\n");
  383. return -1; // fail to create
  384. }
  385. #ifndef NEW_SKIN
  386. if (!m_wndStatusBar.Create(this) ||
  387. !m_wndStatusBar.SetIndicators(indicators,
  388. sizeof(indicators)/sizeof(UINT)))
  389. {
  390. // Jeff.创建失败的可能性小,加日志输出;
  391. TRACE0("Failed to create status bar\n");
  392. return -1; // fail to create
  393. }
  394. m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_NORMAL,200);
  395. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  396. #endif
  397. // TODO: Delete these three lines if you don't want the toolbar to
  398. // be dockable
  399. NewMenu2();
  400. ::GetWindowRect (this->m_hWndMDIClient, g_rc);
  401. /* CString ss;
  402. ss.Format ("%d,%d,%d,%d", g_rc.left , g_rc.top , g_rc.right , g_rc.bottom );
  403. AfxMessageBox(ss);*/
  404. g_pMainWnd=this;
  405. m_wndToolBar2.Init ();
  406. g_rc.top +=38;
  407. g_rc.left +=160;
  408. /* m_WidthScale = (float)g_rc.Width ()/722;
  409. m_HeightScale = (float)g_rc.Height ()/533;*/
  410. g_user.bLongin =0;
  411. SetTimer(1, 100, NULL);
  412. return 0;
  413. }
  414. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  415. {
  416. if( !CMDIFrameWnd::PreCreateWindow(cs) )
  417. return FALSE;
  418. // TODO: Modify the Window class or styles here by modifying
  419. // the CREATESTRUCT cs
  420. cs.style&=~WS_MAXIMIZEBOX;
  421. cs.style&=~WS_THICKFRAME;
  422. cs.lpszName=g_title+"影楼管理系统";
  423. cs.style&=~FWS_ADDTOTITLE;
  424. RECT rect;
  425. HWND hWnd = ::FindWindow("Shell_TrayWnd", 0);
  426. ::GetWindowRect(hWnd,&rect);
  427. cs.x=0;
  428. cs.y=0;
  429. cs.cx=GetSystemMetrics(SM_CXSCREEN);
  430. cs.cy=GetSystemMetrics(SM_CYSCREEN)-(rect.bottom -rect.top)+3;
  431. return TRUE;
  432. }
  433. /////////////////////////////////////////////////////////////////////////////
  434. // CMainFrame diagnostics
  435. #ifdef _DEBUG
  436. void CMainFrame::AssertValid() const
  437. {
  438. CMDIFrameWnd::AssertValid();
  439. }
  440. void CMainFrame::Dump(CDumpContext& dc) const
  441. {
  442. CMDIFrameWnd::Dump(dc);
  443. }
  444. #endif //_DEBUG
  445. /////////////////////////////////////////////////////////////////////////////
  446. // CMainFrame message handlers
  447. void CMainFrame::OnDestroy()
  448. {
  449. //WriteLog("退出系统");//Jeff.add
  450. OnDisconnect();
  451. Transport_UnInit();
  452. m_Mdi.DeleteAll();
  453. if(g_hmouse)UnhookWindowsHookEx(g_hmouse);
  454. CMDIFrameWnd::OnDestroy();
  455. }
  456. void CMainFrame::OnClose()
  457. {
  458. g_bShowBar=0;
  459. if(m_Mdi.MainClose())
  460. CMDIFrameWnd::OnClose();
  461. }//连接
  462. void CMainFrame::NewMenu2()
  463. {
  464. CMenu *pMemu=GetMenu();
  465. #ifdef BASIC_VERSION
  466. CMenu* submenu = pMemu->GetSubMenu(1);
  467. //submenu->RemoveMenu (IDM_StaffAchievementShow, MF_BYCOMMAND );//Jeff del 2014.06.16
  468. submenu->RemoveMenu (IDM_salaryset, MF_BYCOMMAND );
  469. #endif
  470. #if 0 // 此机用选片菜单项,去掉不用;
  471. {
  472. CString version = _T ("Version 1.0");
  473. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  474. if(checked)
  475. {
  476. CMenu* submenu = pMemu->GetSubMenu(1);
  477. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  478. }
  479. }
  480. #endif
  481. #ifndef BASIC_VERSION
  482. {
  483. CString version = _T ("Version 1.0");
  484. BOOL checked=AfxGetApp()->GetProfileInt (version, "status2", 0);
  485. if(checked)
  486. {
  487. #if 0 // Jeff:去掉菜单,此机用于员工业绩查看的菜单选项;
  488. CMenu* submenu = pMemu->GetSubMenu(1);
  489. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  490. #endif
  491. g_bStaffAchievementShow=1;
  492. SetTimer(3, 100, NULL);
  493. }
  494. }
  495. #endif
  496. if(g_bShowOK==0)
  497. {
  498. CMenu* submenu = pMemu->GetSubMenu(2);
  499. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  500. }
  501. }
  502. HMENU CMainFrame::NewMenu()
  503. {
  504. //设置菜单为XP风格 IDM_SHOWHIS
  505. BCMenu::SetMenuDrawMode(1);
  506. //若取消下面这句注释,则可看到菜单的图标栏和文字栏背景颜色为白色,
  507. //文字颜色为蓝色,选中项的前景色为紫红色
  508. //m_menuXP.SetMenuXPItemColor(0x00FFFFFF,0x00FFFFFF,0x00FF0000,0x00FF00FF);
  509. // 设置菜单中图标大小为32×32
  510. // m_menuXP.SetIconSize(32,32);
  511. // 加载菜单资源
  512. m_menuXP.LoadMenu(IDR_MAINFRAME);
  513. // 加载菜单对应的工具栏资源
  514. // m_menuXP.LoadToolbar(IDR_MAINFRAME);
  515. /*由于菜单左边栏中默认的图标大小为16×16,而与之对应的Toolbar中图标大小为32×32,
  516. 因此菜单中图标不能正确显示,只显示出工具栏中图标的左上角部分,所以修改菜单中各
  517. 项对应的图标为24b色位图资源IDB_***,或者在LoadMenu之前调用SetIconSize,设置菜单
  518. 中图标大小为32×32*/
  519. // m_menuXP.SetIconSize(24,24);
  520. // m_menuXP.ModifyODMenu(NULL,IDM_YWBU,IDB_YW); //
  521. /* m_menuXP.ModifyODMenu(NULL,ID_FILE_OPEN,IDB_BITMAP5);
  522. m_menuXP.ModifyODMenu(NULL,ID_FILE_SAVE,IDB_BITMAP7);
  523. m_menuXP.ModifyODMenu(NULL,ID_FILE_PRINT,IDB_BITMAP6);
  524. m_menuXP.ModifyODMenu(NULL,ID_APP_ABOUT,IDB_BITMAP3);
  525. m_menuXP.ModifyODMenu(NULL,ID_APP_EXIT,IDB_BITMAP2);*/
  526. // m_menuXP.EnableMenuItem (0, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  527. // m_menuXP.EnableMenuItem (2, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  528. // m_menuXP.EnableMenuItem (3, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  529. // m_menuXP.EnableMenuItem (4, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  530. // m_menuXP.EnableMenuItem (5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  531. // m_menuXP.EnableMenuItem (8, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  532. #if 0 // Jeff此机用选片菜单项不用;
  533. {
  534. CString version = _T ("Version 1.0");
  535. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  536. if(checked)
  537. {
  538. CMenu* submenu = m_menuXP.GetSubMenu(1);
  539. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  540. }
  541. }
  542. #endif
  543. {
  544. CString version = _T ("Version 1.0");
  545. BOOL checked=AfxGetApp()->GetProfileInt (version, "status2", 0);
  546. if(checked)
  547. {
  548. #if 0 // Jeff:去掉此机用于员工业绩查看的菜单选项;
  549. CMenu* submenu = m_menuXP.GetSubMenu(1);
  550. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  551. #endif
  552. g_bStaffAchievementShow=1;
  553. SetTimer(3, 100, NULL);
  554. }
  555. }
  556. if(g_bShowOK==0)
  557. {
  558. CMenu* submenu = m_menuXP.GetSubMenu(2);
  559. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  560. }
  561. return(m_menuXP.Detach());
  562. }
  563. ///////////////////////////////////////////////////////
  564. //减少代码
  565. #define OPEN_MENU(x) m_Mdi.Append(pName, RUNTIME_CLASS(x), IDR_MAINFRAME, this, nID)
  566. //响应菜单命令
  567. void CMainFrame::OnCommandMenu(UINT nID)
  568. {
  569. if(nID>=2000 && nID<=2100)
  570. {
  571. OnBranchData(nID);
  572. return;
  573. }
  574. if(g_user.bLongin==0)
  575. {
  576. if(g_bNoLoginLia)
  577. {
  578. Login dlg;
  579. dlg.SetLiaPath ("5.lia");
  580. dlg.DoModal();
  581. }
  582. else
  583. {
  584. Login3 dlg;
  585. dlg.SetLiaPath ("5.lia");
  586. dlg.DoModal();
  587. }
  588. return;
  589. if(g_user.bLongin==0)return;
  590. }
  591. else
  592. {
  593. InsideMsg();
  594. }
  595. ResetTimer();
  596. if(nID>=1000 && nID<=1100)
  597. {
  598. OnHistory(nID);
  599. return;
  600. }
  601. LPSTR pName ;
  602. //打开窗口
  603. switch(nID)
  604. {
  605. case IDM_PayOutSet:
  606. {
  607. if(IsHasRights(16)==0)return;
  608. PayOutSet dlg;
  609. dlg.DoModal ();
  610. return;
  611. }
  612. case IDM_SPLB:
  613. {
  614. if(IsHasRightsnew(29)==0)return;
  615. SPLBDlg dlg;
  616. dlg.DoModal ();
  617. return;
  618. }
  619. case IDM_JD:
  620. {
  621. if(IsHasRightsnew(49)==0)return;
  622. SPLBDlg dlg;
  623. dlg.m_mode=1;
  624. dlg.DoModal ();
  625. return;
  626. }
  627. case IDM_AREA:
  628. {
  629. if(IsHasRightsnew(47)==0)return;
  630. AreaDlg dlg;
  631. dlg.DoModal ();
  632. return;
  633. }
  634. case IDM_Psw:
  635. {
  636. Psw dlg;
  637. dlg.DoModal ();
  638. return;
  639. }
  640. case IDM_Set:
  641. {
  642. if(IsHasRightsnew(49)==0)return;
  643. /* if(g_bBranchModify)
  644. {
  645. AfxMessageBox("系统设置不支持远程访问,请直接访问该分店!", MB_ICONINFORMATION);
  646. return;
  647. }*/
  648. Set dlg;
  649. dlg.DoModal();
  650. //if(dlg.DoModal() != IDOK)
  651. //{
  652. //AfxMessageBox("789");
  653. //Set::SetCancle();
  654. //}
  655. return;
  656. }
  657. case IDM_HIDEWINDOW:
  658. {
  659. HideWindow dlg;
  660. dlg.DoModal ();
  661. return;
  662. }
  663. case IDM_Logout:// Jeff.注销;
  664. {
  665. WriteLog("退出系统");//Jeff.add;
  666. g_user.bLongin=0;
  667. g_user.name.Empty();
  668. g_user.rights.Empty();
  669. g_user.account.Empty();
  670. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  671. g_pMainWnd2->RefreshOutlookBar();
  672. #ifndef NEW_SKIN
  673. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  674. #endif
  675. m_Mdi.CloseAll();
  676. #ifdef ENTERPRISE_VERSION
  677. g_branchname.Empty();
  678. g_branchip.Empty();
  679. g_pMainWnd->OnDisconnect();
  680. g_bBranchModify=0;
  681. #endif
  682. if(g_pMainWnd2)
  683. {
  684. g_pMainWnd2->DrawLogin();
  685. g_pMainWnd2->ShowBar(0);
  686. }
  687. g_hisyeararray.RemoveAll();
  688. g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
  689. g_brancharray.RemoveAll();
  690. g_pMainWnd->AddBranchMenu(&g_brancharray);
  691. if(g_bNoLoginLia)
  692. {
  693. Login dlg;
  694. dlg.SetLiaPath ("5.lia");
  695. dlg.DoModal();
  696. }
  697. else
  698. {
  699. Login3 dlg;
  700. dlg.SetLiaPath ("5.lia");
  701. dlg.DoModal();
  702. }
  703. if(g_user.bLongin==0)
  704. if(g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  705. return;
  706. }
  707. case IDM_TODAY:
  708. pName = (LPSTR)(LPCSTR)"历史订单";
  709. // OPEN_MENU(SalarySet3);
  710. OPEN_MENU(DinDanHistroy);
  711. break;
  712. case IDM_TAKECONTROL:
  713. pName = (LPSTR)(LPCSTR)"摄控表";
  714. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))
  715. OPEN_MENU(TodayForm2);
  716. else
  717. OPEN_MENU(TodayForm);
  718. break;
  719. case IDM_CLIENTMONEY:
  720. pName = (LPSTR)(LPCSTR)"客人付款";
  721. OPEN_MENU(ClientMoney);
  722. break;
  723. case IDM_TAKEAWAYBOOK:
  724. pName = (LPSTR)(LPCSTR)"发片/取件";
  725. OPEN_MENU(outsourcing);
  726. break;
  727. case IDM_CODE:
  728. pName = (LPSTR)(LPCSTR)"商品报表";
  729. OPEN_MENU(SPForm);
  730. break;
  731. case IDM_Daily:
  732. // if(IsHasRightsnew(22)==0)return;
  733. // pName = (LPSTR)(LPCSTR)"日财务表";
  734. // OPEN_MENU(DailyForm);
  735. pName = (LPSTR)(LPCSTR)"沟通助手";
  736. OPEN_MENU(InsideMsg);
  737. break;
  738. case IDM_ProcessAlarm:
  739. pName = (LPSTR)(LPCSTR)"流程监控";
  740. OPEN_MENU(ProcessAlarm);
  741. break;
  742. case IDM_DINDAN:
  743. // if(IsHasRights(7)==0)return;
  744. pName = (LPSTR)(LPCSTR)"订单报表";
  745. OPEN_MENU(DinDanFrom);
  746. break;
  747. case IDM_CLIENT:
  748. //if(IsHasRights(8)==0)return;
  749. pName = (LPSTR)(LPCSTR)"客户报表";
  750. OPEN_MENU(CClientForm);
  751. break;
  752. case IDM_PayOutInput:
  753. if(IsHasRightsnew(20)==0)return;
  754. pName = (LPSTR)(LPCSTR)"现金支出";
  755. OPEN_MENU(PayOutInput);
  756. break;
  757. case IDM_salaryset:
  758. if(IsHasRightsnew(25)==0)return;
  759. pName = (LPSTR)(LPCSTR)"工资设置";
  760. OPEN_MENU(SalarySet);
  761. break;
  762. case IDM_mysalary:
  763. if(IsHasRights(16)==0)return;
  764. pName = (LPSTR)(LPCSTR)"我的工资";
  765. OPEN_MENU(MySalary);
  766. break;
  767. case IDM_SP:
  768. // if(IsHasRightsnew(29)==0)return;
  769. pName = (LPSTR)(LPCSTR)"商品设置";
  770. OPEN_MENU(ShangPin);
  771. break;
  772. case IDM_WORKER:
  773. if(IsHasRightsnew(27)==0)return;
  774. pName = (LPSTR)(LPCSTR)"员工设置";
  775. OPEN_MENU(Worker);
  776. break;
  777. case IDM_TAOXI:
  778. if(IsHasRightsnew(30)==0)return;
  779. pName = (LPSTR)(LPCSTR)"套系设置";
  780. OPEN_MENU(TXDlg);
  781. break;
  782. case IDM_TAOXISP:
  783. if(IsHasRightsnew(30)==0)return;
  784. pName = (LPSTR)(LPCSTR)"套系赠送商品设置";
  785. OPEN_MENU(TXSPDlg);
  786. break;
  787. case IDM_Provider:
  788. if(IsHasRightsnew(32)==0)return;
  789. pName = (LPSTR)(LPCSTR)"供应商设置";
  790. OPEN_MENU(ProviderDlg);
  791. break;
  792. case IDM_BUMEN:
  793. {if(IsHasRightsnew(49)==0)return;
  794. BuMenDlg dlg;
  795. dlg.DoModal ();
  796. return;
  797. }
  798. case IDM_Account:
  799. if(IsHasRightsnew(49)==0)return;
  800. pName = (LPSTR)(LPCSTR)"账号管理";
  801. OPEN_MENU(Account);
  802. break;
  803. case IDM_YLCD:
  804. {
  805. //AfxMessageBox("IDM_YLCD");
  806. ::CopyFile (_T(g_path7+"\\接单系统\\Regsvr32.exe"), _T(g_mainpath+"\\Regsvr32.exe"), 0);
  807. ::CopyFile (_T(g_path7+"\\接单系统\\Flash9f.ocx"), _T(g_mainpath+"\\Flash9f.ocx"), 0);
  808. CString temp;
  809. temp.Format ("%s\\regsvr32.exe /s %s\\Flash9f.OCX", g_mainpath,g_mainpath);
  810. WinExec(temp,SW_HIDE);
  811. ::CopyFile (_T(g_path7+"\\接单系统\\接单系统.exe"), _T(g_mainpath+"\\接单系统.exe"), 0);
  812. ::CopyFile (_T(g_path7+"\\接单系统\\my32.dll"), _T(g_mainpath+"\\my32.dll"), 0);
  813. ::CopyFile (_T(g_path7+"\\接单系统\\server.dat"), _T(g_mainpath+"\\server.dat"), 0);
  814. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\接单系统.exe"), g_server, NULL, SW_SHOWNORMAL);
  815. }
  816. break;
  817. case IDM_YLCDMANAGE:
  818. ::CopyFile (_T(g_path7+"\\接单系统\\资源管理器.exe"), _T(g_mainpath+"\\资源管理器.exe"), 0);
  819. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\资源管理器.exe"), g_server, NULL, SW_SHOWNORMAL);
  820. break;
  821. }
  822. }
  823. //减少代码
  824. ///////////////////////////////////////////////////////////////////////////////
  825. void CMainFrame::OnDisconnect()
  826. {
  827. m_tClientTunnel.net_CloseSocket();
  828. SetConnectionID(INVALID_SOCKET);
  829. }
  830. void CMainFrame::ProcessLoginResponse(void *pLoginResult)
  831. {
  832. if( NULL == pLoginResult ) return;
  833. LOGIN_RESULT_STRU *ptLoginResult = (LOGIN_RESULT_STRU *)pLoginResult;
  834. DWORD dwConnectionID = ptLoginResult->tCommonMsg.dwConnectionID;
  835. SetConnectionID(dwConnectionID);
  836. BYTE byResult = ptLoginResult->byResult;
  837. if(LOGIN_RESULT_SUC == byResult)
  838. {
  839. }
  840. else
  841. {
  842. OnDisconnect();
  843. }
  844. }
  845. BOOL CMainFrame::ProcessLoginRequest()
  846. {
  847. // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
  848. WORD wMessageId = MSG_LOGIN_REQ;
  849. // 2.填充发送数据;
  850. TLOGIN_STRU tLogonInfo = {0};
  851. tLogonInfo.tCommonMsg.dwConnectionID = GetConnectionID();//此时m_dwConnectionID为INVALIDE_SOCKET;
  852. tLogonInfo.tCommonMsg.wMessageId = wMessageId;
  853. CString strUserName = newGUID();// 以随机数作为登陆时的用户名称;
  854. strUserName.TrimLeft();
  855. strUserName.TrimRight();
  856. strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
  857. DWORD dwDataLen = sizeof(TLOGIN_STRU);
  858. // 3.填充数据头;
  859. TMessageHeader tHeader = {0};
  860. tHeader.wMessageId = wMessageId;
  861. tHeader.dwDataLen = dwDataLen;
  862. // 4.发送数据;
  863. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)&tLogonInfo, dwDataLen);
  864. if( ulSendLen == SOCKET_ERROR )
  865. {
  866. return 0;
  867. }
  868. return 1;
  869. }
  870. DWORD CMainFrame::GetConnectionID()
  871. {
  872. return m_dwConnectionID;
  873. }
  874. void CMainFrame::SetConnectionID(DWORD dwConnection)
  875. {
  876. m_dwConnectionID = dwConnection;
  877. }
  878. /************************************************************************/
  879. /*
  880. Date: 2015-04-11
  881. Author: Jeff
  882. 函数:GetSharePathInfo
  883. 描述:获取共享目录表的所有信息;
  884. 参数:
  885. 返回:成功返回TRUE;
  886. 注意:获取的表记录存储在全局变量g_aryOfSharePathInfo中;
  887. 调用约定:在登陆软件时调用,且必须连接的服务器是本店的;
  888. */
  889. /************************************************************************/
  890. BOOL CMainFrame::GetSharePathInfo()
  891. {
  892. // 1.连接的数据库必须是本局域网的服务器;
  893. if ( g_bAllBranch || !g_branchname.IsEmpty() || !g_branchip.IsEmpty() )
  894. {
  895. // 非当前局域网服务器;
  896. return FALSE;
  897. }
  898. // 2.获取当前连接的分店域名是否与g_domain一致;
  899. g_sendhead.bsql = 0;
  900. g_sendhead.code[0] = 29;
  901. g_sendhead.tabcount = 1;
  902. g_pMainWnd->ProcessChatMessageRequest2(23);
  903. if ( !g_bSendOK )
  904. {
  905. // 连接服务器失败;
  906. return FALSE;
  907. }
  908. CArray<CStringArray,CStringArray> strArray;
  909. DataToArray(&strArray);
  910. CString strCurBranchDomain = _T("");
  911. if ( strArray.GetSize() )
  912. {
  913. strCurBranchDomain = strArray.ElementAt(0).ElementAt(0);
  914. if ( strCurBranchDomain.Find(_T(".ly.com")) == -1)
  915. {
  916. // 当前获取的域名有错;
  917. return FALSE;
  918. }
  919. }
  920. if ( g_domain.CompareNoCase(strCurBranchDomain) != 0)
  921. {
  922. // 当前连接的分店域名与局域网服务器域名不一致;
  923. return FALSE;
  924. }
  925. // 3.获取可用的共享信息;//select * from NetShareInfo where enable = 1;
  926. CString strFilter = _T("");
  927. strFilter.Format(_T("enable = 1"));
  928. g_sendhead.bsql = 0;
  929. g_sendhead.code[0] = 300;
  930. g_sendhead.tabcount = 1;
  931. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  932. if ( !g_bSendOK )
  933. {
  934. // 获取共享信息失败;
  935. return FALSE;
  936. }
  937. g_aryOfSharePathInfo.RemoveAll();
  938. DataToArray(&g_aryOfSharePathInfo);
  939. return g_aryOfSharePathInfo.GetSize() ? TRUE : FALSE;
  940. }
  941. //*********************************************//
  942. /*
  943. 函数:ProcessChatMessageRequest2
  944. 参数:BYTE code [IN]
  945. 返回:无
  946. 过程:OnConnect() -> ProcessChatMessageRequest()
  947. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  948. 2.SendDataDlg计时器里调用CConnectDlg对话框
  949. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  950. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  951. 5.关闭对话框和断开连接;
  952. */
  953. //*********************************************//
  954. void CMainFrame::ProcessChatMessageRequest2(BYTE code)
  955. {
  956. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  957. SendDataDlg dlg;
  958. dlg.m_bycode =code;
  959. dlg.DoModal();
  960. }
  961. //*********************************************//
  962. /*
  963. 函数:ProcessChatMessageRequest2
  964. 参数:CString sql [IN]
  965. 返回:无
  966. 过程:OnConnect() -> ProcessChatMessageRequest()
  967. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  968. 2.SendDataDlg计时器里调用CConnectDlg对话框
  969. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  970. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  971. 5.关闭对话框和断开连接;
  972. */
  973. //*********************************************//
  974. void CMainFrame::ProcessChatMessageRequest2(CString sql)
  975. {
  976. if( (sql.Find ("insert")!=-1 || sql.Find ("update")!=-1 || sql.Find ("delete")!=-1) && g_branchname!="" && g_bBranchModify==0)
  977. {
  978. AfxMessageBox("当前为分店数据查看状态,不能更改分店数据!", MB_ICONSTOP);
  979. g_bSendOK=0;
  980. return;
  981. }
  982. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  983. SendDataDlg dlg;
  984. dlg.m_strSQL = sql;
  985. dlg.DoModal ();
  986. }
  987. //*********************************************//
  988. /*
  989. 函数:ProcessChatMessageRequest2
  990. 参数:BYTE *pData [IN], int length [IN]
  991. 返回:无
  992. 过程:OnConnect() -> ProcessChatMessageRequest()
  993. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  994. 2.SendDataDlg计时器里调用CConnectDlg对话框
  995. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  996. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  997. 5.关闭对话框和断开连接;
  998. */
  999. //*********************************************//
  1000. void CMainFrame::ProcessChatMessageRequest2(BYTE *pData, int length)
  1001. {
  1002. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  1003. SendDataDlg dlg;
  1004. dlg.m_pData =pData;
  1005. dlg.m_nlength =length;
  1006. dlg.DoModal ();
  1007. }
  1008. /************************************************************************/
  1009. /*
  1010. 函数:ProcessChatMessageRequest
  1011. 描述:对服务发送数据;
  1012. 参数:void *szDataBuf[IN], int nDataLen[IN]
  1013. 返回:发送成功与否;
  1014. */
  1015. /************************************************************************/
  1016. BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)
  1017. {
  1018. // 1.获取当前与服务器连接的id;
  1019. DWORD dwFromUserID = GetConnectionID();
  1020. // 2.设置通信类型为MSG_CHATMESSAGE_REQ;
  1021. WORD wMessageId = MSG_CHATMESSAGE_REQ;
  1022. // 3.计算出欲发送的数据的长度 dwDataLen;
  1023. DWORD dwDataLen = sizeof(TCHAT_MESSAGE_STRU) + nDataLen;
  1024. BYTE *pSendData = new BYTE[dwDataLen];
  1025. TCHAT_MESSAGE_STRU *pChatMessage=(TCHAT_MESSAGE_STRU*)pSendData;
  1026. memset(pChatMessage, 0x00, dwDataLen);
  1027. // 3.1.g_nYearpos第一次与服务端通信时为-1;
  1028. if(g_nYearpos == -1)
  1029. g_sendhead.length[99]=g_nYearpos;
  1030. else
  1031. g_sendhead.length[99]=g_nYearpos*32142953+10966236;
  1032. g_sendhead.length[98]=987123768;
  1033. memcpy(pSendData, &g_sendhead, sizeof(g_sendhead));
  1034. #ifdef ENTERPRISE_VERSION
  1035. if(g_bBranchModify==0)
  1036. strcpy(pChatMessage->szFromUserName, g_branchname);
  1037. #endif
  1038. // 4.填充发送的数据结构;
  1039. pChatMessage->tCommonMsg.dwConnectionID = GetConnectionID();
  1040. pChatMessage->tCommonMsg.wMessageId = wMessageId;
  1041. pChatMessage->dwFromUserID = dwFromUserID;
  1042. pChatMessage->dwToUserID = g_nSendCode;//▲▲g_nSendCode在服务端同为dwToUserID;
  1043. pChatMessage->wMessageLen = nDataLen;
  1044. memcpy(pChatMessage->byFileContent, szDataBuf, nDataLen);
  1045. // 5.填充数据头;
  1046. TMessageHeader tHeader = {0};
  1047. tHeader.wMessageId = wMessageId;
  1048. tHeader.dwDataLen = dwDataLen;
  1049. // 6.发送数据;
  1050. BOOL bRet=0;
  1051. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)pChatMessage, dwDataLen);
  1052. if( ulSendLen != SOCKET_ERROR )
  1053. {
  1054. bRet=1;
  1055. }
  1056. // 7.发送完毕,释放内存;
  1057. delete [] pSendData;
  1058. return bRet;
  1059. }
  1060. /************************************************************************/
  1061. /*
  1062. 函数:ProcessChatMessageResponse
  1063. 描述:接收服务返回的数据;
  1064. 参数:void *pResponse[IN]
  1065. 返回:无;
  1066. 调用关系:
  1067. 1.由 void CMainFrame::ProcessNetEvent(...)调用
  1068. */
  1069. /************************************************************************/
  1070. void CMainFrame::ProcessChatMessageResponse(void *pResponse)
  1071. {
  1072. // 1.数据空,直接返回;
  1073. if( NULL == pResponse )
  1074. return;
  1075. // 2.数据解析过程;
  1076. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pResponse;
  1077. int nMessageLen = pChatMessage->wMessageLen;
  1078. int nMessageLen2 = pChatMessage->dwToUserID; // 在服务器中被处理了,一般使dwToUserID=wMessageLen;
  1079. // Jeff.dwFromUserID==8888表示的内容是更新客户端skin界面数据,只有两处dwToUserID==211和dwToUserID==21;
  1080. // Jeff.其余的大多数都是 dwFromUserID = wMessageLen = dwToUserID 三者相等;
  1081. if(nMessageLen==nMessageLen2 && pChatMessage->dwFromUserID!=8888)
  1082. {
  1083. // 2.1.清除全局变量g_pData数据,用于保存接收的实际数据;
  1084. if(g_pData)
  1085. delete []g_pData;
  1086. g_pData=NULL;
  1087. g_pData=new BYTE[nMessageLen];
  1088. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1089. memcpy( &g_sendhead, pChatMessage, sizeof(g_sendhead));
  1090. g_nLeng=nMessageLen;
  1091. if(nMessageLen<=sizeof(DWORD))
  1092. {
  1093. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1094. }
  1095. KillTimer(2);
  1096. if(g_hSendWnd)
  1097. {
  1098. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);//关闭发送对话框;
  1099. }
  1100. }
  1101. else if(nMessageLen==nMessageLen2 && pChatMessage->dwFromUserID==8888)
  1102. {
  1103. if(g_pData2)
  1104. delete []g_pData2;
  1105. g_pData2=NULL;
  1106. g_pData2=new BYTE[nMessageLen2];
  1107. memcpy(g_pData2, pChatMessage->byFileContent, nMessageLen2);
  1108. g_nLeng2=nMessageLen2;
  1109. KillTimer(2);
  1110. if(g_hSendWnd )
  1111. {
  1112. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1113. }
  1114. }
  1115. else // 登陆返回;
  1116. {
  1117. if(g_bConnLYFZ)
  1118. {
  1119. if(g_pData)
  1120. delete []g_pData;
  1121. g_pData=NULL;
  1122. g_pData=new BYTE[nMessageLen];
  1123. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1124. memcpy( &g_sendhead, pChatMessage, sizeof(g_sendhead));
  1125. g_nLeng=nMessageLen;
  1126. if(nMessageLen<=sizeof(DWORD))
  1127. {
  1128. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1129. }
  1130. KillTimer(2);
  1131. if(g_hSendWnd )
  1132. {
  1133. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1134. }
  1135. return;
  1136. }
  1137. if(g_conntype) // Jeff.g_conntype == 1,表示连接公司服务器的返回,用于集团版解析*.ly.com的IP地址;
  1138. {
  1139. // KillTimer(2);
  1140. char *szChatMessage = new char[nMessageLen+1];
  1141. memset(szChatMessage, 0x00, nMessageLen+1);
  1142. memcpy(szChatMessage, pChatMessage->byFileContent, nMessageLen);
  1143. g_server=szChatMessage;
  1144. delete []szChatMessage;
  1145. CStdioFile fp;
  1146. CString path=g_mainpath+"\\ip.txt";
  1147. ::DeleteFile(path);
  1148. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  1149. fp.WriteString(g_server);
  1150. fp.Close();
  1151. g_conntype=0;
  1152. // g_serverip=g_server;
  1153. return;
  1154. }
  1155. if(g_pData2==NULL)
  1156. {
  1157. g_pData2=new BYTE[nMessageLen2];
  1158. g_nLeng2=0;
  1159. }
  1160. memcpy(g_pData2+g_nLeng2, pChatMessage->byFileContent, nMessageLen);
  1161. g_nLeng2+=nMessageLen;
  1162. if(g_nLeng2==nMessageLen2)//已收完
  1163. {
  1164. KillTimer(2);
  1165. if(g_hSendWnd )
  1166. {
  1167. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1168. }
  1169. }
  1170. else
  1171. {
  1172. KillTimer(2);
  1173. SetTimer(2, g_ntimeout, NULL);
  1174. }
  1175. }
  1176. }
  1177. BOOL CMainFrame::OnConnectBranch()
  1178. {
  1179. if(g_branchip=="")
  1180. {
  1181. return 0;
  1182. }
  1183. g_conntype=0;
  1184. CString strServerAddress = g_branchip;
  1185. char *szServerAddress = strServerAddress.GetBuffer(0);
  1186. strServerAddress.ReleaseBuffer();
  1187. /*for Client, IP and Port can be 0,
  1188. and for Server, IP is LocalIP, and Port is Listening Port*/
  1189. int nResult = m_tClientTunnel.net_OpenSocket(
  1190. Transport_Client,
  1191. 0,
  1192. HandleClientNetEvent,
  1193. this);
  1194. if( TRANSPORT_OK != nResult )
  1195. {
  1196. // AfxMessageBox("网络初始化失败!");
  1197. return 0;
  1198. }
  1199. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1200. WORD wPort = SERVER_PORT;
  1201. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1202. if( TRANSPORT_OK != nResult )
  1203. {
  1204. m_tClientTunnel.net_CloseSocket();
  1205. return OnConnectBranch2();
  1206. return 0;
  1207. }
  1208. return ProcessLoginRequest();
  1209. }
  1210. BOOL CMainFrame::OnConnectBranch2()
  1211. {
  1212. if(g_branchip2=="")
  1213. {
  1214. return 0;
  1215. }
  1216. g_conntype=0;
  1217. CString strServerAddress = g_branchip2;
  1218. char *szServerAddress = strServerAddress.GetBuffer(0);
  1219. strServerAddress.ReleaseBuffer();
  1220. /*for Client, IP and Port can be 0,
  1221. and for Server, IP is LocalIP, and Port is Listening Port*/
  1222. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1223. 0,
  1224. HandleClientNetEvent,
  1225. this);
  1226. if( TRANSPORT_OK != nResult )
  1227. {
  1228. // AfxMessageBox("网络初始化失败!");
  1229. return 0;
  1230. }
  1231. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1232. WORD wPort = SERVER_PORT;
  1233. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1234. if( TRANSPORT_OK != nResult )
  1235. {
  1236. m_tClientTunnel.net_CloseSocket();
  1237. return 0;
  1238. }
  1239. return ProcessLoginRequest();
  1240. }
  1241. BOOL CMainFrame::OnConnectIP()
  1242. {
  1243. CString strServerAddress = g_server;
  1244. char *szServerAddress = strServerAddress.GetBuffer(0);
  1245. strServerAddress.ReleaseBuffer();
  1246. /*for Client, IP and Port can be 0,
  1247. and for Server, IP is LocalIP, and Port is Listening Port*/
  1248. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1249. 0,
  1250. HandleClientNetEvent,
  1251. this);
  1252. if( TRANSPORT_OK != nResult )
  1253. {
  1254. // AfxMessageBox("网络初始化失败!");
  1255. return 0;
  1256. }
  1257. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1258. WORD wPort = SERVER_PORT;
  1259. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1260. if( TRANSPORT_OK != nResult )
  1261. {
  1262. m_tClientTunnel.net_CloseSocket();
  1263. return 0;
  1264. }
  1265. return ProcessLoginRequest();
  1266. }
  1267. //ip.txt
  1268. BOOL CMainFrame::OnConnectLYFZ()
  1269. {
  1270. CString strBranchIP = "lijiafz.vicp.net";
  1271. MyGetIPByName2(strBranchIP);
  1272. if(strBranchIP=="")
  1273. {
  1274. return 0;
  1275. }
  1276. g_conntype=0;
  1277. CString strServerAddress = strBranchIP;
  1278. char *szServerAddress = strServerAddress.GetBuffer(0);
  1279. strServerAddress.ReleaseBuffer();
  1280. /*for Client, IP and Port can be 0,
  1281. and for Server, IP is LocalIP, and Port is Listening Port*/
  1282. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1283. 0,
  1284. HandleClientNetEvent,
  1285. this);
  1286. if( TRANSPORT_OK != nResult )
  1287. {
  1288. // AfxMessageBox("网络初始化失败!");
  1289. return 0;
  1290. }
  1291. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1292. WORD wPort = GetPort();
  1293. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1294. if( TRANSPORT_OK != nResult )
  1295. {
  1296. m_tClientTunnel.net_CloseSocket();
  1297. return 0;
  1298. }
  1299. return ProcessLoginRequest();
  1300. }
  1301. BOOL CMainFrame::OnConnect()
  1302. {
  1303. // 1.Jeff 断开(如果有在在未关的连接)之前的连接;
  1304. OnDisconnect();
  1305. // 2.根据需要连接指定的服务器;
  1306. if(g_bBranchModify)
  1307. {
  1308. // Jeff.g_bBranchModify在g_bGenBranchData=1时,在welcome::OnTimer里被设置为1;
  1309. return OnConnectBranch();// 连接集团版分店;
  1310. }
  1311. if(g_bConnLYFZ)
  1312. {
  1313. return OnConnectLYFZ();// 连接公司服务端程序;
  1314. }
  1315. g_conntype=0;
  1316. CString strServerAddress = g_server;
  1317. // 3.如果dbconfig.dat里保存的是*.ly.com的信息,就要读取ip.txt里的IP地址;
  1318. if(g_serverbak.Find(".ly.com")!=-1)
  1319. {
  1320. strServerAddress=g_serverbak;
  1321. CStdioFile fp;
  1322. CString path=g_mainpath+"\\ip.txt";
  1323. if(::PathFileExists(path))
  1324. {
  1325. fp.Open(path, CFile::modeRead);
  1326. fp.ReadString(g_server);
  1327. fp.Close();
  1328. if(OnConnectIP())
  1329. {
  1330. //MessageBox("ip成功");
  1331. // g_serverip=g_server;
  1332. //LOG4C((LOG_NOTICE,"OnConnectIP == 1,return 1"));
  1333. return 1;
  1334. }
  1335. g_server=strServerAddress ;
  1336. OnDisconnect();//MessageBox("ip失败");
  1337. }
  1338. g_conntype=1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1339. strServerAddress="lijiafz.vicp.net";
  1340. MyGetIPByName2(strServerAddress);
  1341. if(strServerAddress.IsEmpty())
  1342. {
  1343. //LOG4C((LOG_NOTICE,"strServerAddress == 0,return 0"));
  1344. return 0;//OnConnect2();
  1345. }
  1346. }
  1347. else if(g_ntimeout==29000)//非远程 30000
  1348. {
  1349. strServerAddress=g_serverarray.ElementAt(g_conpos);
  1350. }
  1351. // 4.如果没有IP.txt或dbconfig.dat里的不是ly.com信息,而是一般的计算机名称;
  1352. char *szServerAddress = strServerAddress.GetBuffer(0);
  1353. strServerAddress.ReleaseBuffer();
  1354. // AfxMessageBox("连接:"+strServerAddress);
  1355. /*for Client, IP and Port can be 0,
  1356. and for Server, IP is LocalIP, and Port is Listening Port*/
  1357. // 5.创建通信对象连接;
  1358. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1359. 0,
  1360. HandleClientNetEvent,
  1361. this);
  1362. if( TRANSPORT_OK != nResult )
  1363. {
  1364. // AfxMessageBox("网络初始化失败!");
  1365. // LOG4C((LOG_NOTICE,"网络初始化失败!,return 0"));
  1366. return 0;
  1367. }
  1368. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1369. WORD wPort = SERVER_PORT;
  1370. if(g_conntype) wPort=GetPort();
  1371. // 6.连接公司服务器或影楼服务器;
  1372. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1373. if( TRANSPORT_OK != nResult )
  1374. {
  1375. // AfxMessageBox("连接失败");
  1376. m_tClientTunnel.net_CloseSocket();
  1377. if(g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1378. {
  1379. // LOG4C((LOG_NOTICE,"连接失败,return 0"));
  1380. return 0;//OnConnect2();
  1381. }
  1382. if(g_serverarray.GetSize()>1)
  1383. {
  1384. if(g_conpos<(g_serverarray.GetSize()-1))
  1385. {
  1386. g_conpos++;
  1387. return OnConnect();
  1388. }
  1389. else
  1390. {
  1391. g_conpos=0;
  1392. return 0;
  1393. }
  1394. }
  1395. return 0;
  1396. }
  1397. // LOG4C((LOG_NOTICE,"ok send"));
  1398. return ProcessLoginRequest();
  1399. }
  1400. BOOL CMainFrame::OnConnect2()
  1401. {
  1402. g_conntype=2;
  1403. CString server="http://www.lyfz.net/download/ip.txt";
  1404. char buf[MAX_PATH];
  1405. ::GetTempPath(sizeof(buf),buf);
  1406. CString m_strTempDir=buf;
  1407. DWORD m_dwHttpRequestFlags=HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1408. INTERNET_PORT m_dwPort;
  1409. DWORD dwType;
  1410. CInternetSession m_cis;
  1411. CHttpConnection *m_pHttp;
  1412. CString m_strServer;
  1413. CString m_strIniPath;
  1414. AfxParseURL(server,dwType,m_strServer,m_strIniPath,m_dwPort);
  1415. if(dwType!=AFX_INET_SERVICE_HTTP)
  1416. {
  1417. return 0;//OnConnect3();
  1418. }
  1419. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,5);
  1420. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1421. try
  1422. {
  1423. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1424. }
  1425. catch(CInternetException* pEx)
  1426. {
  1427. return 0;//OnConnect3();
  1428. }
  1429. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1430. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1431. try
  1432. {
  1433. pFile->SendRequest();
  1434. }
  1435. catch(CInternetException* pEx)
  1436. {
  1437. pFile->Close();
  1438. return 0;//OnConnect3();
  1439. }
  1440. if(pFile)
  1441. {
  1442. CStdioFile csf;
  1443. csf.Open(m_strTempDir+"\\ip.txt",CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
  1444. char buf[2048];
  1445. int n;
  1446. while((n=pFile->Read(buf,2048))>0)
  1447. csf.Write(buf,n);
  1448. csf.Close();
  1449. pFile->Close();
  1450. }
  1451. CString strServerAddress ;
  1452. CStdioFile fp;
  1453. fp.Open (m_strTempDir+"\\ip.txt", CFile::modeRead);
  1454. fp.ReadString (strServerAddress);
  1455. fp.Close ();
  1456. char *szServerAddress = strServerAddress.GetBuffer(0);
  1457. strServerAddress.ReleaseBuffer();
  1458. /*for Client, IP and Port can be 0,
  1459. and for Server, IP is LocalIP, and Port is Listening Port*/
  1460. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1461. 0,
  1462. HandleClientNetEvent,
  1463. this);
  1464. if( TRANSPORT_OK != nResult )
  1465. {
  1466. return 0;
  1467. }
  1468. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1469. WORD wPort = SERVER_PORT;
  1470. if(g_conntype)wPort=GetPort();
  1471. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1472. if( TRANSPORT_OK != nResult )
  1473. {
  1474. m_tClientTunnel.net_CloseSocket();
  1475. return 0;//OnConnect3();
  1476. }
  1477. return ProcessLoginRequest();
  1478. }
  1479. BOOL CMainFrame::OnConnect3()
  1480. {
  1481. g_conntype=3;
  1482. CString server="http://photo.bjlyfz.com/download/ip.txt";
  1483. char buf[MAX_PATH];
  1484. ::GetTempPath(sizeof(buf),buf);
  1485. CString m_strTempDir=buf;
  1486. DWORD m_dwHttpRequestFlags=HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1487. INTERNET_PORT m_dwPort;
  1488. DWORD dwType;
  1489. CInternetSession m_cis;
  1490. CHttpConnection *m_pHttp;
  1491. CString m_strServer;
  1492. CString m_strIniPath;
  1493. AfxParseURL(server,dwType,m_strServer,m_strIniPath,m_dwPort);
  1494. if(dwType!=AFX_INET_SERVICE_HTTP)
  1495. {
  1496. return FALSE;
  1497. }
  1498. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,5);
  1499. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1500. try
  1501. {
  1502. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1503. }
  1504. catch(CInternetException* pEx)
  1505. {
  1506. return false;
  1507. }
  1508. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1509. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1510. try
  1511. {
  1512. pFile->SendRequest();
  1513. }
  1514. catch(CInternetException* pEx)
  1515. {
  1516. pFile->Close();
  1517. return false;
  1518. }
  1519. if(pFile)
  1520. {
  1521. CStdioFile csf;
  1522. csf.Open(m_strTempDir+"\\ip.txt",CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
  1523. char buf[2048];
  1524. int n;
  1525. while((n=pFile->Read(buf,2048))>0)
  1526. csf.Write(buf,n);
  1527. csf.Close();
  1528. pFile->Close();
  1529. }
  1530. CString strServerAddress ;
  1531. CStdioFile fp;
  1532. fp.Open (m_strTempDir+"\\ip.txt", CFile::modeRead);
  1533. fp.ReadString (strServerAddress);
  1534. fp.Close ();
  1535. char *szServerAddress = strServerAddress.GetBuffer(0);
  1536. strServerAddress.ReleaseBuffer();
  1537. /*for Client, IP and Port can be 0,
  1538. and for Server, IP is LocalIP, and Port is Listening Port*/
  1539. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1540. 0,
  1541. HandleClientNetEvent,
  1542. this);
  1543. if( TRANSPORT_OK != nResult )
  1544. {
  1545. return 0;
  1546. }
  1547. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1548. WORD wPort = SERVER_PORT;
  1549. if(g_conntype)wPort=GetPort();
  1550. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1551. if( TRANSPORT_OK != nResult )
  1552. {
  1553. m_tClientTunnel.net_CloseSocket();
  1554. return 0;
  1555. }
  1556. return ProcessLoginRequest();
  1557. }
  1558. void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
  1559. {
  1560. if( Transport_ReadEv == nEventType )
  1561. {
  1562. if( NULL == pRecvMsg ) return;
  1563. TMessageHeader* pHeader = (TMessageHeader *)pRecvMsg;
  1564. char *pDataBuf = (char *)pRecvMsg + MESSAGE_HEADER_LEN;
  1565. WORD dwMessageID = pHeader->wMessageId;
  1566. switch(dwMessageID)
  1567. {
  1568. case MSG_LOGIN_RESP:
  1569. {
  1570. LOGIN_RESULT_STRU tLoginResult = {0};
  1571. memcpy(&tLoginResult, pDataBuf, sizeof(LOGIN_RESULT_STRU));
  1572. ProcessLoginResponse(&tLoginResult);
  1573. break;
  1574. }
  1575. case MSG_USERINFO_RESP:
  1576. {
  1577. break;
  1578. }
  1579. case MSG_LOGOUT_RESP:
  1580. {
  1581. break;
  1582. }
  1583. case MSG_CHATMESSAGE_RESP:
  1584. {
  1585. //AfxMessageBox("登陆成功");
  1586. static int i = 0;
  1587. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pDataBuf;
  1588. ProcessChatMessageResponse((void *)pChatMessage);
  1589. break;
  1590. }
  1591. default:
  1592. {
  1593. break;
  1594. }
  1595. }
  1596. }
  1597. else if( Transport_CloseEv == nEventType )
  1598. {
  1599. OnDisconnect();
  1600. }
  1601. }
  1602. extern BOOL EncryptFile2(BYTE *buffer, DWORD leng, PCHAR szPassword);
  1603. void CMainFrame::OnTimer(UINT nIDEvent)
  1604. {
  1605. // TODO: Add your message handler code here and/or call default
  1606. if( 1 == nIDEvent )
  1607. {
  1608. KillTimer(nIDEvent);
  1609. CString version = _T ("Version 1.0");
  1610. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);//status:此机用选片菜单项
  1611. // checked==1:此机用选片菜单项
  1612. // g_bStaffAchievementShow==1:此机用于员工业绩查看
  1613. if(checked && g_bStaffAchievementShow==0) // .此机用选片菜单项;
  1614. {
  1615. KillTimer(3);
  1616. #ifdef NEW_SKIN
  1617. Welcome weldlg;
  1618. weldlg.DoModal();
  1619. #endif
  1620. ChoosePhotoSkin dlg;
  1621. dlg.SetLiaPath ("1.lia");
  1622. if(dlg.DoModal ()!=IDOK)
  1623. {
  1624. PostMessage(WM_QUIT);
  1625. return;
  1626. }
  1627. if(dlg.m_exitcode==3)
  1628. {
  1629. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  1630. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  1631. }
  1632. else
  1633. {
  1634. ShowWindow(SW_SHOW);
  1635. #ifdef NEW_SKIN
  1636. if(m_pMainFrimDlg2==NULL)
  1637. {
  1638. m_pMainFrimDlg2=new MainFrimDlg2;
  1639. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  1640. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  1641. }
  1642. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1643. #endif
  1644. }
  1645. }
  1646. else if(g_bStaffAchievementShow==0) // .非选片、非查看员工业绩;
  1647. {
  1648. #ifdef NEW_SKIN
  1649. g_bNoConnDlg=1;
  1650. Welcome weldlg;
  1651. weldlg.DoModal();
  1652. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1653. ShowWindow(SW_SHOW);
  1654. g_bNoConnDlg=0;
  1655. if(g_bNoLoginLia) // Jeff.OnCreate里判断skin文件有5.lia, g_bNoLoginLia = 0, 无 g_bNoLoginLia = 1;
  1656. {
  1657. Login dlg;
  1658. dlg.SetLiaPath("5.lia");
  1659. dlg.DoModal();
  1660. }
  1661. else
  1662. {
  1663. Login3 dlg;
  1664. dlg.SetLiaPath("5.lia");
  1665. dlg.DoModal();
  1666. }
  1667. if(g_user.bLongin && g_pMainWnd2)
  1668. {
  1669. g_pMainWnd2->ShowBar (1);
  1670. InsideMsg();
  1671. }
  1672. #else
  1673. ShowWindow(SW_SHOW);
  1674. if(g_bNoLoginLia)
  1675. {
  1676. Login dlg;
  1677. dlg.SetLiaPath ("5.lia");
  1678. dlg.DoModal();
  1679. }
  1680. else
  1681. {
  1682. Login3 dlg;
  1683. dlg.SetLiaPath ("5.lia");
  1684. dlg.DoModal();
  1685. }
  1686. #endif
  1687. }
  1688. if(g_hmouse==NULL )//&& atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
  1689. {
  1690. g_hmouse=SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId ());
  1691. }
  1692. }
  1693. else if( 2 == nIDEvent ) //29秒后,若连接和发送未完成,将关闭连接和发送框;
  1694. {
  1695. KillTimer(2);
  1696. if(g_hConnectWnd )
  1697. ::SendMessage (g_hConnectWnd, WM_CLOSE, 0, 0);
  1698. if(g_hSendWnd )
  1699. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1700. if(g_bStaffAchievementShow==0 && g_bConnLYFZ==0)
  1701. {
  1702. if(g_bGenBranchData==0)
  1703. {
  1704. if(g_branchip!="")
  1705. AfxMessageBox("连接分店:"+g_branchname+"失败!", MB_ICONINFORMATION);
  1706. else
  1707. AfxMessageBox("连接服务器失败!", MB_ICONINFORMATION);
  1708. }
  1709. OnDisconnect();
  1710. }
  1711. g_bSendOK=0; g_bNeedCoon=1;
  1712. }
  1713. else if( 3 == nIDEvent )
  1714. {
  1715. KillTimer(3);
  1716. #ifdef NEW_SKIN
  1717. Welcome weldlg;
  1718. weldlg.DoModal();
  1719. #endif
  1720. ShowWindow(SW_SHOW);
  1721. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1722. g_sendhead.bsql=0;
  1723. g_sendhead.code[0]=24;
  1724. g_sendhead.code[1]=1;
  1725. g_sendhead.tabcount=2;
  1726. g_pMainWnd->ProcessChatMessageRequest2(1);
  1727. if(g_bSendOK==0)
  1728. {
  1729. return;
  1730. }
  1731. CArray<CStringArray, CStringArray>patharray;
  1732. CArray<CStringArray, CStringArray>userarray;
  1733. DataToArray(&g_cominfoarray,&g_hisyeararray);
  1734. g_userarray.SetSize( userarray.GetSize (), 1 );
  1735. int count=0;
  1736. for(int ii=0; ii<userarray.GetSize (); ii++)
  1737. {
  1738. if(userarray.ElementAt (ii).ElementAt (10)=="在职")
  1739. g_userarray.ElementAt (count++).Copy (userarray.ElementAt (ii));
  1740. }
  1741. g_userarray.SetSize( count, 1 );
  1742. StaffAchievementShowAll dlg;
  1743. g_pMainWnd->GetOcx();
  1744. dlg.DoModal ();
  1745. }
  1746. else if( 5 == nIDEvent )
  1747. {
  1748. if(g_bInSkin)return;
  1749. if(g_nAutoShowStaffAchievement==1)return;
  1750. if(g_bAllBranch)return;
  1751. if(g_user.bLongin)
  1752. {
  1753. // m_Mdi.CloseAll();
  1754. g_pMainWnd->OnCommandMenu(IDM_Logout);
  1755. }
  1756. /* g_nAutoShowStaffAchievement=1;
  1757. KillTimer(5);
  1758. StaffAchievementShowAll dlg;
  1759. g_pMainWnd->GetOcx();
  1760. dlg.DoModal ();*/
  1761. }
  1762. else if( 6 == nIDEvent )
  1763. {
  1764. static BOOL bDouble=0;
  1765. bDouble=!bDouble;
  1766. if(bDouble)
  1767. g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
  1768. else
  1769. g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
  1770. }
  1771. else if( 7 == nIDEvent )
  1772. {
  1773. KillTimer(7);
  1774. if(g_bInSkin)return;
  1775. if(g_nAutoShowStaffAchievement==1)return;
  1776. if(g_bAllBranch)return;
  1777. CString str=g_sInfo;
  1778. g_bConnLYFZ=1;
  1779. OnDisconnect();
  1780. BYTE *pData=new BYTE[str.GetLength ()];
  1781. memcpy(pData, str.GetBuffer (0), str.GetLength ());
  1782. str.ReleaseBuffer ();
  1783. EncryptFile2(pData, str.GetLength (), "888666333");
  1784. g_nSendCode=16;
  1785. g_pMainWnd->ProcessChatMessageRequest2(pData, str.GetLength ());
  1786. g_nSendCode=0;
  1787. delete []pData;
  1788. OnDisconnect();
  1789. g_bSendLYFZ=0;
  1790. g_bConnLYFZ=0;
  1791. if(g_bSendOK)
  1792. {
  1793. char *pStr=new char[g_nLeng+1];
  1794. memset(pStr, 0, g_nLeng+1);
  1795. memcpy(pStr, g_pData, g_nLeng);
  1796. CString str=pStr;
  1797. delete []pStr;
  1798. if(str=="g_bInSkin")
  1799. {
  1800. g_sendhead.bsql=1;
  1801. g_pMainWnd->ProcessChatMessageRequest2("update version set [setcheck1]='ok'");
  1802. }
  1803. }
  1804. }
  1805. }
  1806. void CMainFrame::OnOutbarNotify(CString strMsg)
  1807. {
  1808. if(g_user.bLongin==0)
  1809. {
  1810. if(g_bNoLoginLia)
  1811. {
  1812. Login dlg;
  1813. dlg.SetLiaPath ("5.lia");
  1814. dlg.DoModal();
  1815. }
  1816. else
  1817. {
  1818. Login3 dlg;
  1819. dlg.SetLiaPath ("5.lia");
  1820. dlg.DoModal();
  1821. }
  1822. return;
  1823. if(g_user.bLongin==0)return;
  1824. }
  1825. else
  1826. {
  1827. InsideMsg();
  1828. }
  1829. ResetTimer();
  1830. if(strMsg=="开单")
  1831. {
  1832. if(IsHasRights(0)==0)return;
  1833. /* UINT nID=0;
  1834. LPSTR pName ;
  1835. pName = (LPSTR)(LPCSTR)"开单";
  1836. OPEN_MENU(Booking);*/
  1837. Booking2 dlg;
  1838. dlg.DoModal ();
  1839. return;
  1840. }
  1841. else if(strMsg=="拍照")
  1842. {
  1843. if(IsHasRights(1)==0)return;
  1844. UINT nID=1;
  1845. LPSTR pName ;
  1846. pName = (LPSTR)(LPCSTR)"拍照";
  1847. OPEN_MENU(TakeFrom);
  1848. return;
  1849. }
  1850. else if(strMsg=="修片")
  1851. {
  1852. if(IsHasRights(1)==0)return;
  1853. UINT nID=1;
  1854. LPSTR pName ;
  1855. pName = (LPSTR)(LPCSTR)"修片";
  1856. OPEN_MENU(BeautifySkinFrom);
  1857. return;
  1858. }
  1859. else if(strMsg=="选片")
  1860. {
  1861. if(IsHasRights(2)==0)return;
  1862. UINT nID=1;
  1863. LPSTR pName ;
  1864. pName = (LPSTR)(LPCSTR)"选片";
  1865. OPEN_MENU(ChoosePhotoForm);
  1866. return;
  1867. }
  1868. else if(strMsg=="精修")
  1869. {
  1870. if(IsHasRights(2)==0)return;
  1871. UINT nID=1;
  1872. LPSTR pName ;
  1873. pName = (LPSTR)(LPCSTR)"精修";
  1874. OPEN_MENU(BeautifySkinFrom2);
  1875. return;
  1876. }
  1877. else if(strMsg=="设计")
  1878. {
  1879. if(IsHasRights(2)==0)return;
  1880. UINT nID=1;
  1881. LPSTR pName ;
  1882. pName = (LPSTR)(LPCSTR)"设计";
  1883. OPEN_MENU(DesignFrom);
  1884. return;
  1885. }
  1886. else if(strMsg=="数码安排")
  1887. {
  1888. UINT nID=1;
  1889. LPSTR pName ;
  1890. pName = (LPSTR)(LPCSTR)"数码安排";
  1891. OPEN_MENU(DigitalWork);
  1892. return;
  1893. }
  1894. else if(strMsg=="刻盘")
  1895. {
  1896. UINT nID=1;
  1897. LPSTR pName ;
  1898. pName = (LPSTR)(LPCSTR)"刻盘";
  1899. OPEN_MENU(BurnCD);
  1900. return;
  1901. }
  1902. else if(strMsg=="相片冲印")
  1903. {
  1904. UINT nID=1;
  1905. LPSTR pName ;
  1906. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  1907. OPEN_MENU(PhotoPrintFrom);
  1908. return;
  1909. }
  1910. else if(strMsg=="发片/取件")
  1911. {
  1912. if(IsHasRights(3)==0)return;
  1913. UINT nID=1;
  1914. LPSTR pName ;
  1915. pName = (LPSTR)(LPCSTR)"发片/取件";
  1916. OPEN_MENU(outsourcing);
  1917. return;
  1918. }
  1919. else if(strMsg=="满意度")
  1920. {
  1921. UINT nID=1;
  1922. LPSTR pName ;
  1923. pName = (LPSTR)(LPCSTR)"满意度";
  1924. OPEN_MENU(Satisfaction);
  1925. return;
  1926. }
  1927. else if(strMsg=="满意度图表")
  1928. {
  1929. UINT nID=1;
  1930. LPSTR pName ;
  1931. pName = (LPSTR)(LPCSTR)"满意度图表";
  1932. OPEN_MENU(SatisfactionForm);
  1933. return;
  1934. }
  1935. else if(strMsg=="回复统计")
  1936. {
  1937. UINT nID=1;
  1938. LPSTR pName ;
  1939. pName = (LPSTR)(LPCSTR)"回复统计";
  1940. OPEN_MENU(MsgReg2);
  1941. return;
  1942. }
  1943. /* else if(strMsg=="取件")
  1944. {
  1945. if(IsHasRights(3)==0)return;
  1946. UINT nID=1;
  1947. LPSTR pName ;
  1948. pName = (LPSTR)(LPCSTR)"取件";
  1949. OPEN_MENU(TakeAwayFrom);
  1950. return;
  1951. }*/
  1952. else if(strMsg=="其它收入")
  1953. {
  1954. if(IsHasRightsnew(16)==0)return;
  1955. // if(IsHasRightsnew(48)==0)return;
  1956. UINT nID=1;
  1957. LPSTR pName ;
  1958. pName = (LPSTR)(LPCSTR)"其它收入";
  1959. OPEN_MENU(IncomeInput);
  1960. return;
  1961. }
  1962. else if(strMsg=="其它二销")
  1963. {
  1964. if(IsHasRightsnew(16)==0)return;
  1965. UINT nID=1;
  1966. LPSTR pName ;
  1967. pName = (LPSTR)(LPCSTR)"其它二销";
  1968. OPEN_MENU(IncomeInput2);
  1969. return;
  1970. }
  1971. else if(strMsg=="员工奖罚")
  1972. {
  1973. if(IsHasRightsnew(16)==0)return;
  1974. UINT nID=1;
  1975. LPSTR pName ;
  1976. pName = (LPSTR)(LPCSTR)"员工奖罚";
  1977. OPEN_MENU(IncomeInput3);
  1978. return;
  1979. }
  1980. else if(strMsg=="员工奖惩")
  1981. {
  1982. if(IsHasRightsnew(16)==0)return;
  1983. UINT nID=1;
  1984. LPSTR pName ;
  1985. pName = (LPSTR)(LPCSTR)"员工奖惩";
  1986. OPEN_MENU(IncomeInput4);
  1987. return;
  1988. }
  1989. else if(strMsg=="订单收款")
  1990. {
  1991. if(IsHasRights(17)==0)return;
  1992. UINT nID=1;
  1993. LPSTR pName ;
  1994. pName = (LPSTR)(LPCSTR)"订单收款";
  1995. OPEN_MENU(FinanceForm);
  1996. return;
  1997. }
  1998. else if(strMsg=="日财务表")
  1999. {
  2000. if(IsHasRightsnew(22)==0)return;
  2001. UINT nID=2;
  2002. LPSTR pName ;
  2003. pName = (LPSTR)(LPCSTR)"日财务表";
  2004. OPEN_MENU(DailyForm);
  2005. return;
  2006. }
  2007. else if(strMsg=="提成比例")
  2008. {
  2009. #ifndef ENTERPRISE_VERSION
  2010. #ifndef CHILD_VERSION
  2011. #ifdef BASIC_VERSION
  2012. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2013. {
  2014. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2015. exit(0);return;
  2016. }
  2017. #else
  2018. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2019. {
  2020. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2021. exit(0);return;
  2022. }
  2023. #endif
  2024. #else
  2025. #ifdef BASIC_VERSION
  2026. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2027. {
  2028. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2029. exit(0);return;
  2030. }
  2031. #else
  2032. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2033. {
  2034. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2035. exit(0);return;
  2036. }
  2037. #endif
  2038. #endif
  2039. #else
  2040. #ifndef CHILD_VERSION
  2041. #ifdef BASIC_VERSION
  2042. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2043. {
  2044. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2045. exit(0);return;
  2046. }
  2047. #else
  2048. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2049. {
  2050. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2051. exit(0);return;
  2052. }
  2053. #endif
  2054. #else
  2055. #ifdef BASIC_VERSION
  2056. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2057. {
  2058. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2059. exit(0);return;
  2060. }
  2061. #else
  2062. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2063. {
  2064. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2065. exit(0);return;
  2066. }
  2067. #endif
  2068. #endif
  2069. #endif
  2070. UINT nID=2;
  2071. LPSTR pName ;
  2072. pName = (LPSTR)(LPCSTR)"提成比例";
  2073. OPEN_MENU(SalarySet2);
  2074. return;
  2075. }
  2076. //else if(strMsg=="员工工作")
  2077. else if(strMsg=="计件提成")
  2078. {
  2079. UINT nID=2;
  2080. LPSTR pName ;
  2081. //pName = (LPSTR)(LPCSTR)"员工工作";
  2082. pName = (LPSTR)(LPCSTR)"计件提成";
  2083. OPEN_MENU(SalarySet3);
  2084. return;
  2085. }
  2086. else if(strMsg=="工资管理")
  2087. {
  2088. #ifndef ENTERPRISE_VERSION
  2089. #ifndef CHILD_VERSION
  2090. #ifdef BASIC_VERSION
  2091. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2092. {
  2093. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2094. exit(0);return;
  2095. }
  2096. #else
  2097. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2098. {
  2099. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2100. exit(0);return;
  2101. }
  2102. #endif
  2103. #else
  2104. #ifdef BASIC_VERSION
  2105. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2106. {
  2107. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2108. exit(0);return;
  2109. }
  2110. #else
  2111. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2112. {
  2113. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2114. exit(0);return;
  2115. }
  2116. #endif
  2117. #endif
  2118. #else
  2119. #ifndef CHILD_VERSION
  2120. #ifdef BASIC_VERSION
  2121. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2122. {
  2123. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2124. exit(0);return;
  2125. }
  2126. #else
  2127. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2128. {
  2129. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2130. exit(0);return;
  2131. }
  2132. #endif
  2133. #else
  2134. #ifdef BASIC_VERSION
  2135. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2136. {
  2137. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2138. exit(0);return;
  2139. }
  2140. #else
  2141. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2142. {
  2143. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2144. exit(0);return;
  2145. }
  2146. #endif
  2147. #endif
  2148. #endif
  2149. UINT nID=2;
  2150. LPSTR pName ;
  2151. pName = (LPSTR)(LPCSTR)"工资管理";
  2152. OPEN_MENU(MySalary);
  2153. return;
  2154. }
  2155. else if(strMsg=="客人付款")
  2156. {
  2157. UINT nID=2;
  2158. LPSTR pName ;
  2159. pName = (LPSTR)(LPCSTR)"客人付款";
  2160. OPEN_MENU(ClientMoney);
  2161. return;
  2162. }
  2163. else if(strMsg=="工资报表")
  2164. {
  2165. #ifndef ENTERPRISE_VERSION
  2166. #ifndef CHILD_VERSION
  2167. #ifdef BASIC_VERSION
  2168. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2169. {
  2170. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2171. exit(0);return;
  2172. }
  2173. #else
  2174. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2175. {
  2176. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2177. exit(0);return;
  2178. }
  2179. #endif
  2180. #else
  2181. #ifdef BASIC_VERSION
  2182. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2183. {
  2184. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2185. exit(0);return;
  2186. }
  2187. #else
  2188. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2189. {
  2190. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2191. exit(0);return;
  2192. }
  2193. #endif
  2194. #endif
  2195. #else
  2196. #ifndef CHILD_VERSION
  2197. #ifdef BASIC_VERSION
  2198. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2199. {
  2200. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2201. exit(0);return;
  2202. }
  2203. #else
  2204. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2205. {
  2206. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2207. exit(0);return;
  2208. }
  2209. #endif
  2210. #else
  2211. #ifdef BASIC_VERSION
  2212. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2213. {
  2214. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2215. exit(0);return;
  2216. }
  2217. #else
  2218. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2219. {
  2220. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2221. exit(0);return;
  2222. }
  2223. #endif
  2224. #endif
  2225. #endif
  2226. if(IsHasRightsnew(25)==0)return;
  2227. UINT nID=2;
  2228. LPSTR pName ;
  2229. pName = (LPSTR)(LPCSTR)"工资报表";
  2230. g_ncount=100;
  2231. OPEN_MENU(MySalary);
  2232. return;
  2233. }
  2234. else if(strMsg=="员工业绩")
  2235. {
  2236. #ifndef ENTERPRISE_VERSION
  2237. #ifndef CHILD_VERSION
  2238. #ifdef BASIC_VERSION
  2239. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2240. {
  2241. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2242. exit(0);return;
  2243. }
  2244. #else
  2245. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2246. {
  2247. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2248. exit(0);return;
  2249. }
  2250. #endif
  2251. #else
  2252. #ifdef BASIC_VERSION
  2253. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2254. {
  2255. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2256. exit(0);return;
  2257. }
  2258. #else
  2259. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2260. {
  2261. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2262. exit(0);return;
  2263. }
  2264. #endif
  2265. #endif
  2266. #else
  2267. #ifndef CHILD_VERSION
  2268. #ifdef BASIC_VERSION
  2269. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2270. {
  2271. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2272. exit(0);return;
  2273. }
  2274. #else
  2275. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2276. {
  2277. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2278. exit(0);return;
  2279. }
  2280. #endif
  2281. #else
  2282. #ifdef BASIC_VERSION
  2283. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2284. {
  2285. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2286. exit(0);return;
  2287. }
  2288. #else
  2289. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2290. {
  2291. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2292. exit(0);return;
  2293. }
  2294. #endif
  2295. #endif
  2296. #endif
  2297. if(IsHasRightsnew(33)==0)return;
  2298. UINT nID=2;
  2299. LPSTR pName ;
  2300. pName = (LPSTR)(LPCSTR)"员工业绩";
  2301. OPEN_MENU(StaffAchievement);
  2302. return;
  2303. }
  2304. else if(strMsg=="订单客户")
  2305. {
  2306. UINT nID=2;
  2307. LPSTR pName ;
  2308. pName = (LPSTR)(LPCSTR)"订单客户";
  2309. g_dx+=10000;
  2310. OPEN_MENU(CClientForm);
  2311. if(g_dx>=10000)g_dx-=10000;
  2312. return;
  2313. }
  2314. else if(strMsg=="服务记录")
  2315. {
  2316. UINT nID=2;
  2317. LPSTR pName ;
  2318. pName = (LPSTR)(LPCSTR)"服务记录";
  2319. OPEN_MENU(CClientForm2);
  2320. return;
  2321. }
  2322. else if(strMsg=="服务统计")
  2323. {
  2324. UINT nID=2;
  2325. LPSTR pName ;
  2326. pName = (LPSTR)(LPCSTR)"服务统计";
  2327. OPEN_MENU(CClientForm3);
  2328. return;
  2329. }
  2330. else if(strMsg=="意向客户")
  2331. {
  2332. UINT nID=2;
  2333. LPSTR pName ;
  2334. pName = (LPSTR)(LPCSTR)"意向客户";
  2335. #ifdef LYFZ_VERSION
  2336. OPEN_MENU(Client2FormLYFZ);
  2337. #else
  2338. OPEN_MENU(Client2Form);
  2339. #endif
  2340. return;
  2341. }
  2342. else if(strMsg=="老客户")
  2343. {
  2344. UINT nID=2;
  2345. LPSTR pName ;
  2346. pName = (LPSTR)(LPCSTR)"老客户";
  2347. OPEN_MENU(OldClient);
  2348. return;
  2349. }
  2350. else if(strMsg=="客户来电")
  2351. {
  2352. UINT nID=2;
  2353. LPSTR pName ;
  2354. pName = (LPSTR)(LPCSTR)"客户来电";
  2355. OPEN_MENU(PhoneRecord);
  2356. return;
  2357. }
  2358. else if(strMsg=="拨出电话")
  2359. {
  2360. UINT nID=2;
  2361. LPSTR pName ;
  2362. pName = (LPSTR)(LPCSTR)"拨出电话";
  2363. OPEN_MENU(PhoneRecordOut);
  2364. return;
  2365. }
  2366. else if(strMsg=="未接来电")
  2367. {
  2368. UINT nID=2;
  2369. LPSTR pName ;
  2370. pName = (LPSTR)(LPCSTR)"未接来电";
  2371. OPEN_MENU(MissCall);
  2372. return;
  2373. }
  2374. else if(strMsg=="客户流失")
  2375. {
  2376. UINT nID=2;
  2377. LPSTR pName ;
  2378. pName = (LPSTR)(LPCSTR)"客户流失";
  2379. OPEN_MENU(ClientReasonChart);
  2380. return;
  2381. }
  2382. else if(strMsg=="客户来源")
  2383. {
  2384. UINT nID=2;
  2385. LPSTR pName ;
  2386. pName = (LPSTR)(LPCSTR)"客户来源";
  2387. OPEN_MENU(ClientFromChart);
  2388. return;
  2389. }
  2390. else if(strMsg=="月财务表")
  2391. {
  2392. if(IsHasRightsnew(23)==0)return;
  2393. UINT nID=2;
  2394. LPSTR pName ;
  2395. pName = (LPSTR)(LPCSTR)"月财务表";
  2396. OPEN_MENU(MonthForm);
  2397. return;
  2398. }
  2399. else if(strMsg=="支出报表")
  2400. {
  2401. if(IsHasRightsnew(23)==0)return;
  2402. UINT nID=2;
  2403. LPSTR pName ;
  2404. pName = (LPSTR)(LPCSTR)"支出报表";
  2405. OPEN_MENU(MonthForm2);
  2406. return;
  2407. }
  2408. else if(strMsg=="年财务表")
  2409. {
  2410. if(IsHasRightsnew(24)==0)return;
  2411. UINT nID=2;
  2412. LPSTR pName ;
  2413. pName = (LPSTR)(LPCSTR)"年财务表";
  2414. OPEN_MENU(YearForm);
  2415. return;
  2416. }
  2417. else if(strMsg=="年财务图表")
  2418. {
  2419. if(IsHasRightsnew(24)==0)return;
  2420. GetOcx();
  2421. UINT nID=2;
  2422. LPSTR pName ;
  2423. pName = (LPSTR)(LPCSTR)"年财务图表";
  2424. OPEN_MENU(YearForm2);
  2425. return;
  2426. }
  2427. else if(strMsg=="订单图表")
  2428. {
  2429. GetOcx();
  2430. UINT nID=2;
  2431. LPSTR pName ;
  2432. pName = (LPSTR)(LPCSTR)"订单图表";
  2433. OPEN_MENU(DinDanForm);
  2434. return;
  2435. }
  2436. #ifdef ENTERPRISE_VERSION
  2437. else if(strMsg=="订单报表")
  2438. {
  2439. GetOcx();
  2440. UINT nID=2;
  2441. LPSTR pName ;
  2442. pName = (LPSTR)(LPCSTR)"订单报表2";
  2443. OPEN_MENU(DinDanFromBranch);
  2444. return;
  2445. }
  2446. else if(strMsg=="财务图表")
  2447. {
  2448. GetOcx();
  2449. UINT nID=2;
  2450. LPSTR pName ;
  2451. pName = (LPSTR)(LPCSTR)"财务图表";
  2452. OPEN_MENU(YearFormBranch);
  2453. return;
  2454. }
  2455. else if(strMsg=="订单图表")
  2456. {
  2457. GetOcx();
  2458. UINT nID=2;
  2459. LPSTR pName ;
  2460. pName = (LPSTR)(LPCSTR)"订单图表";
  2461. OPEN_MENU(YearFormBranch2);
  2462. return;
  2463. }
  2464. else if(strMsg=="摄控安排")
  2465. {
  2466. UINT nID=2;
  2467. LPSTR pName ;
  2468. pName = (LPSTR)(LPCSTR)"摄控安排";
  2469. g_bookingtype=0;
  2470. OPEN_MENU(TodayForm);
  2471. return;
  2472. }
  2473. else if(strMsg=="选片预约")
  2474. {
  2475. UINT nID=2;
  2476. LPSTR pName ;
  2477. pName = (LPSTR)(LPCSTR)"选片预约";
  2478. g_bookingtype=1;
  2479. OPEN_MENU(TodayForm);
  2480. return;
  2481. }
  2482. else if(strMsg=="看样预约")
  2483. {
  2484. UINT nID=2;
  2485. LPSTR pName ;
  2486. pName = (LPSTR)(LPCSTR)"看样预约";
  2487. g_bookingtype=2;
  2488. OPEN_MENU(TodayForm);
  2489. return;
  2490. }
  2491. else if(strMsg=="取件预约")
  2492. {
  2493. UINT nID=2;
  2494. LPSTR pName ;
  2495. pName = (LPSTR)(LPCSTR)"取件预约";
  2496. g_bookingtype=3;
  2497. OPEN_MENU(TodayForm);
  2498. return;
  2499. }
  2500. else if(strMsg=="婚庆安排")
  2501. {
  2502. UINT nID=2;
  2503. LPSTR pName ;
  2504. pName = (LPSTR)(LPCSTR)"婚庆安排";
  2505. g_bookingtype=4;
  2506. OPEN_MENU(TodayForm);
  2507. return;
  2508. }
  2509. #endif
  2510. else if(strMsg=="员工资料")
  2511. {
  2512. UINT nID=2;
  2513. LPSTR pName ;
  2514. pName = (LPSTR)(LPCSTR)"员工资料";
  2515. if(g_bAllBranch)
  2516. OPEN_MENU(EmployeeForm2);
  2517. else
  2518. OPEN_MENU(EmployeeForm);
  2519. return;
  2520. }
  2521. else if(strMsg=="客户区域")
  2522. {
  2523. // if(IsHasRightsnew(48)==0)return;
  2524. GetOcx();
  2525. UINT nID=2;
  2526. LPSTR pName ;
  2527. pName = (LPSTR)(LPCSTR)"客户区域";
  2528. OPEN_MENU(AreaClient);
  2529. return;
  2530. }
  2531. else if(strMsg=="客户报表")
  2532. {
  2533. UINT nID=3;
  2534. LPSTR pName ;
  2535. pName = (LPSTR)(LPCSTR)"客户报表";
  2536. OPEN_MENU(CClientForm);
  2537. return;
  2538. }
  2539. else if(strMsg=="每日签到")
  2540. {
  2541. UINT nID=3;
  2542. LPSTR pName ;
  2543. pName = (LPSTR)(LPCSTR)"每日签到";
  2544. OPEN_MENU(WorkerReport);
  2545. return;
  2546. }
  2547. else if(strMsg=="服务费")
  2548. {
  2549. UINT nID=3;
  2550. LPSTR pName ;
  2551. pName = (LPSTR)(LPCSTR)"服务费";
  2552. OPEN_MENU(annualfee);
  2553. return;
  2554. }
  2555. else if(strMsg=="现金支出")
  2556. {
  2557. if(IsHasRightsnew(16)==0)return;
  2558. UINT nID=3;
  2559. LPSTR pName ;
  2560. pName = (LPSTR)(LPCSTR)"现金支出";
  2561. OPEN_MENU(PayOutInput);
  2562. return;
  2563. }
  2564. else if(strMsg=="短信群发")
  2565. {
  2566. UINT nID=3;
  2567. LPSTR pName ;
  2568. pName = (LPSTR)(LPCSTR)"短信群发";
  2569. OPEN_MENU(SendMsg);
  2570. return;
  2571. }
  2572. else if(strMsg=="短信发送")
  2573. {
  2574. UINT nID=3;
  2575. LPSTR pName ;
  2576. pName = (LPSTR)(LPCSTR)"客户报表";
  2577. OPEN_MENU(CClientForm);
  2578. return;
  2579. }
  2580. else if(strMsg=="流程短信")
  2581. {
  2582. UINT nID=3;
  2583. LPSTR pName ;
  2584. pName = (LPSTR)(LPCSTR)"流程短信";
  2585. OPEN_MENU(WorkMsg);
  2586. return;
  2587. }
  2588. else if(strMsg=="员工短信")
  2589. {
  2590. UINT nID=3;
  2591. LPSTR pName ;
  2592. pName = (LPSTR)(LPCSTR)"员工短信";
  2593. OPEN_MENU(EmployeeMsg);
  2594. return;
  2595. }
  2596. else if(strMsg=="发送记录")
  2597. {
  2598. UINT nID=3;
  2599. LPSTR pName ;
  2600. pName = (LPSTR)(LPCSTR)"发送记录";
  2601. OPEN_MENU(MsgReg);
  2602. return;
  2603. }
  2604. else if(strMsg=="短信设置")
  2605. {
  2606. if(IsHasRightsnew(49)==0)return;
  2607. MsgSet dlg;
  2608. dlg.DoModal();
  2609. return;
  2610. }
  2611. else if(strMsg=="金卡会员")
  2612. {
  2613. #ifndef ENTERPRISE_VERSION
  2614. #ifndef CHILD_VERSION
  2615. #ifdef BASIC_VERSION
  2616. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2617. {
  2618. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2619. exit(0);return;
  2620. }
  2621. #else
  2622. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2623. {
  2624. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2625. exit(0);return;
  2626. }
  2627. #endif
  2628. #else
  2629. #ifdef BASIC_VERSION
  2630. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2631. {
  2632. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2633. exit(0);return;
  2634. }
  2635. #else
  2636. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2637. {
  2638. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2639. exit(0);return;
  2640. }
  2641. #endif
  2642. #endif
  2643. #else
  2644. #ifndef CHILD_VERSION
  2645. #ifdef BASIC_VERSION
  2646. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2647. {
  2648. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2649. exit(0);return;
  2650. }
  2651. #else
  2652. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2653. {
  2654. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2655. exit(0);return;
  2656. }
  2657. #endif
  2658. #else
  2659. #ifdef BASIC_VERSION
  2660. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2661. {
  2662. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2663. exit(0);return;
  2664. }
  2665. #else
  2666. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2667. {
  2668. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2669. exit(0);return;
  2670. }
  2671. #endif
  2672. #endif
  2673. #endif
  2674. UINT nID=3;
  2675. LPSTR pName ;
  2676. pName = (LPSTR)(LPCSTR)"金卡会员";
  2677. OPEN_MENU(ShowMember);
  2678. return;
  2679. }
  2680. else if(strMsg=="现金子卡")
  2681. {
  2682. UINT nID=3;
  2683. LPSTR pName ;
  2684. pName = (LPSTR)(LPCSTR)"现金子卡";
  2685. OPEN_MENU(ShowMember2);
  2686. return;
  2687. }
  2688. else if(strMsg=="蓝钻会员")
  2689. {
  2690. #ifndef ENTERPRISE_VERSION
  2691. #ifndef CHILD_VERSION
  2692. #ifdef BASIC_VERSION
  2693. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2694. {
  2695. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2696. exit(0);return;
  2697. }
  2698. #else
  2699. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2700. {
  2701. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2702. exit(0);return;
  2703. }
  2704. #endif
  2705. #else
  2706. #ifdef BASIC_VERSION
  2707. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2708. {
  2709. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2710. exit(0);return;
  2711. }
  2712. #else
  2713. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2714. {
  2715. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2716. exit(0);return;
  2717. }
  2718. #endif
  2719. #endif
  2720. #else
  2721. #ifndef CHILD_VERSION
  2722. #ifdef BASIC_VERSION
  2723. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2724. {
  2725. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2726. exit(0);return;
  2727. }
  2728. #else
  2729. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2730. {
  2731. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2732. exit(0);return;
  2733. }
  2734. #endif
  2735. #else
  2736. #ifdef BASIC_VERSION
  2737. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2738. {
  2739. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2740. exit(0);return;
  2741. }
  2742. #else
  2743. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2744. {
  2745. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2746. exit(0);return;
  2747. }
  2748. #endif
  2749. #endif
  2750. #endif
  2751. UINT nID=3;
  2752. LPSTR pName ;
  2753. pName = (LPSTR)(LPCSTR)"蓝钻会员";
  2754. OPEN_MENU(ShowMemberBlue);
  2755. return;
  2756. }
  2757. else if(strMsg=="转介绍积分")
  2758. {
  2759. #ifndef ENTERPRISE_VERSION
  2760. #ifndef CHILD_VERSION
  2761. #ifdef BASIC_VERSION
  2762. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2763. {
  2764. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2765. exit(0);return;
  2766. }
  2767. #else
  2768. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2769. {
  2770. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2771. exit(0);return;
  2772. }
  2773. #endif
  2774. #else
  2775. #ifdef BASIC_VERSION
  2776. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2777. {
  2778. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2779. exit(0);return;
  2780. }
  2781. #else
  2782. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2783. {
  2784. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2785. exit(0);return;
  2786. }
  2787. #endif
  2788. #endif
  2789. #else
  2790. #ifndef CHILD_VERSION
  2791. #ifdef BASIC_VERSION
  2792. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2793. {
  2794. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2795. exit(0);return;
  2796. }
  2797. #else
  2798. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2799. {
  2800. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2801. exit(0);return;
  2802. }
  2803. #endif
  2804. #else
  2805. #ifdef BASIC_VERSION
  2806. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2807. {
  2808. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2809. exit(0);return;
  2810. }
  2811. #else
  2812. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2813. {
  2814. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2815. exit(0);return;
  2816. }
  2817. #endif
  2818. #endif
  2819. #endif
  2820. UINT nID=3;
  2821. LPSTR pName ;
  2822. pName = (LPSTR)(LPCSTR)"转介绍积分";
  2823. OPEN_MENU(Card2Reg);
  2824. return;
  2825. }
  2826. /* else if(strMsg=="转介绍图表")
  2827. {
  2828. #ifndef ENTERPRISE_VERSION
  2829. #ifndef CHILD_VERSION
  2830. #ifdef BASIC_VERSION
  2831. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2832. {
  2833. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2834. exit(0);return;
  2835. }
  2836. #else
  2837. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2838. {
  2839. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2840. exit(0);return;
  2841. }
  2842. #endif
  2843. #else
  2844. #ifdef BASIC_VERSION
  2845. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2846. {
  2847. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2848. exit(0);return;
  2849. }
  2850. #else
  2851. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2852. {
  2853. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2854. exit(0);return;
  2855. }
  2856. #endif
  2857. #endif
  2858. #else
  2859. #ifndef CHILD_VERSION
  2860. #ifdef BASIC_VERSION
  2861. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2862. {
  2863. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2864. exit(0);return;
  2865. }
  2866. #else
  2867. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2868. {
  2869. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2870. exit(0);return;
  2871. }
  2872. #endif
  2873. #else
  2874. #ifdef BASIC_VERSION
  2875. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2876. {
  2877. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2878. exit(0);return;
  2879. }
  2880. #else
  2881. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2882. {
  2883. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2884. exit(0);return;
  2885. }
  2886. #endif
  2887. #endif
  2888. #endif
  2889. UINT nID=3;
  2890. LPSTR pName ;
  2891. pName = (LPSTR)(LPCSTR)"转介绍图表";
  2892. OPEN_MENU(Card2RegChart);
  2893. return;
  2894. }*/
  2895. else if(strMsg=="金卡图表")
  2896. {
  2897. UINT nID=3;
  2898. LPSTR pName ;
  2899. pName = (LPSTR)(LPCSTR)"金卡图表";
  2900. OPEN_MENU(MemberChart);
  2901. return;
  2902. }
  2903. else if(strMsg=="积分短信")
  2904. {
  2905. UINT nID=3;
  2906. LPSTR pName ;
  2907. pName = (LPSTR)(LPCSTR)"积分短信";
  2908. OPEN_MENU(ShowMemberMsg);
  2909. return;
  2910. }
  2911. else if(strMsg=="转介绍返现")
  2912. {
  2913. #ifndef ENTERPRISE_VERSION
  2914. #ifndef CHILD_VERSION
  2915. #ifdef BASIC_VERSION
  2916. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2917. {
  2918. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2919. exit(0);return;
  2920. }
  2921. #else
  2922. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2923. {
  2924. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2925. exit(0);return;
  2926. }
  2927. #endif
  2928. #else
  2929. #ifdef BASIC_VERSION
  2930. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2931. {
  2932. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2933. exit(0);return;
  2934. }
  2935. #else
  2936. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2937. {
  2938. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2939. exit(0);return;
  2940. }
  2941. #endif
  2942. #endif
  2943. #else
  2944. #ifndef CHILD_VERSION
  2945. #ifdef BASIC_VERSION
  2946. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2947. {
  2948. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2949. exit(0);return;
  2950. }
  2951. #else
  2952. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2953. {
  2954. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2955. exit(0);return;
  2956. }
  2957. #endif
  2958. #else
  2959. #ifdef BASIC_VERSION
  2960. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2961. {
  2962. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2963. exit(0);return;
  2964. }
  2965. #else
  2966. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2967. {
  2968. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2969. exit(0);return;
  2970. }
  2971. #endif
  2972. #endif
  2973. #endif
  2974. UINT nID=3;
  2975. LPSTR pName ;
  2976. pName = (LPSTR)(LPCSTR)"转介绍返现";
  2977. OPEN_MENU(Card2RegBlue);
  2978. return;
  2979. }
  2980. else if(strMsg=="转介绍图表")
  2981. {
  2982. #ifndef ENTERPRISE_VERSION
  2983. #ifndef CHILD_VERSION
  2984. #ifdef BASIC_VERSION
  2985. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2986. {
  2987. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2988. exit(0);return;
  2989. }
  2990. #else
  2991. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2992. {
  2993. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2994. exit(0);return;
  2995. }
  2996. #endif
  2997. #else
  2998. #ifdef BASIC_VERSION
  2999. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3000. {
  3001. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3002. exit(0);return;
  3003. }
  3004. #else
  3005. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3006. {
  3007. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3008. exit(0);return;
  3009. }
  3010. #endif
  3011. #endif
  3012. #else
  3013. #ifndef CHILD_VERSION
  3014. #ifdef BASIC_VERSION
  3015. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3016. {
  3017. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3018. exit(0);return;
  3019. }
  3020. #else
  3021. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3022. {
  3023. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3024. exit(0);return;
  3025. }
  3026. #endif
  3027. #else
  3028. #ifdef BASIC_VERSION
  3029. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3030. {
  3031. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3032. exit(0);return;
  3033. }
  3034. #else
  3035. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3036. {
  3037. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3038. exit(0);return;
  3039. }
  3040. #endif
  3041. #endif
  3042. #endif
  3043. UINT nID=3;
  3044. LPSTR pName ;
  3045. pName = (LPSTR)(LPCSTR)"转介绍图表";
  3046. OPEN_MENU(Card2RegChartBlue);
  3047. return;
  3048. }
  3049. else if(strMsg=="积分设置")
  3050. {
  3051. if(IsHasRightsnew(49)==0)return;
  3052. MemberSet dlg;
  3053. dlg.DoModal();
  3054. return;
  3055. }
  3056. else if(strMsg=="礼服录入")
  3057. {
  3058. if(IsHasRightsnew(39)==0)return;
  3059. UINT nID=3;
  3060. LPSTR pName ;
  3061. pName = (LPSTR)(LPCSTR)"礼服录入";
  3062. OPEN_MENU(DressManage);
  3063. return;
  3064. }
  3065. else if(strMsg=="礼服查看")
  3066. {
  3067. #ifndef ENTERPRISE_VERSION
  3068. #ifndef CHILD_VERSION
  3069. #ifdef BASIC_VERSION
  3070. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3071. {
  3072. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3073. exit(0);return;
  3074. }
  3075. #else
  3076. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3077. {
  3078. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3079. exit(0);return;
  3080. }
  3081. #endif
  3082. #else
  3083. #ifdef BASIC_VERSION
  3084. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3085. {
  3086. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3087. exit(0);return;
  3088. }
  3089. #else
  3090. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3091. {
  3092. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3093. exit(0);return;
  3094. }
  3095. #endif
  3096. #endif
  3097. #else
  3098. #ifndef CHILD_VERSION
  3099. #ifdef BASIC_VERSION
  3100. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3101. {
  3102. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3103. exit(0);return;
  3104. }
  3105. #else
  3106. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3107. {
  3108. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3109. exit(0);return;
  3110. }
  3111. #endif
  3112. #else
  3113. #ifdef BASIC_VERSION
  3114. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3115. {
  3116. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3117. exit(0);return;
  3118. }
  3119. #else
  3120. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3121. {
  3122. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3123. exit(0);return;
  3124. }
  3125. #endif
  3126. #endif
  3127. #endif
  3128. if(IsHasRightsnew(40)==0)return;
  3129. UINT nID=3;
  3130. LPSTR pName ;
  3131. pName = (LPSTR)(LPCSTR)"礼服查看";
  3132. OPEN_MENU(ShowDress);
  3133. return;
  3134. }
  3135. else if(strMsg=="撞期预警")
  3136. {
  3137. UINT nID=3;
  3138. LPSTR pName ;
  3139. pName = (LPSTR)(LPCSTR)"撞期预警";
  3140. OPEN_MENU(DressEarlyWarning);
  3141. return;
  3142. }
  3143. else if(strMsg=="礼服出租")
  3144. {
  3145. UINT nID=3;
  3146. LPSTR pName ;
  3147. pName = (LPSTR)(LPCSTR)"礼服出租";
  3148. OPEN_MENU(ShowHireReg);
  3149. return;
  3150. }
  3151. else if(strMsg=="礼服图片")
  3152. {
  3153. ShowPic dlg;
  3154. dlg.m_mode=4;
  3155. dlg.m_path=g_path5+"\\";
  3156. dlg.DoModal ();
  3157. return;
  3158. }
  3159. else if(strMsg=="商品类别设置")
  3160. {
  3161. if(IsHasRightsnew(29)==0)return;
  3162. SPLBDlg dlg;
  3163. dlg.DoModal ();
  3164. return;
  3165. }
  3166. else if(strMsg=="商品名称设置")
  3167. {
  3168. if(IsHasRightsnew(29)==0)return;
  3169. UINT nID=3;
  3170. LPSTR pName ;
  3171. pName = (LPSTR)(LPCSTR)"商品设置";
  3172. OPEN_MENU(ShangPin);
  3173. return;
  3174. }
  3175. else if(strMsg=="固定资产管理")
  3176. {
  3177. UINT nID=3;
  3178. LPSTR pName ;
  3179. pName = (LPSTR)(LPCSTR)"固定资产管理";
  3180. OPEN_MENU(FixedAssets);
  3181. return;
  3182. }
  3183. else if(strMsg=="入库单")
  3184. {
  3185. if(IsHasRightsnew(44)==0)return;
  3186. InputGoods dlg;
  3187. dlg.DoModal ();
  3188. return;
  3189. }
  3190. else if(strMsg=="出库单")
  3191. {
  3192. #ifndef ENTERPRISE_VERSION
  3193. #ifndef CHILD_VERSION
  3194. #ifdef BASIC_VERSION
  3195. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3196. {
  3197. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3198. exit(0);return;
  3199. }
  3200. #else
  3201. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3202. {
  3203. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3204. exit(0);return;
  3205. }
  3206. #endif
  3207. #else
  3208. #ifdef BASIC_VERSION
  3209. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3210. {
  3211. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3212. exit(0);return;
  3213. }
  3214. #else
  3215. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3216. {
  3217. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3218. exit(0);return;
  3219. }
  3220. #endif
  3221. #endif
  3222. #else
  3223. #ifndef CHILD_VERSION
  3224. #ifdef BASIC_VERSION
  3225. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3226. {
  3227. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3228. exit(0);return;
  3229. }
  3230. #else
  3231. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3232. {
  3233. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3234. exit(0);return;
  3235. }
  3236. #endif
  3237. #else
  3238. #ifdef BASIC_VERSION
  3239. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3240. {
  3241. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3242. exit(0);return;
  3243. }
  3244. #else
  3245. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3246. {
  3247. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3248. exit(0);return;
  3249. }
  3250. #endif
  3251. #endif
  3252. #endif
  3253. if(IsHasRightsnew(45)==0)return;
  3254. InputGoods dlg;
  3255. dlg.m_mode=1;
  3256. dlg.DoModal ();
  3257. return;
  3258. }
  3259. else if(strMsg=="库存查询")
  3260. {
  3261. #ifndef ENTERPRISE_VERSION
  3262. #ifndef CHILD_VERSION
  3263. #ifdef BASIC_VERSION
  3264. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3265. {
  3266. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3267. exit(0);return;
  3268. }
  3269. #else
  3270. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3271. {
  3272. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3273. exit(0);return;
  3274. }
  3275. #endif
  3276. #else
  3277. #ifdef BASIC_VERSION
  3278. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3279. {
  3280. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3281. exit(0);return;
  3282. }
  3283. #else
  3284. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3285. {
  3286. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3287. exit(0);return;
  3288. }
  3289. #endif
  3290. #endif
  3291. #else
  3292. #ifndef CHILD_VERSION
  3293. #ifdef BASIC_VERSION
  3294. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3295. {
  3296. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3297. exit(0);return;
  3298. }
  3299. #else
  3300. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3301. {
  3302. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3303. exit(0);return;
  3304. }
  3305. #endif
  3306. #else
  3307. #ifdef BASIC_VERSION
  3308. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3309. {
  3310. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3311. exit(0);return;
  3312. }
  3313. #else
  3314. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3315. {
  3316. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3317. exit(0);return;
  3318. }
  3319. #endif
  3320. #endif
  3321. #endif
  3322. UINT nID=3;
  3323. LPSTR pName ;
  3324. pName = (LPSTR)(LPCSTR)"库存查询";
  3325. OPEN_MENU(ShowGoods);
  3326. return;
  3327. }
  3328. else if(strMsg=="商品图表")
  3329. {
  3330. UINT nID=3;
  3331. LPSTR pName ;
  3332. pName = (LPSTR)(LPCSTR)"商品图表";
  3333. OPEN_MENU(StoreInfoChart);
  3334. return;
  3335. }
  3336. else if(strMsg=="成本核算")
  3337. {
  3338. UINT nID=3;
  3339. LPSTR pName ;
  3340. pName = (LPSTR)(LPCSTR)"成本核算";
  3341. OPEN_MENU(CostCal);
  3342. return;
  3343. }
  3344. else if(strMsg=="考勤记录")
  3345. {
  3346. UINT nID=3;
  3347. LPSTR pName ;
  3348. pName = (LPSTR)(LPCSTR)"考勤记录";
  3349. OPEN_MENU(LoginReg);
  3350. return;
  3351. }
  3352. else if(strMsg=="月统计")
  3353. {
  3354. UINT nID=3;
  3355. LPSTR pName ;
  3356. pName = (LPSTR)(LPCSTR)"月统计";
  3357. OPEN_MENU(LoginReg2);
  3358. return;
  3359. }
  3360. else if(strMsg=="时间设置")
  3361. {
  3362. if(IsHasRightsnew(21)==0)return;
  3363. SetLoginTime dlg;
  3364. dlg.DoModal ();
  3365. return;
  3366. }
  3367. else if(strMsg=="排班设置")
  3368. {
  3369. if(IsHasRightsnew(21)==0)return;
  3370. SetLoginBan dlg;
  3371. dlg.DoModal ();
  3372. return;
  3373. }
  3374. else if(strMsg=="意向查询")
  3375. {
  3376. UINT nID=3;
  3377. LPSTR pName ;
  3378. pName = (LPSTR)(LPCSTR)"意向查询";
  3379. OPEN_MENU(HospitalClient);
  3380. return;
  3381. }
  3382. else if(strMsg=="今日提醒")
  3383. {
  3384. UINT nID=3;
  3385. LPSTR pName ;
  3386. pName = (LPSTR)(LPCSTR)"今日提醒";
  3387. OPEN_MENU(HospitalClientAlarm);
  3388. return;
  3389. }
  3390. else if(strMsg=="跟踪短信")
  3391. {
  3392. UINT nID=3;
  3393. LPSTR pName ;
  3394. pName = (LPSTR)(LPCSTR)"跟踪短信";
  3395. OPEN_MENU(HospitalClientMsg);
  3396. return;
  3397. }
  3398. else if(strMsg=="意向单录入")
  3399. {
  3400. AddHospitalClient dlg;
  3401. dlg.DoModal();
  3402. return;
  3403. }
  3404. else if(strMsg=="资料设置")
  3405. {
  3406. HospitalInfoSet dlg;
  3407. dlg.DoModal ();
  3408. return;
  3409. }
  3410. #if 1 // Jeff.add.2014.07.08.多多福文件柜功能;
  3411. else if ( strMsg == "文件柜")
  3412. {
  3413. //FileManage dlg;
  3414. UINT nID=3;
  3415. LPSTR pName ;
  3416. pName = (LPSTR)(LPCSTR)"文件柜";
  3417. OPEN_MENU(FileManage);
  3418. return;
  3419. }
  3420. #endif
  3421. AfxMessageBox(strMsg+",开发中...");
  3422. }
  3423. void CMainFrame::AutoUpdate()
  3424. {
  3425. if(g_bBranchModify)
  3426. {
  3427. AfxMessageBox("此店与分店"+g_branchname+"软件版本不同,请同时升级! ");
  3428. return;
  3429. }
  3430. else if(g_branchname!="")
  3431. {
  3432. AfxMessageBox("此店与分店"+g_branchname+"软件版本不同,请同时升级! ");
  3433. return;
  3434. }
  3435. g_ntimeout=30000;
  3436. if(!::PathFileExists (g_mainpath+"\\AutoUpdate.exe"))
  3437. {
  3438. g_sendhead.bsql=0;
  3439. g_sendhead.code[0]=99;
  3440. g_sendhead.tabcount=1;
  3441. g_pMainWnd->ProcessChatMessageRequest2(99);
  3442. if(g_bSendOK==0)
  3443. goto failed;
  3444. CFile fp;
  3445. fp.Open (g_mainpath+"\\AutoUpdate.exe", CFile::modeWrite|CFile::modeCreate);
  3446. fp.Write (g_pData, g_nLeng);
  3447. fp.Close ();
  3448. }
  3449. {
  3450. ::DeleteFile (g_mainpath+"\\YLGL2.exe");
  3451. g_sendhead.bsql=0;
  3452. g_sendhead.code[0]=98;
  3453. g_sendhead.tabcount=1;
  3454. g_pMainWnd->ProcessChatMessageRequest2(99);if(g_bSendOK==0)goto failed;
  3455. CFile fp;
  3456. fp.Open (g_mainpath+"\\YLGL2.exe", CFile::modeWrite|CFile::modeCreate);
  3457. fp.Write (g_pData, g_nLeng);
  3458. fp.Close ();
  3459. }
  3460. AfxMessageBox("自动升级成功!", MB_ICONINFORMATION);
  3461. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\AutoUpdate.exe"), "12345", NULL, SW_SHOWNORMAL);
  3462. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3463. exit(0);
  3464. return ;
  3465. failed:
  3466. AfxMessageBox("自动升级失败!", MB_ICONINFORMATION);
  3467. if(g_ntimeout==30000)//非远程
  3468. {
  3469. AfxMessageBox("提醒:升级过程中需要传输较多的数据,如果网速慢可能导致远程升级失败!\r\n\
  3470. 可拷贝店内客户端用QQ传过来覆盖除dbconfig.dat的文件即可。", MB_ICONINFORMATION);
  3471. }
  3472. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3473. }
  3474. void CMainFrame::Onchoosephotoskin() //Jeff:此机用于选片菜单项;不在使用2014.06.16
  3475. {
  3476. if(g_user.bLongin==0)
  3477. {
  3478. if(g_bNoLoginLia)
  3479. {
  3480. Login dlg;
  3481. dlg.SetLiaPath ("5.lia");
  3482. dlg.DoModal();
  3483. }
  3484. else
  3485. {
  3486. Login3 dlg;
  3487. dlg.SetLiaPath ("5.lia");
  3488. dlg.DoModal();
  3489. }
  3490. if(g_user.bLongin==0)return;
  3491. }
  3492. // TODO: Add your command handler code here
  3493. CString version = _T ("Version 1.0");
  3494. CMenu *pMenu=GetMenu();
  3495. CMenu* submenu = pMenu->GetSubMenu(1);
  3496. UINT status=submenu->GetMenuState(IDM_choosephotoskin, MF_BYCOMMAND );
  3497. if(status&MF_CHECKED)
  3498. {
  3499. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_UNCHECKED);
  3500. AfxGetApp()->WriteProfileInt (version, "status", 0);
  3501. }
  3502. else
  3503. {
  3504. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  3505. AfxGetApp()->WriteProfileInt (version, "status", 1);
  3506. }
  3507. }
  3508. BOOL CMainFrame::IsCtrlDown()
  3509. {
  3510. short state=GetKeyState(VK_LCONTROL);
  3511. BYTE sta=(BYTE)(state>>8);
  3512. state=GetKeyState(VK_RCONTROL);
  3513. BYTE sta2=(BYTE)(state>>8);
  3514. if(sta||sta2)
  3515. return 1;
  3516. else
  3517. return 0;
  3518. }//IsShiftDown
  3519. BOOL CMainFrame::IsShiftDown()
  3520. {
  3521. short state=GetKeyState(VK_LSHIFT);
  3522. BYTE sta=(BYTE)(state>>8);
  3523. state=GetKeyState(VK_RSHIFT);
  3524. BYTE sta2=(BYTE)(state>>8);
  3525. if(sta||sta2)
  3526. return 1;
  3527. else
  3528. return 0;
  3529. }
  3530. BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
  3531. {
  3532. // TODO: Add your specialized code here and/or call the base class IDM_Logout
  3533. if(pMsg->message==WM_KEYDOWN)
  3534. {
  3535. switch (pMsg->wParam)
  3536. {
  3537. case VK_F12:
  3538. g_pMainWnd->OnCommandMenu(IDM_Logout);
  3539. return 1;
  3540. case VK_F1:
  3541. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  3542. return 1;
  3543. case VK_F2:
  3544. {
  3545. if(g_pMainWnd->m_bCheckF2F3 && (IsShiftDown()==0 || IsCtrlDown()==0) )return 1;
  3546. m_Mdi.MainClose();
  3547. if(g_user.bLongin)
  3548. {
  3549. SearchClient dlg;
  3550. dlg.SetLiaPath ("2.lia");
  3551. if(dlg.DoModal ()!=IDOK)
  3552. {
  3553. if(dlg.m_bLogout)
  3554. {
  3555. g_user.bLongin=0;
  3556. g_user.name.Empty ();
  3557. g_user.rights.Empty ();
  3558. g_user.account.Empty ();
  3559. goto ll;
  3560. }
  3561. PostMessage(WM_QUIT);
  3562. return 1;
  3563. }
  3564. if(dlg.m_exitcode==3)
  3565. {
  3566. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3567. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3568. }
  3569. else
  3570. {
  3571. ShowWindow(SW_SHOW);
  3572. #ifdef NEW_SKIN
  3573. if(m_pMainFrimDlg2==NULL)
  3574. {
  3575. m_pMainFrimDlg2=new MainFrimDlg2;
  3576. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3577. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3578. }
  3579. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3580. g_bInSkin=0;
  3581. #endif
  3582. }
  3583. }
  3584. else
  3585. {
  3586. ll:
  3587. ChoosePhotoSkin dlg;
  3588. dlg.SetLiaPath ("1.lia");
  3589. if(dlg.DoModal ()!=IDOK)
  3590. {
  3591. PostMessage(WM_QUIT);
  3592. return 1;
  3593. }
  3594. if(dlg.m_exitcode==3)
  3595. {
  3596. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3597. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3598. }
  3599. else
  3600. {
  3601. ShowWindow(SW_SHOW);
  3602. #ifdef NEW_SKIN
  3603. if(m_pMainFrimDlg2==NULL)
  3604. {
  3605. m_pMainFrimDlg2=new MainFrimDlg2;
  3606. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3607. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3608. }
  3609. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3610. #endif
  3611. }
  3612. }
  3613. }
  3614. return 1;
  3615. case VK_F3:
  3616. {
  3617. if(g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown()==0 || g_pMainWnd->IsCtrlDown()==0) )return 1;
  3618. m_Mdi.MainClose();
  3619. if(g_user.bLongin)
  3620. {
  3621. SearchClient dlg;
  3622. dlg.m_mode =1;
  3623. dlg.SetLiaPath ("2.lia");
  3624. if(dlg.DoModal ()!=IDOK)
  3625. {
  3626. if(dlg.m_bLogout)
  3627. {
  3628. g_user.bLongin=0;
  3629. g_user.name.Empty ();
  3630. g_user.rights.Empty ();
  3631. g_user.account.Empty ();
  3632. goto mm;
  3633. }
  3634. PostMessage(WM_QUIT);
  3635. return 1;
  3636. }
  3637. if(dlg.m_exitcode==2)
  3638. {
  3639. keybd_event(VK_F2,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3640. keybd_event(VK_F2,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3641. }
  3642. else
  3643. {
  3644. ShowWindow(SW_SHOW);
  3645. #ifdef NEW_SKIN
  3646. if(m_pMainFrimDlg2==NULL)
  3647. {
  3648. m_pMainFrimDlg2=new MainFrimDlg2;
  3649. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3650. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3651. }
  3652. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3653. #endif
  3654. }
  3655. }
  3656. else
  3657. {
  3658. mm:
  3659. ChoosePhotoSkin dlg;
  3660. dlg.m_mode =1;
  3661. dlg.SetLiaPath ("1.lia");
  3662. if(dlg.DoModal ()!=IDOK)
  3663. {
  3664. PostMessage(WM_QUIT);
  3665. return 1;
  3666. }
  3667. if(dlg.m_exitcode==2)
  3668. {
  3669. keybd_event(VK_F2,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3670. keybd_event(VK_F2,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3671. }
  3672. else
  3673. {
  3674. ShowWindow(SW_SHOW);
  3675. #ifdef NEW_SKIN
  3676. if(m_pMainFrimDlg2==NULL)
  3677. {
  3678. m_pMainFrimDlg2=new MainFrimDlg2;
  3679. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3680. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3681. }
  3682. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3683. #endif
  3684. }
  3685. }
  3686. }
  3687. return 1;
  3688. case VK_F11:
  3689. if(g_bInSkin)return 1;
  3690. if(g_user.bLongin)
  3691. {
  3692. SqlDlg dlg;
  3693. dlg.DoModal ();
  3694. }
  3695. break;
  3696. #ifdef LYFZ_VERSION
  3697. case VK_F4:
  3698. if(g_user.bLongin)
  3699. {
  3700. g_sendhead.bsql=0;
  3701. g_sendhead.code[0]=199;
  3702. g_sendhead.tabcount=1;
  3703. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return 0;
  3704. DataToArray(&g_List1array);
  3705. CStdioFile fp;
  3706. CString path=g_mainpath+"\\NullBalance.txt";
  3707. ::DeleteFile (path);
  3708. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  3709. CString str;
  3710. for(int i=0; i<g_List1array.GetSize (); i++)
  3711. {
  3712. for(int j=0; j<g_List1array.ElementAt (0).GetSize (); j++)
  3713. {
  3714. str=g_List1array.ElementAt (0).ElementAt (j)+"\n";
  3715. str.TrimLeft ();
  3716. fp.WriteString (str);
  3717. }
  3718. }
  3719. fp.Close ();
  3720. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  3721. }
  3722. break;
  3723. #endif
  3724. }
  3725. }
  3726. return CMDIFrameWnd::PreTranslateMessage(pMsg);
  3727. }
  3728. void CMainFrame::GetSkin()
  3729. {return;
  3730. #ifdef MNLS_VERSION
  3731. if(::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3732. {
  3733. CFile fp;
  3734. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeRead);
  3735. DWORD leng=fp.GetLength ();
  3736. fp.Close ();
  3737. if(leng!=194987)
  3738. ::DeleteFile (g_mainpath+"\\skin\\4.lia");
  3739. }
  3740. if(!::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3741. {
  3742. ::CreateDirectory (g_mainpath+"\\skin", NULL);
  3743. g_sendhead.bsql=0;
  3744. g_sendhead.code[0]=100;
  3745. g_sendhead.tabcount=1;
  3746. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  3747. CFile fp;
  3748. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeWrite|CFile::modeCreate);
  3749. fp.Write (g_pData, g_nLeng);
  3750. fp.Close ();
  3751. }
  3752. #endif
  3753. }
  3754. void AutoDraw(CPrintRX &m_Print, CRect &StrRect, CString &str, float fscale)
  3755. {
  3756. CString tempbz,temp;
  3757. BOOL bRun=0;
  3758. CSize size;
  3759. int fontsize=12;
  3760. int i=0;
  3761. ll: tempbz=str;
  3762. i=0;
  3763. m_Print.SetFontFace(fontsize, 1, "宋体");
  3764. while(1)
  3765. {
  3766. if(!tempbz.IsEmpty ())
  3767. {
  3768. temp=tempbz;
  3769. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3770. int right=0;
  3771. CRect temprc=StrRect;
  3772. temprc.top += i*(fontsize*fscale);i++;
  3773. temprc.bottom =temprc.top +fontsize;
  3774. if(temprc.bottom >StrRect.bottom )break;
  3775. while(size.cx>temprc.Width ())
  3776. {
  3777. right++;
  3778. temp=tempbz.Left (tempbz.GetLength ()-(right));
  3779. if(GIsHalfHZ(temp))
  3780. {
  3781. right++;
  3782. temp.Delete (temp.GetLength ()-1);
  3783. }
  3784. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3785. }
  3786. if(temp.Find ("\r\n")!=-1)
  3787. {
  3788. temp=temp.Left (temp.Find ("\r\n"));//i++;
  3789. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ()-2);
  3790. }
  3791. else
  3792. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  3793. if(bRun)
  3794. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, temprc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3795. }
  3796. else
  3797. break;
  3798. }
  3799. if(tempbz.IsEmpty ()==0)
  3800. {
  3801. fontsize--;
  3802. goto ll;
  3803. }
  3804. if(bRun==0)
  3805. {
  3806. bRun=1;
  3807. goto ll;
  3808. }
  3809. }
  3810. void CMainFrame::PrintDinDan3(CString strOrderNumber)
  3811. {
  3812. // TODO: Add your control notification handler code here
  3813. CPrintRX m_Print;
  3814. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  3815. {
  3816. m_Print.InitToPrint(NULL, 1);
  3817. }
  3818. else
  3819. {
  3820. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  3821. if(name.IsEmpty ())
  3822. m_Print.InitToPrint(NULL, 1);
  3823. else
  3824. {
  3825. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  3826. if(nret==-1)
  3827. {
  3828. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  3829. }
  3830. }
  3831. }
  3832. m_Print.StartPrint();
  3833. m_Print.StartPage();
  3834. LoadRect load;
  3835. load.SetLiaPath ("11.lia");
  3836. load.SetMargins(0,0);
  3837. if(!load.Load ())return;
  3838. LoadRect load2;
  3839. load2.SetLiaPath ("12.lia");
  3840. load2.SetMargins(0,0);
  3841. if(!load2.Load ())return;
  3842. LoadRect load3;
  3843. load3.SetLiaPath ("13.lia");
  3844. load3.SetMargins(-6,520);
  3845. if(!load3.Load ())return;
  3846. int i;
  3847. //////////////////////////////////////////////////////////////
  3848. CStringArray txarray;
  3849. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"'";
  3850. g_sendhead.code[0]=11;
  3851. g_sendhead.code[1]=52;
  3852. g_sendhead.code[2]=50;
  3853. g_sendhead.code[3]=150;
  3854. g_sendhead.tabcount=4;
  3855. g_sendhead.bsql=0;
  3856. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  3857. CArray<CStringArray, CStringArray>sparray;
  3858. CArray<CStringArray, CStringArray>clientarray;
  3859. CArray<CStringArray, CStringArray>jdarray;
  3860. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray);
  3861. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  3862. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  3863. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  3864. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  3865. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  3866. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  3867. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  3868. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  3869. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  3870. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  3871. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  3872. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  3873. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  3874. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  3875. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  3876. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  3877. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  3878. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  3879. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  3880. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  3881. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  3882. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  3883. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  3884. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  3885. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  3886. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  3887. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  3888. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  3889. CString m_bz ="其它要求: "+g_List1array.ElementAt (0).ElementAt (38);
  3890. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  3891. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  3892. if(IsHasRights2new(31)==0)
  3893. {
  3894. m_phone1="***";
  3895. m_phone2="***";
  3896. }
  3897. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  3898. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  3899. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  3900. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  3901. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  3902. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  3903. CString m_addr=m_addr1+";";
  3904. m_addr.TrimLeft (";");
  3905. m_addr+=m_addr2;
  3906. CString m_qq=m_qq1+";";
  3907. m_qq.TrimLeft (";");
  3908. m_qq+=m_qq2;
  3909. CString m_jd;
  3910. for( i=0; i<jdarray.GetSize (); i++)
  3911. {
  3912. m_jd+=jdarray.ElementAt (i).ElementAt (1);
  3913. m_jd+=";";
  3914. }
  3915. m_jd.TrimRight (";");
  3916. m_money1.Format ("%f", atof(m_taoxijiage));
  3917. m_money2.Format ("%f", atof(m_payed1));
  3918. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  3919. ConvertToPrice(m_money1);
  3920. ConvertToPrice(m_money2);
  3921. ConvertToPrice(m_money3);
  3922. ////////////////////////////////////////////////////////////////
  3923. int rcpos=-1;
  3924. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  3925. m_Print.SetFontFace(17, 1, "宋体");
  3926. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3927. StrRect.top -=0;
  3928. StrRect.bottom -=10;
  3929. StrRect.left -=140;
  3930. StrRect.right =StrRect.left+48;
  3931. m_Print.SetFontFace(15, 1, "宋体");
  3932. m_Print.SetColor(0xffffff);
  3933. m_Print.DrawRect(StrRect, 0);
  3934. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3935. StrRect.left =StrRect.right ;
  3936. StrRect.right =StrRect.left+48;
  3937. m_Print.DrawRect(StrRect, RGB(255,0,0));
  3938. m_Print.SetColor(0, RGB(255,0,0));
  3939. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3940. m_Print.SetColor(0);
  3941. m_Print.SetFontFace(12, 1, "宋体");
  3942. StrRect.left -=48;
  3943. int hei=StrRect.Height ();
  3944. StrRect.top =StrRect.bottom+2;
  3945. StrRect.bottom +=hei+2;
  3946. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3947. StrRect.top =StrRect.bottom-2;
  3948. StrRect.bottom +=hei-5;
  3949. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  3950. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3951. m_Print.SetFontFace(12, 1, "宋体");
  3952. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3953. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3954. m_Print.SetFontFace(11, 1, "宋体");
  3955. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3956. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3957. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3958. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3959. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3960. m_Print.DrawRect2(StrRect, 2);
  3961. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3962. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3963. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3964. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3965. m_Print.DrawRect2(StrRect, 2);
  3966. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3967. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3968. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3969. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3970. m_Print.DrawRect2(StrRect, 2);
  3971. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3972. m_Print.DrawText((LPTSTR)(LPCTSTR)"约单时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3973. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3974. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3975. m_Print.DrawRect2(StrRect, 2);
  3976. ////////////
  3977. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3978. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3979. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3980. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3981. m_Print.DrawRect2(StrRect, 2);
  3982. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3983. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3984. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3985. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3986. m_Print.DrawRect2(StrRect, 2);
  3987. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3988. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3989. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3990. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3991. m_Print.DrawRect2(StrRect, 2);
  3992. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3993. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3994. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3995. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3996. m_Print.DrawRect2(StrRect, 2);
  3997. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3998. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3999. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4000. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4001. m_Print.DrawRect2(StrRect, 2);
  4002. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4003. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/邮箱:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4004. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4005. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4006. m_Print.DrawRect2(StrRect, 2);
  4007. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4008. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系金额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4009. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4010. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4011. m_Print.DrawRect2(StrRect, 2);
  4012. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4013. //m_Print.DrawText((LPTSTR)(LPCTSTR)"定金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4014. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4015. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4016. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4017. m_Print.DrawRect2(StrRect, 2);
  4018. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4019. m_Print.DrawText((LPTSTR)(LPCTSTR)"余额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4020. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4021. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4022. m_Print.DrawRect2(StrRect, 2);
  4023. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4024. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4025. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4026. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4027. m_Print.DrawRect2(StrRect, 2);
  4028. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4029. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍摄景点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4030. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4031. m_Print.DrawText((LPTSTR)(LPCTSTR)m_jd, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4032. m_Print.DrawRect2(StrRect, 2);
  4033. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4034. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容提供: 男士服装:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4035. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4036. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0,FORMAT_HCENTER | FORMAT_VCENTER);
  4037. m_Print.DrawRect2(StrRect, 2);
  4038. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4039. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT| FORMAT_VCENTER);
  4040. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4041. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4042. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4043. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_HCENTER| FORMAT_VCENTER);
  4044. m_Print.DrawRect2(StrRect, 2);
  4045. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4046. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0,FORMAT_LEFT | FORMAT_VCENTER);
  4047. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4048. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内提供拍摄区服装/头饰造型", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4049. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4050. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4051. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4052. m_Print.DrawText((LPTSTR)(LPCTSTR)" ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4053. m_Print.DrawRect2(StrRect, 2);
  4054. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4055. m_Print.DrawText((LPTSTR)(LPCTSTR)"专业数码拍摄:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4056. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4057. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4058. m_Print.DrawRect2(StrRect, 2);
  4059. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4060. m_Print.DrawText((LPTSTR)(LPCTSTR)"张", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4061. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4062. m_Print.DrawText((LPTSTR)(LPCTSTR)"(JPG格式数据)", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4063. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4064. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内赠送:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4065. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4066. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_List1array.ElementAt (0).ElementAt (9)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4067. m_Print.DrawRect2(StrRect, 2);
  4068. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4069. m_Print.DrawText((LPTSTR)(LPCTSTR)"张设计排版精修入册", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4070. //////////////////////load2
  4071. rcpos=-1;
  4072. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4073. m_Print.DrawText((LPTSTR)(LPCTSTR)"原始数据套系内张数JPG格式光盘壹只", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4074. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4075. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4076. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4077. // m_Print.DrawText((LPTSTR)(LPCTSTR)"", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4078. // AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4079. m_Print.DrawRect2(StrRect, 2);
  4080. m_Print.SetFontFace(11, 1, "宋体");
  4081. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4082. m_Print.DrawText((LPTSTR)(LPCTSTR)"客人产品:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4083. int rowcount=sparray.GetSize ()/8;
  4084. int needaddrow=0;
  4085. while(sparray.GetSize ()>rowcount*8+needaddrow)
  4086. needaddrow++;
  4087. int pos=0;
  4088. CString str="";
  4089. int addcount=0;
  4090. if(needaddrow>0)
  4091. addcount=1;
  4092. else
  4093. addcount=0;
  4094. needaddrow--;
  4095. str.Empty ();
  4096. for( i=0; i<rowcount+addcount; i++)
  4097. {
  4098. str+=sparray.ElementAt (pos).ElementAt (5);
  4099. str+=" 数量:";
  4100. str+=sparray.ElementAt (pos).ElementAt (3);
  4101. str+=";";
  4102. pos++;
  4103. }
  4104. StrRect=load2.m_rcarray .ElementAt (++rcpos);//6
  4105. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4106. m_Print.DrawRect2(StrRect, 2);
  4107. StrRect=load2.m_rcarray .ElementAt (++rcpos);//6
  4108. if(needaddrow>0)
  4109. addcount=1;
  4110. else
  4111. addcount=0;
  4112. needaddrow--;
  4113. str.Empty ();
  4114. for( i=0; i<rowcount+addcount; i++)
  4115. {
  4116. str+=sparray.ElementAt (pos).ElementAt (5);
  4117. str+=" 数量:";
  4118. str+=sparray.ElementAt (pos).ElementAt (3);
  4119. str+=";";
  4120. pos++;
  4121. }
  4122. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4123. m_Print.DrawRect2(StrRect, 2);
  4124. StrRect=load2.m_rcarray .ElementAt (++rcpos);//7
  4125. if(needaddrow>0)
  4126. addcount=1;
  4127. else
  4128. addcount=0;
  4129. needaddrow--;
  4130. str.Empty ();
  4131. for( i=0; i<rowcount+addcount; i++)
  4132. {
  4133. str+=sparray.ElementAt (pos).ElementAt (5);
  4134. str+=" 数量:";
  4135. str+=sparray.ElementAt (pos).ElementAt (3);
  4136. str+=";";
  4137. pos++;
  4138. }
  4139. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4140. m_Print.DrawRect2(StrRect, 2);
  4141. StrRect=load2.m_rcarray .ElementAt (++rcpos);//8
  4142. if(needaddrow>0)
  4143. addcount=1;
  4144. else
  4145. addcount=0;
  4146. needaddrow--;
  4147. str.Empty ();
  4148. for( i=0; i<rowcount+addcount; i++)
  4149. {
  4150. str+=sparray.ElementAt (pos).ElementAt (5);
  4151. str+=" 数量:";
  4152. str+=sparray.ElementAt (pos).ElementAt (3);
  4153. str+=";";
  4154. pos++;
  4155. }
  4156. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4157. m_Print.DrawRect2(StrRect, 2);
  4158. StrRect=load2.m_rcarray .ElementAt (++rcpos);//9
  4159. if(needaddrow>0)
  4160. addcount=1;
  4161. else
  4162. addcount=0;
  4163. needaddrow--;
  4164. str.Empty ();
  4165. for( i=0; i<rowcount+addcount; i++)
  4166. {
  4167. str+=sparray.ElementAt (pos).ElementAt (5);
  4168. str+=" 数量:";
  4169. str+=sparray.ElementAt (pos).ElementAt (3);
  4170. str+=";";
  4171. pos++;
  4172. }
  4173. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4174. m_Print.DrawRect2(StrRect, 2);
  4175. StrRect=load2.m_rcarray .ElementAt (++rcpos);//10
  4176. if(needaddrow>0)
  4177. addcount=1;
  4178. else
  4179. addcount=0;
  4180. needaddrow--;
  4181. str.Empty ();
  4182. for( i=0; i<rowcount+addcount; i++)
  4183. {
  4184. str+=sparray.ElementAt (pos).ElementAt (5);
  4185. str+=" 数量:";
  4186. str+=sparray.ElementAt (pos).ElementAt (3);
  4187. str+=";";
  4188. pos++;
  4189. }
  4190. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4191. m_Print.DrawRect2(StrRect, 2);
  4192. StrRect=load2.m_rcarray .ElementAt (++rcpos);//11
  4193. if(needaddrow>0)
  4194. addcount=1;
  4195. else
  4196. addcount=0;
  4197. needaddrow--;
  4198. str.Empty ();
  4199. for( i=0; i<rowcount+addcount; i++)
  4200. {
  4201. str+=sparray.ElementAt (pos).ElementAt (5);
  4202. str+=" 数量:";
  4203. str+=sparray.ElementAt (pos).ElementAt (3);
  4204. str+=";";
  4205. pos++;
  4206. }
  4207. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4208. m_Print.DrawRect2(StrRect, 2);
  4209. StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4210. if(needaddrow>0)
  4211. addcount=1;
  4212. else
  4213. addcount=0;
  4214. needaddrow--;
  4215. str.Empty ();
  4216. for( i=0; i<rowcount+addcount; i++)
  4217. {
  4218. str+=sparray.ElementAt (pos).ElementAt (5);
  4219. str+=" 数量:";
  4220. str+=sparray.ElementAt (pos).ElementAt (3);
  4221. str+=";";
  4222. pos++;
  4223. }
  4224. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4225. m_Print.DrawRect2(StrRect, 2);
  4226. /* StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4227. if(needaddrow>0)
  4228. addcount=1;
  4229. else
  4230. addcount=0;
  4231. needaddrow--;
  4232. str.Empty ();
  4233. for( i=0; i<rowcount+addcount; i++)
  4234. {
  4235. str+=sparray.ElementAt (pos).ElementAt (5);
  4236. str+=" 数量:";
  4237. str+=sparray.ElementAt (pos).ElementAt (3);
  4238. str+=";";
  4239. pos++;
  4240. }
  4241. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4242. m_Print.DrawRect2(StrRect, 2);
  4243. StrRect=load2.m_rcarray .ElementAt (++rcpos);//14
  4244. if(needaddrow>0)
  4245. addcount=1;
  4246. else
  4247. addcount=0;
  4248. needaddrow--;
  4249. str.Empty ();
  4250. for( i=0; i<rowcount+addcount; i++)
  4251. {
  4252. str+=sparray.ElementAt (pos).ElementAt (5);
  4253. str+=" 数量:";
  4254. str+=sparray.ElementAt (pos).ElementAt (3);
  4255. str+=";";
  4256. pos++;
  4257. }
  4258. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4259. m_Print.DrawRect2(StrRect, 2);*/
  4260. CRect sprc[2];
  4261. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4262. // AutoDraw(m_Print, StrRect, m_bz.Left (leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4263. m_Print.DrawRect2(StrRect, 2);
  4264. sprc[0]=StrRect;
  4265. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4266. // AutoDraw(m_Print, StrRect, m_bz.Right (leng-leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4267. m_Print.DrawRect2(StrRect, 2);
  4268. sprc[1]=StrRect;
  4269. //AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4270. {
  4271. CString temp,tempspno,tempbz;
  4272. CSize size;
  4273. BOOL bRun=0;
  4274. int fontsize=12;
  4275. ll: tempspno=m_bz;
  4276. m_Print.SetFontFace(fontsize, 1, "宋体");
  4277. for( i=0; i<2; i++)
  4278. {
  4279. if(!tempspno.IsEmpty ())
  4280. {
  4281. temp=tempspno;
  4282. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4283. int right=0;
  4284. CRect temprc=sprc[i];
  4285. while(size.cx>temprc.Width ())
  4286. {
  4287. right++;
  4288. temp=tempspno.Left (tempspno.GetLength ()-(right));
  4289. if(GIsHalfHZ(temp))
  4290. {
  4291. right++;
  4292. temp.Delete (temp.GetLength ()-1);
  4293. }
  4294. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4295. }
  4296. if(bRun)
  4297. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4298. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  4299. if(tempspno.IsEmpty ())i++;
  4300. }
  4301. }
  4302. if(tempspno.IsEmpty ()==0)//|| tempbz.IsEmpty ()==0)
  4303. {
  4304. fontsize--;
  4305. goto ll;
  4306. }
  4307. if(bRun==0)
  4308. {
  4309. bRun=1;
  4310. goto ll;
  4311. }
  4312. }
  4313. m_Print.SetFontFace(11, 1, "宋体");
  4314. //////////////////////load3
  4315. rcpos=-1;
  4316. for( i=0; i<24; i++)
  4317. {
  4318. StrRect=load3.m_rcarray .ElementAt (i);
  4319. m_Print.DrawRect2(StrRect, 1);
  4320. }
  4321. CStringArray strarray;
  4322. strarray.Add("营业员");
  4323. strarray.Add("前台接待");
  4324. strarray.Add("化妆师");
  4325. strarray.Add("礼服师");
  4326. strarray.Add("摄影师");
  4327. strarray.Add("摄影助理");
  4328. strarray.Add("美工师");
  4329. strarray.Add("设计师");
  4330. for( i=0; i<8; i++)
  4331. {
  4332. StrRect=load3.m_rcarray .ElementAt (i);
  4333. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4334. }
  4335. strarray.RemoveAll();
  4336. strarray.Add(m_ren);
  4337. strarray.Add(g_List1array.ElementAt (0).ElementAt (49) );
  4338. strarray.Add(m_waiter2);
  4339. strarray.Add(g_List1array.ElementAt (0).ElementAt (51));
  4340. strarray.Add(m_waiter1);
  4341. strarray.Add(g_List1array.ElementAt (0).ElementAt (50));
  4342. strarray.Add("");
  4343. strarray.Add(m_waiter4);
  4344. for( i=8; i<16; i++)
  4345. {
  4346. StrRect=load3.m_rcarray .ElementAt (i);
  4347. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-8), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4348. }
  4349. StrRect=load3.m_rcarray .ElementAt (27);
  4350. m_Print.DrawText((LPTSTR)(LPCTSTR)"客户电话: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4351. StrRect=load3.m_rcarray .ElementAt (28);
  4352. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4353. m_Print.SetFontFace(13, 1, "宋体");
  4354. StrRect=load3.m_rcarray .ElementAt (25);
  4355. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4356. StrRect=load3.m_rcarray .ElementAt (26);
  4357. m_Print.DrawRect2(StrRect, 2);
  4358. StrRect=load3.m_rcarray .ElementAt (24);
  4359. str="\
  4360. 顾客须知\r\n\
  4361. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  4362. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  4363. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  4364. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  4365. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  4366. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  4367. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  4368. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  4369. AutoDraw(m_Print, StrRect, str, 1.8);
  4370. PrintPreview dlg;
  4371. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4372. dlg.m_pDC =m_Print.GetPDC() ;
  4373. if(dlg.DoModal ()!=IDOK)return;
  4374. //结束打印
  4375. m_Print.EndPage();
  4376. m_Print.EndPrint();
  4377. }
  4378. void CMainFrame::PrintDailyForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4379. {
  4380. // TODO: Add your control notification handler code here
  4381. int pages=Listarray->GetSize ()/46;
  4382. if(Listarray->GetSize ()%46)pages++;
  4383. for(int aa=0; aa<pages; aa++)
  4384. {
  4385. PrintPreview dlg;
  4386. CPrintRX m_Print;
  4387. m_Print.InitToPrint(NULL, 1);
  4388. m_Print.StartPrint();
  4389. m_Print.StartPage();
  4390. CRect mainrc(0,0,560,793);
  4391. float fscale;
  4392. {
  4393. int w,h;
  4394. m_Print.GetWidHei(w , h );
  4395. fscale=(float)w/(float)h;
  4396. }
  4397. mainrc.DeflateRect (25, 40, 10, 0);
  4398. CRect rc,rc2;
  4399. rc=mainrc;
  4400. rc.bottom =rc.top ;
  4401. rc.top -=20;
  4402. m_Print.SetFontFace(16, 1, "黑体");
  4403. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4404. m_Print.SetFontFace(9, 1, "宋体");
  4405. CString str;
  4406. int wid[4]={320,60,60,90};
  4407. int hei=16;
  4408. if(fscale>0.71)hei=15;
  4409. rc=mainrc;
  4410. rc.bottom =rc.top +hei;
  4411. for(int i=0; i<47; i++)
  4412. {
  4413. rc2.top =rc.top +i*hei;
  4414. rc2.bottom =rc.bottom +i*hei;
  4415. rc2.left =rc.left ;
  4416. rc2.right =rc.left +wid[0];
  4417. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  4418. for(int j=0; j<4; j++)
  4419. {
  4420. m_Print.DrawRect2(rc2, 1);
  4421. if(Listarray->GetSize ()>aa*46+i)
  4422. {
  4423. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4424. rc2.left +=3;
  4425. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4426. rc2.left -=3;
  4427. }
  4428. rc2.left +=wid[j];
  4429. rc2.right =rc2.left+wid[j+1];
  4430. }
  4431. }
  4432. rc2.top +=2;
  4433. rc2.left +=2;rc2.right =mainrc.right+4;
  4434. m_Print.SetFontFace(8, 1, "宋体");
  4435. int infopos=info.Find ("***");
  4436. if(infopos!=-1)
  4437. {
  4438. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Left (infopos), rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4439. CRect rc3=rc2;
  4440. rc3.top =rc2.bottom -4;
  4441. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Right (info.GetLength ()-infopos-3), rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4442. }
  4443. else
  4444. m_Print.DrawText((LPTSTR)(LPCTSTR)info, rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4445. str.Format (" 页:%d/%d", aa+1, pages);
  4446. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4447. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  4448. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4449. dlg.m_pDC =m_Print.GetPDC() ;
  4450. // dlg.m_mode=1;
  4451. if(aa==0)
  4452. {
  4453. if(dlg.DoModal ()!=IDOK)
  4454. return;
  4455. }
  4456. //结束打印
  4457. m_Print.EndPage();
  4458. m_Print.EndPrint();
  4459. }
  4460. }
  4461. void CMainFrame::PrintLoginForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4462. {
  4463. // TODO: Add your control notification handler code here
  4464. int sinlecount=33*6;
  4465. int pages=Listarray->GetSize ()/sinlecount;
  4466. if(Listarray->GetSize ()%sinlecount)pages++;
  4467. for(int aa=0; aa<pages; aa++)
  4468. {
  4469. PrintPreview dlg;
  4470. CPrintRX m_Print;
  4471. m_Print.InitToPrint(NULL, 1);
  4472. m_Print.StartPrint();
  4473. m_Print.StartPage();
  4474. CRect mainrc(0,0,560,793);
  4475. float fscale;
  4476. {
  4477. int w,h;
  4478. m_Print.GetWidHei(w , h );
  4479. fscale=(float)w/(float)h;
  4480. }
  4481. mainrc.DeflateRect (25, 40, 10, 0);
  4482. CString str;
  4483. CRect rc,rc2;
  4484. rc=mainrc;
  4485. rc.bottom =rc.top ;
  4486. rc.top -=20;
  4487. rc.left -=20;
  4488. m_Print.SetFontFace(12, 1, "黑体");
  4489. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4490. m_Print.SetFontFace(6, 1, "宋体");
  4491. str.Format (" 页:%d/%d", aa+1, pages);
  4492. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4493. rc.right =mainrc.right+20 ;
  4494. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4495. int wid[2]={50,110};
  4496. int hei=11;
  4497. rc=mainrc;
  4498. rc.bottom =rc.top +hei;
  4499. rc.top +=10;
  4500. rc.bottom +=10;
  4501. int dtx=rc.Width ()/3+18;
  4502. int dty=380;
  4503. for(int j=0; j<6; j++)
  4504. {
  4505. if(Listarray->GetSize ()<aa*sinlecount+33*(j+1))continue;
  4506. for(int i=0; i<33; i++)
  4507. {
  4508. rc2.top =rc.top +i*hei;
  4509. rc2.bottom =rc.bottom +i*hei;
  4510. rc2.left =rc.left ;
  4511. rc2.right =rc.left +wid[0];
  4512. if(i==0)
  4513. {
  4514. // rc2.left +=wid[1];
  4515. rc2.right +=wid[1];
  4516. }
  4517. if(j==1 || j==4)
  4518. {
  4519. rc2.left +=dtx;
  4520. rc2.right +=dtx;
  4521. }
  4522. if(j==2 || j==5)
  4523. {
  4524. rc2.left +=dtx*2;
  4525. rc2.right +=dtx*2;
  4526. }
  4527. if(j==3 || j==4 || j==5)
  4528. {
  4529. rc2.top +=dty;
  4530. rc2.bottom +=dty;
  4531. }
  4532. m_Print.DrawRect2(rc2, 1);
  4533. if(Listarray->GetSize ()>aa*sinlecount+33*j+i)
  4534. {
  4535. str=Listarray->ElementAt (aa*sinlecount+33*j+i).ElementAt (0);
  4536. rc2.left +=3;
  4537. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4538. rc2.left -=3;
  4539. }
  4540. if(i==0)continue;
  4541. rc2.left =rc2.right ;
  4542. rc2.right +=wid[1];
  4543. m_Print.DrawRect2(rc2, 1);
  4544. if(Listarray->GetSize ()>aa*sinlecount+33*j+i)
  4545. {
  4546. if(Listarray->ElementAt (aa*sinlecount+33*j+i).GetSize ()>1)
  4547. {
  4548. str=Listarray->ElementAt (aa*sinlecount+33*j+i).ElementAt (1);
  4549. rc2.left +=3;
  4550. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4551. rc2.left -=3;
  4552. }
  4553. }
  4554. /* if(Listarray->GetSize ()>aa*46+i)
  4555. {
  4556. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4557. rc2.left +=3;
  4558. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4559. rc2.left -=3;
  4560. }
  4561. rc2.left +=wid[j];
  4562. rc2.right =rc2.left+wid[j+1];*/
  4563. }
  4564. }
  4565. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4566. dlg.m_pDC =m_Print.GetPDC() ;
  4567. if(aa==0)
  4568. {
  4569. if(dlg.DoModal ()!=IDOK)
  4570. return;
  4571. }
  4572. //结束打印
  4573. m_Print.EndPage();
  4574. m_Print.EndPrint();
  4575. }
  4576. }
  4577. void CMainFrame::PrintTakeForm(CArray<CStringArray, CStringArray>*Listarray)
  4578. {
  4579. CString title;
  4580. CString info;
  4581. // TODO: Add your control notification handler code here
  4582. int sinlecount=4;
  4583. int pages=Listarray->GetSize ()/sinlecount;
  4584. if(Listarray->GetSize ()%sinlecount)pages++;
  4585. for(int aa=0; aa<pages; aa++)
  4586. {
  4587. PrintPreview dlg;
  4588. CPrintRX m_Print;
  4589. m_Print.InitToPrint(NULL, 1);
  4590. m_Print.StartPrint();
  4591. m_Print.StartPage();
  4592. CRect mainrc(0,0,560,793);
  4593. float fscale;
  4594. {
  4595. int w,h;
  4596. m_Print.GetWidHei(w , h );
  4597. fscale=(float)w/(float)h;
  4598. }
  4599. mainrc.DeflateRect (25, 40, 10, 0);
  4600. CString str;
  4601. CRect rc,rc2;
  4602. rc=mainrc;
  4603. rc.bottom =rc.top ;
  4604. rc.top -=20;
  4605. rc.left -=20;
  4606. m_Print.SetFontFace(6, 1, "宋体");
  4607. str.Format (" 页:%d/%d", aa+1, pages);
  4608. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4609. rc.right =mainrc.right+10 ;
  4610. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4611. m_Print.SetFontFace(12, 1, "宋体");
  4612. int wid[2]={70,190};
  4613. int hei=22;
  4614. rc=mainrc;
  4615. rc.bottom =rc.top +hei;
  4616. rc.top +=10;
  4617. rc.bottom +=10;
  4618. int dtx=rc.Width ()/2+18;
  4619. int dty=380;
  4620. int arraysize=Listarray->ElementAt (0).GetSize();
  4621. for(int j=0; j<4; j++)
  4622. {
  4623. if(Listarray->GetSize ()<=aa*sinlecount+j)continue;
  4624. for(int i=0; i<arraysize; i++)
  4625. {
  4626. rc2.top =rc.top +i/2*hei;
  4627. rc2.bottom =rc.bottom +i/2*hei;
  4628. rc2.left =rc.left ;
  4629. rc2.right =rc.left +wid[0];
  4630. if(i%2)
  4631. {
  4632. rc2.left=rc2.right;
  4633. rc2.right +=wid[1];
  4634. }
  4635. if(j==1 || j==3)
  4636. {
  4637. rc2.left +=dtx;
  4638. rc2.right +=dtx;
  4639. }
  4640. if(j==2 || j==3 )
  4641. {
  4642. rc2.top +=dty;
  4643. rc2.bottom +=dty;
  4644. }
  4645. if(i==arraysize-1 || i==arraysize-2)
  4646. {
  4647. rc2.bottom +=hei*2;
  4648. }
  4649. m_Print.DrawRect2(rc2, 1);
  4650. {
  4651. str=Listarray->ElementAt (aa*sinlecount+j).ElementAt (i);
  4652. if(i==arraysize-1)
  4653. {
  4654. CRect rc3=rc2;
  4655. rc3.left+=3;
  4656. rc3.top+=3;
  4657. AutoDraw(m_Print, rc3, str, 1.4);
  4658. }
  4659. else if(i==arraysize-2)
  4660. {
  4661. CRect rc3=rc2;
  4662. rc3.left+=3;
  4663. rc3.top+=3;
  4664. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4665. }
  4666. else
  4667. {
  4668. rc2.left +=3;
  4669. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4670. rc2.left -=3;
  4671. }
  4672. }
  4673. }
  4674. }
  4675. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4676. dlg.m_pDC =m_Print.GetPDC() ;
  4677. if(aa==0)
  4678. {
  4679. if(dlg.DoModal ()!=IDOK)
  4680. return;
  4681. }
  4682. //结束打印
  4683. m_Print.EndPage();
  4684. m_Print.EndPrint();
  4685. }
  4686. }
  4687. void CMainFrame::PrintThumbNail(CStringArray *array, CString client, BOOL bDir, CString m_size)
  4688. {
  4689. // TODO: Add your control notification handler code here
  4690. CStringArray titlearray;
  4691. CStringArray namearray;
  4692. CStringArray noarray;
  4693. CArray<CRect,CRect>rcarray;
  4694. CArray<CRect,CRect>widtharray;
  4695. if(m_size!="")
  4696. {
  4697. int pos=m_size.Find (";");
  4698. while(pos!=-1)
  4699. {
  4700. CString size=m_size.Left (pos);
  4701. int pos2=size.Find (":");
  4702. if(pos2!=-1)
  4703. {
  4704. CString str;
  4705. CRect rc;
  4706. str=size.Left (pos2);
  4707. noarray.Add (str);
  4708. str=size.Right (size.GetLength ()-pos2-1);
  4709. pos2=str.Find (",");
  4710. namearray.Add(str.Left (pos2));str.Delete (0, pos2+1);
  4711. pos2=str.Find (",");
  4712. rc.left=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4713. pos2=str.Find (",");
  4714. rc.top=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4715. widtharray.Add (rc);
  4716. pos2=str.Find (",");
  4717. rc.left=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4718. pos2=str.Find (",");
  4719. rc.top=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4720. pos2=str.Find (",");
  4721. rc.right=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4722. rc.bottom=atoi(str);
  4723. rcarray.Add (rc);
  4724. }
  4725. m_size=m_size.Right (m_size.GetLength ()-pos-1);
  4726. pos=m_size.Find (";");
  4727. }
  4728. }
  4729. PrintPreview dlg;
  4730. CPrintRX m_Print;
  4731. m_Print.InitToPrint(NULL, 1);
  4732. m_Print.StartPrint();
  4733. m_Print.StartPage();
  4734. CRect mainrc(0,0,560,793);
  4735. mainrc.DeflateRect (25, 50, 10, 0);
  4736. m_Print.SetFontFace(10, 1, "宋体");
  4737. CRect rc,rc2;
  4738. rc=mainrc;
  4739. rc.bottom =rc.top ;
  4740. rc.top -=20;
  4741. m_Print.DrawText((LPTSTR)(LPCTSTR)client, rc, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4742. rc.bottom -=5;
  4743. m_Print.DrawRect2(rc, 2);
  4744. if(array->GetSize ()>130)m_Print.SetFontFace(8, 1, "宋体");
  4745. if(bDir)m_Print.SetFontFace(6, 1, "宋体");
  4746. ////////////////////////////////////////////////////////////////
  4747. int imgcount=array->GetSize ();
  4748. int dtx=5;
  4749. int dty=15;
  4750. int cx,cy;
  4751. int countx=5;
  4752. int county=1;
  4753. while(1)
  4754. {
  4755. if(countx*county>=imgcount)
  4756. {
  4757. cx=(mainrc.Width ()-(countx-1)*dtx)/countx;
  4758. cy=cx*4/3;
  4759. break;
  4760. }
  4761. else
  4762. {
  4763. cx=(mainrc.Width ()-(countx-1)*dtx)/countx;
  4764. cy=cx*4/3;
  4765. if(cy*(county+1)+dty*county < mainrc.Height ())//Y方向可以增加一个
  4766. {
  4767. county++;
  4768. }
  4769. else//Y方向不能加,X方向加
  4770. {
  4771. countx++;
  4772. county=1;
  4773. }
  4774. }
  4775. }
  4776. int imgpos=0;
  4777. CString stemp;
  4778. CPen pen( PS_SOLID, 1, RGB(255, 0, 0) );
  4779. CPen *oldpen=m_Print.m_DC.SelectObject(&pen);
  4780. CPen *oldpen2=m_Print.m_memdc.SelectObject(&pen);
  4781. for(int i=0; i<county; i++)
  4782. {
  4783. for(int j=0; j<countx; j++)
  4784. {
  4785. rc=mainrc;
  4786. rc.top +=i*(cy+dty);
  4787. rc.left +=j*(cx+dtx);
  4788. rc.right =rc.left +cx;
  4789. rc.bottom =rc.top +cy;
  4790. Image *pImg=NULL;
  4791. if(imgpos>=array->GetSize ())break;
  4792. CString str=array->ElementAt (imgpos);
  4793. CString spath=str.Left (str.ReverseFind ('\\')+1);
  4794. spath+="m";
  4795. spath+=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4796. if(::CheckFileExist (spath))
  4797. ::LoadImageFromBuf (&pImg, spath);
  4798. else
  4799. {
  4800. ::LoadImageFromBuf (&pImg, str);
  4801. if(pImg==NULL)continue;
  4802. int orientation=GetOrientation(pImg);
  4803. if(orientation==8)
  4804. pImg->RotateFlip( Rotate270FlipNone );
  4805. else if(orientation==6)
  4806. pImg->RotateFlip( Rotate90FlipNone );
  4807. }
  4808. if(pImg==NULL)continue;
  4809. rc2=rc;
  4810. RectFitDes(pImg->GetWidth(), pImg->GetHeight(), rc);
  4811. imgpos++;
  4812. m_Print.DrawImage(pImg, rc);
  4813. int imgwidth=pImg->GetWidth();
  4814. delete pImg;
  4815. rc2.top =rc2.bottom+3 ;
  4816. rc2.bottom +=10;
  4817. if(bDir==0)
  4818. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4819. else
  4820. {
  4821. stemp=str.Left (str.ReverseFind ('\\'));
  4822. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4823. if(stemp.ReverseFind ('\\')!=-1)
  4824. {
  4825. stemp=stemp.Right (stemp.GetLength ()-stemp.ReverseFind ('\\')-1);
  4826. str=stemp+"\\"+str;
  4827. }
  4828. }
  4829. if(str.Find (".")!=-1)
  4830. str=str.Left (str.Find ("."));
  4831. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  4832. if(noarray.GetSize())
  4833. {
  4834. rc2=rc;
  4835. for(int aa=0; aa<noarray.GetSize(); aa++)
  4836. {
  4837. float scale=(float)rc2.Width ()/(float)imgwidth;
  4838. if(noarray.ElementAt(aa)==str)
  4839. {
  4840. int nIndex=aa;
  4841. CRect rc=rcarray.ElementAt (nIndex);
  4842. int wid=widtharray.ElementAt (nIndex).left;
  4843. int hei=widtharray.ElementAt (nIndex).top;
  4844. scale*=(float)imgwidth/(float)wid;
  4845. rc.left *=scale;
  4846. rc.right *=scale;
  4847. rc.top *=scale;
  4848. rc.bottom *=scale;
  4849. rc.left+=rc2.left;
  4850. rc.right+=rc2.left;
  4851. rc.top +=rc2.top;
  4852. rc.bottom +=rc2.top;
  4853. if(rc.left<rc2.left)rc.left=rc2.left;
  4854. if(rc.right>rc2.right)rc.right=rc2.right;
  4855. if(rc.top<rc2.top)rc.top=rc2.top;
  4856. if(rc.bottom>rc2.bottom)rc.bottom=rc2.bottom;
  4857. m_Print.DrawRect2(rc, 1);
  4858. }
  4859. }
  4860. }
  4861. }
  4862. }
  4863. m_Print.m_DC.SelectObject(oldpen);
  4864. m_Print.m_memdc.SelectObject(oldpen2);
  4865. /* CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  4866. StrRect.top -=15;StrRect.bottom -=15;
  4867. Image *pImg=NULL;
  4868. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  4869. m_Print.DrawImage(pImg, StrRect);
  4870. delete pImg;
  4871. m_Print.SetFontFace(10, 1, "宋体");
  4872. StrRect=load.m_rcarray .ElementAt (20);
  4873. StrRect.right=load.m_rcarray .ElementAt (23).right;
  4874. StrRect.top -=18;StrRect.bottom -=18;
  4875. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  4876. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4877. */
  4878. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4879. dlg.m_pDC =m_Print.GetPDC() ;
  4880. if(dlg.DoModal ()!=IDOK)
  4881. return;
  4882. //结束打印
  4883. m_Print.EndPage();
  4884. m_Print.EndPrint();
  4885. }
  4886. // remark by Jeff
  4887. // 函数:PrintDinDan
  4888. // 参数:
  4889. // strOrderNumber:订单单号;(Order number)
  4890. // 返回:void
  4891. // 注意:#
  4892. void CMainFrame::PrintDinDan(CString strOrderNumber)//打印订单报表;
  4893. {
  4894. // TODO: Add your control notification handler code here
  4895. int printcot=1;
  4896. for(int aa=0; aa<printcot; aa++)
  4897. {
  4898. PrintPreview dlg;
  4899. CPrintRX m_Print;
  4900. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  4901. {
  4902. m_Print.InitToPrint(NULL, 1);
  4903. }
  4904. else
  4905. {
  4906. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  4907. if(name.IsEmpty ())
  4908. m_Print.InitToPrint(NULL, 1);
  4909. else
  4910. {
  4911. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  4912. if(nret==-1 && aa==0)
  4913. {
  4914. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  4915. }
  4916. }
  4917. }
  4918. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==0)
  4919. {
  4920. #ifdef ZHIAI_VERSION
  4921. PrintDinDan3(strOrderNumber);
  4922. return;
  4923. #endif
  4924. #ifdef SZBLCT_VERSION
  4925. PrintDinDan4(strOrderNumber);
  4926. return;
  4927. #endif
  4928. m_Print.StartPrint();
  4929. m_Print.StartPage();
  4930. LoadRect load;
  4931. load.SetLiaPath ("6.lia");
  4932. load.SetMargins(-14,15);
  4933. if(!load.Load ())return;
  4934. LoadRect load2;
  4935. load2.SetLiaPath ("7.lia");
  4936. load2.SetMargins(-14,216+15);
  4937. if(!load2.Load ())return;
  4938. LoadRect load3;
  4939. load3.SetLiaPath ("8.lia");
  4940. load3.SetMargins(-14,705+15);
  4941. if(!load3.Load ())return;
  4942. int i;
  4943. //////////////////////////////////////////////////////////////
  4944. CStringArray txarray;
  4945. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"';;";
  4946. g_sendhead.code[0]=11;
  4947. g_sendhead.code[1]=52;
  4948. g_sendhead.code[2]=50;
  4949. g_sendhead.code[3]=150;
  4950. g_sendhead.code[4]=77;
  4951. g_sendhead.code[5]=4;
  4952. g_sendhead.tabcount=6;
  4953. g_sendhead.bsql=0;
  4954. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  4955. CArray<CStringArray, CStringArray>sparray;
  4956. CArray<CStringArray, CStringArray>clientarray;
  4957. CArray<CStringArray, CStringArray>phonearray;
  4958. CArray<CStringArray, CStringArray>fgarray;
  4959. CArray<CStringArray, CStringArray>danweiarray;
  4960. CArray<CStringArray, CStringArray>jdarray;
  4961. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  4962. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  4963. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  4964. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  4965. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  4966. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  4967. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  4968. CString m_taoxiname;
  4969. if(m_zs.Find ("\\")!=-1)
  4970. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底\\入册:"+g_List1array.ElementAt (0).ElementAt (9);
  4971. else
  4972. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底:"+g_List1array.ElementAt (0).ElementAt (9);
  4973. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  4974. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  4975. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  4976. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  4977. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  4978. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  4979. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  4980. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  4981. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  4982. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  4983. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  4984. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  4985. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  4986. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  4987. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  4988. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  4989. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  4990. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  4991. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  4992. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  4993. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  4994. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  4995. if(jdarray.GetSize ())
  4996. {
  4997. if(m_bz.IsEmpty ()==0)
  4998. m_bz="\r\n"+m_bz;
  4999. m_bz+="景点:";
  5000. }
  5001. #ifdef DDF_VERSION
  5002. m_bz+="219店:219路馨园小区对面\r\n";
  5003. m_bz+="金色店:万科金色家园小区东门南走20米荣光社区一楼\r\n";
  5004. m_bz+="万泰店:万泰锦绣华城小区正门\r\n";
  5005. #else
  5006. for( i=0; i<jdarray.GetSize (); i++)
  5007. {
  5008. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5009. }
  5010. m_bz.TrimRight (";");
  5011. #endif
  5012. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5013. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5014. if(IsHasRights2new(31)==0)
  5015. {
  5016. m_phone1="***";
  5017. m_phone2="***";
  5018. }
  5019. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5020. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5021. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  5022. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  5023. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  5024. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  5025. filter="name='"+m_ren+"'";
  5026. g_sendhead.code[0]=5;
  5027. g_sendhead.tabcount=1;
  5028. g_sendhead.bsql=0;
  5029. int g_nYearposTemp=g_nYearpos;
  5030. g_nYearpos=-1;
  5031. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5032. g_nYearpos=g_nYearposTemp;
  5033. if(g_bSendOK==0)return;
  5034. DataToArray(&phonearray);
  5035. m_money1.Format ("%f", atof(m_taoxijiage));
  5036. m_money2.Format ("%f", atof(m_payed1));
  5037. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5038. ConvertToPrice(m_money1);
  5039. ConvertToPrice(m_money2);
  5040. ConvertToPrice(m_money3);
  5041. ////////////////////////////////////////////////////////////////
  5042. int rcpos=-1;
  5043. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  5044. StrRect.top -=15;StrRect.bottom -=15;
  5045. Image *pImg=NULL;
  5046. #ifdef MNLS_VERSION
  5047. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  5048. #else
  5049. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  5050. #endif
  5051. m_Print.DrawImage(pImg, StrRect);
  5052. delete pImg;
  5053. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5054. {
  5055. Image *pImg=NULL;
  5056. g_nSendCode=31;
  5057. int g_nYearposTemp=g_nYearpos;
  5058. g_nYearpos=-1;
  5059. g_pMainWnd->ProcessChatMessageRequest2(1);
  5060. g_nYearpos=g_nYearposTemp;
  5061. g_nSendCode=0;
  5062. if(g_bSendOK==0)return;
  5063. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  5064. if(pImg)
  5065. {
  5066. StrRect.left=30;
  5067. StrRect.top=12;
  5068. StrRect.right=StrRect.left+60;
  5069. StrRect.bottom=StrRect.top+60;
  5070. m_Print.DrawImage(pImg, StrRect);
  5071. delete pImg;pImg=NULL;
  5072. }
  5073. }
  5074. m_Print.SetFontFace(11, 1, "宋体");
  5075. StrRect=load.m_rcarray .ElementAt (20);
  5076. StrRect.right=load.m_rcarray .ElementAt (23).right;
  5077. StrRect.top -=18;StrRect.bottom -=18;
  5078. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  5079. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5080. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  5081. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5082. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5083. StrRect.top -=15;StrRect.bottom -=15;
  5084. #ifdef MNLS_VERSION
  5085. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5086. #endif
  5087. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5088. StrRect.top -=15;StrRect.bottom -=15;
  5089. #ifdef MNLS_VERSION
  5090. m_Print.DrawRect(StrRect);
  5091. #endif
  5092. m_Print.SetFontFace(7, 1, "黑体");
  5093. m_Print.SetColor(0xffffff);
  5094. #ifdef MNLS_VERSION
  5095. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5096. #endif
  5097. m_Print.SetColor(0);
  5098. m_Print.SetFontFace(15, 1, "宋体");
  5099. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5100. StrRect.top -=15;StrRect.bottom -=15;
  5101. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5102. CStringArray strarray;
  5103. strarray.Add("NO: "+strOrderNumber);
  5104. CString date;
  5105. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  5106. strarray.Add(date);
  5107. strarray.Add("喜爱");
  5108. strarray.Add("格调");
  5109. if(fgarray.GetSize ()==12)
  5110. {
  5111. for(int i=0; i<12; i++)
  5112. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  5113. }
  5114. else
  5115. {
  5116. strarray.Add("复古典雅");
  5117. strarray.Add("温文尔雅");
  5118. strarray.Add("豪华艳丽");
  5119. strarray.Add("传统大方");
  5120. strarray.Add("新潮个性");
  5121. strarray.Add("浪漫奔放");
  5122. strarray.Add("简单素雅");
  5123. strarray.Add("活泼俏丽");
  5124. strarray.Add("妩媚温馨");
  5125. strarray.Add("温柔贤惠");
  5126. strarray.Add("成熟感性");
  5127. strarray.Add("清纯可爱");
  5128. }
  5129. strarray.Add("姓名");
  5130. // strarray.Add("职业");
  5131. strarray.Add("");
  5132. strarray.Add("地址");
  5133. strarray.Add("电话");
  5134. #ifdef CHILD_VERSION
  5135. strarray.Add("家长");
  5136. strarray.Add("宝宝");
  5137. #else
  5138. strarray.Add("先生");
  5139. strarray.Add("女士");
  5140. #endif
  5141. m_Print.SetFontFace(11, 1, "宋体");
  5142. for( i=0; i<strarray.GetSize (); i++)
  5143. {
  5144. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5145. if(i<2)
  5146. {
  5147. StrRect.top -=15;StrRect.bottom -=15;
  5148. }
  5149. if(i>15)
  5150. m_Print.DrawRect2(StrRect, 1);
  5151. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5152. }
  5153. for( i=29; i<=40; i++)
  5154. {
  5155. if(m_style.GetLength ()<=(i-29))continue;
  5156. if(m_style.GetAt (i-29)!='1')continue;
  5157. StrRect=load.m_rcarray .ElementAt (i-1);
  5158. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5159. }
  5160. for( i=27; i<=48; i++)
  5161. {
  5162. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5163. m_Print.DrawRect2(StrRect, 1);
  5164. }
  5165. #ifdef CHILD_VERSION
  5166. StrRect=load.m_rcarray .ElementAt (45);
  5167. StrRect.right =StrRect.left +62;
  5168. m_Print.DrawRect2(StrRect, 1);
  5169. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5170. StrRect.left =StrRect.right ;
  5171. StrRect.right =StrRect.left +62;
  5172. m_Print.DrawRect2(StrRect, 1);
  5173. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5174. StrRect.left =StrRect.right ;
  5175. StrRect.right =StrRect.left +62;
  5176. m_Print.DrawRect2(StrRect, 1);
  5177. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5178. StrRect.left =StrRect.right ;
  5179. StrRect.right =StrRect.left +62;
  5180. m_Print.DrawRect2(StrRect, 1);
  5181. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5182. #endif
  5183. /////////////////////////
  5184. strarray.RemoveAll ();
  5185. CString temp;
  5186. temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  5187. strarray.Add (temp);
  5188. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  5189. strarray.Add (temp);
  5190. strarray.Add ("化妆");
  5191. strarray.Add ("造型");
  5192. #ifdef CHILD_VERSION
  5193. strarray.Add ("");
  5194. #else
  5195. strarray.Add ("婚纱");
  5196. #endif
  5197. strarray.Add ("服饰");
  5198. strarray.Add ("配");
  5199. strarray.Add ("置");
  5200. strarray.Add ("其");
  5201. strarray.Add ("它");
  5202. strarray.Add ("套系名称");
  5203. strarray.Add ("镜款");
  5204. strarray.Add ("套系总价");
  5205. strarray.Add ("主摄影师");
  5206. strarray.Add ("拍摄日期");
  5207. strarray.Add ("预约金");
  5208. #ifdef CHILD_VERSION
  5209. strarray.Add ("主引导师");
  5210. #else
  5211. strarray.Add ("主化妆师");
  5212. #endif
  5213. strarray.Add ("看样日期");
  5214. strarray.Add ("欠款余额");
  5215. strarray.Add ("总监");
  5216. strarray.Add ("取件日期");
  5217. rcpos=-1;
  5218. for( i=0; i<strarray.GetSize (); i++)
  5219. {
  5220. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  5221. if(i>9)
  5222. m_Print.DrawRect2(StrRect, 1);
  5223. #ifdef CHILD_VERSION
  5224. if(i==5)
  5225. StrRect.top -=StrRect.Height ();
  5226. #endif
  5227. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5228. }
  5229. for( i=22; i<=41; i++)
  5230. {
  5231. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  5232. m_Print.DrawRect2(StrRect, 1);
  5233. }
  5234. /////////////////////////////
  5235. strarray.RemoveAll ();
  5236. #ifdef CHILD_VERSION
  5237. strarray.Add ("顾客方 家长:");
  5238. strarray.Add ("宝宝:");
  5239. #else
  5240. strarray.Add ("顾客方 先生:");
  5241. strarray.Add ("女士:");
  5242. #endif
  5243. strarray.Add ("电话:");
  5244. strarray.Add ("影楼方 店长:");
  5245. strarray.Add ("接单人:");
  5246. strarray.Add ("电话:");
  5247. rcpos=-1;
  5248. for( i=0; i<strarray.GetSize (); i++)
  5249. {
  5250. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  5251. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5252. }
  5253. for( i=7; i<=12; i++)
  5254. {
  5255. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  5256. // if(i!=10)
  5257. m_Print.DrawRect2(StrRect, 2);
  5258. }
  5259. //////////////////////////////////////
  5260. //开始打数据
  5261. strarray.RemoveAll ();
  5262. strarray.Add (m_name1);
  5263. strarray.Add (m_name2);
  5264. /// strarray.Add (m_occupation1);
  5265. // strarray.Add (m_occupation2);
  5266. strarray.Add ("");
  5267. strarray.Add ("");
  5268. strarray.Add (m_addr1);
  5269. #ifdef CHILD_VERSION
  5270. strarray.Add ("");
  5271. #else
  5272. strarray.Add (m_addr2);
  5273. #endif
  5274. strarray.Add (m_phone1);
  5275. strarray.Add (m_phone2);
  5276. for( i=41; i<=48; i++)
  5277. {
  5278. StrRect=load.m_rcarray .ElementAt (i-1);
  5279. StrRect.left +=4;
  5280. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5281. }
  5282. ///////////////////////////////
  5283. strarray.RemoveAll ();
  5284. strarray.Add (m_money1);
  5285. strarray.Add (m_waiter1);
  5286. strarray.Add (m_time2);
  5287. strarray.Add (m_money2);
  5288. strarray.Add (m_waiter2);
  5289. strarray.Add (m_time4);
  5290. strarray.Add (m_money3);
  5291. strarray.Add ("");
  5292. strarray.Add (m_time5);
  5293. for( i=32; i<=40; i++)
  5294. {
  5295. StrRect=load2.m_rcarray .ElementAt (i-1);
  5296. StrRect.left +=4;
  5297. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5298. }
  5299. ///////////////////////////////
  5300. strarray.RemoveAll ();
  5301. strarray.Add (m_name1);
  5302. strarray.Add (m_name2);
  5303. CString phone;
  5304. if(m_phone1.IsEmpty ()==0)
  5305. phone=m_phone1+",";
  5306. phone+=m_phone2;
  5307. phone.TrimRight (",");
  5308. strarray.Add (phone);
  5309. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  5310. strarray.Add (m_ren);
  5311. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  5312. for( i=7; i<=12; i++)
  5313. {
  5314. StrRect=load3.m_rcarray .ElementAt (i-1);
  5315. StrRect.left +=4;
  5316. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5317. }
  5318. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  5319. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5320. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  5321. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5322. StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  5323. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5324. //////////////////////////////
  5325. //开始画文字
  5326. StrRect=load2.m_rcarray .ElementAt (30);
  5327. StrRect.left +=3;
  5328. StrRect.top +=3;
  5329. StrRect.right -=2;
  5330. StrRect.bottom -=2;
  5331. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5332. StrRect=load2.m_rcarray .ElementAt (29);
  5333. StrRect.left +=3;
  5334. StrRect.top +=3;
  5335. StrRect.right -=2;
  5336. StrRect.bottom -=2;
  5337. str="";
  5338. for(i=0; i<sparray.GetSize (); i++)
  5339. {
  5340. str+=sparray.ElementAt (i).ElementAt (5);
  5341. str+=" 数量:";
  5342. str+=sparray.ElementAt (i).ElementAt (3);
  5343. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  5344. str+="\r\n";
  5345. }
  5346. str.TrimRight ("\r\n");
  5347. AutoDraw(m_Print, StrRect, str, 1.4);
  5348. StrRect=load2.m_rcarray .ElementAt (40);
  5349. StrRect.top +=8;
  5350. m_Print.SetFontFace(12, 1, "黑体");
  5351. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5352. StrRect.left +=3;
  5353. StrRect.top +=30;
  5354. StrRect.right -=2;
  5355. StrRect.bottom -=2;
  5356. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  5357. if(str.IsEmpty ())
  5358. {
  5359. str="\
  5360. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5361. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5362. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5363. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5364. 持良好的心境.\r\n\
  5365. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5366. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5367. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5368. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5369. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5370. 勿进影室, 以免影响拍摄.\r\n\
  5371. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5372. 师或店长沟通.\r\n\
  5373. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5374. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5375. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5376. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5377. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5378. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5379. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5380. 还.";
  5381. }
  5382. AutoDraw(m_Print, StrRect, str, 1.8);
  5383. }
  5384. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==1)
  5385. {//AfxMessageBox("yyy");
  5386. m_Print.StartPrint();
  5387. m_Print.StartPage();
  5388. LoadRect load;
  5389. load.SetLiaPath ("6-2.lia");
  5390. load.SetMargins(0,0);
  5391. if(!load.Load ())return;
  5392. int i;
  5393. //////////////////////////////////////////////////////////////
  5394. CStringArray txarray;
  5395. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"';;";
  5396. g_sendhead.code[0]=11;
  5397. g_sendhead.code[1]=52;
  5398. g_sendhead.code[2]=50;
  5399. g_sendhead.code[3]=150;
  5400. g_sendhead.code[4]=77;
  5401. g_sendhead.code[5]=4;
  5402. g_sendhead.tabcount=6;
  5403. g_sendhead.bsql=0;
  5404. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  5405. CArray<CStringArray, CStringArray>sparray;
  5406. CArray<CStringArray, CStringArray>clientarray;
  5407. CArray<CStringArray, CStringArray>phonearray;
  5408. CArray<CStringArray, CStringArray>fgarray;
  5409. CArray<CStringArray, CStringArray>danweiarray;
  5410. CArray<CStringArray, CStringArray>jdarray;
  5411. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5412. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  5413. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  5414. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  5415. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  5416. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  5417. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  5418. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  5419. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  5420. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  5421. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  5422. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  5423. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  5424. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  5425. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  5426. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  5427. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  5428. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  5429. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  5430. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  5431. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  5432. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  5433. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  5434. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  5435. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  5436. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  5437. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  5438. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  5439. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  5440. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  5441. if(jdarray.GetSize ())
  5442. {
  5443. if(m_bz.IsEmpty ()==0)
  5444. m_bz="\r\n"+m_bz;
  5445. m_bz+="景点:";
  5446. }
  5447. for( i=0; i<jdarray.GetSize (); i++)
  5448. {
  5449. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5450. }
  5451. m_bz.TrimRight (";");
  5452. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5453. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5454. if(IsHasRights2new(31)==0)
  5455. {
  5456. m_phone1="***";
  5457. m_phone2="***";
  5458. }
  5459. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5460. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5461. CString m_birthday1 = clientarray.ElementAt (0).ElementAt (11);
  5462. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  5463. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  5464. CString str;
  5465. filter="name='"+m_ren+"'";
  5466. g_sendhead.code[0]=5;
  5467. g_sendhead.tabcount=1;
  5468. g_sendhead.bsql=0;
  5469. int g_nYearposTemp=g_nYearpos;
  5470. g_nYearpos=-1;
  5471. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5472. g_nYearpos=g_nYearposTemp;
  5473. if(g_bSendOK==0)return;
  5474. DataToArray(&phonearray);
  5475. m_money1.Format ("%f", atof(m_taoxijiage));
  5476. m_money2.Format ("%f", atof(m_payed1));
  5477. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5478. ConvertToPrice(m_money1);
  5479. ConvertToPrice(m_money2);
  5480. ConvertToPrice(m_money3);
  5481. ////////////////////////////////////////////////////////////////
  5482. int rcpos=-1;
  5483. CRect StrRect=load.m_rcarray.ElementAt (0);
  5484. m_Print.SetFontFace(25, 1, "黑体");
  5485. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"预约单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5486. m_Print.SetFontFace(11, 1, "宋体");
  5487. StrRect=load.m_rcarray .ElementAt (1);
  5488. if(m_time1.GetLength ()==10)
  5489. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2));
  5490. else
  5491. str="开单日期:";
  5492. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5493. StrRect=load.m_rcarray .ElementAt (2);
  5494. m_Print.DrawText((LPTSTR)(LPCTSTR)("No."+strOrderNumber), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5495. CStringArray strarray;
  5496. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5497. {
  5498. Image *pImg=NULL;
  5499. g_nSendCode=31;
  5500. int g_nYearposTemp=g_nYearpos;
  5501. g_nYearpos=-1;
  5502. g_pMainWnd->ProcessChatMessageRequest2(1);
  5503. g_nYearpos=g_nYearposTemp;
  5504. g_nSendCode=0;
  5505. if(g_bSendOK==0)return;
  5506. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  5507. if(pImg)
  5508. {
  5509. StrRect.left=47;
  5510. StrRect.top=12;
  5511. StrRect.right=StrRect.left+60;
  5512. StrRect.bottom=StrRect.top+60;
  5513. m_Print.DrawImage(pImg, StrRect);
  5514. delete pImg;pImg=NULL;
  5515. }
  5516. }
  5517. #ifdef CHILD_VERSION
  5518. strarray.Add("家长姓名");
  5519. strarray.Add("宝宝姓名");
  5520. #else
  5521. strarray.Add("先生姓名");
  5522. strarray.Add("女士姓名");
  5523. #endif
  5524. strarray.Add ("服装套数");
  5525. // strarray.Add ("拍摄张数");
  5526. #ifdef CHILD_VERSION
  5527. strarray.Add("出生日期");
  5528. #else
  5529. strarray.Add("结婚日期");
  5530. #endif
  5531. strarray.Add ("拍摄日期");
  5532. strarray.Add ("联系电话");
  5533. strarray.Add ("联系电话");
  5534. strarray.Add ("造型套数");
  5535. if(m_zs.Find ("\\")!=-1)
  5536. strarray.Add ("入底\\入册");
  5537. else
  5538. strarray.Add ("入底张数");
  5539. strarray.Add ("选片日期");
  5540. strarray.Add ("QQ/邮箱");
  5541. strarray.Add ("套系总额");
  5542. strarray.Add ("预约金");
  5543. strarray.Add ("余款金额");
  5544. strarray.Add ("取件日期");
  5545. strarray.Add (m_name1);
  5546. strarray.Add (m_name2);
  5547. strarray.Add (m_clothescount);
  5548. // str.Format("%d", atoi(m_zs)*3);
  5549. // strarray.Add (str);
  5550. #ifdef CHILD_VERSION
  5551. strarray.Add(m_birthday1);
  5552. #else
  5553. strarray.Add(m_time3);
  5554. #endif
  5555. strarray.Add (m_time2);
  5556. strarray.Add (m_phone1);
  5557. strarray.Add (m_phone2);
  5558. strarray.Add (m_clothescount2);
  5559. strarray.Add (m_zs);
  5560. strarray.Add (m_time4);
  5561. strarray.Add (m_qq1);
  5562. strarray.Add (m_money1);
  5563. strarray.Add (m_money2);
  5564. strarray.Add (m_money3);
  5565. strarray.Add (m_time5);
  5566. for( i=4; i<=33; i++)
  5567. {
  5568. StrRect=load.m_rcarray .ElementAt (i-1);
  5569. m_Print.DrawRect2(StrRect, 1);
  5570. if(strarray.GetSize ()>(i-4))
  5571. {
  5572. if(i<=18)
  5573. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5574. else
  5575. {
  5576. StrRect.left +=4;
  5577. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5578. }
  5579. }
  5580. }
  5581. int dt=413;
  5582. StrRect=load.m_rcarray .ElementAt (36);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5583. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5584. StrRect=load.m_rcarray .ElementAt (37);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5585. StrRect=load.m_rcarray .ElementAt (38);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5586. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5587. StrRect=load.m_rcarray .ElementAt (39);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5588. StrRect=load.m_rcarray .ElementAt (40);StrRect.top +=dt;StrRect.bottom +=dt;
  5589. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5590. StrRect=load.m_rcarray .ElementAt (41);StrRect.top +=dt;StrRect.bottom +=dt;
  5591. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5592. StrRect=load.m_rcarray .ElementAt (42);StrRect.top +=dt;StrRect.bottom +=dt;
  5593. m_Print.DrawText((LPTSTR)(LPCTSTR)("网址:"+g_cominfoarray.ElementAt (0).ElementAt (13)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5594. //////////////////////////////
  5595. //开始画文字
  5596. StrRect=load.m_rcarray .ElementAt (7);
  5597. int hei=StrRect.Height ();
  5598. StrRect.top+=hei ;
  5599. StrRect.bottom+=hei ;
  5600. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5601. StrRect.top+=dt ;
  5602. StrRect.bottom+=dt ;
  5603. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5604. StrRect=load.m_rcarray .ElementAt (17);
  5605. StrRect.top+=hei ;
  5606. StrRect.bottom+=hei ;
  5607. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5608. StrRect=load.m_rcarray .ElementAt (33);
  5609. StrRect.bottom =StrRect.top +dt ; m_Print.DrawRect2(StrRect, 1);
  5610. StrRect.top+=hei;
  5611. StrRect.left +=3;
  5612. StrRect.top +=3;
  5613. StrRect.right -=2;
  5614. StrRect.bottom -=2;
  5615. str="";
  5616. for(i=0; i<sparray.GetSize (); i++)
  5617. {
  5618. str+=sparray.ElementAt (i).ElementAt (5);
  5619. str+=" 数量:";
  5620. str+=sparray.ElementAt (i).ElementAt (3);
  5621. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  5622. str+="\r\n";
  5623. }
  5624. str.TrimRight ("\r\n");
  5625. AutoDraw(m_Print, StrRect, str, 1.4);
  5626. StrRect=load.m_rcarray .ElementAt (33);
  5627. StrRect.top +=dt ;
  5628. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  5629. StrRect.top+=hei;
  5630. StrRect.left +=3;
  5631. StrRect.top +=3;
  5632. StrRect.right -=2;
  5633. StrRect.bottom -=2;
  5634. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5635. StrRect=load.m_rcarray .ElementAt (34);
  5636. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  5637. StrRect.top+=hei;
  5638. StrRect.left +=3;
  5639. StrRect.top +=3;
  5640. StrRect.right -=2;
  5641. StrRect.bottom -=2;
  5642. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  5643. if(str.IsEmpty ())
  5644. {
  5645. str="\
  5646. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5647. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5648. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5649. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5650. 持良好的心境.\r\n\
  5651. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5652. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5653. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5654. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5655. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5656. 勿进影室, 以免影响拍摄.\r\n\
  5657. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5658. 师或店长沟通.\r\n\
  5659. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5660. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5661. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5662. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5663. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5664. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5665. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5666. 还.";
  5667. }
  5668. AutoDraw(m_Print, StrRect, str, 1.8);
  5669. StrRect=load.m_rcarray .ElementAt (35);
  5670. StrRect.bottom +=100;
  5671. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  5672. str="第\r\n一\r\n联\r\n存\r\n根\r\n∧\r\n白\r\n∨\r\n第\r\n二\r\n联\r\n客\r\n户\r\n∧\r\n红\r\n∨\r\n第\r\n三\r\n联\r\n流\r\n程\r\n∧\r\n黄\r\n∨";
  5673. // AutoDraw(m_Print, StrRect, str, 1.4);
  5674. }
  5675. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==2)
  5676. {
  5677. PrintDinDan5(strOrderNumber);
  5678. return;
  5679. }
  5680. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==3)
  5681. {
  5682. PrintDinDan6(strOrderNumber);
  5683. return;
  5684. }
  5685. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  5686. dlg.m_pDC =m_Print.GetPDC() ;
  5687. dlg.m_mode=1;
  5688. if(aa==0)
  5689. {
  5690. if(dlg.DoModal ()!=IDOK)
  5691. return;
  5692. printcot=dlg.m_num;
  5693. }
  5694. //结束打印
  5695. m_Print.EndPage();
  5696. m_Print.EndPrint();
  5697. }
  5698. }
  5699. void CovertDate2(CString date, CString &date2)
  5700. {
  5701. try
  5702. {
  5703. if(date=="2013-04-09")
  5704. {
  5705. date2="2013-02-29";
  5706. return;
  5707. }
  5708. ///////////////////////////////////
  5709. date2=date;
  5710. GongToLong(date2);
  5711. ////////////////////////////////////
  5712. return;
  5713. CCalendarConvert m_CalendarConvert;
  5714. SYSTEMTIME src = {0};
  5715. SYSTEMTIME dst = {0};
  5716. COleDateTime m_timeLunar(atoi(date.Mid (0,4)),atoi(date.Mid (5,2)),atoi(date.Mid (8,2)),0,0,0);
  5717. COleDateTime m_timeGregorian;
  5718. m_timeLunar.GetAsSystemTime ( src );
  5719. BOOL bEmbolism = 0;
  5720. if ( m_CalendarConvert.Gregorian2Lunar ( &src, &dst , &bEmbolism) )
  5721. {
  5722. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
  5723. date2.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
  5724. if(m_timeGregorian.GetYear ()==-1)date2="2000-13-32";
  5725. }
  5726. else
  5727. {
  5728. date2.Empty ();
  5729. }
  5730. }
  5731. catch(...)
  5732. {
  5733. }
  5734. }
  5735. void CMainFrame::PrintDinDan5(CString m_id)
  5736. {
  5737. int printcot=1;
  5738. for(int aa=0; aa<printcot; aa++)
  5739. {
  5740. PrintPreview dlg;
  5741. CPrintRX m_Print;
  5742. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  5743. {
  5744. m_Print.InitToPrint(NULL, 1);
  5745. }
  5746. else
  5747. {
  5748. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  5749. if(name.IsEmpty ())
  5750. m_Print.InitToPrint(NULL, 1);
  5751. else
  5752. {
  5753. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  5754. if(nret==-1 && aa==0)
  5755. {
  5756. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  5757. }
  5758. }
  5759. }
  5760. {
  5761. m_Print.StartPrint();
  5762. m_Print.StartPage();
  5763. LoadRect load;
  5764. load.SetLiaPath ("19.lia");
  5765. load.SetMargins(0,-20);
  5766. if(!load.Load ())return;
  5767. int i;
  5768. //////////////////////////////////////////////////////////////
  5769. CStringArray txarray;
  5770. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  5771. g_sendhead.code[0]=11;
  5772. g_sendhead.code[1]=52;
  5773. g_sendhead.code[2]=50;
  5774. g_sendhead.code[3]=150;
  5775. g_sendhead.code[4]=77;
  5776. g_sendhead.code[5]=4;
  5777. g_sendhead.tabcount=6;
  5778. g_sendhead.bsql=0;
  5779. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  5780. CArray<CStringArray, CStringArray>sparray;
  5781. CArray<CStringArray, CStringArray>clientarray;
  5782. CArray<CStringArray, CStringArray>phonearray;
  5783. CArray<CStringArray, CStringArray>fgarray;
  5784. CArray<CStringArray, CStringArray>danweiarray;
  5785. CArray<CStringArray, CStringArray>jdarray;
  5786. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5787. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  5788. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  5789. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  5790. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  5791. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  5792. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  5793. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  5794. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  5795. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  5796. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  5797. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  5798. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  5799. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  5800. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  5801. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  5802. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  5803. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  5804. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  5805. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  5806. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  5807. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  5808. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  5809. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  5810. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  5811. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  5812. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  5813. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  5814. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (36);
  5815. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  5816. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  5817. CString m_txtype = g_List1array.ElementAt (0).ElementAt (52);
  5818. CString m_memberno = g_List1array.ElementAt (0).ElementAt (47);
  5819. CString str;
  5820. if(jdarray.GetSize ())
  5821. {
  5822. if(m_bz.IsEmpty ()==0)
  5823. m_bz="\r\n"+m_bz;
  5824. m_bz+="景点:";
  5825. }
  5826. for( i=0; i<jdarray.GetSize (); i++)
  5827. {
  5828. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5829. }
  5830. m_bz.TrimRight (";");
  5831. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5832. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5833. if(IsHasRights2new(31)==0)
  5834. {
  5835. m_phone1="***";
  5836. m_phone2="***";
  5837. }
  5838. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5839. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5840. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  5841. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  5842. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  5843. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  5844. BOOL check1=atoi(clientarray.ElementAt (0).ElementAt (15));
  5845. filter="name='"+m_ren+"'";
  5846. g_sendhead.code[0]=5;
  5847. g_sendhead.tabcount=1;
  5848. g_sendhead.bsql=0;
  5849. int g_nYearposTemp=g_nYearpos;
  5850. g_nYearpos=-1;
  5851. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5852. g_nYearpos=g_nYearposTemp;
  5853. if(g_bSendOK==0)return;
  5854. DataToArray(&phonearray);
  5855. m_money1.Format ("%f", atof(m_taoxijiage));
  5856. m_money2.Format ("%f", atof(m_payed1));
  5857. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5858. ConvertToPrice(m_money1);
  5859. ConvertToPrice(m_money2);
  5860. ConvertToPrice(m_money3);
  5861. ////////////////////////////////////////////////////////////////
  5862. int rcpos=-1;
  5863. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  5864. //Image *pImg=NULL;
  5865. // ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  5866. // m_Print.DrawImage(pImg, StrRect);
  5867. // delete pImg;
  5868. m_Print.SetFontFace(20, 1, "宋体");
  5869. StrRect=load.m_rcarray .ElementAt (1);
  5870. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"定单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5871. m_Print.SetFontFace(12, 1, "宋体");
  5872. StrRect=load.m_rcarray .ElementAt (2);
  5873. m_Print.DrawText((LPTSTR)(LPCTSTR)("NO."+m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5874. StrRect=load.m_rcarray .ElementAt (3);
  5875. str.Format ("%s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2) );
  5876. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5877. StrRect=load.m_rcarray .ElementAt (4);
  5878. m_Print.DrawText((LPTSTR)(LPCTSTR)("联系人:"+m_name1), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5879. CStringArray strarray;
  5880. strarray.Add("姓名");
  5881. strarray.Add("性别");
  5882. strarray.Add("年龄");
  5883. strarray.Add("出生年月");
  5884. strarray.Add("套系价格");
  5885. strarray.Add("预约金");
  5886. strarray.Add("欠款");
  5887. strarray.Add("拍摄类型");
  5888. strarray.Add("会员卡号");
  5889. strarray.Add("定单人");
  5890. strarray.Add("入底\\入册");
  5891. strarray.Add("联系电话");
  5892. for( i=6; i<=17; i++)
  5893. {
  5894. StrRect=load.m_rcarray .ElementAt (i-1);
  5895. m_Print.DrawRect2(StrRect, 1);
  5896. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-6), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5897. }
  5898. strarray.RemoveAll ();
  5899. strarray.Add(m_name2);
  5900. strarray.Add(m_sex);
  5901. if(m_birthday.GetLength ()!=10)
  5902. strarray.Add("");
  5903. else
  5904. {
  5905. int year=0;
  5906. if(check1)
  5907. {
  5908. CString date2;
  5909. CovertDate2(g_date, date2);
  5910. year=atoi(date2.Left (4))-atoi(m_birthday.Left (4));
  5911. if(date2.Right(5)>=m_birthday.Right(5))
  5912. year++;
  5913. }
  5914. else
  5915. {
  5916. year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  5917. if(g_date.Right(5)>=m_birthday.Right(5))
  5918. year++;
  5919. }
  5920. str.Format ("%d", year);
  5921. strarray.Add(str);
  5922. }
  5923. strarray.Add(m_birthday);
  5924. strarray.Add(m_money1);
  5925. strarray.Add(m_money2);
  5926. strarray.Add(m_money3);
  5927. strarray.Add(m_txtype);
  5928. strarray.Add(m_memberno);
  5929. strarray.Add(m_ren);
  5930. strarray.Add(m_zs);
  5931. if(!m_phone1.IsEmpty ())
  5932. strarray.Add(m_phone1);
  5933. else
  5934. strarray.Add(m_phone2);
  5935. for( i=18; i<=29; i++)
  5936. {
  5937. StrRect=load.m_rcarray .ElementAt (i-1);
  5938. m_Print.DrawRect2(StrRect, 1);
  5939. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5940. }
  5941. strarray.RemoveAll ();
  5942. strarray.Add("摄影师");
  5943. strarray.Add("拍照时间");
  5944. strarray.Add("选片人");
  5945. strarray.Add("选片时间");
  5946. strarray.Add("引导师");
  5947. strarray.Add("设计师");
  5948. strarray.Add("取件时间");
  5949. strarray.Add("顾客签字");
  5950. for( i=34; i<=41; i++)
  5951. {
  5952. StrRect=load.m_rcarray .ElementAt (i-1);
  5953. m_Print.DrawRect2(StrRect, 1);
  5954. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-34), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5955. }
  5956. strarray.RemoveAll ();
  5957. strarray.Add(m_waiter1);
  5958. strarray.Add(m_time2);
  5959. strarray.Add(m_waiter3);
  5960. strarray.Add(m_time4);
  5961. strarray.Add(m_waiter2);
  5962. strarray.Add(m_waiter4);
  5963. strarray.Add(m_time5);
  5964. strarray.Add("");
  5965. for( i=42; i<=49; i++)
  5966. {
  5967. StrRect=load.m_rcarray .ElementAt (i-1);
  5968. m_Print.DrawRect2(StrRect, 1);
  5969. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5970. }
  5971. m_Print.SetFontFace(15, 1, "宋体");
  5972. StrRect=load.m_rcarray .ElementAt (29);
  5973. m_Print.DrawRect2(StrRect, 1);
  5974. StrRect.top +=45;
  5975. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5976. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5977. m_Print.DrawText((LPTSTR)(LPCTSTR)"内", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5978. m_Print.DrawText((LPTSTR)(LPCTSTR)"容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5979. StrRect=load.m_rcarray .ElementAt (30);
  5980. m_Print.DrawRect2(StrRect, 1);
  5981. StrRect.top +=45;
  5982. m_Print.DrawText((LPTSTR)(LPCTSTR)"友", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5983. m_Print.DrawText((LPTSTR)(LPCTSTR)"情", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5984. m_Print.DrawText((LPTSTR)(LPCTSTR)"提", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5985. m_Print.DrawText((LPTSTR)(LPCTSTR)"示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5986. m_Print.SetFontFace(10, 1, "宋体");
  5987. StrRect=load.m_rcarray .ElementAt (37);StrRect.top =StrRect.bottom +2;
  5988. str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  5989. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  5990. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  5991. StrRect=load.m_rcarray .ElementAt (48);StrRect.top =StrRect.bottom +2;StrRect.left -=200;
  5992. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  5993. //开始画文字
  5994. StrRect=load.m_rcarray .ElementAt (31);
  5995. StrRect.left +=3;
  5996. StrRect.top +=3;
  5997. StrRect.right -=2;
  5998. StrRect.bottom -=2;
  5999. str="";
  6000. for(i=0; i<sparray.GetSize (); i++)
  6001. {
  6002. str+=sparray.ElementAt (i).ElementAt (5);
  6003. str+=" 数量:";
  6004. str+=sparray.ElementAt (i).ElementAt (3);
  6005. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  6006. str+="\r\n";
  6007. }
  6008. str.TrimRight ("\r\n");
  6009. m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6010. m_bz.TrimLeft();
  6011. if(m_bz!="")
  6012. { str+="\r\n";str+="\r\n";
  6013. str+="备注:"+m_bz;
  6014. }
  6015. AutoDraw(m_Print, StrRect, str, 1.4);
  6016. StrRect=load.m_rcarray .ElementAt (32); m_Print.DrawRect2(StrRect, 1);
  6017. StrRect.left +=3;
  6018. StrRect.top +=3;
  6019. StrRect.right -=2;
  6020. StrRect.bottom -=2;
  6021. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6022. if(str.IsEmpty ())
  6023. {
  6024. str="\
  6025. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6026. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6027. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6028. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6029. 持良好的心境.\r\n\
  6030. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6031. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6032. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6033. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6034. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6035. 勿进影室, 以免影响拍摄.\r\n\
  6036. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6037. 师或店长沟通.\r\n\
  6038. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6039. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6040. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6041. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6042. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6043. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6044. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6045. 还.";
  6046. }
  6047. AutoDraw(m_Print, StrRect, str, 1.8);
  6048. }
  6049. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6050. dlg.m_pDC =m_Print.GetPDC() ;
  6051. dlg.m_mode=1;
  6052. if(aa==0)
  6053. {
  6054. if(dlg.DoModal ()!=IDOK)
  6055. return;
  6056. printcot=dlg.m_num;
  6057. }
  6058. //结束打印
  6059. m_Print.EndPage();
  6060. m_Print.EndPrint();
  6061. }
  6062. }
  6063. void CMainFrame::PrintDinDan4(CString m_id)
  6064. {
  6065. // TODO: Add your control notification handler code here
  6066. CPrintRX m_Print;
  6067. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6068. {
  6069. m_Print.InitToPrint(NULL, 1);
  6070. }
  6071. else
  6072. {
  6073. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  6074. if(name.IsEmpty ())
  6075. m_Print.InitToPrint(NULL, 1);
  6076. else
  6077. {
  6078. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6079. if(nret==-1)
  6080. {
  6081. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6082. }
  6083. }
  6084. }
  6085. m_Print.StartPrint();
  6086. m_Print.StartPage();
  6087. LoadRect load;
  6088. load.SetLiaPath ("6-2.lia");
  6089. load.SetMargins(0,0);
  6090. if(!load.Load ())return;
  6091. int i;
  6092. //////////////////////////////////////////////////////////////
  6093. CStringArray txarray;
  6094. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  6095. g_sendhead.code[0]=11;
  6096. g_sendhead.code[1]=52;
  6097. g_sendhead.code[2]=50;
  6098. g_sendhead.code[3]=150;
  6099. g_sendhead.code[4]=77;
  6100. g_sendhead.code[5]=4;
  6101. g_sendhead.tabcount=6;
  6102. g_sendhead.bsql=0;
  6103. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  6104. CArray<CStringArray, CStringArray>sparray;
  6105. CArray<CStringArray, CStringArray>clientarray;
  6106. CArray<CStringArray, CStringArray>phonearray;
  6107. CArray<CStringArray, CStringArray>fgarray;
  6108. CArray<CStringArray, CStringArray>danweiarray;
  6109. CArray<CStringArray, CStringArray>jdarray;
  6110. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  6111. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  6112. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  6113. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  6114. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  6115. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  6116. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  6117. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  6118. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  6119. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  6120. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  6121. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  6122. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  6123. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  6124. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  6125. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  6126. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  6127. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  6128. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  6129. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  6130. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  6131. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  6132. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  6133. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  6134. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  6135. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  6136. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  6137. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  6138. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  6139. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6140. if(jdarray.GetSize ())
  6141. {
  6142. if(m_bz.IsEmpty ()==0)
  6143. m_bz="\r\n"+m_bz;
  6144. m_bz+="景点:";
  6145. }
  6146. for( i=0; i<jdarray.GetSize (); i++)
  6147. {
  6148. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  6149. }
  6150. m_bz.TrimRight (";");
  6151. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  6152. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  6153. if(IsHasRights2new(31)==0)
  6154. {
  6155. m_phone1="***";
  6156. m_phone2="***";
  6157. }
  6158. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  6159. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  6160. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  6161. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  6162. CString str;
  6163. filter="name='"+m_ren+"'";
  6164. g_sendhead.code[0]=5;
  6165. g_sendhead.tabcount=1;
  6166. g_sendhead.bsql=0;
  6167. int g_nYearposTemp=g_nYearpos;
  6168. g_nYearpos=-1;
  6169. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6170. g_nYearpos=g_nYearposTemp;
  6171. if(g_bSendOK==0)return;
  6172. DataToArray(&phonearray);
  6173. m_money1.Format ("%f", atof(m_taoxijiage));
  6174. m_money2.Format ("%f", atof(m_payed1));
  6175. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  6176. ConvertToPrice(m_money1);
  6177. ConvertToPrice(m_money2);
  6178. ConvertToPrice(m_money3);
  6179. ////////////////////////////////////////////////////////////////
  6180. int rcpos=-1;
  6181. CRect StrRect=load.m_rcarray.ElementAt (0);
  6182. m_Print.SetFontFace(25, 1, "黑体");
  6183. m_Print.DrawText((LPTSTR)(LPCTSTR)"巴黎春天婚纱摄影预约单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6184. m_Print.SetFontFace(11, 1, "宋体");
  6185. StrRect=load.m_rcarray .ElementAt (1);
  6186. if(m_time1.GetLength ()==10)
  6187. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2));
  6188. else
  6189. str="开单日期:";
  6190. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6191. StrRect=load.m_rcarray .ElementAt (2);
  6192. m_Print.DrawText((LPTSTR)(LPCTSTR)("No."+m_id), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6193. CStringArray strarray;
  6194. strarray.Add ("先生姓名");
  6195. strarray.Add ("女士姓名");
  6196. strarray.Add ("服装套数");
  6197. strarray.Add ("拍摄张数");
  6198. strarray.Add ("拍摄日期");
  6199. strarray.Add ("联系电话");
  6200. strarray.Add ("联系电话");
  6201. strarray.Add ("造型套数");
  6202. strarray.Add ("入册张数");
  6203. strarray.Add ("选片日期");
  6204. strarray.Add ("QQ/邮箱");
  6205. strarray.Add ("套系总额");
  6206. strarray.Add ("预约金");
  6207. strarray.Add ("余款金额");
  6208. strarray.Add ("取件日期");
  6209. strarray.Add (m_name1);
  6210. strarray.Add (m_name2);
  6211. strarray.Add (m_clothescount);
  6212. str.Format("%d", atoi(m_zs)*3);
  6213. strarray.Add (str);
  6214. strarray.Add (m_time2);
  6215. strarray.Add (m_phone1);
  6216. strarray.Add (m_phone2);
  6217. strarray.Add (m_clothescount2);
  6218. strarray.Add (m_zs);
  6219. strarray.Add (m_time4);
  6220. strarray.Add (m_qq1);
  6221. strarray.Add (m_money1);
  6222. strarray.Add (m_money2);
  6223. strarray.Add (m_money3);
  6224. strarray.Add (m_time5);
  6225. for( i=4; i<=33; i++)
  6226. {
  6227. StrRect=load.m_rcarray .ElementAt (i-1);
  6228. m_Print.DrawRect2(StrRect, 1);
  6229. if(strarray.GetSize ()>(i-4))
  6230. {
  6231. if(i<=18)
  6232. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6233. else
  6234. {
  6235. StrRect.left +=4;
  6236. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6237. }
  6238. }
  6239. }
  6240. int dt=413;
  6241. StrRect=load.m_rcarray .ElementAt (36);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6242. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6243. StrRect=load.m_rcarray .ElementAt (37);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6244. StrRect=load.m_rcarray .ElementAt (38);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6245. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6246. StrRect=load.m_rcarray .ElementAt (39);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6247. StrRect=load.m_rcarray .ElementAt (40);StrRect.top +=dt;StrRect.bottom +=dt;
  6248. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址:深圳市红岭中路中深国际大厦首层,二十二层", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6249. StrRect=load.m_rcarray .ElementAt (41);StrRect.top +=dt;StrRect.bottom +=dt;
  6250. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:0755-61308198 61308199 25860696 25860697", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6251. StrRect=load.m_rcarray .ElementAt (42);StrRect.top +=dt;StrRect.bottom +=dt;
  6252. m_Print.DrawText((LPTSTR)(LPCTSTR)"网址:www.paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6253. StrRect=load.m_rcarray .ElementAt (43);StrRect.top +=dt;StrRect.bottom +=dt;
  6254. m_Print.DrawText((LPTSTR)(LPCTSTR)"邮箱:blct@paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6255. //////////////////////////////
  6256. //开始画文字
  6257. StrRect=load.m_rcarray .ElementAt (7);
  6258. int hei=StrRect.Height ();
  6259. StrRect.top+=hei ;
  6260. StrRect.bottom+=hei ;
  6261. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6262. StrRect.top+=dt ;
  6263. StrRect.bottom+=dt ;
  6264. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6265. StrRect=load.m_rcarray .ElementAt (17);
  6266. StrRect.top+=hei ;
  6267. StrRect.bottom+=hei ;
  6268. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6269. StrRect=load.m_rcarray .ElementAt (33);
  6270. StrRect.bottom =StrRect.top +dt ; m_Print.DrawRect2(StrRect, 1);
  6271. StrRect.top+=hei;
  6272. StrRect.left +=3;
  6273. StrRect.top +=3;
  6274. StrRect.right -=2;
  6275. StrRect.bottom -=2;
  6276. str="";
  6277. for(i=0; i<sparray.GetSize (); i++)
  6278. {
  6279. str+=sparray.ElementAt (i).ElementAt (5);
  6280. str+=" 数量:";
  6281. str+=sparray.ElementAt (i).ElementAt (3);
  6282. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  6283. str+="\r\n";
  6284. }
  6285. str.TrimRight ("\r\n");
  6286. AutoDraw(m_Print, StrRect, str, 1.4);
  6287. StrRect=load.m_rcarray .ElementAt (33);
  6288. StrRect.top +=dt ;
  6289. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  6290. StrRect.top+=hei;
  6291. StrRect.left +=3;
  6292. StrRect.top +=3;
  6293. StrRect.right -=2;
  6294. StrRect.bottom -=2;
  6295. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6296. StrRect=load.m_rcarray .ElementAt (34);
  6297. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  6298. StrRect.top+=hei;
  6299. StrRect.left +=3;
  6300. StrRect.top +=3;
  6301. StrRect.right -=2;
  6302. StrRect.bottom -=2;
  6303. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6304. if(str.IsEmpty ())
  6305. {
  6306. str="\
  6307. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6308. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6309. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6310. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6311. 持良好的心境.\r\n\
  6312. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6313. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6314. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6315. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6316. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6317. 勿进影室, 以免影响拍摄.\r\n\
  6318. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6319. 师或店长沟通.\r\n\
  6320. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6321. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6322. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6323. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6324. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6325. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6326. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6327. 还.";
  6328. }
  6329. AutoDraw(m_Print, StrRect, str, 1.8);
  6330. StrRect=load.m_rcarray .ElementAt (35);
  6331. StrRect.bottom +=100;
  6332. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  6333. str="第\r\n一\r\n联\r\n存\r\n根\r\n∧\r\n白\r\n∨\r\n第\r\n二\r\n联\r\n客\r\n户\r\n∧\r\n红\r\n∨\r\n第\r\n三\r\n联\r\n流\r\n程\r\n∧\r\n黄\r\n∨";
  6334. AutoDraw(m_Print, StrRect, str, 1.4);
  6335. PrintPreview dlg;
  6336. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6337. dlg.m_pDC =m_Print.GetPDC() ;
  6338. if(dlg.DoModal ()!=IDOK)return;
  6339. //结束打印
  6340. m_Print.EndPage();
  6341. m_Print.EndPrint();
  6342. }
  6343. int CalHeight(CArray<CRect,CRect>*rcarray, CStringArray *strarray2, CPrintRX *Print, int FORMAT)
  6344. {
  6345. CSize size;
  6346. CString str,temp;
  6347. CRect rc;
  6348. int maxhei=1;
  6349. int fonthei;
  6350. for(int i=0; i < rcarray->GetSize (); i++)
  6351. {
  6352. rc=rcarray->ElementAt (i);
  6353. maxhei=max(maxhei, rc.bottom );
  6354. str=strarray2->ElementAt (i);
  6355. temp.Empty ();
  6356. int hei=0;
  6357. while(str.IsEmpty()==0)
  6358. {
  6359. str=str.Right (str.GetLength ()-temp.GetLength ());
  6360. if(str.IsEmpty ())break;
  6361. Print->GetStrSize((LPTSTR)(LPCTSTR)str, size);
  6362. fonthei=size.cy+1;
  6363. if(size.cx<=rc.Width())
  6364. {
  6365. CRect rc2=rc;
  6366. rc2.top +=hei*fonthei;
  6367. rc2.bottom =rc2.top+fonthei;
  6368. Print->DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT | FORMAT_UP);
  6369. //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6370. maxhei=max(maxhei, rc2.bottom );
  6371. break;
  6372. }
  6373. int right=0;
  6374. while(size.cx>rc.Width ())
  6375. {
  6376. right++;
  6377. temp=str.Left (str.GetLength ()-(right));
  6378. if(GIsHalfHZ(temp))
  6379. {
  6380. right++;
  6381. temp.Delete (temp.GetLength ()-1);
  6382. }
  6383. Print->GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  6384. }
  6385. CRect rc2=rc;
  6386. rc2.top +=hei*fonthei;
  6387. rc2.bottom =rc2.top+fonthei;
  6388. Print->DrawText((LPTSTR)(LPCTSTR)temp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6389. hei++;
  6390. maxhei=max(maxhei, rc2.bottom );
  6391. }
  6392. }
  6393. return maxhei+1;
  6394. }
  6395. /* CPrintRX m_Print;
  6396. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6397. {
  6398. m_Print.InitToPrint(NULL, 1);
  6399. }
  6400. else
  6401. {
  6402. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  6403. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6404. if(nret==-1)
  6405. {
  6406. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6407. }
  6408. }
  6409. m_Print.StartPrint();
  6410. m_Print.StartPage();
  6411. LoadRect load;
  6412. load.SetLiaPath ("6.lia");
  6413. load.SetMargins(-14,35);
  6414. if(!load.Load ())return;
  6415. LoadRect load2;
  6416. load2.SetLiaPath ("7.lia");
  6417. load2.SetMargins(-14,216+35);
  6418. if(!load2.Load ())return;
  6419. LoadRect load3;
  6420. load3.SetLiaPath ("8.lia");
  6421. load3.SetMargins(-14,705+35);
  6422. if(!load3.Load ())return;
  6423. int i;
  6424. //////////////////////////////////////////////////////////////
  6425. CStringArray txarray;
  6426. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册';";
  6427. g_sendhead.code[0]=11;
  6428. g_sendhead.code[1]=52;
  6429. g_sendhead.code[2]=50;
  6430. g_sendhead.code[3]=77;
  6431. g_sendhead.tabcount=4;
  6432. g_sendhead.bsql=0;
  6433. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  6434. CArray<CStringArray, CStringArray>sparray;
  6435. CArray<CStringArray, CStringArray>clientarray;
  6436. CArray<CStringArray, CStringArray>phonearray;
  6437. CArray<CStringArray, CStringArray>fgarray;
  6438. DataToArray(&g_List1array, &clientarray, &sparray, &fgarray);
  6439. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  6440. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  6441. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  6442. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  6443. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  6444. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  6445. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  6446. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  6447. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  6448. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  6449. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  6450. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  6451. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  6452. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  6453. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  6454. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  6455. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  6456. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  6457. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  6458. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  6459. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  6460. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  6461. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  6462. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  6463. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  6464. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  6465. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  6466. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  6467. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6468. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  6469. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  6470. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  6471. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  6472. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  6473. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  6474. filter="name='"+m_ren+"'";
  6475. g_sendhead.code[0]=5;
  6476. g_sendhead.tabcount=1;
  6477. g_sendhead.bsql=0;
  6478. int g_nYearposTemp=g_nYearpos;
  6479. g_nYearpos=-1;
  6480. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6481. g_nYearpos=g_nYearposTemp;
  6482. if(g_bSendOK==0)return;
  6483. DataToArray(&phonearray);
  6484. m_money1.Format ("%f", atof(m_taoxijiage));
  6485. m_money2.Format ("%f", atof(m_payed1));
  6486. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  6487. ConvertToPrice(m_money1);
  6488. ConvertToPrice(m_money2);
  6489. ConvertToPrice(m_money3);
  6490. ////////////////////////////////////////////////////////////////
  6491. int rcpos=-1;
  6492. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6493. StrRect.top -=15;StrRect.bottom -=15;
  6494. Image *pImg=NULL;
  6495. #ifdef MNLS_VERSION
  6496. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  6497. #else
  6498. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  6499. #endif
  6500. m_Print.DrawImage(pImg, StrRect);
  6501. delete pImg;
  6502. m_Print.SetFontFace(11, 1, "宋体");
  6503. StrRect=load.m_rcarray .ElementAt (20);
  6504. StrRect.right=load.m_rcarray .ElementAt (23).right;
  6505. StrRect.top -=18;StrRect.bottom -=18;
  6506. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  6507. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6508. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  6509. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6510. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6511. StrRect.top -=15;StrRect.bottom -=15;
  6512. #ifdef MNLS_VERSION
  6513. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6514. #endif
  6515. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6516. StrRect.top -=15;StrRect.bottom -=15;
  6517. #ifdef MNLS_VERSION
  6518. m_Print.DrawRect(StrRect);
  6519. #endif
  6520. m_Print.SetFontFace(7, 1, "黑体");
  6521. m_Print.SetColor(0xffffff);
  6522. #ifdef MNLS_VERSION
  6523. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6524. #endif
  6525. m_Print.SetColor(0);
  6526. m_Print.SetFontFace(15, 1, "宋体");
  6527. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6528. StrRect.top -=15;StrRect.bottom -=15;
  6529. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6530. CStringArray strarray;
  6531. strarray.Add("NO: "+m_id);
  6532. CString date;
  6533. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  6534. strarray.Add(date);
  6535. strarray.Add("喜爱");
  6536. strarray.Add("格调");
  6537. if(fgarray.GetSize ()==12)
  6538. {
  6539. for(int i=0; i<12; i++)
  6540. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  6541. }
  6542. else
  6543. {
  6544. strarray.Add("复古典雅");
  6545. strarray.Add("温文尔雅");
  6546. strarray.Add("豪华艳丽");
  6547. strarray.Add("传统大方");
  6548. strarray.Add("新潮个性");
  6549. strarray.Add("浪漫奔放");
  6550. strarray.Add("简单素雅");
  6551. strarray.Add("活泼俏丽");
  6552. strarray.Add("妩媚温馨");
  6553. strarray.Add("温柔贤惠");
  6554. strarray.Add("成熟感性");
  6555. strarray.Add("清纯可爱");
  6556. }
  6557. strarray.Add("姓名");
  6558. strarray.Add("");
  6559. strarray.Add("电话");
  6560. strarray.Add("QQ/邮箱");
  6561. #ifdef CHILD_VERSION
  6562. strarray.Add("家长");
  6563. strarray.Add("宝宝");
  6564. #else
  6565. strarray.Add("先生");
  6566. strarray.Add("女士");
  6567. #endif
  6568. m_Print.SetFontFace(11, 1, "宋体");
  6569. for( i=0; i<strarray.GetSize (); i++)
  6570. {
  6571. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6572. if(i<2)
  6573. {
  6574. StrRect.top -=15;StrRect.bottom -=15;
  6575. }
  6576. if(i>15)
  6577. {
  6578. if(i==18)
  6579. StrRect.right-=80;
  6580. else if(i==19)
  6581. StrRect.left-=80;
  6582. m_Print.DrawRect2(StrRect, 1);
  6583. }
  6584. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6585. }
  6586. for( i=29; i<=40; i++)
  6587. {
  6588. if(m_style.GetLength ()<=(i-29))continue;
  6589. if(m_style.GetAt (i-29)!='1')continue;
  6590. StrRect=load.m_rcarray .ElementAt (i-1);
  6591. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6592. }
  6593. for( i=27; i<=48; i++)
  6594. {
  6595. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6596. if(i==45 || i==46)
  6597. StrRect.right-=80;
  6598. else if(i==47 || i==48)
  6599. StrRect.left-=80;
  6600. m_Print.DrawRect2(StrRect, 1);
  6601. }
  6602. /////////////////////////
  6603. strarray.RemoveAll ();
  6604. CString temp;
  6605. // temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  6606. strarray.Add (temp);
  6607. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  6608. strarray.Add (temp);
  6609. strarray.Add ("造型/");
  6610. strarray.Add ("服饰");
  6611. strarray.Add ("");
  6612. strarray.Add ("");
  6613. strarray.Add ("配");
  6614. strarray.Add ("置");
  6615. strarray.Add ("其");
  6616. strarray.Add ("它");
  6617. strarray.Add ("套系名称");
  6618. strarray.Add ("镜款");
  6619. strarray.Add ("套系总价");
  6620. strarray.Add ("拍摄张数");
  6621. strarray.Add ("选片日期");
  6622. strarray.Add ("定金");
  6623. strarray.Add ("入册张数");
  6624. strarray.Add ("");
  6625. strarray.Add ("欠款余额");
  6626. strarray.Add ("拍摄日期");
  6627. strarray.Add ("");
  6628. rcpos=-1;
  6629. for( i=0; i<strarray.GetSize (); i++)
  6630. {
  6631. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6632. if(i>9)
  6633. m_Print.DrawRect2(StrRect, 1);
  6634. if(i==1)
  6635. {
  6636. StrRect=load2.m_rcarray .ElementAt (21);StrRect.left +=4;
  6637. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6638. }
  6639. else if(i==6 || i==7)
  6640. {
  6641. StrRect.top -=25;
  6642. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6643. }
  6644. else
  6645. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6646. }
  6647. for( i=22; i<=41; i++)
  6648. {
  6649. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6650. if(rcpos==23 || rcpos==28)continue;
  6651. if(rcpos==24 || rcpos==29)
  6652. StrRect.top-=39;
  6653. m_Print.DrawRect2(StrRect, 1);
  6654. }
  6655. /////////////////////////////
  6656. strarray.RemoveAll ();
  6657. strarray.Add ("顾客签字:");
  6658. strarray.Add ("");
  6659. strarray.Add ("");
  6660. strarray.Add ("门市签字:");
  6661. strarray.Add ("");
  6662. strarray.Add ("");
  6663. rcpos=-1;
  6664. for( i=0; i<strarray.GetSize (); i++)
  6665. {
  6666. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6667. if(i==0 || i==3)
  6668. {
  6669. StrRect.bottom+=20;
  6670. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6671. }
  6672. }
  6673. for( i=7; i<=12; i++)
  6674. {
  6675. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6676. if(i==7 || i==10)
  6677. {
  6678. StrRect.bottom+=12;
  6679. m_Print.DrawRect2(StrRect, 2);
  6680. }
  6681. }
  6682. //////////////////////////////////////
  6683. //开始打数据
  6684. strarray.RemoveAll ();
  6685. strarray.Add (m_name1);
  6686. strarray.Add (m_name2);
  6687. strarray.Add ("");
  6688. strarray.Add ("");
  6689. strarray.Add (m_phone1);
  6690. #ifdef CHILD_VERSION
  6691. strarray.Add ("");
  6692. #else
  6693. strarray.Add (m_phone2);
  6694. #endif
  6695. strarray.Add (m_qq1);
  6696. strarray.Add (m_qq2);
  6697. for( i=41; i<=48; i++)
  6698. {
  6699. StrRect=load.m_rcarray .ElementAt (i-1);
  6700. StrRect.left +=4;
  6701. if(i==45 || i==46)
  6702. StrRect.right-=80;
  6703. else if(i==47 || i==48)
  6704. StrRect.left-=80;
  6705. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6706. }
  6707. ///////////////////////////////
  6708. strarray.RemoveAll ();
  6709. strarray.Add (m_money1);
  6710. str.Format("%d", atoi(m_zs)*2);
  6711. strarray.Add (str);
  6712. strarray.Add (m_time4);
  6713. strarray.Add (m_money2);
  6714. strarray.Add (m_zs);
  6715. strarray.Add ("");
  6716. strarray.Add (m_money3);
  6717. strarray.Add (m_time2);
  6718. strarray.Add ("");
  6719. for( i=32; i<=40; i++)
  6720. {
  6721. StrRect=load2.m_rcarray .ElementAt (i-1);
  6722. StrRect.left +=4;
  6723. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6724. }
  6725. ///////////////////////////////
  6726. strarray.RemoveAll ();
  6727. strarray.Add (m_name1);
  6728. strarray.Add (m_name2);
  6729. CString phone;
  6730. if(m_phone1.IsEmpty ()==0)
  6731. phone=m_phone1+",";
  6732. phone+=m_phone2;
  6733. phone.TrimRight (",");
  6734. strarray.Add (phone);
  6735. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  6736. strarray.Add (m_ren);
  6737. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  6738. for( i=7; i<=12; i++)
  6739. {
  6740. StrRect=load3.m_rcarray .ElementAt (i-1);
  6741. StrRect.left +=4;
  6742. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6743. }
  6744. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  6745. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6746. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  6747. str.Format("造型 %d 款,服装 %d 套", atoi(m_clothescount2), atoi(m_clothescount));
  6748. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6749. // StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  6750. // m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6751. //////////////////////////////
  6752. //开始画文字
  6753. StrRect=load2.m_rcarray .ElementAt (30);
  6754. StrRect.left +=3;
  6755. StrRect.top +=3;
  6756. StrRect.right -=2;
  6757. StrRect.bottom -=2;
  6758. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6759. StrRect=load2.m_rcarray .ElementAt (29); StrRect.top -=39;
  6760. StrRect.left +=3;
  6761. StrRect.top +=3;
  6762. StrRect.right -=2;
  6763. StrRect.bottom -=2;
  6764. str="";
  6765. for(i=0; i<sparray.GetSize (); i++)
  6766. {
  6767. str+=sparray.ElementAt (i).ElementAt (5);
  6768. str+=" 数量:";
  6769. str+=sparray.ElementAt (i).ElementAt (3);
  6770. str+="\r\n";
  6771. }
  6772. str.TrimRight ("\r\n");
  6773. AutoDraw(m_Print, StrRect, str, 1.4);
  6774. StrRect=load2.m_rcarray .ElementAt (40);
  6775. StrRect.top +=8;
  6776. m_Print.SetFontFace(12, 1, "黑体");
  6777. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客须知", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  6778. StrRect.left +=3;
  6779. StrRect.top +=30;
  6780. StrRect.right -=2;
  6781. StrRect.bottom -=2;
  6782. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6783. if(str.IsEmpty ())
  6784. {
  6785. str="\
  6786. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6787. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6788. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6789. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6790. 持良好的心境.\r\n\
  6791. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6792. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6793. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6794. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6795. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6796. 勿进影室, 以免影响拍摄.\r\n\
  6797. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6798. 师或店长沟通.\r\n\
  6799. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6800. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6801. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6802. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6803. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6804. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6805. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6806. 还.";
  6807. }
  6808. AutoDraw(m_Print, StrRect, str, 1.8);
  6809. PrintPreview dlg;
  6810. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6811. dlg.m_pDC =m_Print.GetPDC() ;
  6812. if(dlg.DoModal ()!=IDOK)return;
  6813. //结束打印
  6814. m_Print.EndPage();
  6815. m_Print.EndPrint();*/
  6816. /*
  6817. void CMainFrame::PrintReceipt(CStringArray *pArray)
  6818. {
  6819. g_sendhead.bsql=0;
  6820. g_sendhead.code[0]=24;
  6821. g_sendhead.tabcount=1;
  6822. int g_nYearposTemp=g_nYearpos;
  6823. g_nYearpos=-1;
  6824. g_pMainWnd->ProcessChatMessageRequest2(1);
  6825. g_nYearpos=g_nYearposTemp;
  6826. if(0==g_bSendOK)return;
  6827. DataToArray(&g_cominfoarray);
  6828. CString SerialNo;
  6829. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  6830. CPrintRX m_Print;
  6831. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6832. {
  6833. m_Print.InitToPrint(NULL, 1);
  6834. }
  6835. else
  6836. {
  6837. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  6838. if(name.IsEmpty ())
  6839. m_Print.InitToPrint(NULL, 1);
  6840. else
  6841. {
  6842. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6843. if(nret==-1)
  6844. {
  6845. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6846. }
  6847. }
  6848. }
  6849. m_Print.StartPrint();
  6850. m_Print.StartPage();
  6851. LoadRect load;
  6852. BOOL bSmall=0;
  6853. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  6854. {
  6855. bSmall=1;
  6856. load.SetLiaPath ("20.lia");
  6857. }
  6858. else
  6859. load.SetLiaPath ("10.lia");
  6860. if(bSmall)
  6861. load.SetMargins(0,0);
  6862. else
  6863. load.SetMargins(10,0);
  6864. if(!load.Load ())return;
  6865. int rcpos=-1;
  6866. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6867. if(bSmall)
  6868. {
  6869. m_Print.SetFontFace(18, 1, "黑体");
  6870. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6871. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6872. m_Print.SetFontFace(9, 1, "宋体");
  6873. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6874. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6875. m_Print.SetFontFace(6, 1, "宋体");
  6876. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6877. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6878. m_Print.SetFontFace(9, 1, "宋体");
  6879. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6880. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6881. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6882. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6883. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6884. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6885. int hei=StrRect.Height ();
  6886. StrRect.bottom=StrRect.top;
  6887. StrRect.top -=8;
  6888. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6889. m_Print.SetFontFace(11, 1, "宋体");
  6890. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6891. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6892. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6893. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6894. m_Print.SetFontFace(8, 1, "宋体");
  6895. for(int i=7; i<24; i++)
  6896. {
  6897. StrRect=load.m_rcarray .ElementAt (i);
  6898. m_Print.DrawRect2(StrRect, 1);
  6899. }
  6900. for( i=9; i<24; i++)
  6901. {
  6902. StrRect=load.m_rcarray .ElementAt (i);
  6903. StrRect.left +=2;
  6904. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6905. }
  6906. m_Print.SetFontFace(6, 1, "宋体");
  6907. for(i=24; i<26; i++)
  6908. {
  6909. StrRect=load.m_rcarray .ElementAt (i);
  6910. StrRect.left +=2;
  6911. if(i==24)
  6912. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6913. else
  6914. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6915. }
  6916. // StrRect=load.m_rcarray .ElementAt (27);
  6917. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6918. }
  6919. else//大单
  6920. {
  6921. m_Print.SetFontFace(20, 1, "黑体");
  6922. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6923. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6924. m_Print.SetFontFace(11, 1, "宋体");
  6925. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15;
  6926. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6927. int hei=StrRect.Height ();
  6928. StrRect.bottom=StrRect.top;
  6929. StrRect.top -=10;
  6930. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6931. m_Print.SetFontFace(8, 1, "宋体");
  6932. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6933. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6934. #ifdef LYFZ_VERSION
  6935. m_Print.SetFontFace(9, 1, "宋体");
  6936. #else
  6937. m_Print.SetFontFace(11, 1, "宋体");
  6938. #endif
  6939. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6940. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6941. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6942. #ifdef LYFZ_VERSION
  6943. StrRect.left +=30;
  6944. StrRect.right +=30;
  6945. #endif
  6946. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6947. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6948. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6949. m_Print.SetFontFace(13, 1, "宋体");
  6950. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6951. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6952. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6953. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6954. m_Print.SetFontFace(11, 1, "宋体");
  6955. for(int i=7; i<24; i++)
  6956. {
  6957. StrRect=load.m_rcarray .ElementAt (i);
  6958. m_Print.DrawRect2(StrRect, 1);
  6959. }
  6960. for( i=9; i<24; i++)
  6961. {
  6962. StrRect=load.m_rcarray .ElementAt (i);
  6963. StrRect.left +=2;
  6964. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6965. }
  6966. #ifdef LYFZ_VERSION
  6967. m_Print.SetFontFace(7, 1, "宋体");
  6968. for(i=24; i<25; i++)
  6969. {
  6970. StrRect=load.m_rcarray .ElementAt (i);
  6971. StrRect.left +=2;
  6972. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6973. }
  6974. #else
  6975. m_Print.SetFontFace(7, 1, "宋体");
  6976. for(i=24; i<27; i++)
  6977. {
  6978. StrRect=load.m_rcarray .ElementAt (i);
  6979. StrRect.left +=2;
  6980. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6981. }
  6982. #endif
  6983. StrRect=load.m_rcarray .ElementAt (24);
  6984. hei=StrRect.Height ();
  6985. StrRect.top +=hei;
  6986. StrRect.bottom +=hei;
  6987. StrRect.right +=100;
  6988. StrRect.left +=2;
  6989. StrRect=load.m_rcarray .ElementAt (27);
  6990. AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6991. }
  6992. PrintPreview dlg;
  6993. dlg.m_mode=3;
  6994. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6995. dlg.m_pDC =m_Print.GetPDC() ;
  6996. if(dlg.DoModal ()!=IDOK)return;
  6997. //结束打印
  6998. m_Print.EndPage();
  6999. m_Print.EndPrint();
  7000. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7001. CString sql;
  7002. sql.Format("update version set [serialno]='%s'", SerialNo);
  7003. g_sendhead.bsql=1;
  7004. g_nYearposTemp=g_nYearpos;
  7005. g_nYearpos=-1;
  7006. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7007. g_nYearpos=g_nYearposTemp;
  7008. }
  7009. */
  7010. void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7011. {
  7012. //AfxMessageBox("abce");
  7013. int printcot=1;
  7014. for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7015. {
  7016. g_sendhead.bsql=0;
  7017. g_sendhead.code[0]=24;
  7018. g_sendhead.tabcount=1;
  7019. int g_nYearposTemp=g_nYearpos;
  7020. g_nYearpos=-1;
  7021. g_pMainWnd->ProcessChatMessageRequest2(1);
  7022. g_nYearpos=g_nYearposTemp;
  7023. if(0==g_bSendOK)return;
  7024. DataToArray(&g_cominfoarray);
  7025. CString SerialNo;
  7026. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7027. // 1.创建打印对象
  7028. CPrintRX m_Print;
  7029. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7030. {
  7031. m_Print.InitToPrint(NULL, 1);
  7032. }
  7033. else
  7034. {
  7035. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  7036. if(name.IsEmpty ())
  7037. m_Print.InitToPrint(NULL, 1);
  7038. else
  7039. {
  7040. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7041. if(nret==-1 && aa==0)
  7042. {
  7043. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7044. }
  7045. }
  7046. }
  7047. // 2.开始打印
  7048. m_Print.StartPrint();
  7049. m_Print.StartPage();
  7050. LoadRect load;
  7051. BOOL bSmall=0;
  7052. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7053. {
  7054. bSmall=1;
  7055. load.SetLiaPath ("20.lia");
  7056. }
  7057. else
  7058. load.SetLiaPath ("10.lia");
  7059. if(bSmall)
  7060. load.SetMargins(0,0);
  7061. else
  7062. load.SetMargins(10,0);
  7063. if(!load.Load ())return;
  7064. int rcpos=-1;
  7065. CRect StrRect=load.m_rcarray.ElementAt (++rcpos);
  7066. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7067. {
  7068. Image *pImg=NULL;
  7069. g_nSendCode=31;
  7070. int g_nYearposTemp=g_nYearpos;
  7071. g_nYearpos=-1;
  7072. g_pMainWnd->ProcessChatMessageRequest2(1);
  7073. g_nYearpos=g_nYearposTemp;
  7074. g_nSendCode=0;
  7075. if(g_bSendOK==0)return;
  7076. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7077. if(pImg)
  7078. {
  7079. StrRect.left=65;
  7080. if(bSmall) StrRect.left=55;
  7081. StrRect.top=10;
  7082. StrRect.right=StrRect.left+58;
  7083. StrRect.bottom=StrRect.top+58;
  7084. // 3.打印2维码图像;
  7085. m_Print.DrawImage(pImg, StrRect);
  7086. delete pImg;
  7087. pImg=NULL;
  7088. }
  7089. }
  7090. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7091. if(bSmall)
  7092. {
  7093. m_Print.SetFontFace(18, 1, "黑体");
  7094. StrRect=load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7095. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7096. m_Print.SetFontFace(9, 1, "宋体");
  7097. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7098. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7099. m_Print.SetFontFace(6, 1, "宋体");
  7100. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7101. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7102. m_Print.SetFontFace(9, 1, "宋体");
  7103. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7104. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7105. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7106. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7107. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7108. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7109. int hei=StrRect.Height ();
  7110. StrRect.bottom=StrRect.top;
  7111. StrRect.top -=8;
  7112. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7113. m_Print.SetFontFace(11, 1, "宋体");
  7114. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7115. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7116. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7117. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7118. m_Print.SetFontFace(8, 1, "宋体");
  7119. for(int i=7; i<24; i++)
  7120. {
  7121. StrRect=load.m_rcarray .ElementAt (i);
  7122. m_Print.DrawRect2(StrRect, 1);
  7123. }
  7124. for( i=9; i<24; i++)
  7125. {
  7126. StrRect=load.m_rcarray .ElementAt (i);
  7127. StrRect.left +=2;
  7128. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7129. }
  7130. m_Print.SetFontFace(6, 1, "宋体");
  7131. for(i=24; i<26; i++)
  7132. {
  7133. StrRect=load.m_rcarray .ElementAt (i);
  7134. StrRect.left +=2;
  7135. if(i==24)
  7136. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7137. else
  7138. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7139. }
  7140. // StrRect=load.m_rcarray .ElementAt (27);
  7141. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7142. }
  7143. else//大单
  7144. {
  7145. // 1.打印表头(蒙娜丽莎收款单)
  7146. m_Print.SetFontFace(20, 1, "黑体");
  7147. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7148. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7149. m_Print.SetFontFace(11, 1, "宋体");
  7150. // 2.打印订单号(NO.20140608-001)
  7151. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7152. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7153. // 3.打印SerialNo(SerialNo.01062)
  7154. int hei=StrRect.Height ();
  7155. StrRect.bottom=StrRect.top;
  7156. StrRect.top -=10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7157. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7158. // 4.打印影楼地址信息、电话;
  7159. m_Print.SetFontFace(8, 1, "宋体");
  7160. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7161. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7162. #ifdef LYFZ_VERSION
  7163. m_Print.SetFontFace(9, 1, "宋体");
  7164. #else
  7165. m_Print.SetFontFace(11, 1, "宋体");
  7166. #endif
  7167. // 5.打印客户姓名
  7168. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7169. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7170. // 6.打印客户联系电话
  7171. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7172. #ifdef LYFZ_VERSION
  7173. StrRect.left +=30;
  7174. StrRect.right +=30;
  7175. #endif
  7176. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7177. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7178. // 7.打印开单日期
  7179. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7180. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7181. // 8.打印列字段:收款项目
  7182. m_Print.SetFontFace(13, 1, "宋体");
  7183. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7184. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7185. //printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7186. // 9.打印列字段:金额
  7187. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7188. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7189. //printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7190. // 10.打印列字段:开单人
  7191. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7192. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7193. //printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7194. // 11.画表格-画3列;
  7195. m_Print.SetFontFace(11, 1, "宋体");
  7196. int i;
  7197. for( i=7; i<10; i++)
  7198. {
  7199. StrRect=load.m_rcarray.ElementAt (i);
  7200. m_Print.DrawRect2(StrRect, 1);
  7201. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7202. }
  7203. // 12.打印详细内容
  7204. int dty=0;
  7205. int dtytemp=0;
  7206. // for( i=10; i<14; i+=3)
  7207. for( i=10; i<22; i+=3) // 循环4次,再画
  7208. {
  7209. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7210. CArray<CRect,CRect>rcarray;
  7211. CStringArray strarray2;
  7212. StrRect=load.m_rcarray.ElementAt(i);
  7213. StrRect.top +=dty;
  7214. StrRect.bottom +=dty;
  7215. if(StrRect.bottom > load.m_rcarray.ElementAt(22).top+5)
  7216. {
  7217. StrRect=load.m_rcarray.ElementAt(i-1);
  7218. StrRect.top +=dty;
  7219. StrRect.bottom +=dty;
  7220. dty=StrRect.bottom-load.m_rcarray.ElementAt (22).top;
  7221. break;
  7222. }
  7223. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7224. StrRect.left +=2;
  7225. StrRect.right -=2;
  7226. StrRect.top +=4;
  7227. rcarray.Add(StrRect);
  7228. strarray2.Add(pArray->ElementAt(i));
  7229. // 指定格子宽度,计算字符串占几行(高度).
  7230. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7231. dtytemp=bottom-StrRect.bottom;
  7232. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7233. // 重新获取表格大小,并画出表格;
  7234. StrRect=load.m_rcarray.ElementAt (i);
  7235. StrRect.bottom +=dtytemp;
  7236. StrRect.top +=dty;
  7237. StrRect.bottom +=dty;
  7238. m_Print.DrawRect2(StrRect, 1);
  7239. // 获取下一表格大小,并画出表格;
  7240. StrRect=load.m_rcarray.ElementAt(i+1);
  7241. StrRect.top +=dty;
  7242. StrRect.bottom +=dty;
  7243. StrRect.bottom +=dtytemp;
  7244. m_Print.DrawRect2(StrRect, 1);
  7245. StrRect.left +=2;
  7246. // 打印出金额字段内容
  7247. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i+1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7248. //printf("Jeff:%d:%s\n\n",i+1,pArray->ElementAt(i+1));//Jeff Printf;
  7249. StrRect=load.m_rcarray.ElementAt(i+2);
  7250. StrRect.top +=dty;
  7251. StrRect.bottom +=dty;
  7252. StrRect.bottom +=dtytemp;
  7253. m_Print.DrawRect2(StrRect, 1);
  7254. StrRect.left +=2;
  7255. // 打印开单人字段内容
  7256. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i+2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7257. //printf("Jeff:%d:%s\n\n",i+2,pArray->ElementAt(i+2));//Jeff Printf;
  7258. dty+=dtytemp;
  7259. }
  7260. //.打印->付款情况 应付 实付 欠款.
  7261. i=22;
  7262. StrRect=load.m_rcarray.ElementAt (i);
  7263. StrRect.top +=dty;
  7264. StrRect.bottom +=dty;
  7265. m_Print.DrawRect2(StrRect, 1);
  7266. StrRect.left +=2;
  7267. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7268. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7269. //.打印->合计人民币(大写):.......
  7270. i=23;
  7271. StrRect=load.m_rcarray .ElementAt(i);StrRect.top +=dty;StrRect.bottom +=dty;
  7272. m_Print.DrawRect2(StrRect, 1);
  7273. StrRect.left +=2;
  7274. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7275. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7276. #ifdef LYFZ_VERSION
  7277. m_Print.SetFontFace(7, 1, "宋体");
  7278. for(i=24; i<25; i++)
  7279. {
  7280. StrRect=load.m_rcarray .ElementAt (i);StrRect.top +=dty;StrRect.bottom +=dty;
  7281. StrRect.left +=2;
  7282. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7283. }
  7284. #else
  7285. m_Print.SetFontFace(7, 1, "宋体");
  7286. for(i=24; i<27; i++)
  7287. {
  7288. StrRect=load.m_rcarray .ElementAt (i);StrRect.top +=dty;StrRect.bottom +=dty;
  7289. StrRect.left +=2;
  7290. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7291. }
  7292. #endif
  7293. StrRect=load.m_rcarray .ElementAt (24);StrRect.top +=dty;StrRect.bottom +=dty;
  7294. hei=StrRect.Height ();
  7295. StrRect.top +=hei;
  7296. StrRect.bottom +=hei;
  7297. StrRect.right +=100;
  7298. StrRect.left +=2;
  7299. StrRect=load.m_rcarray .ElementAt (27);StrRect.top +=dty;StrRect.bottom +=dty;
  7300. AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7301. }
  7302. PrintPreview dlg;
  7303. dlg.m_mode=3;
  7304. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7305. dlg.m_pDC =m_Print.GetPDC() ;
  7306. if(aa==0)
  7307. {
  7308. if(dlg.DoModal ()!=IDOK)
  7309. return;
  7310. printcot=dlg.m_num;
  7311. }
  7312. //结束打印
  7313. m_Print.EndPage();
  7314. m_Print.EndPrint();
  7315. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7316. CString sql;
  7317. sql.Format("update version set [serialno]='%s'", SerialNo);
  7318. g_sendhead.bsql=1;
  7319. g_nYearposTemp=g_nYearpos;
  7320. g_nYearpos=-1;
  7321. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7322. g_nYearpos=g_nYearposTemp;
  7323. }
  7324. }
  7325. void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7326. {
  7327. //AfxMessageBox("abce");
  7328. int printcot=1;
  7329. for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7330. {
  7331. g_sendhead.bsql=0;
  7332. g_sendhead.code[0]=24;
  7333. g_sendhead.tabcount=1;
  7334. int g_nYearposTemp=g_nYearpos;
  7335. g_nYearpos=-1;
  7336. g_pMainWnd->ProcessChatMessageRequest2(1);
  7337. g_nYearpos=g_nYearposTemp;
  7338. if(0==g_bSendOK)return;
  7339. DataToArray(&g_cominfoarray);
  7340. CString SerialNo;
  7341. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7342. // 1.创建打印对象
  7343. CPrintRX m_Print;
  7344. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7345. {
  7346. m_Print.InitToPrint(NULL, 1);
  7347. }
  7348. else
  7349. {
  7350. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  7351. if(name.IsEmpty ())
  7352. m_Print.InitToPrint(NULL, 1);
  7353. else
  7354. {
  7355. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7356. if(nret==-1 && aa==0)
  7357. {
  7358. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7359. }
  7360. }
  7361. }
  7362. // 2.开始打印
  7363. m_Print.StartPrint();
  7364. m_Print.StartPage();
  7365. LoadRect load;
  7366. BOOL bSmall=0;
  7367. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7368. {
  7369. bSmall=1;
  7370. load.SetLiaPath ("20.lia");
  7371. }
  7372. else
  7373. load.SetLiaPath ("10.lia");
  7374. if(bSmall)
  7375. load.SetMargins(0,0);
  7376. else
  7377. load.SetMargins(10,0);
  7378. if(!load.Load ())return;
  7379. int rcpos=-1;
  7380. CRect StrRect=load.m_rcarray.ElementAt (++rcpos);
  7381. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7382. {
  7383. Image *pImg=NULL;
  7384. g_nSendCode=31;
  7385. int g_nYearposTemp=g_nYearpos;
  7386. g_nYearpos=-1;
  7387. g_pMainWnd->ProcessChatMessageRequest2(1);
  7388. g_nYearpos=g_nYearposTemp;
  7389. g_nSendCode=0;
  7390. if(g_bSendOK==0)return;
  7391. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7392. if(pImg)
  7393. {
  7394. StrRect.left=65;
  7395. if(bSmall) StrRect.left=55;
  7396. StrRect.top=10;
  7397. StrRect.right=StrRect.left+58;
  7398. StrRect.bottom=StrRect.top+58;
  7399. // 3.打印2维码图像;
  7400. m_Print.DrawImage(pImg, StrRect);
  7401. delete pImg;
  7402. pImg=NULL;
  7403. }
  7404. }
  7405. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7406. if(bSmall)
  7407. {
  7408. m_Print.SetFontFace(18, 1, "黑体");
  7409. StrRect=load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7410. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7411. m_Print.SetFontFace(9, 1, "宋体");
  7412. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7413. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7414. m_Print.SetFontFace(6, 1, "宋体");
  7415. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7416. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7417. m_Print.SetFontFace(9, 1, "宋体");
  7418. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7419. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7420. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7421. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7422. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7423. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7424. int hei=StrRect.Height ();
  7425. StrRect.bottom=StrRect.top;
  7426. StrRect.top -=8;
  7427. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7428. m_Print.SetFontFace(11, 1, "宋体");
  7429. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7430. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7431. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7432. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7433. m_Print.SetFontFace(8, 1, "宋体");
  7434. for(int i=7; i<24; i++)
  7435. {
  7436. StrRect=load.m_rcarray .ElementAt (i);
  7437. m_Print.DrawRect2(StrRect, 1);
  7438. }
  7439. for( i=9; i<24; i++)
  7440. {
  7441. StrRect=load.m_rcarray .ElementAt (i);
  7442. StrRect.left +=2;
  7443. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7444. }
  7445. m_Print.SetFontFace(6, 1, "宋体");
  7446. for(i=24; i<26; i++)
  7447. {
  7448. StrRect=load.m_rcarray .ElementAt (i);
  7449. StrRect.left +=2;
  7450. if(i==24)
  7451. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7452. else
  7453. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7454. }
  7455. // StrRect=load.m_rcarray .ElementAt (27);
  7456. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7457. }
  7458. else//大单
  7459. {
  7460. // 1.打印表头(蒙娜丽莎收款单)
  7461. m_Print.SetFontFace(20, 1, "黑体");
  7462. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7463. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7464. m_Print.SetFontFace(11, 1, "宋体");
  7465. // 2.打印订单号(NO.20140608-001)
  7466. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7467. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7468. // 3.打印SerialNo(SerialNo.01062)
  7469. int hei=StrRect.Height ();
  7470. StrRect.bottom=StrRect.top;
  7471. StrRect.top -=10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7472. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7473. // 4.打印影楼地址信息、电话;
  7474. m_Print.SetFontFace(8, 1, "宋体");
  7475. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7476. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7477. #ifdef LYFZ_VERSION
  7478. m_Print.SetFontFace(9, 1, "宋体");
  7479. #else
  7480. m_Print.SetFontFace(11, 1, "宋体");
  7481. #endif
  7482. // 5.打印客户姓名
  7483. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7484. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7485. // 6.打印客户联系电话
  7486. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7487. #ifdef LYFZ_VERSION
  7488. StrRect.left +=30;
  7489. StrRect.right +=30;
  7490. #endif
  7491. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7492. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7493. // 7.打印开单日期
  7494. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7495. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7496. #if 0 // Original Edition
  7497. // 8.打印列字段:收款项目
  7498. m_Print.SetFontFace(13, 1, "宋体");
  7499. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7500. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7501. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7502. // 9.打印列字段:金额
  7503. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7504. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7505. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7506. // 10.打印列字段:开单人
  7507. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7508. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7509. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7510. #else
  7511. // 8.打印列字段:收款项目
  7512. m_Print.SetFontFace(13, 1, "宋体");
  7513. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7514. StrRect=CRect(66,85,280,105);
  7515. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7516. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7517. // 8.1 Jeff add:支付方式
  7518. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7519. StrRect=CRect(280,85,350,105);
  7520. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7521. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7522. // 9.打印列字段:金额
  7523. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7524. StrRect=CRect(350,85,442,105);
  7525. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7526. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7527. // 10.打印列字段:开单人
  7528. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7529. StrRect=CRect(442,85,535,105);
  7530. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7531. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7532. //rcpos += 3;
  7533. #endif
  7534. // 11.画表格-画3列;old
  7535. // 11.draw 4 column
  7536. m_Print.SetFontFace(11, 1, "宋体");
  7537. int i;
  7538. //for( i=7; i<10; i++)
  7539. //{
  7540. // StrRect=load.m_rcarray.ElementAt(i);
  7541. // m_Print.DrawRect2(StrRect, 1);
  7542. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7543. //}
  7544. m_Print.DrawRect2(CRect(66,85,280,105),1);
  7545. m_Print.DrawRect2(CRect(280,85,350,105),1);
  7546. m_Print.DrawRect2(CRect(350,85,442,105),1);
  7547. m_Print.DrawRect2(CRect(442,85,535,105),1);
  7548. // 12.打印详细内容
  7549. int dty=0;
  7550. int dtytemp=0;
  7551. // for( i=10; i<14; i+=3)
  7552. //for( i=10; i<22; i+=3) // 循环4次,再画
  7553. int j = 0;
  7554. for( i=10,j=11; i<22; i+=3,j+=4) // 循环4次,再画
  7555. {
  7556. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7557. CArray<CRect,CRect>rcarray;
  7558. CStringArray strarray2;
  7559. StrRect=load.m_rcarray.ElementAt(i);
  7560. StrRect.top +=dty;
  7561. StrRect.bottom +=dty;
  7562. StrRect.right -= 70; // Jeff add
  7563. //printf("Jeff:i=%d:left=%d,top=%d,right=%d,bottom=%d.\n\n",i,StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7564. /*
  7565. 4次的CRect
  7566. 66,105,350,125
  7567. 66,126,350,146
  7568. 66,147,350,167
  7569. 66,168,350,188
  7570. */
  7571. if(StrRect.bottom > load.m_rcarray.ElementAt(22).top+5)
  7572. {
  7573. StrRect=load.m_rcarray.ElementAt(i-1);
  7574. StrRect.top +=dty;
  7575. StrRect.bottom +=dty;
  7576. dty=StrRect.bottom-load.m_rcarray.ElementAt (22).top;
  7577. break;
  7578. }
  7579. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7580. StrRect.left +=2;
  7581. StrRect.right -=2;
  7582. StrRect.top +=4;
  7583. rcarray.Add(StrRect);
  7584. //strarray2.Add(pArray->ElementAt(i+1));
  7585. strarray2.Add(pArray->ElementAt(j));
  7586. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7587. // 指定格子宽度,计算字符串占几行(高度).
  7588. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7589. dtytemp=bottom-StrRect.bottom;
  7590. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7591. // 重新获取表格大小,并画出表格;
  7592. /*
  7593. CRect(66,85,280,105),
  7594. CRect(280,85,350,105)
  7595. CRect(350,85,442,105)
  7596. CRect(442,85,535,105)
  7597. CRect(66,105,350,125),
  7598. CRect(66,126,350,146)
  7599. CRect(66,147,350,167)
  7600. CRect(66,168,350,188)
  7601. */
  7602. // 画收款项目框及打印内容;
  7603. StrRect=load.m_rcarray.ElementAt(i);
  7604. //StrRect=CRect(66,85,280,105);
  7605. StrRect.bottom +=dtytemp;
  7606. StrRect.top +=dty;
  7607. StrRect.bottom +=dty;
  7608. //StrRect.left -= 70; // Jeff add
  7609. StrRect.right -= 70; // Jeff add
  7610. //printf("Jeff:1.i=%d:left=%d,top=%d,right=%d,bottom=%d.\n\n",i,StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7611. m_Print.DrawRect2(StrRect, 1);
  7612. // 画支付方式框及打印内容;
  7613. StrRect=load.m_rcarray.ElementAt(i);
  7614. //StrRect=CRect(280,85,350,105);
  7615. StrRect.bottom +=dtytemp;
  7616. StrRect.top +=dty;
  7617. StrRect.bottom +=dty;
  7618. StrRect.left += StrRect.Width()-70;
  7619. //StrRect.right += 70; // Jeff add
  7620. //printf("Jeff:2.i=%d:left=%d,top=%d,right=%d,bottom=%d.\n\n",i,StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7621. m_Print.DrawRect2(StrRect, 1);
  7622. StrRect.left +=2;
  7623. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7624. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7625. // 画金额框及打印内容;
  7626. StrRect=load.m_rcarray.ElementAt(i+1);
  7627. //StrRect=CRect(350,85,442,105);
  7628. StrRect.top +=dty;
  7629. StrRect.bottom +=dty;
  7630. StrRect.bottom +=dtytemp;
  7631. //StrRect.right -= 70; // Jeff add
  7632. //printf("Jeff:i=%d:left=%d,top=%d,right=%d,bottom=%d.\n\n",i,StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7633. m_Print.DrawRect2(StrRect, 1);
  7634. StrRect.left +=2;
  7635. // 打印出金额字段内容
  7636. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7637. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7638. // 画开单人框及打印内容;
  7639. StrRect=load.m_rcarray.ElementAt(i+2);
  7640. //StrRect=CRect(442,85,535,105);
  7641. StrRect.top +=dty;
  7642. StrRect.bottom +=dty;
  7643. StrRect.bottom +=dtytemp;
  7644. //StrRect.right -= 70; // Jeff add
  7645. //printf("Jeff:i=%d:left=%d,top=%d,right=%d,bottom=%d.\n\n",i,StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7646. m_Print.DrawRect2(StrRect, 1);
  7647. StrRect.left +=2;
  7648. // 打印开单人字段内容
  7649. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7650. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7651. dty+=dtytemp;
  7652. }
  7653. //.打印->付款情况 应付 实付 欠款.
  7654. i=22;
  7655. j=27;
  7656. StrRect=load.m_rcarray.ElementAt (i);
  7657. StrRect.top +=dty;
  7658. StrRect.bottom +=dty;
  7659. m_Print.DrawRect2(StrRect, 1);
  7660. StrRect.left +=2;
  7661. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7662. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7663. //.打印->合计人民币(大写):.......
  7664. i=23;
  7665. j=28;
  7666. StrRect=load.m_rcarray.ElementAt(i);
  7667. StrRect.top +=dty;
  7668. StrRect.bottom +=dty;
  7669. m_Print.DrawRect2(StrRect, 1);
  7670. StrRect.left +=2;
  7671. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7672. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7673. // 打印总金额;
  7674. #ifdef LYFZ_VERSION
  7675. m_Print.SetFontFace(7, 1, "宋体");
  7676. for(i=24; i<25; i++)
  7677. {
  7678. StrRect=load.m_rcarray.ElementAt(i);
  7679. StrRect.top +=dty;
  7680. StrRect.bottom +=dty;
  7681. StrRect.left +=2;
  7682. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7683. }
  7684. #else
  7685. m_Print.SetFontFace(7, 1, "宋体");
  7686. for(i=24,j=29; i<27; i++,j++)
  7687. {
  7688. StrRect=load.m_rcarray.ElementAt(i);
  7689. StrRect.top +=dty;
  7690. StrRect.bottom +=dty;
  7691. StrRect.left +=2;
  7692. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7693. }
  7694. #endif
  7695. StrRect=load.m_rcarray.ElementAt (24);
  7696. StrRect.top +=dty;
  7697. StrRect.bottom +=dty;
  7698. hei=StrRect.Height ();
  7699. StrRect.top +=hei;
  7700. StrRect.bottom +=hei;
  7701. StrRect.right +=100;
  7702. StrRect.left +=2;
  7703. StrRect=load.m_rcarray .ElementAt(27);StrRect.top +=dty;StrRect.bottom +=dty;
  7704. AutoDraw(m_Print, StrRect, pArray->ElementAt(32), 1.0);
  7705. }
  7706. PrintPreview dlg;
  7707. dlg.m_mode=3;
  7708. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7709. dlg.m_pDC =m_Print.GetPDC() ;
  7710. if(aa==0)
  7711. {
  7712. if(dlg.DoModal ()!=IDOK)
  7713. return;
  7714. printcot=dlg.m_num;
  7715. }
  7716. //结束打印
  7717. m_Print.EndPage();
  7718. m_Print.EndPrint();
  7719. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7720. CString sql;
  7721. sql.Format("update version set [serialno]='%s'", SerialNo);
  7722. g_sendhead.bsql=1;
  7723. g_nYearposTemp=g_nYearpos;
  7724. g_nYearpos=-1;
  7725. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7726. g_nYearpos=g_nYearposTemp;
  7727. }
  7728. }
  7729. void CMainFrame::PrintFlowChart(CString strOrderNumber)
  7730. {
  7731. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
  7732. {
  7733. PrintFlowChart3(strOrderNumber);return;
  7734. }
  7735. #ifdef ZHIAI_VERSION
  7736. PrintFlowChart2(strOrderNumber);
  7737. return;
  7738. #endif
  7739. int printcot=1;
  7740. for(int aa=0; aa<printcot; aa++)
  7741. {
  7742. CPrintRX m_Print;
  7743. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7744. {
  7745. m_Print.InitToPrint(NULL, 1);
  7746. }
  7747. else
  7748. {
  7749. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  7750. if(name.IsEmpty ())
  7751. m_Print.InitToPrint(NULL, 1);
  7752. else
  7753. {
  7754. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7755. if(nret==-1 && aa==0)
  7756. {
  7757. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7758. }
  7759. }
  7760. }
  7761. m_Print.StartPrint();
  7762. m_Print.StartPage();
  7763. // CRect StrRect(0,0,560,818);
  7764. LoadRect load;
  7765. load.SetLiaPath ("4.lia");
  7766. load.SetMargins(-14,-14);
  7767. if(!load.Load ())return;
  7768. LoadRect load2;
  7769. load2.SetMargins(-14,472+27-14);
  7770. load2.SetLiaPath ("5.lia");
  7771. if(!load2.Load ())return;
  7772. //////////////////////////////////////////////////////////////
  7773. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2'";
  7774. g_sendhead.code[0]=54;
  7775. g_sendhead.code[1]=223;
  7776. g_sendhead.tabcount=2;
  7777. g_sendhead.bsql=0;
  7778. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  7779. CArray<CStringArray, CStringArray>sparray;
  7780. DataToArray(&g_List1array,&sparray);
  7781. CString spno;
  7782. for(int i=0; i<sparray.GetSize (); i++)
  7783. {
  7784. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  7785. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  7786. if(sparray.ElementAt (i).ElementAt (5)=="入册" && sparray.ElementAt (i).ElementAt (5)=="入底" && sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  7787. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  7788. spno+=sparray.ElementAt (i).ElementAt (5);
  7789. if(0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7790. spno+="; ";
  7791. else
  7792. {
  7793. spno+=":";
  7794. spno+=sparray.ElementAt (i).ElementAt (6);
  7795. spno+="; ";
  7796. }
  7797. }
  7798. spno+=" 加挑:";
  7799. for( i=0; i<sparray.GetSize (); i++)
  7800. {
  7801. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  7802. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  7803. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  7804. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  7805. spno+=sparray.ElementAt (i).ElementAt (5);
  7806. if(0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7807. spno+="; ";
  7808. else
  7809. {
  7810. spno+=":";
  7811. spno+=sparray.ElementAt (i).ElementAt (6);
  7812. spno+="; ";
  7813. }
  7814. }
  7815. if(spno.Right (6)==" 加挑:")
  7816. {
  7817. spno=spno.Left (spno.GetLength ()-6);
  7818. }
  7819. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  7820. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  7821. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  7822. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  7823. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  7824. if(m_urgent.IsEmpty ())m_urgent="否";
  7825. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  7826. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  7827. // CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  7828. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  7829. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  7830. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  7831. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  7832. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  7833. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  7834. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  7835. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  7836. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17)+g_List1array.ElementAt (0).ElementAt (29);
  7837. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  7838. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  7839. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  7840. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  7841. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  7842. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  7843. CString m_sum3;
  7844. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  7845. ::ConvertToPrice (m_sum3);
  7846. if(m_money3.IsEmpty ())m_money3="0";
  7847. // m_money3=m_money3+"/"+m_sum3;
  7848. CString name;
  7849. if(!m_name1.IsEmpty ())
  7850. name=m_name1+",";
  7851. name+=m_name2;
  7852. name.TrimRight (",");
  7853. CString phone;
  7854. if(!m_phone1.IsEmpty ())
  7855. phone=m_phone1+",";
  7856. phone+=m_phone2;phone.TrimRight (",");
  7857. if(IsHasRights2new(31)==0)
  7858. phone="***";
  7859. CStringArray strarray;
  7860. strarray.Add (m_urgent);
  7861. strarray.Add (m_ren);
  7862. strarray.Add (m_waiter3);
  7863. strarray.Add (name);
  7864. strarray.Add (m_time2);
  7865. strarray.Add (m_time4);
  7866. strarray.Add (m_money3);
  7867. strarray.Add (m_sum3);
  7868. strarray.Add (m_takezs);
  7869. strarray.Add (m_taoxizs);
  7870. strarray.Add (m_choosezs);
  7871. strarray.Add (strOrderNumber);
  7872. strarray.Add (phone);
  7873. ////////////////////////////////////////////////////////////////
  7874. int rcpos=-1;
  7875. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  7876. Image *pImg=NULL;
  7877. #ifdef MNLS_VERSION
  7878. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  7879. #else
  7880. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  7881. #endif
  7882. m_Print.DrawImage(pImg, StrRect);
  7883. delete pImg;
  7884. m_Print.SetFontFace(11, 1, "宋体");
  7885. StrRect=load2.m_rcarray .ElementAt (7);
  7886. StrRect.top=load2.m_rcarray .ElementAt (15).top-15 ;
  7887. StrRect.bottom=load2.m_rcarray .ElementAt (15).bottom-15 ;
  7888. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  7889. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7890. StrRect.top+=15;
  7891. StrRect.bottom+=15;
  7892. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  7893. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7894. m_Print.SetFontFace(15, 1, "宋体");
  7895. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7896. #ifdef MNLS_VERSION
  7897. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7898. #endif
  7899. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7900. #ifdef MNLS_VERSION
  7901. m_Print.DrawRect(StrRect);
  7902. #endif
  7903. m_Print.SetFontFace(7, 1, "黑体");
  7904. m_Print.SetColor(0xffffff);
  7905. #ifdef MNLS_VERSION
  7906. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7907. #endif
  7908. m_Print.SetColor(0);
  7909. m_Print.SetFontFace(25, 1, "黑体");
  7910. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7911. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7912. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  7913. {
  7914. Image *pImg=NULL;
  7915. g_nSendCode=31;
  7916. int g_nYearposTemp=g_nYearpos;
  7917. g_nYearpos=-1;
  7918. g_pMainWnd->ProcessChatMessageRequest2(1);
  7919. g_nYearpos=g_nYearposTemp;
  7920. g_nSendCode=0;
  7921. if(g_bSendOK==0)return;
  7922. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7923. if(pImg)
  7924. {
  7925. StrRect.left=450;
  7926. StrRect.top=22;
  7927. StrRect.right=StrRect.left+60;
  7928. StrRect.bottom=StrRect.top+60;
  7929. m_Print.DrawImage(pImg, StrRect);
  7930. delete pImg;pImg=NULL;
  7931. }
  7932. }
  7933. #ifdef CHILD_VERSION
  7934. CString title[13]={"是否加急:","接单门市:",\
  7935. "选样人员:","客人姓名:","拍照日期:","选片日期:","加挑:","余款:",\
  7936. "拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  7937. #else
  7938. CString title[13]={"是否加急:","接单门市:",\
  7939. "选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","加挑:","余款:",\
  7940. "拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  7941. #endif
  7942. m_Print.SetFontFace(12, 1, "宋体");
  7943. for( i=0; i<13; i++)
  7944. {
  7945. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7946. if(i<3)
  7947. m_Print.DrawRect2(StrRect, 0);
  7948. else
  7949. m_Print.DrawRect2(StrRect, 1);
  7950. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7951. }
  7952. for( i=18; i<=37; i++)
  7953. {
  7954. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7955. if(i>=19&&i<=21)
  7956. m_Print.DrawRect2(StrRect, 2);
  7957. /* else if(i==26)
  7958. {
  7959. CRect rc=StrRect;
  7960. CRect rc2=rc;
  7961. rc.right -=rc2.Width ()/2;
  7962. m_Print.DrawRect2(rc, 1);
  7963. rc2.left +=rc.Width ();
  7964. m_Print.DrawRect2(rc2, 1);
  7965. }*/
  7966. else
  7967. m_Print.DrawRect2(StrRect, 1);
  7968. if(i==18)
  7969. {
  7970. StrRect.left +=5;
  7971. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7972. }
  7973. }
  7974. //////////////////////////////////////
  7975. rcpos=-1;
  7976. for( i=0; i<8; i++)
  7977. {
  7978. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  7979. m_Print.DrawRect2(StrRect, 1);
  7980. }
  7981. #ifdef CHILD_VERSION
  7982. CString title2[4]={"引导师:","摄影师:","数码设计师:","顾客设计签名:"};
  7983. #else
  7984. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客设计签名:"};
  7985. #endif
  7986. for( i=0; i<4; i++)
  7987. {
  7988. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  7989. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7990. }
  7991. for( i=0; i<4; i++)
  7992. {
  7993. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  7994. m_Print.DrawRect2(StrRect, 2);
  7995. }
  7996. StrRect=load2.m_rcarray .ElementAt (11);
  7997. StrRect.top -=15;
  7998. StrRect.bottom -=15;
  7999. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客选片签名:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8000. StrRect=load2.m_rcarray .ElementAt (15);
  8001. StrRect.top -=15;
  8002. StrRect.bottom -=15;
  8003. m_Print.DrawRect2(StrRect, 2);
  8004. ///////////////////////////////////////////
  8005. for( i=19; i<=31; i++)
  8006. {
  8007. StrRect=load.m_rcarray .ElementAt (i-1);
  8008. StrRect.left +=4;
  8009. if(i==31)
  8010. {
  8011. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  8012. {
  8013. StrRect.top +=2;
  8014. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  8015. StrRect.top +=8;
  8016. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8017. }
  8018. else
  8019. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8020. }
  8021. /* else if((i-19)==7)
  8022. {
  8023. CRect rc=StrRect;
  8024. CRect rc2=rc;
  8025. rc.right -=rc2.Width ()/2;
  8026. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8027. rc2.left +=rc.Width ()+3;
  8028. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8029. }*/
  8030. else
  8031. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8032. }
  8033. strarray.RemoveAll ();
  8034. strarray.Add (m_waiter2);
  8035. strarray.Add (m_waiter1);
  8036. strarray.Add (m_waiter4);
  8037. for( i=13; i<=15; i++)
  8038. {
  8039. StrRect=load2.m_rcarray .ElementAt (i-1);
  8040. StrRect.left +=4;
  8041. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8042. }
  8043. ///////////spno
  8044. CRect sprc[14];
  8045. for(i=0; i<14; i++)
  8046. {
  8047. if(i<7)
  8048. {
  8049. if(i==0)
  8050. {
  8051. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  8052. }
  8053. else
  8054. {
  8055. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  8056. }
  8057. }
  8058. else
  8059. {
  8060. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  8061. }
  8062. sprc[i]=StrRect;
  8063. }
  8064. CString temp,tempspno,tempbz;
  8065. CSize size;
  8066. BOOL bRun=0;
  8067. int fontsize=12;
  8068. ll: tempspno=spno;
  8069. tempbz=m_bz;
  8070. m_Print.SetFontFace(fontsize, 1, "宋体");
  8071. for( i=0; i<14; i++)
  8072. {
  8073. if(!tempspno.IsEmpty ())
  8074. {
  8075. temp=tempspno;
  8076. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8077. int right=0;
  8078. CRect temprc=sprc[i];
  8079. while(size.cx>temprc.Width ())
  8080. {
  8081. right++;
  8082. temp=tempspno.Left (tempspno.GetLength ()-(right));
  8083. if(GIsHalfHZ(temp))
  8084. {
  8085. right++;
  8086. temp.Delete (temp.GetLength ()-1);
  8087. }
  8088. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8089. }
  8090. if(bRun)
  8091. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8092. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  8093. if(tempspno.IsEmpty ())i++;
  8094. }
  8095. else if(!tempbz.IsEmpty ())
  8096. {
  8097. temp=tempbz;
  8098. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8099. int right=0;
  8100. CRect temprc=sprc[i];
  8101. while(size.cx>temprc.Width ())
  8102. {
  8103. right++;
  8104. temp=tempbz.Left (tempbz.GetLength ()-(right));
  8105. if(GIsHalfHZ(temp))
  8106. {
  8107. right++;
  8108. temp.Delete (temp.GetLength ()-1);
  8109. }
  8110. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8111. }
  8112. if(bRun)
  8113. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8114. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  8115. }
  8116. }
  8117. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  8118. {
  8119. fontsize--;
  8120. goto ll;
  8121. }
  8122. if(bRun==0)
  8123. {
  8124. bRun=1;
  8125. goto ll;
  8126. }
  8127. PrintPreview dlg;
  8128. dlg.m_mode=2;
  8129. dlg.m_name =name;
  8130. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  8131. dlg.m_pDC =m_Print.GetPDC() ;
  8132. if(aa==0)
  8133. {
  8134. if(dlg.DoModal ()!=IDOK)
  8135. return;
  8136. printcot=dlg.m_num;
  8137. }
  8138. //结束打印
  8139. m_Print.EndPage();
  8140. m_Print.EndPrint();
  8141. }
  8142. }
  8143. void CMainFrame::PrintFlowChart3LKAY(CString strOrderNumber)
  8144. {
  8145. int printcot=1;
  8146. for(int aa=0; aa<printcot; aa++)
  8147. {
  8148. CPrintRX m_Print;
  8149. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8150. {
  8151. m_Print.InitToPrint(NULL, 1);
  8152. }
  8153. else
  8154. {
  8155. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  8156. if(name.IsEmpty ())
  8157. m_Print.InitToPrint(NULL, 1);
  8158. else
  8159. {
  8160. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8161. if(nret==-1 && aa==0)
  8162. {
  8163. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8164. }
  8165. }
  8166. }
  8167. m_Print.StartPrint();
  8168. m_Print.StartPage();
  8169. LoadRect load;
  8170. load.SetLiaPath ("18.lia");
  8171. load.SetMargins(10,0);
  8172. if(!load.Load ())return;
  8173. CString str;
  8174. int rcpos=-1;
  8175. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  8176. m_Print.SetFontFace(25, 1, "宋体");
  8177. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8178. m_Print.SetFontFace(15, 1, "宋体");
  8179. StrRect=load.m_rcarray .ElementAt (++rcpos);
  8180. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8181. m_Print.SetFontFace(9, 1, "宋体");
  8182. //////////////////////////////////////////////////////////////
  8183. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2';id='"+strOrderNumber+"'";
  8184. g_sendhead.code[0]=54;
  8185. g_sendhead.code[1]=223;
  8186. g_sendhead.code[2]=52;
  8187. g_sendhead.tabcount=3;
  8188. g_sendhead.bsql=0;
  8189. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  8190. CArray<CStringArray, CStringArray>sparray;
  8191. CArray<CStringArray, CStringArray>clientarray;
  8192. DataToArray(&g_List1array,&sparray,&clientarray);
  8193. CString spno;
  8194. CStringArray sparray2;
  8195. for(int i=0; i<sparray.GetSize (); i++)
  8196. {
  8197. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8198. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  8199. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8200. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8201. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8202. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  8203. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8204. sparray2.Add (sparray.ElementAt (i).ElementAt (9));
  8205. sparray2.Add (sparray.ElementAt (i).ElementAt (10));
  8206. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8207. }
  8208. for( i=0; i<sparray.GetSize (); i++)
  8209. {
  8210. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  8211. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  8212. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  8213. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8214. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8215. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  8216. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8217. sparray2.Add (sparray.ElementAt (i).ElementAt (9));
  8218. sparray2.Add (sparray.ElementAt (i).ElementAt (10));
  8219. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8220. }
  8221. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  8222. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  8223. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  8224. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  8225. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  8226. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  8227. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  8228. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  8229. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  8230. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  8231. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  8232. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  8233. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  8234. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  8235. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  8236. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  8237. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  8238. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  8239. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  8240. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  8241. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  8242. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  8243. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  8244. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  8245. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  8246. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  8247. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  8248. CString m_sum3;
  8249. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  8250. ::ConvertToPrice (m_sum3);
  8251. if(m_money3.IsEmpty ())m_money3="0";
  8252. int dty=0;
  8253. CString name;
  8254. if(!m_name1.IsEmpty ())
  8255. name=m_name1+",";
  8256. name+=m_name2;
  8257. name.TrimRight (",");
  8258. CString phone;
  8259. if(!m_phone1.IsEmpty ())
  8260. phone=m_phone1+",";
  8261. phone+=m_phone2;phone.TrimRight (",");
  8262. if(IsHasRights2new(31)==0)
  8263. phone="***";
  8264. CStringArray strarray;
  8265. #ifdef CHILD_VERSION
  8266. if(m_birthday.IsEmpty ())
  8267. strarray.Add ("姓名/性别");
  8268. else
  8269. strarray.Add ("姓名/性别/年龄");
  8270. #else
  8271. strarray.Add ("客人姓名");
  8272. #endif
  8273. strarray.Add ("电话");
  8274. strarray.Add ("单号");
  8275. strarray.Add ("套系");
  8276. strarray.Add ("选样");
  8277. strarray.Add ("余款/加挑");
  8278. strarray.Add ("选片/日期");
  8279. #ifdef CHILD_VERSION
  8280. if(m_birthday.IsEmpty ())
  8281. strarray.Add (name+"/"+m_sex);
  8282. else
  8283. {
  8284. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  8285. m_birthday.Format ("%d", year+1);
  8286. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  8287. }
  8288. #else
  8289. strarray.Add (name);
  8290. #endif
  8291. strarray.Add (phone);
  8292. strarray.Add (strOrderNumber);
  8293. strarray.Add (m_taoxiname);
  8294. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8295. strarray.Add (str);
  8296. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  8297. strarray.Add (str);
  8298. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  8299. for( i=3; i<=16; i++)
  8300. {
  8301. StrRect=load.m_rcarray .ElementAt (i-1);
  8302. if(i<10)
  8303. {
  8304. m_Print.DrawRect2(StrRect, 1);
  8305. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8306. }
  8307. }
  8308. StrRect=load.m_rcarray .ElementAt (29);
  8309. m_Print.DrawRect2(StrRect, 1);
  8310. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8311. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8312. {
  8313. Image *pImg=NULL;
  8314. g_nSendCode=31;
  8315. int g_nYearposTemp=g_nYearpos;
  8316. g_nYearpos=-1;
  8317. g_pMainWnd->ProcessChatMessageRequest2(1);
  8318. g_nYearpos=g_nYearposTemp;
  8319. g_nSendCode=0;
  8320. if(g_bSendOK==0)return;
  8321. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  8322. if(pImg)
  8323. {
  8324. StrRect.left=485;
  8325. StrRect.top=12;
  8326. StrRect.right=StrRect.left+60;
  8327. StrRect.bottom=StrRect.top+60;
  8328. m_Print.DrawImage(pImg, StrRect);
  8329. delete pImg;pImg=NULL;
  8330. }
  8331. }
  8332. CArray<CRect,CRect>rcarray;
  8333. CStringArray strarray2;
  8334. for( i=10; i<=16; i++)
  8335. {
  8336. StrRect=load.m_rcarray .ElementAt (i-1);
  8337. StrRect.left +=2;
  8338. StrRect.right -=2;
  8339. StrRect.top +=2;
  8340. rcarray.Add (StrRect);
  8341. strarray2.Add (strarray.ElementAt (7+i-10));
  8342. }
  8343. if(1)
  8344. {
  8345. StrRect=load.m_rcarray .ElementAt (30);
  8346. StrRect.left +=2;
  8347. StrRect.right -=2;
  8348. StrRect.top +=2;
  8349. rcarray.Add (StrRect);
  8350. strarray2.Add (m_time6+"/"+m_time5);
  8351. }
  8352. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8353. for( i=10; i<=16; i++)
  8354. {
  8355. StrRect=load.m_rcarray .ElementAt (i-1);
  8356. if(i==10)
  8357. {
  8358. dty+=bottom-StrRect.bottom;
  8359. }
  8360. StrRect.bottom =bottom;
  8361. m_Print.DrawRect2(StrRect, 1);
  8362. }
  8363. if(1)
  8364. {
  8365. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  8366. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  8367. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  8368. }
  8369. m_Print.SetFontFace(15, 1, "宋体");
  8370. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  8371. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8372. m_Print.SetFontFace(9, 1, "宋体");
  8373. strarray.RemoveAll ();
  8374. strarray.Add ("产品名称");
  8375. strarray.Add ("数量");
  8376. strarray.Add ("P数");
  8377. strarray.Add ("张数");
  8378. strarray.Add ("照片编号");
  8379. CArray<CRect,CRect>rc2array;
  8380. int wid=25;
  8381. for( i=18; i<=22; i++)
  8382. {
  8383. StrRect=load.m_rcarray .ElementAt (i-1);
  8384. if(i==19)
  8385. {
  8386. StrRect.right =StrRect.left+wid;
  8387. }
  8388. if(i==20)
  8389. {
  8390. StrRect=load.m_rcarray .ElementAt (i-2);
  8391. StrRect.left +=wid;StrRect.right=StrRect.left;
  8392. StrRect.right +=wid;
  8393. }
  8394. if(i==21)
  8395. {
  8396. StrRect=load.m_rcarray .ElementAt (i-3);
  8397. StrRect.left +=wid*2;StrRect.right=StrRect.left;
  8398. StrRect.right +=wid;
  8399. wid=StrRect.right;
  8400. }
  8401. if(i==22)
  8402. {
  8403. StrRect=load.m_rcarray .ElementAt (i-3);
  8404. StrRect.left =wid;
  8405. }
  8406. StrRect.top +=dty;StrRect.bottom +=dty;
  8407. m_Print.DrawRect2(StrRect, 1);
  8408. StrRect.left +=2;
  8409. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8410. StrRect.left -=2;
  8411. StrRect.top =StrRect.bottom ;
  8412. StrRect.bottom +=18;
  8413. rc2array.Add (StrRect);
  8414. }
  8415. int curypos=0;
  8416. for(i=0; i<sparray2.GetSize (); i+=5)
  8417. {
  8418. rcarray.RemoveAll ();
  8419. strarray2.RemoveAll ();
  8420. for(int j=0; j<5; j++)
  8421. {
  8422. StrRect=rc2array.ElementAt (j);
  8423. StrRect.left +=2;
  8424. StrRect.right -=2;
  8425. StrRect.top +=2;
  8426. rcarray.Add (StrRect);
  8427. strarray2.Add (sparray2.ElementAt (i+j));
  8428. }
  8429. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8430. rcarray.RemoveAll ();
  8431. for( j=0; j<5; j++)
  8432. {
  8433. StrRect=rc2array.ElementAt (j);
  8434. if(j==0)
  8435. {
  8436. dty+=bottom-StrRect.bottom;
  8437. }
  8438. StrRect.bottom =bottom;
  8439. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8440. StrRect.top =StrRect.bottom ;
  8441. StrRect.bottom +=18;
  8442. rcarray.Add (StrRect);
  8443. }
  8444. rc2array.RemoveAll ();
  8445. rc2array.Copy(rcarray);
  8446. }
  8447. m_Print.SetFontFace(15, 1, "宋体");
  8448. StrRect=load.m_rcarray .ElementAt (20);
  8449. dty=curypos-StrRect.bottom+35;
  8450. StrRect.top +=dty;StrRect.bottom +=dty;
  8451. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8452. m_Print.SetFontFace(9, 1, "宋体");
  8453. rcarray.RemoveAll ();
  8454. strarray2.RemoveAll ();
  8455. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8456. StrRect.left +=2;
  8457. StrRect.right -=2;
  8458. StrRect.top +=2;
  8459. rcarray.Add (StrRect);
  8460. strarray2.Add (m_bz);
  8461. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8462. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8463. dty+=bottom-StrRect.bottom;
  8464. StrRect.bottom =bottom;
  8465. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8466. m_Print.SetFontFace(10, 1, "宋体");
  8467. StrRect=load.m_rcarray .ElementAt (22);
  8468. dty=curypos-StrRect.bottom+25;
  8469. StrRect.top +=dty;StrRect.bottom +=dty;
  8470. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  8471. if(m_edit9.IsEmpty())
  8472. {
  8473. m_edit9="\
  8474. 经确认后的照片均排入制作流程,\r\n\
  8475. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8476. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8477. }
  8478. CString info1,info2,info3;
  8479. int newlinepos=m_edit9.Find("\r\n");
  8480. if(newlinepos!=-1)
  8481. {
  8482. info1=m_edit9.Left(newlinepos);
  8483. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8484. }
  8485. newlinepos=m_edit9.Find("\r\n");
  8486. if(newlinepos!=-1)
  8487. {
  8488. info2=m_edit9.Left(newlinepos);
  8489. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8490. info3=m_edit9;
  8491. }
  8492. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8493. StrRect=load.m_rcarray .ElementAt (23);
  8494. StrRect.top +=dty;StrRect.bottom +=dty;
  8495. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8496. StrRect=load.m_rcarray .ElementAt (24);
  8497. StrRect.top +=dty;StrRect.bottom +=dty;
  8498. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8499. StrRect.top +=15;
  8500. StrRect.bottom +=15;
  8501. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8502. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  8503. StrRect=load.m_rcarray .ElementAt (25);
  8504. StrRect.top +=dty-dy;
  8505. StrRect.bottom +=dty-dy;
  8506. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8507. StrRect=load.m_rcarray .ElementAt (26);
  8508. StrRect.top +=dty-dy;
  8509. StrRect.bottom +=dty-dy;
  8510. m_Print.DrawRect2(StrRect, 2);
  8511. StrRect=load.m_rcarray .ElementAt (25);
  8512. StrRect.top +=dty+15-dy;
  8513. StrRect.bottom +=dty+15-dy;
  8514. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8515. StrRect=load.m_rcarray .ElementAt (26);
  8516. StrRect.top +=dty+15-dy;
  8517. StrRect.bottom +=dty+15-dy;
  8518. m_Print.DrawRect2(StrRect, 2);
  8519. StrRect=load.m_rcarray .ElementAt (25);
  8520. StrRect.top +=dty+15*2-dy;
  8521. StrRect.bottom +=dty+15*2-dy;
  8522. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8523. StrRect=load.m_rcarray .ElementAt (26);
  8524. StrRect.top +=dty+15*2-dy;
  8525. StrRect.bottom +=dty+15*2-dy;
  8526. m_Print.DrawRect2(StrRect, 2);
  8527. PrintPreview dlg;dlg.m_mode=2;
  8528. dlg.m_name =name;
  8529. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  8530. dlg.m_pDC =m_Print.GetPDC() ;
  8531. if(aa==0)
  8532. {
  8533. if(dlg.DoModal ()!=IDOK)
  8534. return;
  8535. printcot=dlg.m_num;
  8536. }
  8537. //结束打印
  8538. m_Print.EndPage();
  8539. m_Print.EndPrint();
  8540. }
  8541. }
  8542. void CMainFrame::PrintFlowChart3(CString strOrderNumber)
  8543. {
  8544. #ifdef LKAY_VERSION
  8545. PrintFlowChart3LKAY(strOrderNumber);
  8546. return;
  8547. #endif
  8548. int printcot=1;
  8549. for(int aa=0; aa<printcot; aa++)
  8550. {
  8551. BOOL bSecondPage=0;
  8552. int nPrintedPos=0;
  8553. for(int bb=0; bb<2; bb++)
  8554. {
  8555. if(bb && bSecondPage==0)break;
  8556. CPrintRX m_Print;
  8557. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8558. {
  8559. m_Print.InitToPrint(NULL, 1);
  8560. }
  8561. else
  8562. {
  8563. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  8564. if(name.IsEmpty ())
  8565. m_Print.InitToPrint(NULL, 1);
  8566. else
  8567. {
  8568. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8569. if(nret==-1 && aa==0)
  8570. {
  8571. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8572. }
  8573. }
  8574. }
  8575. m_Print.StartPrint();
  8576. m_Print.StartPage();
  8577. LoadRect load;
  8578. load.SetLiaPath ("18.lia");
  8579. load.SetMargins(10,0);
  8580. if(!load.Load ())return;
  8581. CString str;
  8582. int rcpos=-1;
  8583. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  8584. if( (bb==0 && bSecondPage==0) )
  8585. {
  8586. m_Print.SetFontFace(25, 1, "宋体");
  8587. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8588. m_Print.SetFontFace(15, 1, "宋体");
  8589. StrRect=load.m_rcarray .ElementAt (++rcpos);
  8590. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8591. m_Print.SetFontFace(9, 1, "宋体");
  8592. }
  8593. //////////////////////////////////////////////////////////////
  8594. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2';id='"+strOrderNumber+"'";
  8595. g_sendhead.code[0]=54;
  8596. g_sendhead.code[1]=223;
  8597. g_sendhead.code[2]=52;
  8598. g_sendhead.tabcount=3;
  8599. g_sendhead.bsql=0;
  8600. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  8601. CArray<CStringArray, CStringArray>sparray;
  8602. CArray<CStringArray, CStringArray>clientarray;
  8603. DataToArray(&g_List1array,&sparray,&clientarray);
  8604. CString spno;
  8605. CStringArray sparray2;
  8606. for(int i=0; i<sparray.GetSize (); i++)
  8607. {
  8608. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8609. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  8610. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8611. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8612. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8613. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  8614. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8615. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8616. }
  8617. for( i=0; i<sparray.GetSize (); i++)
  8618. {
  8619. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  8620. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  8621. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  8622. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8623. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8624. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  8625. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8626. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8627. }
  8628. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  8629. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  8630. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  8631. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  8632. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  8633. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  8634. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  8635. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  8636. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  8637. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  8638. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  8639. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  8640. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  8641. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  8642. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  8643. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  8644. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  8645. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  8646. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  8647. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  8648. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  8649. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  8650. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  8651. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  8652. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  8653. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  8654. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  8655. CString m_sum3;
  8656. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  8657. ::ConvertToPrice (m_sum3);
  8658. if(m_money3.IsEmpty ())m_money3="0";
  8659. int dty=0;
  8660. CString name;
  8661. if(!m_name1.IsEmpty ())
  8662. name=m_name1+",";
  8663. name+=m_name2;
  8664. name.TrimRight (",");
  8665. CString phone;
  8666. if(!m_phone1.IsEmpty ())
  8667. phone=m_phone1+",";
  8668. phone+=m_phone2;phone.TrimRight (",");
  8669. if(IsHasRights2new(31)==0)
  8670. phone="***";
  8671. CStringArray strarray;
  8672. CArray<CRect,CRect>rcarray;
  8673. CStringArray strarray2; CArray<CRect,CRect>rc2array;
  8674. int bottom;
  8675. if( (bb==0 && bSecondPage==0) )
  8676. {
  8677. #ifdef CHILD_VERSION
  8678. if(m_birthday.IsEmpty ())
  8679. strarray.Add ("姓名/性别");
  8680. else
  8681. strarray.Add ("姓名/性别/年龄");
  8682. #else
  8683. strarray.Add ("客人姓名");
  8684. #endif
  8685. strarray.Add ("电话");
  8686. strarray.Add ("单号");
  8687. strarray.Add ("套系");
  8688. strarray.Add ("选样");
  8689. strarray.Add ("余款/加挑");
  8690. strarray.Add ("选片/日期");
  8691. #ifdef CHILD_VERSION
  8692. if(m_birthday.IsEmpty ())
  8693. strarray.Add (name+"/"+m_sex);
  8694. else
  8695. {
  8696. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  8697. m_birthday.Format ("%d", year+1);
  8698. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  8699. }
  8700. #else
  8701. strarray.Add (name);
  8702. #endif
  8703. strarray.Add (phone);
  8704. strarray.Add (strOrderNumber);
  8705. strarray.Add (m_taoxiname);
  8706. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8707. strarray.Add (str);
  8708. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  8709. strarray.Add (str);
  8710. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  8711. for( i=3; i<=16; i++)
  8712. {
  8713. StrRect=load.m_rcarray .ElementAt (i-1);
  8714. if(i<10)
  8715. {
  8716. m_Print.DrawRect2(StrRect, 1);
  8717. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8718. }
  8719. }
  8720. StrRect=load.m_rcarray .ElementAt (29);
  8721. m_Print.DrawRect2(StrRect, 1);
  8722. BOOL bPrintDate=1;
  8723. #ifdef DDF_VERSION
  8724. // bPrintDate=0;
  8725. #else
  8726. if(m_time5=="" && m_time6=="")
  8727. bPrintDate=0;
  8728. #endif
  8729. if(bPrintDate)
  8730. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8731. else
  8732. {
  8733. #ifdef CHILD_VERSION
  8734. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8735. #else
  8736. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8737. #endif
  8738. }
  8739. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8740. {
  8741. Image *pImg=NULL;
  8742. g_nSendCode=31;
  8743. int g_nYearposTemp=g_nYearpos;
  8744. g_nYearpos=-1;
  8745. g_pMainWnd->ProcessChatMessageRequest2(1);
  8746. g_nYearpos=g_nYearposTemp;
  8747. g_nSendCode=0;
  8748. if(g_bSendOK==0)return;
  8749. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  8750. if(pImg)
  8751. {
  8752. StrRect.left=485;
  8753. StrRect.top=12;
  8754. StrRect.right=StrRect.left+60;
  8755. StrRect.bottom=StrRect.top+60;
  8756. m_Print.DrawImage(pImg, StrRect);
  8757. delete pImg;pImg=NULL;
  8758. }
  8759. }
  8760. // CArray<CRect,CRect>rcarray;
  8761. // CStringArray strarray2;
  8762. for( i=10; i<=16; i++)
  8763. {
  8764. StrRect=load.m_rcarray .ElementAt (i-1);
  8765. StrRect.left +=2;
  8766. StrRect.right -=2;
  8767. StrRect.top +=2;
  8768. rcarray.Add (StrRect);
  8769. strarray2.Add (strarray.ElementAt (7+i-10));
  8770. }
  8771. if(1)
  8772. {
  8773. StrRect=load.m_rcarray .ElementAt (30);
  8774. StrRect.left +=2;
  8775. StrRect.right -=2;
  8776. StrRect.top +=2;
  8777. rcarray.Add (StrRect);
  8778. if(bPrintDate)
  8779. strarray2.Add (m_time6+"/"+m_time5);
  8780. else
  8781. {
  8782. strarray2.Add (m_waiter1+"/"+m_waiter2);
  8783. }
  8784. }
  8785. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8786. for( i=10; i<=16; i++)
  8787. {
  8788. StrRect=load.m_rcarray.ElementAt (i-1);
  8789. if(i==10)
  8790. {
  8791. dty+=bottom-StrRect.bottom;
  8792. }
  8793. StrRect.bottom =bottom;
  8794. m_Print.DrawRect2(StrRect, 1);
  8795. }
  8796. if(1)
  8797. {
  8798. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  8799. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  8800. }
  8801. m_Print.SetFontFace(15, 1, "宋体");
  8802. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  8803. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8804. }
  8805. int curypos=0;
  8806. int oldpos=0;
  8807. if(bb==1)
  8808. {
  8809. dty=-100;
  8810. oldpos=nPrintedPos;
  8811. if(oldpos==0)oldpos=10000;
  8812. }
  8813. m_Print.SetFontFace(9, 1, "宋体");
  8814. strarray.RemoveAll ();
  8815. if((oldpos!=10000&&oldpos<sparray2.GetSize ()) || bb==0)
  8816. {
  8817. strarray.Add ("产品名称");
  8818. strarray.Add ("数量");
  8819. strarray.Add ("照片编号");
  8820. for( i=18; i<=20; i++)
  8821. {
  8822. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  8823. m_Print.DrawRect2(StrRect, 1);
  8824. StrRect.left +=2;
  8825. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8826. StrRect.left -=2;
  8827. StrRect.top =StrRect.bottom ;
  8828. StrRect.bottom +=18;
  8829. rc2array.Add (StrRect);
  8830. }
  8831. }
  8832. for(i=oldpos; i<sparray2.GetSize (); i+=3)
  8833. {
  8834. rcarray.RemoveAll ();
  8835. strarray2.RemoveAll ();
  8836. for(int j=0; j<3; j++)
  8837. {
  8838. StrRect=rc2array.ElementAt (j);
  8839. StrRect.left +=2;
  8840. StrRect.right -=2;
  8841. StrRect.top +=2;
  8842. rcarray.Add (StrRect);
  8843. strarray2.Add (sparray2.ElementAt (i+j));
  8844. }
  8845. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8846. rcarray.RemoveAll ();
  8847. for( j=0; j<3; j++)
  8848. {
  8849. StrRect=rc2array.ElementAt (j);
  8850. if(j==0)
  8851. {
  8852. dty+=bottom-StrRect.bottom;
  8853. }
  8854. StrRect.bottom =bottom;
  8855. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8856. StrRect.top =StrRect.bottom ;
  8857. StrRect.bottom +=18;
  8858. rcarray.Add (StrRect);
  8859. }
  8860. rc2array.RemoveAll ();
  8861. rc2array.Copy(rcarray);
  8862. if(bottom>750)
  8863. {
  8864. bSecondPage=1;
  8865. nPrintedPos=i+3;
  8866. break;
  8867. }
  8868. }
  8869. if( (bb==0 && bSecondPage==0) || (bb==1 && bSecondPage==1) )
  8870. {
  8871. m_Print.SetFontFace(15, 1, "宋体");
  8872. StrRect=load.m_rcarray .ElementAt (20);
  8873. dty=curypos-StrRect.bottom+35;
  8874. StrRect.top +=dty;StrRect.bottom +=dty;
  8875. if(StrRect.bottom>700 && bb==0)
  8876. {
  8877. bSecondPage=1;
  8878. }
  8879. else
  8880. {
  8881. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8882. m_Print.SetFontFace(9, 1, "宋体");
  8883. rcarray.RemoveAll ();
  8884. strarray2.RemoveAll ();
  8885. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8886. StrRect.left +=2;
  8887. StrRect.right -=2;
  8888. StrRect.top +=2;
  8889. rcarray.Add (StrRect);
  8890. strarray2.Add (m_bz);
  8891. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8892. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8893. dty+=bottom-StrRect.bottom;
  8894. StrRect.bottom =bottom;
  8895. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8896. m_Print.SetFontFace(10, 1, "宋体");
  8897. StrRect=load.m_rcarray .ElementAt (22);
  8898. dty=curypos-StrRect.bottom+25;
  8899. StrRect.top +=dty;StrRect.bottom +=dty;
  8900. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  8901. if(m_edit9.IsEmpty())
  8902. {
  8903. m_edit9="\
  8904. 经确认后的照片均排入制作流程,\r\n\
  8905. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8906. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8907. }
  8908. CString info1,info2,info3;
  8909. int newlinepos=m_edit9.Find("\r\n");
  8910. if(newlinepos!=-1)
  8911. {
  8912. info1=m_edit9.Left(newlinepos);
  8913. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8914. }
  8915. newlinepos=m_edit9.Find("\r\n");
  8916. if(newlinepos!=-1)
  8917. {
  8918. info2=m_edit9.Left(newlinepos);
  8919. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8920. info3=m_edit9;
  8921. }
  8922. #ifdef QCH_VERSION
  8923. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8924. StrRect=load.m_rcarray .ElementAt (23);
  8925. StrRect.top +=dty;StrRect.bottom +=dty;
  8926. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8927. StrRect=load.m_rcarray .ElementAt (24);
  8928. StrRect.top +=dty;StrRect.bottom +=dty;
  8929. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8930. StrRect.top +=15;
  8931. StrRect.bottom +=15;
  8932. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8933. #else
  8934. if(1)
  8935. {
  8936. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8937. StrRect=load.m_rcarray .ElementAt (23);
  8938. StrRect.top +=dty;StrRect.bottom +=dty;
  8939. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8940. StrRect=load.m_rcarray .ElementAt (24);
  8941. StrRect.top +=dty;StrRect.bottom +=dty;
  8942. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8943. }
  8944. else
  8945. {
  8946. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8947. StrRect=load.m_rcarray .ElementAt (23);
  8948. StrRect.top +=dty;StrRect.bottom +=dty;
  8949. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8950. StrRect=load.m_rcarray .ElementAt (24);
  8951. StrRect.top +=dty;StrRect.bottom +=dty;
  8952. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8953. }
  8954. StrRect.top +=15;
  8955. StrRect.bottom +=15;
  8956. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8957. #endif
  8958. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  8959. StrRect=load.m_rcarray .ElementAt (25);
  8960. StrRect.top +=dty-dy;
  8961. StrRect.bottom +=dty-dy;
  8962. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8963. StrRect=load.m_rcarray .ElementAt (26);
  8964. StrRect.top +=dty-dy;
  8965. StrRect.bottom +=dty-dy;
  8966. m_Print.DrawRect2(StrRect, 2);
  8967. StrRect=load.m_rcarray .ElementAt (25);
  8968. StrRect.top +=dty+15-dy;
  8969. StrRect.bottom +=dty+15-dy;
  8970. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8971. StrRect=load.m_rcarray .ElementAt (26);
  8972. StrRect.top +=dty+15-dy;
  8973. StrRect.bottom +=dty+15-dy;
  8974. m_Print.DrawRect2(StrRect, 2);
  8975. StrRect=load.m_rcarray .ElementAt (25);
  8976. StrRect.top +=dty+15*2-dy;
  8977. StrRect.bottom +=dty+15*2-dy;
  8978. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8979. StrRect=load.m_rcarray .ElementAt (26);
  8980. StrRect.top +=dty+15*2-dy;
  8981. StrRect.bottom +=dty+15*2-dy;
  8982. m_Print.DrawRect2(StrRect, 2);
  8983. }
  8984. }
  8985. PrintPreview dlg;dlg.m_mode=2;
  8986. dlg.m_name =name;
  8987. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  8988. dlg.m_pDC =m_Print.GetPDC() ;
  8989. if(aa==0)
  8990. {
  8991. if(dlg.DoModal ()!=IDOK)
  8992. return;
  8993. printcot=dlg.m_num;
  8994. }
  8995. //结束打印
  8996. m_Print.EndPage();
  8997. m_Print.EndPrint();
  8998. }
  8999. }
  9000. }
  9001. /*
  9002. void CMainFrame::PrintFlowChart3(CString m_id)
  9003. {
  9004. #ifdef LKAY_VERSION
  9005. PrintFlowChart3LKAY(m_id);
  9006. return;
  9007. #endif
  9008. int printcot=1;
  9009. for(int aa=0; aa<printcot; aa++)
  9010. {
  9011. CPrintRX m_Print;
  9012. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9013. {
  9014. m_Print.InitToPrint(NULL, 1);
  9015. }
  9016. else
  9017. {
  9018. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  9019. if(name.IsEmpty ())
  9020. m_Print.InitToPrint(NULL, 1);
  9021. else
  9022. {
  9023. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9024. if(nret==-1 && aa==0)
  9025. {
  9026. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9027. }
  9028. }
  9029. }
  9030. m_Print.StartPrint();
  9031. m_Print.StartPage();
  9032. LoadRect load;
  9033. load.SetLiaPath ("18.lia");
  9034. load.SetMargins(10,0);
  9035. if(!load.Load ())return;
  9036. CString str;
  9037. int rcpos=-1;
  9038. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9039. m_Print.SetFontFace(25, 1, "宋体");
  9040. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9041. m_Print.SetFontFace(15, 1, "宋体");
  9042. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9043. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9044. m_Print.SetFontFace(9, 1, "宋体");
  9045. //////////////////////////////////////////////////////////////
  9046. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9047. g_sendhead.code[0]=54;
  9048. g_sendhead.code[1]=50;
  9049. g_sendhead.code[2]=52;
  9050. g_sendhead.tabcount=3;
  9051. g_sendhead.bsql=0;
  9052. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9053. CArray<CStringArray, CStringArray>sparray;
  9054. CArray<CStringArray, CStringArray>clientarray;
  9055. DataToArray(&g_List1array,&sparray,&clientarray);
  9056. CString spno;
  9057. CStringArray sparray2;
  9058. for(int i=0; i<sparray.GetSize (); i++)
  9059. {
  9060. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9061. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9062. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9063. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9064. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9065. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9066. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9067. }
  9068. for( i=0; i<sparray.GetSize (); i++)
  9069. {
  9070. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9071. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9072. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9073. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9074. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9075. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9076. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9077. }
  9078. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9079. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9080. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9081. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9082. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9083. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9084. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9085. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9086. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9087. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9088. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9089. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9090. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9091. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9092. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9093. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9094. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9095. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9096. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  9097. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  9098. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9099. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9100. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9101. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9102. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9103. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9104. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9105. CString m_sum3;
  9106. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9107. ::ConvertToPrice (m_sum3);
  9108. if(m_money3.IsEmpty ())m_money3="0";
  9109. int dty=0;
  9110. CString name;
  9111. if(!m_name1.IsEmpty ())
  9112. name=m_name1+",";
  9113. name+=m_name2;
  9114. name.TrimRight (",");
  9115. CString phone;
  9116. if(!m_phone1.IsEmpty ())
  9117. phone=m_phone1+",";
  9118. phone+=m_phone2;phone.TrimRight (",");
  9119. if(IsHasRights2new(31)==0)
  9120. phone="***";
  9121. CStringArray strarray;
  9122. #ifdef CHILD_VERSION
  9123. if(m_birthday.IsEmpty ())
  9124. strarray.Add ("姓名/性别");
  9125. else
  9126. strarray.Add ("姓名/性别/年龄");
  9127. #else
  9128. strarray.Add ("客人姓名");
  9129. #endif
  9130. strarray.Add ("电话");
  9131. strarray.Add ("单号");
  9132. strarray.Add ("套系");
  9133. strarray.Add ("选样");
  9134. strarray.Add ("余款/加挑");
  9135. strarray.Add ("选片/日期");
  9136. #ifdef CHILD_VERSION
  9137. if(m_birthday.IsEmpty ())
  9138. strarray.Add (name+"/"+m_sex);
  9139. else
  9140. {
  9141. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9142. m_birthday.Format ("%d", year+1);
  9143. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9144. }
  9145. #else
  9146. strarray.Add (name);
  9147. #endif
  9148. strarray.Add (phone);
  9149. strarray.Add (m_id);
  9150. strarray.Add (m_taoxiname);
  9151. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9152. strarray.Add (str);
  9153. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9154. strarray.Add (str);
  9155. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  9156. for( i=3; i<=16; i++)
  9157. {
  9158. StrRect=load.m_rcarray .ElementAt (i-1);
  9159. if(i<10)
  9160. {
  9161. m_Print.DrawRect2(StrRect, 1);
  9162. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9163. }
  9164. }
  9165. StrRect=load.m_rcarray .ElementAt (29);
  9166. m_Print.DrawRect2(StrRect, 1);
  9167. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9168. CArray<CRect,CRect>rcarray;
  9169. CStringArray strarray2;
  9170. for( i=10; i<=16; i++)
  9171. {
  9172. StrRect=load.m_rcarray .ElementAt (i-1);
  9173. StrRect.left +=2;
  9174. StrRect.right -=2;
  9175. StrRect.top +=2;
  9176. rcarray.Add (StrRect);
  9177. strarray2.Add (strarray.ElementAt (7+i-10));
  9178. }
  9179. if(1)
  9180. {
  9181. StrRect=load.m_rcarray .ElementAt (30);
  9182. StrRect.left +=2;
  9183. StrRect.right -=2;
  9184. StrRect.top +=2;
  9185. rcarray.Add (StrRect);
  9186. strarray2.Add (m_time6+"/"+m_time5);
  9187. }
  9188. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9189. for( i=10; i<=16; i++)
  9190. {
  9191. StrRect=load.m_rcarray .ElementAt (i-1);
  9192. if(i==10)
  9193. {
  9194. dty+=bottom-StrRect.bottom;
  9195. }
  9196. StrRect.bottom =bottom;
  9197. m_Print.DrawRect2(StrRect, 1);
  9198. }
  9199. if(1)
  9200. {
  9201. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9202. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9203. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  9204. }
  9205. m_Print.SetFontFace(15, 1, "宋体");
  9206. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9207. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9208. m_Print.SetFontFace(9, 1, "宋体");
  9209. strarray.RemoveAll ();
  9210. strarray.Add ("产品名称");
  9211. strarray.Add ("数量");
  9212. strarray.Add ("照片编号");
  9213. CArray<CRect,CRect>rc2array;
  9214. for( i=18; i<=20; i++)
  9215. {
  9216. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9217. m_Print.DrawRect2(StrRect, 1);
  9218. StrRect.left +=2;
  9219. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9220. StrRect.left -=2;
  9221. StrRect.top =StrRect.bottom ;
  9222. StrRect.bottom +=18;
  9223. rc2array.Add (StrRect);
  9224. }
  9225. int curypos=0;
  9226. for(i=0; i<sparray2.GetSize (); i+=3)
  9227. {
  9228. rcarray.RemoveAll ();
  9229. strarray2.RemoveAll ();
  9230. for(int j=0; j<3; j++)
  9231. {
  9232. StrRect=rc2array.ElementAt (j);
  9233. StrRect.left +=2;
  9234. StrRect.right -=2;
  9235. StrRect.top +=2;
  9236. rcarray.Add (StrRect);
  9237. strarray2.Add (sparray2.ElementAt (i+j));
  9238. }
  9239. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9240. rcarray.RemoveAll ();
  9241. for( j=0; j<3; j++)
  9242. {
  9243. StrRect=rc2array.ElementAt (j);
  9244. if(j==0)
  9245. {
  9246. dty+=bottom-StrRect.bottom;
  9247. }
  9248. StrRect.bottom =bottom;
  9249. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9250. StrRect.top =StrRect.bottom ;
  9251. StrRect.bottom +=18;
  9252. rcarray.Add (StrRect);
  9253. }
  9254. rc2array.RemoveAll ();
  9255. rc2array.Copy(rcarray);
  9256. }
  9257. m_Print.SetFontFace(15, 1, "宋体");
  9258. StrRect=load.m_rcarray .ElementAt (20);
  9259. dty=curypos-StrRect.bottom+35;
  9260. StrRect.top +=dty;StrRect.bottom +=dty;
  9261. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9262. m_Print.SetFontFace(9, 1, "宋体");
  9263. rcarray.RemoveAll ();
  9264. strarray2.RemoveAll ();
  9265. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9266. StrRect.left +=2;
  9267. StrRect.right -=2;
  9268. StrRect.top +=2;
  9269. rcarray.Add (StrRect);
  9270. strarray2.Add (m_bz);
  9271. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9272. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9273. dty+=bottom-StrRect.bottom;
  9274. StrRect.bottom =bottom;
  9275. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9276. m_Print.SetFontFace(10, 1, "宋体");
  9277. StrRect=load.m_rcarray .ElementAt (22);
  9278. dty=curypos-StrRect.bottom+25;
  9279. StrRect.top +=dty;StrRect.bottom +=dty;
  9280. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9281. if(m_edit9.IsEmpty())
  9282. {
  9283. m_edit9="\
  9284. 经确认后的照片均排入制作流程,\r\n\
  9285. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9286. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9287. }
  9288. CString info1,info2,info3;
  9289. int newlinepos=m_edit9.Find("\r\n");
  9290. if(newlinepos!=-1)
  9291. {
  9292. info1=m_edit9.Left(newlinepos);
  9293. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9294. }
  9295. newlinepos=m_edit9.Find("\r\n");
  9296. if(newlinepos!=-1)
  9297. {
  9298. info2=m_edit9.Left(newlinepos);
  9299. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9300. info3=m_edit9;
  9301. }
  9302. #ifdef QCH_VERSION
  9303. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9304. StrRect=load.m_rcarray .ElementAt (23);
  9305. StrRect.top +=dty;StrRect.bottom +=dty;
  9306. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9307. StrRect=load.m_rcarray .ElementAt (24);
  9308. StrRect.top +=dty;StrRect.bottom +=dty;
  9309. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9310. StrRect.top +=15;
  9311. StrRect.bottom +=15;
  9312. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9313. #else
  9314. if(1)
  9315. {
  9316. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9317. StrRect=load.m_rcarray .ElementAt (23);
  9318. StrRect.top +=dty;StrRect.bottom +=dty;
  9319. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9320. StrRect=load.m_rcarray .ElementAt (24);
  9321. StrRect.top +=dty;StrRect.bottom +=dty;
  9322. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9323. }
  9324. else
  9325. {
  9326. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9327. StrRect=load.m_rcarray .ElementAt (23);
  9328. StrRect.top +=dty;StrRect.bottom +=dty;
  9329. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9330. StrRect=load.m_rcarray .ElementAt (24);
  9331. StrRect.top +=dty;StrRect.bottom +=dty;
  9332. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9333. }
  9334. StrRect.top +=15;
  9335. StrRect.bottom +=15;
  9336. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9337. #endif
  9338. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  9339. StrRect=load.m_rcarray .ElementAt (25);
  9340. StrRect.top +=dty-dy;
  9341. StrRect.bottom +=dty-dy;
  9342. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9343. StrRect=load.m_rcarray .ElementAt (26);
  9344. StrRect.top +=dty-dy;
  9345. StrRect.bottom +=dty-dy;
  9346. m_Print.DrawRect2(StrRect, 2);
  9347. StrRect=load.m_rcarray .ElementAt (25);
  9348. StrRect.top +=dty+15-dy;
  9349. StrRect.bottom +=dty+15-dy;
  9350. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9351. StrRect=load.m_rcarray .ElementAt (26);
  9352. StrRect.top +=dty+15-dy;
  9353. StrRect.bottom +=dty+15-dy;
  9354. m_Print.DrawRect2(StrRect, 2);
  9355. StrRect=load.m_rcarray .ElementAt (25);
  9356. StrRect.top +=dty+15*2-dy;
  9357. StrRect.bottom +=dty+15*2-dy;
  9358. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9359. StrRect=load.m_rcarray .ElementAt (26);
  9360. StrRect.top +=dty+15*2-dy;
  9361. StrRect.bottom +=dty+15*2-dy;
  9362. m_Print.DrawRect2(StrRect, 2);
  9363. PrintPreview dlg;dlg.m_mode=2;
  9364. dlg.m_name =name;
  9365. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9366. dlg.m_pDC =m_Print.GetPDC() ;
  9367. if(aa==0)
  9368. {
  9369. if(dlg.DoModal ()!=IDOK)
  9370. return;
  9371. printcot=dlg.m_num;
  9372. }
  9373. //结束打印
  9374. m_Print.EndPage();
  9375. m_Print.EndPrint();
  9376. }
  9377. }
  9378. */
  9379. void CMainFrame::PrintFlowChart4(CString m_id)
  9380. {
  9381. int printcot=1;
  9382. for(int aa=0; aa<printcot; aa++)
  9383. {
  9384. CPrintRX m_Print;
  9385. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9386. {
  9387. m_Print.InitToPrint(NULL, 1);
  9388. }
  9389. else
  9390. {
  9391. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  9392. if(name.IsEmpty ())
  9393. m_Print.InitToPrint(NULL, 1);
  9394. else
  9395. {
  9396. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9397. if(nret==-1 && aa==0)
  9398. {
  9399. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9400. }
  9401. }
  9402. }
  9403. m_Print.StartPrint();
  9404. m_Print.StartPage();
  9405. LoadRect load;
  9406. load.SetLiaPath ("18.lia");
  9407. load.SetMargins(10,0);
  9408. if(!load.Load ())return;
  9409. CString str;
  9410. int rcpos=-1;
  9411. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9412. m_Print.SetFontFace(25, 1, "宋体");
  9413. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9414. m_Print.SetFontFace(15, 1, "宋体");
  9415. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9416. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9417. m_Print.SetFontFace(9, 1, "宋体");
  9418. //////////////////////////////////////////////////////////////
  9419. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9420. g_sendhead.code[0]=54;
  9421. g_sendhead.code[1]=223;
  9422. g_sendhead.code[2]=52;
  9423. g_sendhead.tabcount=3;
  9424. g_sendhead.bsql=0;
  9425. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9426. CArray<CStringArray, CStringArray>sparray;
  9427. CArray<CStringArray, CStringArray>clientarray;
  9428. DataToArray(&g_List1array,&sparray,&clientarray);
  9429. CString spno;
  9430. CStringArray sparray2;
  9431. for(int i=0; i<sparray.GetSize (); i++)
  9432. {
  9433. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9434. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (8).IsEmpty ())continue;
  9435. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9436. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  9437. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9438. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9439. sparray2.Add (sparray.ElementAt (i).ElementAt (8));
  9440. }
  9441. for( i=0; i<sparray.GetSize (); i++)
  9442. {
  9443. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9444. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9445. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9446. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9447. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  9448. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9449. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9450. sparray2.Add (sparray.ElementAt (i).ElementAt (8));
  9451. }
  9452. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9453. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9454. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9455. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9456. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9457. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9458. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9459. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9460. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9461. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9462. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9463. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9464. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9465. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9466. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9467. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9468. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9469. CString m_bz =g_List1array.ElementAt (0).ElementAt (17);
  9470. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (25);
  9471. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9472. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9473. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9474. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9475. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9476. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9477. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9478. CString m_waiter8 = g_List1array.ElementAt (0).ElementAt (27);
  9479. CString m_replace=g_List1array.ElementAt (0).ElementAt (28);
  9480. if(!m_replace.IsEmpty ())
  9481. {
  9482. m_replace="设计替换照片:"+m_replace;
  9483. m_replace.Replace ("$", ";");
  9484. m_replace.TrimLeft (";");
  9485. m_bz+=";";
  9486. m_bz+=m_replace;
  9487. }
  9488. CString m_sum3;
  9489. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9490. ::ConvertToPrice (m_sum3);
  9491. if(m_money3.IsEmpty ())m_money3="0";
  9492. int dty=0;
  9493. CString name;
  9494. if(!m_name1.IsEmpty ())
  9495. name=m_name1+",";
  9496. name+=m_name2;
  9497. name.TrimRight (",");
  9498. CString phone;
  9499. if(!m_phone1.IsEmpty ())
  9500. phone=m_phone1+",";
  9501. phone+=m_phone2;phone.TrimRight (",");
  9502. if(IsHasRights2new(31)==0)
  9503. phone="***";
  9504. CStringArray strarray;
  9505. #ifdef CHILD_VERSION
  9506. if(m_birthday.IsEmpty ())
  9507. strarray.Add ("姓名/性别");
  9508. else
  9509. strarray.Add ("姓名/性别/年龄");
  9510. #else
  9511. strarray.Add ("客人姓名");
  9512. #endif
  9513. strarray.Add ("电话");
  9514. strarray.Add ("单号");
  9515. strarray.Add ("套系");
  9516. strarray.Add ("");
  9517. strarray.Add ("余款/加挑");
  9518. strarray.Add ("看设计/日期");
  9519. #ifdef CHILD_VERSION
  9520. if(m_birthday.IsEmpty ())
  9521. strarray.Add (name+"/"+m_sex);
  9522. else
  9523. {
  9524. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9525. m_birthday.Format ("%d", year+1);
  9526. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9527. }
  9528. #else
  9529. strarray.Add (name);
  9530. #endif
  9531. strarray.Add (phone);
  9532. strarray.Add (m_id);
  9533. strarray.Add (m_taoxiname);
  9534. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9535. strarray.Add ("");
  9536. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9537. strarray.Add (str);
  9538. strarray.Add (m_waiter8+"/"+m_time6);
  9539. //////////////////////////////////////////////
  9540. if(1)
  9541. {
  9542. StrRect=load.m_rcarray .ElementAt (6);
  9543. int addwid=StrRect.Width ()/6;
  9544. for( i=3; i<=6; i++)
  9545. {
  9546. StrRect=load.m_rcarray .ElementAt (i-1);
  9547. StrRect.left +=(i-3)*addwid;
  9548. StrRect.right +=(i-2)*addwid;
  9549. load.m_rcarray.SetAt (i-1, StrRect);
  9550. }
  9551. StrRect.left =StrRect.right =-1;
  9552. load.m_rcarray.SetAt (6, StrRect);
  9553. for( i=10; i<=13; i++)
  9554. {
  9555. StrRect=load.m_rcarray .ElementAt (i-1);
  9556. StrRect.left +=(i-10)*addwid;
  9557. StrRect.right +=(i-9)*addwid;
  9558. load.m_rcarray.SetAt (i-1, StrRect);
  9559. }
  9560. StrRect.left =StrRect.right =-1;
  9561. load.m_rcarray.SetAt (13, StrRect);
  9562. StrRect=load.m_rcarray .ElementAt (7);
  9563. int rcwid=StrRect.Width ();
  9564. StrRect.left =load.m_rcarray .ElementAt (5).right ;
  9565. StrRect.right =StrRect.left +rcwid+addwid;
  9566. load.m_rcarray.SetAt (7, StrRect);
  9567. StrRect=load.m_rcarray .ElementAt (8);
  9568. StrRect.left =load.m_rcarray .ElementAt (7).right ;
  9569. StrRect.right =load.m_rcarray .ElementAt (29).left ;
  9570. load.m_rcarray.SetAt (8, StrRect);
  9571. StrRect=load.m_rcarray .ElementAt (14);
  9572. rcwid=StrRect.Width ();
  9573. StrRect.left =load.m_rcarray .ElementAt (12).right ;
  9574. StrRect.right =StrRect.left +rcwid+addwid;
  9575. load.m_rcarray.SetAt (14, StrRect);
  9576. StrRect=load.m_rcarray .ElementAt (15);
  9577. StrRect.left =load.m_rcarray .ElementAt (14).right ;
  9578. StrRect.right =load.m_rcarray .ElementAt (29).left ;
  9579. load.m_rcarray.SetAt (15, StrRect);
  9580. }
  9581. ////////////////////////////////////////////////
  9582. for( i=3; i<=16; i++)
  9583. {
  9584. StrRect=load.m_rcarray .ElementAt (i-1);
  9585. if(i<10)
  9586. {
  9587. m_Print.DrawRect2(StrRect, 1);
  9588. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9589. }
  9590. }
  9591. StrRect=load.m_rcarray .ElementAt (29);
  9592. m_Print.DrawRect2(StrRect, 1);
  9593. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9594. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  9595. {
  9596. Image *pImg=NULL;
  9597. g_nSendCode=31;
  9598. int g_nYearposTemp=g_nYearpos;
  9599. g_nYearpos=-1;
  9600. g_pMainWnd->ProcessChatMessageRequest2(1);
  9601. g_nYearpos=g_nYearposTemp;
  9602. g_nSendCode=0;
  9603. if(g_bSendOK==0)return;
  9604. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  9605. if(pImg)
  9606. {
  9607. StrRect.left=485;
  9608. StrRect.top=12;
  9609. StrRect.right=StrRect.left+60;
  9610. StrRect.bottom=StrRect.top+60;
  9611. m_Print.DrawImage(pImg, StrRect);
  9612. delete pImg;pImg=NULL;
  9613. }
  9614. }
  9615. CArray<CRect,CRect>rcarray;
  9616. CStringArray strarray2;
  9617. for( i=10; i<=16; i++)
  9618. {
  9619. StrRect=load.m_rcarray .ElementAt (i-1);
  9620. StrRect.left +=2;
  9621. StrRect.right -=2;
  9622. StrRect.top +=2;
  9623. rcarray.Add (StrRect);
  9624. strarray2.Add (strarray.ElementAt (7+i-10));
  9625. }
  9626. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9627. for( i=10; i<=16; i++)
  9628. {
  9629. StrRect=load.m_rcarray .ElementAt (i-1);
  9630. if(i==10)
  9631. {
  9632. dty+=bottom-StrRect.bottom;
  9633. }
  9634. StrRect.bottom =bottom;
  9635. m_Print.DrawRect2(StrRect, 1);
  9636. }
  9637. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9638. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9639. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP );
  9640. m_Print.SetFontFace(15, 1, "宋体");
  9641. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9642. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9643. m_Print.SetFontFace(9, 1, "宋体");
  9644. strarray.RemoveAll ();
  9645. strarray.Add ("产品名称");
  9646. strarray.Add ("数量");
  9647. strarray.Add ("照片编号");
  9648. CArray<CRect,CRect>rc2array;
  9649. for( i=18; i<=20; i++)
  9650. {
  9651. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9652. m_Print.DrawRect2(StrRect, 1);
  9653. StrRect.left +=2;
  9654. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9655. StrRect.left -=2;
  9656. StrRect.top =StrRect.bottom ;
  9657. StrRect.bottom +=18;
  9658. rc2array.Add (StrRect);
  9659. }
  9660. int curypos=0;
  9661. for(i=0; i<sparray2.GetSize (); i+=3)
  9662. {
  9663. rcarray.RemoveAll ();
  9664. strarray2.RemoveAll ();
  9665. for(int j=0; j<3; j++)
  9666. {
  9667. StrRect=rc2array.ElementAt (j);
  9668. StrRect.left +=2;
  9669. StrRect.right -=2;
  9670. StrRect.top +=2;
  9671. rcarray.Add (StrRect);
  9672. strarray2.Add (sparray2.ElementAt (i+j));
  9673. }
  9674. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9675. rcarray.RemoveAll ();
  9676. for( j=0; j<3; j++)
  9677. {
  9678. StrRect=rc2array.ElementAt (j);
  9679. if(j==0)
  9680. {
  9681. dty+=bottom-StrRect.bottom;
  9682. }
  9683. StrRect.bottom =bottom;
  9684. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9685. StrRect.top =StrRect.bottom ;
  9686. StrRect.bottom +=18;
  9687. rcarray.Add (StrRect);
  9688. }
  9689. rc2array.RemoveAll ();
  9690. rc2array.Copy(rcarray);
  9691. }
  9692. m_Print.SetFontFace(15, 1, "宋体");
  9693. StrRect=load.m_rcarray .ElementAt (20);
  9694. dty=curypos-StrRect.bottom+35;
  9695. StrRect.top +=dty;StrRect.bottom +=dty;
  9696. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9697. m_Print.SetFontFace(9, 1, "宋体");
  9698. rcarray.RemoveAll ();
  9699. strarray2.RemoveAll ();
  9700. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9701. StrRect.left +=2;
  9702. StrRect.right -=2;
  9703. StrRect.top +=2;
  9704. rcarray.Add (StrRect);
  9705. strarray2.Add (m_bz);
  9706. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9707. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9708. dty+=bottom-StrRect.bottom;
  9709. StrRect.bottom =bottom;
  9710. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9711. m_Print.SetFontFace(10, 1, "宋体");
  9712. StrRect=load.m_rcarray .ElementAt (22);
  9713. dty=curypos-StrRect.bottom+25;
  9714. StrRect.top +=dty;StrRect.bottom +=dty;
  9715. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9716. if(m_edit9.IsEmpty())
  9717. {
  9718. m_edit9="\
  9719. 经确认后的照片均排入制作流程,\r\n\
  9720. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9721. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9722. }
  9723. CString info1,info2,info3;
  9724. int newlinepos=m_edit9.Find("\r\n");
  9725. if(newlinepos!=-1)
  9726. {
  9727. info1=m_edit9.Left(newlinepos);
  9728. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9729. }
  9730. newlinepos=m_edit9.Find("\r\n");
  9731. if(newlinepos!=-1)
  9732. {
  9733. info2=m_edit9.Left(newlinepos);
  9734. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9735. info3=m_edit9;
  9736. }
  9737. if(1)
  9738. {
  9739. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9740. StrRect=load.m_rcarray .ElementAt (23);
  9741. StrRect.top +=dty;StrRect.bottom +=dty;
  9742. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9743. StrRect=load.m_rcarray .ElementAt (24);
  9744. StrRect.top +=dty;StrRect.bottom +=dty;
  9745. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9746. }
  9747. else
  9748. {
  9749. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9750. StrRect=load.m_rcarray .ElementAt (23);
  9751. StrRect.top +=dty;StrRect.bottom +=dty;
  9752. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9753. StrRect=load.m_rcarray .ElementAt (24);
  9754. StrRect.top +=dty;StrRect.bottom +=dty;
  9755. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9756. }
  9757. StrRect=load.m_rcarray .ElementAt (25);
  9758. StrRect.top +=dty;StrRect.bottom +=dty;
  9759. m_Print.DrawText((LPTSTR)(LPCTSTR)"贵宾签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9760. StrRect=load.m_rcarray .ElementAt (26);
  9761. StrRect.top +=dty;StrRect.bottom +=dty;
  9762. m_Print.DrawRect2(StrRect, 2);
  9763. m_Print.SetFontFace(9, 1, "宋体");
  9764. StrRect=load.m_rcarray .ElementAt (27);
  9765. StrRect.top +=dty;StrRect.bottom +=dty;
  9766. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9767. StrRect=load.m_rcarray .ElementAt (28);
  9768. StrRect.top +=dty;StrRect.bottom +=dty;
  9769. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9770. PrintPreview dlg;//dlg.m_mode=2;
  9771. dlg.m_name =name;
  9772. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9773. dlg.m_pDC =m_Print.GetPDC() ;
  9774. if(aa==0)
  9775. {
  9776. if(dlg.DoModal ()!=IDOK)
  9777. return;
  9778. printcot=dlg.m_num;
  9779. }
  9780. //结束打印
  9781. m_Print.EndPage();
  9782. m_Print.EndPrint();
  9783. }
  9784. }
  9785. /*
  9786. void CMainFrame::PrintFlowChart(CString m_id)
  9787. {
  9788. CPrintRX m_Print;
  9789. m_Print.InitToPrint(NULL, 1);
  9790. m_Print.StartPrint();
  9791. m_Print.StartPage();
  9792. // CRect StrRect(0,0,560,818);
  9793. LoadRect load;
  9794. load.SetLiaPath ("4.lia");
  9795. load.SetMargins(-14,-14);
  9796. if(!load.Load ())return;
  9797. LoadRect load2;
  9798. load2.SetMargins(-14,472+27-14);
  9799. load2.SetLiaPath ("5.lia");
  9800. if(!load2.Load ())return;
  9801. //////////////////////////////////////////////////////////////
  9802. CString filter="id='"+m_id+"';id='"+m_id+"'";
  9803. g_sendhead.code[0]=54;
  9804. g_sendhead.code[1]=50;
  9805. g_sendhead.tabcount=2;
  9806. g_sendhead.bsql=0;
  9807. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9808. CArray<CStringArray, CStringArray>sparray;
  9809. DataToArray(&g_List1array,&sparray);
  9810. CString spno;
  9811. for(int i=0; i<sparray.GetSize (); i++)
  9812. {
  9813. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册")continue;
  9814. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9815. spno+=sparray.ElementAt (i).ElementAt (5);
  9816. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  9817. spno+=";";
  9818. else
  9819. {
  9820. spno+=":";
  9821. spno+=sparray.ElementAt (i).ElementAt (6);
  9822. spno+=";";
  9823. }
  9824. }
  9825. spno+=" 加挑:";
  9826. for( i=0; i<sparray.GetSize (); i++)
  9827. {
  9828. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9829. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9830. spno+=sparray.ElementAt (i).ElementAt (5);
  9831. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  9832. spno+=";";
  9833. else
  9834. {
  9835. spno+=":";
  9836. spno+=sparray.ElementAt (i).ElementAt (6);
  9837. spno+=";";
  9838. }
  9839. }
  9840. if(spno.Right (6)==" 加挑:")
  9841. {
  9842. spno=spno.Left (spno.GetLength ()-6);
  9843. }
  9844. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9845. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9846. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9847. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9848. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9849. if(m_urgent.IsEmpty ())m_urgent="否";
  9850. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9851. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9852. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9853. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9854. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9855. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9856. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9857. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9858. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9859. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9860. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9861. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17);
  9862. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9863. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9864. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9865. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9866. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9867. CString m_sum3;
  9868. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9869. ::ConvertToPrice (m_sum3);
  9870. if(m_money3.IsEmpty ())m_money3="0";
  9871. // m_money3=m_money3+"/"+m_sum3;
  9872. CString name;
  9873. if(!m_name1.IsEmpty ())
  9874. name=m_name1+",";
  9875. name+=m_name2;
  9876. name.TrimRight (",");
  9877. CString phone;
  9878. if(!m_phone1.IsEmpty ())
  9879. phone=m_phone1+",";
  9880. phone+=m_phone2;phone.TrimRight (",");
  9881. CStringArray strarray;
  9882. strarray.Add (m_urgent);
  9883. strarray.Add (m_ren);
  9884. strarray.Add (m_waiter3);
  9885. strarray.Add (name);
  9886. strarray.Add (m_time2);
  9887. strarray.Add (m_time4);
  9888. strarray.Add (m_time5);
  9889. strarray.Add (m_money3);
  9890. strarray.Add (m_takezs);
  9891. strarray.Add (m_taoxizs);
  9892. strarray.Add (m_choosezs);
  9893. strarray.Add (m_id);
  9894. strarray.Add (phone);
  9895. ////////////////////////////////////////////////////////////////
  9896. int rcpos=-1;
  9897. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9898. Image *pImg=NULL;
  9899. #ifdef MNLS_VERSION
  9900. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  9901. #else
  9902. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  9903. #endif
  9904. m_Print.DrawImage(pImg, StrRect);
  9905. delete pImg;
  9906. m_Print.SetFontFace(15, 1, "宋体");
  9907. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9908. #ifdef MNLS_VERSION
  9909. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9910. #endif
  9911. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9912. #ifdef MNLS_VERSION
  9913. m_Print.DrawRect(StrRect);
  9914. #endif
  9915. m_Print.SetFontFace(7, 1, "黑体");
  9916. m_Print.SetColor(0xffffff);
  9917. #ifdef MNLS_VERSION
  9918. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9919. #endif
  9920. m_Print.SetColor(0);
  9921. m_Print.SetFontFace(25, 1, "黑体");
  9922. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9923. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9924. CString title[13]={"是否加急:","接单门市:","选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","取件日期:","加挑/余款:","拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  9925. m_Print.SetFontFace(12, 1, "宋体");
  9926. for( i=0; i<13; i++)
  9927. {
  9928. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9929. if(i<3)
  9930. m_Print.DrawRect2(StrRect, 0);
  9931. else
  9932. m_Print.DrawRect2(StrRect, 1);
  9933. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9934. }
  9935. for( i=18; i<=37; i++)
  9936. {
  9937. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9938. if(i>=19&&i<=21)
  9939. m_Print.DrawRect2(StrRect, 2);
  9940. else if(i==26)
  9941. {
  9942. CRect rc=StrRect;
  9943. CRect rc2=rc;
  9944. rc.right -=rc2.Width ()/2;
  9945. m_Print.DrawRect2(rc, 1);
  9946. rc2.left +=rc.Width ();
  9947. m_Print.DrawRect2(rc2, 1);
  9948. }
  9949. else
  9950. m_Print.DrawRect2(StrRect, 1);
  9951. if(i==18)
  9952. {
  9953. StrRect.left +=5;
  9954. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9955. }
  9956. }
  9957. //////////////////////////////////////
  9958. rcpos=-1;
  9959. for( i=0; i<8; i++)
  9960. {
  9961. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9962. m_Print.DrawRect2(StrRect, 1);
  9963. }
  9964. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客签名:"};
  9965. for( i=0; i<4; i++)
  9966. {
  9967. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9968. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9969. }
  9970. for( i=0; i<4; i++)
  9971. {
  9972. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9973. m_Print.DrawRect2(StrRect, 2);
  9974. }
  9975. ///////////////////////////////////////////
  9976. for( i=19; i<=31; i++)
  9977. {
  9978. StrRect=load.m_rcarray .ElementAt (i-1);
  9979. StrRect.left +=4;
  9980. if(i==31)
  9981. {
  9982. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  9983. {
  9984. StrRect.top +=2;
  9985. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  9986. StrRect.top +=8;
  9987. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9988. }
  9989. else
  9990. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9991. }
  9992. else if((i-19)==7)
  9993. {
  9994. CRect rc=StrRect;
  9995. CRect rc2=rc;
  9996. rc.right -=rc2.Width ()/2;
  9997. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9998. rc2.left +=rc.Width ()+3;
  9999. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10000. }
  10001. else
  10002. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10003. }
  10004. strarray.RemoveAll ();
  10005. strarray.Add (m_waiter2);
  10006. strarray.Add (m_waiter1);
  10007. strarray.Add (m_waiter4);
  10008. for( i=13; i<=15; i++)
  10009. {
  10010. StrRect=load2.m_rcarray .ElementAt (i-1);
  10011. StrRect.left +=4;
  10012. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10013. }
  10014. ///////////spno
  10015. CRect sprc[14];
  10016. for(i=0; i<14; i++)
  10017. {
  10018. if(i<7)
  10019. {
  10020. if(i==0)
  10021. {
  10022. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  10023. }
  10024. else
  10025. {
  10026. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  10027. }
  10028. }
  10029. else
  10030. {
  10031. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  10032. }
  10033. sprc[i]=StrRect;
  10034. // m_Print.DrawText((LPTSTR)(LPCTSTR)"xxx", sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10035. }
  10036. CString temp,tempspno,tempbz;
  10037. CSize size;
  10038. BOOL bRun=0;
  10039. int fontsize=12;
  10040. ll: tempspno=spno;
  10041. tempbz=m_bz;
  10042. m_Print.SetFontFace(fontsize, 1, "宋体");
  10043. for( i=0; i<14; i++)
  10044. {
  10045. if(!tempspno.IsEmpty ())
  10046. {
  10047. temp=tempspno;
  10048. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10049. int right=0;
  10050. CRect temprc=sprc[i];
  10051. while(size.cx>temprc.Width ())
  10052. {
  10053. right++;
  10054. temp=tempspno.Left (tempspno.GetLength ()-(right));
  10055. if(GIsHalfHZ(temp))
  10056. {
  10057. right++;
  10058. temp.Delete (temp.GetLength ()-1);
  10059. }
  10060. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10061. }
  10062. if(bRun)
  10063. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10064. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  10065. if(tempspno.IsEmpty ())i++;
  10066. }
  10067. else if(!tempbz.IsEmpty ())
  10068. {
  10069. temp=tempbz;
  10070. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10071. int right=0;
  10072. CRect temprc=sprc[i];
  10073. while(size.cx>temprc.Width ())
  10074. {
  10075. right++;
  10076. temp=tempbz.Left (tempbz.GetLength ()-(right));
  10077. if(GIsHalfHZ(temp))
  10078. {
  10079. right++;
  10080. temp.Delete (temp.GetLength ()-1);
  10081. }
  10082. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10083. }
  10084. if(bRun)
  10085. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10086. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  10087. }
  10088. }
  10089. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  10090. {
  10091. fontsize--;
  10092. goto ll;
  10093. }
  10094. if(bRun==0)
  10095. {
  10096. bRun=1;
  10097. goto ll;
  10098. }
  10099. PrintPreview dlg;
  10100. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  10101. dlg.m_pDC =m_Print.GetPDC() ;
  10102. if(dlg.DoModal ()!=IDOK)return;
  10103. //结束打印
  10104. m_Print.EndPage();
  10105. m_Print.EndPrint();
  10106. }
  10107. void CMainFrame::SetSelFolder(int pos)
  10108. {
  10109. m_wndToolBar2.SetSelFolder(pos);
  10110. }*/
  10111. void CMainFrame::ToPhotoPrint()
  10112. {
  10113. UINT nID=1;
  10114. LPSTR pName ;
  10115. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  10116. OPEN_MENU(PhotoPrintFrom);
  10117. }
  10118. void CMainFrame::GetOcx()
  10119. {
  10120. char path[MAX_PATH];
  10121. ::GetSystemDirectory (path, MAX_PATH);
  10122. CString syspath=path;
  10123. try
  10124. {
  10125. if(!::PathFileExists (syspath+"\\MSCHRT20.OCX"))
  10126. {
  10127. g_sendhead.bsql=0;
  10128. g_sendhead.code[0]=103;
  10129. g_sendhead.tabcount=1;
  10130. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  10131. CFile fp;
  10132. if(fp.Open (syspath+"\\MSCHRT20.OCX", CFile::modeWrite|CFile::modeCreate))
  10133. {
  10134. fp.Write (g_pData, g_nLeng);
  10135. fp.Close ();
  10136. ::Sleep (1000);
  10137. }
  10138. }
  10139. CString temp;
  10140. temp.Format (_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10141. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10142. }
  10143. catch(...)
  10144. {
  10145. }
  10146. try
  10147. {
  10148. CString temp;
  10149. temp.Format (_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10150. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10151. }
  10152. catch(...)
  10153. {
  10154. }
  10155. }
  10156. void CMainFrame::OnServer()
  10157. {
  10158. // TODO: Add your command handler code here
  10159. DBConfig dlg;
  10160. dlg.DoModal ();
  10161. }
  10162. void CMainFrame::OnPath() // 远程访问设置;
  10163. {
  10164. // TODO: Add your command handler code here
  10165. if(g_user.bLongin==0)
  10166. {
  10167. if(g_bNoLoginLia)
  10168. {
  10169. Login dlg;
  10170. dlg.SetLiaPath ("5.lia");
  10171. dlg.DoModal();
  10172. }
  10173. else
  10174. {
  10175. Login3 dlg;
  10176. dlg.SetLiaPath ("5.lia");
  10177. dlg.DoModal();
  10178. }
  10179. if(g_user.bLongin==0)return;
  10180. }
  10181. if(IsHasRightsnew(49)==0)return;
  10182. SetPathDlg2 dlg;
  10183. dlg.DoModal ();
  10184. }
  10185. void CMainFrame::OnShowhis()
  10186. {
  10187. // TODO: Add your command handler code here
  10188. if(g_user.bLongin==0)
  10189. {
  10190. if(g_bNoLoginLia)
  10191. {
  10192. Login dlg;
  10193. dlg.SetLiaPath ("5.lia");
  10194. dlg.DoModal();
  10195. }
  10196. else
  10197. {
  10198. Login3 dlg;
  10199. dlg.SetLiaPath ("5.lia");
  10200. dlg.DoModal();
  10201. }
  10202. if(g_user.bLongin==0)return;
  10203. }
  10204. if(IsHasRightsnew(52)==0)return;
  10205. CMenu *pMenu=GetMenu();
  10206. CMenu* submenu = pMenu->GetSubMenu(2);
  10207. UINT status=submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND );
  10208. if(status&MF_CHECKED)
  10209. {
  10210. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_UNCHECKED);
  10211. g_bShowOK=1;
  10212. }
  10213. else
  10214. {
  10215. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  10216. g_bShowOK=0;
  10217. } m_Mdi.CloseAll();
  10218. }
  10219. void CMainFrame::AddHistoryMenu(CArray<CStringArray, CStringArray>*hisyeararray)
  10220. {
  10221. #ifdef NEW_SKIN
  10222. CMenu *m_menuXP=GetMenu();
  10223. CMenu* submenu = m_menuXP->GetSubMenu(2);
  10224. for(int i=0; i<100; i++)
  10225. {
  10226. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10227. }
  10228. for( i=0; i<hisyeararray->GetSize (); i++)
  10229. {
  10230. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10231. }
  10232. g_nYearpos=-1;
  10233. #else
  10234. HMENU hMenu=::GetMenu (m_hWnd);
  10235. m_menuXP.Attach (hMenu);
  10236. BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
  10237. for(int i=0; i<100; i++)
  10238. {
  10239. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10240. }
  10241. for( i=0; i<hisyeararray->GetSize (); i++)
  10242. {
  10243. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10244. }
  10245. m_menuXP.Detach ();
  10246. g_nYearpos=-1;
  10247. #endif
  10248. }
  10249. /************************************************************************/
  10250. /*
  10251. Jeff
  10252. 函数:AddBranchMenu()
  10253. 参数:CArray<CStringArray, CStringArray> *hisyeararray
  10254. 返回:void
  10255. 注意:
  10256. 调用关系:
  10257. */
  10258. /************************************************************************/
  10259. void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*hisyeararray)
  10260. {
  10261. //WriteClientLog("AddBranchMenu,添加集团版菜单");
  10262. #ifdef ENTERPRISE_VERSION
  10263. CMenu *m_menuXP=GetMenu();
  10264. CMenu* submenu = m_menuXP->GetSubMenu(0);
  10265. for(int i=0; i<100; i++)
  10266. {
  10267. submenu->DeleteMenu (2000+i, MF_BYCOMMAND);
  10268. }
  10269. g_menubranchname.RemoveAll ();
  10270. CString name;
  10271. int a=0;
  10272. #if 0 // Jeff.add for test
  10273. CString strCount;
  10274. strCount.Format("历史数据库个数=%d",hisyeararray->GetSize());
  10275. WriteClientLog(strCount);
  10276. #endif
  10277. for( i=0; i<hisyeararray->GetSize()-1; i++)
  10278. {
  10279. //WriteClientLog("111");
  10280. //WriteClientLog(hisyeararray->ElementAt(i).ElementAt(0));
  10281. //WriteClientLog(name);
  10282. if(name=="")
  10283. {
  10284. name=hisyeararray->ElementAt (i).ElementAt (0);
  10285. #ifndef SQLSERVER_VERSION
  10286. submenu->AppendMenu(MF_STRING, 2000+a, "查看分店数据:"+name+"(使用本机缓存,速度快)");
  10287. a++;
  10288. #endif
  10289. submenu->AppendMenu(MF_STRING, 2000+a, "操作分店数据:"+name+"(实时访问分店,需网络通畅)");
  10290. a++;
  10291. g_menubranchname.Add (name);
  10292. continue;
  10293. }
  10294. else if(hisyeararray->ElementAt (i).ElementAt (0).Find (name)!=-1 && ((hisyeararray->ElementAt (i).ElementAt (0).GetLength ()-name.GetLength ())==4) )
  10295. {
  10296. continue;
  10297. }
  10298. name=hisyeararray->ElementAt (i).ElementAt (0);
  10299. #ifndef SQLSERVER_VERSION
  10300. submenu->AppendMenu(MF_STRING, 2000+a, "查看分店数据:"+name+"(使用本机缓存,速度快)");
  10301. a++;
  10302. #endif
  10303. submenu->AppendMenu(MF_STRING, 2000+a, "操作分店数据:"+name+"(实时访问分店,需网络通畅)");
  10304. g_menubranchname.Add (name);
  10305. a++;
  10306. //WriteClientLog("222");
  10307. }
  10308. if((hisyeararray->GetSize()-1)>0)
  10309. {
  10310. if(hisyeararray->ElementAt (0).ElementAt (3)=="总店")
  10311. submenu->AppendMenu(MF_STRING, 2000+a, "多店数据汇总");
  10312. }
  10313. #endif
  10314. }
  10315. void CMainFrame::OnHistory(UINT nID)
  10316. {
  10317. CMenu *pMenu=GetMenu();
  10318. CMenu* submenu = pMenu->GetSubMenu(2);
  10319. UINT status=submenu->GetMenuState(nID, MF_BYCOMMAND );
  10320. if(g_user.bLongin==0)
  10321. {
  10322. if(g_bNoLoginLia)
  10323. {
  10324. Login dlg;
  10325. dlg.SetLiaPath ("5.lia");
  10326. dlg.DoModal();
  10327. }
  10328. else
  10329. {
  10330. Login3 dlg;
  10331. dlg.SetLiaPath ("5.lia");
  10332. dlg.DoModal();
  10333. }
  10334. if(g_user.bLongin==0)return;
  10335. }
  10336. if(IsHasRightsnew(52)==0)return;
  10337. m_Mdi.CloseAll();
  10338. for(int i=0; i<100; i++)
  10339. {
  10340. submenu-> CheckMenuItem(1000+i, MF_BYCOMMAND | MF_UNCHECKED);
  10341. }
  10342. if(status&MF_CHECKED)
  10343. {
  10344. g_nYearpos=-1;
  10345. status=submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND );
  10346. if(status&MF_CHECKED)
  10347. g_bShowOK=0;
  10348. else
  10349. g_bShowOK=1;
  10350. }
  10351. else
  10352. {
  10353. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10354. g_nYearpos=nID-1000;
  10355. g_bShowOK=1;
  10356. }
  10357. }
  10358. void CMainFrame::OnBranchData(UINT nID)
  10359. {
  10360. #ifdef ENTERPRISE_VERSION
  10361. #ifdef SQLSERVER_VERSION
  10362. OnBranchData2(nID);
  10363. return;
  10364. #endif
  10365. #endif
  10366. }
  10367. void CMainFrame::OnBranchData2(UINT nID)
  10368. {
  10369. #if 1
  10370. CString strMSG;
  10371. strMSG.Format("1登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10372. AfxMessageBox(strMSG);
  10373. #endif
  10374. #ifdef ENTERPRISE_VERSION
  10375. g_bAllBranch=0;
  10376. m_Mdi.CloseAll();
  10377. OnDisconnect();
  10378. CMenu *pMenu=GetMenu();
  10379. CMenu* submenu = pMenu->GetSubMenu(0);
  10380. UINT status=submenu->GetMenuState(nID, MF_BYCOMMAND );
  10381. for(int i=0; i<100; i++)
  10382. {
  10383. submenu-> CheckMenuItem(2000+i, MF_BYCOMMAND | MF_UNCHECKED);
  10384. }
  10385. if(status&MF_CHECKED) // 取消连接其他分店,回归本店连接;
  10386. {
  10387. AfxMessageBox("取消连接其他分店,回归本店连接");
  10388. g_branchname.Empty ();
  10389. g_branchip.Empty ();
  10390. g_bBranchModify=0;
  10391. g_user.bLongin=0;
  10392. if(g_bNoLoginLia)
  10393. {
  10394. Login dlg;
  10395. dlg.SetLiaPath ("5.lia");
  10396. dlg.DoModal();
  10397. }
  10398. else
  10399. {
  10400. Login3 dlg;
  10401. dlg.SetLiaPath ("5.lia");
  10402. dlg.DoModal();
  10403. }
  10404. g_pMainWnd2->RefreshOutlookBar();
  10405. g_pMainWnd2->DrawLogin();
  10406. g_path1=g_path1bak;
  10407. g_path2=g_path2bak;
  10408. g_path3=g_path3bak;
  10409. g_path4=g_path4bak;
  10410. g_path5=g_path5bak;
  10411. g_path6=g_path6bak;
  10412. g_path7=g_path7bak;
  10413. g_pMainWnd2->EnableBtns(1);
  10414. #if 1
  10415. strMSG.Format("2登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10416. AfxMessageBox(strMSG);
  10417. #endif
  10418. }
  10419. else // 连接其他分店;
  10420. {
  10421. AfxMessageBox("连接其他分店");
  10422. BOOL bNeedCheckRights=1;
  10423. if(g_user.bLongin && g_branchname=="")//无需登陆本店判断其访问分店权限
  10424. {
  10425. bNeedCheckRights=0;
  10426. }
  10427. #ifndef SQLSERVER_VERSION
  10428. if((g_menubranchname.GetSize()*2)==nID-2000)//多店数据汇总
  10429. #else
  10430. if((g_menubranchname.GetSize())==nID-2000)//多店数据汇总
  10431. #endif
  10432. {
  10433. AfxMessageBox("多店汇总");
  10434. g_branchname.Empty ();
  10435. g_branchip.Empty ();
  10436. g_bBranchModify=0;
  10437. if(bNeedCheckRights)
  10438. {
  10439. g_user.bLongin=0;
  10440. if(g_user.bLongin==0)
  10441. {
  10442. if(g_bNoLoginLia)
  10443. {
  10444. Login dlg;
  10445. dlg.SetLiaPath ("5.lia");
  10446. dlg.DoModal();
  10447. }
  10448. else
  10449. {
  10450. Login3 dlg;
  10451. dlg.SetLiaPath ("5.lia");
  10452. dlg.DoModal();
  10453. }
  10454. if(g_user.bLongin==0)return;
  10455. }
  10456. }
  10457. if(IsHasRightsnew(28)==0)
  10458. {
  10459. return;
  10460. }
  10461. g_bAllBranch=1; // 设置多店汇总标识为true;
  10462. g_pMainWnd2->ShowBar (0);
  10463. g_pMainWnd2->RefreshOutlookBar2();
  10464. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10465. g_branchname.Empty ();
  10466. g_branchip.Empty ();
  10467. g_bBranchModify=0;
  10468. g_pMainWnd2->DrawLogin();
  10469. g_pMainWnd2->EnableBtns(0);
  10470. g_path1=g_path1bak;
  10471. g_path2=g_path2bak;
  10472. g_path3=g_path3bak;
  10473. g_path4=g_path4bak;
  10474. g_path5=g_path5bak;
  10475. g_path6=g_path6bak;
  10476. g_path7=g_path7bak;
  10477. #if 1
  10478. strMSG.Format("3登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10479. AfxMessageBox(strMSG);
  10480. #endif
  10481. }
  10482. else
  10483. {
  10484. AfxMessageBox("非多店汇总");
  10485. if(bNeedCheckRights)
  10486. {
  10487. g_branchname.Empty ();
  10488. g_branchip.Empty ();
  10489. g_bBranchModify=0;
  10490. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
  10491. g_user.bLongin=0;
  10492. if(g_pMainWnd2)
  10493. {
  10494. g_pMainWnd2->DrawLogin();
  10495. g_pMainWnd2->ShowBar (0);
  10496. }
  10497. if(g_bNoLoginLia)
  10498. {
  10499. Login dlg;
  10500. dlg.SetLiaPath ("5.lia");
  10501. dlg.DoModal();
  10502. }
  10503. else
  10504. {
  10505. Login3 dlg;
  10506. dlg.SetLiaPath ("5.lia");
  10507. dlg.DoModal();
  10508. }
  10509. if(g_user.bLongin==0)return;
  10510. }
  10511. if(IsHasRightsnew(28)==0)
  10512. {
  10513. return;
  10514. }
  10515. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10516. #ifndef SQLSERVER_VERSION
  10517. if(nID%2==0)
  10518. g_branchname = g_menubranchname.ElementAt ((nID-2000)/2);
  10519. else
  10520. g_branchname = g_menubranchname.ElementAt ((nID-2001)/2);
  10521. #else
  10522. g_branchname=g_menubranchname.ElementAt(nID-2000);
  10523. #endif
  10524. g_branchip.Empty ();
  10525. CString domainname="";
  10526. for(int i=0; i<g_brancharray.GetSize(); i++)
  10527. {
  10528. if(g_branchname==g_brancharray.ElementAt (i).ElementAt (0))
  10529. {
  10530. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  10531. g_branchip2=g_brancharray.ElementAt (i).ElementAt (4);
  10532. domainname=g_brancharray.ElementAt (i).ElementAt (2);
  10533. }
  10534. }
  10535. g_path1=g_path1bak;
  10536. g_path2=g_path2bak;
  10537. g_path3=g_path3bak;
  10538. g_path4=g_path4bak;
  10539. g_path5=g_path5bak;
  10540. g_path6=g_path6bak;
  10541. g_path7=g_path7bak;
  10542. if(domainname.IsEmpty ())
  10543. {
  10544. g_path1=g_path2=g_path3=g_path4=g_path5=g_path6=g_path7="xxx";
  10545. }
  10546. else
  10547. {
  10548. g_path1+="\\"+domainname;
  10549. g_path2+="\\"+domainname;
  10550. g_path3+="\\"+domainname;
  10551. g_path4+="\\"+domainname;
  10552. g_path5+="\\"+domainname;
  10553. g_path6+="\\"+domainname;
  10554. g_path7+="\\"+domainname;
  10555. }
  10556. #if 1
  10557. strMSG.Format("2登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10558. AfxMessageBox(strMSG);
  10559. #endif
  10560. g_bBranchModify=1;
  10561. if(g_bBranchModify)OnDisconnect();
  10562. if(1)
  10563. {
  10564. g_user.bLongin=0;
  10565. g_user.name.Empty ();
  10566. g_user.rights.Empty ();
  10567. g_user.account.Empty ();
  10568. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  10569. g_pMainWnd2->RefreshOutlookBar();
  10570. m_Mdi.CloseAll();
  10571. if(g_pMainWnd2)
  10572. {
  10573. g_pMainWnd2->DrawLogin();
  10574. g_pMainWnd2->ShowBar (0);
  10575. }
  10576. if(g_bNoLoginLia)
  10577. {
  10578. Login dlg;
  10579. dlg.SetLiaPath ("5.lia");
  10580. dlg.DoModal();
  10581. }
  10582. else
  10583. {
  10584. Login3 dlg;
  10585. dlg.SetLiaPath ("5.lia");
  10586. dlg.DoModal();
  10587. }
  10588. if(g_user.bLongin==0)return;
  10589. if(g_pMainWnd2)g_pMainWnd2->ShowBar (1);
  10590. }
  10591. g_pMainWnd2->DrawLogin();
  10592. g_pMainWnd2->EnableBtns(1);
  10593. }
  10594. g_nYearpos=-1;
  10595. }
  10596. #endif
  10597. }
  10598. void CMainFrame::OnStaffAchievementShow() //Jeff:此机只用于员工看业绩;
  10599. {
  10600. // TODO: Add your command handler code here
  10601. if(g_user.bLongin==0) // 是否登陆系统;
  10602. {
  10603. if(g_bNoLoginLia)
  10604. {
  10605. Login dlg;
  10606. dlg.SetLiaPath ("5.lia");
  10607. dlg.DoModal();
  10608. }
  10609. else
  10610. {
  10611. Login3 dlg;
  10612. dlg.SetLiaPath ("5.lia");
  10613. dlg.DoModal();
  10614. }
  10615. if(g_user.bLongin==0)return;
  10616. }
  10617. if(IsHasRightsnew(49)==0)return;// 是否有权限进行设置;
  10618. CString version = _T ("Version 1.0");
  10619. CMenu *pMenu=GetMenu();
  10620. CMenu* submenu = pMenu->GetSubMenu(1);
  10621. UINT status=submenu->GetMenuState(IDM_StaffAchievementShow, MF_BYCOMMAND );
  10622. if(status&MF_CHECKED)
  10623. {
  10624. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_UNCHECKED);
  10625. AfxGetApp()->WriteProfileInt (version, "status2", 0);
  10626. g_bStaffAchievementShow=0;
  10627. TCHAR szKey[MAX_PATH];
  10628. TCHAR szDir[MAX_PATH];
  10629. ::GetModuleFileName (NULL, szDir, MAX_PATH);
  10630. HKEY hKey=0;
  10631. DWORD disp=0;
  10632. lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  10633. int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp);
  10634. if(lResult==ERROR_SUCCESS)
  10635. {
  10636. RegDeleteValue(hKey,"YLGLMAINAUTORUN");
  10637. RegDeleteKey (hKey,"YLGLMAINAUTORUN");
  10638. RegCloseKey(hKey);
  10639. }
  10640. }
  10641. else
  10642. {
  10643. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  10644. AfxGetApp()->WriteProfileInt (version, "status2", 1);
  10645. g_bStaffAchievementShow=1;
  10646. TCHAR szKey[MAX_PATH];
  10647. TCHAR szDir[MAX_PATH];
  10648. ::GetModuleFileName (NULL, szDir, MAX_PATH);
  10649. HKEY hKey=0;
  10650. DWORD disp=0;
  10651. lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  10652. int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp);
  10653. if(lResult==ERROR_SUCCESS)
  10654. {
  10655. lResult=RegSetValueEx(hKey,"YLGLMAINAUTORUN",0,REG_SZ,(const unsigned char*)szDir,lstrlen(szDir));
  10656. RegCloseKey(hKey);
  10657. }
  10658. StaffAchievementSet dlg;
  10659. dlg.DoModal ();
  10660. }
  10661. }
  10662. void CMainFrame::PrintDinDan2(CString m_id)
  10663. {
  10664. #ifdef MODERN_VERSION
  10665. SelContent seldlg;
  10666. if(seldlg.DoModal()!=IDOK)return;
  10667. CPrintRX m_Print;
  10668. m_Print.InitToPrint(NULL, 1);
  10669. m_Print.StartPrint();
  10670. m_Print.StartPage();
  10671. // CRect StrRect(0,0,560,818);
  10672. LoadRect load;
  10673. LoadRect load2;
  10674. LoadRect load3;
  10675. load.SetLiaPath ("9.lia");
  10676. load.SetMargins(-14,0);
  10677. if(!load.Load ())return;
  10678. int i;
  10679. //////////////////////////////////////////////////////////////
  10680. CStringArray txarray;
  10681. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  10682. g_sendhead.code[0]=11;
  10683. g_sendhead.code[1]=52;
  10684. g_sendhead.code[2]=50;
  10685. g_sendhead.code[3]=38;
  10686. g_sendhead.code[4]=27;
  10687. g_sendhead.tabcount=5;
  10688. g_sendhead.bsql=0;
  10689. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  10690. CArray<CStringArray, CStringArray>sparray;
  10691. CArray<CStringArray, CStringArray>clientarray;
  10692. CArray<CStringArray, CStringArray>phonearray;
  10693. CArray<CStringArray, CStringArray>bukuan2array;
  10694. CArray<CStringArray, CStringArray>bukuanarray;
  10695. DataToArray(&g_List1array, &clientarray, &sparray, &bukuan2array, &bukuanarray);
  10696. CTime tm=CTime::GetCurrentTime ();
  10697. CString str;
  10698. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  10699. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  10700. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  10701. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  10702. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  10703. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  10704. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  10705. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  10706. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  10707. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  10708. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  10709. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  10710. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  10711. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  10712. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  10713. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  10714. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  10715. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  10716. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  10717. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  10718. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  10719. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  10720. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  10721. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  10722. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  10723. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  10724. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  10725. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  10726. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  10727. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  10728. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  10729. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  10730. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  10731. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  10732. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  10733. filter="name='"+m_ren+"'";
  10734. g_sendhead.code[0]=5;
  10735. g_sendhead.tabcount=1;
  10736. g_sendhead.bsql=0;
  10737. int g_nYearposTemp=g_nYearpos;
  10738. g_nYearpos=-1;
  10739. g_pMainWnd->ProcessChatMessageRequest2(filter);
  10740. g_nYearpos=g_nYearposTemp;
  10741. if(g_bSendOK==0)return;
  10742. DataToArray(&phonearray);
  10743. m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
  10744. m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
  10745. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  10746. ConvertToPrice(m_money1);
  10747. ConvertToPrice(m_money2);
  10748. ConvertToPrice(m_money3);
  10749. ////////////////////////////////////////////////////////////////
  10750. int rcpos=-1;
  10751. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  10752. Image *pImg=NULL;
  10753. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo2.jpg");
  10754. if(seldlg.m_bFrame)
  10755. m_Print.DrawImage(pImg, StrRect);
  10756. delete pImg;
  10757. m_Print.SetFontFace(16, 1, "黑体");
  10758. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10759. if(seldlg.m_bFrame)
  10760. ///////////////////////////////不用改
  10761. m_Print.DrawText((LPTSTR)(LPCTSTR)"摩登新娘工作流程单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10762. m_Print.SetFontFace(10, 1, "宋体");
  10763. for( i=3; i<=6; i++)
  10764. {
  10765. StrRect=load.m_rcarray .ElementAt (i-1);
  10766. if(seldlg.m_bFrame)
  10767. m_Print.DrawRect2(StrRect, 1);
  10768. }
  10769. CStringArray strarray;
  10770. if(seldlg.m_bBooking==0)
  10771. {
  10772. m_name1.Empty ();
  10773. m_name2.Empty ();
  10774. m_phone1.Empty ();
  10775. m_phone2.Empty ();
  10776. m_addr1.Empty ();
  10777. m_addr2.Empty ();
  10778. m_taoxiname.Empty ();
  10779. m_taoxijiage.Empty ();
  10780. }
  10781. if(seldlg.m_bFrame )
  10782. {
  10783. strarray.Add("新郎:"+m_name1);
  10784. strarray.Add("H");
  10785. strarray.Add("O");
  10786. strarray.Add("手机:"+m_phone1);
  10787. strarray.Add("新娘:"+m_name2);
  10788. strarray.Add("H");
  10789. strarray.Add("O");
  10790. strarray.Add("手机:"+m_phone2);
  10791. }
  10792. else
  10793. {
  10794. strarray.Add(" "+m_name1);
  10795. strarray.Add("");
  10796. strarray.Add("");
  10797. strarray.Add(" "+m_phone1);
  10798. strarray.Add(" "+m_name2);
  10799. strarray.Add("");
  10800. strarray.Add("");
  10801. strarray.Add(" "+m_phone2);
  10802. }
  10803. for( i=7; i<=14; i++)
  10804. {
  10805. StrRect=load.m_rcarray .ElementAt (i-1);
  10806. StrRect.left +=2;
  10807. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10808. }
  10809. StrRect=load.m_rcarray .ElementAt (3);
  10810. StrRect.left +=2;
  10811. if(seldlg.m_bFrame)
  10812. str="地址:"+m_addr1;
  10813. else
  10814. str=" "+m_addr1;
  10815. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10816. StrRect=load.m_rcarray .ElementAt (5);
  10817. StrRect.left +=2;
  10818. if(seldlg.m_bFrame)
  10819. str="地址:"+m_addr2;
  10820. else
  10821. str=" "+m_addr2;
  10822. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10823. //////////////////////////////////////////////////////
  10824. StrRect=load.m_rcarray .ElementAt (14);
  10825. str="预\r\n约";
  10826. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10827. StrRect.top +=46;
  10828. StrRect.left +=2;
  10829. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10830. m_Print.SetFontFace(10, 1, "宋体");
  10831. StrRect=load.m_rcarray .ElementAt (15);
  10832. if(seldlg.m_bFrame)
  10833. str="套系名称:"+m_taoxiname;
  10834. else
  10835. str=" "+m_taoxiname;
  10836. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10837. StrRect.left +=4;
  10838. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10839. StrRect=load.m_rcarray .ElementAt (16);
  10840. if(seldlg.m_bFrame)
  10841. str="单价:"+m_taoxijiage;
  10842. else
  10843. str=" "+m_taoxijiage;
  10844. StrRect.left +=2;
  10845. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10846. StrRect=load.m_rcarray .ElementAt (21);
  10847. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10848. str="新人签名:";
  10849. StrRect.left +=2;
  10850. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10851. StrRect=load.m_rcarray .ElementAt (22);
  10852. if(seldlg.m_bBooking==0)
  10853. {
  10854. if(seldlg.m_bFrame)
  10855. str="未付款:";
  10856. else
  10857. str=" ";
  10858. }
  10859. else
  10860. {
  10861. if(seldlg.m_bFrame)
  10862. str="未付款:"+m_money3;
  10863. else
  10864. str=" "+m_money3;
  10865. }
  10866. StrRect.left +=2;
  10867. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10868. StrRect=load.m_rcarray .ElementAt (23);
  10869. str="结婚秘书:";
  10870. StrRect.left +=2;
  10871. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10872. StrRect=load.m_rcarray .ElementAt (24);
  10873. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10874. StrRect.left +=3;
  10875. StrRect.top +=3;
  10876. StrRect.right -=2;
  10877. StrRect.bottom -=2;
  10878. int realpos=0;str="";
  10879. for(i=0; i<sparray.GetSize (); i++)
  10880. {
  10881. if(atoi(sparray.ElementAt (i).ElementAt (4))!=1)continue;
  10882. str+=sparray.ElementAt (i).ElementAt (5);
  10883. str+=" 数量:";
  10884. str+=sparray.ElementAt (i).ElementAt (3);
  10885. if(realpos%2)
  10886. str+="\r\n";
  10887. else
  10888. str+=" ";
  10889. realpos++;
  10890. }
  10891. str.TrimRight ("\r\n");
  10892. str.TrimRight (" ");
  10893. if(seldlg.m_bBooking)AutoDraw(m_Print, StrRect, str, 1.4);
  10894. ///////////////////////////////////////////////////////////
  10895. StrRect=load.m_rcarray .ElementAt (14);
  10896. StrRect.top +=1*122;
  10897. StrRect.bottom +=1*122;
  10898. str="拍\r\n照";
  10899. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10900. StrRect.top +=46;
  10901. StrRect.left +=2;
  10902. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10903. m_Print.SetFontFace(10, 1, "宋体");
  10904. StrRect=load.m_rcarray .ElementAt (15);
  10905. StrRect.top +=1*122;
  10906. StrRect.bottom +=1*122;
  10907. str="拍照内容: 白 晚 特 便";
  10908. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10909. StrRect.left +=4;
  10910. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10911. StrRect=load.m_rcarray .ElementAt (21);
  10912. StrRect.top +=1*122;
  10913. StrRect.bottom +=1*122;
  10914. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10915. str=" 新人签名:";
  10916. StrRect.left +=2;
  10917. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10918. StrRect=load.m_rcarray .ElementAt (22);
  10919. StrRect.top +=1*122;
  10920. StrRect.bottom +=1*122;
  10921. if(seldlg.m_bTake)
  10922. {
  10923. if(seldlg.m_bFrame)
  10924. str="未付款:"+m_money3;
  10925. else
  10926. str=" "+m_money3;
  10927. }
  10928. else
  10929. {
  10930. if(seldlg.m_bFrame)
  10931. str="未付款:";
  10932. else
  10933. str=" ";
  10934. }
  10935. StrRect.left +=2;
  10936. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10937. StrRect=load.m_rcarray .ElementAt (23);
  10938. StrRect.top +=1*122;
  10939. StrRect.bottom +=1*122;
  10940. str="结婚秘书:";
  10941. StrRect.left +=2;
  10942. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10943. StrRect=load.m_rcarray .ElementAt (24);
  10944. StrRect.top +=1*122;
  10945. StrRect.bottom +=1*122;
  10946. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10947. StrRect.left +=3;
  10948. StrRect.top +=3;
  10949. StrRect.right -=2;
  10950. StrRect.bottom -=2;
  10951. if(seldlg.m_bTake)
  10952. {
  10953. str="";
  10954. for(i=0; i<bukuan2array.GetSize (); i++)
  10955. {
  10956. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=1)continue;
  10957. str+="加挑: ";
  10958. str+=bukuan2array.ElementAt (i).ElementAt (4);
  10959. str+="\r\n";
  10960. }
  10961. str.TrimRight ("\r\n");
  10962. str.TrimRight (" ");
  10963. AutoDraw(m_Print, StrRect, str, 1.4);
  10964. }
  10965. ///////////////////////////////////////////////////////////
  10966. StrRect=load.m_rcarray .ElementAt (14);
  10967. StrRect.top +=2*122;
  10968. StrRect.bottom +=2*122;
  10969. str="选\r\n样";
  10970. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10971. StrRect.top +=46;
  10972. StrRect.left +=2;
  10973. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10974. m_Print.SetFontFace(10, 1, "宋体");
  10975. StrRect=load.m_rcarray .ElementAt (15);
  10976. StrRect.top +=2*122;
  10977. StrRect.bottom +=2*122;
  10978. str="选片内容:";
  10979. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10980. StrRect.left +=4;
  10981. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10982. StrRect=load.m_rcarray .ElementAt (21);
  10983. StrRect.top +=2*122;
  10984. StrRect.bottom +=2*122;
  10985. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10986. str=" 新人签名:";
  10987. StrRect.left +=2;
  10988. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10989. StrRect=load.m_rcarray .ElementAt (22);
  10990. StrRect.top +=2*122;
  10991. StrRect.bottom +=2*122;
  10992. if(seldlg.m_bChoose)
  10993. {
  10994. if(seldlg.m_bFrame)
  10995. str="未付款:"+m_money3;
  10996. else
  10997. str=" "+m_money3;
  10998. }
  10999. else
  11000. {
  11001. if(seldlg.m_bFrame)
  11002. str="未付款:";
  11003. else
  11004. str=" ";
  11005. }
  11006. StrRect.left +=2;
  11007. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11008. StrRect=load.m_rcarray .ElementAt (23);
  11009. StrRect.top +=2*122;
  11010. StrRect.bottom +=2*122;
  11011. str="结婚秘书:";
  11012. StrRect.left +=2;
  11013. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11014. StrRect=load.m_rcarray .ElementAt (24);
  11015. StrRect.top +=2*122;
  11016. StrRect.bottom +=2*122;
  11017. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11018. if(seldlg.m_bChoose)
  11019. {
  11020. StrRect.left +=3;
  11021. StrRect.top +=3;
  11022. StrRect.right -=2;
  11023. StrRect.bottom -=2;
  11024. str="";
  11025. for(i=0; i<bukuan2array.GetSize (); i++)
  11026. {
  11027. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=2)continue;
  11028. str+="加挑: ";
  11029. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11030. str+="\r\n";
  11031. }
  11032. str.TrimRight ("\r\n");
  11033. str.TrimRight (" ");
  11034. AutoDraw(m_Print, StrRect, str, 1.4);
  11035. }
  11036. ///////////////////////////////////////////////////////////
  11037. StrRect=load.m_rcarray .ElementAt (14);
  11038. StrRect.top +=3*122;
  11039. StrRect.bottom +=3*122;
  11040. str="结\r\n婚";
  11041. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11042. StrRect.top +=46;
  11043. StrRect.left +=2;
  11044. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11045. m_Print.SetFontFace(10, 1, "宋体");
  11046. StrRect=load.m_rcarray .ElementAt (15);
  11047. StrRect.top +=3*122;
  11048. StrRect.bottom +=3*122;
  11049. str="结婚内容: 区 白 晚 押金:";
  11050. if(seldlg.m_bFrame) m_Print.DrawRect2(StrRect, 1);
  11051. StrRect.left +=4;
  11052. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11053. StrRect=load.m_rcarray .ElementAt (21);
  11054. StrRect.top +=3*122;
  11055. StrRect.bottom +=3*122;
  11056. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11057. str=" 新人签名:";
  11058. StrRect.left +=2;
  11059. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11060. StrRect=load.m_rcarray .ElementAt (22);
  11061. StrRect.top +=3*122;
  11062. StrRect.bottom +=3*122;
  11063. if(seldlg.m_bBooking)
  11064. {
  11065. if(seldlg.m_bFrame)
  11066. str="未付款:"+m_money3;
  11067. else
  11068. str=" "+m_money3;
  11069. }
  11070. else
  11071. {
  11072. if(seldlg.m_bFrame)
  11073. str="未付款:";
  11074. else
  11075. str=" ";
  11076. }
  11077. StrRect.left +=2;
  11078. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11079. StrRect=load.m_rcarray .ElementAt (23);
  11080. StrRect.top +=3*122;
  11081. StrRect.bottom +=3*122;
  11082. str="结婚秘书:";
  11083. StrRect.left +=2;
  11084. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11085. StrRect=load.m_rcarray .ElementAt (24);
  11086. StrRect.top +=3*122;
  11087. StrRect.bottom +=3*122;
  11088. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11089. if(seldlg.m_bBooking)
  11090. {
  11091. StrRect.left +=3;
  11092. StrRect.top +=3;
  11093. StrRect.right -=2;
  11094. StrRect.bottom -=2;
  11095. realpos=0;str="";
  11096. for(i=0; i<sparray.GetSize (); i++)
  11097. {
  11098. if(atoi(sparray.ElementAt (i).ElementAt (4))!=2)continue;
  11099. str+=sparray.ElementAt (i).ElementAt (5);
  11100. str+=" 数量:";
  11101. str+=sparray.ElementAt (i).ElementAt (3);
  11102. if(realpos%2)
  11103. str+="\r\n";
  11104. else
  11105. str+=" ";
  11106. realpos++;
  11107. }
  11108. str.TrimRight ("\r\n");
  11109. str.TrimRight (" ");
  11110. AutoDraw(m_Print, StrRect, str, 1.4);
  11111. }
  11112. ///////////////////////////////////////
  11113. strarray.RemoveAll ();
  11114. if(seldlg.m_bFrame)
  11115. {
  11116. strarray.Add ("项目");
  11117. strarray.Add ("万");
  11118. strarray.Add ("千");
  11119. strarray.Add ("百");
  11120. strarray.Add ("十");
  11121. strarray.Add ("个");
  11122. strarray.Add ("收 银");
  11123. }
  11124. else
  11125. {
  11126. strarray.Add ("");
  11127. strarray.Add ("");
  11128. strarray.Add ("");
  11129. strarray.Add ("");
  11130. strarray.Add ("");
  11131. strarray.Add ("");
  11132. strarray.Add ("");
  11133. }
  11134. CStringArray strarray2;
  11135. float ftotal=0;
  11136. int realcount=0;
  11137. if(seldlg.m_bBooking)
  11138. {
  11139. for(i=0; i<bukuanarray.GetSize (); i++)
  11140. {
  11141. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=3 && atoi(bukuanarray.ElementAt (i).ElementAt (6))!=4)continue;
  11142. realcount++;
  11143. if(realcount>6)break;
  11144. str=bukuanarray.ElementAt (i).ElementAt (1);
  11145. ftotal+=atof(str);
  11146. strarray2.Add (GetW(str));
  11147. strarray2.Add (GetK(str));
  11148. strarray2.Add (GetB(str));
  11149. strarray2.Add (GetS(str));
  11150. strarray2.Add (GetG(str));
  11151. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11152. }
  11153. }
  11154. while(strarray2.GetSize ()<36)
  11155. strarray2.Add ("");
  11156. str.Format ("%f", ftotal);
  11157. strarray2.Add (GetW(str));
  11158. strarray2.Add (GetK(str));
  11159. strarray2.Add (GetB(str));
  11160. strarray2.Add (GetS(str));
  11161. strarray2.Add (GetG(str));
  11162. strarray2.Add ("");
  11163. //拍照
  11164. ftotal=0;
  11165. realcount=0;
  11166. if(seldlg.m_bTake)
  11167. {
  11168. for(i=0; i<bukuanarray.GetSize (); i++)
  11169. {
  11170. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=1)continue;
  11171. realcount++;
  11172. if(realcount>6)break;
  11173. str=bukuanarray.ElementAt (i).ElementAt (1);
  11174. ftotal+=atof(str);
  11175. strarray2.Add (GetW(str));
  11176. strarray2.Add (GetK(str));
  11177. strarray2.Add (GetB(str));
  11178. strarray2.Add (GetS(str));
  11179. strarray2.Add (GetG(str));
  11180. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11181. }
  11182. }
  11183. while(strarray2.GetSize ()<42+36)
  11184. strarray2.Add ("");
  11185. str.Format ("%f", ftotal);
  11186. strarray2.Add (GetW(str));
  11187. strarray2.Add (GetK(str));
  11188. strarray2.Add (GetB(str));
  11189. strarray2.Add (GetS(str));
  11190. strarray2.Add (GetG(str));
  11191. strarray2.Add ("");
  11192. //选片
  11193. ftotal=0;
  11194. realcount=0;
  11195. if(seldlg.m_bChoose)
  11196. {
  11197. for(i=0; i<bukuanarray.GetSize (); i++)
  11198. {
  11199. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=2)continue;
  11200. realcount++;
  11201. if(realcount>6)break;
  11202. str=bukuanarray.ElementAt (i).ElementAt (1);
  11203. ftotal+=atof(str);
  11204. strarray2.Add (GetW(str));
  11205. strarray2.Add (GetK(str));
  11206. strarray2.Add (GetB(str));
  11207. strarray2.Add (GetS(str));
  11208. strarray2.Add (GetG(str));
  11209. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11210. }
  11211. }
  11212. while(strarray2.GetSize ()<42*2+36)
  11213. strarray2.Add ("");
  11214. str.Format ("%f", ftotal);
  11215. strarray2.Add (GetW(str));
  11216. strarray2.Add (GetK(str));
  11217. strarray2.Add (GetB(str));
  11218. strarray2.Add (GetS(str));
  11219. strarray2.Add (GetG(str));
  11220. strarray2.Add ("");
  11221. /////////////////////////////
  11222. CRect temprc;
  11223. for(int n=0; n<4; n++)
  11224. {
  11225. StrRect=load.m_rcarray .ElementAt (17);
  11226. StrRect.top +=n*122;
  11227. StrRect.bottom +=n*122;
  11228. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11229. StrRect=load.m_rcarray .ElementAt (18);
  11230. if(n)
  11231. {
  11232. StrRect.left +=36;
  11233. StrRect.right +=36;
  11234. }
  11235. StrRect.top +=n*122;
  11236. StrRect.bottom +=n*122;
  11237. if(seldlg.m_bFrame)
  11238. str.Format("%d年", tm.GetYear ());
  11239. else
  11240. str.Format("%d ", tm.GetYear ());
  11241. if( (seldlg.m_bBooking==0 && n==3) ||(seldlg.m_bBooking==0 && n==0) || (seldlg.m_bTake==0 && n==1) || (seldlg.m_bChoose==0 && n==2))
  11242. {
  11243. if(seldlg.m_bFrame)
  11244. str=" 年";
  11245. else
  11246. str=" ";
  11247. }
  11248. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11249. StrRect=load.m_rcarray .ElementAt (19);
  11250. if(n)
  11251. {
  11252. StrRect.left +=38;
  11253. StrRect.right +=38;
  11254. }
  11255. StrRect.top +=n*122;
  11256. StrRect.bottom +=n*122;
  11257. if(seldlg.m_bFrame)
  11258. str.Format("%02d月", tm.GetMonth ());
  11259. else
  11260. str.Format("%02d ", tm.GetMonth ());
  11261. if( (seldlg.m_bBooking==0 && n==3) ||(seldlg.m_bBooking==0 && n==0) || (seldlg.m_bTake==0 && n==1) || (seldlg.m_bChoose==0 && n==2))
  11262. {
  11263. if(seldlg.m_bFrame)
  11264. str=" 月";
  11265. else
  11266. str=" ";
  11267. }
  11268. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11269. StrRect=load.m_rcarray .ElementAt (20);
  11270. if(n)
  11271. {
  11272. StrRect.left +=36;
  11273. StrRect.right +=36;
  11274. }
  11275. StrRect.top +=n*122;
  11276. StrRect.bottom +=n*122;
  11277. if(seldlg.m_bFrame)
  11278. str.Format("%02d日", tm.GetDay ());
  11279. else
  11280. str.Format("%02d ", tm.GetDay ());
  11281. if( (seldlg.m_bBooking==0 && n==3) ||(seldlg.m_bBooking==0 && n==0) || (seldlg.m_bTake==0 && n==1) || (seldlg.m_bChoose==0 && n==2))
  11282. {
  11283. if(seldlg.m_bFrame)
  11284. str=" 日";
  11285. else
  11286. str=" ";
  11287. }
  11288. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11289. for(i=26; i<=32; i++)
  11290. {
  11291. StrRect=load.m_rcarray .ElementAt (i-1);
  11292. StrRect.bottom -=14;
  11293. for(int j=0; j<8; j++)
  11294. {
  11295. StrRect.top=StrRect.bottom;
  11296. if(j>2)
  11297. {
  11298. StrRect.bottom =StrRect.top+14;
  11299. }
  11300. else
  11301. {
  11302. StrRect.bottom =StrRect.top+13;
  11303. }
  11304. temprc=StrRect;
  11305. StrRect.top +=n*122;
  11306. StrRect.bottom +=n*122;
  11307. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11308. if(i==26 && j==4 && seldlg.m_bFrame)
  11309. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11310. else if(i==26 && j==5 && seldlg.m_bFrame)
  11311. m_Print.DrawText((LPTSTR)(LPCTSTR)"付款", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11312. else if(i==26 && j==7 && seldlg.m_bFrame)
  11313. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11314. else if(j==0)
  11315. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-26), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11316. else if(j && i>26 && n<3)
  11317. {
  11318. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray2.ElementAt ((j-1)*6+(i-27)+n*42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11319. }
  11320. StrRect=temprc;
  11321. }
  11322. }
  11323. }
  11324. if(seldlg.m_bFrame)
  11325. {
  11326. StrRect=load.m_rcarray .ElementAt (32);
  11327. str="注\r\n意\r\n事\r\n项";
  11328. StrRect.top +=367;
  11329. StrRect.bottom +=367;
  11330. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11331. StrRect.top +=17;
  11332. StrRect.left +=2;
  11333. AutoDraw(m_Print, StrRect, str, 1.4);
  11334. StrRect=load.m_rcarray .ElementAt (33);
  11335. str="1: 本预约单自预定日期起一年内有效.定金在拍照套系金额中扣出.预定金一概不退\r\n\
  11336. 2: 多拍照片只供筛选.恕不奉送.版权所有.不得私自拷贝\r\n\
  11337. 3: 拍照款请于拍照时一次付清\r\n\
  11338. 4: 新娘装AM8:00前钟点费另计.婚纱礼服出租押金500-2000元\r\n\
  11339. 5: 本公司设有豪华VIP礼服区.及皇家御用礼服展区.但需另外加价.详情请咨本店人员\r\n\
  11340. 6: 安瓶, 美甲一次性化妆用具等均属增值服务部分,则需另外加价,详情咨询本店工作人员\r\n\
  11341. 7: 本电脑机械故障导致文件资料丢失.本公司只提供补拍服务\r\n\
  11342. 8: 每次前来请务必携带本单交给工作人员.本单是您在摩登新娘拍照的凭证.办理有关手续凭本单办理盖\r\n\
  11343. 章后方可生效";
  11344. StrRect.top +=367;
  11345. StrRect.bottom +=367;
  11346. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11347. StrRect.top +=4;
  11348. StrRect.left +=2;
  11349. AutoDraw(m_Print, StrRect, str, 1.0);
  11350. StrRect=load.m_rcarray .ElementAt (34);
  11351. str="第\r\n一\r\n联\r\n:\r\n存\r\n根\r\n(\r\n白\r\n色\r\n)\r\n \r\n \r\n \r\n第\r\n二\r\n联\r\n:\r\n客\r\n户\r\n联\r\n(\r\n红\r\n色\r\n)\r\n \r\n \r\n \r\n第\r\n三\r\n联\r\n:\r\n作\r\n业\r\n联\r\n(\r\n绿\r\n色\r\n)";
  11352. AutoDraw(m_Print, StrRect, str, 1.0);
  11353. m_Print.SetFontFace(13, 1, "宋体");
  11354. StrRect=load.m_rcarray .ElementAt (35);
  11355. str="地 址: 汉口 . 解放大道 . 头道街东部购物公园C栋二,三层";
  11356. StrRect.top +=367;
  11357. StrRect.bottom +=367;
  11358. StrRect.left +=2;
  11359. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11360. StrRect=load.m_rcarray .ElementAt (36);
  11361. str="喜讯热线: 027-81888799 81888599 81888699";
  11362. StrRect.top +=367;
  11363. StrRect.bottom +=367;
  11364. StrRect.left +=2;
  11365. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11366. }
  11367. PrintPreview dlg;
  11368. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11369. dlg.m_pDC =m_Print.GetPDC() ;
  11370. if(dlg.DoModal ()!=IDOK)return;
  11371. //结束打印
  11372. m_Print.EndPage();
  11373. m_Print.EndPrint();
  11374. #endif
  11375. }
  11376. void CMainFrame::PrintReceipt3(CString strOrderNumber, CStringArray *pArray, float money)
  11377. {
  11378. int printcot=1;
  11379. for(int aa=0; aa<printcot; aa++)
  11380. {
  11381. g_sendhead.bsql=0;
  11382. g_sendhead.code[0]=24;
  11383. g_sendhead.tabcount=1;
  11384. int g_nYearposTemp=g_nYearpos;
  11385. g_nYearpos=-1;
  11386. g_pMainWnd->ProcessChatMessageRequest2(1);
  11387. g_nYearpos=g_nYearposTemp;
  11388. if(0==g_bSendOK)return;
  11389. DataToArray(&g_cominfoarray);
  11390. CString SerialNo;
  11391. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  11392. CPrintRX m_Print;
  11393. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11394. {
  11395. m_Print.InitToPrint(NULL, 1);
  11396. }
  11397. else
  11398. {
  11399. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  11400. if(name.IsEmpty ())
  11401. m_Print.InitToPrint(NULL, 1);
  11402. else
  11403. {
  11404. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11405. if(nret==-1 && aa==0)
  11406. {
  11407. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11408. }
  11409. }
  11410. }
  11411. m_Print.StartPrint();
  11412. m_Print.StartPage();
  11413. LoadRect load;
  11414. load.SetLiaPath ("15.lia");
  11415. load.SetMargins(0,0);
  11416. if(!load.Load ())return;
  11417. int i;
  11418. //////////////////////////////////////////////////////////////
  11419. CStringArray txarray;
  11420. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  11421. g_sendhead.code[0]=11;
  11422. g_sendhead.code[1]=52;
  11423. g_sendhead.tabcount=2;
  11424. g_sendhead.bsql=0;
  11425. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11426. CArray<CStringArray, CStringArray>sparray;
  11427. CArray<CStringArray, CStringArray>clientarray;
  11428. DataToArray(&g_List1array, &clientarray);
  11429. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11430. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11431. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11432. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11433. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11434. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11435. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11436. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11437. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11438. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11439. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11440. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11441. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11442. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11443. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11444. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11445. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11446. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11447. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11448. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11449. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11450. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11451. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11452. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11453. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11454. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11455. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11456. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11457. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11458. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11459. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11460. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  11461. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  11462. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11463. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11464. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  11465. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  11466. CString m_addr=m_addr1+";";
  11467. m_addr.TrimLeft (";");
  11468. m_addr+=m_addr2;
  11469. CString m_qq=m_qq1+";";
  11470. m_qq.TrimLeft (";");
  11471. m_qq+=m_qq2;
  11472. m_money1.Format ("%f", atof(m_taoxijiage));
  11473. m_money2.Format ("%f", atof(m_payed1));
  11474. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11475. ConvertToPrice(m_money1);
  11476. ConvertToPrice(m_money2);
  11477. ConvertToPrice(m_money3);
  11478. ////////////////////////////////////////////////////////////////
  11479. int rcpos=-1;
  11480. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11481. m_Print.SetFontFace(17, 1, "宋体");
  11482. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11483. StrRect.top -=0;
  11484. StrRect.bottom -=10;
  11485. StrRect.left -=140;
  11486. StrRect.right =StrRect.left+48;
  11487. m_Print.SetFontFace(15, 1, "宋体");
  11488. m_Print.SetColor(0xffffff);
  11489. m_Print.DrawRect(StrRect, 0);
  11490. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11491. StrRect.left =StrRect.right ;
  11492. StrRect.right =StrRect.left+48;
  11493. m_Print.DrawRect(StrRect, RGB(255,0,0));
  11494. m_Print.SetColor(0, RGB(255,0,0));
  11495. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11496. m_Print.SetColor(0);
  11497. m_Print.SetFontFace(12, 1, "宋体");
  11498. StrRect.left -=48;
  11499. int hei=StrRect.Height ();
  11500. StrRect.top =StrRect.bottom+2;
  11501. StrRect.bottom +=hei+2;
  11502. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11503. StrRect.top =StrRect.bottom-2;
  11504. StrRect.bottom +=hei-5;
  11505. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11506. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11507. m_Print.SetFontFace(12, 1, "宋体");
  11508. m_Print.DrawText((LPTSTR)(LPCTSTR)"收款单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11509. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11510. m_Print.SetFontFace(9, 1, "宋体");
  11511. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11512. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11513. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11514. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11515. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11516. m_Print.DrawRect2(StrRect, 2);
  11517. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11518. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11519. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11520. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11521. m_Print.DrawRect2(StrRect, 2);
  11522. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11523. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11524. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11525. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11526. m_Print.DrawRect2(StrRect, 2);
  11527. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11528. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11529. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11530. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11531. m_Print.DrawRect2(StrRect, 2);
  11532. ////////////
  11533. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11534. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11535. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11536. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11537. m_Print.DrawRect2(StrRect, 2);
  11538. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11539. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11540. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11541. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11542. m_Print.DrawRect2(StrRect, 2);
  11543. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11544. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11545. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11546. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11547. m_Print.DrawRect2(StrRect, 2);
  11548. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11549. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11550. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11551. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11552. m_Print.DrawRect2(StrRect, 2);
  11553. for( i=19; i<49; i++)
  11554. {
  11555. if(i>=44)
  11556. {
  11557. StrRect=load.m_rcarray .ElementAt (i-5);
  11558. int hei=StrRect.Height ();
  11559. StrRect.top +=hei;
  11560. StrRect.bottom +=hei;
  11561. }
  11562. else
  11563. StrRect=load.m_rcarray .ElementAt (i);
  11564. m_Print.DrawRect2(StrRect, 1);
  11565. }
  11566. float fmoney=0;
  11567. for( i=19; i<49; i++)
  11568. {
  11569. if(i>=44)
  11570. {
  11571. StrRect=load.m_rcarray .ElementAt (i-5);
  11572. int hei=StrRect.Height ();
  11573. StrRect.top +=hei;
  11574. StrRect.bottom +=hei;
  11575. }
  11576. else
  11577. StrRect=load.m_rcarray .ElementAt (i);
  11578. StrRect.left +=2;
  11579. /* if((i-19)%5==2)
  11580. {
  11581. fmoney+=atof(pArray->ElementAt (i-19));
  11582. }*/
  11583. m_Print.DrawText((LPTSTR)(LPCTSTR)(pArray->ElementAt (i-19)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11584. }
  11585. m_money2.Format ("%f", money);
  11586. ConvertToPrice(m_money2);
  11587. StrRect=load.m_rcarray .ElementAt (44);
  11588. CString str;
  11589. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 实收¥: %s 元 收银员: %s",\
  11590. GetHMoney(GetW(m_money2)),GetHMoney(GetK(m_money2)),GetHMoney(GetB(m_money2)),GetHMoney(GetS(m_money2)),GetHMoney(GetG(m_money2)),\
  11591. m_money2, g_user.name);
  11592. m_Print.DrawRect2(StrRect, 1);
  11593. StrRect.left +=3;
  11594. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11595. StrRect=load.m_rcarray .ElementAt (46);
  11596. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11597. StrRect=load.m_rcarray .ElementAt (47);
  11598. m_Print.DrawRect2(StrRect, 2);
  11599. StrRect=load.m_rcarray .ElementAt (48);
  11600. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11601. StrRect=load.m_rcarray .ElementAt (45);
  11602. str="\
  11603. 顾客须知\r\n\
  11604. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  11605. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  11606. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  11607. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  11608. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  11609. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  11610. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  11611. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  11612. AutoDraw(m_Print, StrRect, str, 1.8);
  11613. PrintPreview dlg;
  11614. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11615. dlg.m_pDC =m_Print.GetPDC() ;
  11616. if(aa==0)
  11617. {
  11618. if(dlg.DoModal ()!=IDOK)
  11619. return;
  11620. printcot=dlg.m_num;
  11621. }
  11622. //结束打印
  11623. m_Print.EndPage();
  11624. m_Print.EndPrint();
  11625. }
  11626. }
  11627. void CMainFrame::PrintReceipt2(CString strOrderNumber)
  11628. {
  11629. int printcot=1;
  11630. for(int aa=0; aa<printcot; aa++)
  11631. {
  11632. g_sendhead.bsql=0;
  11633. g_sendhead.code[0]=24;
  11634. g_sendhead.tabcount=1;
  11635. int g_nYearposTemp=g_nYearpos;
  11636. g_nYearpos=-1;
  11637. g_pMainWnd->ProcessChatMessageRequest2(1);
  11638. g_nYearpos=g_nYearposTemp;
  11639. if(0==g_bSendOK)return;
  11640. DataToArray(&g_cominfoarray);
  11641. CString SerialNo;
  11642. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  11643. CPrintRX m_Print;
  11644. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11645. {
  11646. m_Print.InitToPrint(NULL, 1);
  11647. }
  11648. else
  11649. {
  11650. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  11651. if(name.IsEmpty ())
  11652. m_Print.InitToPrint(NULL, 1);
  11653. else
  11654. {
  11655. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11656. if(nret==-1 && aa==0)
  11657. {
  11658. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11659. }
  11660. }
  11661. }
  11662. m_Print.StartPrint();
  11663. m_Print.StartPage();
  11664. LoadRect load;
  11665. load.SetLiaPath ("14.lia");
  11666. load.SetMargins(0,0);
  11667. if(!load.Load ())return;
  11668. int i;
  11669. //////////////////////////////////////////////////////////////
  11670. CStringArray txarray;
  11671. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  11672. g_sendhead.code[0]=11;
  11673. g_sendhead.code[1]=52;
  11674. g_sendhead.code[2]=93;
  11675. g_sendhead.tabcount=3;
  11676. g_sendhead.bsql=0;
  11677. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11678. CArray<CStringArray, CStringArray>sparray;
  11679. CArray<CStringArray, CStringArray>clientarray;
  11680. CArray<CStringArray, CStringArray>moneyarray;
  11681. DataToArray(&g_List1array, &clientarray, &moneyarray);
  11682. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11683. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11684. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11685. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11686. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11687. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11688. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11689. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11690. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11691. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11692. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11693. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11694. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11695. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11696. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11697. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11698. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11699. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11700. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11701. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11702. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11703. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11704. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11705. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11706. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11707. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11708. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11709. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11710. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11711. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11712. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11713. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  11714. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  11715. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11716. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11717. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  11718. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  11719. CString m_addr=m_addr1+";";
  11720. m_addr.TrimLeft (";");
  11721. m_addr+=m_addr2;
  11722. CString m_qq=m_qq1+";";
  11723. m_qq.TrimLeft (";");
  11724. m_qq+=m_qq2;
  11725. m_money1.Format ("%f", atof(m_taoxijiage));
  11726. m_money2="0";
  11727. for( i=0; i<moneyarray.GetSize (); i++)
  11728. {
  11729. if(moneyarray.ElementAt (i).ElementAt (5)=="预约收款")
  11730. m_money2=moneyarray.ElementAt (i).ElementAt (1);
  11731. }
  11732. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11733. ConvertToPrice(m_money1);
  11734. ConvertToPrice(m_money2);
  11735. ConvertToPrice(m_money3);
  11736. ////////////////////////////////////////////////////////////////
  11737. int rcpos=-1;
  11738. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11739. m_Print.SetFontFace(17, 1, "宋体");
  11740. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11741. StrRect.top -=0;
  11742. StrRect.bottom -=10;
  11743. StrRect.left -=140;
  11744. StrRect.right =StrRect.left+48;
  11745. m_Print.SetFontFace(15, 1, "宋体");
  11746. m_Print.SetColor(0xffffff);
  11747. m_Print.DrawRect(StrRect, 0);
  11748. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11749. StrRect.left =StrRect.right ;
  11750. StrRect.right =StrRect.left+48;
  11751. m_Print.DrawRect(StrRect, RGB(255,0,0));
  11752. m_Print.SetColor(0, RGB(255,0,0));
  11753. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11754. m_Print.SetColor(0);
  11755. m_Print.SetFontFace(12, 1, "宋体");
  11756. StrRect.left -=48;
  11757. int hei=StrRect.Height ();
  11758. StrRect.top =StrRect.bottom+2;
  11759. StrRect.bottom +=hei+2;
  11760. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11761. StrRect.top =StrRect.bottom-2;
  11762. StrRect.bottom +=hei-5;
  11763. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11764. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11765. m_Print.SetFontFace(12, 1, "宋体");
  11766. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约金单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11767. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11768. m_Print.SetFontFace(9, 1, "宋体");
  11769. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11770. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11771. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11772. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11773. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11774. m_Print.DrawRect2(StrRect, 2);
  11775. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11776. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11777. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11778. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11779. m_Print.DrawRect2(StrRect, 2);
  11780. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11781. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11782. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11783. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11784. m_Print.DrawRect2(StrRect, 2);
  11785. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11786. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11787. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11788. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11789. m_Print.DrawRect2(StrRect, 2);
  11790. ////////////
  11791. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11792. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11793. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11794. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11795. m_Print.DrawRect2(StrRect, 2);
  11796. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11797. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11798. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11799. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11800. m_Print.DrawRect2(StrRect, 2);
  11801. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11802. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11803. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11804. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11805. m_Print.DrawRect2(StrRect, 2);
  11806. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11807. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11808. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11809. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11810. m_Print.DrawRect2(StrRect, 2);
  11811. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11812. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11813. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11814. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11815. m_Print.DrawRect2(StrRect, 2);
  11816. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11817. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11818. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11819. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11820. m_Print.DrawRect2(StrRect, 2);
  11821. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11822. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/MSN:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11823. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11824. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11825. m_Print.DrawRect2(StrRect, 2);
  11826. CStringArray strarray;
  11827. strarray.Add("套系名称");
  11828. strarray.Add("总 额");
  11829. strarray.Add("定 金");
  11830. strarray.Add("余 款");
  11831. strarray.Add("摄影日期");
  11832. strarray.Add(m_taoxiname);
  11833. strarray.Add(m_money1);
  11834. strarray.Add(m_money2);
  11835. strarray.Add(m_money3);
  11836. strarray.Add(m_time2);
  11837. for( i=25; i<37; i++)
  11838. {
  11839. StrRect=load.m_rcarray .ElementAt (i);
  11840. m_Print.DrawRect2(StrRect, 1);
  11841. }
  11842. for( i=25; i<35; i++)
  11843. {
  11844. StrRect=load.m_rcarray .ElementAt (i);
  11845. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-25), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11846. }
  11847. StrRect=load.m_rcarray .ElementAt (35);
  11848. StrRect.left +=5;
  11849. StrRect.top +=5;
  11850. m_Print.DrawText((LPTSTR)(LPCTSTR)" 备 注:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  11851. StrRect=load.m_rcarray .ElementAt (36);
  11852. CString str;
  11853. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 ¥: %s 元 收银员: %s",\
  11854. GetHMoney(GetW(m_money2)),GetHMoney(GetK(m_money2)),GetHMoney(GetB(m_money2)),GetHMoney(GetS(m_money2)),GetHMoney(GetG(m_money2)),\
  11855. m_money2, g_user.name);
  11856. StrRect.left +=3;
  11857. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11858. StrRect=load.m_rcarray .ElementAt (38);
  11859. m_Print.DrawText((LPTSTR)(LPCTSTR)"营业员:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11860. StrRect=load.m_rcarray .ElementAt (39);
  11861. m_Print.DrawText((LPTSTR)(LPCTSTR)m_ren, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11862. m_Print.DrawRect2(StrRect, 2);
  11863. StrRect=load.m_rcarray .ElementAt (40);
  11864. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11865. StrRect=load.m_rcarray .ElementAt (41);
  11866. m_Print.DrawRect2(StrRect, 2);
  11867. StrRect=load.m_rcarray .ElementAt (42);
  11868. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11869. StrRect=load.m_rcarray .ElementAt (37);
  11870. str="\
  11871. 顾客须知\r\n\
  11872. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  11873. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  11874. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  11875. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  11876. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  11877. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  11878. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  11879. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  11880. AutoDraw(m_Print, StrRect, str, 1.8);
  11881. PrintPreview dlg;
  11882. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11883. dlg.m_pDC =m_Print.GetPDC() ;
  11884. if(aa==0)
  11885. {
  11886. if(dlg.DoModal ()!=IDOK)
  11887. return;
  11888. printcot=dlg.m_num;
  11889. }
  11890. //结束打印
  11891. m_Print.EndPage();
  11892. m_Print.EndPrint();
  11893. }
  11894. }
  11895. void CMainFrame::OnAutodelphoto()
  11896. {
  11897. // TODO: Add your command handler code here
  11898. if(g_user.bLongin==0)
  11899. {
  11900. if(g_bNoLoginLia)
  11901. {
  11902. Login dlg;
  11903. dlg.SetLiaPath ("5.lia");
  11904. dlg.DoModal();
  11905. }
  11906. else
  11907. {
  11908. Login3 dlg;
  11909. dlg.SetLiaPath ("5.lia");
  11910. dlg.DoModal();
  11911. }
  11912. if(g_user.bLongin==0)return;
  11913. }
  11914. if(IsHasRightsnew(49)==0)return;
  11915. DelPhotoSet dlg;
  11916. dlg.DoModal ();
  11917. }
  11918. void CMainFrame::Onphotomanage()
  11919. {
  11920. // TODO: Add your command handler code here
  11921. if(g_user.bLongin==0)
  11922. {
  11923. if(g_bNoLoginLia)
  11924. {
  11925. Login dlg;
  11926. dlg.SetLiaPath ("5.lia");
  11927. dlg.DoModal();
  11928. }
  11929. else
  11930. {
  11931. Login3 dlg;
  11932. dlg.SetLiaPath ("5.lia");
  11933. dlg.DoModal();
  11934. }
  11935. if(g_user.bLongin==0)return;
  11936. }
  11937. if(IsHasRightsnew(49)==0)return;
  11938. ShowPic3 dlg;
  11939. dlg.DoModal ();
  11940. }
  11941. void CMainFrame::OnCompanyinfo()
  11942. {
  11943. // TODO: Add your command handler code here
  11944. if(g_user.bLongin==0)
  11945. {
  11946. if(g_bNoLoginLia)
  11947. {
  11948. Login dlg;
  11949. dlg.SetLiaPath ("5.lia");
  11950. dlg.DoModal();
  11951. }
  11952. else
  11953. {
  11954. Login3 dlg;
  11955. dlg.SetLiaPath ("5.lia");
  11956. dlg.DoModal();
  11957. }
  11958. if(g_user.bLongin==0)return;
  11959. }
  11960. if(IsHasRightsnew(49)==0)return;
  11961. CompanyInfo dlg;
  11962. dlg.DoModal ();
  11963. }
  11964. void CMainFrame::OnTaoxifg()
  11965. {
  11966. // TODO: Add your command handler code here
  11967. if(g_user.bLongin==0)
  11968. {
  11969. if(g_bNoLoginLia)
  11970. {
  11971. Login dlg;
  11972. dlg.SetLiaPath ("5.lia");
  11973. dlg.DoModal();
  11974. }
  11975. else
  11976. {
  11977. Login3 dlg;
  11978. dlg.SetLiaPath ("5.lia");
  11979. dlg.DoModal();
  11980. }
  11981. if(g_user.bLongin==0)return;
  11982. }
  11983. if(IsHasRightsnew(49)==0)return;
  11984. TXFG dlg;
  11985. dlg.DoModal ();
  11986. }
  11987. void CMainFrame::OnHelpfile()
  11988. {
  11989. // TODO: Add your command handler code here
  11990. // ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  11991. // if(::PathFileExists (g_mainpath+"\\zx.dll"))
  11992. // ShellExecute(NULL, _T("open"), _T("www.zcsmkj.com"), "", NULL, SW_SHOWNORMAL);
  11993. // else
  11994. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  11995. }
  11996. void CMainFrame::OnPhotobak()
  11997. {
  11998. // TODO: Add your command handler code here
  11999. if(g_user.bLongin==0)
  12000. {
  12001. if(g_bNoLoginLia)
  12002. {
  12003. Login dlg;
  12004. dlg.SetLiaPath ("5.lia");
  12005. dlg.DoModal();
  12006. }
  12007. else
  12008. {
  12009. Login3 dlg;
  12010. dlg.SetLiaPath ("5.lia");
  12011. dlg.DoModal();
  12012. }
  12013. if(g_user.bLongin==0)return;
  12014. }
  12015. if(IsHasRightsnew(49)==0)return;
  12016. PhotoBak dlg;
  12017. dlg.DoModal ();
  12018. }
  12019. //客户报表
  12020. void CMainFrame::OnClose2()
  12021. { // TODO: Add your message handler code here and/or call default
  12022. if(AfxMessageBox("是否退出系统?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  12023. WriteLog("退出系统");//Jeff.add
  12024. g_bShowBar=0;
  12025. if(m_Mdi.MainClose())
  12026. CMDIFrameWnd::OnClose();
  12027. }
  12028. //
  12029. void CMainFrame::ResetTimer()
  12030. {
  12031. }
  12032. void CMainFrame::LinkClick(CString str, int nParent)
  12033. {
  12034. g_pMainWnd2->m_bar.LinkClick(str);
  12035. }
  12036. void CMainFrame::PrintFlowChart2(CString m_id)
  12037. {
  12038. CPrintRX m_Print;
  12039. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12040. {
  12041. m_Print.InitToPrint(NULL, 1);
  12042. }
  12043. else
  12044. {
  12045. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  12046. if(name.IsEmpty ())
  12047. m_Print.InitToPrint(NULL, 1);
  12048. else
  12049. {
  12050. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12051. if(nret==-1)
  12052. {
  12053. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12054. }
  12055. }
  12056. }
  12057. m_Print.StartPrint();
  12058. m_Print.StartPage();
  12059. LoadRect load;
  12060. load.SetLiaPath ("16.lia");
  12061. load.SetMargins(0,0);
  12062. if(!load.Load ())return;
  12063. LoadRect load2;
  12064. load2.SetLiaPath ("17.lia");
  12065. load2.SetMargins(0,660);
  12066. if(!load2.Load ())return;
  12067. int i;
  12068. //////////////////////////////////////////////////////////////
  12069. CStringArray txarray;
  12070. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and kind<>'2'";
  12071. g_sendhead.code[0]=11;
  12072. g_sendhead.code[1]=52;
  12073. g_sendhead.code[2]=223;
  12074. g_sendhead.tabcount=3;
  12075. g_sendhead.bsql=0;
  12076. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  12077. CArray<CStringArray, CStringArray>sparray;
  12078. CArray<CStringArray, CStringArray>clientarray;
  12079. DataToArray(&g_List1array, &clientarray, &sparray);
  12080. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  12081. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  12082. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  12083. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  12084. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  12085. CString m_photocount= g_List1array.ElementAt (0).ElementAt (9);
  12086. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  12087. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  12088. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  12089. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  12090. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  12091. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  12092. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  12093. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  12094. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  12095. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  12096. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  12097. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  12098. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  12099. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  12100. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  12101. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  12102. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  12103. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  12104. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  12105. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  12106. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  12107. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  12108. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (39)+g_List1array.ElementAt (0).ElementAt (75);
  12109. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  12110. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  12111. CString spno;
  12112. for( i=0; i<sparray.GetSize (); i++)
  12113. {
  12114. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12115. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  12116. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12117. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  12118. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  12119. spno+=sparray.ElementAt (i).ElementAt (5);
  12120. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  12121. spno+="; ";
  12122. else
  12123. {
  12124. spno+=":";
  12125. spno+=sparray.ElementAt (i).ElementAt (6);
  12126. spno+="; ";
  12127. }
  12128. }
  12129. spno+=" 加挑:";
  12130. for( i=0; i<sparray.GetSize (); i++)
  12131. {
  12132. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  12133. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  12134. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  12135. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  12136. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  12137. spno+=sparray.ElementAt (i).ElementAt (5);
  12138. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  12139. spno+="; ";
  12140. else
  12141. {
  12142. spno+=":";
  12143. spno+=sparray.ElementAt (i).ElementAt (6);
  12144. spno+="; ";
  12145. }
  12146. }
  12147. if(spno.Right (6)==" 加挑:")
  12148. {
  12149. spno=spno.Left (spno.GetLength ()-6);
  12150. }
  12151. ////////////////////////////////////////////////////////////////
  12152. int rcpos=-1;
  12153. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12154. m_Print.SetFontFace(17, 1, "宋体");
  12155. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12156. StrRect.top -=0;
  12157. StrRect.bottom -=10;
  12158. StrRect.left -=140;
  12159. StrRect.right =StrRect.left+48;
  12160. m_Print.SetFontFace(15, 1, "宋体");
  12161. m_Print.SetColor(0xffffff);
  12162. m_Print.DrawRect(StrRect, 0);
  12163. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12164. StrRect.left =StrRect.right ;
  12165. StrRect.right =StrRect.left+48;
  12166. m_Print.DrawRect(StrRect, RGB(255,0,0));
  12167. m_Print.SetColor(0, RGB(255,0,0));
  12168. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12169. m_Print.SetColor(0);
  12170. m_Print.SetFontFace(12, 1, "宋体");
  12171. StrRect.left -=48;
  12172. int hei=StrRect.Height ();
  12173. StrRect.top =StrRect.bottom+2;
  12174. StrRect.bottom +=hei+2;
  12175. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12176. StrRect.top =StrRect.bottom-2;
  12177. StrRect.bottom +=hei-5;
  12178. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12179. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12180. m_Print.SetFontFace(12, 1, "宋体");
  12181. m_Print.DrawText((LPTSTR)(LPCTSTR)"加做取件单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12182. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12183. m_Print.SetFontFace(11, 1, "宋体");
  12184. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+m_id), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12185. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12186. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12187. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12188. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12189. m_Print.DrawRect2(StrRect, 2);
  12190. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12191. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12192. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12193. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12194. m_Print.DrawRect2(StrRect, 2);
  12195. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12196. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12197. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12198. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time4, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12199. m_Print.DrawRect2(StrRect, 2);
  12200. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12201. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12202. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12203. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12204. m_Print.DrawRect2(StrRect, 2);
  12205. ////////////
  12206. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12207. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12208. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12209. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12210. m_Print.DrawRect2(StrRect, 2);
  12211. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12212. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12213. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12214. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12215. m_Print.DrawRect2(StrRect, 2);
  12216. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12217. m_Print.DrawText((LPTSTR)(LPCTSTR)"赠送张数:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12218. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12219. m_Print.DrawText((LPTSTR)(LPCTSTR)m_photocount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12220. m_Print.DrawRect2(StrRect, 2);
  12221. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12222. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12223. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12224. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12225. m_Print.DrawRect2(StrRect, 2);
  12226. ////////////
  12227. ///////////spno
  12228. CRect sprc[22];
  12229. StrRect=load.m_rcarray .ElementAt (19);
  12230. StrRect.left +=4;StrRect.right -=3;
  12231. hei=StrRect.Height ();
  12232. for(i=0; i<22; i++)
  12233. {
  12234. sprc[i]=StrRect;
  12235. m_Print.DrawRect2(StrRect, 1);
  12236. if(i==0)
  12237. {
  12238. StrRect.left +=5;
  12239. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12240. StrRect.left -=5;
  12241. }
  12242. StrRect.top =StrRect.bottom ;
  12243. StrRect.bottom =StrRect.top +hei;
  12244. sprc[i].left +=4;sprc[i].right -=3;
  12245. }
  12246. StrRect.bottom =StrRect.top +60;
  12247. m_Print.DrawRect2(StrRect, 1);
  12248. StrRect.left +=3; StrRect.top +=3;
  12249. StrRect.right -=3; StrRect.bottom -=3;
  12250. AutoDraw(m_Print, StrRect, m_bz, 1.8);
  12251. CString temp,tempspno,tempbz;
  12252. CSize size;
  12253. BOOL bRun=0;
  12254. int fontsize=12;
  12255. ll: tempspno=spno;
  12256. m_Print.SetFontFace(fontsize, 1, "宋体");
  12257. for( i=1; i<22; i++)
  12258. {
  12259. if(!tempspno.IsEmpty ())
  12260. {
  12261. temp=tempspno;
  12262. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12263. int right=0;
  12264. CRect temprc=sprc[i];
  12265. while(size.cx>temprc.Width ())
  12266. {
  12267. right++;
  12268. temp=tempspno.Left (tempspno.GetLength ()-(right));
  12269. if(GIsHalfHZ(temp))
  12270. {
  12271. right++;
  12272. temp.Delete (temp.GetLength ()-1);
  12273. }
  12274. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12275. }
  12276. if(bRun)
  12277. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12278. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  12279. if(tempspno.IsEmpty ())i++;
  12280. }
  12281. }
  12282. if(tempspno.IsEmpty ()==0)//|| tempbz.IsEmpty ()==0)
  12283. {
  12284. fontsize--;
  12285. goto ll;
  12286. }
  12287. if(bRun==0)
  12288. {
  12289. bRun=1;
  12290. goto ll;
  12291. }
  12292. m_Print.SetFontFace(12, 1, "宋体");
  12293. StrRect=load2.m_rcarray .ElementAt (1);
  12294. m_Print.DrawText((LPTSTR)(LPCTSTR)"喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12295. StrRect=load2.m_rcarray .ElementAt (2);
  12296. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12297. StrRect=load2.m_rcarray .ElementAt (3);
  12298. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12299. StrRect=load2.m_rcarray .ElementAt (4);
  12300. m_Print.DrawRect2(StrRect, 2);
  12301. StrRect=load2.m_rcarray .ElementAt (0);
  12302. CString str="\
  12303. 爱心提示:如对制作有任何要求请清楚列出,所有制作内容一经确认将按要求制作。\r\n\
  12304. 选样文件从拍摄日期计算将保留二个月;套相成品按取件日期保留三个月,逾期不做保留。\r\n\
  12305. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12306. AutoDraw(m_Print, StrRect, str, 1.8);
  12307. PrintPreview dlg;dlg.m_mode=2;
  12308. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  12309. dlg.m_pDC =m_Print.GetPDC() ;
  12310. if(dlg.DoModal ()!=IDOK)return;
  12311. //结束打印
  12312. m_Print.EndPage();
  12313. m_Print.EndPrint();
  12314. }
  12315. //分店
  12316. CString CMainFrame::GetDanWei(CString name, CArray<CStringArray, CStringArray>*array)
  12317. {
  12318. for(int i=0; i<array->GetSize (); i++)
  12319. {
  12320. if(name==array->ElementAt (i).ElementAt (1) )
  12321. return array->ElementAt (i).ElementAt (2);
  12322. }
  12323. return "";
  12324. }
  12325. //g_sendhead
  12326. int CMainFrame::GetPort()
  12327. {
  12328. static int aaa=-1;
  12329. if(aaa==-1)
  12330. {
  12331. aaa=CTime::GetCurrentTime ().GetSecond ()%7;
  12332. }
  12333. aaa++;
  12334. if(aaa>=7)aaa=0;
  12335. return 8387+aaa;
  12336. }
  12337. void CMainFrame::OnShowBakState()
  12338. {
  12339. // TODO: Add your command handler code here
  12340. g_sendhead.bsql=0;
  12341. g_sendhead.code[0]=171;
  12342. g_sendhead.tabcount=1;
  12343. g_pMainWnd->ProcessChatMessageRequest2(1);
  12344. if(g_bSendOK==0)
  12345. {
  12346. return;
  12347. }
  12348. CArray<CStringArray, CStringArray>g_bakstatearray;
  12349. DataToArray(&g_bakstatearray);
  12350. while(g_bakstatearray.GetSize()>7)
  12351. {
  12352. g_bakstatearray.RemoveAt(0);
  12353. }
  12354. int photocount=0;
  12355. int infocount=0;
  12356. for(int i=0; i<g_bakstatearray.GetSize(); i++)
  12357. {
  12358. if(g_bakstatearray.ElementAt(i).ElementAt(1)!="1")photocount++;
  12359. if(g_bakstatearray.ElementAt(i).ElementAt(2)!="1")infocount++;
  12360. }
  12361. ShowBakState dlg;
  12362. dlg.m_pArray=&g_bakstatearray;
  12363. dlg.DoModal ();
  12364. }
  12365. void CMainFrame::PrintReceipt2(CStringArray *pArray)
  12366. {
  12367. int printcot=1;
  12368. for(int aa=0; aa<printcot; aa++)
  12369. {
  12370. g_sendhead.bsql=0;
  12371. g_sendhead.code[0]=24;
  12372. g_sendhead.tabcount=1;
  12373. int g_nYearposTemp=g_nYearpos;
  12374. g_nYearpos=-1;
  12375. g_pMainWnd->ProcessChatMessageRequest2(1);
  12376. g_nYearpos=g_nYearposTemp;
  12377. if(0==g_bSendOK)return;
  12378. DataToArray(&g_cominfoarray);
  12379. CString SerialNo;
  12380. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127))+1);
  12381. CPrintRX m_Print;
  12382. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12383. {
  12384. m_Print.InitToPrint(NULL, 1);
  12385. }
  12386. else
  12387. {
  12388. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  12389. if(name.IsEmpty ())
  12390. m_Print.InitToPrint(NULL, 1);
  12391. else
  12392. {
  12393. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12394. if(nret==-1 && aa==0)
  12395. {
  12396. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12397. }
  12398. }
  12399. }
  12400. m_Print.StartPrint();
  12401. m_Print.StartPage();
  12402. LoadRect load;
  12403. BOOL bSmall=0;
  12404. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  12405. {
  12406. bSmall=1;
  12407. load.SetLiaPath ("20.lia");
  12408. }
  12409. else
  12410. load.SetLiaPath ("10.lia");
  12411. if(bSmall)
  12412. load.SetMargins(-10,0);
  12413. else
  12414. load.SetMargins(10,0);
  12415. if(!load.Load ())return;
  12416. int rcpos=-1;
  12417. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12418. Image *pImg=NULL;
  12419. #ifdef MNLS_VERSION
  12420. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  12421. #else
  12422. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  12423. #endif
  12424. // m_Print.DrawImage(pImg, StrRect);
  12425. delete pImg;
  12426. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  12427. {
  12428. Image *pImg=NULL;
  12429. g_nSendCode=31;
  12430. int g_nYearposTemp=g_nYearpos;
  12431. g_nYearpos=-1;
  12432. g_pMainWnd->ProcessChatMessageRequest2(1);
  12433. g_nYearpos=g_nYearposTemp;
  12434. g_nSendCode=0;
  12435. if(g_bSendOK==0)return;
  12436. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  12437. if(pImg)
  12438. {
  12439. StrRect.left=65;
  12440. if(bSmall)StrRect.left=55;
  12441. StrRect.top=10;
  12442. StrRect.right=StrRect.left+58;
  12443. StrRect.bottom=StrRect.top+58;
  12444. m_Print.DrawImage(pImg, StrRect);
  12445. delete pImg;pImg=NULL;
  12446. }
  12447. }
  12448. if(bSmall)
  12449. {
  12450. m_Print.SetFontFace(18, 1, "黑体");
  12451. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12452. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12453. m_Print.SetFontFace(9, 1, "宋体");
  12454. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12455. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12456. m_Print.SetFontFace(6, 1, "宋体");
  12457. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12458. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12459. m_Print.SetFontFace(9, 1, "宋体");
  12460. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12461. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12462. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12463. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12464. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12465. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12466. int hei=StrRect.Height ();
  12467. StrRect.bottom=StrRect.top;
  12468. StrRect.top -=8;
  12469. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12470. m_Print.SetFontFace(10, 1, "宋体");
  12471. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12472. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12473. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12474. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12475. m_Print.SetFontFace(9, 1, "宋体");
  12476. for(int i=7; i<24; i++)
  12477. {
  12478. StrRect=load.m_rcarray .ElementAt (i);
  12479. m_Print.DrawRect2(StrRect, 1);
  12480. }
  12481. for( i=9; i<24; i++)
  12482. {
  12483. StrRect=load.m_rcarray .ElementAt (i);
  12484. StrRect.left +=2;
  12485. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12486. }
  12487. m_Print.SetFontFace(6, 1, "宋体");
  12488. for(i=24; i<26; i++)
  12489. {
  12490. StrRect=load.m_rcarray .ElementAt (i);
  12491. StrRect.left +=2;
  12492. if(i==24)
  12493. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12494. else
  12495. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12496. }
  12497. }
  12498. else//大单
  12499. {
  12500. m_Print.SetFontFace(20, 1, "黑体");
  12501. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12502. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12503. m_Print.SetFontFace(11, 1, "宋体");
  12504. // StrRect=load.m_rcarray .ElementAt (++rcpos);
  12505. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12506. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15;
  12507. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12508. int hei=StrRect.Height ();
  12509. StrRect.bottom=StrRect.top;
  12510. StrRect.top -=10;
  12511. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12512. m_Print.SetFontFace(8, 1, "宋体");
  12513. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12514. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12515. m_Print.SetFontFace(11, 1, "宋体");
  12516. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12517. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12518. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12519. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12520. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12521. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12522. m_Print.SetFontFace(13, 1, "宋体");
  12523. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12524. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12525. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12526. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12527. m_Print.SetFontFace(11, 1, "宋体");
  12528. for(int i=7; i<24; i++)
  12529. {
  12530. StrRect=load.m_rcarray .ElementAt (i);
  12531. m_Print.DrawRect2(StrRect, 1);
  12532. }
  12533. for( i=9; i<24; i++)
  12534. {
  12535. StrRect=load.m_rcarray .ElementAt (i);
  12536. StrRect.left +=2;
  12537. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12538. }
  12539. m_Print.SetFontFace(8, 1, "宋体");
  12540. for(i=24; i<27; i++)
  12541. {
  12542. StrRect=load.m_rcarray .ElementAt (i);
  12543. StrRect.left +=2;
  12544. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12545. }
  12546. }
  12547. PrintPreview dlg;
  12548. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  12549. dlg.m_pDC =m_Print.GetPDC() ;
  12550. if(aa==0)
  12551. {
  12552. if(dlg.DoModal ()!=IDOK)
  12553. return;
  12554. printcot=dlg.m_num;
  12555. }
  12556. //结束打印
  12557. m_Print.EndPage();
  12558. m_Print.EndPrint();
  12559. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127))+1);
  12560. CString sql;
  12561. sql.Format("update version set [serialno2]='%s'", SerialNo);
  12562. g_sendhead.bsql=1;
  12563. g_nYearposTemp=g_nYearpos;
  12564. g_nYearpos=-1;
  12565. g_pMainWnd->ProcessChatMessageRequest2(sql);
  12566. g_nYearpos=g_nYearposTemp;
  12567. }
  12568. }
  12569. //出生年月
  12570. //第一联
  12571. void CMainFrame::OnLog()
  12572. {
  12573. // TODO: Add your command handler code here OnShowBakState
  12574. if(IsHasRightsnew(49)==0)return;
  12575. ShowLOg dlg;
  12576. dlg.DoModal ();
  12577. }
  12578. // www.lyfz.net 8888
  12579. void CMainFrame::PrintDinDan6(CString m_id)
  12580. {
  12581. // TODO: Add your control notification handler code here 预约订单
  12582. int printcot=1;
  12583. for(int aa=0; aa<printcot; aa++)
  12584. {
  12585. PrintPreview dlg;
  12586. CPrintRX m_Print;
  12587. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12588. {
  12589. m_Print.InitToPrint(NULL, 1);
  12590. }
  12591. else
  12592. {
  12593. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  12594. if(name.IsEmpty ())
  12595. m_Print.InitToPrint(NULL, 1);
  12596. else
  12597. {
  12598. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12599. if(nret==-1 && aa==0)
  12600. {
  12601. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12602. }
  12603. }
  12604. }
  12605. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==3)
  12606. {
  12607. m_Print.StartPrint();
  12608. m_Print.StartPage();
  12609. LoadRect load;
  12610. load.SetLiaPath ("6.lia");
  12611. load.SetMargins(-14,15);
  12612. if(!load.Load ())return;
  12613. LoadRect load2;
  12614. load2.SetLiaPath ("7.lia");
  12615. load2.SetMargins(-14,216+15);
  12616. if(!load2.Load ())return;
  12617. LoadRect load3;
  12618. load3.SetLiaPath ("8.lia");
  12619. load3.SetMargins(-14,705+15);
  12620. if(!load3.Load ())return;
  12621. int i;
  12622. //////////////////////////////////////////////////////////////
  12623. CStringArray txarray;
  12624. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  12625. g_sendhead.code[0]=11;
  12626. g_sendhead.code[1]=52;
  12627. g_sendhead.code[2]=50;
  12628. g_sendhead.code[3]=150;
  12629. g_sendhead.code[4]=77;
  12630. g_sendhead.code[5]=4;
  12631. g_sendhead.tabcount=6;
  12632. g_sendhead.bsql=0;
  12633. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  12634. CArray<CStringArray, CStringArray>sparray;
  12635. CArray<CStringArray, CStringArray>clientarray;
  12636. CArray<CStringArray, CStringArray>phonearray;
  12637. CArray<CStringArray, CStringArray>fgarray;
  12638. CArray<CStringArray, CStringArray>danweiarray;
  12639. CArray<CStringArray, CStringArray>jdarray;
  12640. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  12641. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  12642. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  12643. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  12644. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  12645. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  12646. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  12647. CString m_taoxiname;
  12648. if(m_zs.Find ("\\")!=-1)
  12649. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底\\入册:"+g_List1array.ElementAt (0).ElementAt (9);
  12650. else
  12651. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底:"+g_List1array.ElementAt (0).ElementAt (9);
  12652. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  12653. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  12654. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  12655. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  12656. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  12657. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  12658. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  12659. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  12660. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  12661. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  12662. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  12663. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  12664. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  12665. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  12666. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  12667. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  12668. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  12669. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  12670. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  12671. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  12672. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  12673. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  12674. if(jdarray.GetSize ())
  12675. {
  12676. if(m_bz.IsEmpty ()==0)
  12677. m_bz="\r\n"+m_bz;
  12678. m_bz+="景点:";
  12679. }
  12680. for( i=0; i<jdarray.GetSize (); i++)
  12681. {
  12682. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  12683. }
  12684. m_bz.TrimRight (";");
  12685. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  12686. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  12687. if(IsHasRights2new(31)==0)
  12688. {
  12689. m_phone1="***";
  12690. m_phone2="***";
  12691. }
  12692. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  12693. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  12694. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  12695. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  12696. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  12697. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  12698. filter="name='"+m_ren+"'";
  12699. g_sendhead.code[0]=5;
  12700. g_sendhead.tabcount=1;
  12701. g_sendhead.bsql=0;
  12702. int g_nYearposTemp=g_nYearpos;
  12703. g_nYearpos=-1;
  12704. g_pMainWnd->ProcessChatMessageRequest2(filter);
  12705. g_nYearpos=g_nYearposTemp;
  12706. if(g_bSendOK==0)return;
  12707. DataToArray(&phonearray);
  12708. m_money1.Format ("%f", atof(m_taoxijiage));
  12709. m_money2.Format ("%f", atof(m_payed1));
  12710. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  12711. ConvertToPrice(m_money1);
  12712. ConvertToPrice(m_money2);
  12713. ConvertToPrice(m_money3);
  12714. ////////////////////////////////////////////////////////////////
  12715. int rcpos=-1;
  12716. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12717. StrRect.top -=15;StrRect.bottom -=15;
  12718. Image *pImg=NULL;
  12719. #ifdef MNLS_VERSION
  12720. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  12721. #else
  12722. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  12723. #endif
  12724. m_Print.DrawImage(pImg, StrRect);
  12725. delete pImg;
  12726. m_Print.SetFontFace(11, 1, "宋体");
  12727. StrRect=load.m_rcarray .ElementAt (20);
  12728. StrRect.right=load.m_rcarray .ElementAt (23).right;
  12729. StrRect.top -=18;StrRect.bottom -=18;
  12730. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  12731. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12732. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  12733. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12734. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12735. StrRect.top -=15;StrRect.bottom -=15;
  12736. #ifdef MNLS_VERSION
  12737. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12738. #endif
  12739. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12740. StrRect.top -=15;StrRect.bottom -=15;
  12741. #ifdef MNLS_VERSION
  12742. m_Print.DrawRect(StrRect);
  12743. #endif
  12744. m_Print.SetFontFace(7, 1, "黑体");
  12745. m_Print.SetColor(0xffffff);
  12746. #ifdef MNLS_VERSION
  12747. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12748. #endif
  12749. m_Print.SetColor(0);
  12750. m_Print.SetFontFace(15, 1, "宋体");
  12751. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12752. StrRect.top -=15;StrRect.bottom -=15;
  12753. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同拍摄单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12754. CStringArray strarray;
  12755. strarray.Add("NO: "+m_id);
  12756. CString date;
  12757. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  12758. strarray.Add(date);
  12759. strarray.Add("喜爱");
  12760. strarray.Add("格调");
  12761. if(fgarray.GetSize ()==12)
  12762. {
  12763. for(int i=0; i<12; i++)
  12764. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  12765. }
  12766. else
  12767. {
  12768. strarray.Add("复古典雅");
  12769. strarray.Add("温文尔雅");
  12770. strarray.Add("豪华艳丽");
  12771. strarray.Add("传统大方");
  12772. strarray.Add("新潮个性");
  12773. strarray.Add("浪漫奔放");
  12774. strarray.Add("简单素雅");
  12775. strarray.Add("活泼俏丽");
  12776. strarray.Add("妩媚温馨");
  12777. strarray.Add("温柔贤惠");
  12778. strarray.Add("成熟感性");
  12779. strarray.Add("清纯可爱");
  12780. }
  12781. strarray.Add("姓名");
  12782. // strarray.Add("职业");
  12783. strarray.Add("");
  12784. strarray.Add("地址");
  12785. strarray.Add("电话");
  12786. #ifdef CHILD_VERSION
  12787. strarray.Add("家长");
  12788. strarray.Add("宝宝");
  12789. #else
  12790. strarray.Add("先生");
  12791. strarray.Add("女士");
  12792. #endif
  12793. m_Print.SetFontFace(11, 1, "宋体");
  12794. for( i=0; i<strarray.GetSize (); i++)
  12795. {
  12796. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12797. if(i<2)
  12798. {
  12799. StrRect.top -=15;StrRect.bottom -=15;
  12800. }
  12801. if(i>15)
  12802. m_Print.DrawRect2(StrRect, 1);
  12803. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12804. }
  12805. for( i=29; i<=40; i++)
  12806. {
  12807. if(m_style.GetLength ()<=(i-29))continue;
  12808. if(m_style.GetAt (i-29)!='1')continue;
  12809. StrRect=load.m_rcarray .ElementAt (i-1);
  12810. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12811. }
  12812. for( i=27; i<=48; i++)
  12813. {
  12814. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12815. m_Print.DrawRect2(StrRect, 1);
  12816. }
  12817. #ifdef CHILD_VERSION
  12818. StrRect=load.m_rcarray .ElementAt (45);
  12819. StrRect.right =StrRect.left +62;
  12820. m_Print.DrawRect2(StrRect, 1);
  12821. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12822. StrRect.left =StrRect.right ;
  12823. StrRect.right =StrRect.left +62;
  12824. m_Print.DrawRect2(StrRect, 1);
  12825. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12826. StrRect.left =StrRect.right ;
  12827. StrRect.right =StrRect.left +62;
  12828. m_Print.DrawRect2(StrRect, 1);
  12829. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12830. StrRect.left =StrRect.right ;
  12831. StrRect.right =StrRect.left +62;
  12832. m_Print.DrawRect2(StrRect, 1);
  12833. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12834. #endif
  12835. /////////////////////////
  12836. strarray.RemoveAll ();
  12837. CString temp;
  12838. temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  12839. strarray.Add (temp);
  12840. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  12841. strarray.Add (temp);
  12842. strarray.Add ("化妆");
  12843. strarray.Add ("造型");
  12844. #ifdef CHILD_VERSION
  12845. strarray.Add ("");
  12846. #else
  12847. strarray.Add ("婚纱");
  12848. #endif
  12849. strarray.Add ("服饰");
  12850. strarray.Add ("配");
  12851. strarray.Add ("置");
  12852. strarray.Add ("其");
  12853. strarray.Add ("它");
  12854. strarray.Add ("套系名称");
  12855. strarray.Add ("镜款");
  12856. strarray.Add ("套系总价");
  12857. strarray.Add ("主摄影师");
  12858. strarray.Add ("拍摄日期");
  12859. strarray.Add ("预约金");
  12860. #ifdef CHILD_VERSION
  12861. strarray.Add ("主引导师");
  12862. #else
  12863. strarray.Add ("主化妆师");
  12864. #endif
  12865. strarray.Add ("看样日期");
  12866. strarray.Add ("补 余 款");
  12867. strarray.Add ("总监");
  12868. strarray.Add ("取件日期");
  12869. rcpos=-1;
  12870. for( i=0; i<strarray.GetSize (); i++)
  12871. {
  12872. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  12873. if(i>9)
  12874. m_Print.DrawRect2(StrRect, 1);
  12875. #ifdef CHILD_VERSION
  12876. if(i==5)
  12877. StrRect.top -=StrRect.Height ();
  12878. #endif
  12879. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12880. }
  12881. for( i=22; i<=41; i++)
  12882. {
  12883. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  12884. m_Print.DrawRect2(StrRect, 1);
  12885. }
  12886. /////////////////////////////
  12887. strarray.RemoveAll ();
  12888. #ifdef CHILD_VERSION
  12889. strarray.Add ("顾客方 家长:");
  12890. strarray.Add ("宝宝:");
  12891. #else
  12892. strarray.Add ("顾客方 先生:");
  12893. strarray.Add ("女士:");
  12894. #endif
  12895. strarray.Add ("电话:");
  12896. strarray.Add ("影楼方 店长:");
  12897. strarray.Add ("接单人:");
  12898. strarray.Add ("电话:");
  12899. rcpos=-1;
  12900. for( i=0; i<strarray.GetSize (); i++)
  12901. {
  12902. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  12903. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12904. }
  12905. for( i=7; i<=12; i++)
  12906. {
  12907. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  12908. // if(i!=10)
  12909. m_Print.DrawRect2(StrRect, 2);
  12910. }
  12911. //////////////////////////////////////
  12912. //开始打数据
  12913. strarray.RemoveAll ();
  12914. strarray.Add (m_name1);
  12915. strarray.Add (m_name2);
  12916. strarray.Add ("");
  12917. strarray.Add ("");
  12918. strarray.Add (m_addr1);
  12919. #ifdef CHILD_VERSION
  12920. strarray.Add ("");
  12921. #else
  12922. strarray.Add (m_addr2);
  12923. #endif
  12924. strarray.Add (m_phone1);
  12925. strarray.Add (m_phone2);
  12926. for( i=41; i<=48; i++)
  12927. {
  12928. StrRect=load.m_rcarray .ElementAt (i-1);
  12929. StrRect.left +=4;
  12930. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12931. }
  12932. ///////////////////////////////
  12933. strarray.RemoveAll ();
  12934. strarray.Add (m_money1);
  12935. strarray.Add (m_waiter1);
  12936. strarray.Add (m_time2);
  12937. strarray.Add (m_money2);
  12938. strarray.Add (m_waiter2);
  12939. strarray.Add (m_time4);
  12940. strarray.Add (m_money3);
  12941. strarray.Add ("");
  12942. strarray.Add (m_time5);
  12943. for( i=32; i<=40; i++)
  12944. {
  12945. StrRect=load2.m_rcarray .ElementAt (i-1);
  12946. StrRect.left +=4;
  12947. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12948. }
  12949. ///////////////////////////////
  12950. strarray.RemoveAll ();
  12951. strarray.Add ("");//m_name1);
  12952. strarray.Add ("");//m_name2);
  12953. CString phone;
  12954. if(m_phone1.IsEmpty ()==0)
  12955. phone=m_phone1+",";
  12956. phone+=m_phone2;
  12957. phone.TrimRight (",");
  12958. strarray.Add ("");//phone);
  12959. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  12960. strarray.Add (m_ren);
  12961. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  12962. for( i=7; i<=12; i++)
  12963. {
  12964. StrRect=load3.m_rcarray .ElementAt (i-1);
  12965. StrRect.left +=4;
  12966. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12967. }
  12968. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  12969. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12970. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  12971. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12972. StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  12973. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12974. //////////////////////////////
  12975. //开始画文字
  12976. StrRect=load2.m_rcarray .ElementAt (30);
  12977. StrRect.left +=3;
  12978. StrRect.top +=3;
  12979. StrRect.right -=2;
  12980. StrRect.bottom -=2;
  12981. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  12982. StrRect=load2.m_rcarray .ElementAt (29);
  12983. StrRect.left +=3;
  12984. StrRect.top +=3;
  12985. StrRect.right -=2;
  12986. StrRect.bottom -=2;
  12987. str="";
  12988. for(i=0; i<sparray.GetSize (); i++)
  12989. {
  12990. str+=sparray.ElementAt (i).ElementAt (5);
  12991. str+=" 数量:";
  12992. str+=sparray.ElementAt (i).ElementAt (3);
  12993. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  12994. str+="\r\n";
  12995. }
  12996. str.TrimRight ("\r\n");
  12997. AutoDraw(m_Print, StrRect, str, 1.4);
  12998. StrRect=load2.m_rcarray .ElementAt (40);
  12999. StrRect.top +=8;
  13000. m_Print.SetFontFace(12, 1, "黑体");
  13001. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  13002. StrRect.left +=3;
  13003. StrRect.top +=30;
  13004. StrRect.right -=2;
  13005. StrRect.bottom -=2;
  13006. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  13007. if(str.IsEmpty ())
  13008. {
  13009. str="\
  13010. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  13011. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  13012. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  13013. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  13014. 持良好的心境.\r\n\
  13015. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  13016. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  13017. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  13018. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  13019. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  13020. 勿进影室, 以免影响拍摄.\r\n\
  13021. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  13022. 师或店长沟通.\r\n\
  13023. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  13024. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  13025. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  13026. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  13027. 9. 本合同余额欠款须在拍照前付清.\r\n\
  13028. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  13029. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  13030. 还.";
  13031. }
  13032. AutoDraw(m_Print, StrRect, str, 1.8);
  13033. }
  13034. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13035. dlg.m_pDC =m_Print.GetPDC() ;
  13036. dlg.m_mode=1;
  13037. if(aa==0)
  13038. {
  13039. if(dlg.DoModal ()!=IDOK)
  13040. return;
  13041. printcot=dlg.m_num;
  13042. }
  13043. //结束打印
  13044. m_Print.EndPage();
  13045. m_Print.EndPrint();
  13046. }
  13047. }
  13048. void CMainFrame::InsideMsg()
  13049. {
  13050. ///内部消息
  13051. CString str;
  13052. g_sendhead.bsql=0;
  13053. g_sendhead.code[0]=126;
  13054. g_sendhead.tabcount=1;
  13055. g_bNoConnDlg=1;
  13056. g_pMainWnd->ProcessChatMessageRequest2(1);g_bNoConnDlg=0;
  13057. if(g_bSendOK==0)return;
  13058. CArray<CStringArray, CStringArray>m_List1array;
  13059. DataToArray(&g_List1array);//, &m_List1array);
  13060. m_List1array.SetSize(g_List1array.GetSize ());
  13061. for(int i=0; i<g_List1array.GetSize (); i++)
  13062. {
  13063. m_List1array.ElementAt (i).Copy (g_List1array.ElementAt (i));
  13064. }
  13065. str=","+g_user.name+",";
  13066. for( i=g_List1array.GetSize()-1; i>=0; i--)
  13067. {
  13068. CString receivers2=g_List1array.ElementAt (i).ElementAt (4);
  13069. receivers2.TrimLeft(",");
  13070. receivers2.TrimRight(",");
  13071. receivers2=","+receivers2+",";
  13072. CString receivers=g_List1array.ElementAt (i).ElementAt (3);
  13073. receivers.TrimLeft(",");
  13074. receivers.TrimRight(",");
  13075. receivers=","+receivers+",";
  13076. if(receivers.Find(str)==-1)
  13077. g_List1array.RemoveAt(i);
  13078. else if(receivers2.Find(str)!=-1)
  13079. g_List1array.RemoveAt(i);
  13080. }
  13081. if(g_List1array.GetSize())
  13082. {
  13083. ShowMsg dlg;
  13084. dlg.DoModal();
  13085. }
  13086. for( i=m_List1array.GetSize()-1; i>=0; i--)
  13087. {
  13088. CString receivers2=m_List1array.ElementAt (i).ElementAt (4);
  13089. receivers2.TrimLeft(",");
  13090. receivers2.TrimRight(",");
  13091. receivers2=","+receivers2+",";
  13092. CString receivers=m_List1array.ElementAt (i).ElementAt (3);
  13093. if(receivers!="")
  13094. m_List1array.RemoveAt(i);
  13095. else if(receivers2.Find(str)!=-1)
  13096. m_List1array.RemoveAt(i);
  13097. }
  13098. if(m_List1array.GetSize())
  13099. {
  13100. SendInsideMsg2 dlg;
  13101. dlg.m_bShow=1;
  13102. dlg.m_pArray=&m_List1array;
  13103. dlg.DoModal ();
  13104. }
  13105. }
  13106. //定金
  13107. void CMainFrame::PrintHireDress(CString m_id)
  13108. {
  13109. int printcot=1;
  13110. for(int aa=0; aa<printcot; aa++)
  13111. {
  13112. CPrintRX m_Print;
  13113. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13114. {
  13115. m_Print.InitToPrint(NULL, 1);
  13116. }
  13117. else
  13118. {
  13119. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  13120. if(name.IsEmpty ())
  13121. m_Print.InitToPrint(NULL, 1);
  13122. else
  13123. {
  13124. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13125. if(nret==-1 && aa==0)
  13126. {
  13127. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13128. }
  13129. }
  13130. }
  13131. m_Print.StartPrint();
  13132. m_Print.StartPage();
  13133. LoadRect load;
  13134. load.SetLiaPath ("21.lia");
  13135. load.SetMargins(0,0);
  13136. if(!load.Load ())return;
  13137. int i;
  13138. //////////////////////////////////////////////////////////////
  13139. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  13140. g_sendhead.bsql=0;
  13141. g_sendhead.code[0]=73;
  13142. g_sendhead.code[1]=74;
  13143. g_sendhead.code[2]=52;
  13144. g_sendhead.tabcount=3;
  13145. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13146. if(g_bSendOK==0)
  13147. {
  13148. return ;
  13149. }
  13150. CArray<CStringArray, CStringArray>dresshirearray;
  13151. CArray<CStringArray, CStringArray>dresshiredataarray;
  13152. CArray<CStringArray, CStringArray>clientarray;
  13153. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13154. if(dresshirearray.GetSize ()==0)return;
  13155. CString m_remark = dresshirearray.ElementAt (0).ElementAt (10);
  13156. CString m_date1 = dresshirearray.ElementAt (0).ElementAt (7);
  13157. CString m_date2 = dresshirearray.ElementAt (0).ElementAt (8);
  13158. CString m_inputdate = dresshirearray.ElementAt (0).ElementAt (6);
  13159. if(clientarray.GetSize ()==0)return ;
  13160. CString m_name2=clientarray.ElementAt (0).ElementAt (2);
  13161. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  13162. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  13163. CString m_time3=clientarray.ElementAt (0).ElementAt (20);
  13164. CString sItem;
  13165. for( i=0; i<dresshiredataarray.GetSize (); i++)
  13166. {
  13167. sItem+=dresshiredataarray.ElementAt (i).ElementAt (1);sItem+=" ";
  13168. sItem+=dresshiredataarray.ElementAt (i).ElementAt (2);
  13169. sItem+=" 数量:";
  13170. sItem+=dresshiredataarray.ElementAt (i).ElementAt (3)+"\r\n";
  13171. }
  13172. ////////////////////////////////////////////////////////////////
  13173. int rcpos=-1;
  13174. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  13175. m_Print.SetFontFace(17, 1, "宋体");
  13176. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13177. StrRect=load.m_rcarray .ElementAt (++rcpos);
  13178. m_Print.SetFontFace(10, 1, "宋体");
  13179. m_Print.DrawText((LPTSTR)(LPCTSTR)(m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13180. CStringArray strarray;
  13181. strarray.Add("客户姓名");
  13182. strarray.Add("客户电话");
  13183. strarray.Add("预定日期");
  13184. strarray.Add("结婚日期");
  13185. strarray.Add("取件日期");
  13186. strarray.Add("归还日期");
  13187. strarray.Add("本店地址");
  13188. strarray.Add("电 话");
  13189. strarray.Add("客户地址");
  13190. strarray.Add("客户签名");
  13191. for( i=2; i<12; i++)
  13192. {
  13193. StrRect=load.m_rcarray .ElementAt (i);
  13194. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13195. }
  13196. strarray.RemoveAll();
  13197. strarray.Add(m_name2);
  13198. strarray.Add(m_phone2);
  13199. strarray.Add(m_inputdate);
  13200. strarray.Add(m_time3);
  13201. strarray.Add(m_date1);
  13202. strarray.Add(m_date2);
  13203. strarray.Add(g_cominfoarray.ElementAt (0).ElementAt (12));
  13204. strarray.Add(g_cominfoarray.ElementAt (0).ElementAt (11));
  13205. strarray.Add(m_addr2);
  13206. strarray.Add("");
  13207. for( i=12; i<22; i++)
  13208. {
  13209. StrRect=load.m_rcarray .ElementAt (i);
  13210. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13211. m_Print.DrawRect2(StrRect, 2);
  13212. }
  13213. for( i=25; i<30; i++)
  13214. {
  13215. StrRect=load.m_rcarray .ElementAt (i);
  13216. m_Print.DrawRect2(StrRect, 1);
  13217. }
  13218. StrRect=load.m_rcarray .ElementAt (22);
  13219. StrRect.top +=7;
  13220. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13221. StrRect=load.m_rcarray .ElementAt (23);
  13222. StrRect.top +=7;
  13223. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13224. StrRect=load.m_rcarray .ElementAt (24);
  13225. StrRect.top +=7;
  13226. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13227. StrRect=load.m_rcarray .ElementAt (25);StrRect.left +=75;StrRect.top +=5;
  13228. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13229. StrRect=load.m_rcarray .ElementAt (26);StrRect.left +=75;StrRect.top +=5;
  13230. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13231. StrRect=load.m_rcarray .ElementAt (27);StrRect.left +=75;StrRect.top +=5;
  13232. CString str=(g_cominfoarray.ElementAt (0).ElementAt (132));
  13233. if(str.IsEmpty())
  13234. {
  13235. str="\
  13236. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13237. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13238. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13239. 4. 如有破损酌情赔偿.";
  13240. }
  13241. AutoDraw(m_Print, StrRect, str, 1.5);
  13242. PrintPreview dlg;
  13243. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13244. dlg.m_pDC =m_Print.GetPDC() ;
  13245. if(aa==0)
  13246. {
  13247. if(dlg.DoModal ()!=IDOK)
  13248. return;
  13249. printcot=dlg.m_num;
  13250. }
  13251. //结束打印
  13252. m_Print.EndPage();
  13253. m_Print.EndPrint();
  13254. }
  13255. }
  13256. // ****************************************************************************
  13257. // Jeff:
  13258. // 函数:PrintHireDress2
  13259. // 无参;
  13260. // 调用者:DinDanFrom.cpp
  13261. // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
  13262. // 当订单数大于1000,设置连接公司服务器开关量为真;
  13263. // ****************************************************************************
  13264. void CMainFrame::PrintHireDress2()
  13265. {
  13266. if(g_ncot>1000)g_bSendLYFZ=1;
  13267. // g_pMainWnd->SetTimer (7, 3000, NULL);
  13268. }
  13269. void CMainFrame::PrintTakeForm2(CArray<CStringArray, CStringArray>*Listarray)
  13270. {
  13271. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"选片客人明细表";
  13272. int pages=Listarray->GetSize ()/46;
  13273. if(Listarray->GetSize ()%46)pages++;
  13274. for(int aa=0; aa<pages; aa++)
  13275. {
  13276. PrintPreview dlg;
  13277. CPrintRX m_Print;
  13278. m_Print.InitToPrint(NULL, 1);
  13279. m_Print.StartPrint();
  13280. m_Print.StartPage();
  13281. CRect mainrc(0,0,560,793);
  13282. float fscale;
  13283. {
  13284. int w,h;
  13285. m_Print.GetWidHei(w , h );
  13286. fscale=(float)w/(float)h;
  13287. }
  13288. mainrc.DeflateRect (25, 40, 10, 0);
  13289. CRect rc,rc2;
  13290. rc=mainrc;
  13291. rc.bottom =rc.top ;
  13292. rc.top -=20;
  13293. m_Print.SetFontFace(16, 1, "黑体");
  13294. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13295. m_Print.SetFontFace(9, 1, "宋体");
  13296. CString str;
  13297. int wid[5]={200,110,70,85,62};
  13298. int hei=16;
  13299. if(fscale>0.71)hei=15;
  13300. rc=mainrc;
  13301. rc.bottom =rc.top +hei;
  13302. for(int i=0; i<47; i++)
  13303. {
  13304. rc2.top =rc.top +i*hei;
  13305. rc2.bottom =rc.bottom +i*hei;
  13306. rc2.left =rc.left ;
  13307. rc2.right =rc.left +wid[0];
  13308. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13309. for(int j=0; j<5; j++)
  13310. {
  13311. m_Print.DrawRect2(rc2, 1);
  13312. if(Listarray->GetSize ()>aa*46+i)
  13313. {
  13314. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13315. rc2.left +=3;
  13316. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13317. rc2.left -=3;
  13318. }
  13319. rc2.left +=wid[j];
  13320. rc2.right =rc2.left+wid[j+1];
  13321. }
  13322. }
  13323. rc2.top +=2;
  13324. rc2.left +=2;rc2.right =mainrc.right+4;
  13325. m_Print.SetFontFace(8, 1, "宋体");
  13326. str.Format (" 页:%d/%d", aa+1, pages);
  13327. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13328. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13329. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13330. dlg.m_pDC =m_Print.GetPDC() ;
  13331. // dlg.m_mode=1;
  13332. if(aa==0)
  13333. {
  13334. if(dlg.DoModal ()!=IDOK)
  13335. return;
  13336. }
  13337. //结束打印
  13338. m_Print.EndPage();
  13339. m_Print.EndPrint();
  13340. }
  13341. }
  13342. void CMainFrame::PrintTakeForm3(CArray<CStringArray, CStringArray>*Listarray)
  13343. {
  13344. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"看设计客人明细表";
  13345. int pages=Listarray->GetSize ()/46;
  13346. if(Listarray->GetSize ()%46)pages++;
  13347. for(int aa=0; aa<pages; aa++)
  13348. {
  13349. PrintPreview dlg;
  13350. CPrintRX m_Print;
  13351. m_Print.InitToPrint(NULL, 1);
  13352. m_Print.StartPrint();
  13353. m_Print.StartPage();
  13354. CRect mainrc(0,0,560,793);
  13355. float fscale;
  13356. {
  13357. int w,h;
  13358. m_Print.GetWidHei(w , h );
  13359. fscale=(float)w/(float)h;
  13360. }
  13361. mainrc.DeflateRect (25, 40, 10, 0);
  13362. CRect rc,rc2;
  13363. rc=mainrc;
  13364. rc.bottom =rc.top ;
  13365. rc.top -=20;
  13366. m_Print.SetFontFace(16, 1, "黑体");
  13367. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13368. m_Print.SetFontFace(9, 1, "宋体");
  13369. CString str;
  13370. int wid[5]={200,110,70,85,62};
  13371. int hei=16;
  13372. if(fscale>0.71)hei=15;
  13373. rc=mainrc;
  13374. rc.bottom =rc.top +hei;
  13375. for(int i=0; i<47; i++)
  13376. {
  13377. rc2.top =rc.top +i*hei;
  13378. rc2.bottom =rc.bottom +i*hei;
  13379. rc2.left =rc.left ;
  13380. rc2.right =rc.left +wid[0];
  13381. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13382. for(int j=0; j<5; j++)
  13383. {
  13384. m_Print.DrawRect2(rc2, 1);
  13385. if(Listarray->GetSize ()>aa*46+i)
  13386. {
  13387. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13388. rc2.left +=3;
  13389. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13390. rc2.left -=3;
  13391. }
  13392. rc2.left +=wid[j];
  13393. rc2.right =rc2.left+wid[j+1];
  13394. }
  13395. }
  13396. rc2.top +=2;
  13397. rc2.left +=2;rc2.right =mainrc.right+4;
  13398. m_Print.SetFontFace(8, 1, "宋体");
  13399. str.Format (" 页:%d/%d", aa+1, pages);
  13400. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13401. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13402. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13403. dlg.m_pDC =m_Print.GetPDC() ;
  13404. // dlg.m_mode=1;
  13405. if(aa==0)
  13406. {
  13407. if(dlg.DoModal ()!=IDOK)
  13408. return;
  13409. }
  13410. //结束打印
  13411. m_Print.EndPage();
  13412. m_Print.EndPrint();
  13413. }
  13414. }
  13415. void CMainFrame::PrintTakeForm4(CArray<CStringArray, CStringArray>*Listarray)
  13416. {
  13417. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"取件客人明细表";
  13418. int pages=Listarray->GetSize ()/46;
  13419. if(Listarray->GetSize ()%46)pages++;
  13420. for(int aa=0; aa<pages; aa++)
  13421. {
  13422. PrintPreview dlg;
  13423. CPrintRX m_Print;
  13424. m_Print.InitToPrint(NULL, 1);
  13425. m_Print.StartPrint();
  13426. m_Print.StartPage();
  13427. CRect mainrc(0,0,560,793);
  13428. float fscale;
  13429. {
  13430. int w,h;
  13431. m_Print.GetWidHei(w , h );
  13432. fscale=(float)w/(float)h;
  13433. }
  13434. mainrc.DeflateRect (25, 40, 10, 0);
  13435. CRect rc,rc2;
  13436. rc=mainrc;
  13437. rc.bottom =rc.top ;
  13438. rc.top -=20;
  13439. m_Print.SetFontFace(16, 1, "黑体");
  13440. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13441. m_Print.SetFontFace(9, 1, "宋体");
  13442. CString str;
  13443. int wid[5]={200,110,70,85,62};
  13444. int hei=16;
  13445. if(fscale>0.71)hei=15;
  13446. rc=mainrc;
  13447. rc.bottom =rc.top +hei;
  13448. for(int i=0; i<47; i++)
  13449. {
  13450. rc2.top =rc.top +i*hei;
  13451. rc2.bottom =rc.bottom +i*hei;
  13452. rc2.left =rc.left ;
  13453. rc2.right =rc.left +wid[0];
  13454. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13455. for(int j=0; j<5; j++)
  13456. {
  13457. m_Print.DrawRect2(rc2, 1);
  13458. if(Listarray->GetSize ()>aa*46+i)
  13459. {
  13460. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13461. rc2.left +=3;
  13462. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13463. rc2.left -=3;
  13464. }
  13465. rc2.left +=wid[j];
  13466. rc2.right =rc2.left+wid[j+1];
  13467. }
  13468. }
  13469. rc2.top +=2;
  13470. rc2.left +=2;rc2.right =mainrc.right+4;
  13471. m_Print.SetFontFace(8, 1, "宋体");
  13472. str.Format (" 页:%d/%d", aa+1, pages);
  13473. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13474. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13475. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13476. dlg.m_pDC =m_Print.GetPDC() ;
  13477. // dlg.m_mode=1;
  13478. if(aa==0)
  13479. {
  13480. if(dlg.DoModal ()!=IDOK)
  13481. return;
  13482. }
  13483. //结束打印
  13484. m_Print.EndPage();
  13485. m_Print.EndPrint();
  13486. }
  13487. }
  13488. void CMainFrame::PrintTakeForm5(CArray<CStringArray, CStringArray>*Listarray)
  13489. {
  13490. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"婚庆客人明细表";
  13491. int pages=Listarray->GetSize ()/46;
  13492. if(Listarray->GetSize ()%46)pages++;
  13493. for(int aa=0; aa<pages; aa++)
  13494. {
  13495. PrintPreview dlg;
  13496. CPrintRX m_Print;
  13497. m_Print.InitToPrint(NULL, 1);
  13498. m_Print.StartPrint();
  13499. m_Print.StartPage();
  13500. CRect mainrc(0,0,560,793);
  13501. float fscale;
  13502. {
  13503. int w,h;
  13504. m_Print.GetWidHei(w , h );
  13505. fscale=(float)w/(float)h;
  13506. }
  13507. mainrc.DeflateRect (25, 40, 10, 0);
  13508. CRect rc,rc2;
  13509. rc=mainrc;
  13510. rc.bottom =rc.top ;
  13511. rc.top -=20;
  13512. m_Print.SetFontFace(16, 1, "黑体");
  13513. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13514. m_Print.SetFontFace(8, 1, "宋体");
  13515. CString str;
  13516. int wid[7]={165,90,90,45,45,60,35};
  13517. int hei=16;
  13518. if(fscale>0.71)hei=15;
  13519. rc=mainrc;
  13520. rc.bottom =rc.top +hei;
  13521. for(int i=0; i<47; i++)
  13522. {
  13523. rc2.top =rc.top +i*hei;
  13524. rc2.bottom =rc.bottom +i*hei;
  13525. rc2.left =rc.left ;
  13526. rc2.right =rc.left +wid[0];
  13527. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13528. for(int j=0; j<7; j++)
  13529. {
  13530. m_Print.DrawRect2(rc2, 1);
  13531. if(Listarray->GetSize ()>aa*46+i)
  13532. {
  13533. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13534. rc2.left +=3;
  13535. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13536. rc2.left -=3;
  13537. }
  13538. rc2.left +=wid[j];
  13539. rc2.right =rc2.left+wid[j+1];
  13540. }
  13541. }
  13542. rc2.top +=2;
  13543. rc2.left +=2;rc2.right =mainrc.right+4;
  13544. m_Print.SetFontFace(8, 1, "宋体");
  13545. str.Format (" 页:%d/%d", aa+1, pages);
  13546. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13547. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13548. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13549. dlg.m_pDC =m_Print.GetPDC() ;
  13550. // dlg.m_mode=1;
  13551. if(aa==0)
  13552. {
  13553. if(dlg.DoModal ()!=IDOK)
  13554. return;
  13555. }
  13556. //结束打印
  13557. m_Print.EndPage();
  13558. m_Print.EndPrint();
  13559. }
  13560. }
  13561. void CMainFrame::PrintTakeForm1(CArray<CStringArray, CStringArray>*Listarray)
  13562. {
  13563. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"拍照客人明细表";
  13564. int pages=Listarray->GetSize ()/46;
  13565. if(Listarray->GetSize ()%46)pages++;
  13566. for(int aa=0; aa<pages; aa++)
  13567. {
  13568. PrintPreview dlg;
  13569. CPrintRX m_Print;
  13570. m_Print.InitToPrint(NULL, 1);
  13571. m_Print.StartPrint();
  13572. m_Print.StartPage();
  13573. CRect mainrc(0,0,560,793);
  13574. float fscale;
  13575. {
  13576. int w,h;
  13577. m_Print.GetWidHei(w , h );
  13578. fscale=(float)w/(float)h;
  13579. }
  13580. mainrc.DeflateRect (25, 40, 10, 0);
  13581. CRect rc,rc2;
  13582. rc=mainrc;
  13583. rc.bottom =rc.top ;
  13584. rc.top -=20;
  13585. m_Print.SetFontFace(16, 1, "黑体");
  13586. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13587. m_Print.SetFontFace(8, 1, "宋体");
  13588. CString str;
  13589. int wid[7]={165,60,90,60,60,60,35};
  13590. int hei=16;
  13591. if(fscale>0.71)hei=15;
  13592. rc=mainrc;
  13593. rc.bottom =rc.top +hei;
  13594. for(int i=0; i<47; i++)
  13595. {
  13596. rc2.top =rc.top +i*hei;
  13597. rc2.bottom =rc.bottom +i*hei;
  13598. rc2.left =rc.left ;
  13599. rc2.right =rc.left +wid[0];
  13600. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13601. for(int j=0; j<7; j++)
  13602. {
  13603. m_Print.DrawRect2(rc2, 1);
  13604. if(Listarray->GetSize ()>aa*46+i)
  13605. {
  13606. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13607. rc2.left +=3;
  13608. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13609. rc2.left -=3;
  13610. }
  13611. rc2.left +=wid[j];
  13612. rc2.right =rc2.left+wid[j+1];
  13613. }
  13614. }
  13615. rc2.top +=2;
  13616. rc2.left +=2;rc2.right =mainrc.right+4;
  13617. m_Print.SetFontFace(8, 1, "宋体");
  13618. str.Format (" 页:%d/%d", aa+1, pages);
  13619. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13620. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13621. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13622. dlg.m_pDC =m_Print.GetPDC() ;
  13623. // dlg.m_mode=1;
  13624. if(aa==0)
  13625. {
  13626. if(dlg.DoModal ()!=IDOK)
  13627. return;
  13628. }
  13629. //结束打印
  13630. m_Print.EndPage();
  13631. m_Print.EndPrint();
  13632. }
  13633. }
  13634. void CMainFrame::ShowMonthForm2()
  13635. {
  13636. }
  13637. // dlg;