MainFrm.cpp 441 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916
  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. #ifdef VC60
  284. UINT CMainFrame::OnNcHitTest(CPoint point)
  285. {
  286. if(CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
  287. return HTCLIENT;
  288. return CWnd::OnNcHitTest(point);
  289. }
  290. #else
  291. LRESULT CMainFrame::OnNcHitTest(CPoint point)
  292. {
  293. if(CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
  294. return HTCLIENT;
  295. return CWnd::OnNcHitTest(point);
  296. }
  297. #endif
  298. void CMainFrame::OnNcLButtonDblClk(UINT nFlags, CPoint point)
  299. {
  300. if(nFlags != HTCAPTION)
  301. CMDIFrameWnd::OnNcLButtonDblClk(nFlags, point);
  302. }
  303. CMainFrame::CMainFrame()
  304. {
  305. // TODO: add member initialization code here
  306. SetConnectionID(INVALID_SOCKET);
  307. m_pMainFrimDlg2=NULL;
  308. CString version = _T ("Version 1.0");
  309. m_bCheckF2F3=AfxGetApp()->GetProfileInt (version, "f2f3", 0);
  310. if(0==::PathFileExists(g_mainpath+"\\skin\\5.lia"))
  311. {
  312. g_bNoLoginLia=1;
  313. }
  314. }
  315. CMainFrame::~CMainFrame()
  316. {
  317. if(m_pMainFrimDlg2)
  318. {
  319. m_pMainFrimDlg2->DestroyWindow ();
  320. delete m_pMainFrimDlg2;
  321. }
  322. }
  323. void InTheMe(HWND m_hWnd)
  324. {
  325. BOOL bXpVisualStyle=FALSE;
  326. OSVERSIONINFO osvi;
  327. osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  328. ::GetVersionEx (&osvi);
  329. if((osvi.dwPlatformId==VER_PLATFORM_WIN32_NT)&&(osvi.dwMajorVersion>=5)&&(osvi.dwMinorVersion>=1))
  330. {
  331. HMODULE hUxTheme=::LoadLibrary(_T( "UxTheme.dll"));
  332. POPENTHEMEDATA pOpenThemeData;
  333. PCLOSETHEMEDATA pCloseThemeData;
  334. if(hUxTheme!=NULL)
  335. {
  336. pOpenThemeData=(POPENTHEMEDATA)::GetProcAddress(hUxTheme, "OpenThemeData");
  337. pCloseThemeData=(PCLOSETHEMEDATA)::GetProcAddress (hUxTheme, "CloseThemeData");
  338. HTHEME hButtonTheme=(*pOpenThemeData)(m_hWnd,L"BUTTON");
  339. if(hButtonTheme!=NULL)
  340. bXpVisualStyle=TRUE;
  341. (*pCloseThemeData)(hButtonTheme);
  342. }
  343. ::FreeLibrary(hUxTheme);
  344. }
  345. if(bXpVisualStyle)
  346. AfxMessageBox(_T( "正在使用视觉主题 "));
  347. else
  348. AfxMessageBox(_T( "没有使用视觉主题 "));
  349. }
  350. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  351. {
  352. if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  353. {
  354. // Jeff.创建失败的可能性小,加日志输出;
  355. return -1;
  356. }
  357. if(g_server.Find (".ly.com")!=-1)
  358. {
  359. g_ntimeout=30000;
  360. }
  361. if(::PathFileExists (g_mainpath+"\\logo.ico"))
  362. {
  363. Bitmap *bmp=NULL;
  364. LoadImageFromFile (&bmp, g_mainpath+"\\logo.ico");
  365. // m_hIcon = AfxGetApp()->LoadIcon(g_mainpath+"\\logo.ico");
  366. bmp->GetHICON(&m_hIcon);
  367. delete bmp;
  368. SetIcon(m_hIcon, TRUE); // Set big icon
  369. SetIcon(m_hIcon, FALSE); // Set small icon
  370. }
  371. if(!m_wndClient.SubclassWindow (m_hWndMDIClient))
  372. {
  373. // Jeff.创建失败的可能性小,加日志输出;
  374. return -1;
  375. }
  376. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  377. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  378. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  379. {
  380. // Jeff.创建失败的可能性小,加日志输出;
  381. TRACE0("Failed to create toolbar\n");
  382. return -1; // fail to create
  383. }
  384. m_wndToolBar.LoadTrueColorToolBar(90, IDB_NORMAL, 0, IDB_DISABLE);
  385. // second toolbar must have different ID
  386. if (!m_wndToolBar2.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT | CBRS_NOALIGN,
  387. AFX_IDW_CONTROLBAR_FIRST + 32) ||
  388. !m_wndToolBar2.LoadToolBar(IDR_TOOLBAR1))
  389. {
  390. // Jeff.创建失败的可能性小,加日志输出;
  391. TRACE0("Failed to create toolbar\n");
  392. return -1; // fail to create
  393. }
  394. #ifndef NEW_SKIN
  395. if (!m_wndStatusBar.Create(this) ||
  396. !m_wndStatusBar.SetIndicators(indicators,
  397. sizeof(indicators)/sizeof(UINT)))
  398. {
  399. // Jeff.创建失败的可能性小,加日志输出;
  400. TRACE0("Failed to create status bar\n");
  401. return -1; // fail to create
  402. }
  403. m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_NORMAL,200);
  404. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  405. #endif
  406. // TODO: Delete these three lines if you don't want the toolbar to
  407. // be dockable
  408. NewMenu2();
  409. ::GetWindowRect (this->m_hWndMDIClient, g_rc);
  410. /* CString ss;
  411. ss.Format ("%d,%d,%d,%d", g_rc.left , g_rc.top , g_rc.right , g_rc.bottom );
  412. AfxMessageBox(ss);*/
  413. g_pMainWnd=this;
  414. m_wndToolBar2.Init ();
  415. g_rc.top +=38;
  416. g_rc.left +=160;
  417. /* m_WidthScale = (float)g_rc.Width ()/722;
  418. m_HeightScale = (float)g_rc.Height ()/533;*/
  419. g_user.bLongin =0;
  420. SetTimer(1, 100, NULL);
  421. return 0;
  422. }
  423. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  424. {
  425. if( !CMDIFrameWnd::PreCreateWindow(cs) )
  426. return FALSE;
  427. // TODO: Modify the Window class or styles here by modifying
  428. // the CREATESTRUCT cs
  429. cs.style&=~WS_MAXIMIZEBOX;
  430. cs.style&=~WS_THICKFRAME;
  431. cs.lpszName=g_title+"影楼管理系统";
  432. cs.style&=~FWS_ADDTOTITLE;
  433. RECT rect;
  434. HWND hWnd = ::FindWindow("Shell_TrayWnd", 0);
  435. ::GetWindowRect(hWnd,&rect);
  436. cs.x=0;
  437. cs.y=0;
  438. cs.cx=GetSystemMetrics(SM_CXSCREEN);
  439. cs.cy=GetSystemMetrics(SM_CYSCREEN)-(rect.bottom -rect.top)+3;
  440. return TRUE;
  441. }
  442. /////////////////////////////////////////////////////////////////////////////
  443. // CMainFrame diagnostics
  444. #ifdef _DEBUG
  445. void CMainFrame::AssertValid() const
  446. {
  447. CMDIFrameWnd::AssertValid();
  448. }
  449. void CMainFrame::Dump(CDumpContext& dc) const
  450. {
  451. CMDIFrameWnd::Dump(dc);
  452. }
  453. #endif //_DEBUG
  454. /////////////////////////////////////////////////////////////////////////////
  455. // CMainFrame message handlers
  456. void CMainFrame::OnDestroy()
  457. {
  458. //WriteLog("退出系统");//Jeff.add
  459. OnDisconnect();
  460. Transport_UnInit();
  461. m_Mdi.DeleteAll();
  462. if(g_hmouse)UnhookWindowsHookEx(g_hmouse);
  463. CMDIFrameWnd::OnDestroy();
  464. }
  465. void CMainFrame::OnClose()
  466. {
  467. g_bShowBar=0;
  468. if(m_Mdi.MainClose())
  469. CMDIFrameWnd::OnClose();
  470. }//连接
  471. void CMainFrame::NewMenu2()
  472. {
  473. CMenu *pMemu=GetMenu();
  474. #ifdef BASIC_VERSION
  475. CMenu* submenu = pMemu->GetSubMenu(1);
  476. //submenu->RemoveMenu (IDM_StaffAchievementShow, MF_BYCOMMAND );//Jeff del 2014.06.16
  477. submenu->RemoveMenu (IDM_salaryset, MF_BYCOMMAND );
  478. #endif
  479. #if 0 // 此机用选片菜单项,去掉不用;
  480. {
  481. CString version = _T ("Version 1.0");
  482. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  483. if(checked)
  484. {
  485. CMenu* submenu = pMemu->GetSubMenu(1);
  486. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  487. }
  488. }
  489. #endif
  490. #ifndef BASIC_VERSION
  491. {
  492. CString version = _T ("Version 1.0");
  493. BOOL checked=AfxGetApp()->GetProfileInt (version, "status2", 0);
  494. if(checked)
  495. {
  496. #if 0 // Jeff:去掉菜单,此机用于员工业绩查看的菜单选项;
  497. CMenu* submenu = pMemu->GetSubMenu(1);
  498. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  499. #endif
  500. g_bStaffAchievementShow=1;
  501. SetTimer(3, 100, NULL);
  502. }
  503. }
  504. #endif
  505. if(g_bShowOK==0)
  506. {
  507. CMenu* submenu = pMemu->GetSubMenu(2);
  508. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  509. }
  510. }
  511. HMENU CMainFrame::NewMenu()
  512. {
  513. //设置菜单为XP风格 IDM_SHOWHIS
  514. BCMenu::SetMenuDrawMode(1);
  515. //若取消下面这句注释,则可看到菜单的图标栏和文字栏背景颜色为白色,
  516. //文字颜色为蓝色,选中项的前景色为紫红色
  517. //m_menuXP.SetMenuXPItemColor(0x00FFFFFF,0x00FFFFFF,0x00FF0000,0x00FF00FF);
  518. // 设置菜单中图标大小为32×32
  519. // m_menuXP.SetIconSize(32,32);
  520. // 加载菜单资源
  521. m_menuXP.LoadMenu(IDR_MAINFRAME);
  522. // 加载菜单对应的工具栏资源
  523. // m_menuXP.LoadToolbar(IDR_MAINFRAME);
  524. /*由于菜单左边栏中默认的图标大小为16×16,而与之对应的Toolbar中图标大小为32×32,
  525. 因此菜单中图标不能正确显示,只显示出工具栏中图标的左上角部分,所以修改菜单中各
  526. 项对应的图标为24b色位图资源IDB_***,或者在LoadMenu之前调用SetIconSize,设置菜单
  527. 中图标大小为32×32*/
  528. // m_menuXP.SetIconSize(24,24);
  529. // m_menuXP.ModifyODMenu(NULL,IDM_YWBU,IDB_YW); //
  530. /* m_menuXP.ModifyODMenu(NULL,ID_FILE_OPEN,IDB_BITMAP5);
  531. m_menuXP.ModifyODMenu(NULL,ID_FILE_SAVE,IDB_BITMAP7);
  532. m_menuXP.ModifyODMenu(NULL,ID_FILE_PRINT,IDB_BITMAP6);
  533. m_menuXP.ModifyODMenu(NULL,ID_APP_ABOUT,IDB_BITMAP3);
  534. m_menuXP.ModifyODMenu(NULL,ID_APP_EXIT,IDB_BITMAP2);*/
  535. // m_menuXP.EnableMenuItem (0, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  536. // m_menuXP.EnableMenuItem (2, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  537. // m_menuXP.EnableMenuItem (3, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  538. // m_menuXP.EnableMenuItem (4, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  539. // m_menuXP.EnableMenuItem (5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  540. // m_menuXP.EnableMenuItem (8, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  541. #if 0 // Jeff此机用选片菜单项不用;
  542. {
  543. CString version = _T ("Version 1.0");
  544. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  545. if(checked)
  546. {
  547. CMenu* submenu = m_menuXP.GetSubMenu(1);
  548. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  549. }
  550. }
  551. #endif
  552. {
  553. CString version = _T ("Version 1.0");
  554. BOOL checked=AfxGetApp()->GetProfileInt (version, "status2", 0);
  555. if(checked)
  556. {
  557. #if 0 // Jeff:去掉此机用于员工业绩查看的菜单选项;
  558. CMenu* submenu = m_menuXP.GetSubMenu(1);
  559. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  560. #endif
  561. g_bStaffAchievementShow=1;
  562. SetTimer(3, 100, NULL);
  563. }
  564. }
  565. if(g_bShowOK==0)
  566. {
  567. CMenu* submenu = m_menuXP.GetSubMenu(2);
  568. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  569. }
  570. return(m_menuXP.Detach());
  571. }
  572. ///////////////////////////////////////////////////////
  573. //减少代码
  574. #define OPEN_MENU(x) m_Mdi.Append(pName, RUNTIME_CLASS(x), IDR_MAINFRAME, this, nID)
  575. //响应菜单命令
  576. void CMainFrame::OnCommandMenu(UINT nID)
  577. {
  578. if(nID>=2000 && nID<=2100)
  579. {
  580. OnBranchData(nID);
  581. return;
  582. }
  583. if(g_user.bLongin==0)
  584. {
  585. if(g_bNoLoginLia)
  586. {
  587. Login dlg;
  588. dlg.SetLiaPath ("5.lia");
  589. dlg.DoModal();
  590. }
  591. else
  592. {
  593. Login3 dlg;
  594. dlg.SetLiaPath ("5.lia");
  595. dlg.DoModal();
  596. }
  597. return;
  598. if(g_user.bLongin==0)return;
  599. }
  600. else
  601. {
  602. InsideMsg();
  603. }
  604. ResetTimer();
  605. if(nID>=1000 && nID<=1100)
  606. {
  607. OnHistory(nID);
  608. return;
  609. }
  610. LPSTR pName ;
  611. //打开窗口
  612. switch(nID)
  613. {
  614. case IDM_PayOutSet:
  615. {
  616. if(IsHasRights(16)==0)return;
  617. PayOutSet dlg;
  618. dlg.DoModal ();
  619. return;
  620. }
  621. case IDM_SPLB:
  622. {
  623. if(IsHasRightsnew(29)==0)return;
  624. SPLBDlg dlg;
  625. dlg.DoModal ();
  626. return;
  627. }
  628. case IDM_JD:
  629. {
  630. if(IsHasRightsnew(49)==0)return;
  631. SPLBDlg dlg;
  632. dlg.m_mode=1;
  633. dlg.DoModal ();
  634. return;
  635. }
  636. case IDM_AREA:
  637. {
  638. if(IsHasRightsnew(47)==0)return;
  639. AreaDlg dlg;
  640. dlg.DoModal ();
  641. return;
  642. }
  643. case IDM_Psw:
  644. {
  645. Psw dlg;
  646. dlg.DoModal ();
  647. return;
  648. }
  649. case IDM_Set:
  650. {
  651. if(IsHasRightsnew(49)==0)return;
  652. /* if(g_bBranchModify)
  653. {
  654. AfxMessageBox("系统设置不支持远程访问,请直接访问该分店!", MB_ICONINFORMATION);
  655. return;
  656. }*/
  657. Set dlg;
  658. dlg.DoModal();
  659. //if(dlg.DoModal() != IDOK)
  660. //{
  661. //AfxMessageBox("789");
  662. //Set::SetCancle();
  663. //}
  664. return;
  665. }
  666. case IDM_HIDEWINDOW:
  667. {
  668. HideWindow dlg;
  669. dlg.DoModal ();
  670. return;
  671. }
  672. case IDM_Logout:// Jeff.注销;
  673. {
  674. WriteLog("退出系统");//Jeff.add;
  675. g_user.bLongin=0;
  676. g_user.name.Empty();
  677. g_user.rights.Empty();
  678. g_user.account.Empty();
  679. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  680. g_pMainWnd2->RefreshOutlookBar();
  681. #ifndef NEW_SKIN
  682. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  683. #endif
  684. m_Mdi.CloseAll();
  685. #ifdef ENTERPRISE_VERSION
  686. g_branchname.Empty();
  687. g_branchip.Empty();
  688. g_pMainWnd->OnDisconnect();
  689. g_bBranchModify=0;
  690. #endif
  691. if(g_pMainWnd2)
  692. {
  693. g_pMainWnd2->DrawLogin();
  694. g_pMainWnd2->ShowBar(0);
  695. }
  696. g_hisyeararray.RemoveAll();
  697. g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
  698. g_brancharray.RemoveAll();
  699. g_pMainWnd->AddBranchMenu(&g_brancharray);
  700. if(g_bNoLoginLia)
  701. {
  702. Login dlg;
  703. dlg.SetLiaPath ("5.lia");
  704. dlg.DoModal();
  705. }
  706. else
  707. {
  708. Login3 dlg;
  709. dlg.SetLiaPath ("5.lia");
  710. dlg.DoModal();
  711. }
  712. if(g_user.bLongin==0)
  713. if(g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  714. return;
  715. }
  716. case IDM_TODAY:
  717. pName = (LPSTR)(LPCSTR)"历史订单";
  718. // OPEN_MENU(SalarySet3);
  719. OPEN_MENU(DinDanHistroy);
  720. break;
  721. case IDM_TAKECONTROL:
  722. pName = (LPSTR)(LPCSTR)"摄控表";
  723. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))
  724. OPEN_MENU(TodayForm2);
  725. else
  726. OPEN_MENU(TodayForm);
  727. break;
  728. case IDM_CLIENTMONEY:
  729. pName = (LPSTR)(LPCSTR)"客人付款";
  730. OPEN_MENU(ClientMoney);
  731. break;
  732. case IDM_TAKEAWAYBOOK:
  733. pName = (LPSTR)(LPCSTR)"发片/取件";
  734. OPEN_MENU(outsourcing);
  735. break;
  736. case IDM_CODE:
  737. pName = (LPSTR)(LPCSTR)"商品报表";
  738. OPEN_MENU(SPForm);
  739. break;
  740. case IDM_Daily:
  741. // if(IsHasRightsnew(22)==0)return;
  742. // pName = (LPSTR)(LPCSTR)"日财务表";
  743. // OPEN_MENU(DailyForm);
  744. pName = (LPSTR)(LPCSTR)"沟通助手";
  745. OPEN_MENU(InsideMsg);
  746. break;
  747. case IDM_ProcessAlarm:
  748. pName = (LPSTR)(LPCSTR)"流程监控";
  749. OPEN_MENU(ProcessAlarm);
  750. break;
  751. case IDM_DINDAN:
  752. // if(IsHasRights(7)==0)return;
  753. pName = (LPSTR)(LPCSTR)"订单报表";
  754. OPEN_MENU(DinDanFrom);
  755. break;
  756. case IDM_CLIENT:
  757. //if(IsHasRights(8)==0)return;
  758. pName = (LPSTR)(LPCSTR)"客户报表";
  759. OPEN_MENU(CClientForm);
  760. break;
  761. case IDM_PayOutInput:
  762. if(IsHasRightsnew(20)==0)return;
  763. pName = (LPSTR)(LPCSTR)"现金支出";
  764. OPEN_MENU(PayOutInput);
  765. break;
  766. case IDM_salaryset:
  767. if(IsHasRightsnew(25)==0)return;
  768. pName = (LPSTR)(LPCSTR)"工资设置";
  769. OPEN_MENU(SalarySet);
  770. break;
  771. case IDM_mysalary:
  772. if(IsHasRights(16)==0)return;
  773. pName = (LPSTR)(LPCSTR)"我的工资";
  774. OPEN_MENU(MySalary);
  775. break;
  776. case IDM_SP:
  777. // if(IsHasRightsnew(29)==0)return;
  778. pName = (LPSTR)(LPCSTR)"商品设置";
  779. OPEN_MENU(ShangPin);
  780. break;
  781. case IDM_WORKER:
  782. if(IsHasRightsnew(27)==0)return;
  783. pName = (LPSTR)(LPCSTR)"员工设置";
  784. OPEN_MENU(Worker);
  785. break;
  786. case IDM_TAOXI:
  787. if(IsHasRightsnew(30)==0)return;
  788. pName = (LPSTR)(LPCSTR)"套系设置";
  789. OPEN_MENU(TXDlg);
  790. break;
  791. case IDM_TAOXISP:
  792. if(IsHasRightsnew(30)==0)return;
  793. pName = (LPSTR)(LPCSTR)"套系赠送商品设置";
  794. OPEN_MENU(TXSPDlg);
  795. break;
  796. case IDM_Provider:
  797. if(IsHasRightsnew(32)==0)return;
  798. pName = (LPSTR)(LPCSTR)"供应商设置";
  799. OPEN_MENU(ProviderDlg);
  800. break;
  801. case IDM_BUMEN:
  802. {if(IsHasRightsnew(49)==0)return;
  803. BuMenDlg dlg;
  804. dlg.DoModal ();
  805. return;
  806. }
  807. case IDM_Account:
  808. if(IsHasRightsnew(49)==0)return;
  809. pName = (LPSTR)(LPCSTR)"账号管理";
  810. OPEN_MENU(Account);
  811. break;
  812. case IDM_YLCD:
  813. {
  814. //AfxMessageBox("IDM_YLCD");
  815. ::CopyFile (_T(g_path7+"\\接单系统\\Regsvr32.exe"), _T(g_mainpath+"\\Regsvr32.exe"), 0);
  816. ::CopyFile (_T(g_path7+"\\接单系统\\Flash9f.ocx"), _T(g_mainpath+"\\Flash9f.ocx"), 0);
  817. CString temp;
  818. temp.Format ("%s\\regsvr32.exe /s %s\\Flash9f.OCX", g_mainpath,g_mainpath);
  819. WinExec(temp,SW_HIDE);
  820. ::CopyFile (_T(g_path7+"\\接单系统\\接单系统.exe"), _T(g_mainpath+"\\接单系统.exe"), 0);
  821. ::CopyFile (_T(g_path7+"\\接单系统\\my32.dll"), _T(g_mainpath+"\\my32.dll"), 0);
  822. ::CopyFile (_T(g_path7+"\\接单系统\\server.dat"), _T(g_mainpath+"\\server.dat"), 0);
  823. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\接单系统.exe"), g_server, NULL, SW_SHOWNORMAL);
  824. }
  825. break;
  826. case IDM_YLCDMANAGE:
  827. ::CopyFile (_T(g_path7+"\\接单系统\\资源管理器.exe"), _T(g_mainpath+"\\资源管理器.exe"), 0);
  828. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\资源管理器.exe"), g_server, NULL, SW_SHOWNORMAL);
  829. break;
  830. }
  831. }
  832. //减少代码
  833. ///////////////////////////////////////////////////////////////////////////////
  834. void CMainFrame::OnDisconnect()
  835. {
  836. m_tClientTunnel.net_CloseSocket();
  837. SetConnectionID(INVALID_SOCKET);
  838. }
  839. void CMainFrame::ProcessLoginResponse(void *pLoginResult)
  840. {
  841. if( NULL == pLoginResult ) return;
  842. LOGIN_RESULT_STRU *ptLoginResult = (LOGIN_RESULT_STRU *)pLoginResult;
  843. DWORD dwConnectionID = ptLoginResult->tCommonMsg.dwConnectionID;
  844. SetConnectionID(dwConnectionID);
  845. BYTE byResult = ptLoginResult->byResult;
  846. if(LOGIN_RESULT_SUC == byResult)
  847. {
  848. }
  849. else
  850. {
  851. OnDisconnect();
  852. }
  853. }
  854. BOOL CMainFrame::ProcessLoginRequest()
  855. {
  856. // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
  857. WORD wMessageId = MSG_LOGIN_REQ;
  858. // 2.填充发送数据;
  859. TLOGIN_STRU tLogonInfo = {0};
  860. tLogonInfo.tCommonMsg.dwConnectionID = GetConnectionID();//此时m_dwConnectionID为INVALIDE_SOCKET;
  861. tLogonInfo.tCommonMsg.wMessageId = wMessageId;
  862. CString strUserName = newGUID();// 以随机数作为登陆时的用户名称;
  863. strUserName.TrimLeft();
  864. strUserName.TrimRight();
  865. strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
  866. DWORD dwDataLen = sizeof(TLOGIN_STRU);
  867. // 3.填充数据头;
  868. TMessageHeader tHeader = {0};
  869. tHeader.wMessageId = wMessageId;
  870. tHeader.dwDataLen = dwDataLen;
  871. // 4.发送数据;
  872. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)&tLogonInfo, dwDataLen);
  873. if( ulSendLen == SOCKET_ERROR )
  874. {
  875. return 0;
  876. }
  877. return 1;
  878. }
  879. DWORD CMainFrame::GetConnectionID()
  880. {
  881. return m_dwConnectionID;
  882. }
  883. void CMainFrame::SetConnectionID(DWORD dwConnection)
  884. {
  885. m_dwConnectionID = dwConnection;
  886. }
  887. /************************************************************************/
  888. /*
  889. Date: 2015-04-11
  890. Author: Jeff
  891. 函数:GetSharePathInfo
  892. 描述:获取共享目录表的所有信息;
  893. 参数:
  894. 返回:成功返回TRUE;
  895. 注意:获取的表记录存储在全局变量g_aryOfSharePathInfo中;
  896. 调用约定:在登陆软件时调用,且必须连接的服务器是本店的;
  897. */
  898. /************************************************************************/
  899. BOOL CMainFrame::GetSharePathInfo()
  900. {
  901. // 1.连接的数据库必须是本局域网的服务器;
  902. if ( g_bAllBranch || !g_branchname.IsEmpty() || !g_branchip.IsEmpty() )
  903. {
  904. // 非当前局域网服务器;
  905. return FALSE;
  906. }
  907. // 2.获取当前连接的分店域名是否与g_domain一致;
  908. g_sendhead.bsql = 0;
  909. g_sendhead.code[0] = 29;
  910. g_sendhead.tabcount = 1;
  911. g_pMainWnd->ProcessChatMessageRequest2(23);
  912. if ( !g_bSendOK )
  913. {
  914. // 连接服务器失败;
  915. return FALSE;
  916. }
  917. CArray<CStringArray,CStringArray> strArray;
  918. DataToArray(&strArray);
  919. CString strCurBranchDomain = _T("");
  920. if ( strArray.GetSize() )
  921. {
  922. strCurBranchDomain = strArray.ElementAt(0).ElementAt(0);
  923. if ( strCurBranchDomain.Find(_T(".ly.com")) == -1)
  924. {
  925. // 当前获取的域名有错;
  926. return FALSE;
  927. }
  928. }
  929. if ( g_domain.CompareNoCase(strCurBranchDomain) != 0)
  930. {
  931. // 当前连接的分店域名与局域网服务器域名不一致;
  932. return FALSE;
  933. }
  934. // 3.获取可用的共享信息;//select * from NetShareInfo where enable = 1;
  935. CString strFilter = _T("");
  936. strFilter.Format(_T("enable = 1"));
  937. g_sendhead.bsql = 0;
  938. g_sendhead.code[0] = 300;
  939. g_sendhead.tabcount = 1;
  940. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  941. if ( !g_bSendOK )
  942. {
  943. // 获取共享信息失败;
  944. return FALSE;
  945. }
  946. g_aryOfSharePathInfo.RemoveAll();
  947. DataToArray(&g_aryOfSharePathInfo);
  948. return g_aryOfSharePathInfo.GetSize() ? TRUE : FALSE;
  949. }
  950. //*********************************************//
  951. /*
  952. 函数:ProcessChatMessageRequest2
  953. 参数:BYTE code [IN]
  954. 返回:无
  955. 过程:OnConnect() -> ProcessChatMessageRequest()
  956. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  957. 2.SendDataDlg计时器里调用CConnectDlg对话框
  958. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  959. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  960. 5.关闭对话框和断开连接;
  961. */
  962. //*********************************************//
  963. void CMainFrame::ProcessChatMessageRequest2(BYTE code)
  964. {
  965. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  966. SendDataDlg dlg;
  967. dlg.m_bycode =code;
  968. dlg.DoModal();
  969. }
  970. //*********************************************//
  971. /*
  972. 函数:ProcessChatMessageRequest2
  973. 参数:CString sql [IN]
  974. 返回:无
  975. 过程:OnConnect() -> ProcessChatMessageRequest()
  976. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  977. 2.SendDataDlg计时器里调用CConnectDlg对话框
  978. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  979. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  980. 5.关闭对话框和断开连接;
  981. */
  982. //*********************************************//
  983. void CMainFrame::ProcessChatMessageRequest2(CString sql)
  984. {
  985. if( (sql.Find ("insert")!=-1 || sql.Find ("update")!=-1 || sql.Find ("delete")!=-1) && g_branchname!="" && g_bBranchModify==0)
  986. {
  987. AfxMessageBox("当前为分店数据查看状态,不能更改分店数据!", MB_ICONSTOP);
  988. g_bSendOK=0;
  989. return;
  990. }
  991. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  992. SendDataDlg dlg;
  993. dlg.m_strSQL = sql;
  994. dlg.DoModal ();
  995. }
  996. //*********************************************//
  997. /*
  998. 函数:ProcessChatMessageRequest2
  999. 参数:BYTE *pData [IN], int length [IN]
  1000. 返回:无
  1001. 过程:OnConnect() -> ProcessChatMessageRequest()
  1002. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  1003. 2.SendDataDlg计时器里调用CConnectDlg对话框
  1004. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  1005. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  1006. 5.关闭对话框和断开连接;
  1007. */
  1008. //*********************************************//
  1009. void CMainFrame::ProcessChatMessageRequest2(BYTE *pData, int length)
  1010. {
  1011. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  1012. SendDataDlg dlg;
  1013. dlg.m_pData =pData;
  1014. dlg.m_nlength =length;
  1015. dlg.DoModal ();
  1016. }
  1017. /************************************************************************/
  1018. /*
  1019. 函数:ProcessChatMessageRequest
  1020. 描述:对服务发送数据;
  1021. 参数:void *szDataBuf[IN], int nDataLen[IN]
  1022. 返回:发送成功与否;
  1023. */
  1024. /************************************************************************/
  1025. BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)
  1026. {
  1027. // 1.获取当前与服务器连接的id;
  1028. DWORD dwFromUserID = GetConnectionID();
  1029. // 2.设置通信类型为MSG_CHATMESSAGE_REQ;
  1030. WORD wMessageId = MSG_CHATMESSAGE_REQ;
  1031. // 3.计算出欲发送的数据的长度 dwDataLen;
  1032. DWORD dwDataLen = sizeof(TCHAT_MESSAGE_STRU) + nDataLen;
  1033. BYTE *pSendData = new BYTE[dwDataLen];
  1034. TCHAT_MESSAGE_STRU *pChatMessage=(TCHAT_MESSAGE_STRU*)pSendData;
  1035. memset(pChatMessage, 0x00, dwDataLen);
  1036. // 3.1.g_nYearpos第一次与服务端通信时为-1;
  1037. if(g_nYearpos == -1)
  1038. g_sendhead.length[99]=g_nYearpos;
  1039. else
  1040. g_sendhead.length[99]=g_nYearpos*32142953+10966236;
  1041. g_sendhead.length[98]=987123768;
  1042. memcpy(pSendData, &g_sendhead, sizeof(g_sendhead));
  1043. #ifdef ENTERPRISE_VERSION
  1044. if(g_bBranchModify==0)
  1045. strcpy(pChatMessage->szFromUserName, g_branchname);
  1046. #endif
  1047. // 4.填充发送的数据结构;
  1048. pChatMessage->tCommonMsg.dwConnectionID = GetConnectionID();
  1049. pChatMessage->tCommonMsg.wMessageId = wMessageId;
  1050. pChatMessage->dwFromUserID = dwFromUserID;
  1051. pChatMessage->dwToUserID = g_nSendCode;//▲▲g_nSendCode在服务端同为dwToUserID;
  1052. pChatMessage->wMessageLen = nDataLen;
  1053. memcpy(pChatMessage->byFileContent, szDataBuf, nDataLen);
  1054. // 5.填充数据头;
  1055. TMessageHeader tHeader = {0};
  1056. tHeader.wMessageId = wMessageId;
  1057. tHeader.dwDataLen = dwDataLen;
  1058. // 6.发送数据;
  1059. BOOL bRet=0;
  1060. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)pChatMessage, dwDataLen);
  1061. if( ulSendLen != SOCKET_ERROR )
  1062. {
  1063. bRet=1;
  1064. }
  1065. // 7.发送完毕,释放内存;
  1066. delete [] pSendData;
  1067. return bRet;
  1068. }
  1069. /************************************************************************/
  1070. /*
  1071. 函数:ProcessChatMessageResponse
  1072. 描述:接收服务返回的数据;
  1073. 参数:void *pResponse[IN]
  1074. 返回:无;
  1075. 调用关系:
  1076. 1.由 void CMainFrame::ProcessNetEvent(...)调用
  1077. */
  1078. /************************************************************************/
  1079. void CMainFrame::ProcessChatMessageResponse(void *pResponse)
  1080. {
  1081. // 1.数据空,直接返回;
  1082. if( NULL == pResponse )
  1083. return;
  1084. // 2.数据解析过程;
  1085. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pResponse;
  1086. int nMessageLen = pChatMessage->wMessageLen;
  1087. int nMessageLen2 = pChatMessage->dwToUserID; // 在服务器中被处理了,一般使dwToUserID=wMessageLen;
  1088. // Jeff.dwFromUserID==8888表示的内容是更新客户端skin界面数据,只有两处dwToUserID==211和dwToUserID==21;
  1089. // Jeff.其余的大多数都是 dwFromUserID = wMessageLen = dwToUserID 三者相等;
  1090. if(nMessageLen==nMessageLen2 && pChatMessage->dwFromUserID!=8888)
  1091. {
  1092. // 2.1.清除全局变量g_pData数据,用于保存接收的实际数据;
  1093. if(g_pData)
  1094. delete []g_pData;
  1095. g_pData=NULL;
  1096. g_pData=new BYTE[nMessageLen];
  1097. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1098. memcpy( &g_sendhead, pChatMessage, sizeof(g_sendhead));
  1099. g_nLeng=nMessageLen;
  1100. if(nMessageLen<=sizeof(DWORD))
  1101. {
  1102. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1103. }
  1104. KillTimer(2);
  1105. if(g_hSendWnd)
  1106. {
  1107. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);//关闭发送对话框;
  1108. }
  1109. }
  1110. else if(nMessageLen==nMessageLen2 && pChatMessage->dwFromUserID==8888)
  1111. {
  1112. if(g_pData2)
  1113. delete []g_pData2;
  1114. g_pData2=NULL;
  1115. g_pData2=new BYTE[nMessageLen2];
  1116. memcpy(g_pData2, pChatMessage->byFileContent, nMessageLen2);
  1117. g_nLeng2=nMessageLen2;
  1118. KillTimer(2);
  1119. if(g_hSendWnd )
  1120. {
  1121. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1122. }
  1123. }
  1124. else // 登陆返回;
  1125. {
  1126. if(g_bConnLYFZ)
  1127. {
  1128. if(g_pData)
  1129. delete []g_pData;
  1130. g_pData=NULL;
  1131. g_pData=new BYTE[nMessageLen];
  1132. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1133. memcpy( &g_sendhead, pChatMessage, sizeof(g_sendhead));
  1134. g_nLeng=nMessageLen;
  1135. if(nMessageLen<=sizeof(DWORD))
  1136. {
  1137. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1138. }
  1139. KillTimer(2);
  1140. if(g_hSendWnd )
  1141. {
  1142. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1143. }
  1144. return;
  1145. }
  1146. if(g_conntype) // Jeff.g_conntype == 1,表示连接公司服务器的返回,用于集团版解析*.ly.com的IP地址;
  1147. {
  1148. // KillTimer(2);
  1149. char *szChatMessage = new char[nMessageLen+1];
  1150. memset(szChatMessage, 0x00, nMessageLen+1);
  1151. memcpy(szChatMessage, pChatMessage->byFileContent, nMessageLen);
  1152. g_server=szChatMessage;
  1153. delete []szChatMessage;
  1154. CStdioFile fp;
  1155. CString path=g_mainpath+"\\ip.txt";
  1156. ::DeleteFile(path);
  1157. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  1158. fp.WriteString(g_server);
  1159. fp.Close();
  1160. g_conntype=0;
  1161. // g_serverip=g_server;
  1162. return;
  1163. }
  1164. if(g_pData2==NULL)
  1165. {
  1166. g_pData2=new BYTE[nMessageLen2];
  1167. g_nLeng2=0;
  1168. }
  1169. memcpy(g_pData2+g_nLeng2, pChatMessage->byFileContent, nMessageLen);
  1170. g_nLeng2+=nMessageLen;
  1171. if(g_nLeng2==nMessageLen2)//已收完
  1172. {
  1173. KillTimer(2);
  1174. if(g_hSendWnd )
  1175. {
  1176. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1177. }
  1178. }
  1179. else
  1180. {
  1181. KillTimer(2);
  1182. SetTimer(2, g_ntimeout, NULL);
  1183. }
  1184. }
  1185. }
  1186. BOOL CMainFrame::OnConnectBranch()
  1187. {
  1188. if(g_branchip=="")
  1189. {
  1190. return 0;
  1191. }
  1192. g_conntype=0;
  1193. CString strServerAddress = g_branchip;
  1194. char *szServerAddress = strServerAddress.GetBuffer(0);
  1195. strServerAddress.ReleaseBuffer();
  1196. /*for Client, IP and Port can be 0,
  1197. and for Server, IP is LocalIP, and Port is Listening Port*/
  1198. int nResult = m_tClientTunnel.net_OpenSocket(
  1199. Transport_Client,
  1200. 0,
  1201. HandleClientNetEvent,
  1202. this);
  1203. if( TRANSPORT_OK != nResult )
  1204. {
  1205. // AfxMessageBox("网络初始化失败!");
  1206. return 0;
  1207. }
  1208. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1209. WORD wPort = SERVER_PORT;
  1210. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1211. if( TRANSPORT_OK != nResult )
  1212. {
  1213. m_tClientTunnel.net_CloseSocket();
  1214. return OnConnectBranch2();
  1215. return 0;
  1216. }
  1217. return ProcessLoginRequest();
  1218. }
  1219. BOOL CMainFrame::OnConnectBranch2()
  1220. {
  1221. if(g_branchip2=="")
  1222. {
  1223. return 0;
  1224. }
  1225. g_conntype=0;
  1226. CString strServerAddress = g_branchip2;
  1227. char *szServerAddress = strServerAddress.GetBuffer(0);
  1228. strServerAddress.ReleaseBuffer();
  1229. /*for Client, IP and Port can be 0,
  1230. and for Server, IP is LocalIP, and Port is Listening Port*/
  1231. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1232. 0,
  1233. HandleClientNetEvent,
  1234. this);
  1235. if( TRANSPORT_OK != nResult )
  1236. {
  1237. // AfxMessageBox("网络初始化失败!");
  1238. return 0;
  1239. }
  1240. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1241. WORD wPort = SERVER_PORT;
  1242. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1243. if( TRANSPORT_OK != nResult )
  1244. {
  1245. m_tClientTunnel.net_CloseSocket();
  1246. return 0;
  1247. }
  1248. return ProcessLoginRequest();
  1249. }
  1250. BOOL CMainFrame::OnConnectIP()
  1251. {
  1252. CString strServerAddress = g_server;
  1253. char *szServerAddress = strServerAddress.GetBuffer(0);
  1254. strServerAddress.ReleaseBuffer();
  1255. /*for Client, IP and Port can be 0,
  1256. and for Server, IP is LocalIP, and Port is Listening Port*/
  1257. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1258. 0,
  1259. HandleClientNetEvent,
  1260. this);
  1261. if( TRANSPORT_OK != nResult )
  1262. {
  1263. // AfxMessageBox("网络初始化失败!");
  1264. return 0;
  1265. }
  1266. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1267. WORD wPort = SERVER_PORT;
  1268. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1269. if( TRANSPORT_OK != nResult )
  1270. {
  1271. m_tClientTunnel.net_CloseSocket();
  1272. return 0;
  1273. }
  1274. return ProcessLoginRequest();
  1275. }
  1276. //ip.txt
  1277. BOOL CMainFrame::OnConnectLYFZ()
  1278. {
  1279. CString strBranchIP = "lijiafz.vicp.net";
  1280. MyGetIPByName2(strBranchIP);
  1281. if(strBranchIP=="")
  1282. {
  1283. return 0;
  1284. }
  1285. g_conntype=0;
  1286. CString strServerAddress = strBranchIP;
  1287. char *szServerAddress = strServerAddress.GetBuffer(0);
  1288. strServerAddress.ReleaseBuffer();
  1289. /*for Client, IP and Port can be 0,
  1290. and for Server, IP is LocalIP, and Port is Listening Port*/
  1291. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1292. 0,
  1293. HandleClientNetEvent,
  1294. this);
  1295. if( TRANSPORT_OK != nResult )
  1296. {
  1297. // AfxMessageBox("网络初始化失败!");
  1298. return 0;
  1299. }
  1300. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1301. WORD wPort = GetPort();
  1302. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1303. if( TRANSPORT_OK != nResult )
  1304. {
  1305. m_tClientTunnel.net_CloseSocket();
  1306. return 0;
  1307. }
  1308. return ProcessLoginRequest();
  1309. }
  1310. BOOL CMainFrame::OnConnect()
  1311. {
  1312. // 1.Jeff 断开(如果有在在未关的连接)之前的连接;
  1313. OnDisconnect();
  1314. // 2.根据需要连接指定的服务器;
  1315. if(g_bBranchModify)
  1316. {
  1317. // Jeff.g_bBranchModify在g_bGenBranchData=1时,在welcome::OnTimer里被设置为1;
  1318. return OnConnectBranch();// 连接集团版分店;
  1319. }
  1320. if(g_bConnLYFZ)
  1321. {
  1322. return OnConnectLYFZ();// 连接公司服务端程序;
  1323. }
  1324. g_conntype=0;
  1325. CString strServerAddress = g_server;
  1326. // 3.如果dbconfig.dat里保存的是*.ly.com的信息,就要读取ip.txt里的IP地址;
  1327. if(g_serverbak.Find(".ly.com")!=-1)
  1328. {
  1329. strServerAddress=g_serverbak;
  1330. CStdioFile fp;
  1331. CString path=g_mainpath+"\\ip.txt";
  1332. if(::PathFileExists(path))
  1333. {
  1334. fp.Open(path, CFile::modeRead);
  1335. fp.ReadString(g_server);
  1336. fp.Close();
  1337. if(OnConnectIP())
  1338. {
  1339. //MessageBox("ip成功");
  1340. // g_serverip=g_server;
  1341. //LOG4C((LOG_NOTICE,"OnConnectIP == 1,return 1"));
  1342. return 1;
  1343. }
  1344. g_server=strServerAddress ;
  1345. OnDisconnect();//MessageBox("ip失败");
  1346. }
  1347. g_conntype=1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1348. strServerAddress="lijiafz.vicp.net";
  1349. MyGetIPByName2(strServerAddress);
  1350. if(strServerAddress.IsEmpty())
  1351. {
  1352. //LOG4C((LOG_NOTICE,"strServerAddress == 0,return 0"));
  1353. return 0;//OnConnect2();
  1354. }
  1355. }
  1356. else if(g_ntimeout==29000)//非远程 30000
  1357. {
  1358. strServerAddress=g_serverarray.ElementAt(g_conpos);
  1359. }
  1360. // 4.如果没有IP.txt或dbconfig.dat里的不是ly.com信息,而是一般的计算机名称;
  1361. char *szServerAddress = strServerAddress.GetBuffer(0);
  1362. strServerAddress.ReleaseBuffer();
  1363. // AfxMessageBox("连接:"+strServerAddress);
  1364. /*for Client, IP and Port can be 0,
  1365. and for Server, IP is LocalIP, and Port is Listening Port*/
  1366. // 5.创建通信对象连接;
  1367. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1368. 0,
  1369. HandleClientNetEvent,
  1370. this);
  1371. if( TRANSPORT_OK != nResult )
  1372. {
  1373. // AfxMessageBox("网络初始化失败!");
  1374. // LOG4C((LOG_NOTICE,"网络初始化失败!,return 0"));
  1375. return 0;
  1376. }
  1377. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1378. WORD wPort = SERVER_PORT;
  1379. if(g_conntype) wPort=GetPort();
  1380. // 6.连接公司服务器或影楼服务器;
  1381. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1382. if( TRANSPORT_OK != nResult )
  1383. {
  1384. // AfxMessageBox("连接失败");
  1385. m_tClientTunnel.net_CloseSocket();
  1386. if(g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1387. {
  1388. // LOG4C((LOG_NOTICE,"连接失败,return 0"));
  1389. return 0;//OnConnect2();
  1390. }
  1391. if(g_serverarray.GetSize()>1)
  1392. {
  1393. if(g_conpos<(g_serverarray.GetSize()-1))
  1394. {
  1395. g_conpos++;
  1396. return OnConnect();
  1397. }
  1398. else
  1399. {
  1400. g_conpos=0;
  1401. return 0;
  1402. }
  1403. }
  1404. return 0;
  1405. }
  1406. // LOG4C((LOG_NOTICE,"ok send"));
  1407. return ProcessLoginRequest();
  1408. }
  1409. BOOL CMainFrame::OnConnect2()
  1410. {
  1411. g_conntype=2;
  1412. CString server="http://www.lyfz.net/download/ip.txt";
  1413. char buf[MAX_PATH];
  1414. ::GetTempPath(sizeof(buf),buf);
  1415. CString m_strTempDir=buf;
  1416. DWORD m_dwHttpRequestFlags=HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1417. INTERNET_PORT m_dwPort;
  1418. DWORD dwType;
  1419. CInternetSession m_cis;
  1420. CHttpConnection *m_pHttp;
  1421. CString m_strServer;
  1422. CString m_strIniPath;
  1423. AfxParseURL(server,dwType,m_strServer,m_strIniPath,m_dwPort);
  1424. if(dwType!=AFX_INET_SERVICE_HTTP)
  1425. {
  1426. return 0;//OnConnect3();
  1427. }
  1428. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,5);
  1429. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1430. try
  1431. {
  1432. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1433. }
  1434. catch(CInternetException* pEx)
  1435. {
  1436. return 0;//OnConnect3();
  1437. }
  1438. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1439. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1440. try
  1441. {
  1442. pFile->SendRequest();
  1443. }
  1444. catch(CInternetException* pEx)
  1445. {
  1446. pFile->Close();
  1447. return 0;//OnConnect3();
  1448. }
  1449. if(pFile)
  1450. {
  1451. CStdioFile csf;
  1452. csf.Open(m_strTempDir+"\\ip.txt",CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
  1453. char buf[2048];
  1454. int n;
  1455. while((n=pFile->Read(buf,2048))>0)
  1456. csf.Write(buf,n);
  1457. csf.Close();
  1458. pFile->Close();
  1459. }
  1460. CString strServerAddress ;
  1461. CStdioFile fp;
  1462. fp.Open (m_strTempDir+"\\ip.txt", CFile::modeRead);
  1463. fp.ReadString (strServerAddress);
  1464. fp.Close ();
  1465. char *szServerAddress = strServerAddress.GetBuffer(0);
  1466. strServerAddress.ReleaseBuffer();
  1467. /*for Client, IP and Port can be 0,
  1468. and for Server, IP is LocalIP, and Port is Listening Port*/
  1469. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1470. 0,
  1471. HandleClientNetEvent,
  1472. this);
  1473. if( TRANSPORT_OK != nResult )
  1474. {
  1475. return 0;
  1476. }
  1477. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1478. WORD wPort = SERVER_PORT;
  1479. if(g_conntype)wPort=GetPort();
  1480. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1481. if( TRANSPORT_OK != nResult )
  1482. {
  1483. m_tClientTunnel.net_CloseSocket();
  1484. return 0;//OnConnect3();
  1485. }
  1486. return ProcessLoginRequest();
  1487. }
  1488. BOOL CMainFrame::OnConnect3()
  1489. {
  1490. g_conntype=3;
  1491. CString server="http://photo.bjlyfz.com/download/ip.txt";
  1492. char buf[MAX_PATH];
  1493. ::GetTempPath(sizeof(buf),buf);
  1494. CString m_strTempDir=buf;
  1495. DWORD m_dwHttpRequestFlags=HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1496. INTERNET_PORT m_dwPort;
  1497. DWORD dwType;
  1498. CInternetSession m_cis;
  1499. CHttpConnection *m_pHttp;
  1500. CString m_strServer;
  1501. CString m_strIniPath;
  1502. AfxParseURL(server,dwType,m_strServer,m_strIniPath,m_dwPort);
  1503. if(dwType!=AFX_INET_SERVICE_HTTP)
  1504. {
  1505. return FALSE;
  1506. }
  1507. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,5);
  1508. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1509. try
  1510. {
  1511. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1512. }
  1513. catch(CInternetException* pEx)
  1514. {
  1515. return false;
  1516. }
  1517. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1518. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1519. try
  1520. {
  1521. pFile->SendRequest();
  1522. }
  1523. catch(CInternetException* pEx)
  1524. {
  1525. pFile->Close();
  1526. return false;
  1527. }
  1528. if(pFile)
  1529. {
  1530. CStdioFile csf;
  1531. csf.Open(m_strTempDir+"\\ip.txt",CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
  1532. char buf[2048];
  1533. int n;
  1534. while((n=pFile->Read(buf,2048))>0)
  1535. csf.Write(buf,n);
  1536. csf.Close();
  1537. pFile->Close();
  1538. }
  1539. CString strServerAddress ;
  1540. CStdioFile fp;
  1541. fp.Open (m_strTempDir+"\\ip.txt", CFile::modeRead);
  1542. fp.ReadString (strServerAddress);
  1543. fp.Close ();
  1544. char *szServerAddress = strServerAddress.GetBuffer(0);
  1545. strServerAddress.ReleaseBuffer();
  1546. /*for Client, IP and Port can be 0,
  1547. and for Server, IP is LocalIP, and Port is Listening Port*/
  1548. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1549. 0,
  1550. HandleClientNetEvent,
  1551. this);
  1552. if( TRANSPORT_OK != nResult )
  1553. {
  1554. return 0;
  1555. }
  1556. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1557. WORD wPort = SERVER_PORT;
  1558. if(g_conntype)wPort=GetPort();
  1559. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1560. if( TRANSPORT_OK != nResult )
  1561. {
  1562. m_tClientTunnel.net_CloseSocket();
  1563. return 0;
  1564. }
  1565. return ProcessLoginRequest();
  1566. }
  1567. void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
  1568. {
  1569. if( Transport_ReadEv == nEventType )
  1570. {
  1571. if( NULL == pRecvMsg ) return;
  1572. TMessageHeader* pHeader = (TMessageHeader *)pRecvMsg;
  1573. char *pDataBuf = (char *)pRecvMsg + MESSAGE_HEADER_LEN;
  1574. WORD dwMessageID = pHeader->wMessageId;
  1575. switch(dwMessageID)
  1576. {
  1577. case MSG_LOGIN_RESP:
  1578. {
  1579. LOGIN_RESULT_STRU tLoginResult = {0};
  1580. memcpy(&tLoginResult, pDataBuf, sizeof(LOGIN_RESULT_STRU));
  1581. ProcessLoginResponse(&tLoginResult);
  1582. break;
  1583. }
  1584. case MSG_USERINFO_RESP:
  1585. {
  1586. break;
  1587. }
  1588. case MSG_LOGOUT_RESP:
  1589. {
  1590. break;
  1591. }
  1592. case MSG_CHATMESSAGE_RESP:
  1593. {
  1594. //AfxMessageBox("登陆成功");
  1595. static int i = 0;
  1596. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pDataBuf;
  1597. ProcessChatMessageResponse((void *)pChatMessage);
  1598. break;
  1599. }
  1600. default:
  1601. {
  1602. break;
  1603. }
  1604. }
  1605. }
  1606. else if( Transport_CloseEv == nEventType )
  1607. {
  1608. OnDisconnect();
  1609. }
  1610. }
  1611. extern BOOL EncryptFile2(BYTE *buffer, DWORD leng, PCHAR szPassword);
  1612. void CMainFrame::OnTimer(UINT nIDEvent)
  1613. {
  1614. // TODO: Add your message handler code here and/or call default
  1615. if( 1 == nIDEvent )
  1616. {
  1617. KillTimer(nIDEvent);
  1618. CString version = _T ("Version 1.0");
  1619. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);//status:此机用选片菜单项
  1620. // checked==1:此机用选片菜单项
  1621. // g_bStaffAchievementShow==1:此机用于员工业绩查看
  1622. if(checked && g_bStaffAchievementShow==0) // .此机用选片菜单项;
  1623. {
  1624. KillTimer(3);
  1625. #ifdef NEW_SKIN
  1626. Welcome weldlg;
  1627. weldlg.DoModal();
  1628. #endif
  1629. ChoosePhotoSkin dlg;
  1630. dlg.SetLiaPath ("1.lia");
  1631. if(dlg.DoModal ()!=IDOK)
  1632. {
  1633. PostMessage(WM_QUIT);
  1634. return;
  1635. }
  1636. if(dlg.m_exitcode==3)
  1637. {
  1638. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  1639. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  1640. }
  1641. else
  1642. {
  1643. ShowWindow(SW_SHOW);
  1644. #ifdef NEW_SKIN
  1645. if(m_pMainFrimDlg2==NULL)
  1646. {
  1647. m_pMainFrimDlg2=new MainFrimDlg2;
  1648. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  1649. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  1650. }
  1651. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1652. #endif
  1653. }
  1654. }
  1655. else if(g_bStaffAchievementShow==0) // .非选片、非查看员工业绩;
  1656. {
  1657. #ifdef NEW_SKIN
  1658. g_bNoConnDlg=1;
  1659. Welcome weldlg;
  1660. weldlg.DoModal();
  1661. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1662. ShowWindow(SW_SHOW);
  1663. g_bNoConnDlg=0;
  1664. if(g_bNoLoginLia) // Jeff.OnCreate里判断skin文件有5.lia, g_bNoLoginLia = 0, 无 g_bNoLoginLia = 1;
  1665. {
  1666. Login dlg;
  1667. dlg.SetLiaPath("5.lia");
  1668. dlg.DoModal();
  1669. }
  1670. else
  1671. {
  1672. Login3 dlg;
  1673. dlg.SetLiaPath("5.lia");
  1674. dlg.DoModal();
  1675. }
  1676. if(g_user.bLongin && g_pMainWnd2)
  1677. {
  1678. g_pMainWnd2->ShowBar (1);
  1679. InsideMsg();
  1680. }
  1681. #else
  1682. ShowWindow(SW_SHOW);
  1683. if(g_bNoLoginLia)
  1684. {
  1685. Login dlg;
  1686. dlg.SetLiaPath ("5.lia");
  1687. dlg.DoModal();
  1688. }
  1689. else
  1690. {
  1691. Login3 dlg;
  1692. dlg.SetLiaPath ("5.lia");
  1693. dlg.DoModal();
  1694. }
  1695. #endif
  1696. }
  1697. if(g_hmouse==NULL )//&& atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
  1698. {
  1699. g_hmouse=SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId ());
  1700. }
  1701. }
  1702. else if( 2 == nIDEvent ) //29秒后,若连接和发送未完成,将关闭连接和发送框;
  1703. {
  1704. KillTimer(2);
  1705. if(g_hConnectWnd )
  1706. ::SendMessage (g_hConnectWnd, WM_CLOSE, 0, 0);
  1707. if(g_hSendWnd )
  1708. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1709. if(g_bStaffAchievementShow==0 && g_bConnLYFZ==0)
  1710. {
  1711. if(g_bGenBranchData==0)
  1712. {
  1713. if(g_branchip!="")
  1714. AfxMessageBox("连接分店:"+g_branchname+"失败!", MB_ICONINFORMATION);
  1715. else
  1716. AfxMessageBox("连接服务器失败!", MB_ICONINFORMATION);
  1717. }
  1718. OnDisconnect();
  1719. }
  1720. g_bSendOK=0; g_bNeedCoon=1;
  1721. }
  1722. else if( 3 == nIDEvent )
  1723. {
  1724. KillTimer(3);
  1725. #ifdef NEW_SKIN
  1726. Welcome weldlg;
  1727. weldlg.DoModal();
  1728. #endif
  1729. ShowWindow(SW_SHOW);
  1730. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1731. g_sendhead.bsql=0;
  1732. g_sendhead.code[0]=24;
  1733. g_sendhead.code[1]=1;
  1734. g_sendhead.tabcount=2;
  1735. g_pMainWnd->ProcessChatMessageRequest2(1);
  1736. if(g_bSendOK==0)
  1737. {
  1738. return;
  1739. }
  1740. CArray<CStringArray, CStringArray>patharray;
  1741. CArray<CStringArray, CStringArray>userarray;
  1742. DataToArray(&g_cominfoarray,&g_hisyeararray);
  1743. g_userarray.SetSize( userarray.GetSize (), 1 );
  1744. int count=0;
  1745. for(int ii=0; ii<userarray.GetSize (); ii++)
  1746. {
  1747. if(userarray.ElementAt (ii).ElementAt (10)=="在职")
  1748. g_userarray.ElementAt (count++).Copy (userarray.ElementAt (ii));
  1749. }
  1750. g_userarray.SetSize( count, 1 );
  1751. StaffAchievementShowAll dlg;
  1752. g_pMainWnd->GetOcx();
  1753. dlg.DoModal ();
  1754. }
  1755. else if( 5 == nIDEvent )
  1756. {
  1757. if(g_bInSkin)return;
  1758. if(g_nAutoShowStaffAchievement==1)return;
  1759. if(g_bAllBranch)return;
  1760. if(g_user.bLongin)
  1761. {
  1762. // m_Mdi.CloseAll();
  1763. g_pMainWnd->OnCommandMenu(IDM_Logout);
  1764. }
  1765. /* g_nAutoShowStaffAchievement=1;
  1766. KillTimer(5);
  1767. StaffAchievementShowAll dlg;
  1768. g_pMainWnd->GetOcx();
  1769. dlg.DoModal ();*/
  1770. }
  1771. else if( 6 == nIDEvent )
  1772. {
  1773. static BOOL bDouble=0;
  1774. bDouble=!bDouble;
  1775. if(bDouble)
  1776. g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
  1777. else
  1778. g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
  1779. }
  1780. else if( 7 == nIDEvent )
  1781. {
  1782. KillTimer(7);
  1783. if(g_bInSkin)return;
  1784. if(g_nAutoShowStaffAchievement==1)return;
  1785. if(g_bAllBranch)return;
  1786. CString str=g_sInfo;
  1787. g_bConnLYFZ=1;
  1788. OnDisconnect();
  1789. BYTE *pData=new BYTE[str.GetLength ()];
  1790. memcpy(pData, str.GetBuffer (0), str.GetLength ());
  1791. str.ReleaseBuffer ();
  1792. EncryptFile2(pData, str.GetLength (), "888666333");
  1793. g_nSendCode=16;
  1794. g_pMainWnd->ProcessChatMessageRequest2(pData, str.GetLength ());
  1795. g_nSendCode=0;
  1796. delete []pData;
  1797. OnDisconnect();
  1798. g_bSendLYFZ=0;
  1799. g_bConnLYFZ=0;
  1800. if(g_bSendOK)
  1801. {
  1802. char *pStr=new char[g_nLeng+1];
  1803. memset(pStr, 0, g_nLeng+1);
  1804. memcpy(pStr, g_pData, g_nLeng);
  1805. CString str=pStr;
  1806. delete []pStr;
  1807. if(str=="g_bInSkin")
  1808. {
  1809. g_sendhead.bsql=1;
  1810. g_pMainWnd->ProcessChatMessageRequest2("update version set [setcheck1]='ok'");
  1811. }
  1812. }
  1813. }
  1814. }
  1815. void CMainFrame::OnOutbarNotify(CString strMsg)
  1816. {
  1817. if(g_user.bLongin==0)
  1818. {
  1819. if(g_bNoLoginLia)
  1820. {
  1821. Login dlg;
  1822. dlg.SetLiaPath ("5.lia");
  1823. dlg.DoModal();
  1824. }
  1825. else
  1826. {
  1827. Login3 dlg;
  1828. dlg.SetLiaPath ("5.lia");
  1829. dlg.DoModal();
  1830. }
  1831. return;
  1832. if(g_user.bLongin==0)return;
  1833. }
  1834. else
  1835. {
  1836. InsideMsg();
  1837. }
  1838. ResetTimer();
  1839. if(strMsg=="开单")
  1840. {
  1841. if(IsHasRights(0)==0)return;
  1842. /* UINT nID=0;
  1843. LPSTR pName ;
  1844. pName = (LPSTR)(LPCSTR)"开单";
  1845. OPEN_MENU(Booking);*/
  1846. Booking2 dlg;
  1847. dlg.DoModal ();
  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(TakeFrom);
  1857. return;
  1858. }
  1859. else if(strMsg=="修片")
  1860. {
  1861. if(IsHasRights(1)==0)return;
  1862. UINT nID=1;
  1863. LPSTR pName ;
  1864. pName = (LPSTR)(LPCSTR)"修片";
  1865. OPEN_MENU(BeautifySkinFrom);
  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(ChoosePhotoForm);
  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(BeautifySkinFrom2);
  1884. return;
  1885. }
  1886. else if(strMsg=="设计")
  1887. {
  1888. if(IsHasRights(2)==0)return;
  1889. UINT nID=1;
  1890. LPSTR pName ;
  1891. pName = (LPSTR)(LPCSTR)"设计";
  1892. OPEN_MENU(DesignFrom);
  1893. return;
  1894. }
  1895. else if(strMsg=="数码安排")
  1896. {
  1897. UINT nID=1;
  1898. LPSTR pName ;
  1899. pName = (LPSTR)(LPCSTR)"数码安排";
  1900. OPEN_MENU(DigitalWork);
  1901. return;
  1902. }
  1903. else if(strMsg=="刻盘")
  1904. {
  1905. UINT nID=1;
  1906. LPSTR pName ;
  1907. pName = (LPSTR)(LPCSTR)"刻盘";
  1908. OPEN_MENU(BurnCD);
  1909. return;
  1910. }
  1911. else if(strMsg=="相片冲印")
  1912. {
  1913. UINT nID=1;
  1914. LPSTR pName ;
  1915. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  1916. OPEN_MENU(PhotoPrintFrom);
  1917. return;
  1918. }
  1919. else if(strMsg=="发片/取件")
  1920. {
  1921. if(IsHasRights(3)==0)return;
  1922. UINT nID=1;
  1923. LPSTR pName ;
  1924. pName = (LPSTR)(LPCSTR)"发片/取件";
  1925. OPEN_MENU(outsourcing);
  1926. return;
  1927. }
  1928. else if(strMsg=="满意度")
  1929. {
  1930. UINT nID=1;
  1931. LPSTR pName ;
  1932. pName = (LPSTR)(LPCSTR)"满意度";
  1933. OPEN_MENU(Satisfaction);
  1934. return;
  1935. }
  1936. else if(strMsg=="满意度图表")
  1937. {
  1938. UINT nID=1;
  1939. LPSTR pName ;
  1940. pName = (LPSTR)(LPCSTR)"满意度图表";
  1941. OPEN_MENU(SatisfactionForm);
  1942. return;
  1943. }
  1944. else if(strMsg=="回复统计")
  1945. {
  1946. UINT nID=1;
  1947. LPSTR pName ;
  1948. pName = (LPSTR)(LPCSTR)"回复统计";
  1949. OPEN_MENU(MsgReg2);
  1950. return;
  1951. }
  1952. /* else if(strMsg=="取件")
  1953. {
  1954. if(IsHasRights(3)==0)return;
  1955. UINT nID=1;
  1956. LPSTR pName ;
  1957. pName = (LPSTR)(LPCSTR)"取件";
  1958. OPEN_MENU(TakeAwayFrom);
  1959. return;
  1960. }*/
  1961. else if(strMsg=="其它收入")
  1962. {
  1963. if(IsHasRightsnew(16)==0)return;
  1964. // if(IsHasRightsnew(48)==0)return;
  1965. UINT nID=1;
  1966. LPSTR pName ;
  1967. pName = (LPSTR)(LPCSTR)"其它收入";
  1968. OPEN_MENU(IncomeInput);
  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(IncomeInput2);
  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(IncomeInput3);
  1987. return;
  1988. }
  1989. else if(strMsg=="员工奖惩")
  1990. {
  1991. if(IsHasRightsnew(16)==0)return;
  1992. UINT nID=1;
  1993. LPSTR pName ;
  1994. pName = (LPSTR)(LPCSTR)"员工奖惩";
  1995. OPEN_MENU(IncomeInput4);
  1996. return;
  1997. }
  1998. else if(strMsg=="订单收款")
  1999. {
  2000. if(IsHasRights(17)==0)return;
  2001. UINT nID=1;
  2002. LPSTR pName ;
  2003. pName = (LPSTR)(LPCSTR)"订单收款";
  2004. OPEN_MENU(FinanceForm);
  2005. return;
  2006. }
  2007. else if(strMsg=="日财务表")
  2008. {
  2009. if(IsHasRightsnew(22)==0)return;
  2010. UINT nID=2;
  2011. LPSTR pName ;
  2012. pName = (LPSTR)(LPCSTR)"日财务表";
  2013. OPEN_MENU(DailyForm);
  2014. return;
  2015. }
  2016. else if(strMsg=="提成比例")
  2017. {
  2018. #ifndef ENTERPRISE_VERSION
  2019. #ifndef CHILD_VERSION
  2020. #ifdef BASIC_VERSION
  2021. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2022. {
  2023. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2024. exit(0);return;
  2025. }
  2026. #else
  2027. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2028. {
  2029. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2030. exit(0);return;
  2031. }
  2032. #endif
  2033. #else
  2034. #ifdef BASIC_VERSION
  2035. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2036. {
  2037. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2038. exit(0);return;
  2039. }
  2040. #else
  2041. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2042. {
  2043. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2044. exit(0);return;
  2045. }
  2046. #endif
  2047. #endif
  2048. #else
  2049. #ifndef CHILD_VERSION
  2050. #ifdef BASIC_VERSION
  2051. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2052. {
  2053. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2054. exit(0);return;
  2055. }
  2056. #else
  2057. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2058. {
  2059. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2060. exit(0);return;
  2061. }
  2062. #endif
  2063. #else
  2064. #ifdef BASIC_VERSION
  2065. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2066. {
  2067. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2068. exit(0);return;
  2069. }
  2070. #else
  2071. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2072. {
  2073. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2074. exit(0);return;
  2075. }
  2076. #endif
  2077. #endif
  2078. #endif
  2079. UINT nID=2;
  2080. LPSTR pName ;
  2081. pName = (LPSTR)(LPCSTR)"提成比例";
  2082. OPEN_MENU(SalarySet2);
  2083. return;
  2084. }
  2085. //else if(strMsg=="员工工作")
  2086. else if(strMsg=="计件提成")
  2087. {
  2088. UINT nID=2;
  2089. LPSTR pName ;
  2090. //pName = (LPSTR)(LPCSTR)"员工工作";
  2091. pName = (LPSTR)(LPCSTR)"计件提成";
  2092. OPEN_MENU(SalarySet3);
  2093. return;
  2094. }
  2095. else if(strMsg=="工资管理")
  2096. {
  2097. #ifndef ENTERPRISE_VERSION
  2098. #ifndef CHILD_VERSION
  2099. #ifdef BASIC_VERSION
  2100. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2101. {
  2102. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2103. exit(0);return;
  2104. }
  2105. #else
  2106. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2107. {
  2108. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2109. exit(0);return;
  2110. }
  2111. #endif
  2112. #else
  2113. #ifdef BASIC_VERSION
  2114. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2115. {
  2116. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2117. exit(0);return;
  2118. }
  2119. #else
  2120. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2121. {
  2122. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2123. exit(0);return;
  2124. }
  2125. #endif
  2126. #endif
  2127. #else
  2128. #ifndef CHILD_VERSION
  2129. #ifdef BASIC_VERSION
  2130. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2131. {
  2132. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2133. exit(0);return;
  2134. }
  2135. #else
  2136. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2137. {
  2138. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2139. exit(0);return;
  2140. }
  2141. #endif
  2142. #else
  2143. #ifdef BASIC_VERSION
  2144. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2145. {
  2146. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2147. exit(0);return;
  2148. }
  2149. #else
  2150. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2151. {
  2152. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2153. exit(0);return;
  2154. }
  2155. #endif
  2156. #endif
  2157. #endif
  2158. UINT nID=2;
  2159. LPSTR pName ;
  2160. pName = (LPSTR)(LPCSTR)"工资管理";
  2161. OPEN_MENU(MySalary);
  2162. return;
  2163. }
  2164. else if(strMsg=="客人付款")
  2165. {
  2166. UINT nID=2;
  2167. LPSTR pName ;
  2168. pName = (LPSTR)(LPCSTR)"客人付款";
  2169. OPEN_MENU(ClientMoney);
  2170. return;
  2171. }
  2172. else if(strMsg=="工资报表")
  2173. {
  2174. #ifndef ENTERPRISE_VERSION
  2175. #ifndef CHILD_VERSION
  2176. #ifdef BASIC_VERSION
  2177. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2178. {
  2179. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2180. exit(0);return;
  2181. }
  2182. #else
  2183. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2184. {
  2185. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2186. exit(0);return;
  2187. }
  2188. #endif
  2189. #else
  2190. #ifdef BASIC_VERSION
  2191. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2192. {
  2193. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2194. exit(0);return;
  2195. }
  2196. #else
  2197. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2198. {
  2199. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2200. exit(0);return;
  2201. }
  2202. #endif
  2203. #endif
  2204. #else
  2205. #ifndef CHILD_VERSION
  2206. #ifdef BASIC_VERSION
  2207. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2208. {
  2209. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2210. exit(0);return;
  2211. }
  2212. #else
  2213. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2214. {
  2215. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2216. exit(0);return;
  2217. }
  2218. #endif
  2219. #else
  2220. #ifdef BASIC_VERSION
  2221. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2222. {
  2223. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2224. exit(0);return;
  2225. }
  2226. #else
  2227. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2228. {
  2229. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2230. exit(0);return;
  2231. }
  2232. #endif
  2233. #endif
  2234. #endif
  2235. if(IsHasRightsnew(25)==0)return;
  2236. UINT nID=2;
  2237. LPSTR pName ;
  2238. pName = (LPSTR)(LPCSTR)"工资报表";
  2239. g_ncount=100;
  2240. OPEN_MENU(MySalary);
  2241. return;
  2242. }
  2243. else if(strMsg=="员工业绩")
  2244. {
  2245. #ifndef ENTERPRISE_VERSION
  2246. #ifndef CHILD_VERSION
  2247. #ifdef BASIC_VERSION
  2248. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2249. {
  2250. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2251. exit(0);return;
  2252. }
  2253. #else
  2254. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2255. {
  2256. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2257. exit(0);return;
  2258. }
  2259. #endif
  2260. #else
  2261. #ifdef BASIC_VERSION
  2262. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2263. {
  2264. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2265. exit(0);return;
  2266. }
  2267. #else
  2268. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2269. {
  2270. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2271. exit(0);return;
  2272. }
  2273. #endif
  2274. #endif
  2275. #else
  2276. #ifndef CHILD_VERSION
  2277. #ifdef BASIC_VERSION
  2278. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2279. {
  2280. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2281. exit(0);return;
  2282. }
  2283. #else
  2284. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2285. {
  2286. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2287. exit(0);return;
  2288. }
  2289. #endif
  2290. #else
  2291. #ifdef BASIC_VERSION
  2292. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2293. {
  2294. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2295. exit(0);return;
  2296. }
  2297. #else
  2298. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2299. {
  2300. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2301. exit(0);return;
  2302. }
  2303. #endif
  2304. #endif
  2305. #endif
  2306. if(IsHasRightsnew(33)==0)return;
  2307. UINT nID=2;
  2308. LPSTR pName ;
  2309. pName = (LPSTR)(LPCSTR)"员工业绩";
  2310. OPEN_MENU(StaffAchievement);
  2311. return;
  2312. }
  2313. else if(strMsg=="订单客户")
  2314. {
  2315. UINT nID=2;
  2316. LPSTR pName ;
  2317. pName = (LPSTR)(LPCSTR)"订单客户";
  2318. g_dx+=10000;
  2319. OPEN_MENU(CClientForm);
  2320. if(g_dx>=10000)g_dx-=10000;
  2321. return;
  2322. }
  2323. else if(strMsg=="服务记录")
  2324. {
  2325. UINT nID=2;
  2326. LPSTR pName ;
  2327. pName = (LPSTR)(LPCSTR)"服务记录";
  2328. OPEN_MENU(CClientForm2);
  2329. return;
  2330. }
  2331. else if(strMsg=="服务统计")
  2332. {
  2333. UINT nID=2;
  2334. LPSTR pName ;
  2335. pName = (LPSTR)(LPCSTR)"服务统计";
  2336. OPEN_MENU(CClientForm3);
  2337. return;
  2338. }
  2339. else if(strMsg=="意向客户")
  2340. {
  2341. UINT nID=2;
  2342. LPSTR pName ;
  2343. pName = (LPSTR)(LPCSTR)"意向客户";
  2344. #ifdef LYFZ_VERSION
  2345. OPEN_MENU(Client2FormLYFZ);
  2346. #else
  2347. OPEN_MENU(Client2Form);
  2348. #endif
  2349. return;
  2350. }
  2351. else if(strMsg=="老客户")
  2352. {
  2353. UINT nID=2;
  2354. LPSTR pName ;
  2355. pName = (LPSTR)(LPCSTR)"老客户";
  2356. OPEN_MENU(OldClient);
  2357. return;
  2358. }
  2359. else if(strMsg=="客户来电")
  2360. {
  2361. UINT nID=2;
  2362. LPSTR pName ;
  2363. pName = (LPSTR)(LPCSTR)"客户来电";
  2364. OPEN_MENU(PhoneRecord);
  2365. return;
  2366. }
  2367. else if(strMsg=="拨出电话")
  2368. {
  2369. UINT nID=2;
  2370. LPSTR pName ;
  2371. pName = (LPSTR)(LPCSTR)"拨出电话";
  2372. OPEN_MENU(PhoneRecordOut);
  2373. return;
  2374. }
  2375. else if(strMsg=="未接来电")
  2376. {
  2377. UINT nID=2;
  2378. LPSTR pName ;
  2379. pName = (LPSTR)(LPCSTR)"未接来电";
  2380. OPEN_MENU(MissCall);
  2381. return;
  2382. }
  2383. else if(strMsg=="客户流失")
  2384. {
  2385. UINT nID=2;
  2386. LPSTR pName ;
  2387. pName = (LPSTR)(LPCSTR)"客户流失";
  2388. OPEN_MENU(ClientReasonChart);
  2389. return;
  2390. }
  2391. else if(strMsg=="客户来源")
  2392. {
  2393. UINT nID=2;
  2394. LPSTR pName ;
  2395. pName = (LPSTR)(LPCSTR)"客户来源";
  2396. OPEN_MENU(ClientFromChart);
  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(MonthForm);
  2406. return;
  2407. }
  2408. else if(strMsg=="支出报表")
  2409. {
  2410. if(IsHasRightsnew(23)==0)return;
  2411. UINT nID=2;
  2412. LPSTR pName ;
  2413. pName = (LPSTR)(LPCSTR)"支出报表";
  2414. OPEN_MENU(MonthForm2);
  2415. return;
  2416. }
  2417. else if(strMsg=="年财务表")
  2418. {
  2419. if(IsHasRightsnew(24)==0)return;
  2420. UINT nID=2;
  2421. LPSTR pName ;
  2422. pName = (LPSTR)(LPCSTR)"年财务表";
  2423. OPEN_MENU(YearForm);
  2424. return;
  2425. }
  2426. else if(strMsg=="年财务图表")
  2427. {
  2428. if(IsHasRightsnew(24)==0)return;
  2429. GetOcx();
  2430. UINT nID=2;
  2431. LPSTR pName ;
  2432. pName = (LPSTR)(LPCSTR)"年财务图表";
  2433. OPEN_MENU(YearForm2);
  2434. return;
  2435. }
  2436. else if(strMsg=="订单图表")
  2437. {
  2438. GetOcx();
  2439. UINT nID=2;
  2440. LPSTR pName ;
  2441. pName = (LPSTR)(LPCSTR)"订单图表";
  2442. OPEN_MENU(DinDanForm);
  2443. return;
  2444. }
  2445. #ifdef ENTERPRISE_VERSION
  2446. else if(strMsg=="订单报表")
  2447. {
  2448. GetOcx();
  2449. UINT nID=2;
  2450. LPSTR pName ;
  2451. pName = (LPSTR)(LPCSTR)"订单报表2";
  2452. OPEN_MENU(DinDanFromBranch);
  2453. return;
  2454. }
  2455. else if(strMsg=="财务图表")
  2456. {
  2457. GetOcx();
  2458. UINT nID=2;
  2459. LPSTR pName ;
  2460. pName = (LPSTR)(LPCSTR)"财务图表";
  2461. OPEN_MENU(YearFormBranch);
  2462. return;
  2463. }
  2464. else if(strMsg=="订单图表")
  2465. {
  2466. GetOcx();
  2467. UINT nID=2;
  2468. LPSTR pName ;
  2469. pName = (LPSTR)(LPCSTR)"订单图表";
  2470. OPEN_MENU(YearFormBranch2);
  2471. return;
  2472. }
  2473. else if(strMsg=="摄控安排")
  2474. {
  2475. UINT nID=2;
  2476. LPSTR pName ;
  2477. pName = (LPSTR)(LPCSTR)"摄控安排";
  2478. g_bookingtype=0;
  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=1;
  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=2;
  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=3;
  2506. OPEN_MENU(TodayForm);
  2507. return;
  2508. }
  2509. else if(strMsg=="婚庆安排")
  2510. {
  2511. UINT nID=2;
  2512. LPSTR pName ;
  2513. pName = (LPSTR)(LPCSTR)"婚庆安排";
  2514. g_bookingtype=4;
  2515. OPEN_MENU(TodayForm);
  2516. return;
  2517. }
  2518. #endif
  2519. else if(strMsg=="员工资料")
  2520. {
  2521. UINT nID=2;
  2522. LPSTR pName ;
  2523. pName = (LPSTR)(LPCSTR)"员工资料";
  2524. if(g_bAllBranch)
  2525. OPEN_MENU(EmployeeForm2);
  2526. else
  2527. OPEN_MENU(EmployeeForm);
  2528. return;
  2529. }
  2530. else if(strMsg=="客户区域")
  2531. {
  2532. // if(IsHasRightsnew(48)==0)return;
  2533. GetOcx();
  2534. UINT nID=2;
  2535. LPSTR pName ;
  2536. pName = (LPSTR)(LPCSTR)"客户区域";
  2537. OPEN_MENU(AreaClient);
  2538. return;
  2539. }
  2540. else if(strMsg=="客户报表")
  2541. {
  2542. UINT nID=3;
  2543. LPSTR pName ;
  2544. pName = (LPSTR)(LPCSTR)"客户报表";
  2545. OPEN_MENU(CClientForm);
  2546. return;
  2547. }
  2548. else if(strMsg=="每日签到")
  2549. {
  2550. UINT nID=3;
  2551. LPSTR pName ;
  2552. pName = (LPSTR)(LPCSTR)"每日签到";
  2553. OPEN_MENU(WorkerReport);
  2554. return;
  2555. }
  2556. else if(strMsg=="服务费")
  2557. {
  2558. UINT nID=3;
  2559. LPSTR pName ;
  2560. pName = (LPSTR)(LPCSTR)"服务费";
  2561. OPEN_MENU(annualfee);
  2562. return;
  2563. }
  2564. else if(strMsg=="现金支出")
  2565. {
  2566. if(IsHasRightsnew(16)==0)return;
  2567. UINT nID=3;
  2568. LPSTR pName ;
  2569. pName = (LPSTR)(LPCSTR)"现金支出";
  2570. OPEN_MENU(PayOutInput);
  2571. return;
  2572. }
  2573. else if(strMsg=="短信群发")
  2574. {
  2575. UINT nID=3;
  2576. LPSTR pName ;
  2577. pName = (LPSTR)(LPCSTR)"短信群发";
  2578. OPEN_MENU(SendMsg);
  2579. return;
  2580. }
  2581. else if(strMsg=="短信发送")
  2582. {
  2583. UINT nID=3;
  2584. LPSTR pName ;
  2585. pName = (LPSTR)(LPCSTR)"客户报表";
  2586. OPEN_MENU(CClientForm);
  2587. return;
  2588. }
  2589. else if(strMsg=="流程短信")
  2590. {
  2591. UINT nID=3;
  2592. LPSTR pName ;
  2593. pName = (LPSTR)(LPCSTR)"流程短信";
  2594. OPEN_MENU(WorkMsg);
  2595. return;
  2596. }
  2597. else if(strMsg=="员工短信")
  2598. {
  2599. UINT nID=3;
  2600. LPSTR pName ;
  2601. pName = (LPSTR)(LPCSTR)"员工短信";
  2602. OPEN_MENU(EmployeeMsg);
  2603. return;
  2604. }
  2605. else if(strMsg=="发送记录")
  2606. {
  2607. UINT nID=3;
  2608. LPSTR pName ;
  2609. pName = (LPSTR)(LPCSTR)"发送记录";
  2610. OPEN_MENU(MsgReg);
  2611. return;
  2612. }
  2613. else if(strMsg=="短信设置")
  2614. {
  2615. if(IsHasRightsnew(49)==0)return;
  2616. MsgSet dlg;
  2617. dlg.DoModal();
  2618. return;
  2619. }
  2620. else if(strMsg=="金卡会员")
  2621. {
  2622. #ifndef ENTERPRISE_VERSION
  2623. #ifndef CHILD_VERSION
  2624. #ifdef BASIC_VERSION
  2625. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2626. {
  2627. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2628. exit(0);return;
  2629. }
  2630. #else
  2631. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2632. {
  2633. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2634. exit(0);return;
  2635. }
  2636. #endif
  2637. #else
  2638. #ifdef BASIC_VERSION
  2639. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2640. {
  2641. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2642. exit(0);return;
  2643. }
  2644. #else
  2645. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2646. {
  2647. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2648. exit(0);return;
  2649. }
  2650. #endif
  2651. #endif
  2652. #else
  2653. #ifndef CHILD_VERSION
  2654. #ifdef BASIC_VERSION
  2655. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2656. {
  2657. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2658. exit(0);return;
  2659. }
  2660. #else
  2661. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2662. {
  2663. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2664. exit(0);return;
  2665. }
  2666. #endif
  2667. #else
  2668. #ifdef BASIC_VERSION
  2669. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2670. {
  2671. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2672. exit(0);return;
  2673. }
  2674. #else
  2675. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2676. {
  2677. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2678. exit(0);return;
  2679. }
  2680. #endif
  2681. #endif
  2682. #endif
  2683. UINT nID=3;
  2684. LPSTR pName ;
  2685. pName = (LPSTR)(LPCSTR)"金卡会员";
  2686. OPEN_MENU(ShowMember);
  2687. return;
  2688. }
  2689. else if(strMsg=="现金子卡")
  2690. {
  2691. UINT nID=3;
  2692. LPSTR pName ;
  2693. pName = (LPSTR)(LPCSTR)"现金子卡";
  2694. OPEN_MENU(ShowMember2);
  2695. return;
  2696. }
  2697. else if(strMsg=="蓝钻会员")
  2698. {
  2699. #ifndef ENTERPRISE_VERSION
  2700. #ifndef CHILD_VERSION
  2701. #ifdef BASIC_VERSION
  2702. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2703. {
  2704. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2705. exit(0);return;
  2706. }
  2707. #else
  2708. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2709. {
  2710. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2711. exit(0);return;
  2712. }
  2713. #endif
  2714. #else
  2715. #ifdef BASIC_VERSION
  2716. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2717. {
  2718. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2719. exit(0);return;
  2720. }
  2721. #else
  2722. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2723. {
  2724. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2725. exit(0);return;
  2726. }
  2727. #endif
  2728. #endif
  2729. #else
  2730. #ifndef CHILD_VERSION
  2731. #ifdef BASIC_VERSION
  2732. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2733. {
  2734. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2735. exit(0);return;
  2736. }
  2737. #else
  2738. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2739. {
  2740. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2741. exit(0);return;
  2742. }
  2743. #endif
  2744. #else
  2745. #ifdef BASIC_VERSION
  2746. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2747. {
  2748. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2749. exit(0);return;
  2750. }
  2751. #else
  2752. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2753. {
  2754. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2755. exit(0);return;
  2756. }
  2757. #endif
  2758. #endif
  2759. #endif
  2760. UINT nID=3;
  2761. LPSTR pName ;
  2762. pName = (LPSTR)(LPCSTR)"蓝钻会员";
  2763. OPEN_MENU(ShowMemberBlue);
  2764. return;
  2765. }
  2766. else if(strMsg=="转介绍积分")
  2767. {
  2768. #ifndef ENTERPRISE_VERSION
  2769. #ifndef CHILD_VERSION
  2770. #ifdef BASIC_VERSION
  2771. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2772. {
  2773. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2774. exit(0);return;
  2775. }
  2776. #else
  2777. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2778. {
  2779. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2780. exit(0);return;
  2781. }
  2782. #endif
  2783. #else
  2784. #ifdef BASIC_VERSION
  2785. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2786. {
  2787. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2788. exit(0);return;
  2789. }
  2790. #else
  2791. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2792. {
  2793. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2794. exit(0);return;
  2795. }
  2796. #endif
  2797. #endif
  2798. #else
  2799. #ifndef CHILD_VERSION
  2800. #ifdef BASIC_VERSION
  2801. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2802. {
  2803. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2804. exit(0);return;
  2805. }
  2806. #else
  2807. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2808. {
  2809. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2810. exit(0);return;
  2811. }
  2812. #endif
  2813. #else
  2814. #ifdef BASIC_VERSION
  2815. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2816. {
  2817. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2818. exit(0);return;
  2819. }
  2820. #else
  2821. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2822. {
  2823. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2824. exit(0);return;
  2825. }
  2826. #endif
  2827. #endif
  2828. #endif
  2829. UINT nID=3;
  2830. LPSTR pName ;
  2831. pName = (LPSTR)(LPCSTR)"转介绍积分";
  2832. OPEN_MENU(Card2Reg);
  2833. return;
  2834. }
  2835. /* else if(strMsg=="转介绍图表")
  2836. {
  2837. #ifndef ENTERPRISE_VERSION
  2838. #ifndef CHILD_VERSION
  2839. #ifdef BASIC_VERSION
  2840. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2841. {
  2842. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2843. exit(0);return;
  2844. }
  2845. #else
  2846. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2847. {
  2848. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2849. exit(0);return;
  2850. }
  2851. #endif
  2852. #else
  2853. #ifdef BASIC_VERSION
  2854. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2855. {
  2856. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2857. exit(0);return;
  2858. }
  2859. #else
  2860. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2861. {
  2862. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2863. exit(0);return;
  2864. }
  2865. #endif
  2866. #endif
  2867. #else
  2868. #ifndef CHILD_VERSION
  2869. #ifdef BASIC_VERSION
  2870. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2871. {
  2872. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2873. exit(0);return;
  2874. }
  2875. #else
  2876. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2877. {
  2878. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2879. exit(0);return;
  2880. }
  2881. #endif
  2882. #else
  2883. #ifdef BASIC_VERSION
  2884. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2885. {
  2886. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2887. exit(0);return;
  2888. }
  2889. #else
  2890. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2891. {
  2892. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2893. exit(0);return;
  2894. }
  2895. #endif
  2896. #endif
  2897. #endif
  2898. UINT nID=3;
  2899. LPSTR pName ;
  2900. pName = (LPSTR)(LPCSTR)"转介绍图表";
  2901. OPEN_MENU(Card2RegChart);
  2902. return;
  2903. }*/
  2904. else if(strMsg=="金卡图表")
  2905. {
  2906. UINT nID=3;
  2907. LPSTR pName ;
  2908. pName = (LPSTR)(LPCSTR)"金卡图表";
  2909. OPEN_MENU(MemberChart);
  2910. return;
  2911. }
  2912. else if(strMsg=="积分短信")
  2913. {
  2914. UINT nID=3;
  2915. LPSTR pName ;
  2916. pName = (LPSTR)(LPCSTR)"积分短信";
  2917. OPEN_MENU(ShowMemberMsg);
  2918. return;
  2919. }
  2920. else if(strMsg=="转介绍返现")
  2921. {
  2922. #ifndef ENTERPRISE_VERSION
  2923. #ifndef CHILD_VERSION
  2924. #ifdef BASIC_VERSION
  2925. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2926. {
  2927. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2928. exit(0);return;
  2929. }
  2930. #else
  2931. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2932. {
  2933. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2934. exit(0);return;
  2935. }
  2936. #endif
  2937. #else
  2938. #ifdef BASIC_VERSION
  2939. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2940. {
  2941. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2942. exit(0);return;
  2943. }
  2944. #else
  2945. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2946. {
  2947. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2948. exit(0);return;
  2949. }
  2950. #endif
  2951. #endif
  2952. #else
  2953. #ifndef CHILD_VERSION
  2954. #ifdef BASIC_VERSION
  2955. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2956. {
  2957. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2958. exit(0);return;
  2959. }
  2960. #else
  2961. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2962. {
  2963. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2964. exit(0);return;
  2965. }
  2966. #endif
  2967. #else
  2968. #ifdef BASIC_VERSION
  2969. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2970. {
  2971. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2972. exit(0);return;
  2973. }
  2974. #else
  2975. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2976. {
  2977. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2978. exit(0);return;
  2979. }
  2980. #endif
  2981. #endif
  2982. #endif
  2983. UINT nID=3;
  2984. LPSTR pName ;
  2985. pName = (LPSTR)(LPCSTR)"转介绍返现";
  2986. OPEN_MENU(Card2RegBlue);
  2987. return;
  2988. }
  2989. else if(strMsg=="转介绍图表")
  2990. {
  2991. #ifndef ENTERPRISE_VERSION
  2992. #ifndef CHILD_VERSION
  2993. #ifdef BASIC_VERSION
  2994. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2995. {
  2996. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2997. exit(0);return;
  2998. }
  2999. #else
  3000. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3001. {
  3002. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3003. exit(0);return;
  3004. }
  3005. #endif
  3006. #else
  3007. #ifdef BASIC_VERSION
  3008. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3009. {
  3010. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3011. exit(0);return;
  3012. }
  3013. #else
  3014. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3015. {
  3016. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3017. exit(0);return;
  3018. }
  3019. #endif
  3020. #endif
  3021. #else
  3022. #ifndef CHILD_VERSION
  3023. #ifdef BASIC_VERSION
  3024. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3025. {
  3026. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3027. exit(0);return;
  3028. }
  3029. #else
  3030. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3031. {
  3032. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3033. exit(0);return;
  3034. }
  3035. #endif
  3036. #else
  3037. #ifdef BASIC_VERSION
  3038. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3039. {
  3040. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3041. exit(0);return;
  3042. }
  3043. #else
  3044. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3045. {
  3046. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3047. exit(0);return;
  3048. }
  3049. #endif
  3050. #endif
  3051. #endif
  3052. UINT nID=3;
  3053. LPSTR pName ;
  3054. pName = (LPSTR)(LPCSTR)"转介绍图表";
  3055. OPEN_MENU(Card2RegChartBlue);
  3056. return;
  3057. }
  3058. else if(strMsg=="积分设置")
  3059. {
  3060. if(IsHasRightsnew(49)==0)return;
  3061. MemberSet dlg;
  3062. dlg.DoModal();
  3063. return;
  3064. }
  3065. else if(strMsg=="礼服录入")
  3066. {
  3067. if(IsHasRightsnew(39)==0)return;
  3068. UINT nID=3;
  3069. LPSTR pName ;
  3070. pName = (LPSTR)(LPCSTR)"礼服录入";
  3071. OPEN_MENU(DressManage);
  3072. return;
  3073. }
  3074. else if(strMsg=="礼服查看")
  3075. {
  3076. #ifndef ENTERPRISE_VERSION
  3077. #ifndef CHILD_VERSION
  3078. #ifdef BASIC_VERSION
  3079. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3080. {
  3081. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3082. exit(0);return;
  3083. }
  3084. #else
  3085. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3086. {
  3087. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3088. exit(0);return;
  3089. }
  3090. #endif
  3091. #else
  3092. #ifdef BASIC_VERSION
  3093. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3094. {
  3095. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3096. exit(0);return;
  3097. }
  3098. #else
  3099. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3100. {
  3101. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3102. exit(0);return;
  3103. }
  3104. #endif
  3105. #endif
  3106. #else
  3107. #ifndef CHILD_VERSION
  3108. #ifdef BASIC_VERSION
  3109. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3110. {
  3111. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3112. exit(0);return;
  3113. }
  3114. #else
  3115. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3116. {
  3117. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3118. exit(0);return;
  3119. }
  3120. #endif
  3121. #else
  3122. #ifdef BASIC_VERSION
  3123. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3124. {
  3125. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3126. exit(0);return;
  3127. }
  3128. #else
  3129. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3130. {
  3131. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3132. exit(0);return;
  3133. }
  3134. #endif
  3135. #endif
  3136. #endif
  3137. if(IsHasRightsnew(40)==0)return;
  3138. UINT nID=3;
  3139. LPSTR pName ;
  3140. pName = (LPSTR)(LPCSTR)"礼服查看";
  3141. OPEN_MENU(ShowDress);
  3142. return;
  3143. }
  3144. else if(strMsg=="撞期预警")
  3145. {
  3146. UINT nID=3;
  3147. LPSTR pName ;
  3148. pName = (LPSTR)(LPCSTR)"撞期预警";
  3149. OPEN_MENU(DressEarlyWarning);
  3150. return;
  3151. }
  3152. else if(strMsg=="礼服出租")
  3153. {
  3154. UINT nID=3;
  3155. LPSTR pName ;
  3156. pName = (LPSTR)(LPCSTR)"礼服出租";
  3157. OPEN_MENU(ShowHireReg);
  3158. return;
  3159. }
  3160. else if(strMsg=="礼服图片")
  3161. {
  3162. ShowPic dlg;
  3163. dlg.m_mode=4;
  3164. dlg.m_path=g_path5+"\\";
  3165. dlg.DoModal ();
  3166. return;
  3167. }
  3168. else if(strMsg=="商品类别设置")
  3169. {
  3170. if(IsHasRightsnew(29)==0)return;
  3171. SPLBDlg dlg;
  3172. dlg.DoModal ();
  3173. return;
  3174. }
  3175. else if(strMsg=="商品名称设置")
  3176. {
  3177. if(IsHasRightsnew(29)==0)return;
  3178. UINT nID=3;
  3179. LPSTR pName ;
  3180. pName = (LPSTR)(LPCSTR)"商品设置";
  3181. OPEN_MENU(ShangPin);
  3182. return;
  3183. }
  3184. else if(strMsg=="固定资产管理")
  3185. {
  3186. UINT nID=3;
  3187. LPSTR pName ;
  3188. pName = (LPSTR)(LPCSTR)"固定资产管理";
  3189. OPEN_MENU(FixedAssets);
  3190. return;
  3191. }
  3192. else if(strMsg=="入库单")
  3193. {
  3194. if(IsHasRightsnew(44)==0)return;
  3195. InputGoods dlg;
  3196. dlg.DoModal ();
  3197. return;
  3198. }
  3199. else if(strMsg=="出库单")
  3200. {
  3201. #ifndef ENTERPRISE_VERSION
  3202. #ifndef CHILD_VERSION
  3203. #ifdef BASIC_VERSION
  3204. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3205. {
  3206. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3207. exit(0);return;
  3208. }
  3209. #else
  3210. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3211. {
  3212. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3213. exit(0);return;
  3214. }
  3215. #endif
  3216. #else
  3217. #ifdef BASIC_VERSION
  3218. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3219. {
  3220. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3221. exit(0);return;
  3222. }
  3223. #else
  3224. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3225. {
  3226. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3227. exit(0);return;
  3228. }
  3229. #endif
  3230. #endif
  3231. #else
  3232. #ifndef CHILD_VERSION
  3233. #ifdef BASIC_VERSION
  3234. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3235. {
  3236. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3237. exit(0);return;
  3238. }
  3239. #else
  3240. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3241. {
  3242. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3243. exit(0);return;
  3244. }
  3245. #endif
  3246. #else
  3247. #ifdef BASIC_VERSION
  3248. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3249. {
  3250. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3251. exit(0);return;
  3252. }
  3253. #else
  3254. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3255. {
  3256. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3257. exit(0);return;
  3258. }
  3259. #endif
  3260. #endif
  3261. #endif
  3262. if(IsHasRightsnew(45)==0)return;
  3263. InputGoods dlg;
  3264. dlg.m_mode=1;
  3265. dlg.DoModal ();
  3266. return;
  3267. }
  3268. else if(strMsg=="库存查询")
  3269. {
  3270. #ifndef ENTERPRISE_VERSION
  3271. #ifndef CHILD_VERSION
  3272. #ifdef BASIC_VERSION
  3273. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3274. {
  3275. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3276. exit(0);return;
  3277. }
  3278. #else
  3279. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3280. {
  3281. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3282. exit(0);return;
  3283. }
  3284. #endif
  3285. #else
  3286. #ifdef BASIC_VERSION
  3287. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3288. {
  3289. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3290. exit(0);return;
  3291. }
  3292. #else
  3293. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3294. {
  3295. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3296. exit(0);return;
  3297. }
  3298. #endif
  3299. #endif
  3300. #else
  3301. #ifndef CHILD_VERSION
  3302. #ifdef BASIC_VERSION
  3303. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3304. {
  3305. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3306. exit(0);return;
  3307. }
  3308. #else
  3309. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3310. {
  3311. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3312. exit(0);return;
  3313. }
  3314. #endif
  3315. #else
  3316. #ifdef BASIC_VERSION
  3317. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3318. {
  3319. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3320. exit(0);return;
  3321. }
  3322. #else
  3323. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3324. {
  3325. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3326. exit(0);return;
  3327. }
  3328. #endif
  3329. #endif
  3330. #endif
  3331. UINT nID=3;
  3332. LPSTR pName ;
  3333. pName = (LPSTR)(LPCSTR)"库存查询";
  3334. OPEN_MENU(ShowGoods);
  3335. return;
  3336. }
  3337. else if(strMsg=="商品图表")
  3338. {
  3339. UINT nID=3;
  3340. LPSTR pName ;
  3341. pName = (LPSTR)(LPCSTR)"商品图表";
  3342. OPEN_MENU(StoreInfoChart);
  3343. return;
  3344. }
  3345. else if(strMsg=="成本核算")
  3346. {
  3347. UINT nID=3;
  3348. LPSTR pName ;
  3349. pName = (LPSTR)(LPCSTR)"成本核算";
  3350. OPEN_MENU(CostCal);
  3351. return;
  3352. }
  3353. else if(strMsg=="考勤记录")
  3354. {
  3355. UINT nID=3;
  3356. LPSTR pName ;
  3357. pName = (LPSTR)(LPCSTR)"考勤记录";
  3358. OPEN_MENU(LoginReg);
  3359. return;
  3360. }
  3361. else if(strMsg=="月统计")
  3362. {
  3363. UINT nID=3;
  3364. LPSTR pName ;
  3365. pName = (LPSTR)(LPCSTR)"月统计";
  3366. OPEN_MENU(LoginReg2);
  3367. return;
  3368. }
  3369. else if(strMsg=="时间设置")
  3370. {
  3371. if(IsHasRightsnew(21)==0)return;
  3372. SetLoginTime dlg;
  3373. dlg.DoModal ();
  3374. return;
  3375. }
  3376. else if(strMsg=="排班设置")
  3377. {
  3378. if(IsHasRightsnew(21)==0)return;
  3379. SetLoginBan dlg;
  3380. dlg.DoModal ();
  3381. return;
  3382. }
  3383. else if(strMsg=="意向查询")
  3384. {
  3385. UINT nID=3;
  3386. LPSTR pName ;
  3387. pName = (LPSTR)(LPCSTR)"意向查询";
  3388. OPEN_MENU(HospitalClient);
  3389. return;
  3390. }
  3391. else if(strMsg=="今日提醒")
  3392. {
  3393. UINT nID=3;
  3394. LPSTR pName ;
  3395. pName = (LPSTR)(LPCSTR)"今日提醒";
  3396. OPEN_MENU(HospitalClientAlarm);
  3397. return;
  3398. }
  3399. else if(strMsg=="跟踪短信")
  3400. {
  3401. UINT nID=3;
  3402. LPSTR pName ;
  3403. pName = (LPSTR)(LPCSTR)"跟踪短信";
  3404. OPEN_MENU(HospitalClientMsg);
  3405. return;
  3406. }
  3407. else if(strMsg=="意向单录入")
  3408. {
  3409. AddHospitalClient dlg;
  3410. dlg.DoModal();
  3411. return;
  3412. }
  3413. else if(strMsg=="资料设置")
  3414. {
  3415. HospitalInfoSet dlg;
  3416. dlg.DoModal ();
  3417. return;
  3418. }
  3419. #if 1 // Jeff.add.2014.07.08.多多福文件柜功能;
  3420. else if ( strMsg == "文件柜")
  3421. {
  3422. //FileManage dlg;
  3423. UINT nID=3;
  3424. LPSTR pName ;
  3425. pName = (LPSTR)(LPCSTR)"文件柜";
  3426. OPEN_MENU(FileManage);
  3427. return;
  3428. }
  3429. #endif
  3430. AfxMessageBox(strMsg+",开发中...");
  3431. }
  3432. void CMainFrame::AutoUpdate()
  3433. {
  3434. if(g_bBranchModify)
  3435. {
  3436. AfxMessageBox("此店与分店"+g_branchname+"软件版本不同,请同时升级! ");
  3437. return;
  3438. }
  3439. else if(g_branchname!="")
  3440. {
  3441. AfxMessageBox("此店与分店"+g_branchname+"软件版本不同,请同时升级! ");
  3442. return;
  3443. }
  3444. g_ntimeout=30000;
  3445. if(!::PathFileExists (g_mainpath+"\\AutoUpdate.exe"))
  3446. {
  3447. g_sendhead.bsql=0;
  3448. g_sendhead.code[0]=99;
  3449. g_sendhead.tabcount=1;
  3450. g_pMainWnd->ProcessChatMessageRequest2(99);
  3451. if(g_bSendOK==0)
  3452. goto failed;
  3453. CFile fp;
  3454. fp.Open (g_mainpath+"\\AutoUpdate.exe", CFile::modeWrite|CFile::modeCreate);
  3455. fp.Write (g_pData, g_nLeng);
  3456. fp.Close ();
  3457. }
  3458. {
  3459. ::DeleteFile (g_mainpath+"\\YLGL2.exe");
  3460. g_sendhead.bsql=0;
  3461. g_sendhead.code[0]=98;
  3462. g_sendhead.tabcount=1;
  3463. g_pMainWnd->ProcessChatMessageRequest2(99);if(g_bSendOK==0)goto failed;
  3464. CFile fp;
  3465. fp.Open (g_mainpath+"\\YLGL2.exe", CFile::modeWrite|CFile::modeCreate);
  3466. fp.Write (g_pData, g_nLeng);
  3467. fp.Close ();
  3468. }
  3469. AfxMessageBox("自动升级成功!", MB_ICONINFORMATION);
  3470. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\AutoUpdate.exe"), "12345", NULL, SW_SHOWNORMAL);
  3471. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3472. exit(0);
  3473. return ;
  3474. failed:
  3475. AfxMessageBox("自动升级失败!", MB_ICONINFORMATION);
  3476. if(g_ntimeout==30000)//非远程
  3477. {
  3478. AfxMessageBox("提醒:升级过程中需要传输较多的数据,如果网速慢可能导致远程升级失败!\r\n\
  3479. 可拷贝店内客户端用QQ传过来覆盖除dbconfig.dat的文件即可。", MB_ICONINFORMATION);
  3480. }
  3481. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3482. }
  3483. void CMainFrame::Onchoosephotoskin() //Jeff:此机用于选片菜单项;不在使用2014.06.16
  3484. {
  3485. if(g_user.bLongin==0)
  3486. {
  3487. if(g_bNoLoginLia)
  3488. {
  3489. Login dlg;
  3490. dlg.SetLiaPath ("5.lia");
  3491. dlg.DoModal();
  3492. }
  3493. else
  3494. {
  3495. Login3 dlg;
  3496. dlg.SetLiaPath ("5.lia");
  3497. dlg.DoModal();
  3498. }
  3499. if(g_user.bLongin==0)return;
  3500. }
  3501. // TODO: Add your command handler code here
  3502. CString version = _T ("Version 1.0");
  3503. CMenu *pMenu=GetMenu();
  3504. CMenu* submenu = pMenu->GetSubMenu(1);
  3505. UINT status=submenu->GetMenuState(IDM_choosephotoskin, MF_BYCOMMAND );
  3506. if(status&MF_CHECKED)
  3507. {
  3508. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_UNCHECKED);
  3509. AfxGetApp()->WriteProfileInt (version, "status", 0);
  3510. }
  3511. else
  3512. {
  3513. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  3514. AfxGetApp()->WriteProfileInt (version, "status", 1);
  3515. }
  3516. }
  3517. BOOL CMainFrame::IsCtrlDown()
  3518. {
  3519. short state=GetKeyState(VK_LCONTROL);
  3520. BYTE sta=(BYTE)(state>>8);
  3521. state=GetKeyState(VK_RCONTROL);
  3522. BYTE sta2=(BYTE)(state>>8);
  3523. if(sta||sta2)
  3524. return 1;
  3525. else
  3526. return 0;
  3527. }//IsShiftDown
  3528. BOOL CMainFrame::IsShiftDown()
  3529. {
  3530. short state=GetKeyState(VK_LSHIFT);
  3531. BYTE sta=(BYTE)(state>>8);
  3532. state=GetKeyState(VK_RSHIFT);
  3533. BYTE sta2=(BYTE)(state>>8);
  3534. if(sta||sta2)
  3535. return 1;
  3536. else
  3537. return 0;
  3538. }
  3539. BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
  3540. {
  3541. // TODO: Add your specialized code here and/or call the base class IDM_Logout
  3542. if(pMsg->message==WM_KEYDOWN)
  3543. {
  3544. switch (pMsg->wParam)
  3545. {
  3546. case VK_F12:
  3547. g_pMainWnd->OnCommandMenu(IDM_Logout);
  3548. return 1;
  3549. case VK_F1:
  3550. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  3551. return 1;
  3552. case VK_F2:
  3553. {
  3554. if(g_pMainWnd->m_bCheckF2F3 && (IsShiftDown()==0 || IsCtrlDown()==0) )return 1;
  3555. m_Mdi.MainClose();
  3556. if(g_user.bLongin)
  3557. {
  3558. SearchClient dlg;
  3559. dlg.SetLiaPath ("2.lia");
  3560. if(dlg.DoModal ()!=IDOK)
  3561. {
  3562. if(dlg.m_bLogout)
  3563. {
  3564. g_user.bLongin=0;
  3565. g_user.name.Empty ();
  3566. g_user.rights.Empty ();
  3567. g_user.account.Empty ();
  3568. goto ll;
  3569. }
  3570. PostMessage(WM_QUIT);
  3571. return 1;
  3572. }
  3573. if(dlg.m_exitcode==3)
  3574. {
  3575. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3576. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3577. }
  3578. else
  3579. {
  3580. ShowWindow(SW_SHOW);
  3581. #ifdef NEW_SKIN
  3582. if(m_pMainFrimDlg2==NULL)
  3583. {
  3584. m_pMainFrimDlg2=new MainFrimDlg2;
  3585. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3586. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3587. }
  3588. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3589. g_bInSkin=0;
  3590. #endif
  3591. }
  3592. }
  3593. else
  3594. {
  3595. ll:
  3596. ChoosePhotoSkin dlg;
  3597. dlg.SetLiaPath ("1.lia");
  3598. if(dlg.DoModal ()!=IDOK)
  3599. {
  3600. PostMessage(WM_QUIT);
  3601. return 1;
  3602. }
  3603. if(dlg.m_exitcode==3)
  3604. {
  3605. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3606. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3607. }
  3608. else
  3609. {
  3610. ShowWindow(SW_SHOW);
  3611. #ifdef NEW_SKIN
  3612. if(m_pMainFrimDlg2==NULL)
  3613. {
  3614. m_pMainFrimDlg2=new MainFrimDlg2;
  3615. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3616. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3617. }
  3618. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3619. #endif
  3620. }
  3621. }
  3622. }
  3623. return 1;
  3624. case VK_F3:
  3625. {
  3626. if(g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown()==0 || g_pMainWnd->IsCtrlDown()==0) )return 1;
  3627. m_Mdi.MainClose();
  3628. if(g_user.bLongin)
  3629. {
  3630. SearchClient dlg;
  3631. dlg.m_mode =1;
  3632. dlg.SetLiaPath ("2.lia");
  3633. if(dlg.DoModal ()!=IDOK)
  3634. {
  3635. if(dlg.m_bLogout)
  3636. {
  3637. g_user.bLongin=0;
  3638. g_user.name.Empty ();
  3639. g_user.rights.Empty ();
  3640. g_user.account.Empty ();
  3641. goto mm;
  3642. }
  3643. PostMessage(WM_QUIT);
  3644. return 1;
  3645. }
  3646. if(dlg.m_exitcode==2)
  3647. {
  3648. keybd_event(VK_F2,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3649. keybd_event(VK_F2,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3650. }
  3651. else
  3652. {
  3653. ShowWindow(SW_SHOW);
  3654. #ifdef NEW_SKIN
  3655. if(m_pMainFrimDlg2==NULL)
  3656. {
  3657. m_pMainFrimDlg2=new MainFrimDlg2;
  3658. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3659. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3660. }
  3661. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3662. #endif
  3663. }
  3664. }
  3665. else
  3666. {
  3667. mm:
  3668. ChoosePhotoSkin dlg;
  3669. dlg.m_mode =1;
  3670. dlg.SetLiaPath ("1.lia");
  3671. if(dlg.DoModal ()!=IDOK)
  3672. {
  3673. PostMessage(WM_QUIT);
  3674. return 1;
  3675. }
  3676. if(dlg.m_exitcode==2)
  3677. {
  3678. keybd_event(VK_F2,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3679. keybd_event(VK_F2,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3680. }
  3681. else
  3682. {
  3683. ShowWindow(SW_SHOW);
  3684. #ifdef NEW_SKIN
  3685. if(m_pMainFrimDlg2==NULL)
  3686. {
  3687. m_pMainFrimDlg2=new MainFrimDlg2;
  3688. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3689. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3690. }
  3691. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3692. #endif
  3693. }
  3694. }
  3695. }
  3696. return 1;
  3697. case VK_F11:
  3698. if(g_bInSkin)return 1;
  3699. if(g_user.bLongin)
  3700. {
  3701. SqlDlg dlg;
  3702. dlg.DoModal ();
  3703. }
  3704. break;
  3705. #ifdef LYFZ_VERSION
  3706. case VK_F4:
  3707. if(g_user.bLongin)
  3708. {
  3709. g_sendhead.bsql=0;
  3710. g_sendhead.code[0]=199;
  3711. g_sendhead.tabcount=1;
  3712. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return 0;
  3713. DataToArray(&g_List1array);
  3714. CStdioFile fp;
  3715. CString path=g_mainpath+"\\NullBalance.txt";
  3716. ::DeleteFile (path);
  3717. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  3718. CString str;
  3719. for(int i=0; i<g_List1array.GetSize (); i++)
  3720. {
  3721. for(int j=0; j<g_List1array.ElementAt (0).GetSize (); j++)
  3722. {
  3723. str=g_List1array.ElementAt (0).ElementAt (j)+"\n";
  3724. str.TrimLeft ();
  3725. fp.WriteString (str);
  3726. }
  3727. }
  3728. fp.Close ();
  3729. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  3730. }
  3731. break;
  3732. #endif
  3733. }
  3734. }
  3735. return CMDIFrameWnd::PreTranslateMessage(pMsg);
  3736. }
  3737. void CMainFrame::GetSkin()
  3738. {return;
  3739. #ifdef MNLS_VERSION
  3740. if(::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3741. {
  3742. CFile fp;
  3743. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeRead);
  3744. DWORD leng=fp.GetLength ();
  3745. fp.Close ();
  3746. if(leng!=194987)
  3747. ::DeleteFile (g_mainpath+"\\skin\\4.lia");
  3748. }
  3749. if(!::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3750. {
  3751. ::CreateDirectory (g_mainpath+"\\skin", NULL);
  3752. g_sendhead.bsql=0;
  3753. g_sendhead.code[0]=100;
  3754. g_sendhead.tabcount=1;
  3755. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  3756. CFile fp;
  3757. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeWrite|CFile::modeCreate);
  3758. fp.Write (g_pData, g_nLeng);
  3759. fp.Close ();
  3760. }
  3761. #endif
  3762. }
  3763. void AutoDraw(CPrintRX &m_Print, CRect &StrRect, CString &str, float fscale)
  3764. {
  3765. CString tempbz,temp;
  3766. BOOL bRun=0;
  3767. CSize size;
  3768. int fontsize=12;
  3769. int i=0;
  3770. ll: tempbz=str;
  3771. i=0;
  3772. m_Print.SetFontFace(fontsize, 1, "宋体");
  3773. while(1)
  3774. {
  3775. if(!tempbz.IsEmpty ())
  3776. {
  3777. temp=tempbz;
  3778. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3779. int right=0;
  3780. CRect temprc=StrRect;
  3781. temprc.top += i*(fontsize*fscale);i++;
  3782. temprc.bottom =temprc.top +fontsize;
  3783. if(temprc.bottom >StrRect.bottom )break;
  3784. while(size.cx>temprc.Width ())
  3785. {
  3786. right++;
  3787. temp=tempbz.Left (tempbz.GetLength ()-(right));
  3788. if(GIsHalfHZ(temp))
  3789. {
  3790. right++;
  3791. temp.Delete (temp.GetLength ()-1);
  3792. }
  3793. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3794. }
  3795. if(temp.Find ("\r\n")!=-1)
  3796. {
  3797. temp=temp.Left (temp.Find ("\r\n"));//i++;
  3798. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ()-2);
  3799. }
  3800. else
  3801. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  3802. if(bRun)
  3803. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, temprc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3804. }
  3805. else
  3806. break;
  3807. }
  3808. if(tempbz.IsEmpty ()==0)
  3809. {
  3810. fontsize--;
  3811. goto ll;
  3812. }
  3813. if(bRun==0)
  3814. {
  3815. bRun=1;
  3816. goto ll;
  3817. }
  3818. }
  3819. void CMainFrame::PrintDinDan3(CString strOrderNumber)
  3820. {
  3821. // TODO: Add your control notification handler code here
  3822. CPrintRX m_Print;
  3823. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  3824. {
  3825. m_Print.InitToPrint(NULL, 1);
  3826. }
  3827. else
  3828. {
  3829. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  3830. if(name.IsEmpty ())
  3831. m_Print.InitToPrint(NULL, 1);
  3832. else
  3833. {
  3834. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  3835. if(nret==-1)
  3836. {
  3837. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  3838. }
  3839. }
  3840. }
  3841. m_Print.StartPrint();
  3842. m_Print.StartPage();
  3843. LoadRect load;
  3844. load.SetLiaPath ("11.lia");
  3845. load.SetMargins(0,0);
  3846. if(!load.Load ())return;
  3847. LoadRect load2;
  3848. load2.SetLiaPath ("12.lia");
  3849. load2.SetMargins(0,0);
  3850. if(!load2.Load ())return;
  3851. LoadRect load3;
  3852. load3.SetLiaPath ("13.lia");
  3853. load3.SetMargins(-6,520);
  3854. if(!load3.Load ())return;
  3855. int i;
  3856. //////////////////////////////////////////////////////////////
  3857. CStringArray txarray;
  3858. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"'";
  3859. g_sendhead.code[0]=11;
  3860. g_sendhead.code[1]=52;
  3861. g_sendhead.code[2]=50;
  3862. g_sendhead.code[3]=150;
  3863. g_sendhead.tabcount=4;
  3864. g_sendhead.bsql=0;
  3865. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  3866. CArray<CStringArray, CStringArray>sparray;
  3867. CArray<CStringArray, CStringArray>clientarray;
  3868. CArray<CStringArray, CStringArray>jdarray;
  3869. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray);
  3870. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  3871. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  3872. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  3873. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  3874. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  3875. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  3876. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  3877. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  3878. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  3879. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  3880. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  3881. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  3882. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  3883. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  3884. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  3885. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  3886. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  3887. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  3888. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  3889. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  3890. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  3891. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  3892. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  3893. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  3894. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  3895. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  3896. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  3897. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  3898. CString m_bz ="其它要求: "+g_List1array.ElementAt (0).ElementAt (38);
  3899. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  3900. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  3901. if(IsHasRights2new(31)==0)
  3902. {
  3903. m_phone1="***";
  3904. m_phone2="***";
  3905. }
  3906. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  3907. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  3908. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  3909. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  3910. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  3911. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  3912. CString m_addr=m_addr1+";";
  3913. m_addr.TrimLeft (";");
  3914. m_addr+=m_addr2;
  3915. CString m_qq=m_qq1+";";
  3916. m_qq.TrimLeft (";");
  3917. m_qq+=m_qq2;
  3918. CString m_jd;
  3919. for( i=0; i<jdarray.GetSize (); i++)
  3920. {
  3921. m_jd+=jdarray.ElementAt (i).ElementAt (1);
  3922. m_jd+=";";
  3923. }
  3924. m_jd.TrimRight (";");
  3925. m_money1.Format ("%f", atof(m_taoxijiage));
  3926. m_money2.Format ("%f", atof(m_payed1));
  3927. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  3928. ConvertToPrice(m_money1);
  3929. ConvertToPrice(m_money2);
  3930. ConvertToPrice(m_money3);
  3931. ////////////////////////////////////////////////////////////////
  3932. int rcpos=-1;
  3933. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  3934. m_Print.SetFontFace(17, 1, "宋体");
  3935. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3936. StrRect.top -=0;
  3937. StrRect.bottom -=10;
  3938. StrRect.left -=140;
  3939. StrRect.right =StrRect.left+48;
  3940. m_Print.SetFontFace(15, 1, "宋体");
  3941. m_Print.SetColor(0xffffff);
  3942. m_Print.DrawRect(StrRect, 0);
  3943. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3944. StrRect.left =StrRect.right ;
  3945. StrRect.right =StrRect.left+48;
  3946. m_Print.DrawRect(StrRect, RGB(255,0,0));
  3947. m_Print.SetColor(0, RGB(255,0,0));
  3948. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3949. m_Print.SetColor(0);
  3950. m_Print.SetFontFace(12, 1, "宋体");
  3951. StrRect.left -=48;
  3952. int hei=StrRect.Height ();
  3953. StrRect.top =StrRect.bottom+2;
  3954. StrRect.bottom +=hei+2;
  3955. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3956. StrRect.top =StrRect.bottom-2;
  3957. StrRect.bottom +=hei-5;
  3958. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  3959. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3960. m_Print.SetFontFace(12, 1, "宋体");
  3961. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3962. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3963. m_Print.SetFontFace(11, 1, "宋体");
  3964. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3965. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3966. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3967. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3968. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3969. m_Print.DrawRect2(StrRect, 2);
  3970. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3971. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3972. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3973. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3974. m_Print.DrawRect2(StrRect, 2);
  3975. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3976. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3977. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3978. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3979. m_Print.DrawRect2(StrRect, 2);
  3980. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3981. m_Print.DrawText((LPTSTR)(LPCTSTR)"约单时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3982. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3983. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3984. m_Print.DrawRect2(StrRect, 2);
  3985. ////////////
  3986. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3987. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3988. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3989. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3990. m_Print.DrawRect2(StrRect, 2);
  3991. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3992. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3993. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3994. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3995. m_Print.DrawRect2(StrRect, 2);
  3996. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3997. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3998. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3999. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4000. m_Print.DrawRect2(StrRect, 2);
  4001. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4002. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4003. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4004. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4005. m_Print.DrawRect2(StrRect, 2);
  4006. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4007. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4008. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4009. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4010. m_Print.DrawRect2(StrRect, 2);
  4011. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4012. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/邮箱:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4013. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4014. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4015. m_Print.DrawRect2(StrRect, 2);
  4016. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4017. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系金额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4018. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4019. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4020. m_Print.DrawRect2(StrRect, 2);
  4021. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4022. //m_Print.DrawText((LPTSTR)(LPCTSTR)"定金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4023. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4024. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4025. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4026. m_Print.DrawRect2(StrRect, 2);
  4027. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4028. m_Print.DrawText((LPTSTR)(LPCTSTR)"余额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4029. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4030. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4031. m_Print.DrawRect2(StrRect, 2);
  4032. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4033. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4034. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4035. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4036. m_Print.DrawRect2(StrRect, 2);
  4037. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4038. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍摄景点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4039. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4040. m_Print.DrawText((LPTSTR)(LPCTSTR)m_jd, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4041. m_Print.DrawRect2(StrRect, 2);
  4042. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4043. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容提供: 男士服装:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4044. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4045. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0,FORMAT_HCENTER | FORMAT_VCENTER);
  4046. m_Print.DrawRect2(StrRect, 2);
  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)m_clothescount2, StrRect, 0, 0, FORMAT_HCENTER| 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)"套系内提供拍摄区服装/头饰造型", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4058. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4059. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4060. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4061. m_Print.DrawText((LPTSTR)(LPCTSTR)" ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4062. m_Print.DrawRect2(StrRect, 2);
  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)m_outside2, 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. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4071. m_Print.DrawText((LPTSTR)(LPCTSTR)"(JPG格式数据)", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4072. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4073. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内赠送:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4074. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4075. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_List1array.ElementAt (0).ElementAt (9)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4076. m_Print.DrawRect2(StrRect, 2);
  4077. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4078. m_Print.DrawText((LPTSTR)(LPCTSTR)"张设计排版精修入册", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4079. //////////////////////load2
  4080. rcpos=-1;
  4081. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4082. m_Print.DrawText((LPTSTR)(LPCTSTR)"原始数据套系内张数JPG格式光盘壹只", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4083. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4084. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4085. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4086. // m_Print.DrawText((LPTSTR)(LPCTSTR)"", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4087. // AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4088. m_Print.DrawRect2(StrRect, 2);
  4089. m_Print.SetFontFace(11, 1, "宋体");
  4090. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4091. m_Print.DrawText((LPTSTR)(LPCTSTR)"客人产品:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4092. int rowcount=sparray.GetSize ()/8;
  4093. int needaddrow=0;
  4094. while(sparray.GetSize ()>rowcount*8+needaddrow)
  4095. needaddrow++;
  4096. int pos=0;
  4097. CString str="";
  4098. int addcount=0;
  4099. if(needaddrow>0)
  4100. addcount=1;
  4101. else
  4102. addcount=0;
  4103. needaddrow--;
  4104. str.Empty ();
  4105. for( i=0; i<rowcount+addcount; i++)
  4106. {
  4107. str+=sparray.ElementAt (pos).ElementAt (5);
  4108. str+=" 数量:";
  4109. str+=sparray.ElementAt (pos).ElementAt (3);
  4110. str+=";";
  4111. pos++;
  4112. }
  4113. StrRect=load2.m_rcarray .ElementAt (++rcpos);//6
  4114. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4115. m_Print.DrawRect2(StrRect, 2);
  4116. StrRect=load2.m_rcarray .ElementAt (++rcpos);//6
  4117. if(needaddrow>0)
  4118. addcount=1;
  4119. else
  4120. addcount=0;
  4121. needaddrow--;
  4122. str.Empty ();
  4123. for( i=0; i<rowcount+addcount; i++)
  4124. {
  4125. str+=sparray.ElementAt (pos).ElementAt (5);
  4126. str+=" 数量:";
  4127. str+=sparray.ElementAt (pos).ElementAt (3);
  4128. str+=";";
  4129. pos++;
  4130. }
  4131. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4132. m_Print.DrawRect2(StrRect, 2);
  4133. StrRect=load2.m_rcarray .ElementAt (++rcpos);//7
  4134. if(needaddrow>0)
  4135. addcount=1;
  4136. else
  4137. addcount=0;
  4138. needaddrow--;
  4139. str.Empty ();
  4140. for( i=0; i<rowcount+addcount; i++)
  4141. {
  4142. str+=sparray.ElementAt (pos).ElementAt (5);
  4143. str+=" 数量:";
  4144. str+=sparray.ElementAt (pos).ElementAt (3);
  4145. str+=";";
  4146. pos++;
  4147. }
  4148. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4149. m_Print.DrawRect2(StrRect, 2);
  4150. StrRect=load2.m_rcarray .ElementAt (++rcpos);//8
  4151. if(needaddrow>0)
  4152. addcount=1;
  4153. else
  4154. addcount=0;
  4155. needaddrow--;
  4156. str.Empty ();
  4157. for( i=0; i<rowcount+addcount; i++)
  4158. {
  4159. str+=sparray.ElementAt (pos).ElementAt (5);
  4160. str+=" 数量:";
  4161. str+=sparray.ElementAt (pos).ElementAt (3);
  4162. str+=";";
  4163. pos++;
  4164. }
  4165. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4166. m_Print.DrawRect2(StrRect, 2);
  4167. StrRect=load2.m_rcarray .ElementAt (++rcpos);//9
  4168. if(needaddrow>0)
  4169. addcount=1;
  4170. else
  4171. addcount=0;
  4172. needaddrow--;
  4173. str.Empty ();
  4174. for( i=0; i<rowcount+addcount; i++)
  4175. {
  4176. str+=sparray.ElementAt (pos).ElementAt (5);
  4177. str+=" 数量:";
  4178. str+=sparray.ElementAt (pos).ElementAt (3);
  4179. str+=";";
  4180. pos++;
  4181. }
  4182. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4183. m_Print.DrawRect2(StrRect, 2);
  4184. StrRect=load2.m_rcarray .ElementAt (++rcpos);//10
  4185. if(needaddrow>0)
  4186. addcount=1;
  4187. else
  4188. addcount=0;
  4189. needaddrow--;
  4190. str.Empty ();
  4191. for( i=0; i<rowcount+addcount; i++)
  4192. {
  4193. str+=sparray.ElementAt (pos).ElementAt (5);
  4194. str+=" 数量:";
  4195. str+=sparray.ElementAt (pos).ElementAt (3);
  4196. str+=";";
  4197. pos++;
  4198. }
  4199. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4200. m_Print.DrawRect2(StrRect, 2);
  4201. StrRect=load2.m_rcarray .ElementAt (++rcpos);//11
  4202. if(needaddrow>0)
  4203. addcount=1;
  4204. else
  4205. addcount=0;
  4206. needaddrow--;
  4207. str.Empty ();
  4208. for( i=0; i<rowcount+addcount; i++)
  4209. {
  4210. str+=sparray.ElementAt (pos).ElementAt (5);
  4211. str+=" 数量:";
  4212. str+=sparray.ElementAt (pos).ElementAt (3);
  4213. str+=";";
  4214. pos++;
  4215. }
  4216. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4217. m_Print.DrawRect2(StrRect, 2);
  4218. StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4219. if(needaddrow>0)
  4220. addcount=1;
  4221. else
  4222. addcount=0;
  4223. needaddrow--;
  4224. str.Empty ();
  4225. for( i=0; i<rowcount+addcount; i++)
  4226. {
  4227. str+=sparray.ElementAt (pos).ElementAt (5);
  4228. str+=" 数量:";
  4229. str+=sparray.ElementAt (pos).ElementAt (3);
  4230. str+=";";
  4231. pos++;
  4232. }
  4233. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4234. m_Print.DrawRect2(StrRect, 2);
  4235. /* StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4236. if(needaddrow>0)
  4237. addcount=1;
  4238. else
  4239. addcount=0;
  4240. needaddrow--;
  4241. str.Empty ();
  4242. for( i=0; i<rowcount+addcount; i++)
  4243. {
  4244. str+=sparray.ElementAt (pos).ElementAt (5);
  4245. str+=" 数量:";
  4246. str+=sparray.ElementAt (pos).ElementAt (3);
  4247. str+=";";
  4248. pos++;
  4249. }
  4250. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4251. m_Print.DrawRect2(StrRect, 2);
  4252. StrRect=load2.m_rcarray .ElementAt (++rcpos);//14
  4253. if(needaddrow>0)
  4254. addcount=1;
  4255. else
  4256. addcount=0;
  4257. needaddrow--;
  4258. str.Empty ();
  4259. for( i=0; i<rowcount+addcount; i++)
  4260. {
  4261. str+=sparray.ElementAt (pos).ElementAt (5);
  4262. str+=" 数量:";
  4263. str+=sparray.ElementAt (pos).ElementAt (3);
  4264. str+=";";
  4265. pos++;
  4266. }
  4267. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4268. m_Print.DrawRect2(StrRect, 2);*/
  4269. CRect sprc[2];
  4270. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4271. // AutoDraw(m_Print, StrRect, m_bz.Left (leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4272. m_Print.DrawRect2(StrRect, 2);
  4273. sprc[0]=StrRect;
  4274. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4275. // AutoDraw(m_Print, StrRect, m_bz.Right (leng-leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4276. m_Print.DrawRect2(StrRect, 2);
  4277. sprc[1]=StrRect;
  4278. //AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4279. {
  4280. CString temp,tempspno,tempbz;
  4281. CSize size;
  4282. BOOL bRun=0;
  4283. int fontsize=12;
  4284. ll: tempspno=m_bz;
  4285. m_Print.SetFontFace(fontsize, 1, "宋体");
  4286. for( i=0; i<2; i++)
  4287. {
  4288. if(!tempspno.IsEmpty ())
  4289. {
  4290. temp=tempspno;
  4291. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4292. int right=0;
  4293. CRect temprc=sprc[i];
  4294. while(size.cx>temprc.Width ())
  4295. {
  4296. right++;
  4297. temp=tempspno.Left (tempspno.GetLength ()-(right));
  4298. if(GIsHalfHZ(temp))
  4299. {
  4300. right++;
  4301. temp.Delete (temp.GetLength ()-1);
  4302. }
  4303. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4304. }
  4305. if(bRun)
  4306. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4307. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  4308. if(tempspno.IsEmpty ())i++;
  4309. }
  4310. }
  4311. if(tempspno.IsEmpty ()==0)//|| tempbz.IsEmpty ()==0)
  4312. {
  4313. fontsize--;
  4314. goto ll;
  4315. }
  4316. if(bRun==0)
  4317. {
  4318. bRun=1;
  4319. goto ll;
  4320. }
  4321. }
  4322. m_Print.SetFontFace(11, 1, "宋体");
  4323. //////////////////////load3
  4324. rcpos=-1;
  4325. for( i=0; i<24; i++)
  4326. {
  4327. StrRect=load3.m_rcarray .ElementAt (i);
  4328. m_Print.DrawRect2(StrRect, 1);
  4329. }
  4330. CStringArray strarray;
  4331. strarray.Add("营业员");
  4332. strarray.Add("前台接待");
  4333. strarray.Add("化妆师");
  4334. strarray.Add("礼服师");
  4335. strarray.Add("摄影师");
  4336. strarray.Add("摄影助理");
  4337. strarray.Add("美工师");
  4338. strarray.Add("设计师");
  4339. for( i=0; i<8; i++)
  4340. {
  4341. StrRect=load3.m_rcarray .ElementAt (i);
  4342. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4343. }
  4344. strarray.RemoveAll();
  4345. strarray.Add(m_ren);
  4346. strarray.Add(g_List1array.ElementAt (0).ElementAt (49) );
  4347. strarray.Add(m_waiter2);
  4348. strarray.Add(g_List1array.ElementAt (0).ElementAt (51));
  4349. strarray.Add(m_waiter1);
  4350. strarray.Add(g_List1array.ElementAt (0).ElementAt (50));
  4351. strarray.Add("");
  4352. strarray.Add(m_waiter4);
  4353. for( i=8; i<16; i++)
  4354. {
  4355. StrRect=load3.m_rcarray .ElementAt (i);
  4356. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-8), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4357. }
  4358. StrRect=load3.m_rcarray .ElementAt (27);
  4359. m_Print.DrawText((LPTSTR)(LPCTSTR)"客户电话: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4360. StrRect=load3.m_rcarray .ElementAt (28);
  4361. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4362. m_Print.SetFontFace(13, 1, "宋体");
  4363. StrRect=load3.m_rcarray .ElementAt (25);
  4364. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4365. StrRect=load3.m_rcarray .ElementAt (26);
  4366. m_Print.DrawRect2(StrRect, 2);
  4367. StrRect=load3.m_rcarray .ElementAt (24);
  4368. str="\
  4369. 顾客须知\r\n\
  4370. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  4371. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  4372. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  4373. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  4374. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  4375. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  4376. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  4377. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  4378. AutoDraw(m_Print, StrRect, str, 1.8);
  4379. PrintPreview dlg;
  4380. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4381. dlg.m_pDC =m_Print.GetPDC() ;
  4382. if(dlg.DoModal ()!=IDOK)return;
  4383. //结束打印
  4384. m_Print.EndPage();
  4385. m_Print.EndPrint();
  4386. }
  4387. void CMainFrame::PrintDailyForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4388. {
  4389. // TODO: Add your control notification handler code here
  4390. int pages=Listarray->GetSize ()/46;
  4391. if(Listarray->GetSize ()%46)pages++;
  4392. for(int aa=0; aa<pages; aa++)
  4393. {
  4394. PrintPreview dlg;
  4395. CPrintRX m_Print;
  4396. m_Print.InitToPrint(NULL, 1);
  4397. m_Print.StartPrint();
  4398. m_Print.StartPage();
  4399. CRect mainrc(0,0,560,793);
  4400. float fscale;
  4401. {
  4402. int w,h;
  4403. m_Print.GetWidHei(w , h );
  4404. fscale=(float)w/(float)h;
  4405. }
  4406. mainrc.DeflateRect (25, 40, 10, 0);
  4407. CRect rc,rc2;
  4408. rc=mainrc;
  4409. rc.bottom =rc.top ;
  4410. rc.top -=20;
  4411. m_Print.SetFontFace(16, 1, "黑体");
  4412. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4413. m_Print.SetFontFace(9, 1, "宋体");
  4414. CString str;
  4415. int wid[4]={320,60,60,90};
  4416. int hei=16;
  4417. if(fscale>0.71)hei=15;
  4418. rc=mainrc;
  4419. rc.bottom =rc.top +hei;
  4420. for(int i=0; i<47; i++)
  4421. {
  4422. rc2.top =rc.top +i*hei;
  4423. rc2.bottom =rc.bottom +i*hei;
  4424. rc2.left =rc.left ;
  4425. rc2.right =rc.left +wid[0];
  4426. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  4427. for(int j=0; j<4; j++)
  4428. {
  4429. m_Print.DrawRect2(rc2, 1);
  4430. if(Listarray->GetSize ()>aa*46+i)
  4431. {
  4432. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4433. rc2.left +=3;
  4434. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4435. rc2.left -=3;
  4436. }
  4437. rc2.left +=wid[j];
  4438. rc2.right =rc2.left+wid[j+1];
  4439. }
  4440. }
  4441. rc2.top +=2;
  4442. rc2.left +=2;rc2.right =mainrc.right+4;
  4443. m_Print.SetFontFace(8, 1, "宋体");
  4444. int infopos=info.Find ("***");
  4445. if(infopos!=-1)
  4446. {
  4447. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Left (infopos), rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4448. CRect rc3=rc2;
  4449. rc3.top =rc2.bottom -4;
  4450. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Right (info.GetLength ()-infopos-3), rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4451. }
  4452. else
  4453. m_Print.DrawText((LPTSTR)(LPCTSTR)info, rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4454. str.Format (" 页:%d/%d", aa+1, pages);
  4455. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4456. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  4457. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4458. dlg.m_pDC =m_Print.GetPDC() ;
  4459. // dlg.m_mode=1;
  4460. if(aa==0)
  4461. {
  4462. if(dlg.DoModal ()!=IDOK)
  4463. return;
  4464. }
  4465. //结束打印
  4466. m_Print.EndPage();
  4467. m_Print.EndPrint();
  4468. }
  4469. }
  4470. void CMainFrame::PrintLoginForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4471. {
  4472. // TODO: Add your control notification handler code here
  4473. int sinlecount=33*6;
  4474. int pages=Listarray->GetSize ()/sinlecount;
  4475. if(Listarray->GetSize ()%sinlecount)pages++;
  4476. for(int aa=0; aa<pages; aa++)
  4477. {
  4478. PrintPreview dlg;
  4479. CPrintRX m_Print;
  4480. m_Print.InitToPrint(NULL, 1);
  4481. m_Print.StartPrint();
  4482. m_Print.StartPage();
  4483. CRect mainrc(0,0,560,793);
  4484. float fscale;
  4485. {
  4486. int w,h;
  4487. m_Print.GetWidHei(w , h );
  4488. fscale=(float)w/(float)h;
  4489. }
  4490. mainrc.DeflateRect (25, 40, 10, 0);
  4491. CString str;
  4492. CRect rc,rc2;
  4493. rc=mainrc;
  4494. rc.bottom =rc.top ;
  4495. rc.top -=20;
  4496. rc.left -=20;
  4497. m_Print.SetFontFace(12, 1, "黑体");
  4498. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4499. m_Print.SetFontFace(6, 1, "宋体");
  4500. str.Format (" 页:%d/%d", aa+1, pages);
  4501. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4502. rc.right =mainrc.right+20 ;
  4503. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4504. int wid[2]={50,110};
  4505. int hei=11;
  4506. rc=mainrc;
  4507. rc.bottom =rc.top +hei;
  4508. rc.top +=10;
  4509. rc.bottom +=10;
  4510. int dtx=rc.Width ()/3+18;
  4511. int dty=380;
  4512. for(int j=0; j<6; j++)
  4513. {
  4514. if(Listarray->GetSize ()<aa*sinlecount+33*(j+1))continue;
  4515. for(int i=0; i<33; i++)
  4516. {
  4517. rc2.top =rc.top +i*hei;
  4518. rc2.bottom =rc.bottom +i*hei;
  4519. rc2.left =rc.left ;
  4520. rc2.right =rc.left +wid[0];
  4521. if(i==0)
  4522. {
  4523. // rc2.left +=wid[1];
  4524. rc2.right +=wid[1];
  4525. }
  4526. if(j==1 || j==4)
  4527. {
  4528. rc2.left +=dtx;
  4529. rc2.right +=dtx;
  4530. }
  4531. if(j==2 || j==5)
  4532. {
  4533. rc2.left +=dtx*2;
  4534. rc2.right +=dtx*2;
  4535. }
  4536. if(j==3 || j==4 || j==5)
  4537. {
  4538. rc2.top +=dty;
  4539. rc2.bottom +=dty;
  4540. }
  4541. m_Print.DrawRect2(rc2, 1);
  4542. if(Listarray->GetSize ()>aa*sinlecount+33*j+i)
  4543. {
  4544. str=Listarray->ElementAt (aa*sinlecount+33*j+i).ElementAt (0);
  4545. rc2.left +=3;
  4546. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4547. rc2.left -=3;
  4548. }
  4549. if(i==0)continue;
  4550. rc2.left =rc2.right ;
  4551. rc2.right +=wid[1];
  4552. m_Print.DrawRect2(rc2, 1);
  4553. if(Listarray->GetSize ()>aa*sinlecount+33*j+i)
  4554. {
  4555. if(Listarray->ElementAt (aa*sinlecount+33*j+i).GetSize ()>1)
  4556. {
  4557. str=Listarray->ElementAt (aa*sinlecount+33*j+i).ElementAt (1);
  4558. rc2.left +=3;
  4559. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4560. rc2.left -=3;
  4561. }
  4562. }
  4563. /* if(Listarray->GetSize ()>aa*46+i)
  4564. {
  4565. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4566. rc2.left +=3;
  4567. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4568. rc2.left -=3;
  4569. }
  4570. rc2.left +=wid[j];
  4571. rc2.right =rc2.left+wid[j+1];*/
  4572. }
  4573. }
  4574. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4575. dlg.m_pDC =m_Print.GetPDC() ;
  4576. if(aa==0)
  4577. {
  4578. if(dlg.DoModal ()!=IDOK)
  4579. return;
  4580. }
  4581. //结束打印
  4582. m_Print.EndPage();
  4583. m_Print.EndPrint();
  4584. }
  4585. }
  4586. void CMainFrame::PrintTakeForm(CArray<CStringArray, CStringArray>*Listarray)
  4587. {
  4588. CString title;
  4589. CString info;
  4590. // TODO: Add your control notification handler code here
  4591. int sinlecount=4;
  4592. int pages=Listarray->GetSize ()/sinlecount;
  4593. if(Listarray->GetSize ()%sinlecount)pages++;
  4594. for(int aa=0; aa<pages; aa++)
  4595. {
  4596. PrintPreview dlg;
  4597. CPrintRX m_Print;
  4598. m_Print.InitToPrint(NULL, 1);
  4599. m_Print.StartPrint();
  4600. m_Print.StartPage();
  4601. CRect mainrc(0,0,560,793);
  4602. float fscale;
  4603. {
  4604. int w,h;
  4605. m_Print.GetWidHei(w , h );
  4606. fscale=(float)w/(float)h;
  4607. }
  4608. mainrc.DeflateRect (25, 40, 10, 0);
  4609. CString str;
  4610. CRect rc,rc2;
  4611. rc=mainrc;
  4612. rc.bottom =rc.top ;
  4613. rc.top -=20;
  4614. rc.left -=20;
  4615. m_Print.SetFontFace(6, 1, "宋体");
  4616. str.Format (" 页:%d/%d", aa+1, pages);
  4617. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4618. rc.right =mainrc.right+10 ;
  4619. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4620. m_Print.SetFontFace(12, 1, "宋体");
  4621. int wid[2]={70,190};
  4622. int hei=22;
  4623. rc=mainrc;
  4624. rc.bottom =rc.top +hei;
  4625. rc.top +=10;
  4626. rc.bottom +=10;
  4627. int dtx=rc.Width ()/2+18;
  4628. int dty=380;
  4629. int arraysize=Listarray->ElementAt (0).GetSize();
  4630. for(int j=0; j<4; j++)
  4631. {
  4632. if(Listarray->GetSize ()<=aa*sinlecount+j)continue;
  4633. for(int i=0; i<arraysize; i++)
  4634. {
  4635. rc2.top =rc.top +i/2*hei;
  4636. rc2.bottom =rc.bottom +i/2*hei;
  4637. rc2.left =rc.left ;
  4638. rc2.right =rc.left +wid[0];
  4639. if(i%2)
  4640. {
  4641. rc2.left=rc2.right;
  4642. rc2.right +=wid[1];
  4643. }
  4644. if(j==1 || j==3)
  4645. {
  4646. rc2.left +=dtx;
  4647. rc2.right +=dtx;
  4648. }
  4649. if(j==2 || j==3 )
  4650. {
  4651. rc2.top +=dty;
  4652. rc2.bottom +=dty;
  4653. }
  4654. if(i==arraysize-1 || i==arraysize-2)
  4655. {
  4656. rc2.bottom +=hei*2;
  4657. }
  4658. m_Print.DrawRect2(rc2, 1);
  4659. {
  4660. str=Listarray->ElementAt (aa*sinlecount+j).ElementAt (i);
  4661. if(i==arraysize-1)
  4662. {
  4663. CRect rc3=rc2;
  4664. rc3.left+=3;
  4665. rc3.top+=3;
  4666. AutoDraw(m_Print, rc3, str, 1.4);
  4667. }
  4668. else if(i==arraysize-2)
  4669. {
  4670. CRect rc3=rc2;
  4671. rc3.left+=3;
  4672. rc3.top+=3;
  4673. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4674. }
  4675. else
  4676. {
  4677. rc2.left +=3;
  4678. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4679. rc2.left -=3;
  4680. }
  4681. }
  4682. }
  4683. }
  4684. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4685. dlg.m_pDC =m_Print.GetPDC() ;
  4686. if(aa==0)
  4687. {
  4688. if(dlg.DoModal ()!=IDOK)
  4689. return;
  4690. }
  4691. //结束打印
  4692. m_Print.EndPage();
  4693. m_Print.EndPrint();
  4694. }
  4695. }
  4696. void CMainFrame::PrintThumbNail(CStringArray *array, CString client, BOOL bDir, CString m_size)
  4697. {
  4698. // TODO: Add your control notification handler code here
  4699. CStringArray titlearray;
  4700. CStringArray namearray;
  4701. CStringArray noarray;
  4702. CArray<CRect,CRect>rcarray;
  4703. CArray<CRect,CRect>widtharray;
  4704. if(m_size!="")
  4705. {
  4706. int pos=m_size.Find (";");
  4707. while(pos!=-1)
  4708. {
  4709. CString size=m_size.Left (pos);
  4710. int pos2=size.Find (":");
  4711. if(pos2!=-1)
  4712. {
  4713. CString str;
  4714. CRect rc;
  4715. str=size.Left (pos2);
  4716. noarray.Add (str);
  4717. str=size.Right (size.GetLength ()-pos2-1);
  4718. pos2=str.Find (",");
  4719. namearray.Add(str.Left (pos2));str.Delete (0, pos2+1);
  4720. pos2=str.Find (",");
  4721. rc.left=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4722. pos2=str.Find (",");
  4723. rc.top=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4724. widtharray.Add (rc);
  4725. pos2=str.Find (",");
  4726. rc.left=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4727. pos2=str.Find (",");
  4728. rc.top=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4729. pos2=str.Find (",");
  4730. rc.right=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4731. rc.bottom=atoi(str);
  4732. rcarray.Add (rc);
  4733. }
  4734. m_size=m_size.Right (m_size.GetLength ()-pos-1);
  4735. pos=m_size.Find (";");
  4736. }
  4737. }
  4738. PrintPreview dlg;
  4739. CPrintRX m_Print;
  4740. m_Print.InitToPrint(NULL, 1);
  4741. m_Print.StartPrint();
  4742. m_Print.StartPage();
  4743. CRect mainrc(0,0,560,793);
  4744. mainrc.DeflateRect (25, 50, 10, 0);
  4745. m_Print.SetFontFace(10, 1, "宋体");
  4746. CRect rc,rc2;
  4747. rc=mainrc;
  4748. rc.bottom =rc.top ;
  4749. rc.top -=20;
  4750. m_Print.DrawText((LPTSTR)(LPCTSTR)client, rc, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4751. rc.bottom -=5;
  4752. m_Print.DrawRect2(rc, 2);
  4753. if(array->GetSize ()>130)m_Print.SetFontFace(8, 1, "宋体");
  4754. if(bDir)m_Print.SetFontFace(6, 1, "宋体");
  4755. ////////////////////////////////////////////////////////////////
  4756. int imgcount=array->GetSize ();
  4757. int dtx=5;
  4758. int dty=15;
  4759. int cx,cy;
  4760. int countx=5;
  4761. int county=1;
  4762. while(1)
  4763. {
  4764. if(countx*county>=imgcount)
  4765. {
  4766. cx=(mainrc.Width ()-(countx-1)*dtx)/countx;
  4767. cy=cx*4/3;
  4768. break;
  4769. }
  4770. else
  4771. {
  4772. cx=(mainrc.Width ()-(countx-1)*dtx)/countx;
  4773. cy=cx*4/3;
  4774. if(cy*(county+1)+dty*county < mainrc.Height ())//Y方向可以增加一个
  4775. {
  4776. county++;
  4777. }
  4778. else//Y方向不能加,X方向加
  4779. {
  4780. countx++;
  4781. county=1;
  4782. }
  4783. }
  4784. }
  4785. int imgpos=0;
  4786. CString stemp;
  4787. CPen pen( PS_SOLID, 1, RGB(255, 0, 0) );
  4788. CPen *oldpen=m_Print.m_DC.SelectObject(&pen);
  4789. CPen *oldpen2=m_Print.m_memdc.SelectObject(&pen);
  4790. for(int i=0; i<county; i++)
  4791. {
  4792. for(int j=0; j<countx; j++)
  4793. {
  4794. rc=mainrc;
  4795. rc.top +=i*(cy+dty);
  4796. rc.left +=j*(cx+dtx);
  4797. rc.right =rc.left +cx;
  4798. rc.bottom =rc.top +cy;
  4799. Image *pImg=NULL;
  4800. if(imgpos>=array->GetSize ())break;
  4801. CString str=array->ElementAt (imgpos);
  4802. CString spath=str.Left (str.ReverseFind ('\\')+1);
  4803. spath+="m";
  4804. spath+=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4805. if(::CheckFileExist (spath))
  4806. ::LoadImageFromBuf (&pImg, spath);
  4807. else
  4808. {
  4809. ::LoadImageFromBuf (&pImg, str);
  4810. if(pImg==NULL)continue;
  4811. int orientation=GetOrientation(pImg);
  4812. if(orientation==8)
  4813. pImg->RotateFlip( Rotate270FlipNone );
  4814. else if(orientation==6)
  4815. pImg->RotateFlip( Rotate90FlipNone );
  4816. }
  4817. if(pImg==NULL)continue;
  4818. rc2=rc;
  4819. RectFitDes(pImg->GetWidth(), pImg->GetHeight(), rc);
  4820. imgpos++;
  4821. m_Print.DrawImage(pImg, rc);
  4822. int imgwidth=pImg->GetWidth();
  4823. delete pImg;
  4824. rc2.top =rc2.bottom+3 ;
  4825. rc2.bottom +=10;
  4826. if(bDir==0)
  4827. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4828. else
  4829. {
  4830. stemp=str.Left (str.ReverseFind ('\\'));
  4831. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4832. if(stemp.ReverseFind ('\\')!=-1)
  4833. {
  4834. stemp=stemp.Right (stemp.GetLength ()-stemp.ReverseFind ('\\')-1);
  4835. str=stemp+"\\"+str;
  4836. }
  4837. }
  4838. if(str.Find (".")!=-1)
  4839. str=str.Left (str.Find ("."));
  4840. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  4841. if(noarray.GetSize())
  4842. {
  4843. rc2=rc;
  4844. for(int aa=0; aa<noarray.GetSize(); aa++)
  4845. {
  4846. float scale=(float)rc2.Width ()/(float)imgwidth;
  4847. if(noarray.ElementAt(aa)==str)
  4848. {
  4849. int nIndex=aa;
  4850. CRect rc=rcarray.ElementAt (nIndex);
  4851. int wid=widtharray.ElementAt (nIndex).left;
  4852. int hei=widtharray.ElementAt (nIndex).top;
  4853. scale*=(float)imgwidth/(float)wid;
  4854. rc.left *=scale;
  4855. rc.right *=scale;
  4856. rc.top *=scale;
  4857. rc.bottom *=scale;
  4858. rc.left+=rc2.left;
  4859. rc.right+=rc2.left;
  4860. rc.top +=rc2.top;
  4861. rc.bottom +=rc2.top;
  4862. if(rc.left<rc2.left)rc.left=rc2.left;
  4863. if(rc.right>rc2.right)rc.right=rc2.right;
  4864. if(rc.top<rc2.top)rc.top=rc2.top;
  4865. if(rc.bottom>rc2.bottom)rc.bottom=rc2.bottom;
  4866. m_Print.DrawRect2(rc, 1);
  4867. }
  4868. }
  4869. }
  4870. }
  4871. }
  4872. m_Print.m_DC.SelectObject(oldpen);
  4873. m_Print.m_memdc.SelectObject(oldpen2);
  4874. /* CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  4875. StrRect.top -=15;StrRect.bottom -=15;
  4876. Image *pImg=NULL;
  4877. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  4878. m_Print.DrawImage(pImg, StrRect);
  4879. delete pImg;
  4880. m_Print.SetFontFace(10, 1, "宋体");
  4881. StrRect=load.m_rcarray .ElementAt (20);
  4882. StrRect.right=load.m_rcarray .ElementAt (23).right;
  4883. StrRect.top -=18;StrRect.bottom -=18;
  4884. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  4885. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4886. */
  4887. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4888. dlg.m_pDC =m_Print.GetPDC() ;
  4889. if(dlg.DoModal ()!=IDOK)
  4890. return;
  4891. //结束打印
  4892. m_Print.EndPage();
  4893. m_Print.EndPrint();
  4894. }
  4895. // remark by Jeff
  4896. // 函数:PrintDinDan
  4897. // 参数:
  4898. // strOrderNumber:订单单号;(Order number)
  4899. // 返回:void
  4900. // 注意:#
  4901. void CMainFrame::PrintDinDan(CString strOrderNumber)//打印订单报表;
  4902. {
  4903. // TODO: Add your control notification handler code here
  4904. int printcot=1;
  4905. for(int aa=0; aa<printcot; aa++)
  4906. {
  4907. PrintPreview dlg;
  4908. CPrintRX m_Print;
  4909. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  4910. {
  4911. m_Print.InitToPrint(NULL, 1);
  4912. }
  4913. else
  4914. {
  4915. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  4916. if(name.IsEmpty ())
  4917. m_Print.InitToPrint(NULL, 1);
  4918. else
  4919. {
  4920. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  4921. if(nret==-1 && aa==0)
  4922. {
  4923. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  4924. }
  4925. }
  4926. }
  4927. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==0)
  4928. {
  4929. #ifdef ZHIAI_VERSION
  4930. PrintDinDan3(strOrderNumber);
  4931. return;
  4932. #endif
  4933. #ifdef SZBLCT_VERSION
  4934. PrintDinDan4(strOrderNumber);
  4935. return;
  4936. #endif
  4937. m_Print.StartPrint();
  4938. m_Print.StartPage();
  4939. LoadRect load;
  4940. load.SetLiaPath ("6.lia");
  4941. load.SetMargins(-14,15);
  4942. if(!load.Load ())return;
  4943. LoadRect load2;
  4944. load2.SetLiaPath ("7.lia");
  4945. load2.SetMargins(-14,216+15);
  4946. if(!load2.Load ())return;
  4947. LoadRect load3;
  4948. load3.SetLiaPath ("8.lia");
  4949. load3.SetMargins(-14,705+15);
  4950. if(!load3.Load ())return;
  4951. int i;
  4952. //////////////////////////////////////////////////////////////
  4953. CStringArray txarray;
  4954. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"';;";
  4955. g_sendhead.code[0]=11;
  4956. g_sendhead.code[1]=52;
  4957. g_sendhead.code[2]=50;
  4958. g_sendhead.code[3]=150;
  4959. g_sendhead.code[4]=77;
  4960. g_sendhead.code[5]=4;
  4961. g_sendhead.tabcount=6;
  4962. g_sendhead.bsql=0;
  4963. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  4964. CArray<CStringArray, CStringArray>sparray;
  4965. CArray<CStringArray, CStringArray>clientarray;
  4966. CArray<CStringArray, CStringArray>phonearray;
  4967. CArray<CStringArray, CStringArray>fgarray;
  4968. CArray<CStringArray, CStringArray>danweiarray;
  4969. CArray<CStringArray, CStringArray>jdarray;
  4970. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  4971. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  4972. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  4973. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  4974. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  4975. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  4976. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  4977. CString m_taoxiname;
  4978. if(m_zs.Find ("\\")!=-1)
  4979. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底\\入册:"+g_List1array.ElementAt (0).ElementAt (9);
  4980. else
  4981. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底:"+g_List1array.ElementAt (0).ElementAt (9);
  4982. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  4983. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  4984. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  4985. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  4986. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  4987. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  4988. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  4989. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  4990. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  4991. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  4992. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  4993. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  4994. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  4995. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  4996. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  4997. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  4998. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  4999. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  5000. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  5001. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  5002. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  5003. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  5004. if(jdarray.GetSize ())
  5005. {
  5006. if(m_bz.IsEmpty ()==0)
  5007. m_bz="\r\n"+m_bz;
  5008. m_bz+="景点:";
  5009. }
  5010. #ifdef DDF_VERSION
  5011. m_bz+="219店:219路馨园小区对面\r\n";
  5012. m_bz+="金色店:万科金色家园小区东门南走20米荣光社区一楼\r\n";
  5013. m_bz+="万泰店:万泰锦绣华城小区正门\r\n";
  5014. #else
  5015. for( i=0; i<jdarray.GetSize (); i++)
  5016. {
  5017. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5018. }
  5019. m_bz.TrimRight (";");
  5020. #endif
  5021. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5022. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5023. if(IsHasRights2new(31)==0)
  5024. {
  5025. m_phone1="***";
  5026. m_phone2="***";
  5027. }
  5028. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5029. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5030. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  5031. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  5032. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  5033. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  5034. filter="name='"+m_ren+"'";
  5035. g_sendhead.code[0]=5;
  5036. g_sendhead.tabcount=1;
  5037. g_sendhead.bsql=0;
  5038. int g_nYearposTemp=g_nYearpos;
  5039. g_nYearpos=-1;
  5040. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5041. g_nYearpos=g_nYearposTemp;
  5042. if(g_bSendOK==0)return;
  5043. DataToArray(&phonearray);
  5044. m_money1.Format ("%f", atof(m_taoxijiage));
  5045. m_money2.Format ("%f", atof(m_payed1));
  5046. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5047. ConvertToPrice(m_money1);
  5048. ConvertToPrice(m_money2);
  5049. ConvertToPrice(m_money3);
  5050. ////////////////////////////////////////////////////////////////
  5051. int rcpos=-1;
  5052. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  5053. StrRect.top -=15;StrRect.bottom -=15;
  5054. Image *pImg=NULL;
  5055. #ifdef MNLS_VERSION
  5056. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  5057. #else
  5058. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  5059. #endif
  5060. m_Print.DrawImage(pImg, StrRect);
  5061. delete pImg;
  5062. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5063. {
  5064. Image *pImg=NULL;
  5065. g_nSendCode=31;
  5066. int g_nYearposTemp=g_nYearpos;
  5067. g_nYearpos=-1;
  5068. g_pMainWnd->ProcessChatMessageRequest2(1);
  5069. g_nYearpos=g_nYearposTemp;
  5070. g_nSendCode=0;
  5071. if(g_bSendOK==0)return;
  5072. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  5073. if(pImg)
  5074. {
  5075. StrRect.left=30;
  5076. StrRect.top=12;
  5077. StrRect.right=StrRect.left+60;
  5078. StrRect.bottom=StrRect.top+60;
  5079. m_Print.DrawImage(pImg, StrRect);
  5080. delete pImg;pImg=NULL;
  5081. }
  5082. }
  5083. m_Print.SetFontFace(11, 1, "宋体");
  5084. StrRect=load.m_rcarray .ElementAt (20);
  5085. StrRect.right=load.m_rcarray .ElementAt (23).right;
  5086. StrRect.top -=18;StrRect.bottom -=18;
  5087. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  5088. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5089. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  5090. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5091. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5092. StrRect.top -=15;StrRect.bottom -=15;
  5093. #ifdef MNLS_VERSION
  5094. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5095. #endif
  5096. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5097. StrRect.top -=15;StrRect.bottom -=15;
  5098. #ifdef MNLS_VERSION
  5099. m_Print.DrawRect(StrRect);
  5100. #endif
  5101. m_Print.SetFontFace(7, 1, "黑体");
  5102. m_Print.SetColor(0xffffff);
  5103. #ifdef MNLS_VERSION
  5104. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5105. #endif
  5106. m_Print.SetColor(0);
  5107. m_Print.SetFontFace(15, 1, "宋体");
  5108. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5109. StrRect.top -=15;StrRect.bottom -=15;
  5110. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5111. CStringArray strarray;
  5112. strarray.Add("NO: "+strOrderNumber);
  5113. CString date;
  5114. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  5115. strarray.Add(date);
  5116. strarray.Add("喜爱");
  5117. strarray.Add("格调");
  5118. if(fgarray.GetSize ()==12)
  5119. {
  5120. for(int i=0; i<12; i++)
  5121. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  5122. }
  5123. else
  5124. {
  5125. strarray.Add("复古典雅");
  5126. strarray.Add("温文尔雅");
  5127. strarray.Add("豪华艳丽");
  5128. strarray.Add("传统大方");
  5129. strarray.Add("新潮个性");
  5130. strarray.Add("浪漫奔放");
  5131. strarray.Add("简单素雅");
  5132. strarray.Add("活泼俏丽");
  5133. strarray.Add("妩媚温馨");
  5134. strarray.Add("温柔贤惠");
  5135. strarray.Add("成熟感性");
  5136. strarray.Add("清纯可爱");
  5137. }
  5138. strarray.Add("姓名");
  5139. // strarray.Add("职业");
  5140. strarray.Add("");
  5141. strarray.Add("地址");
  5142. strarray.Add("电话");
  5143. #ifdef CHILD_VERSION
  5144. strarray.Add("家长");
  5145. strarray.Add("宝宝");
  5146. #else
  5147. strarray.Add("先生");
  5148. strarray.Add("女士");
  5149. #endif
  5150. m_Print.SetFontFace(11, 1, "宋体");
  5151. for( i=0; i<strarray.GetSize (); i++)
  5152. {
  5153. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5154. if(i<2)
  5155. {
  5156. StrRect.top -=15;StrRect.bottom -=15;
  5157. }
  5158. if(i>15)
  5159. m_Print.DrawRect2(StrRect, 1);
  5160. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5161. }
  5162. for( i=29; i<=40; i++)
  5163. {
  5164. if(m_style.GetLength ()<=(i-29))continue;
  5165. if(m_style.GetAt (i-29)!='1')continue;
  5166. StrRect=load.m_rcarray .ElementAt (i-1);
  5167. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5168. }
  5169. for( i=27; i<=48; i++)
  5170. {
  5171. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5172. m_Print.DrawRect2(StrRect, 1);
  5173. }
  5174. #ifdef CHILD_VERSION
  5175. StrRect=load.m_rcarray .ElementAt (45);
  5176. StrRect.right =StrRect.left +62;
  5177. m_Print.DrawRect2(StrRect, 1);
  5178. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5179. StrRect.left =StrRect.right ;
  5180. StrRect.right =StrRect.left +62;
  5181. m_Print.DrawRect2(StrRect, 1);
  5182. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5183. StrRect.left =StrRect.right ;
  5184. StrRect.right =StrRect.left +62;
  5185. m_Print.DrawRect2(StrRect, 1);
  5186. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5187. StrRect.left =StrRect.right ;
  5188. StrRect.right =StrRect.left +62;
  5189. m_Print.DrawRect2(StrRect, 1);
  5190. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5191. #endif
  5192. /////////////////////////
  5193. strarray.RemoveAll ();
  5194. CString temp;
  5195. temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  5196. strarray.Add (temp);
  5197. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  5198. strarray.Add (temp);
  5199. strarray.Add ("化妆");
  5200. strarray.Add ("造型");
  5201. #ifdef CHILD_VERSION
  5202. strarray.Add ("");
  5203. #else
  5204. strarray.Add ("婚纱");
  5205. #endif
  5206. strarray.Add ("服饰");
  5207. strarray.Add ("配");
  5208. strarray.Add ("置");
  5209. strarray.Add ("其");
  5210. strarray.Add ("它");
  5211. strarray.Add ("套系名称");
  5212. strarray.Add ("镜款");
  5213. strarray.Add ("套系总价");
  5214. strarray.Add ("主摄影师");
  5215. strarray.Add ("拍摄日期");
  5216. strarray.Add ("预约金");
  5217. #ifdef CHILD_VERSION
  5218. strarray.Add ("主引导师");
  5219. #else
  5220. strarray.Add ("主化妆师");
  5221. #endif
  5222. strarray.Add ("看样日期");
  5223. strarray.Add ("欠款余额");
  5224. strarray.Add ("总监");
  5225. strarray.Add ("取件日期");
  5226. rcpos=-1;
  5227. for( i=0; i<strarray.GetSize (); i++)
  5228. {
  5229. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  5230. if(i>9)
  5231. m_Print.DrawRect2(StrRect, 1);
  5232. #ifdef CHILD_VERSION
  5233. if(i==5)
  5234. StrRect.top -=StrRect.Height ();
  5235. #endif
  5236. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5237. }
  5238. for( i=22; i<=41; i++)
  5239. {
  5240. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  5241. m_Print.DrawRect2(StrRect, 1);
  5242. }
  5243. /////////////////////////////
  5244. strarray.RemoveAll ();
  5245. #ifdef CHILD_VERSION
  5246. strarray.Add ("顾客方 家长:");
  5247. strarray.Add ("宝宝:");
  5248. #else
  5249. strarray.Add ("顾客方 先生:");
  5250. strarray.Add ("女士:");
  5251. #endif
  5252. strarray.Add ("电话:");
  5253. strarray.Add ("影楼方 店长:");
  5254. strarray.Add ("接单人:");
  5255. strarray.Add ("电话:");
  5256. rcpos=-1;
  5257. for( i=0; i<strarray.GetSize (); i++)
  5258. {
  5259. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  5260. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5261. }
  5262. for( i=7; i<=12; i++)
  5263. {
  5264. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  5265. // if(i!=10)
  5266. m_Print.DrawRect2(StrRect, 2);
  5267. }
  5268. //////////////////////////////////////
  5269. //开始打数据
  5270. strarray.RemoveAll ();
  5271. strarray.Add (m_name1);
  5272. strarray.Add (m_name2);
  5273. /// strarray.Add (m_occupation1);
  5274. // strarray.Add (m_occupation2);
  5275. strarray.Add ("");
  5276. strarray.Add ("");
  5277. strarray.Add (m_addr1);
  5278. #ifdef CHILD_VERSION
  5279. strarray.Add ("");
  5280. #else
  5281. strarray.Add (m_addr2);
  5282. #endif
  5283. strarray.Add (m_phone1);
  5284. strarray.Add (m_phone2);
  5285. for( i=41; i<=48; i++)
  5286. {
  5287. StrRect=load.m_rcarray .ElementAt (i-1);
  5288. StrRect.left +=4;
  5289. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5290. }
  5291. ///////////////////////////////
  5292. strarray.RemoveAll ();
  5293. strarray.Add (m_money1);
  5294. strarray.Add (m_waiter1);
  5295. strarray.Add (m_time2);
  5296. strarray.Add (m_money2);
  5297. strarray.Add (m_waiter2);
  5298. strarray.Add (m_time4);
  5299. strarray.Add (m_money3);
  5300. strarray.Add ("");
  5301. strarray.Add (m_time5);
  5302. for( i=32; i<=40; i++)
  5303. {
  5304. StrRect=load2.m_rcarray .ElementAt (i-1);
  5305. StrRect.left +=4;
  5306. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5307. }
  5308. ///////////////////////////////
  5309. strarray.RemoveAll ();
  5310. strarray.Add (m_name1);
  5311. strarray.Add (m_name2);
  5312. CString phone;
  5313. if(m_phone1.IsEmpty ()==0)
  5314. phone=m_phone1+",";
  5315. phone+=m_phone2;
  5316. phone.TrimRight (",");
  5317. strarray.Add (phone);
  5318. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  5319. strarray.Add (m_ren);
  5320. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  5321. for( i=7; i<=12; i++)
  5322. {
  5323. StrRect=load3.m_rcarray .ElementAt (i-1);
  5324. StrRect.left +=4;
  5325. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5326. }
  5327. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  5328. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5329. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  5330. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5331. StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  5332. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5333. //////////////////////////////
  5334. //开始画文字
  5335. StrRect=load2.m_rcarray .ElementAt (30);
  5336. StrRect.left +=3;
  5337. StrRect.top +=3;
  5338. StrRect.right -=2;
  5339. StrRect.bottom -=2;
  5340. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5341. StrRect=load2.m_rcarray .ElementAt (29);
  5342. StrRect.left +=3;
  5343. StrRect.top +=3;
  5344. StrRect.right -=2;
  5345. StrRect.bottom -=2;
  5346. str="";
  5347. for(i=0; i<sparray.GetSize (); i++)
  5348. {
  5349. str+=sparray.ElementAt (i).ElementAt (5);
  5350. str+=" 数量:";
  5351. str+=sparray.ElementAt (i).ElementAt (3);
  5352. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  5353. str+="\r\n";
  5354. }
  5355. str.TrimRight ("\r\n");
  5356. AutoDraw(m_Print, StrRect, str, 1.4);
  5357. StrRect=load2.m_rcarray .ElementAt (40);
  5358. StrRect.top +=8;
  5359. m_Print.SetFontFace(12, 1, "黑体");
  5360. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5361. StrRect.left +=3;
  5362. StrRect.top +=30;
  5363. StrRect.right -=2;
  5364. StrRect.bottom -=2;
  5365. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  5366. if(str.IsEmpty ())
  5367. {
  5368. str="\
  5369. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5370. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5371. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5372. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5373. 持良好的心境.\r\n\
  5374. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5375. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5376. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5377. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5378. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5379. 勿进影室, 以免影响拍摄.\r\n\
  5380. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5381. 师或店长沟通.\r\n\
  5382. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5383. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5384. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5385. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5386. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5387. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5388. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5389. 还.";
  5390. }
  5391. AutoDraw(m_Print, StrRect, str, 1.8);
  5392. }
  5393. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==1)
  5394. {//AfxMessageBox("yyy");
  5395. m_Print.StartPrint();
  5396. m_Print.StartPage();
  5397. LoadRect load;
  5398. load.SetLiaPath ("6-2.lia");
  5399. load.SetMargins(0,0);
  5400. if(!load.Load ())return;
  5401. int i;
  5402. //////////////////////////////////////////////////////////////
  5403. CStringArray txarray;
  5404. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"';;";
  5405. g_sendhead.code[0]=11;
  5406. g_sendhead.code[1]=52;
  5407. g_sendhead.code[2]=50;
  5408. g_sendhead.code[3]=150;
  5409. g_sendhead.code[4]=77;
  5410. g_sendhead.code[5]=4;
  5411. g_sendhead.tabcount=6;
  5412. g_sendhead.bsql=0;
  5413. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  5414. CArray<CStringArray, CStringArray>sparray;
  5415. CArray<CStringArray, CStringArray>clientarray;
  5416. CArray<CStringArray, CStringArray>phonearray;
  5417. CArray<CStringArray, CStringArray>fgarray;
  5418. CArray<CStringArray, CStringArray>danweiarray;
  5419. CArray<CStringArray, CStringArray>jdarray;
  5420. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5421. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  5422. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  5423. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  5424. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  5425. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  5426. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  5427. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  5428. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  5429. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  5430. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  5431. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  5432. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  5433. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  5434. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  5435. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  5436. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  5437. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  5438. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  5439. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  5440. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  5441. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  5442. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  5443. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  5444. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  5445. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  5446. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  5447. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  5448. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  5449. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  5450. if(jdarray.GetSize ())
  5451. {
  5452. if(m_bz.IsEmpty ()==0)
  5453. m_bz="\r\n"+m_bz;
  5454. m_bz+="景点:";
  5455. }
  5456. for( i=0; i<jdarray.GetSize (); i++)
  5457. {
  5458. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5459. }
  5460. m_bz.TrimRight (";");
  5461. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5462. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5463. if(IsHasRights2new(31)==0)
  5464. {
  5465. m_phone1="***";
  5466. m_phone2="***";
  5467. }
  5468. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5469. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5470. CString m_birthday1 = clientarray.ElementAt (0).ElementAt (11);
  5471. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  5472. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  5473. CString str;
  5474. filter="name='"+m_ren+"'";
  5475. g_sendhead.code[0]=5;
  5476. g_sendhead.tabcount=1;
  5477. g_sendhead.bsql=0;
  5478. int g_nYearposTemp=g_nYearpos;
  5479. g_nYearpos=-1;
  5480. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5481. g_nYearpos=g_nYearposTemp;
  5482. if(g_bSendOK==0)return;
  5483. DataToArray(&phonearray);
  5484. m_money1.Format ("%f", atof(m_taoxijiage));
  5485. m_money2.Format ("%f", atof(m_payed1));
  5486. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5487. ConvertToPrice(m_money1);
  5488. ConvertToPrice(m_money2);
  5489. ConvertToPrice(m_money3);
  5490. ////////////////////////////////////////////////////////////////
  5491. int rcpos=-1;
  5492. CRect StrRect=load.m_rcarray.ElementAt (0);
  5493. m_Print.SetFontFace(25, 1, "黑体");
  5494. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"预约单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5495. m_Print.SetFontFace(11, 1, "宋体");
  5496. StrRect=load.m_rcarray .ElementAt (1);
  5497. if(m_time1.GetLength ()==10)
  5498. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2));
  5499. else
  5500. str="开单日期:";
  5501. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5502. StrRect=load.m_rcarray .ElementAt (2);
  5503. m_Print.DrawText((LPTSTR)(LPCTSTR)("No."+strOrderNumber), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5504. CStringArray strarray;
  5505. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5506. {
  5507. Image *pImg=NULL;
  5508. g_nSendCode=31;
  5509. int g_nYearposTemp=g_nYearpos;
  5510. g_nYearpos=-1;
  5511. g_pMainWnd->ProcessChatMessageRequest2(1);
  5512. g_nYearpos=g_nYearposTemp;
  5513. g_nSendCode=0;
  5514. if(g_bSendOK==0)return;
  5515. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  5516. if(pImg)
  5517. {
  5518. StrRect.left=47;
  5519. StrRect.top=12;
  5520. StrRect.right=StrRect.left+60;
  5521. StrRect.bottom=StrRect.top+60;
  5522. m_Print.DrawImage(pImg, StrRect);
  5523. delete pImg;pImg=NULL;
  5524. }
  5525. }
  5526. #ifdef CHILD_VERSION
  5527. strarray.Add("家长姓名");
  5528. strarray.Add("宝宝姓名");
  5529. #else
  5530. strarray.Add("先生姓名");
  5531. strarray.Add("女士姓名");
  5532. #endif
  5533. strarray.Add ("服装套数");
  5534. // strarray.Add ("拍摄张数");
  5535. #ifdef CHILD_VERSION
  5536. strarray.Add("出生日期");
  5537. #else
  5538. strarray.Add("结婚日期");
  5539. #endif
  5540. strarray.Add ("拍摄日期");
  5541. strarray.Add ("联系电话");
  5542. strarray.Add ("联系电话");
  5543. strarray.Add ("造型套数");
  5544. if(m_zs.Find ("\\")!=-1)
  5545. strarray.Add ("入底\\入册");
  5546. else
  5547. strarray.Add ("入底张数");
  5548. strarray.Add ("选片日期");
  5549. strarray.Add ("QQ/邮箱");
  5550. strarray.Add ("套系总额");
  5551. strarray.Add ("预约金");
  5552. strarray.Add ("余款金额");
  5553. strarray.Add ("取件日期");
  5554. strarray.Add (m_name1);
  5555. strarray.Add (m_name2);
  5556. strarray.Add (m_clothescount);
  5557. // str.Format("%d", atoi(m_zs)*3);
  5558. // strarray.Add (str);
  5559. #ifdef CHILD_VERSION
  5560. strarray.Add(m_birthday1);
  5561. #else
  5562. strarray.Add(m_time3);
  5563. #endif
  5564. strarray.Add (m_time2);
  5565. strarray.Add (m_phone1);
  5566. strarray.Add (m_phone2);
  5567. strarray.Add (m_clothescount2);
  5568. strarray.Add (m_zs);
  5569. strarray.Add (m_time4);
  5570. strarray.Add (m_qq1);
  5571. strarray.Add (m_money1);
  5572. strarray.Add (m_money2);
  5573. strarray.Add (m_money3);
  5574. strarray.Add (m_time5);
  5575. for( i=4; i<=33; i++)
  5576. {
  5577. StrRect=load.m_rcarray .ElementAt (i-1);
  5578. m_Print.DrawRect2(StrRect, 1);
  5579. if(strarray.GetSize ()>(i-4))
  5580. {
  5581. if(i<=18)
  5582. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5583. else
  5584. {
  5585. StrRect.left +=4;
  5586. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5587. }
  5588. }
  5589. }
  5590. int dt=413;
  5591. StrRect=load.m_rcarray .ElementAt (36);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5592. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5593. StrRect=load.m_rcarray .ElementAt (37);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5594. StrRect=load.m_rcarray .ElementAt (38);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5595. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5596. StrRect=load.m_rcarray .ElementAt (39);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5597. StrRect=load.m_rcarray .ElementAt (40);StrRect.top +=dt;StrRect.bottom +=dt;
  5598. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5599. StrRect=load.m_rcarray .ElementAt (41);StrRect.top +=dt;StrRect.bottom +=dt;
  5600. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5601. StrRect=load.m_rcarray .ElementAt (42);StrRect.top +=dt;StrRect.bottom +=dt;
  5602. m_Print.DrawText((LPTSTR)(LPCTSTR)("网址:"+g_cominfoarray.ElementAt (0).ElementAt (13)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5603. //////////////////////////////
  5604. //开始画文字
  5605. StrRect=load.m_rcarray .ElementAt (7);
  5606. int hei=StrRect.Height ();
  5607. StrRect.top+=hei ;
  5608. StrRect.bottom+=hei ;
  5609. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5610. StrRect.top+=dt ;
  5611. StrRect.bottom+=dt ;
  5612. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5613. StrRect=load.m_rcarray .ElementAt (17);
  5614. StrRect.top+=hei ;
  5615. StrRect.bottom+=hei ;
  5616. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5617. StrRect=load.m_rcarray .ElementAt (33);
  5618. StrRect.bottom =StrRect.top +dt ; m_Print.DrawRect2(StrRect, 1);
  5619. StrRect.top+=hei;
  5620. StrRect.left +=3;
  5621. StrRect.top +=3;
  5622. StrRect.right -=2;
  5623. StrRect.bottom -=2;
  5624. str="";
  5625. for(i=0; i<sparray.GetSize (); i++)
  5626. {
  5627. str+=sparray.ElementAt (i).ElementAt (5);
  5628. str+=" 数量:";
  5629. str+=sparray.ElementAt (i).ElementAt (3);
  5630. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  5631. str+="\r\n";
  5632. }
  5633. str.TrimRight ("\r\n");
  5634. AutoDraw(m_Print, StrRect, str, 1.4);
  5635. StrRect=load.m_rcarray .ElementAt (33);
  5636. StrRect.top +=dt ;
  5637. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  5638. StrRect.top+=hei;
  5639. StrRect.left +=3;
  5640. StrRect.top +=3;
  5641. StrRect.right -=2;
  5642. StrRect.bottom -=2;
  5643. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5644. StrRect=load.m_rcarray .ElementAt (34);
  5645. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  5646. StrRect.top+=hei;
  5647. StrRect.left +=3;
  5648. StrRect.top +=3;
  5649. StrRect.right -=2;
  5650. StrRect.bottom -=2;
  5651. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  5652. if(str.IsEmpty ())
  5653. {
  5654. str="\
  5655. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5656. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5657. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5658. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5659. 持良好的心境.\r\n\
  5660. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5661. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5662. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5663. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5664. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5665. 勿进影室, 以免影响拍摄.\r\n\
  5666. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5667. 师或店长沟通.\r\n\
  5668. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5669. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5670. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5671. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5672. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5673. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5674. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5675. 还.";
  5676. }
  5677. AutoDraw(m_Print, StrRect, str, 1.8);
  5678. StrRect=load.m_rcarray .ElementAt (35);
  5679. StrRect.bottom +=100;
  5680. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  5681. 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∨";
  5682. // AutoDraw(m_Print, StrRect, str, 1.4);
  5683. }
  5684. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==2)
  5685. {
  5686. PrintDinDan5(strOrderNumber);
  5687. return;
  5688. }
  5689. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==3)
  5690. {
  5691. PrintDinDan6(strOrderNumber);
  5692. return;
  5693. }
  5694. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  5695. dlg.m_pDC =m_Print.GetPDC() ;
  5696. dlg.m_mode=1;
  5697. if(aa==0)
  5698. {
  5699. if(dlg.DoModal ()!=IDOK)
  5700. return;
  5701. printcot=dlg.m_num;
  5702. }
  5703. //结束打印
  5704. m_Print.EndPage();
  5705. m_Print.EndPrint();
  5706. }
  5707. }
  5708. void CovertDate2(CString date, CString &date2)
  5709. {
  5710. try
  5711. {
  5712. if(date=="2013-04-09")
  5713. {
  5714. date2="2013-02-29";
  5715. return;
  5716. }
  5717. ///////////////////////////////////
  5718. date2=date;
  5719. GongToLong(date2);
  5720. ////////////////////////////////////
  5721. return;
  5722. CCalendarConvert m_CalendarConvert;
  5723. SYSTEMTIME src = {0};
  5724. SYSTEMTIME dst = {0};
  5725. COleDateTime m_timeLunar(atoi(date.Mid (0,4)),atoi(date.Mid (5,2)),atoi(date.Mid (8,2)),0,0,0);
  5726. COleDateTime m_timeGregorian;
  5727. m_timeLunar.GetAsSystemTime ( src );
  5728. BOOL bEmbolism = 0;
  5729. if ( m_CalendarConvert.Gregorian2Lunar ( &src, &dst , &bEmbolism) )
  5730. {
  5731. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
  5732. date2.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
  5733. if(m_timeGregorian.GetYear ()==-1)date2="2000-13-32";
  5734. }
  5735. else
  5736. {
  5737. date2.Empty ();
  5738. }
  5739. }
  5740. catch(...)
  5741. {
  5742. }
  5743. }
  5744. void CMainFrame::PrintDinDan5(CString m_id)
  5745. {
  5746. int printcot=1;
  5747. for(int aa=0; aa<printcot; aa++)
  5748. {
  5749. PrintPreview dlg;
  5750. CPrintRX m_Print;
  5751. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  5752. {
  5753. m_Print.InitToPrint(NULL, 1);
  5754. }
  5755. else
  5756. {
  5757. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  5758. if(name.IsEmpty ())
  5759. m_Print.InitToPrint(NULL, 1);
  5760. else
  5761. {
  5762. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  5763. if(nret==-1 && aa==0)
  5764. {
  5765. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  5766. }
  5767. }
  5768. }
  5769. {
  5770. m_Print.StartPrint();
  5771. m_Print.StartPage();
  5772. LoadRect load;
  5773. load.SetLiaPath ("19.lia");
  5774. load.SetMargins(0,-20);
  5775. if(!load.Load ())return;
  5776. int i;
  5777. //////////////////////////////////////////////////////////////
  5778. CStringArray txarray;
  5779. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  5780. g_sendhead.code[0]=11;
  5781. g_sendhead.code[1]=52;
  5782. g_sendhead.code[2]=50;
  5783. g_sendhead.code[3]=150;
  5784. g_sendhead.code[4]=77;
  5785. g_sendhead.code[5]=4;
  5786. g_sendhead.tabcount=6;
  5787. g_sendhead.bsql=0;
  5788. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  5789. CArray<CStringArray, CStringArray>sparray;
  5790. CArray<CStringArray, CStringArray>clientarray;
  5791. CArray<CStringArray, CStringArray>phonearray;
  5792. CArray<CStringArray, CStringArray>fgarray;
  5793. CArray<CStringArray, CStringArray>danweiarray;
  5794. CArray<CStringArray, CStringArray>jdarray;
  5795. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5796. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  5797. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  5798. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  5799. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  5800. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  5801. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  5802. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  5803. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  5804. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  5805. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  5806. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  5807. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  5808. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  5809. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  5810. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  5811. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  5812. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  5813. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  5814. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  5815. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  5816. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  5817. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  5818. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  5819. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  5820. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  5821. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  5822. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  5823. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (36);
  5824. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  5825. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  5826. CString m_txtype = g_List1array.ElementAt (0).ElementAt (52);
  5827. CString m_memberno = g_List1array.ElementAt (0).ElementAt (47);
  5828. CString str;
  5829. if(jdarray.GetSize ())
  5830. {
  5831. if(m_bz.IsEmpty ()==0)
  5832. m_bz="\r\n"+m_bz;
  5833. m_bz+="景点:";
  5834. }
  5835. for( i=0; i<jdarray.GetSize (); i++)
  5836. {
  5837. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5838. }
  5839. m_bz.TrimRight (";");
  5840. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5841. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5842. if(IsHasRights2new(31)==0)
  5843. {
  5844. m_phone1="***";
  5845. m_phone2="***";
  5846. }
  5847. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5848. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5849. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  5850. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  5851. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  5852. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  5853. BOOL check1=atoi(clientarray.ElementAt (0).ElementAt (15));
  5854. filter="name='"+m_ren+"'";
  5855. g_sendhead.code[0]=5;
  5856. g_sendhead.tabcount=1;
  5857. g_sendhead.bsql=0;
  5858. int g_nYearposTemp=g_nYearpos;
  5859. g_nYearpos=-1;
  5860. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5861. g_nYearpos=g_nYearposTemp;
  5862. if(g_bSendOK==0)return;
  5863. DataToArray(&phonearray);
  5864. m_money1.Format ("%f", atof(m_taoxijiage));
  5865. m_money2.Format ("%f", atof(m_payed1));
  5866. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5867. ConvertToPrice(m_money1);
  5868. ConvertToPrice(m_money2);
  5869. ConvertToPrice(m_money3);
  5870. ////////////////////////////////////////////////////////////////
  5871. int rcpos=-1;
  5872. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  5873. //Image *pImg=NULL;
  5874. // ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  5875. // m_Print.DrawImage(pImg, StrRect);
  5876. // delete pImg;
  5877. m_Print.SetFontFace(20, 1, "宋体");
  5878. StrRect=load.m_rcarray .ElementAt (1);
  5879. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"定单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5880. m_Print.SetFontFace(12, 1, "宋体");
  5881. StrRect=load.m_rcarray .ElementAt (2);
  5882. m_Print.DrawText((LPTSTR)(LPCTSTR)("NO."+m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5883. StrRect=load.m_rcarray .ElementAt (3);
  5884. str.Format ("%s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2) );
  5885. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5886. StrRect=load.m_rcarray .ElementAt (4);
  5887. m_Print.DrawText((LPTSTR)(LPCTSTR)("联系人:"+m_name1), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5888. CStringArray strarray;
  5889. strarray.Add("姓名");
  5890. strarray.Add("性别");
  5891. strarray.Add("年龄");
  5892. strarray.Add("出生年月");
  5893. strarray.Add("套系价格");
  5894. strarray.Add("预约金");
  5895. strarray.Add("欠款");
  5896. strarray.Add("拍摄类型");
  5897. strarray.Add("会员卡号");
  5898. strarray.Add("定单人");
  5899. strarray.Add("入底\\入册");
  5900. strarray.Add("联系电话");
  5901. for( i=6; i<=17; i++)
  5902. {
  5903. StrRect=load.m_rcarray .ElementAt (i-1);
  5904. m_Print.DrawRect2(StrRect, 1);
  5905. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-6), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5906. }
  5907. strarray.RemoveAll ();
  5908. strarray.Add(m_name2);
  5909. strarray.Add(m_sex);
  5910. if(m_birthday.GetLength ()!=10)
  5911. strarray.Add("");
  5912. else
  5913. {
  5914. int year=0;
  5915. if(check1)
  5916. {
  5917. CString date2;
  5918. CovertDate2(g_date, date2);
  5919. year=atoi(date2.Left (4))-atoi(m_birthday.Left (4));
  5920. if(date2.Right(5)>=m_birthday.Right(5))
  5921. year++;
  5922. }
  5923. else
  5924. {
  5925. year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  5926. if(g_date.Right(5)>=m_birthday.Right(5))
  5927. year++;
  5928. }
  5929. str.Format ("%d", year);
  5930. strarray.Add(str);
  5931. }
  5932. strarray.Add(m_birthday);
  5933. strarray.Add(m_money1);
  5934. strarray.Add(m_money2);
  5935. strarray.Add(m_money3);
  5936. strarray.Add(m_txtype);
  5937. strarray.Add(m_memberno);
  5938. strarray.Add(m_ren);
  5939. strarray.Add(m_zs);
  5940. if(!m_phone1.IsEmpty ())
  5941. strarray.Add(m_phone1);
  5942. else
  5943. strarray.Add(m_phone2);
  5944. for( i=18; i<=29; i++)
  5945. {
  5946. StrRect=load.m_rcarray .ElementAt (i-1);
  5947. m_Print.DrawRect2(StrRect, 1);
  5948. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5949. }
  5950. strarray.RemoveAll ();
  5951. strarray.Add("摄影师");
  5952. strarray.Add("拍照时间");
  5953. strarray.Add("选片人");
  5954. strarray.Add("选片时间");
  5955. strarray.Add("引导师");
  5956. strarray.Add("设计师");
  5957. strarray.Add("取件时间");
  5958. strarray.Add("顾客签字");
  5959. for( i=34; i<=41; i++)
  5960. {
  5961. StrRect=load.m_rcarray .ElementAt (i-1);
  5962. m_Print.DrawRect2(StrRect, 1);
  5963. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-34), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5964. }
  5965. strarray.RemoveAll ();
  5966. strarray.Add(m_waiter1);
  5967. strarray.Add(m_time2);
  5968. strarray.Add(m_waiter3);
  5969. strarray.Add(m_time4);
  5970. strarray.Add(m_waiter2);
  5971. strarray.Add(m_waiter4);
  5972. strarray.Add(m_time5);
  5973. strarray.Add("");
  5974. for( i=42; i<=49; i++)
  5975. {
  5976. StrRect=load.m_rcarray .ElementAt (i-1);
  5977. m_Print.DrawRect2(StrRect, 1);
  5978. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5979. }
  5980. m_Print.SetFontFace(15, 1, "宋体");
  5981. StrRect=load.m_rcarray .ElementAt (29);
  5982. m_Print.DrawRect2(StrRect, 1);
  5983. StrRect.top +=45;
  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);StrRect.top +=20;
  5986. m_Print.DrawText((LPTSTR)(LPCTSTR)"内", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5987. m_Print.DrawText((LPTSTR)(LPCTSTR)"容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5988. StrRect=load.m_rcarray .ElementAt (30);
  5989. m_Print.DrawRect2(StrRect, 1);
  5990. StrRect.top +=45;
  5991. m_Print.DrawText((LPTSTR)(LPCTSTR)"友", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5992. m_Print.DrawText((LPTSTR)(LPCTSTR)"情", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5993. m_Print.DrawText((LPTSTR)(LPCTSTR)"提", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5994. m_Print.DrawText((LPTSTR)(LPCTSTR)"示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5995. m_Print.SetFontFace(10, 1, "宋体");
  5996. StrRect=load.m_rcarray .ElementAt (37);StrRect.top =StrRect.bottom +2;
  5997. str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  5998. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  5999. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  6000. StrRect=load.m_rcarray .ElementAt (48);StrRect.top =StrRect.bottom +2;StrRect.left -=200;
  6001. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  6002. //开始画文字
  6003. StrRect=load.m_rcarray .ElementAt (31);
  6004. StrRect.left +=3;
  6005. StrRect.top +=3;
  6006. StrRect.right -=2;
  6007. StrRect.bottom -=2;
  6008. str="";
  6009. for(i=0; i<sparray.GetSize (); i++)
  6010. {
  6011. str+=sparray.ElementAt (i).ElementAt (5);
  6012. str+=" 数量:";
  6013. str+=sparray.ElementAt (i).ElementAt (3);
  6014. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  6015. str+="\r\n";
  6016. }
  6017. str.TrimRight ("\r\n");
  6018. m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6019. m_bz.TrimLeft();
  6020. if(m_bz!="")
  6021. { str+="\r\n";str+="\r\n";
  6022. str+="备注:"+m_bz;
  6023. }
  6024. AutoDraw(m_Print, StrRect, str, 1.4);
  6025. StrRect=load.m_rcarray .ElementAt (32); m_Print.DrawRect2(StrRect, 1);
  6026. StrRect.left +=3;
  6027. StrRect.top +=3;
  6028. StrRect.right -=2;
  6029. StrRect.bottom -=2;
  6030. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6031. if(str.IsEmpty ())
  6032. {
  6033. str="\
  6034. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6035. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6036. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6037. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6038. 持良好的心境.\r\n\
  6039. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6040. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6041. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6042. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6043. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6044. 勿进影室, 以免影响拍摄.\r\n\
  6045. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6046. 师或店长沟通.\r\n\
  6047. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6048. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6049. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6050. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6051. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6052. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6053. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6054. 还.";
  6055. }
  6056. AutoDraw(m_Print, StrRect, str, 1.8);
  6057. }
  6058. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6059. dlg.m_pDC =m_Print.GetPDC() ;
  6060. dlg.m_mode=1;
  6061. if(aa==0)
  6062. {
  6063. if(dlg.DoModal ()!=IDOK)
  6064. return;
  6065. printcot=dlg.m_num;
  6066. }
  6067. //结束打印
  6068. m_Print.EndPage();
  6069. m_Print.EndPrint();
  6070. }
  6071. }
  6072. void CMainFrame::PrintDinDan4(CString m_id)
  6073. {
  6074. // TODO: Add your control notification handler code here
  6075. CPrintRX m_Print;
  6076. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6077. {
  6078. m_Print.InitToPrint(NULL, 1);
  6079. }
  6080. else
  6081. {
  6082. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  6083. if(name.IsEmpty ())
  6084. m_Print.InitToPrint(NULL, 1);
  6085. else
  6086. {
  6087. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6088. if(nret==-1)
  6089. {
  6090. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6091. }
  6092. }
  6093. }
  6094. m_Print.StartPrint();
  6095. m_Print.StartPage();
  6096. LoadRect load;
  6097. load.SetLiaPath ("6-2.lia");
  6098. load.SetMargins(0,0);
  6099. if(!load.Load ())return;
  6100. int i;
  6101. //////////////////////////////////////////////////////////////
  6102. CStringArray txarray;
  6103. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  6104. g_sendhead.code[0]=11;
  6105. g_sendhead.code[1]=52;
  6106. g_sendhead.code[2]=50;
  6107. g_sendhead.code[3]=150;
  6108. g_sendhead.code[4]=77;
  6109. g_sendhead.code[5]=4;
  6110. g_sendhead.tabcount=6;
  6111. g_sendhead.bsql=0;
  6112. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  6113. CArray<CStringArray, CStringArray>sparray;
  6114. CArray<CStringArray, CStringArray>clientarray;
  6115. CArray<CStringArray, CStringArray>phonearray;
  6116. CArray<CStringArray, CStringArray>fgarray;
  6117. CArray<CStringArray, CStringArray>danweiarray;
  6118. CArray<CStringArray, CStringArray>jdarray;
  6119. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  6120. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  6121. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  6122. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  6123. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  6124. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  6125. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  6126. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  6127. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  6128. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  6129. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  6130. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  6131. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  6132. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  6133. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  6134. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  6135. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  6136. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  6137. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  6138. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  6139. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  6140. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  6141. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  6142. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  6143. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  6144. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  6145. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  6146. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  6147. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  6148. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6149. if(jdarray.GetSize ())
  6150. {
  6151. if(m_bz.IsEmpty ()==0)
  6152. m_bz="\r\n"+m_bz;
  6153. m_bz+="景点:";
  6154. }
  6155. for( i=0; i<jdarray.GetSize (); i++)
  6156. {
  6157. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  6158. }
  6159. m_bz.TrimRight (";");
  6160. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  6161. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  6162. if(IsHasRights2new(31)==0)
  6163. {
  6164. m_phone1="***";
  6165. m_phone2="***";
  6166. }
  6167. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  6168. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  6169. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  6170. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  6171. CString str;
  6172. filter="name='"+m_ren+"'";
  6173. g_sendhead.code[0]=5;
  6174. g_sendhead.tabcount=1;
  6175. g_sendhead.bsql=0;
  6176. int g_nYearposTemp=g_nYearpos;
  6177. g_nYearpos=-1;
  6178. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6179. g_nYearpos=g_nYearposTemp;
  6180. if(g_bSendOK==0)return;
  6181. DataToArray(&phonearray);
  6182. m_money1.Format ("%f", atof(m_taoxijiage));
  6183. m_money2.Format ("%f", atof(m_payed1));
  6184. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  6185. ConvertToPrice(m_money1);
  6186. ConvertToPrice(m_money2);
  6187. ConvertToPrice(m_money3);
  6188. ////////////////////////////////////////////////////////////////
  6189. int rcpos=-1;
  6190. CRect StrRect=load.m_rcarray.ElementAt (0);
  6191. m_Print.SetFontFace(25, 1, "黑体");
  6192. m_Print.DrawText((LPTSTR)(LPCTSTR)"巴黎春天婚纱摄影预约单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6193. m_Print.SetFontFace(11, 1, "宋体");
  6194. StrRect=load.m_rcarray .ElementAt (1);
  6195. if(m_time1.GetLength ()==10)
  6196. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2));
  6197. else
  6198. str="开单日期:";
  6199. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6200. StrRect=load.m_rcarray .ElementAt (2);
  6201. m_Print.DrawText((LPTSTR)(LPCTSTR)("No."+m_id), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6202. CStringArray strarray;
  6203. strarray.Add ("先生姓名");
  6204. strarray.Add ("女士姓名");
  6205. strarray.Add ("服装套数");
  6206. strarray.Add ("拍摄张数");
  6207. strarray.Add ("拍摄日期");
  6208. strarray.Add ("联系电话");
  6209. strarray.Add ("联系电话");
  6210. strarray.Add ("造型套数");
  6211. strarray.Add ("入册张数");
  6212. strarray.Add ("选片日期");
  6213. strarray.Add ("QQ/邮箱");
  6214. strarray.Add ("套系总额");
  6215. strarray.Add ("预约金");
  6216. strarray.Add ("余款金额");
  6217. strarray.Add ("取件日期");
  6218. strarray.Add (m_name1);
  6219. strarray.Add (m_name2);
  6220. strarray.Add (m_clothescount);
  6221. str.Format("%d", atoi(m_zs)*3);
  6222. strarray.Add (str);
  6223. strarray.Add (m_time2);
  6224. strarray.Add (m_phone1);
  6225. strarray.Add (m_phone2);
  6226. strarray.Add (m_clothescount2);
  6227. strarray.Add (m_zs);
  6228. strarray.Add (m_time4);
  6229. strarray.Add (m_qq1);
  6230. strarray.Add (m_money1);
  6231. strarray.Add (m_money2);
  6232. strarray.Add (m_money3);
  6233. strarray.Add (m_time5);
  6234. for( i=4; i<=33; i++)
  6235. {
  6236. StrRect=load.m_rcarray .ElementAt (i-1);
  6237. m_Print.DrawRect2(StrRect, 1);
  6238. if(strarray.GetSize ()>(i-4))
  6239. {
  6240. if(i<=18)
  6241. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6242. else
  6243. {
  6244. StrRect.left +=4;
  6245. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6246. }
  6247. }
  6248. }
  6249. int dt=413;
  6250. StrRect=load.m_rcarray .ElementAt (36);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6251. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6252. StrRect=load.m_rcarray .ElementAt (37);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6253. StrRect=load.m_rcarray .ElementAt (38);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6254. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6255. StrRect=load.m_rcarray .ElementAt (39);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6256. StrRect=load.m_rcarray .ElementAt (40);StrRect.top +=dt;StrRect.bottom +=dt;
  6257. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址:深圳市红岭中路中深国际大厦首层,二十二层", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6258. StrRect=load.m_rcarray .ElementAt (41);StrRect.top +=dt;StrRect.bottom +=dt;
  6259. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:0755-61308198 61308199 25860696 25860697", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6260. StrRect=load.m_rcarray .ElementAt (42);StrRect.top +=dt;StrRect.bottom +=dt;
  6261. m_Print.DrawText((LPTSTR)(LPCTSTR)"网址:www.paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6262. StrRect=load.m_rcarray .ElementAt (43);StrRect.top +=dt;StrRect.bottom +=dt;
  6263. m_Print.DrawText((LPTSTR)(LPCTSTR)"邮箱:blct@paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6264. //////////////////////////////
  6265. //开始画文字
  6266. StrRect=load.m_rcarray .ElementAt (7);
  6267. int hei=StrRect.Height ();
  6268. StrRect.top+=hei ;
  6269. StrRect.bottom+=hei ;
  6270. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6271. StrRect.top+=dt ;
  6272. StrRect.bottom+=dt ;
  6273. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6274. StrRect=load.m_rcarray .ElementAt (17);
  6275. StrRect.top+=hei ;
  6276. StrRect.bottom+=hei ;
  6277. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6278. StrRect=load.m_rcarray .ElementAt (33);
  6279. StrRect.bottom =StrRect.top +dt ; m_Print.DrawRect2(StrRect, 1);
  6280. StrRect.top+=hei;
  6281. StrRect.left +=3;
  6282. StrRect.top +=3;
  6283. StrRect.right -=2;
  6284. StrRect.bottom -=2;
  6285. str="";
  6286. for(i=0; i<sparray.GetSize (); i++)
  6287. {
  6288. str+=sparray.ElementAt (i).ElementAt (5);
  6289. str+=" 数量:";
  6290. str+=sparray.ElementAt (i).ElementAt (3);
  6291. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  6292. str+="\r\n";
  6293. }
  6294. str.TrimRight ("\r\n");
  6295. AutoDraw(m_Print, StrRect, str, 1.4);
  6296. StrRect=load.m_rcarray .ElementAt (33);
  6297. StrRect.top +=dt ;
  6298. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  6299. StrRect.top+=hei;
  6300. StrRect.left +=3;
  6301. StrRect.top +=3;
  6302. StrRect.right -=2;
  6303. StrRect.bottom -=2;
  6304. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6305. StrRect=load.m_rcarray .ElementAt (34);
  6306. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  6307. StrRect.top+=hei;
  6308. StrRect.left +=3;
  6309. StrRect.top +=3;
  6310. StrRect.right -=2;
  6311. StrRect.bottom -=2;
  6312. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6313. if(str.IsEmpty ())
  6314. {
  6315. str="\
  6316. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6317. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6318. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6319. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6320. 持良好的心境.\r\n\
  6321. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6322. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6323. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6324. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6325. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6326. 勿进影室, 以免影响拍摄.\r\n\
  6327. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6328. 师或店长沟通.\r\n\
  6329. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6330. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6331. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6332. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6333. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6334. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6335. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6336. 还.";
  6337. }
  6338. AutoDraw(m_Print, StrRect, str, 1.8);
  6339. StrRect=load.m_rcarray .ElementAt (35);
  6340. StrRect.bottom +=100;
  6341. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  6342. 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∨";
  6343. AutoDraw(m_Print, StrRect, str, 1.4);
  6344. PrintPreview dlg;
  6345. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6346. dlg.m_pDC =m_Print.GetPDC() ;
  6347. if(dlg.DoModal ()!=IDOK)return;
  6348. //结束打印
  6349. m_Print.EndPage();
  6350. m_Print.EndPrint();
  6351. }
  6352. int CalHeight(CArray<CRect,CRect>*rcarray, CStringArray *strarray2, CPrintRX *Print, int FORMAT)
  6353. {
  6354. CSize size;
  6355. CString str,temp;
  6356. CRect rc;
  6357. int maxhei=1;
  6358. int fonthei;
  6359. for(int i=0; i < rcarray->GetSize (); i++)
  6360. {
  6361. rc=rcarray->ElementAt (i);
  6362. maxhei=max(maxhei, rc.bottom );
  6363. str=strarray2->ElementAt (i);
  6364. temp.Empty ();
  6365. int hei=0;
  6366. while(str.IsEmpty()==0)
  6367. {
  6368. str=str.Right (str.GetLength ()-temp.GetLength ());
  6369. if(str.IsEmpty ())break;
  6370. Print->GetStrSize((LPTSTR)(LPCTSTR)str, size);
  6371. fonthei=size.cy+1;
  6372. if(size.cx<=rc.Width())
  6373. {
  6374. CRect rc2=rc;
  6375. rc2.top +=hei*fonthei;
  6376. rc2.bottom =rc2.top+fonthei;
  6377. Print->DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT | FORMAT_UP);
  6378. //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6379. maxhei=max(maxhei, rc2.bottom );
  6380. break;
  6381. }
  6382. int right=0;
  6383. while(size.cx>rc.Width ())
  6384. {
  6385. right++;
  6386. temp=str.Left (str.GetLength ()-(right));
  6387. if(GIsHalfHZ(temp))
  6388. {
  6389. right++;
  6390. temp.Delete (temp.GetLength ()-1);
  6391. }
  6392. Print->GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  6393. }
  6394. CRect rc2=rc;
  6395. rc2.top +=hei*fonthei;
  6396. rc2.bottom =rc2.top+fonthei;
  6397. Print->DrawText((LPTSTR)(LPCTSTR)temp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6398. hei++;
  6399. maxhei=max(maxhei, rc2.bottom );
  6400. }
  6401. }
  6402. return maxhei+1;
  6403. }
  6404. /* CPrintRX m_Print;
  6405. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6406. {
  6407. m_Print.InitToPrint(NULL, 1);
  6408. }
  6409. else
  6410. {
  6411. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  6412. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6413. if(nret==-1)
  6414. {
  6415. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6416. }
  6417. }
  6418. m_Print.StartPrint();
  6419. m_Print.StartPage();
  6420. LoadRect load;
  6421. load.SetLiaPath ("6.lia");
  6422. load.SetMargins(-14,35);
  6423. if(!load.Load ())return;
  6424. LoadRect load2;
  6425. load2.SetLiaPath ("7.lia");
  6426. load2.SetMargins(-14,216+35);
  6427. if(!load2.Load ())return;
  6428. LoadRect load3;
  6429. load3.SetLiaPath ("8.lia");
  6430. load3.SetMargins(-14,705+35);
  6431. if(!load3.Load ())return;
  6432. int i;
  6433. //////////////////////////////////////////////////////////////
  6434. CStringArray txarray;
  6435. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册';";
  6436. g_sendhead.code[0]=11;
  6437. g_sendhead.code[1]=52;
  6438. g_sendhead.code[2]=50;
  6439. g_sendhead.code[3]=77;
  6440. g_sendhead.tabcount=4;
  6441. g_sendhead.bsql=0;
  6442. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  6443. CArray<CStringArray, CStringArray>sparray;
  6444. CArray<CStringArray, CStringArray>clientarray;
  6445. CArray<CStringArray, CStringArray>phonearray;
  6446. CArray<CStringArray, CStringArray>fgarray;
  6447. DataToArray(&g_List1array, &clientarray, &sparray, &fgarray);
  6448. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  6449. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  6450. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  6451. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  6452. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  6453. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  6454. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  6455. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  6456. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  6457. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  6458. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  6459. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  6460. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  6461. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  6462. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  6463. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  6464. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  6465. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  6466. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  6467. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  6468. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  6469. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  6470. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  6471. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  6472. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  6473. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  6474. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  6475. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  6476. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6477. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  6478. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  6479. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  6480. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  6481. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  6482. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  6483. filter="name='"+m_ren+"'";
  6484. g_sendhead.code[0]=5;
  6485. g_sendhead.tabcount=1;
  6486. g_sendhead.bsql=0;
  6487. int g_nYearposTemp=g_nYearpos;
  6488. g_nYearpos=-1;
  6489. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6490. g_nYearpos=g_nYearposTemp;
  6491. if(g_bSendOK==0)return;
  6492. DataToArray(&phonearray);
  6493. m_money1.Format ("%f", atof(m_taoxijiage));
  6494. m_money2.Format ("%f", atof(m_payed1));
  6495. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  6496. ConvertToPrice(m_money1);
  6497. ConvertToPrice(m_money2);
  6498. ConvertToPrice(m_money3);
  6499. ////////////////////////////////////////////////////////////////
  6500. int rcpos=-1;
  6501. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6502. StrRect.top -=15;StrRect.bottom -=15;
  6503. Image *pImg=NULL;
  6504. #ifdef MNLS_VERSION
  6505. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  6506. #else
  6507. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  6508. #endif
  6509. m_Print.DrawImage(pImg, StrRect);
  6510. delete pImg;
  6511. m_Print.SetFontFace(11, 1, "宋体");
  6512. StrRect=load.m_rcarray .ElementAt (20);
  6513. StrRect.right=load.m_rcarray .ElementAt (23).right;
  6514. StrRect.top -=18;StrRect.bottom -=18;
  6515. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  6516. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6517. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  6518. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6519. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6520. StrRect.top -=15;StrRect.bottom -=15;
  6521. #ifdef MNLS_VERSION
  6522. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6523. #endif
  6524. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6525. StrRect.top -=15;StrRect.bottom -=15;
  6526. #ifdef MNLS_VERSION
  6527. m_Print.DrawRect(StrRect);
  6528. #endif
  6529. m_Print.SetFontFace(7, 1, "黑体");
  6530. m_Print.SetColor(0xffffff);
  6531. #ifdef MNLS_VERSION
  6532. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6533. #endif
  6534. m_Print.SetColor(0);
  6535. m_Print.SetFontFace(15, 1, "宋体");
  6536. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6537. StrRect.top -=15;StrRect.bottom -=15;
  6538. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6539. CStringArray strarray;
  6540. strarray.Add("NO: "+m_id);
  6541. CString date;
  6542. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  6543. strarray.Add(date);
  6544. strarray.Add("喜爱");
  6545. strarray.Add("格调");
  6546. if(fgarray.GetSize ()==12)
  6547. {
  6548. for(int i=0; i<12; i++)
  6549. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  6550. }
  6551. else
  6552. {
  6553. strarray.Add("复古典雅");
  6554. strarray.Add("温文尔雅");
  6555. strarray.Add("豪华艳丽");
  6556. strarray.Add("传统大方");
  6557. strarray.Add("新潮个性");
  6558. strarray.Add("浪漫奔放");
  6559. strarray.Add("简单素雅");
  6560. strarray.Add("活泼俏丽");
  6561. strarray.Add("妩媚温馨");
  6562. strarray.Add("温柔贤惠");
  6563. strarray.Add("成熟感性");
  6564. strarray.Add("清纯可爱");
  6565. }
  6566. strarray.Add("姓名");
  6567. strarray.Add("");
  6568. strarray.Add("电话");
  6569. strarray.Add("QQ/邮箱");
  6570. #ifdef CHILD_VERSION
  6571. strarray.Add("家长");
  6572. strarray.Add("宝宝");
  6573. #else
  6574. strarray.Add("先生");
  6575. strarray.Add("女士");
  6576. #endif
  6577. m_Print.SetFontFace(11, 1, "宋体");
  6578. for( i=0; i<strarray.GetSize (); i++)
  6579. {
  6580. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6581. if(i<2)
  6582. {
  6583. StrRect.top -=15;StrRect.bottom -=15;
  6584. }
  6585. if(i>15)
  6586. {
  6587. if(i==18)
  6588. StrRect.right-=80;
  6589. else if(i==19)
  6590. StrRect.left-=80;
  6591. m_Print.DrawRect2(StrRect, 1);
  6592. }
  6593. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6594. }
  6595. for( i=29; i<=40; i++)
  6596. {
  6597. if(m_style.GetLength ()<=(i-29))continue;
  6598. if(m_style.GetAt (i-29)!='1')continue;
  6599. StrRect=load.m_rcarray .ElementAt (i-1);
  6600. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6601. }
  6602. for( i=27; i<=48; i++)
  6603. {
  6604. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6605. if(i==45 || i==46)
  6606. StrRect.right-=80;
  6607. else if(i==47 || i==48)
  6608. StrRect.left-=80;
  6609. m_Print.DrawRect2(StrRect, 1);
  6610. }
  6611. /////////////////////////
  6612. strarray.RemoveAll ();
  6613. CString temp;
  6614. // temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  6615. strarray.Add (temp);
  6616. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  6617. strarray.Add (temp);
  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. strarray.Add ("套系总价");
  6629. strarray.Add ("拍摄张数");
  6630. strarray.Add ("选片日期");
  6631. strarray.Add ("定金");
  6632. strarray.Add ("入册张数");
  6633. strarray.Add ("");
  6634. strarray.Add ("欠款余额");
  6635. strarray.Add ("拍摄日期");
  6636. strarray.Add ("");
  6637. rcpos=-1;
  6638. for( i=0; i<strarray.GetSize (); i++)
  6639. {
  6640. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6641. if(i>9)
  6642. m_Print.DrawRect2(StrRect, 1);
  6643. if(i==1)
  6644. {
  6645. StrRect=load2.m_rcarray .ElementAt (21);StrRect.left +=4;
  6646. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6647. }
  6648. else if(i==6 || i==7)
  6649. {
  6650. StrRect.top -=25;
  6651. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6652. }
  6653. else
  6654. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6655. }
  6656. for( i=22; i<=41; i++)
  6657. {
  6658. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6659. if(rcpos==23 || rcpos==28)continue;
  6660. if(rcpos==24 || rcpos==29)
  6661. StrRect.top-=39;
  6662. m_Print.DrawRect2(StrRect, 1);
  6663. }
  6664. /////////////////////////////
  6665. strarray.RemoveAll ();
  6666. strarray.Add ("顾客签字:");
  6667. strarray.Add ("");
  6668. strarray.Add ("");
  6669. strarray.Add ("门市签字:");
  6670. strarray.Add ("");
  6671. strarray.Add ("");
  6672. rcpos=-1;
  6673. for( i=0; i<strarray.GetSize (); i++)
  6674. {
  6675. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6676. if(i==0 || i==3)
  6677. {
  6678. StrRect.bottom+=20;
  6679. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6680. }
  6681. }
  6682. for( i=7; i<=12; i++)
  6683. {
  6684. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6685. if(i==7 || i==10)
  6686. {
  6687. StrRect.bottom+=12;
  6688. m_Print.DrawRect2(StrRect, 2);
  6689. }
  6690. }
  6691. //////////////////////////////////////
  6692. //开始打数据
  6693. strarray.RemoveAll ();
  6694. strarray.Add (m_name1);
  6695. strarray.Add (m_name2);
  6696. strarray.Add ("");
  6697. strarray.Add ("");
  6698. strarray.Add (m_phone1);
  6699. #ifdef CHILD_VERSION
  6700. strarray.Add ("");
  6701. #else
  6702. strarray.Add (m_phone2);
  6703. #endif
  6704. strarray.Add (m_qq1);
  6705. strarray.Add (m_qq2);
  6706. for( i=41; i<=48; i++)
  6707. {
  6708. StrRect=load.m_rcarray .ElementAt (i-1);
  6709. StrRect.left +=4;
  6710. if(i==45 || i==46)
  6711. StrRect.right-=80;
  6712. else if(i==47 || i==48)
  6713. StrRect.left-=80;
  6714. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6715. }
  6716. ///////////////////////////////
  6717. strarray.RemoveAll ();
  6718. strarray.Add (m_money1);
  6719. str.Format("%d", atoi(m_zs)*2);
  6720. strarray.Add (str);
  6721. strarray.Add (m_time4);
  6722. strarray.Add (m_money2);
  6723. strarray.Add (m_zs);
  6724. strarray.Add ("");
  6725. strarray.Add (m_money3);
  6726. strarray.Add (m_time2);
  6727. strarray.Add ("");
  6728. for( i=32; i<=40; i++)
  6729. {
  6730. StrRect=load2.m_rcarray .ElementAt (i-1);
  6731. StrRect.left +=4;
  6732. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6733. }
  6734. ///////////////////////////////
  6735. strarray.RemoveAll ();
  6736. strarray.Add (m_name1);
  6737. strarray.Add (m_name2);
  6738. CString phone;
  6739. if(m_phone1.IsEmpty ()==0)
  6740. phone=m_phone1+",";
  6741. phone+=m_phone2;
  6742. phone.TrimRight (",");
  6743. strarray.Add (phone);
  6744. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  6745. strarray.Add (m_ren);
  6746. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  6747. for( i=7; i<=12; i++)
  6748. {
  6749. StrRect=load3.m_rcarray .ElementAt (i-1);
  6750. StrRect.left +=4;
  6751. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6752. }
  6753. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  6754. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6755. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  6756. str.Format("造型 %d 款,服装 %d 套", atoi(m_clothescount2), atoi(m_clothescount));
  6757. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6758. // StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  6759. // m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6760. //////////////////////////////
  6761. //开始画文字
  6762. StrRect=load2.m_rcarray .ElementAt (30);
  6763. StrRect.left +=3;
  6764. StrRect.top +=3;
  6765. StrRect.right -=2;
  6766. StrRect.bottom -=2;
  6767. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6768. StrRect=load2.m_rcarray .ElementAt (29); StrRect.top -=39;
  6769. StrRect.left +=3;
  6770. StrRect.top +=3;
  6771. StrRect.right -=2;
  6772. StrRect.bottom -=2;
  6773. str="";
  6774. for(i=0; i<sparray.GetSize (); i++)
  6775. {
  6776. str+=sparray.ElementAt (i).ElementAt (5);
  6777. str+=" 数量:";
  6778. str+=sparray.ElementAt (i).ElementAt (3);
  6779. str+="\r\n";
  6780. }
  6781. str.TrimRight ("\r\n");
  6782. AutoDraw(m_Print, StrRect, str, 1.4);
  6783. StrRect=load2.m_rcarray .ElementAt (40);
  6784. StrRect.top +=8;
  6785. m_Print.SetFontFace(12, 1, "黑体");
  6786. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客须知", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  6787. StrRect.left +=3;
  6788. StrRect.top +=30;
  6789. StrRect.right -=2;
  6790. StrRect.bottom -=2;
  6791. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6792. if(str.IsEmpty ())
  6793. {
  6794. str="\
  6795. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6796. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6797. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6798. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6799. 持良好的心境.\r\n\
  6800. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6801. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6802. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6803. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6804. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6805. 勿进影室, 以免影响拍摄.\r\n\
  6806. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6807. 师或店长沟通.\r\n\
  6808. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6809. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6810. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6811. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6812. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6813. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6814. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6815. 还.";
  6816. }
  6817. AutoDraw(m_Print, StrRect, str, 1.8);
  6818. PrintPreview dlg;
  6819. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6820. dlg.m_pDC =m_Print.GetPDC() ;
  6821. if(dlg.DoModal ()!=IDOK)return;
  6822. //结束打印
  6823. m_Print.EndPage();
  6824. m_Print.EndPrint();*/
  6825. /*
  6826. void CMainFrame::PrintReceipt(CStringArray *pArray)
  6827. {
  6828. g_sendhead.bsql=0;
  6829. g_sendhead.code[0]=24;
  6830. g_sendhead.tabcount=1;
  6831. int g_nYearposTemp=g_nYearpos;
  6832. g_nYearpos=-1;
  6833. g_pMainWnd->ProcessChatMessageRequest2(1);
  6834. g_nYearpos=g_nYearposTemp;
  6835. if(0==g_bSendOK)return;
  6836. DataToArray(&g_cominfoarray);
  6837. CString SerialNo;
  6838. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  6839. CPrintRX m_Print;
  6840. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6841. {
  6842. m_Print.InitToPrint(NULL, 1);
  6843. }
  6844. else
  6845. {
  6846. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  6847. if(name.IsEmpty ())
  6848. m_Print.InitToPrint(NULL, 1);
  6849. else
  6850. {
  6851. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6852. if(nret==-1)
  6853. {
  6854. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6855. }
  6856. }
  6857. }
  6858. m_Print.StartPrint();
  6859. m_Print.StartPage();
  6860. LoadRect load;
  6861. BOOL bSmall=0;
  6862. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  6863. {
  6864. bSmall=1;
  6865. load.SetLiaPath ("20.lia");
  6866. }
  6867. else
  6868. load.SetLiaPath ("10.lia");
  6869. if(bSmall)
  6870. load.SetMargins(0,0);
  6871. else
  6872. load.SetMargins(10,0);
  6873. if(!load.Load ())return;
  6874. int rcpos=-1;
  6875. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6876. if(bSmall)
  6877. {
  6878. m_Print.SetFontFace(18, 1, "黑体");
  6879. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6880. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6881. m_Print.SetFontFace(9, 1, "宋体");
  6882. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6883. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6884. m_Print.SetFontFace(6, 1, "宋体");
  6885. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6886. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6887. m_Print.SetFontFace(9, 1, "宋体");
  6888. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6889. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  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_RIGHT | FORMAT_VCENTER);
  6894. int hei=StrRect.Height ();
  6895. StrRect.bottom=StrRect.top;
  6896. StrRect.top -=8;
  6897. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6898. m_Print.SetFontFace(11, 1, "宋体");
  6899. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6900. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6901. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6902. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6903. m_Print.SetFontFace(8, 1, "宋体");
  6904. for(int i=7; i<24; i++)
  6905. {
  6906. StrRect=load.m_rcarray .ElementAt (i);
  6907. m_Print.DrawRect2(StrRect, 1);
  6908. }
  6909. for( i=9; i<24; i++)
  6910. {
  6911. StrRect=load.m_rcarray .ElementAt (i);
  6912. StrRect.left +=2;
  6913. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6914. }
  6915. m_Print.SetFontFace(6, 1, "宋体");
  6916. for(i=24; i<26; i++)
  6917. {
  6918. StrRect=load.m_rcarray .ElementAt (i);
  6919. StrRect.left +=2;
  6920. if(i==24)
  6921. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6922. else
  6923. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6924. }
  6925. // StrRect=load.m_rcarray .ElementAt (27);
  6926. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6927. }
  6928. else//大单
  6929. {
  6930. m_Print.SetFontFace(20, 1, "黑体");
  6931. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6932. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6933. m_Print.SetFontFace(11, 1, "宋体");
  6934. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15;
  6935. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6936. int hei=StrRect.Height ();
  6937. StrRect.bottom=StrRect.top;
  6938. StrRect.top -=10;
  6939. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6940. m_Print.SetFontFace(8, 1, "宋体");
  6941. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6942. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6943. #ifdef LYFZ_VERSION
  6944. m_Print.SetFontFace(9, 1, "宋体");
  6945. #else
  6946. m_Print.SetFontFace(11, 1, "宋体");
  6947. #endif
  6948. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6949. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6950. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6951. #ifdef LYFZ_VERSION
  6952. StrRect.left +=30;
  6953. StrRect.right +=30;
  6954. #endif
  6955. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6956. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6957. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6958. m_Print.SetFontFace(13, 1, "宋体");
  6959. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6960. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6961. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6962. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6963. m_Print.SetFontFace(11, 1, "宋体");
  6964. for(int i=7; i<24; i++)
  6965. {
  6966. StrRect=load.m_rcarray .ElementAt (i);
  6967. m_Print.DrawRect2(StrRect, 1);
  6968. }
  6969. for( i=9; i<24; i++)
  6970. {
  6971. StrRect=load.m_rcarray .ElementAt (i);
  6972. StrRect.left +=2;
  6973. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6974. }
  6975. #ifdef LYFZ_VERSION
  6976. m_Print.SetFontFace(7, 1, "宋体");
  6977. for(i=24; i<25; i++)
  6978. {
  6979. StrRect=load.m_rcarray .ElementAt (i);
  6980. StrRect.left +=2;
  6981. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6982. }
  6983. #else
  6984. m_Print.SetFontFace(7, 1, "宋体");
  6985. for(i=24; i<27; i++)
  6986. {
  6987. StrRect=load.m_rcarray .ElementAt (i);
  6988. StrRect.left +=2;
  6989. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6990. }
  6991. #endif
  6992. StrRect=load.m_rcarray .ElementAt (24);
  6993. hei=StrRect.Height ();
  6994. StrRect.top +=hei;
  6995. StrRect.bottom +=hei;
  6996. StrRect.right +=100;
  6997. StrRect.left +=2;
  6998. StrRect=load.m_rcarray .ElementAt (27);
  6999. AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7000. }
  7001. PrintPreview dlg;
  7002. dlg.m_mode=3;
  7003. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7004. dlg.m_pDC =m_Print.GetPDC() ;
  7005. if(dlg.DoModal ()!=IDOK)return;
  7006. //结束打印
  7007. m_Print.EndPage();
  7008. m_Print.EndPrint();
  7009. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7010. CString sql;
  7011. sql.Format("update version set [serialno]='%s'", SerialNo);
  7012. g_sendhead.bsql=1;
  7013. g_nYearposTemp=g_nYearpos;
  7014. g_nYearpos=-1;
  7015. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7016. g_nYearpos=g_nYearposTemp;
  7017. }
  7018. */
  7019. void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7020. {
  7021. //AfxMessageBox("abce");
  7022. int i = 0;
  7023. int printcot=1;
  7024. for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7025. {
  7026. g_sendhead.bsql=0;
  7027. g_sendhead.code[0]=24;
  7028. g_sendhead.tabcount=1;
  7029. int g_nYearposTemp=g_nYearpos;
  7030. g_nYearpos=-1;
  7031. g_pMainWnd->ProcessChatMessageRequest2(1);
  7032. g_nYearpos=g_nYearposTemp;
  7033. if(0==g_bSendOK)return;
  7034. DataToArray(&g_cominfoarray);
  7035. CString SerialNo;
  7036. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7037. // 1.创建打印对象
  7038. CPrintRX m_Print;
  7039. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7040. {
  7041. m_Print.InitToPrint(NULL, 1);
  7042. }
  7043. else
  7044. {
  7045. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  7046. if(name.IsEmpty ())
  7047. m_Print.InitToPrint(NULL, 1);
  7048. else
  7049. {
  7050. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7051. if(nret==-1 && aa==0)
  7052. {
  7053. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7054. }
  7055. }
  7056. }
  7057. // 2.开始打印
  7058. m_Print.StartPrint();
  7059. m_Print.StartPage();
  7060. LoadRect load;
  7061. BOOL bSmall=0;
  7062. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7063. {
  7064. bSmall=1;
  7065. load.SetLiaPath ("20.lia");
  7066. }
  7067. else
  7068. load.SetLiaPath ("10.lia");
  7069. if(bSmall)
  7070. load.SetMargins(0,0);
  7071. else
  7072. load.SetMargins(10,0);
  7073. if(!load.Load ())return;
  7074. int rcpos=-1;
  7075. CRect StrRect=load.m_rcarray.ElementAt (++rcpos);
  7076. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7077. {
  7078. Image *pImg=NULL;
  7079. g_nSendCode=31;
  7080. int g_nYearposTemp=g_nYearpos;
  7081. g_nYearpos=-1;
  7082. g_pMainWnd->ProcessChatMessageRequest2(1);
  7083. g_nYearpos=g_nYearposTemp;
  7084. g_nSendCode=0;
  7085. if(g_bSendOK==0)return;
  7086. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7087. if(pImg)
  7088. {
  7089. StrRect.left=65;
  7090. if(bSmall) StrRect.left=55;
  7091. StrRect.top=10;
  7092. StrRect.right=StrRect.left+58;
  7093. StrRect.bottom=StrRect.top+58;
  7094. // 3.打印2维码图像;
  7095. m_Print.DrawImage(pImg, StrRect);
  7096. delete pImg;
  7097. pImg=NULL;
  7098. }
  7099. }
  7100. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7101. if(bSmall)
  7102. {
  7103. m_Print.SetFontFace(18, 1, "黑体");
  7104. StrRect=load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7105. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7106. m_Print.SetFontFace(9, 1, "宋体");
  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_LEFT | FORMAT_VCENTER);
  7109. m_Print.SetFontFace(6, 1, "宋体");
  7110. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7111. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7112. m_Print.SetFontFace(9, 1, "宋体");
  7113. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7114. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7115. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7116. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7117. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7118. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7119. int hei=StrRect.Height ();
  7120. StrRect.bottom=StrRect.top;
  7121. StrRect.top -=8;
  7122. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7123. m_Print.SetFontFace(11, 1, "宋体");
  7124. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7125. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7126. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7127. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7128. m_Print.SetFontFace(8, 1, "宋体");
  7129. for( i=7; i<24; i++)
  7130. {
  7131. StrRect=load.m_rcarray .ElementAt (i);
  7132. m_Print.DrawRect2(StrRect, 1);
  7133. }
  7134. for( i=9; i<24; i++)
  7135. {
  7136. StrRect=load.m_rcarray .ElementAt (i);
  7137. StrRect.left +=2;
  7138. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7139. }
  7140. m_Print.SetFontFace(6, 1, "宋体");
  7141. for(i=24; i<26; i++)
  7142. {
  7143. StrRect=load.m_rcarray .ElementAt (i);
  7144. StrRect.left +=2;
  7145. if(i==24)
  7146. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7147. else
  7148. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7149. }
  7150. // StrRect=load.m_rcarray .ElementAt (27);
  7151. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7152. }
  7153. else//大单
  7154. {
  7155. // 1.打印表头(蒙娜丽莎收款单)
  7156. m_Print.SetFontFace(20, 1, "黑体");
  7157. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7158. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7159. m_Print.SetFontFace(11, 1, "宋体");
  7160. // 2.打印订单号(NO.20140608-001)
  7161. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7162. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7163. // 3.打印SerialNo(SerialNo.01062)
  7164. int hei=StrRect.Height ();
  7165. StrRect.bottom=StrRect.top;
  7166. StrRect.top -=10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7167. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7168. // 4.打印影楼地址信息、电话;
  7169. m_Print.SetFontFace(8, 1, "宋体");
  7170. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7171. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7172. #ifdef LYFZ_VERSION
  7173. m_Print.SetFontFace(9, 1, "宋体");
  7174. #else
  7175. m_Print.SetFontFace(11, 1, "宋体");
  7176. #endif
  7177. // 5.打印客户姓名
  7178. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7179. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7180. // 6.打印客户联系电话
  7181. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7182. #ifdef LYFZ_VERSION
  7183. StrRect.left +=30;
  7184. StrRect.right +=30;
  7185. #endif
  7186. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7187. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7188. // 7.打印开单日期
  7189. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7190. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7191. // 8.打印列字段:收款项目
  7192. m_Print.SetFontFace(13, 1, "宋体");
  7193. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7194. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7195. //printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7196. // 9.打印列字段:金额
  7197. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7198. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7199. //printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7200. // 10.打印列字段:开单人
  7201. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7202. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7203. //printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7204. // 11.画表格-画3列;
  7205. m_Print.SetFontFace(11, 1, "宋体");
  7206. for( i=7; i<10; i++)
  7207. {
  7208. StrRect=load.m_rcarray.ElementAt (i);
  7209. m_Print.DrawRect2(StrRect, 1);
  7210. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7211. }
  7212. // 12.打印详细内容
  7213. int dty=0;
  7214. int dtytemp=0;
  7215. // for( i=10; i<14; i+=3)
  7216. for( i=10; i<22; i+=3) // 循环4次,再画
  7217. {
  7218. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7219. CArray<CRect,CRect>rcarray;
  7220. CStringArray strarray2;
  7221. StrRect=load.m_rcarray.ElementAt(i);
  7222. StrRect.top +=dty;
  7223. StrRect.bottom +=dty;
  7224. if(StrRect.bottom > load.m_rcarray.ElementAt(22).top+5)
  7225. {
  7226. StrRect=load.m_rcarray.ElementAt(i-1);
  7227. StrRect.top +=dty;
  7228. StrRect.bottom +=dty;
  7229. dty=StrRect.bottom-load.m_rcarray.ElementAt (22).top;
  7230. break;
  7231. }
  7232. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7233. StrRect.left +=2;
  7234. StrRect.right -=2;
  7235. StrRect.top +=4;
  7236. rcarray.Add(StrRect);
  7237. strarray2.Add(pArray->ElementAt(i));
  7238. // 指定格子宽度,计算字符串占几行(高度).
  7239. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7240. dtytemp=bottom-StrRect.bottom;
  7241. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7242. // 重新获取表格大小,并画出表格;
  7243. StrRect=load.m_rcarray.ElementAt (i);
  7244. StrRect.bottom +=dtytemp;
  7245. StrRect.top +=dty;
  7246. StrRect.bottom +=dty;
  7247. m_Print.DrawRect2(StrRect, 1);
  7248. // 获取下一表格大小,并画出表格;
  7249. StrRect=load.m_rcarray.ElementAt(i+1);
  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+1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7257. //printf("Jeff:%d:%s\n\n",i+1,pArray->ElementAt(i+1));//Jeff Printf;
  7258. StrRect=load.m_rcarray.ElementAt(i+2);
  7259. StrRect.top +=dty;
  7260. StrRect.bottom +=dty;
  7261. StrRect.bottom +=dtytemp;
  7262. m_Print.DrawRect2(StrRect, 1);
  7263. StrRect.left +=2;
  7264. // 打印开单人字段内容
  7265. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i+2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7266. //printf("Jeff:%d:%s\n\n",i+2,pArray->ElementAt(i+2));//Jeff Printf;
  7267. dty+=dtytemp;
  7268. }
  7269. //.打印->付款情况 应付 实付 欠款.
  7270. i=22;
  7271. StrRect=load.m_rcarray.ElementAt (i);
  7272. StrRect.top +=dty;
  7273. StrRect.bottom +=dty;
  7274. m_Print.DrawRect2(StrRect, 1);
  7275. StrRect.left +=2;
  7276. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7277. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7278. //.打印->合计人民币(大写):.......
  7279. i=23;
  7280. StrRect=load.m_rcarray .ElementAt(i);StrRect.top +=dty;StrRect.bottom +=dty;
  7281. m_Print.DrawRect2(StrRect, 1);
  7282. StrRect.left +=2;
  7283. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7284. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7285. #ifdef LYFZ_VERSION
  7286. m_Print.SetFontFace(7, 1, "宋体");
  7287. for(i=24; i<25; i++)
  7288. {
  7289. StrRect=load.m_rcarray .ElementAt (i);StrRect.top +=dty;StrRect.bottom +=dty;
  7290. StrRect.left +=2;
  7291. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7292. }
  7293. #else
  7294. m_Print.SetFontFace(7, 1, "宋体");
  7295. for(i=24; i<27; i++)
  7296. {
  7297. StrRect=load.m_rcarray .ElementAt (i);StrRect.top +=dty;StrRect.bottom +=dty;
  7298. StrRect.left +=2;
  7299. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7300. }
  7301. #endif
  7302. StrRect=load.m_rcarray .ElementAt (24);StrRect.top +=dty;StrRect.bottom +=dty;
  7303. hei=StrRect.Height ();
  7304. StrRect.top +=hei;
  7305. StrRect.bottom +=hei;
  7306. StrRect.right +=100;
  7307. StrRect.left +=2;
  7308. StrRect=load.m_rcarray .ElementAt (27);StrRect.top +=dty;StrRect.bottom +=dty;
  7309. AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7310. }
  7311. PrintPreview dlg;
  7312. dlg.m_mode=3;
  7313. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7314. dlg.m_pDC =m_Print.GetPDC() ;
  7315. if(aa==0)
  7316. {
  7317. if(dlg.DoModal ()!=IDOK)
  7318. return;
  7319. printcot=dlg.m_num;
  7320. }
  7321. //结束打印
  7322. m_Print.EndPage();
  7323. m_Print.EndPrint();
  7324. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7325. CString sql;
  7326. sql.Format("update version set [serialno]='%s'", SerialNo);
  7327. g_sendhead.bsql=1;
  7328. g_nYearposTemp=g_nYearpos;
  7329. g_nYearpos=-1;
  7330. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7331. g_nYearpos=g_nYearposTemp;
  7332. }
  7333. }
  7334. void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7335. {
  7336. //AfxMessageBox("abce");
  7337. int i = 0;
  7338. int printcot=1;
  7339. for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7340. {
  7341. g_sendhead.bsql=0;
  7342. g_sendhead.code[0]=24;
  7343. g_sendhead.tabcount=1;
  7344. int g_nYearposTemp=g_nYearpos;
  7345. g_nYearpos=-1;
  7346. g_pMainWnd->ProcessChatMessageRequest2(1);
  7347. g_nYearpos=g_nYearposTemp;
  7348. if(0==g_bSendOK)return;
  7349. DataToArray(&g_cominfoarray);
  7350. CString SerialNo;
  7351. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7352. // 1.创建打印对象
  7353. CPrintRX m_Print;
  7354. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7355. {
  7356. m_Print.InitToPrint(NULL, 1);
  7357. }
  7358. else
  7359. {
  7360. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  7361. if(name.IsEmpty ())
  7362. m_Print.InitToPrint(NULL, 1);
  7363. else
  7364. {
  7365. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7366. if(nret==-1 && aa==0)
  7367. {
  7368. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7369. }
  7370. }
  7371. }
  7372. // 2.开始打印
  7373. m_Print.StartPrint();
  7374. m_Print.StartPage();
  7375. LoadRect load;
  7376. BOOL bSmall=0;
  7377. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7378. {
  7379. bSmall=1;
  7380. load.SetLiaPath ("20.lia");
  7381. }
  7382. else
  7383. load.SetLiaPath ("10.lia");
  7384. if(bSmall)
  7385. load.SetMargins(0,0);
  7386. else
  7387. load.SetMargins(10,0);
  7388. if(!load.Load ())return;
  7389. int rcpos=-1;
  7390. CRect StrRect=load.m_rcarray.ElementAt (++rcpos);
  7391. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7392. {
  7393. Image *pImg=NULL;
  7394. g_nSendCode=31;
  7395. int g_nYearposTemp=g_nYearpos;
  7396. g_nYearpos=-1;
  7397. g_pMainWnd->ProcessChatMessageRequest2(1);
  7398. g_nYearpos=g_nYearposTemp;
  7399. g_nSendCode=0;
  7400. if(g_bSendOK==0)return;
  7401. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7402. if(pImg)
  7403. {
  7404. StrRect.left=65;
  7405. if(bSmall) StrRect.left=55;
  7406. StrRect.top=10;
  7407. StrRect.right=StrRect.left+58;
  7408. StrRect.bottom=StrRect.top+58;
  7409. // 3.打印2维码图像;
  7410. m_Print.DrawImage(pImg, StrRect);
  7411. delete pImg;
  7412. pImg=NULL;
  7413. }
  7414. }
  7415. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7416. if(bSmall)
  7417. {
  7418. m_Print.SetFontFace(18, 1, "黑体");
  7419. StrRect=load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7420. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7421. m_Print.SetFontFace(9, 1, "宋体");
  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_LEFT | FORMAT_VCENTER);
  7424. m_Print.SetFontFace(6, 1, "宋体");
  7425. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7426. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7427. m_Print.SetFontFace(9, 1, "宋体");
  7428. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7429. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7430. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7431. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7432. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7433. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7434. int hei=StrRect.Height ();
  7435. StrRect.bottom=StrRect.top;
  7436. StrRect.top -=8;
  7437. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7438. m_Print.SetFontFace(11, 1, "宋体");
  7439. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7440. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7441. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7442. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7443. m_Print.SetFontFace(8, 1, "宋体");
  7444. for( i=7; i<24; i++)
  7445. {
  7446. StrRect=load.m_rcarray .ElementAt (i);
  7447. m_Print.DrawRect2(StrRect, 1);
  7448. }
  7449. for( i=9; i<24; i++)
  7450. {
  7451. StrRect=load.m_rcarray .ElementAt (i);
  7452. StrRect.left +=2;
  7453. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7454. }
  7455. m_Print.SetFontFace(6, 1, "宋体");
  7456. for(i=24; i<26; i++)
  7457. {
  7458. StrRect=load.m_rcarray .ElementAt (i);
  7459. StrRect.left +=2;
  7460. if(i==24)
  7461. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7462. else
  7463. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7464. }
  7465. // StrRect=load.m_rcarray .ElementAt (27);
  7466. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7467. }
  7468. else//大单
  7469. {
  7470. // 1.打印表头(蒙娜丽莎收款单)
  7471. m_Print.SetFontFace(20, 1, "黑体");
  7472. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7473. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7474. m_Print.SetFontFace(11, 1, "宋体");
  7475. // 2.打印订单号(NO.20140608-001)
  7476. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7477. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7478. // 3.打印SerialNo(SerialNo.01062)
  7479. int hei=StrRect.Height ();
  7480. StrRect.bottom=StrRect.top;
  7481. StrRect.top -=10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7482. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7483. // 4.打印影楼地址信息、电话;
  7484. m_Print.SetFontFace(8, 1, "宋体");
  7485. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7486. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7487. #ifdef LYFZ_VERSION
  7488. m_Print.SetFontFace(9, 1, "宋体");
  7489. #else
  7490. m_Print.SetFontFace(11, 1, "宋体");
  7491. #endif
  7492. // 5.打印客户姓名
  7493. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7494. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7495. // 6.打印客户联系电话
  7496. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7497. #ifdef LYFZ_VERSION
  7498. StrRect.left +=30;
  7499. StrRect.right +=30;
  7500. #endif
  7501. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7502. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7503. // 7.打印开单日期
  7504. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7505. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7506. #if 0 // Original Edition
  7507. // 8.打印列字段:收款项目
  7508. m_Print.SetFontFace(13, 1, "宋体");
  7509. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7510. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7511. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7512. // 9.打印列字段:金额
  7513. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7514. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7515. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7516. // 10.打印列字段:开单人
  7517. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7518. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7519. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7520. #else
  7521. // 8.打印列字段:收款项目
  7522. m_Print.SetFontFace(13, 1, "宋体");
  7523. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7524. StrRect=CRect(66,85,280,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. // 8.1 Jeff add:支付方式
  7528. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7529. StrRect=CRect(280,85,350,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. // 9.打印列字段:金额
  7533. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7534. StrRect=CRect(350,85,442,105);
  7535. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7536. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7537. // 10.打印列字段:开单人
  7538. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7539. StrRect=CRect(442,85,535,105);
  7540. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7541. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7542. //rcpos += 3;
  7543. #endif
  7544. // 11.画表格-画3列;old
  7545. // 11.draw 4 column
  7546. m_Print.SetFontFace(11, 1, "宋体");
  7547. //for( i=7; i<10; i++)
  7548. //{
  7549. // StrRect=load.m_rcarray.ElementAt(i);
  7550. // m_Print.DrawRect2(StrRect, 1);
  7551. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7552. //}
  7553. m_Print.DrawRect2(CRect(66,85,280,105),1);
  7554. m_Print.DrawRect2(CRect(280,85,350,105),1);
  7555. m_Print.DrawRect2(CRect(350,85,442,105),1);
  7556. m_Print.DrawRect2(CRect(442,85,535,105),1);
  7557. // 12.打印详细内容
  7558. int dty=0;
  7559. int dtytemp=0;
  7560. // for( i=10; i<14; i+=3)
  7561. //for( i=10; i<22; i+=3) // 循环4次,再画
  7562. int j = 0;
  7563. for( i=10,j=11; i<22; i+=3,j+=4) // 循环4次,再画
  7564. {
  7565. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7566. CArray<CRect,CRect>rcarray;
  7567. CStringArray strarray2;
  7568. StrRect=load.m_rcarray.ElementAt(i);
  7569. StrRect.top +=dty;
  7570. StrRect.bottom +=dty;
  7571. StrRect.right -= 70; // Jeff add
  7572. //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;
  7573. /*
  7574. 4次的CRect
  7575. 66,105,350,125
  7576. 66,126,350,146
  7577. 66,147,350,167
  7578. 66,168,350,188
  7579. */
  7580. if(StrRect.bottom > load.m_rcarray.ElementAt(22).top+5)
  7581. {
  7582. StrRect=load.m_rcarray.ElementAt(i-1);
  7583. StrRect.top +=dty;
  7584. StrRect.bottom +=dty;
  7585. dty=StrRect.bottom-load.m_rcarray.ElementAt (22).top;
  7586. break;
  7587. }
  7588. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7589. StrRect.left +=2;
  7590. StrRect.right -=2;
  7591. StrRect.top +=4;
  7592. rcarray.Add(StrRect);
  7593. //strarray2.Add(pArray->ElementAt(i+1));
  7594. strarray2.Add(pArray->ElementAt(j));
  7595. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7596. // 指定格子宽度,计算字符串占几行(高度).
  7597. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7598. dtytemp=bottom-StrRect.bottom;
  7599. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7600. // 重新获取表格大小,并画出表格;
  7601. /*
  7602. CRect(66,85,280,105),
  7603. CRect(280,85,350,105)
  7604. CRect(350,85,442,105)
  7605. CRect(442,85,535,105)
  7606. CRect(66,105,350,125),
  7607. CRect(66,126,350,146)
  7608. CRect(66,147,350,167)
  7609. CRect(66,168,350,188)
  7610. */
  7611. // 画收款项目框及打印内容;
  7612. StrRect=load.m_rcarray.ElementAt(i);
  7613. //StrRect=CRect(66,85,280,105);
  7614. StrRect.bottom +=dtytemp;
  7615. StrRect.top +=dty;
  7616. StrRect.bottom +=dty;
  7617. //StrRect.left -= 70; // Jeff add
  7618. StrRect.right -= 70; // Jeff add
  7619. //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;
  7620. m_Print.DrawRect2(StrRect, 1);
  7621. // 画支付方式框及打印内容;
  7622. StrRect=load.m_rcarray.ElementAt(i);
  7623. //StrRect=CRect(280,85,350,105);
  7624. StrRect.bottom +=dtytemp;
  7625. StrRect.top +=dty;
  7626. StrRect.bottom +=dty;
  7627. StrRect.left += StrRect.Width()-70;
  7628. //StrRect.right += 70; // Jeff add
  7629. //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;
  7630. m_Print.DrawRect2(StrRect, 1);
  7631. StrRect.left +=2;
  7632. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7633. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7634. // 画金额框及打印内容;
  7635. StrRect=load.m_rcarray.ElementAt(i+1);
  7636. //StrRect=CRect(350,85,442,105);
  7637. StrRect.top +=dty;
  7638. StrRect.bottom +=dty;
  7639. StrRect.bottom +=dtytemp;
  7640. //StrRect.right -= 70; // Jeff add
  7641. //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;
  7642. m_Print.DrawRect2(StrRect, 1);
  7643. StrRect.left +=2;
  7644. // 打印出金额字段内容
  7645. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7646. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7647. // 画开单人框及打印内容;
  7648. StrRect=load.m_rcarray.ElementAt(i+2);
  7649. //StrRect=CRect(442,85,535,105);
  7650. StrRect.top +=dty;
  7651. StrRect.bottom +=dty;
  7652. StrRect.bottom +=dtytemp;
  7653. //StrRect.right -= 70; // Jeff add
  7654. //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;
  7655. m_Print.DrawRect2(StrRect, 1);
  7656. StrRect.left +=2;
  7657. // 打印开单人字段内容
  7658. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7659. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7660. dty+=dtytemp;
  7661. }
  7662. //.打印->付款情况 应付 实付 欠款.
  7663. i=22;
  7664. j=27;
  7665. StrRect=load.m_rcarray.ElementAt (i);
  7666. StrRect.top +=dty;
  7667. StrRect.bottom +=dty;
  7668. m_Print.DrawRect2(StrRect, 1);
  7669. StrRect.left +=2;
  7670. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7671. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7672. //.打印->合计人民币(大写):.......
  7673. i=23;
  7674. j=28;
  7675. StrRect=load.m_rcarray.ElementAt(i);
  7676. StrRect.top +=dty;
  7677. StrRect.bottom +=dty;
  7678. m_Print.DrawRect2(StrRect, 1);
  7679. StrRect.left +=2;
  7680. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7681. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7682. // 打印总金额;
  7683. #ifdef LYFZ_VERSION
  7684. m_Print.SetFontFace(7, 1, "宋体");
  7685. for(i=24; i<25; i++)
  7686. {
  7687. StrRect=load.m_rcarray.ElementAt(i);
  7688. StrRect.top +=dty;
  7689. StrRect.bottom +=dty;
  7690. StrRect.left +=2;
  7691. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7692. }
  7693. #else
  7694. m_Print.SetFontFace(7, 1, "宋体");
  7695. for(i=24,j=29; i<27; i++,j++)
  7696. {
  7697. StrRect=load.m_rcarray.ElementAt(i);
  7698. StrRect.top +=dty;
  7699. StrRect.bottom +=dty;
  7700. StrRect.left +=2;
  7701. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7702. }
  7703. #endif
  7704. StrRect=load.m_rcarray.ElementAt (24);
  7705. StrRect.top +=dty;
  7706. StrRect.bottom +=dty;
  7707. hei=StrRect.Height ();
  7708. StrRect.top +=hei;
  7709. StrRect.bottom +=hei;
  7710. StrRect.right +=100;
  7711. StrRect.left +=2;
  7712. StrRect=load.m_rcarray .ElementAt(27);StrRect.top +=dty;StrRect.bottom +=dty;
  7713. AutoDraw(m_Print, StrRect, pArray->ElementAt(32), 1.0);
  7714. }
  7715. PrintPreview dlg;
  7716. dlg.m_mode=3;
  7717. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7718. dlg.m_pDC =m_Print.GetPDC() ;
  7719. if(aa==0)
  7720. {
  7721. if(dlg.DoModal ()!=IDOK)
  7722. return;
  7723. printcot=dlg.m_num;
  7724. }
  7725. //结束打印
  7726. m_Print.EndPage();
  7727. m_Print.EndPrint();
  7728. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7729. CString sql;
  7730. sql.Format("update version set [serialno]='%s'", SerialNo);
  7731. g_sendhead.bsql=1;
  7732. g_nYearposTemp=g_nYearpos;
  7733. g_nYearpos=-1;
  7734. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7735. g_nYearpos=g_nYearposTemp;
  7736. }
  7737. }
  7738. void CMainFrame::PrintFlowChart(CString strOrderNumber)
  7739. {
  7740. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
  7741. {
  7742. PrintFlowChart3(strOrderNumber);return;
  7743. }
  7744. #ifdef ZHIAI_VERSION
  7745. PrintFlowChart2(strOrderNumber);
  7746. return;
  7747. #endif
  7748. int printcot=1;
  7749. for(int aa=0; aa<printcot; aa++)
  7750. {
  7751. CPrintRX m_Print;
  7752. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7753. {
  7754. m_Print.InitToPrint(NULL, 1);
  7755. }
  7756. else
  7757. {
  7758. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  7759. if(name.IsEmpty ())
  7760. m_Print.InitToPrint(NULL, 1);
  7761. else
  7762. {
  7763. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7764. if(nret==-1 && aa==0)
  7765. {
  7766. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7767. }
  7768. }
  7769. }
  7770. m_Print.StartPrint();
  7771. m_Print.StartPage();
  7772. // CRect StrRect(0,0,560,818);
  7773. LoadRect load;
  7774. load.SetLiaPath ("4.lia");
  7775. load.SetMargins(-14,-14);
  7776. if(!load.Load ())return;
  7777. LoadRect load2;
  7778. load2.SetMargins(-14,472+27-14);
  7779. load2.SetLiaPath ("5.lia");
  7780. if(!load2.Load ())return;
  7781. //////////////////////////////////////////////////////////////
  7782. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2'";
  7783. g_sendhead.code[0]=54;
  7784. g_sendhead.code[1]=223;
  7785. g_sendhead.tabcount=2;
  7786. g_sendhead.bsql=0;
  7787. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  7788. CArray<CStringArray, CStringArray>sparray;
  7789. DataToArray(&g_List1array,&sparray);
  7790. CString spno;
  7791. int i = 0;
  7792. for( i=0; i<sparray.GetSize (); i++)
  7793. {
  7794. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  7795. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  7796. if(sparray.ElementAt (i).ElementAt (5)=="入册" && sparray.ElementAt (i).ElementAt (5)=="入底" && sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  7797. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  7798. spno+=sparray.ElementAt (i).ElementAt (5);
  7799. if(0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7800. spno+="; ";
  7801. else
  7802. {
  7803. spno+=":";
  7804. spno+=sparray.ElementAt (i).ElementAt (6);
  7805. spno+="; ";
  7806. }
  7807. }
  7808. spno+=" 加挑:";
  7809. for( i=0; i<sparray.GetSize (); i++)
  7810. {
  7811. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  7812. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  7813. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  7814. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  7815. spno+=sparray.ElementAt (i).ElementAt (5);
  7816. if(0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7817. spno+="; ";
  7818. else
  7819. {
  7820. spno+=":";
  7821. spno+=sparray.ElementAt (i).ElementAt (6);
  7822. spno+="; ";
  7823. }
  7824. }
  7825. if(spno.Right (6)==" 加挑:")
  7826. {
  7827. spno=spno.Left (spno.GetLength ()-6);
  7828. }
  7829. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  7830. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  7831. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  7832. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  7833. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  7834. if(m_urgent.IsEmpty ())m_urgent="否";
  7835. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  7836. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  7837. // CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  7838. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  7839. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  7840. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  7841. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  7842. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  7843. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  7844. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  7845. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  7846. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17)+g_List1array.ElementAt (0).ElementAt (29);
  7847. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  7848. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  7849. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  7850. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  7851. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  7852. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  7853. CString m_sum3;
  7854. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  7855. ::ConvertToPrice (m_sum3);
  7856. if(m_money3.IsEmpty ())m_money3="0";
  7857. // m_money3=m_money3+"/"+m_sum3;
  7858. CString name;
  7859. if(!m_name1.IsEmpty ())
  7860. name=m_name1+",";
  7861. name+=m_name2;
  7862. name.TrimRight (",");
  7863. CString phone;
  7864. if(!m_phone1.IsEmpty ())
  7865. phone=m_phone1+",";
  7866. phone+=m_phone2;phone.TrimRight (",");
  7867. if(IsHasRights2new(31)==0)
  7868. phone="***";
  7869. CStringArray strarray;
  7870. strarray.Add (m_urgent);
  7871. strarray.Add (m_ren);
  7872. strarray.Add (m_waiter3);
  7873. strarray.Add (name);
  7874. strarray.Add (m_time2);
  7875. strarray.Add (m_time4);
  7876. strarray.Add (m_money3);
  7877. strarray.Add (m_sum3);
  7878. strarray.Add (m_takezs);
  7879. strarray.Add (m_taoxizs);
  7880. strarray.Add (m_choosezs);
  7881. strarray.Add (strOrderNumber);
  7882. strarray.Add (phone);
  7883. ////////////////////////////////////////////////////////////////
  7884. int rcpos=-1;
  7885. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  7886. Image *pImg=NULL;
  7887. #ifdef MNLS_VERSION
  7888. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  7889. #else
  7890. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  7891. #endif
  7892. m_Print.DrawImage(pImg, StrRect);
  7893. delete pImg;
  7894. m_Print.SetFontFace(11, 1, "宋体");
  7895. StrRect=load2.m_rcarray .ElementAt (7);
  7896. StrRect.top=load2.m_rcarray .ElementAt (15).top-15 ;
  7897. StrRect.bottom=load2.m_rcarray .ElementAt (15).bottom-15 ;
  7898. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  7899. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7900. StrRect.top+=15;
  7901. StrRect.bottom+=15;
  7902. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  7903. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7904. m_Print.SetFontFace(15, 1, "宋体");
  7905. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7906. #ifdef MNLS_VERSION
  7907. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7908. #endif
  7909. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7910. #ifdef MNLS_VERSION
  7911. m_Print.DrawRect(StrRect);
  7912. #endif
  7913. m_Print.SetFontFace(7, 1, "黑体");
  7914. m_Print.SetColor(0xffffff);
  7915. #ifdef MNLS_VERSION
  7916. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7917. #endif
  7918. m_Print.SetColor(0);
  7919. m_Print.SetFontFace(25, 1, "黑体");
  7920. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7921. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7922. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  7923. {
  7924. Image *pImg=NULL;
  7925. g_nSendCode=31;
  7926. int g_nYearposTemp=g_nYearpos;
  7927. g_nYearpos=-1;
  7928. g_pMainWnd->ProcessChatMessageRequest2(1);
  7929. g_nYearpos=g_nYearposTemp;
  7930. g_nSendCode=0;
  7931. if(g_bSendOK==0)return;
  7932. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7933. if(pImg)
  7934. {
  7935. StrRect.left=450;
  7936. StrRect.top=22;
  7937. StrRect.right=StrRect.left+60;
  7938. StrRect.bottom=StrRect.top+60;
  7939. m_Print.DrawImage(pImg, StrRect);
  7940. delete pImg;pImg=NULL;
  7941. }
  7942. }
  7943. #ifdef CHILD_VERSION
  7944. CString title[13]={"是否加急:","接单门市:",\
  7945. "选样人员:","客人姓名:","拍照日期:","选片日期:","加挑:","余款:",\
  7946. "拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  7947. #else
  7948. CString title[13]={"是否加急:","接单门市:",\
  7949. "选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","加挑:","余款:",\
  7950. "拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  7951. #endif
  7952. m_Print.SetFontFace(12, 1, "宋体");
  7953. for( i=0; i<13; i++)
  7954. {
  7955. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7956. if(i<3)
  7957. m_Print.DrawRect2(StrRect, 0);
  7958. else
  7959. m_Print.DrawRect2(StrRect, 1);
  7960. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7961. }
  7962. for( i=18; i<=37; i++)
  7963. {
  7964. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7965. if(i>=19&&i<=21)
  7966. m_Print.DrawRect2(StrRect, 2);
  7967. /* else if(i==26)
  7968. {
  7969. CRect rc=StrRect;
  7970. CRect rc2=rc;
  7971. rc.right -=rc2.Width ()/2;
  7972. m_Print.DrawRect2(rc, 1);
  7973. rc2.left +=rc.Width ();
  7974. m_Print.DrawRect2(rc2, 1);
  7975. }*/
  7976. else
  7977. m_Print.DrawRect2(StrRect, 1);
  7978. if(i==18)
  7979. {
  7980. StrRect.left +=5;
  7981. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7982. }
  7983. }
  7984. //////////////////////////////////////
  7985. rcpos=-1;
  7986. for( i=0; i<8; i++)
  7987. {
  7988. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  7989. m_Print.DrawRect2(StrRect, 1);
  7990. }
  7991. #ifdef CHILD_VERSION
  7992. CString title2[4]={"引导师:","摄影师:","数码设计师:","顾客设计签名:"};
  7993. #else
  7994. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客设计签名:"};
  7995. #endif
  7996. for( i=0; i<4; i++)
  7997. {
  7998. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  7999. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8000. }
  8001. for( i=0; i<4; i++)
  8002. {
  8003. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  8004. m_Print.DrawRect2(StrRect, 2);
  8005. }
  8006. StrRect=load2.m_rcarray .ElementAt (11);
  8007. StrRect.top -=15;
  8008. StrRect.bottom -=15;
  8009. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客选片签名:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8010. StrRect=load2.m_rcarray .ElementAt (15);
  8011. StrRect.top -=15;
  8012. StrRect.bottom -=15;
  8013. m_Print.DrawRect2(StrRect, 2);
  8014. ///////////////////////////////////////////
  8015. for( i=19; i<=31; i++)
  8016. {
  8017. StrRect=load.m_rcarray .ElementAt (i-1);
  8018. StrRect.left +=4;
  8019. if(i==31)
  8020. {
  8021. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  8022. {
  8023. StrRect.top +=2;
  8024. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  8025. StrRect.top +=8;
  8026. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8027. }
  8028. else
  8029. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8030. }
  8031. /* else if((i-19)==7)
  8032. {
  8033. CRect rc=StrRect;
  8034. CRect rc2=rc;
  8035. rc.right -=rc2.Width ()/2;
  8036. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8037. rc2.left +=rc.Width ()+3;
  8038. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8039. }*/
  8040. else
  8041. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8042. }
  8043. strarray.RemoveAll ();
  8044. strarray.Add (m_waiter2);
  8045. strarray.Add (m_waiter1);
  8046. strarray.Add (m_waiter4);
  8047. for( i=13; i<=15; i++)
  8048. {
  8049. StrRect=load2.m_rcarray .ElementAt (i-1);
  8050. StrRect.left +=4;
  8051. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8052. }
  8053. ///////////spno
  8054. CRect sprc[14];
  8055. for(i=0; i<14; i++)
  8056. {
  8057. if(i<7)
  8058. {
  8059. if(i==0)
  8060. {
  8061. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  8062. }
  8063. else
  8064. {
  8065. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  8066. }
  8067. }
  8068. else
  8069. {
  8070. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  8071. }
  8072. sprc[i]=StrRect;
  8073. }
  8074. CString temp,tempspno,tempbz;
  8075. CSize size;
  8076. BOOL bRun=0;
  8077. int fontsize=12;
  8078. ll: tempspno=spno;
  8079. tempbz=m_bz;
  8080. m_Print.SetFontFace(fontsize, 1, "宋体");
  8081. for( i=0; i<14; i++)
  8082. {
  8083. if(!tempspno.IsEmpty ())
  8084. {
  8085. temp=tempspno;
  8086. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8087. int right=0;
  8088. CRect temprc=sprc[i];
  8089. while(size.cx>temprc.Width ())
  8090. {
  8091. right++;
  8092. temp=tempspno.Left (tempspno.GetLength ()-(right));
  8093. if(GIsHalfHZ(temp))
  8094. {
  8095. right++;
  8096. temp.Delete (temp.GetLength ()-1);
  8097. }
  8098. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8099. }
  8100. if(bRun)
  8101. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8102. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  8103. if(tempspno.IsEmpty ())i++;
  8104. }
  8105. else if(!tempbz.IsEmpty ())
  8106. {
  8107. temp=tempbz;
  8108. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8109. int right=0;
  8110. CRect temprc=sprc[i];
  8111. while(size.cx>temprc.Width ())
  8112. {
  8113. right++;
  8114. temp=tempbz.Left (tempbz.GetLength ()-(right));
  8115. if(GIsHalfHZ(temp))
  8116. {
  8117. right++;
  8118. temp.Delete (temp.GetLength ()-1);
  8119. }
  8120. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8121. }
  8122. if(bRun)
  8123. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8124. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  8125. }
  8126. }
  8127. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  8128. {
  8129. fontsize--;
  8130. goto ll;
  8131. }
  8132. if(bRun==0)
  8133. {
  8134. bRun=1;
  8135. goto ll;
  8136. }
  8137. PrintPreview dlg;
  8138. dlg.m_mode=2;
  8139. dlg.m_name =name;
  8140. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  8141. dlg.m_pDC =m_Print.GetPDC() ;
  8142. if(aa==0)
  8143. {
  8144. if(dlg.DoModal ()!=IDOK)
  8145. return;
  8146. printcot=dlg.m_num;
  8147. }
  8148. //结束打印
  8149. m_Print.EndPage();
  8150. m_Print.EndPrint();
  8151. }
  8152. }
  8153. void CMainFrame::PrintFlowChart3LKAY(CString strOrderNumber)
  8154. {
  8155. int printcot=1;
  8156. for(int aa=0; aa<printcot; aa++)
  8157. {
  8158. CPrintRX m_Print;
  8159. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8160. {
  8161. m_Print.InitToPrint(NULL, 1);
  8162. }
  8163. else
  8164. {
  8165. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  8166. if(name.IsEmpty ())
  8167. m_Print.InitToPrint(NULL, 1);
  8168. else
  8169. {
  8170. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8171. if(nret==-1 && aa==0)
  8172. {
  8173. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8174. }
  8175. }
  8176. }
  8177. m_Print.StartPrint();
  8178. m_Print.StartPage();
  8179. LoadRect load;
  8180. load.SetLiaPath ("18.lia");
  8181. load.SetMargins(10,0);
  8182. if(!load.Load ())return;
  8183. CString str;
  8184. int rcpos=-1;
  8185. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  8186. m_Print.SetFontFace(25, 1, "宋体");
  8187. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8188. m_Print.SetFontFace(15, 1, "宋体");
  8189. StrRect=load.m_rcarray .ElementAt (++rcpos);
  8190. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8191. m_Print.SetFontFace(9, 1, "宋体");
  8192. //////////////////////////////////////////////////////////////
  8193. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2';id='"+strOrderNumber+"'";
  8194. g_sendhead.code[0]=54;
  8195. g_sendhead.code[1]=223;
  8196. g_sendhead.code[2]=52;
  8197. g_sendhead.tabcount=3;
  8198. g_sendhead.bsql=0;
  8199. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  8200. CArray<CStringArray, CStringArray>sparray;
  8201. CArray<CStringArray, CStringArray>clientarray;
  8202. DataToArray(&g_List1array,&sparray,&clientarray);
  8203. CString spno;
  8204. CStringArray sparray2;
  8205. int i = 0;
  8206. for( i=0; i<sparray.GetSize (); i++)
  8207. {
  8208. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8209. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  8210. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8211. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8212. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8213. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  8214. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8215. sparray2.Add (sparray.ElementAt (i).ElementAt (9));
  8216. sparray2.Add (sparray.ElementAt (i).ElementAt (10));
  8217. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8218. }
  8219. for( i=0; i<sparray.GetSize (); i++)
  8220. {
  8221. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  8222. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  8223. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  8224. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8225. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8226. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  8227. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8228. sparray2.Add (sparray.ElementAt (i).ElementAt (9));
  8229. sparray2.Add (sparray.ElementAt (i).ElementAt (10));
  8230. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8231. }
  8232. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  8233. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  8234. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  8235. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  8236. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  8237. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  8238. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  8239. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  8240. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  8241. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  8242. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  8243. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  8244. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  8245. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  8246. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  8247. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  8248. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  8249. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  8250. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  8251. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  8252. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  8253. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  8254. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  8255. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  8256. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  8257. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  8258. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  8259. CString m_sum3;
  8260. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  8261. ::ConvertToPrice (m_sum3);
  8262. if(m_money3.IsEmpty ())m_money3="0";
  8263. int dty=0;
  8264. CString name;
  8265. if(!m_name1.IsEmpty ())
  8266. name=m_name1+",";
  8267. name+=m_name2;
  8268. name.TrimRight (",");
  8269. CString phone;
  8270. if(!m_phone1.IsEmpty ())
  8271. phone=m_phone1+",";
  8272. phone+=m_phone2;phone.TrimRight (",");
  8273. if(IsHasRights2new(31)==0)
  8274. phone="***";
  8275. CStringArray strarray;
  8276. #ifdef CHILD_VERSION
  8277. if(m_birthday.IsEmpty ())
  8278. strarray.Add ("姓名/性别");
  8279. else
  8280. strarray.Add ("姓名/性别/年龄");
  8281. #else
  8282. strarray.Add ("客人姓名");
  8283. #endif
  8284. strarray.Add ("电话");
  8285. strarray.Add ("单号");
  8286. strarray.Add ("套系");
  8287. strarray.Add ("选样");
  8288. strarray.Add ("余款/加挑");
  8289. strarray.Add ("选片/日期");
  8290. #ifdef CHILD_VERSION
  8291. if(m_birthday.IsEmpty ())
  8292. strarray.Add (name+"/"+m_sex);
  8293. else
  8294. {
  8295. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  8296. m_birthday.Format ("%d", year+1);
  8297. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  8298. }
  8299. #else
  8300. strarray.Add (name);
  8301. #endif
  8302. strarray.Add (phone);
  8303. strarray.Add (strOrderNumber);
  8304. strarray.Add (m_taoxiname);
  8305. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8306. strarray.Add (str);
  8307. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  8308. strarray.Add (str);
  8309. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  8310. for( i=3; i<=16; i++)
  8311. {
  8312. StrRect=load.m_rcarray .ElementAt (i-1);
  8313. if(i<10)
  8314. {
  8315. m_Print.DrawRect2(StrRect, 1);
  8316. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8317. }
  8318. }
  8319. StrRect=load.m_rcarray .ElementAt (29);
  8320. m_Print.DrawRect2(StrRect, 1);
  8321. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8322. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8323. {
  8324. Image *pImg=NULL;
  8325. g_nSendCode=31;
  8326. int g_nYearposTemp=g_nYearpos;
  8327. g_nYearpos=-1;
  8328. g_pMainWnd->ProcessChatMessageRequest2(1);
  8329. g_nYearpos=g_nYearposTemp;
  8330. g_nSendCode=0;
  8331. if(g_bSendOK==0)return;
  8332. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  8333. if(pImg)
  8334. {
  8335. StrRect.left=485;
  8336. StrRect.top=12;
  8337. StrRect.right=StrRect.left+60;
  8338. StrRect.bottom=StrRect.top+60;
  8339. m_Print.DrawImage(pImg, StrRect);
  8340. delete pImg;pImg=NULL;
  8341. }
  8342. }
  8343. CArray<CRect,CRect>rcarray;
  8344. CStringArray strarray2;
  8345. for( i=10; i<=16; i++)
  8346. {
  8347. StrRect=load.m_rcarray .ElementAt (i-1);
  8348. StrRect.left +=2;
  8349. StrRect.right -=2;
  8350. StrRect.top +=2;
  8351. rcarray.Add (StrRect);
  8352. strarray2.Add (strarray.ElementAt (7+i-10));
  8353. }
  8354. if(1)
  8355. {
  8356. StrRect=load.m_rcarray .ElementAt (30);
  8357. StrRect.left +=2;
  8358. StrRect.right -=2;
  8359. StrRect.top +=2;
  8360. rcarray.Add (StrRect);
  8361. strarray2.Add (m_time6+"/"+m_time5);
  8362. }
  8363. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8364. for( i=10; i<=16; i++)
  8365. {
  8366. StrRect=load.m_rcarray .ElementAt (i-1);
  8367. if(i==10)
  8368. {
  8369. dty+=bottom-StrRect.bottom;
  8370. }
  8371. StrRect.bottom =bottom;
  8372. m_Print.DrawRect2(StrRect, 1);
  8373. }
  8374. if(1)
  8375. {
  8376. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  8377. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  8378. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  8379. }
  8380. m_Print.SetFontFace(15, 1, "宋体");
  8381. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  8382. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8383. m_Print.SetFontFace(9, 1, "宋体");
  8384. strarray.RemoveAll ();
  8385. strarray.Add ("产品名称");
  8386. strarray.Add ("数量");
  8387. strarray.Add ("P数");
  8388. strarray.Add ("张数");
  8389. strarray.Add ("照片编号");
  8390. CArray<CRect,CRect>rc2array;
  8391. int wid=25;
  8392. for( i=18; i<=22; i++)
  8393. {
  8394. StrRect=load.m_rcarray .ElementAt (i-1);
  8395. if(i==19)
  8396. {
  8397. StrRect.right =StrRect.left+wid;
  8398. }
  8399. if(i==20)
  8400. {
  8401. StrRect=load.m_rcarray .ElementAt (i-2);
  8402. StrRect.left +=wid;StrRect.right=StrRect.left;
  8403. StrRect.right +=wid;
  8404. }
  8405. if(i==21)
  8406. {
  8407. StrRect=load.m_rcarray .ElementAt (i-3);
  8408. StrRect.left +=wid*2;StrRect.right=StrRect.left;
  8409. StrRect.right +=wid;
  8410. wid=StrRect.right;
  8411. }
  8412. if(i==22)
  8413. {
  8414. StrRect=load.m_rcarray .ElementAt (i-3);
  8415. StrRect.left =wid;
  8416. }
  8417. StrRect.top +=dty;StrRect.bottom +=dty;
  8418. m_Print.DrawRect2(StrRect, 1);
  8419. StrRect.left +=2;
  8420. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8421. StrRect.left -=2;
  8422. StrRect.top =StrRect.bottom ;
  8423. StrRect.bottom +=18;
  8424. rc2array.Add (StrRect);
  8425. }
  8426. int curypos=0;
  8427. for(i=0; i<sparray2.GetSize (); i+=5)
  8428. {
  8429. rcarray.RemoveAll ();
  8430. strarray2.RemoveAll ();
  8431. int j = 0;
  8432. for( j=0; j<5; j++)
  8433. {
  8434. StrRect=rc2array.ElementAt (j);
  8435. StrRect.left +=2;
  8436. StrRect.right -=2;
  8437. StrRect.top +=2;
  8438. rcarray.Add (StrRect);
  8439. strarray2.Add (sparray2.ElementAt (i+j));
  8440. }
  8441. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8442. rcarray.RemoveAll ();
  8443. for( j=0; j<5; j++)
  8444. {
  8445. StrRect=rc2array.ElementAt (j);
  8446. if(j==0)
  8447. {
  8448. dty+=bottom-StrRect.bottom;
  8449. }
  8450. StrRect.bottom =bottom;
  8451. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8452. StrRect.top =StrRect.bottom ;
  8453. StrRect.bottom +=18;
  8454. rcarray.Add (StrRect);
  8455. }
  8456. rc2array.RemoveAll ();
  8457. rc2array.Copy(rcarray);
  8458. }
  8459. m_Print.SetFontFace(15, 1, "宋体");
  8460. StrRect=load.m_rcarray .ElementAt (20);
  8461. dty=curypos-StrRect.bottom+35;
  8462. StrRect.top +=dty;StrRect.bottom +=dty;
  8463. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8464. m_Print.SetFontFace(9, 1, "宋体");
  8465. rcarray.RemoveAll ();
  8466. strarray2.RemoveAll ();
  8467. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8468. StrRect.left +=2;
  8469. StrRect.right -=2;
  8470. StrRect.top +=2;
  8471. rcarray.Add (StrRect);
  8472. strarray2.Add (m_bz);
  8473. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8474. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8475. dty+=bottom-StrRect.bottom;
  8476. StrRect.bottom =bottom;
  8477. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8478. m_Print.SetFontFace(10, 1, "宋体");
  8479. StrRect=load.m_rcarray .ElementAt (22);
  8480. dty=curypos-StrRect.bottom+25;
  8481. StrRect.top +=dty;StrRect.bottom +=dty;
  8482. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  8483. if(m_edit9.IsEmpty())
  8484. {
  8485. m_edit9="\
  8486. 经确认后的照片均排入制作流程,\r\n\
  8487. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8488. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8489. }
  8490. CString info1,info2,info3;
  8491. int newlinepos=m_edit9.Find("\r\n");
  8492. if(newlinepos!=-1)
  8493. {
  8494. info1=m_edit9.Left(newlinepos);
  8495. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8496. }
  8497. newlinepos=m_edit9.Find("\r\n");
  8498. if(newlinepos!=-1)
  8499. {
  8500. info2=m_edit9.Left(newlinepos);
  8501. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8502. info3=m_edit9;
  8503. }
  8504. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8505. StrRect=load.m_rcarray .ElementAt (23);
  8506. StrRect.top +=dty;StrRect.bottom +=dty;
  8507. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8508. StrRect=load.m_rcarray .ElementAt (24);
  8509. StrRect.top +=dty;StrRect.bottom +=dty;
  8510. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8511. StrRect.top +=15;
  8512. StrRect.bottom +=15;
  8513. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8514. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  8515. StrRect=load.m_rcarray .ElementAt (25);
  8516. StrRect.top +=dty-dy;
  8517. StrRect.bottom +=dty-dy;
  8518. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8519. StrRect=load.m_rcarray .ElementAt (26);
  8520. StrRect.top +=dty-dy;
  8521. StrRect.bottom +=dty-dy;
  8522. m_Print.DrawRect2(StrRect, 2);
  8523. StrRect=load.m_rcarray .ElementAt (25);
  8524. StrRect.top +=dty+15-dy;
  8525. StrRect.bottom +=dty+15-dy;
  8526. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8527. StrRect=load.m_rcarray .ElementAt (26);
  8528. StrRect.top +=dty+15-dy;
  8529. StrRect.bottom +=dty+15-dy;
  8530. m_Print.DrawRect2(StrRect, 2);
  8531. StrRect=load.m_rcarray .ElementAt (25);
  8532. StrRect.top +=dty+15*2-dy;
  8533. StrRect.bottom +=dty+15*2-dy;
  8534. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8535. StrRect=load.m_rcarray .ElementAt (26);
  8536. StrRect.top +=dty+15*2-dy;
  8537. StrRect.bottom +=dty+15*2-dy;
  8538. m_Print.DrawRect2(StrRect, 2);
  8539. PrintPreview dlg;dlg.m_mode=2;
  8540. dlg.m_name =name;
  8541. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  8542. dlg.m_pDC =m_Print.GetPDC() ;
  8543. if(aa==0)
  8544. {
  8545. if(dlg.DoModal ()!=IDOK)
  8546. return;
  8547. printcot=dlg.m_num;
  8548. }
  8549. //结束打印
  8550. m_Print.EndPage();
  8551. m_Print.EndPrint();
  8552. }
  8553. }
  8554. void CMainFrame::PrintFlowChart3(CString strOrderNumber)
  8555. {
  8556. #ifdef LKAY_VERSION
  8557. PrintFlowChart3LKAY(strOrderNumber);
  8558. return;
  8559. #endif
  8560. int printcot=1;
  8561. for(int aa=0; aa<printcot; aa++)
  8562. {
  8563. BOOL bSecondPage=0;
  8564. int nPrintedPos=0;
  8565. for(int bb=0; bb<2; bb++)
  8566. {
  8567. if(bb && bSecondPage==0)break;
  8568. CPrintRX m_Print;
  8569. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8570. {
  8571. m_Print.InitToPrint(NULL, 1);
  8572. }
  8573. else
  8574. {
  8575. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  8576. if(name.IsEmpty ())
  8577. m_Print.InitToPrint(NULL, 1);
  8578. else
  8579. {
  8580. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8581. if(nret==-1 && aa==0)
  8582. {
  8583. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8584. }
  8585. }
  8586. }
  8587. m_Print.StartPrint();
  8588. m_Print.StartPage();
  8589. LoadRect load;
  8590. load.SetLiaPath ("18.lia");
  8591. load.SetMargins(10,0);
  8592. if(!load.Load ())return;
  8593. CString str;
  8594. int rcpos=-1;
  8595. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  8596. if( (bb==0 && bSecondPage==0) )
  8597. {
  8598. m_Print.SetFontFace(25, 1, "宋体");
  8599. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8600. m_Print.SetFontFace(15, 1, "宋体");
  8601. StrRect=load.m_rcarray .ElementAt (++rcpos);
  8602. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8603. m_Print.SetFontFace(9, 1, "宋体");
  8604. }
  8605. //////////////////////////////////////////////////////////////
  8606. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2';id='"+strOrderNumber+"'";
  8607. g_sendhead.code[0]=54;
  8608. g_sendhead.code[1]=223;
  8609. g_sendhead.code[2]=52;
  8610. g_sendhead.tabcount=3;
  8611. g_sendhead.bsql=0;
  8612. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  8613. CArray<CStringArray, CStringArray>sparray;
  8614. CArray<CStringArray, CStringArray>clientarray;
  8615. DataToArray(&g_List1array,&sparray,&clientarray);
  8616. CString spno;
  8617. CStringArray sparray2;
  8618. int i = 0;
  8619. for( i=0; i<sparray.GetSize (); i++)
  8620. {
  8621. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8622. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  8623. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8624. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8625. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8626. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  8627. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8628. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8629. }
  8630. for( i=0; i<sparray.GetSize (); i++)
  8631. {
  8632. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  8633. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  8634. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  8635. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8636. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8637. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  8638. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8639. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8640. }
  8641. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  8642. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  8643. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  8644. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  8645. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  8646. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  8647. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  8648. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  8649. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  8650. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  8651. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  8652. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  8653. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  8654. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  8655. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  8656. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  8657. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  8658. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  8659. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  8660. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  8661. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  8662. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  8663. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  8664. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  8665. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  8666. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  8667. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  8668. CString m_sum3;
  8669. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  8670. ::ConvertToPrice (m_sum3);
  8671. if(m_money3.IsEmpty ())m_money3="0";
  8672. int dty=0;
  8673. CString name;
  8674. if(!m_name1.IsEmpty ())
  8675. name=m_name1+",";
  8676. name+=m_name2;
  8677. name.TrimRight (",");
  8678. CString phone;
  8679. if(!m_phone1.IsEmpty ())
  8680. phone=m_phone1+",";
  8681. phone+=m_phone2;phone.TrimRight (",");
  8682. if(IsHasRights2new(31)==0)
  8683. phone="***";
  8684. CStringArray strarray;
  8685. CArray<CRect,CRect>rcarray;
  8686. CStringArray strarray2; CArray<CRect,CRect>rc2array;
  8687. int bottom;
  8688. if( (bb==0 && bSecondPage==0) )
  8689. {
  8690. #ifdef CHILD_VERSION
  8691. if(m_birthday.IsEmpty ())
  8692. strarray.Add ("姓名/性别");
  8693. else
  8694. strarray.Add ("姓名/性别/年龄");
  8695. #else
  8696. strarray.Add ("客人姓名");
  8697. #endif
  8698. strarray.Add ("电话");
  8699. strarray.Add ("单号");
  8700. strarray.Add ("套系");
  8701. strarray.Add ("选样");
  8702. strarray.Add ("余款/加挑");
  8703. strarray.Add ("选片/日期");
  8704. #ifdef CHILD_VERSION
  8705. if(m_birthday.IsEmpty ())
  8706. strarray.Add (name+"/"+m_sex);
  8707. else
  8708. {
  8709. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  8710. m_birthday.Format ("%d", year+1);
  8711. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  8712. }
  8713. #else
  8714. strarray.Add (name);
  8715. #endif
  8716. strarray.Add (phone);
  8717. strarray.Add (strOrderNumber);
  8718. strarray.Add (m_taoxiname);
  8719. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8720. strarray.Add (str);
  8721. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  8722. strarray.Add (str);
  8723. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  8724. for( i=3; i<=16; i++)
  8725. {
  8726. StrRect=load.m_rcarray .ElementAt (i-1);
  8727. if(i<10)
  8728. {
  8729. m_Print.DrawRect2(StrRect, 1);
  8730. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8731. }
  8732. }
  8733. StrRect=load.m_rcarray .ElementAt (29);
  8734. m_Print.DrawRect2(StrRect, 1);
  8735. BOOL bPrintDate=1;
  8736. #ifdef DDF_VERSION
  8737. // bPrintDate=0;
  8738. #else
  8739. if(m_time5=="" && m_time6=="")
  8740. bPrintDate=0;
  8741. #endif
  8742. if(bPrintDate)
  8743. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8744. else
  8745. {
  8746. #ifdef CHILD_VERSION
  8747. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8748. #else
  8749. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8750. #endif
  8751. }
  8752. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8753. {
  8754. Image *pImg=NULL;
  8755. g_nSendCode=31;
  8756. int g_nYearposTemp=g_nYearpos;
  8757. g_nYearpos=-1;
  8758. g_pMainWnd->ProcessChatMessageRequest2(1);
  8759. g_nYearpos=g_nYearposTemp;
  8760. g_nSendCode=0;
  8761. if(g_bSendOK==0)return;
  8762. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  8763. if(pImg)
  8764. {
  8765. StrRect.left=485;
  8766. StrRect.top=12;
  8767. StrRect.right=StrRect.left+60;
  8768. StrRect.bottom=StrRect.top+60;
  8769. m_Print.DrawImage(pImg, StrRect);
  8770. delete pImg;pImg=NULL;
  8771. }
  8772. }
  8773. // CArray<CRect,CRect>rcarray;
  8774. // CStringArray strarray2;
  8775. for( i=10; i<=16; i++)
  8776. {
  8777. StrRect=load.m_rcarray .ElementAt (i-1);
  8778. StrRect.left +=2;
  8779. StrRect.right -=2;
  8780. StrRect.top +=2;
  8781. rcarray.Add (StrRect);
  8782. strarray2.Add (strarray.ElementAt (7+i-10));
  8783. }
  8784. if(1)
  8785. {
  8786. StrRect=load.m_rcarray .ElementAt (30);
  8787. StrRect.left +=2;
  8788. StrRect.right -=2;
  8789. StrRect.top +=2;
  8790. rcarray.Add (StrRect);
  8791. if(bPrintDate)
  8792. strarray2.Add (m_time6+"/"+m_time5);
  8793. else
  8794. {
  8795. strarray2.Add (m_waiter1+"/"+m_waiter2);
  8796. }
  8797. }
  8798. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8799. for( i=10; i<=16; i++)
  8800. {
  8801. StrRect=load.m_rcarray.ElementAt (i-1);
  8802. if(i==10)
  8803. {
  8804. dty+=bottom-StrRect.bottom;
  8805. }
  8806. StrRect.bottom =bottom;
  8807. m_Print.DrawRect2(StrRect, 1);
  8808. }
  8809. if(1)
  8810. {
  8811. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  8812. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  8813. }
  8814. m_Print.SetFontFace(15, 1, "宋体");
  8815. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  8816. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8817. }
  8818. int curypos=0;
  8819. int oldpos=0;
  8820. if(bb==1)
  8821. {
  8822. dty=-100;
  8823. oldpos=nPrintedPos;
  8824. if(oldpos==0)oldpos=10000;
  8825. }
  8826. m_Print.SetFontFace(9, 1, "宋体");
  8827. strarray.RemoveAll ();
  8828. if((oldpos!=10000&&oldpos<sparray2.GetSize ()) || bb==0)
  8829. {
  8830. strarray.Add ("产品名称");
  8831. strarray.Add ("数量");
  8832. strarray.Add ("照片编号");
  8833. for( i=18; i<=20; i++)
  8834. {
  8835. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  8836. m_Print.DrawRect2(StrRect, 1);
  8837. StrRect.left +=2;
  8838. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8839. StrRect.left -=2;
  8840. StrRect.top =StrRect.bottom ;
  8841. StrRect.bottom +=18;
  8842. rc2array.Add (StrRect);
  8843. }
  8844. }
  8845. for(i=oldpos; i<sparray2.GetSize (); i+=3)
  8846. {
  8847. rcarray.RemoveAll ();
  8848. strarray2.RemoveAll ();
  8849. int j = 0;
  8850. for( j=0; j<3; j++)
  8851. {
  8852. StrRect=rc2array.ElementAt (j);
  8853. StrRect.left +=2;
  8854. StrRect.right -=2;
  8855. StrRect.top +=2;
  8856. rcarray.Add (StrRect);
  8857. strarray2.Add (sparray2.ElementAt (i+j));
  8858. }
  8859. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8860. rcarray.RemoveAll ();
  8861. for( j=0; j<3; j++)
  8862. {
  8863. StrRect=rc2array.ElementAt (j);
  8864. if(j==0)
  8865. {
  8866. dty+=bottom-StrRect.bottom;
  8867. }
  8868. StrRect.bottom =bottom;
  8869. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8870. StrRect.top =StrRect.bottom ;
  8871. StrRect.bottom +=18;
  8872. rcarray.Add (StrRect);
  8873. }
  8874. rc2array.RemoveAll ();
  8875. rc2array.Copy(rcarray);
  8876. if(bottom>750)
  8877. {
  8878. bSecondPage=1;
  8879. nPrintedPos=i+3;
  8880. break;
  8881. }
  8882. }
  8883. if( (bb==0 && bSecondPage==0) || (bb==1 && bSecondPage==1) )
  8884. {
  8885. m_Print.SetFontFace(15, 1, "宋体");
  8886. StrRect=load.m_rcarray .ElementAt (20);
  8887. dty=curypos-StrRect.bottom+35;
  8888. StrRect.top +=dty;StrRect.bottom +=dty;
  8889. if(StrRect.bottom>700 && bb==0)
  8890. {
  8891. bSecondPage=1;
  8892. }
  8893. else
  8894. {
  8895. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8896. m_Print.SetFontFace(9, 1, "宋体");
  8897. rcarray.RemoveAll ();
  8898. strarray2.RemoveAll ();
  8899. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8900. StrRect.left +=2;
  8901. StrRect.right -=2;
  8902. StrRect.top +=2;
  8903. rcarray.Add (StrRect);
  8904. strarray2.Add (m_bz);
  8905. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8906. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8907. dty+=bottom-StrRect.bottom;
  8908. StrRect.bottom =bottom;
  8909. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8910. m_Print.SetFontFace(10, 1, "宋体");
  8911. StrRect=load.m_rcarray .ElementAt (22);
  8912. dty=curypos-StrRect.bottom+25;
  8913. StrRect.top +=dty;StrRect.bottom +=dty;
  8914. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  8915. if(m_edit9.IsEmpty())
  8916. {
  8917. m_edit9="\
  8918. 经确认后的照片均排入制作流程,\r\n\
  8919. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8920. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8921. }
  8922. CString info1,info2,info3;
  8923. int newlinepos=m_edit9.Find("\r\n");
  8924. if(newlinepos!=-1)
  8925. {
  8926. info1=m_edit9.Left(newlinepos);
  8927. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8928. }
  8929. newlinepos=m_edit9.Find("\r\n");
  8930. if(newlinepos!=-1)
  8931. {
  8932. info2=m_edit9.Left(newlinepos);
  8933. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8934. info3=m_edit9;
  8935. }
  8936. #ifdef QCH_VERSION
  8937. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8938. StrRect=load.m_rcarray .ElementAt (23);
  8939. StrRect.top +=dty;StrRect.bottom +=dty;
  8940. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8941. StrRect=load.m_rcarray .ElementAt (24);
  8942. StrRect.top +=dty;StrRect.bottom +=dty;
  8943. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8944. StrRect.top +=15;
  8945. StrRect.bottom +=15;
  8946. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8947. #else
  8948. if(1)
  8949. {
  8950. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8951. StrRect=load.m_rcarray .ElementAt (23);
  8952. StrRect.top +=dty;StrRect.bottom +=dty;
  8953. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8954. StrRect=load.m_rcarray .ElementAt (24);
  8955. StrRect.top +=dty;StrRect.bottom +=dty;
  8956. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8957. }
  8958. else
  8959. {
  8960. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8961. StrRect=load.m_rcarray .ElementAt (23);
  8962. StrRect.top +=dty;StrRect.bottom +=dty;
  8963. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8964. StrRect=load.m_rcarray .ElementAt (24);
  8965. StrRect.top +=dty;StrRect.bottom +=dty;
  8966. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8967. }
  8968. StrRect.top +=15;
  8969. StrRect.bottom +=15;
  8970. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8971. #endif
  8972. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  8973. StrRect=load.m_rcarray .ElementAt (25);
  8974. StrRect.top +=dty-dy;
  8975. StrRect.bottom +=dty-dy;
  8976. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8977. StrRect=load.m_rcarray .ElementAt (26);
  8978. StrRect.top +=dty-dy;
  8979. StrRect.bottom +=dty-dy;
  8980. m_Print.DrawRect2(StrRect, 2);
  8981. StrRect=load.m_rcarray .ElementAt (25);
  8982. StrRect.top +=dty+15-dy;
  8983. StrRect.bottom +=dty+15-dy;
  8984. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8985. StrRect=load.m_rcarray .ElementAt (26);
  8986. StrRect.top +=dty+15-dy;
  8987. StrRect.bottom +=dty+15-dy;
  8988. m_Print.DrawRect2(StrRect, 2);
  8989. StrRect=load.m_rcarray .ElementAt (25);
  8990. StrRect.top +=dty+15*2-dy;
  8991. StrRect.bottom +=dty+15*2-dy;
  8992. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8993. StrRect=load.m_rcarray .ElementAt (26);
  8994. StrRect.top +=dty+15*2-dy;
  8995. StrRect.bottom +=dty+15*2-dy;
  8996. m_Print.DrawRect2(StrRect, 2);
  8997. }
  8998. }
  8999. PrintPreview dlg;dlg.m_mode=2;
  9000. dlg.m_name =name;
  9001. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9002. dlg.m_pDC =m_Print.GetPDC() ;
  9003. if(aa==0)
  9004. {
  9005. if(dlg.DoModal ()!=IDOK)
  9006. return;
  9007. printcot=dlg.m_num;
  9008. }
  9009. //结束打印
  9010. m_Print.EndPage();
  9011. m_Print.EndPrint();
  9012. }
  9013. }
  9014. }
  9015. /*
  9016. void CMainFrame::PrintFlowChart3(CString m_id)
  9017. {
  9018. #ifdef LKAY_VERSION
  9019. PrintFlowChart3LKAY(m_id);
  9020. return;
  9021. #endif
  9022. int printcot=1;
  9023. for(int aa=0; aa<printcot; aa++)
  9024. {
  9025. CPrintRX m_Print;
  9026. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9027. {
  9028. m_Print.InitToPrint(NULL, 1);
  9029. }
  9030. else
  9031. {
  9032. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  9033. if(name.IsEmpty ())
  9034. m_Print.InitToPrint(NULL, 1);
  9035. else
  9036. {
  9037. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9038. if(nret==-1 && aa==0)
  9039. {
  9040. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9041. }
  9042. }
  9043. }
  9044. m_Print.StartPrint();
  9045. m_Print.StartPage();
  9046. LoadRect load;
  9047. load.SetLiaPath ("18.lia");
  9048. load.SetMargins(10,0);
  9049. if(!load.Load ())return;
  9050. CString str;
  9051. int rcpos=-1;
  9052. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9053. m_Print.SetFontFace(25, 1, "宋体");
  9054. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9055. m_Print.SetFontFace(15, 1, "宋体");
  9056. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9057. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9058. m_Print.SetFontFace(9, 1, "宋体");
  9059. //////////////////////////////////////////////////////////////
  9060. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9061. g_sendhead.code[0]=54;
  9062. g_sendhead.code[1]=50;
  9063. g_sendhead.code[2]=52;
  9064. g_sendhead.tabcount=3;
  9065. g_sendhead.bsql=0;
  9066. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9067. CArray<CStringArray, CStringArray>sparray;
  9068. CArray<CStringArray, CStringArray>clientarray;
  9069. DataToArray(&g_List1array,&sparray,&clientarray);
  9070. CString spno;
  9071. CStringArray sparray2;
  9072. for(int i=0; i<sparray.GetSize (); i++)
  9073. {
  9074. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9075. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9076. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9077. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9078. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9079. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9080. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9081. }
  9082. for( i=0; i<sparray.GetSize (); i++)
  9083. {
  9084. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9085. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9086. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9087. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9088. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9089. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9090. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9091. }
  9092. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9093. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9094. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9095. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9096. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9097. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9098. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9099. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9100. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9101. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9102. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9103. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9104. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9105. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9106. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9107. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9108. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9109. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9110. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  9111. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  9112. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9113. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9114. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9115. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9116. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9117. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9118. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9119. CString m_sum3;
  9120. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9121. ::ConvertToPrice (m_sum3);
  9122. if(m_money3.IsEmpty ())m_money3="0";
  9123. int dty=0;
  9124. CString name;
  9125. if(!m_name1.IsEmpty ())
  9126. name=m_name1+",";
  9127. name+=m_name2;
  9128. name.TrimRight (",");
  9129. CString phone;
  9130. if(!m_phone1.IsEmpty ())
  9131. phone=m_phone1+",";
  9132. phone+=m_phone2;phone.TrimRight (",");
  9133. if(IsHasRights2new(31)==0)
  9134. phone="***";
  9135. CStringArray strarray;
  9136. #ifdef CHILD_VERSION
  9137. if(m_birthday.IsEmpty ())
  9138. strarray.Add ("姓名/性别");
  9139. else
  9140. strarray.Add ("姓名/性别/年龄");
  9141. #else
  9142. strarray.Add ("客人姓名");
  9143. #endif
  9144. strarray.Add ("电话");
  9145. strarray.Add ("单号");
  9146. strarray.Add ("套系");
  9147. strarray.Add ("选样");
  9148. strarray.Add ("余款/加挑");
  9149. strarray.Add ("选片/日期");
  9150. #ifdef CHILD_VERSION
  9151. if(m_birthday.IsEmpty ())
  9152. strarray.Add (name+"/"+m_sex);
  9153. else
  9154. {
  9155. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9156. m_birthday.Format ("%d", year+1);
  9157. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9158. }
  9159. #else
  9160. strarray.Add (name);
  9161. #endif
  9162. strarray.Add (phone);
  9163. strarray.Add (m_id);
  9164. strarray.Add (m_taoxiname);
  9165. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9166. strarray.Add (str);
  9167. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9168. strarray.Add (str);
  9169. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  9170. for( i=3; i<=16; i++)
  9171. {
  9172. StrRect=load.m_rcarray .ElementAt (i-1);
  9173. if(i<10)
  9174. {
  9175. m_Print.DrawRect2(StrRect, 1);
  9176. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9177. }
  9178. }
  9179. StrRect=load.m_rcarray .ElementAt (29);
  9180. m_Print.DrawRect2(StrRect, 1);
  9181. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9182. CArray<CRect,CRect>rcarray;
  9183. CStringArray strarray2;
  9184. for( i=10; i<=16; i++)
  9185. {
  9186. StrRect=load.m_rcarray .ElementAt (i-1);
  9187. StrRect.left +=2;
  9188. StrRect.right -=2;
  9189. StrRect.top +=2;
  9190. rcarray.Add (StrRect);
  9191. strarray2.Add (strarray.ElementAt (7+i-10));
  9192. }
  9193. if(1)
  9194. {
  9195. StrRect=load.m_rcarray .ElementAt (30);
  9196. StrRect.left +=2;
  9197. StrRect.right -=2;
  9198. StrRect.top +=2;
  9199. rcarray.Add (StrRect);
  9200. strarray2.Add (m_time6+"/"+m_time5);
  9201. }
  9202. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9203. for( i=10; i<=16; i++)
  9204. {
  9205. StrRect=load.m_rcarray .ElementAt (i-1);
  9206. if(i==10)
  9207. {
  9208. dty+=bottom-StrRect.bottom;
  9209. }
  9210. StrRect.bottom =bottom;
  9211. m_Print.DrawRect2(StrRect, 1);
  9212. }
  9213. if(1)
  9214. {
  9215. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9216. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9217. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  9218. }
  9219. m_Print.SetFontFace(15, 1, "宋体");
  9220. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9221. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9222. m_Print.SetFontFace(9, 1, "宋体");
  9223. strarray.RemoveAll ();
  9224. strarray.Add ("产品名称");
  9225. strarray.Add ("数量");
  9226. strarray.Add ("照片编号");
  9227. CArray<CRect,CRect>rc2array;
  9228. for( i=18; i<=20; i++)
  9229. {
  9230. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9231. m_Print.DrawRect2(StrRect, 1);
  9232. StrRect.left +=2;
  9233. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9234. StrRect.left -=2;
  9235. StrRect.top =StrRect.bottom ;
  9236. StrRect.bottom +=18;
  9237. rc2array.Add (StrRect);
  9238. }
  9239. int curypos=0;
  9240. for(i=0; i<sparray2.GetSize (); i+=3)
  9241. {
  9242. rcarray.RemoveAll ();
  9243. strarray2.RemoveAll ();
  9244. for(int j=0; j<3; j++)
  9245. {
  9246. StrRect=rc2array.ElementAt (j);
  9247. StrRect.left +=2;
  9248. StrRect.right -=2;
  9249. StrRect.top +=2;
  9250. rcarray.Add (StrRect);
  9251. strarray2.Add (sparray2.ElementAt (i+j));
  9252. }
  9253. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9254. rcarray.RemoveAll ();
  9255. for( j=0; j<3; j++)
  9256. {
  9257. StrRect=rc2array.ElementAt (j);
  9258. if(j==0)
  9259. {
  9260. dty+=bottom-StrRect.bottom;
  9261. }
  9262. StrRect.bottom =bottom;
  9263. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9264. StrRect.top =StrRect.bottom ;
  9265. StrRect.bottom +=18;
  9266. rcarray.Add (StrRect);
  9267. }
  9268. rc2array.RemoveAll ();
  9269. rc2array.Copy(rcarray);
  9270. }
  9271. m_Print.SetFontFace(15, 1, "宋体");
  9272. StrRect=load.m_rcarray .ElementAt (20);
  9273. dty=curypos-StrRect.bottom+35;
  9274. StrRect.top +=dty;StrRect.bottom +=dty;
  9275. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9276. m_Print.SetFontFace(9, 1, "宋体");
  9277. rcarray.RemoveAll ();
  9278. strarray2.RemoveAll ();
  9279. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9280. StrRect.left +=2;
  9281. StrRect.right -=2;
  9282. StrRect.top +=2;
  9283. rcarray.Add (StrRect);
  9284. strarray2.Add (m_bz);
  9285. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9286. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9287. dty+=bottom-StrRect.bottom;
  9288. StrRect.bottom =bottom;
  9289. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9290. m_Print.SetFontFace(10, 1, "宋体");
  9291. StrRect=load.m_rcarray .ElementAt (22);
  9292. dty=curypos-StrRect.bottom+25;
  9293. StrRect.top +=dty;StrRect.bottom +=dty;
  9294. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9295. if(m_edit9.IsEmpty())
  9296. {
  9297. m_edit9="\
  9298. 经确认后的照片均排入制作流程,\r\n\
  9299. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9300. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9301. }
  9302. CString info1,info2,info3;
  9303. int newlinepos=m_edit9.Find("\r\n");
  9304. if(newlinepos!=-1)
  9305. {
  9306. info1=m_edit9.Left(newlinepos);
  9307. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9308. }
  9309. newlinepos=m_edit9.Find("\r\n");
  9310. if(newlinepos!=-1)
  9311. {
  9312. info2=m_edit9.Left(newlinepos);
  9313. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9314. info3=m_edit9;
  9315. }
  9316. #ifdef QCH_VERSION
  9317. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9318. StrRect=load.m_rcarray .ElementAt (23);
  9319. StrRect.top +=dty;StrRect.bottom +=dty;
  9320. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9321. StrRect=load.m_rcarray .ElementAt (24);
  9322. StrRect.top +=dty;StrRect.bottom +=dty;
  9323. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9324. StrRect.top +=15;
  9325. StrRect.bottom +=15;
  9326. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9327. #else
  9328. if(1)
  9329. {
  9330. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9331. StrRect=load.m_rcarray .ElementAt (23);
  9332. StrRect.top +=dty;StrRect.bottom +=dty;
  9333. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9334. StrRect=load.m_rcarray .ElementAt (24);
  9335. StrRect.top +=dty;StrRect.bottom +=dty;
  9336. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9337. }
  9338. else
  9339. {
  9340. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9341. StrRect=load.m_rcarray .ElementAt (23);
  9342. StrRect.top +=dty;StrRect.bottom +=dty;
  9343. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9344. StrRect=load.m_rcarray .ElementAt (24);
  9345. StrRect.top +=dty;StrRect.bottom +=dty;
  9346. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9347. }
  9348. StrRect.top +=15;
  9349. StrRect.bottom +=15;
  9350. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9351. #endif
  9352. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  9353. StrRect=load.m_rcarray .ElementAt (25);
  9354. StrRect.top +=dty-dy;
  9355. StrRect.bottom +=dty-dy;
  9356. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9357. StrRect=load.m_rcarray .ElementAt (26);
  9358. StrRect.top +=dty-dy;
  9359. StrRect.bottom +=dty-dy;
  9360. m_Print.DrawRect2(StrRect, 2);
  9361. StrRect=load.m_rcarray .ElementAt (25);
  9362. StrRect.top +=dty+15-dy;
  9363. StrRect.bottom +=dty+15-dy;
  9364. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9365. StrRect=load.m_rcarray .ElementAt (26);
  9366. StrRect.top +=dty+15-dy;
  9367. StrRect.bottom +=dty+15-dy;
  9368. m_Print.DrawRect2(StrRect, 2);
  9369. StrRect=load.m_rcarray .ElementAt (25);
  9370. StrRect.top +=dty+15*2-dy;
  9371. StrRect.bottom +=dty+15*2-dy;
  9372. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9373. StrRect=load.m_rcarray .ElementAt (26);
  9374. StrRect.top +=dty+15*2-dy;
  9375. StrRect.bottom +=dty+15*2-dy;
  9376. m_Print.DrawRect2(StrRect, 2);
  9377. PrintPreview dlg;dlg.m_mode=2;
  9378. dlg.m_name =name;
  9379. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9380. dlg.m_pDC =m_Print.GetPDC() ;
  9381. if(aa==0)
  9382. {
  9383. if(dlg.DoModal ()!=IDOK)
  9384. return;
  9385. printcot=dlg.m_num;
  9386. }
  9387. //结束打印
  9388. m_Print.EndPage();
  9389. m_Print.EndPrint();
  9390. }
  9391. }
  9392. */
  9393. void CMainFrame::PrintFlowChart4(CString m_id)
  9394. {
  9395. int printcot=1;
  9396. for(int aa=0; aa<printcot; aa++)
  9397. {
  9398. CPrintRX m_Print;
  9399. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9400. {
  9401. m_Print.InitToPrint(NULL, 1);
  9402. }
  9403. else
  9404. {
  9405. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  9406. if(name.IsEmpty ())
  9407. m_Print.InitToPrint(NULL, 1);
  9408. else
  9409. {
  9410. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9411. if(nret==-1 && aa==0)
  9412. {
  9413. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9414. }
  9415. }
  9416. }
  9417. m_Print.StartPrint();
  9418. m_Print.StartPage();
  9419. LoadRect load;
  9420. load.SetLiaPath ("18.lia");
  9421. load.SetMargins(10,0);
  9422. if(!load.Load ())return;
  9423. CString str;
  9424. int rcpos=-1;
  9425. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9426. m_Print.SetFontFace(25, 1, "宋体");
  9427. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9428. m_Print.SetFontFace(15, 1, "宋体");
  9429. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9430. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9431. m_Print.SetFontFace(9, 1, "宋体");
  9432. //////////////////////////////////////////////////////////////
  9433. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9434. g_sendhead.code[0]=54;
  9435. g_sendhead.code[1]=223;
  9436. g_sendhead.code[2]=52;
  9437. g_sendhead.tabcount=3;
  9438. g_sendhead.bsql=0;
  9439. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9440. CArray<CStringArray, CStringArray>sparray;
  9441. CArray<CStringArray, CStringArray>clientarray;
  9442. DataToArray(&g_List1array,&sparray,&clientarray);
  9443. CString spno;
  9444. CStringArray sparray2;
  9445. int i = 0;
  9446. for( i=0; i<sparray.GetSize (); i++)
  9447. {
  9448. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9449. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (8).IsEmpty ())continue;
  9450. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9451. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  9452. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9453. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9454. sparray2.Add (sparray.ElementAt (i).ElementAt (8));
  9455. }
  9456. for( i=0; i<sparray.GetSize (); i++)
  9457. {
  9458. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9459. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9460. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9461. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9462. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  9463. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9464. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9465. sparray2.Add (sparray.ElementAt (i).ElementAt (8));
  9466. }
  9467. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9468. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9469. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9470. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9471. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9472. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9473. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9474. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9475. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9476. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9477. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9478. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9479. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9480. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9481. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9482. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9483. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9484. CString m_bz =g_List1array.ElementAt (0).ElementAt (17);
  9485. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (25);
  9486. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9487. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9488. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9489. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9490. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9491. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9492. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9493. CString m_waiter8 = g_List1array.ElementAt (0).ElementAt (27);
  9494. CString m_replace=g_List1array.ElementAt (0).ElementAt (28);
  9495. if(!m_replace.IsEmpty ())
  9496. {
  9497. m_replace="设计替换照片:"+m_replace;
  9498. m_replace.Replace ("$", ";");
  9499. m_replace.TrimLeft (";");
  9500. m_bz+=";";
  9501. m_bz+=m_replace;
  9502. }
  9503. CString m_sum3;
  9504. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9505. ::ConvertToPrice (m_sum3);
  9506. if(m_money3.IsEmpty ())m_money3="0";
  9507. int dty=0;
  9508. CString name;
  9509. if(!m_name1.IsEmpty ())
  9510. name=m_name1+",";
  9511. name+=m_name2;
  9512. name.TrimRight (",");
  9513. CString phone;
  9514. if(!m_phone1.IsEmpty ())
  9515. phone=m_phone1+",";
  9516. phone+=m_phone2;phone.TrimRight (",");
  9517. if(IsHasRights2new(31)==0)
  9518. phone="***";
  9519. CStringArray strarray;
  9520. #ifdef CHILD_VERSION
  9521. if(m_birthday.IsEmpty ())
  9522. strarray.Add ("姓名/性别");
  9523. else
  9524. strarray.Add ("姓名/性别/年龄");
  9525. #else
  9526. strarray.Add ("客人姓名");
  9527. #endif
  9528. strarray.Add ("电话");
  9529. strarray.Add ("单号");
  9530. strarray.Add ("套系");
  9531. strarray.Add ("");
  9532. strarray.Add ("余款/加挑");
  9533. strarray.Add ("看设计/日期");
  9534. #ifdef CHILD_VERSION
  9535. if(m_birthday.IsEmpty ())
  9536. strarray.Add (name+"/"+m_sex);
  9537. else
  9538. {
  9539. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9540. m_birthday.Format ("%d", year+1);
  9541. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9542. }
  9543. #else
  9544. strarray.Add (name);
  9545. #endif
  9546. strarray.Add (phone);
  9547. strarray.Add (m_id);
  9548. strarray.Add (m_taoxiname);
  9549. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9550. strarray.Add ("");
  9551. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9552. strarray.Add (str);
  9553. strarray.Add (m_waiter8+"/"+m_time6);
  9554. //////////////////////////////////////////////
  9555. if(1)
  9556. {
  9557. StrRect=load.m_rcarray .ElementAt (6);
  9558. int addwid=StrRect.Width ()/6;
  9559. for( i=3; i<=6; i++)
  9560. {
  9561. StrRect=load.m_rcarray .ElementAt (i-1);
  9562. StrRect.left +=(i-3)*addwid;
  9563. StrRect.right +=(i-2)*addwid;
  9564. load.m_rcarray.SetAt (i-1, StrRect);
  9565. }
  9566. StrRect.left =StrRect.right =-1;
  9567. load.m_rcarray.SetAt (6, StrRect);
  9568. for( i=10; i<=13; i++)
  9569. {
  9570. StrRect=load.m_rcarray .ElementAt (i-1);
  9571. StrRect.left +=(i-10)*addwid;
  9572. StrRect.right +=(i-9)*addwid;
  9573. load.m_rcarray.SetAt (i-1, StrRect);
  9574. }
  9575. StrRect.left =StrRect.right =-1;
  9576. load.m_rcarray.SetAt (13, StrRect);
  9577. StrRect=load.m_rcarray .ElementAt (7);
  9578. int rcwid=StrRect.Width ();
  9579. StrRect.left =load.m_rcarray .ElementAt (5).right ;
  9580. StrRect.right =StrRect.left +rcwid+addwid;
  9581. load.m_rcarray.SetAt (7, StrRect);
  9582. StrRect=load.m_rcarray .ElementAt (8);
  9583. StrRect.left =load.m_rcarray .ElementAt (7).right ;
  9584. StrRect.right =load.m_rcarray .ElementAt (29).left ;
  9585. load.m_rcarray.SetAt (8, StrRect);
  9586. StrRect=load.m_rcarray .ElementAt (14);
  9587. rcwid=StrRect.Width ();
  9588. StrRect.left =load.m_rcarray .ElementAt (12).right ;
  9589. StrRect.right =StrRect.left +rcwid+addwid;
  9590. load.m_rcarray.SetAt (14, StrRect);
  9591. StrRect=load.m_rcarray .ElementAt (15);
  9592. StrRect.left =load.m_rcarray .ElementAt (14).right ;
  9593. StrRect.right =load.m_rcarray .ElementAt (29).left ;
  9594. load.m_rcarray.SetAt (15, StrRect);
  9595. }
  9596. ////////////////////////////////////////////////
  9597. for( i=3; i<=16; i++)
  9598. {
  9599. StrRect=load.m_rcarray .ElementAt (i-1);
  9600. if(i<10)
  9601. {
  9602. m_Print.DrawRect2(StrRect, 1);
  9603. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9604. }
  9605. }
  9606. StrRect=load.m_rcarray .ElementAt (29);
  9607. m_Print.DrawRect2(StrRect, 1);
  9608. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9609. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  9610. {
  9611. Image *pImg=NULL;
  9612. g_nSendCode=31;
  9613. int g_nYearposTemp=g_nYearpos;
  9614. g_nYearpos=-1;
  9615. g_pMainWnd->ProcessChatMessageRequest2(1);
  9616. g_nYearpos=g_nYearposTemp;
  9617. g_nSendCode=0;
  9618. if(g_bSendOK==0)return;
  9619. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  9620. if(pImg)
  9621. {
  9622. StrRect.left=485;
  9623. StrRect.top=12;
  9624. StrRect.right=StrRect.left+60;
  9625. StrRect.bottom=StrRect.top+60;
  9626. m_Print.DrawImage(pImg, StrRect);
  9627. delete pImg;pImg=NULL;
  9628. }
  9629. }
  9630. CArray<CRect,CRect>rcarray;
  9631. CStringArray strarray2;
  9632. for( i=10; i<=16; i++)
  9633. {
  9634. StrRect=load.m_rcarray .ElementAt (i-1);
  9635. StrRect.left +=2;
  9636. StrRect.right -=2;
  9637. StrRect.top +=2;
  9638. rcarray.Add (StrRect);
  9639. strarray2.Add (strarray.ElementAt (7+i-10));
  9640. }
  9641. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9642. for( i=10; i<=16; i++)
  9643. {
  9644. StrRect=load.m_rcarray .ElementAt (i-1);
  9645. if(i==10)
  9646. {
  9647. dty+=bottom-StrRect.bottom;
  9648. }
  9649. StrRect.bottom =bottom;
  9650. m_Print.DrawRect2(StrRect, 1);
  9651. }
  9652. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9653. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9654. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP );
  9655. m_Print.SetFontFace(15, 1, "宋体");
  9656. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9657. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9658. m_Print.SetFontFace(9, 1, "宋体");
  9659. strarray.RemoveAll ();
  9660. strarray.Add ("产品名称");
  9661. strarray.Add ("数量");
  9662. strarray.Add ("照片编号");
  9663. CArray<CRect,CRect>rc2array;
  9664. for( i=18; i<=20; i++)
  9665. {
  9666. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9667. m_Print.DrawRect2(StrRect, 1);
  9668. StrRect.left +=2;
  9669. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9670. StrRect.left -=2;
  9671. StrRect.top =StrRect.bottom ;
  9672. StrRect.bottom +=18;
  9673. rc2array.Add (StrRect);
  9674. }
  9675. int curypos=0;
  9676. for(i=0; i<sparray2.GetSize (); i+=3)
  9677. {
  9678. rcarray.RemoveAll ();
  9679. strarray2.RemoveAll ();
  9680. int j = 0;
  9681. for( j=0; j<3; j++)
  9682. {
  9683. StrRect=rc2array.ElementAt (j);
  9684. StrRect.left +=2;
  9685. StrRect.right -=2;
  9686. StrRect.top +=2;
  9687. rcarray.Add (StrRect);
  9688. strarray2.Add (sparray2.ElementAt (i+j));
  9689. }
  9690. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9691. rcarray.RemoveAll ();
  9692. for( j=0; j<3; j++)
  9693. {
  9694. StrRect=rc2array.ElementAt (j);
  9695. if(j==0)
  9696. {
  9697. dty+=bottom-StrRect.bottom;
  9698. }
  9699. StrRect.bottom =bottom;
  9700. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9701. StrRect.top =StrRect.bottom ;
  9702. StrRect.bottom +=18;
  9703. rcarray.Add (StrRect);
  9704. }
  9705. rc2array.RemoveAll ();
  9706. rc2array.Copy(rcarray);
  9707. }
  9708. m_Print.SetFontFace(15, 1, "宋体");
  9709. StrRect=load.m_rcarray .ElementAt (20);
  9710. dty=curypos-StrRect.bottom+35;
  9711. StrRect.top +=dty;StrRect.bottom +=dty;
  9712. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9713. m_Print.SetFontFace(9, 1, "宋体");
  9714. rcarray.RemoveAll ();
  9715. strarray2.RemoveAll ();
  9716. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9717. StrRect.left +=2;
  9718. StrRect.right -=2;
  9719. StrRect.top +=2;
  9720. rcarray.Add (StrRect);
  9721. strarray2.Add (m_bz);
  9722. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9723. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9724. dty+=bottom-StrRect.bottom;
  9725. StrRect.bottom =bottom;
  9726. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9727. m_Print.SetFontFace(10, 1, "宋体");
  9728. StrRect=load.m_rcarray .ElementAt (22);
  9729. dty=curypos-StrRect.bottom+25;
  9730. StrRect.top +=dty;StrRect.bottom +=dty;
  9731. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9732. if(m_edit9.IsEmpty())
  9733. {
  9734. m_edit9="\
  9735. 经确认后的照片均排入制作流程,\r\n\
  9736. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9737. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9738. }
  9739. CString info1,info2,info3;
  9740. int newlinepos=m_edit9.Find("\r\n");
  9741. if(newlinepos!=-1)
  9742. {
  9743. info1=m_edit9.Left(newlinepos);
  9744. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9745. }
  9746. newlinepos=m_edit9.Find("\r\n");
  9747. if(newlinepos!=-1)
  9748. {
  9749. info2=m_edit9.Left(newlinepos);
  9750. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9751. info3=m_edit9;
  9752. }
  9753. if(1)
  9754. {
  9755. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9756. StrRect=load.m_rcarray .ElementAt (23);
  9757. StrRect.top +=dty;StrRect.bottom +=dty;
  9758. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9759. StrRect=load.m_rcarray .ElementAt (24);
  9760. StrRect.top +=dty;StrRect.bottom +=dty;
  9761. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9762. }
  9763. else
  9764. {
  9765. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9766. StrRect=load.m_rcarray .ElementAt (23);
  9767. StrRect.top +=dty;StrRect.bottom +=dty;
  9768. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9769. StrRect=load.m_rcarray .ElementAt (24);
  9770. StrRect.top +=dty;StrRect.bottom +=dty;
  9771. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9772. }
  9773. StrRect=load.m_rcarray .ElementAt (25);
  9774. StrRect.top +=dty;StrRect.bottom +=dty;
  9775. m_Print.DrawText((LPTSTR)(LPCTSTR)"贵宾签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9776. StrRect=load.m_rcarray .ElementAt (26);
  9777. StrRect.top +=dty;StrRect.bottom +=dty;
  9778. m_Print.DrawRect2(StrRect, 2);
  9779. m_Print.SetFontFace(9, 1, "宋体");
  9780. StrRect=load.m_rcarray .ElementAt (27);
  9781. StrRect.top +=dty;StrRect.bottom +=dty;
  9782. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9783. StrRect=load.m_rcarray .ElementAt (28);
  9784. StrRect.top +=dty;StrRect.bottom +=dty;
  9785. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9786. PrintPreview dlg;//dlg.m_mode=2;
  9787. dlg.m_name =name;
  9788. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9789. dlg.m_pDC =m_Print.GetPDC() ;
  9790. if(aa==0)
  9791. {
  9792. if(dlg.DoModal ()!=IDOK)
  9793. return;
  9794. printcot=dlg.m_num;
  9795. }
  9796. //结束打印
  9797. m_Print.EndPage();
  9798. m_Print.EndPrint();
  9799. }
  9800. }
  9801. /*
  9802. void CMainFrame::PrintFlowChart(CString m_id)
  9803. {
  9804. CPrintRX m_Print;
  9805. m_Print.InitToPrint(NULL, 1);
  9806. m_Print.StartPrint();
  9807. m_Print.StartPage();
  9808. // CRect StrRect(0,0,560,818);
  9809. LoadRect load;
  9810. load.SetLiaPath ("4.lia");
  9811. load.SetMargins(-14,-14);
  9812. if(!load.Load ())return;
  9813. LoadRect load2;
  9814. load2.SetMargins(-14,472+27-14);
  9815. load2.SetLiaPath ("5.lia");
  9816. if(!load2.Load ())return;
  9817. //////////////////////////////////////////////////////////////
  9818. CString filter="id='"+m_id+"';id='"+m_id+"'";
  9819. g_sendhead.code[0]=54;
  9820. g_sendhead.code[1]=50;
  9821. g_sendhead.tabcount=2;
  9822. g_sendhead.bsql=0;
  9823. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9824. CArray<CStringArray, CStringArray>sparray;
  9825. DataToArray(&g_List1array,&sparray);
  9826. CString spno;
  9827. for(int i=0; i<sparray.GetSize (); i++)
  9828. {
  9829. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册")continue;
  9830. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9831. spno+=sparray.ElementAt (i).ElementAt (5);
  9832. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  9833. spno+=";";
  9834. else
  9835. {
  9836. spno+=":";
  9837. spno+=sparray.ElementAt (i).ElementAt (6);
  9838. spno+=";";
  9839. }
  9840. }
  9841. spno+=" 加挑:";
  9842. for( i=0; i<sparray.GetSize (); i++)
  9843. {
  9844. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9845. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9846. spno+=sparray.ElementAt (i).ElementAt (5);
  9847. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  9848. spno+=";";
  9849. else
  9850. {
  9851. spno+=":";
  9852. spno+=sparray.ElementAt (i).ElementAt (6);
  9853. spno+=";";
  9854. }
  9855. }
  9856. if(spno.Right (6)==" 加挑:")
  9857. {
  9858. spno=spno.Left (spno.GetLength ()-6);
  9859. }
  9860. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9861. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9862. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9863. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9864. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9865. if(m_urgent.IsEmpty ())m_urgent="否";
  9866. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9867. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9868. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9869. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9870. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9871. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9872. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9873. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9874. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9875. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9876. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9877. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17);
  9878. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9879. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9880. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9881. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9882. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9883. CString m_sum3;
  9884. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9885. ::ConvertToPrice (m_sum3);
  9886. if(m_money3.IsEmpty ())m_money3="0";
  9887. // m_money3=m_money3+"/"+m_sum3;
  9888. CString name;
  9889. if(!m_name1.IsEmpty ())
  9890. name=m_name1+",";
  9891. name+=m_name2;
  9892. name.TrimRight (",");
  9893. CString phone;
  9894. if(!m_phone1.IsEmpty ())
  9895. phone=m_phone1+",";
  9896. phone+=m_phone2;phone.TrimRight (",");
  9897. CStringArray strarray;
  9898. strarray.Add (m_urgent);
  9899. strarray.Add (m_ren);
  9900. strarray.Add (m_waiter3);
  9901. strarray.Add (name);
  9902. strarray.Add (m_time2);
  9903. strarray.Add (m_time4);
  9904. strarray.Add (m_time5);
  9905. strarray.Add (m_money3);
  9906. strarray.Add (m_takezs);
  9907. strarray.Add (m_taoxizs);
  9908. strarray.Add (m_choosezs);
  9909. strarray.Add (m_id);
  9910. strarray.Add (phone);
  9911. ////////////////////////////////////////////////////////////////
  9912. int rcpos=-1;
  9913. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9914. Image *pImg=NULL;
  9915. #ifdef MNLS_VERSION
  9916. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  9917. #else
  9918. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  9919. #endif
  9920. m_Print.DrawImage(pImg, StrRect);
  9921. delete pImg;
  9922. m_Print.SetFontFace(15, 1, "宋体");
  9923. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9924. #ifdef MNLS_VERSION
  9925. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9926. #endif
  9927. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9928. #ifdef MNLS_VERSION
  9929. m_Print.DrawRect(StrRect);
  9930. #endif
  9931. m_Print.SetFontFace(7, 1, "黑体");
  9932. m_Print.SetColor(0xffffff);
  9933. #ifdef MNLS_VERSION
  9934. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9935. #endif
  9936. m_Print.SetColor(0);
  9937. m_Print.SetFontFace(25, 1, "黑体");
  9938. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9939. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9940. CString title[13]={"是否加急:","接单门市:","选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","取件日期:","加挑/余款:","拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  9941. m_Print.SetFontFace(12, 1, "宋体");
  9942. for( i=0; i<13; i++)
  9943. {
  9944. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9945. if(i<3)
  9946. m_Print.DrawRect2(StrRect, 0);
  9947. else
  9948. m_Print.DrawRect2(StrRect, 1);
  9949. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9950. }
  9951. for( i=18; i<=37; i++)
  9952. {
  9953. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9954. if(i>=19&&i<=21)
  9955. m_Print.DrawRect2(StrRect, 2);
  9956. else if(i==26)
  9957. {
  9958. CRect rc=StrRect;
  9959. CRect rc2=rc;
  9960. rc.right -=rc2.Width ()/2;
  9961. m_Print.DrawRect2(rc, 1);
  9962. rc2.left +=rc.Width ();
  9963. m_Print.DrawRect2(rc2, 1);
  9964. }
  9965. else
  9966. m_Print.DrawRect2(StrRect, 1);
  9967. if(i==18)
  9968. {
  9969. StrRect.left +=5;
  9970. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9971. }
  9972. }
  9973. //////////////////////////////////////
  9974. rcpos=-1;
  9975. for( i=0; i<8; i++)
  9976. {
  9977. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9978. m_Print.DrawRect2(StrRect, 1);
  9979. }
  9980. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客签名:"};
  9981. for( i=0; i<4; i++)
  9982. {
  9983. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9984. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9985. }
  9986. for( i=0; i<4; i++)
  9987. {
  9988. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9989. m_Print.DrawRect2(StrRect, 2);
  9990. }
  9991. ///////////////////////////////////////////
  9992. for( i=19; i<=31; i++)
  9993. {
  9994. StrRect=load.m_rcarray .ElementAt (i-1);
  9995. StrRect.left +=4;
  9996. if(i==31)
  9997. {
  9998. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  9999. {
  10000. StrRect.top +=2;
  10001. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  10002. StrRect.top +=8;
  10003. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10004. }
  10005. else
  10006. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10007. }
  10008. else if((i-19)==7)
  10009. {
  10010. CRect rc=StrRect;
  10011. CRect rc2=rc;
  10012. rc.right -=rc2.Width ()/2;
  10013. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10014. rc2.left +=rc.Width ()+3;
  10015. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10016. }
  10017. else
  10018. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10019. }
  10020. strarray.RemoveAll ();
  10021. strarray.Add (m_waiter2);
  10022. strarray.Add (m_waiter1);
  10023. strarray.Add (m_waiter4);
  10024. for( i=13; i<=15; i++)
  10025. {
  10026. StrRect=load2.m_rcarray .ElementAt (i-1);
  10027. StrRect.left +=4;
  10028. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10029. }
  10030. ///////////spno
  10031. CRect sprc[14];
  10032. for(i=0; i<14; i++)
  10033. {
  10034. if(i<7)
  10035. {
  10036. if(i==0)
  10037. {
  10038. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  10039. }
  10040. else
  10041. {
  10042. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  10043. }
  10044. }
  10045. else
  10046. {
  10047. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  10048. }
  10049. sprc[i]=StrRect;
  10050. // m_Print.DrawText((LPTSTR)(LPCTSTR)"xxx", sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10051. }
  10052. CString temp,tempspno,tempbz;
  10053. CSize size;
  10054. BOOL bRun=0;
  10055. int fontsize=12;
  10056. ll: tempspno=spno;
  10057. tempbz=m_bz;
  10058. m_Print.SetFontFace(fontsize, 1, "宋体");
  10059. for( i=0; i<14; i++)
  10060. {
  10061. if(!tempspno.IsEmpty ())
  10062. {
  10063. temp=tempspno;
  10064. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10065. int right=0;
  10066. CRect temprc=sprc[i];
  10067. while(size.cx>temprc.Width ())
  10068. {
  10069. right++;
  10070. temp=tempspno.Left (tempspno.GetLength ()-(right));
  10071. if(GIsHalfHZ(temp))
  10072. {
  10073. right++;
  10074. temp.Delete (temp.GetLength ()-1);
  10075. }
  10076. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10077. }
  10078. if(bRun)
  10079. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10080. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  10081. if(tempspno.IsEmpty ())i++;
  10082. }
  10083. else if(!tempbz.IsEmpty ())
  10084. {
  10085. temp=tempbz;
  10086. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10087. int right=0;
  10088. CRect temprc=sprc[i];
  10089. while(size.cx>temprc.Width ())
  10090. {
  10091. right++;
  10092. temp=tempbz.Left (tempbz.GetLength ()-(right));
  10093. if(GIsHalfHZ(temp))
  10094. {
  10095. right++;
  10096. temp.Delete (temp.GetLength ()-1);
  10097. }
  10098. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10099. }
  10100. if(bRun)
  10101. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10102. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  10103. }
  10104. }
  10105. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  10106. {
  10107. fontsize--;
  10108. goto ll;
  10109. }
  10110. if(bRun==0)
  10111. {
  10112. bRun=1;
  10113. goto ll;
  10114. }
  10115. PrintPreview dlg;
  10116. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  10117. dlg.m_pDC =m_Print.GetPDC() ;
  10118. if(dlg.DoModal ()!=IDOK)return;
  10119. //结束打印
  10120. m_Print.EndPage();
  10121. m_Print.EndPrint();
  10122. }
  10123. void CMainFrame::SetSelFolder(int pos)
  10124. {
  10125. m_wndToolBar2.SetSelFolder(pos);
  10126. }*/
  10127. void CMainFrame::ToPhotoPrint()
  10128. {
  10129. UINT nID=1;
  10130. LPSTR pName ;
  10131. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  10132. OPEN_MENU(PhotoPrintFrom);
  10133. }
  10134. void CMainFrame::GetOcx()
  10135. {
  10136. char path[MAX_PATH];
  10137. ::GetSystemDirectory (path, MAX_PATH);
  10138. CString syspath=path;
  10139. try
  10140. {
  10141. if(!::PathFileExists (syspath+"\\MSCHRT20.OCX"))
  10142. {
  10143. g_sendhead.bsql=0;
  10144. g_sendhead.code[0]=103;
  10145. g_sendhead.tabcount=1;
  10146. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  10147. CFile fp;
  10148. if(fp.Open (syspath+"\\MSCHRT20.OCX", CFile::modeWrite|CFile::modeCreate))
  10149. {
  10150. fp.Write (g_pData, g_nLeng);
  10151. fp.Close ();
  10152. ::Sleep (1000);
  10153. }
  10154. }
  10155. CString temp;
  10156. temp.Format (_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10157. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10158. }
  10159. catch(...)
  10160. {
  10161. }
  10162. try
  10163. {
  10164. CString temp;
  10165. temp.Format (_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10166. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10167. }
  10168. catch(...)
  10169. {
  10170. }
  10171. }
  10172. void CMainFrame::OnServer()
  10173. {
  10174. // TODO: Add your command handler code here
  10175. DBConfig dlg;
  10176. dlg.DoModal ();
  10177. }
  10178. void CMainFrame::OnPath() // 远程访问设置;
  10179. {
  10180. // TODO: Add your command handler code here
  10181. if(g_user.bLongin==0)
  10182. {
  10183. if(g_bNoLoginLia)
  10184. {
  10185. Login dlg;
  10186. dlg.SetLiaPath ("5.lia");
  10187. dlg.DoModal();
  10188. }
  10189. else
  10190. {
  10191. Login3 dlg;
  10192. dlg.SetLiaPath ("5.lia");
  10193. dlg.DoModal();
  10194. }
  10195. if(g_user.bLongin==0)return;
  10196. }
  10197. if(IsHasRightsnew(49)==0)return;
  10198. SetPathDlg2 dlg;
  10199. dlg.DoModal ();
  10200. }
  10201. void CMainFrame::OnShowhis()
  10202. {
  10203. // TODO: Add your command handler code here
  10204. if(g_user.bLongin==0)
  10205. {
  10206. if(g_bNoLoginLia)
  10207. {
  10208. Login dlg;
  10209. dlg.SetLiaPath ("5.lia");
  10210. dlg.DoModal();
  10211. }
  10212. else
  10213. {
  10214. Login3 dlg;
  10215. dlg.SetLiaPath ("5.lia");
  10216. dlg.DoModal();
  10217. }
  10218. if(g_user.bLongin==0)return;
  10219. }
  10220. if(IsHasRightsnew(52)==0)return;
  10221. CMenu *pMenu=GetMenu();
  10222. CMenu* submenu = pMenu->GetSubMenu(2);
  10223. UINT status=submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND );
  10224. if(status&MF_CHECKED)
  10225. {
  10226. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_UNCHECKED);
  10227. g_bShowOK=1;
  10228. }
  10229. else
  10230. {
  10231. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  10232. g_bShowOK=0;
  10233. } m_Mdi.CloseAll();
  10234. }
  10235. void CMainFrame::AddHistoryMenu(CArray<CStringArray, CStringArray>*hisyeararray)
  10236. {
  10237. #ifdef NEW_SKIN
  10238. CMenu *m_menuXP=GetMenu();
  10239. CMenu* submenu = m_menuXP->GetSubMenu(2);
  10240. int i = 0;
  10241. for( i=0; i<100; i++)
  10242. {
  10243. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10244. }
  10245. for( i=0; i<hisyeararray->GetSize (); i++)
  10246. {
  10247. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10248. }
  10249. g_nYearpos=-1;
  10250. #else
  10251. HMENU hMenu=::GetMenu (m_hWnd);
  10252. m_menuXP.Attach (hMenu);
  10253. BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
  10254. for(int i=0; i<100; i++)
  10255. {
  10256. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10257. }
  10258. for( i=0; i<hisyeararray->GetSize (); i++)
  10259. {
  10260. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10261. }
  10262. m_menuXP.Detach ();
  10263. g_nYearpos=-1;
  10264. #endif
  10265. }
  10266. /************************************************************************/
  10267. /*
  10268. Jeff
  10269. 函数:AddBranchMenu()
  10270. 参数:CArray<CStringArray, CStringArray> *hisyeararray
  10271. 返回:void
  10272. 注意:
  10273. 调用关系:
  10274. */
  10275. /************************************************************************/
  10276. void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*hisyeararray)
  10277. {
  10278. //WriteClientLog("AddBranchMenu,添加集团版菜单");
  10279. #ifdef ENTERPRISE_VERSION
  10280. CMenu *m_menuXP=GetMenu();
  10281. CMenu* submenu = m_menuXP->GetSubMenu(0);
  10282. int i = 0;
  10283. for( i=0; i<100; i++)
  10284. {
  10285. submenu->DeleteMenu (2000+i, MF_BYCOMMAND);
  10286. }
  10287. g_menubranchname.RemoveAll ();
  10288. CString name;
  10289. int a=0;
  10290. #if 0 // Jeff.add for test
  10291. CString strCount;
  10292. strCount.Format("历史数据库个数=%d",hisyeararray->GetSize());
  10293. WriteClientLog(strCount);
  10294. #endif
  10295. for( i=0; i<hisyeararray->GetSize()-1; i++)
  10296. {
  10297. //WriteClientLog("111");
  10298. //WriteClientLog(hisyeararray->ElementAt(i).ElementAt(0));
  10299. //WriteClientLog(name);
  10300. if(name=="")
  10301. {
  10302. name=hisyeararray->ElementAt (i).ElementAt (0);
  10303. #ifndef SQLSERVER_VERSION
  10304. submenu->AppendMenu(MF_STRING, 2000+a, "查看分店数据:"+name+"(使用本机缓存,速度快)");
  10305. a++;
  10306. #endif
  10307. submenu->AppendMenu(MF_STRING, 2000+a, "操作分店数据:"+name+"(实时访问分店,需网络通畅)");
  10308. a++;
  10309. g_menubranchname.Add (name);
  10310. continue;
  10311. }
  10312. else if(hisyeararray->ElementAt (i).ElementAt (0).Find (name)!=-1 && ((hisyeararray->ElementAt (i).ElementAt (0).GetLength ()-name.GetLength ())==4) )
  10313. {
  10314. continue;
  10315. }
  10316. name=hisyeararray->ElementAt (i).ElementAt (0);
  10317. #ifndef SQLSERVER_VERSION
  10318. submenu->AppendMenu(MF_STRING, 2000+a, "查看分店数据:"+name+"(使用本机缓存,速度快)");
  10319. a++;
  10320. #endif
  10321. submenu->AppendMenu(MF_STRING, 2000+a, "操作分店数据:"+name+"(实时访问分店,需网络通畅)");
  10322. g_menubranchname.Add (name);
  10323. a++;
  10324. //WriteClientLog("222");
  10325. }
  10326. if((hisyeararray->GetSize()-1)>0)
  10327. {
  10328. if(hisyeararray->ElementAt (0).ElementAt (3)=="总店")
  10329. submenu->AppendMenu(MF_STRING, 2000+a, "多店数据汇总");
  10330. }
  10331. #endif
  10332. }
  10333. void CMainFrame::OnHistory(UINT nID)
  10334. {
  10335. CMenu *pMenu=GetMenu();
  10336. CMenu* submenu = pMenu->GetSubMenu(2);
  10337. UINT status=submenu->GetMenuState(nID, MF_BYCOMMAND );
  10338. if(g_user.bLongin==0)
  10339. {
  10340. if(g_bNoLoginLia)
  10341. {
  10342. Login dlg;
  10343. dlg.SetLiaPath ("5.lia");
  10344. dlg.DoModal();
  10345. }
  10346. else
  10347. {
  10348. Login3 dlg;
  10349. dlg.SetLiaPath ("5.lia");
  10350. dlg.DoModal();
  10351. }
  10352. if(g_user.bLongin==0)return;
  10353. }
  10354. if(IsHasRightsnew(52)==0)return;
  10355. m_Mdi.CloseAll();
  10356. for(int i=0; i<100; i++)
  10357. {
  10358. submenu-> CheckMenuItem(1000+i, MF_BYCOMMAND | MF_UNCHECKED);
  10359. }
  10360. if(status&MF_CHECKED)
  10361. {
  10362. g_nYearpos=-1;
  10363. status=submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND );
  10364. if(status&MF_CHECKED)
  10365. g_bShowOK=0;
  10366. else
  10367. g_bShowOK=1;
  10368. }
  10369. else
  10370. {
  10371. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10372. g_nYearpos=nID-1000;
  10373. g_bShowOK=1;
  10374. }
  10375. }
  10376. void CMainFrame::OnBranchData(UINT nID)
  10377. {
  10378. #ifdef ENTERPRISE_VERSION
  10379. #ifdef SQLSERVER_VERSION
  10380. OnBranchData2(nID);
  10381. return;
  10382. #endif
  10383. #endif
  10384. }
  10385. void CMainFrame::OnBranchData2(UINT nID)
  10386. {
  10387. #if 1
  10388. CString strMSG;
  10389. strMSG.Format("1登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10390. AfxMessageBox(strMSG);
  10391. #endif
  10392. #ifdef ENTERPRISE_VERSION
  10393. g_bAllBranch=0;
  10394. m_Mdi.CloseAll();
  10395. OnDisconnect();
  10396. CMenu *pMenu=GetMenu();
  10397. CMenu* submenu = pMenu->GetSubMenu(0);
  10398. UINT status=submenu->GetMenuState(nID, MF_BYCOMMAND );
  10399. for(int i=0; i<100; i++)
  10400. {
  10401. submenu-> CheckMenuItem(2000+i, MF_BYCOMMAND | MF_UNCHECKED);
  10402. }
  10403. if(status&MF_CHECKED) // 取消连接其他分店,回归本店连接;
  10404. {
  10405. AfxMessageBox("取消连接其他分店,回归本店连接");
  10406. g_branchname.Empty ();
  10407. g_branchip.Empty ();
  10408. g_bBranchModify=0;
  10409. g_user.bLongin=0;
  10410. if(g_bNoLoginLia)
  10411. {
  10412. Login dlg;
  10413. dlg.SetLiaPath ("5.lia");
  10414. dlg.DoModal();
  10415. }
  10416. else
  10417. {
  10418. Login3 dlg;
  10419. dlg.SetLiaPath ("5.lia");
  10420. dlg.DoModal();
  10421. }
  10422. g_pMainWnd2->RefreshOutlookBar();
  10423. g_pMainWnd2->DrawLogin();
  10424. g_path1=g_path1bak;
  10425. g_path2=g_path2bak;
  10426. g_path3=g_path3bak;
  10427. g_path4=g_path4bak;
  10428. g_path5=g_path5bak;
  10429. g_path6=g_path6bak;
  10430. g_path7=g_path7bak;
  10431. g_pMainWnd2->EnableBtns(1);
  10432. #if 1
  10433. strMSG.Format("2登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10434. AfxMessageBox(strMSG);
  10435. #endif
  10436. }
  10437. else // 连接其他分店;
  10438. {
  10439. AfxMessageBox("连接其他分店");
  10440. BOOL bNeedCheckRights=1;
  10441. if(g_user.bLongin && g_branchname=="")//无需登陆本店判断其访问分店权限
  10442. {
  10443. bNeedCheckRights=0;
  10444. }
  10445. #ifndef SQLSERVER_VERSION
  10446. if((g_menubranchname.GetSize()*2)==nID-2000)//多店数据汇总
  10447. #else
  10448. if((g_menubranchname.GetSize())==nID-2000)//多店数据汇总
  10449. #endif
  10450. {
  10451. AfxMessageBox("多店汇总");
  10452. g_branchname.Empty ();
  10453. g_branchip.Empty ();
  10454. g_bBranchModify=0;
  10455. if(bNeedCheckRights)
  10456. {
  10457. g_user.bLongin=0;
  10458. if(g_user.bLongin==0)
  10459. {
  10460. if(g_bNoLoginLia)
  10461. {
  10462. Login dlg;
  10463. dlg.SetLiaPath ("5.lia");
  10464. dlg.DoModal();
  10465. }
  10466. else
  10467. {
  10468. Login3 dlg;
  10469. dlg.SetLiaPath ("5.lia");
  10470. dlg.DoModal();
  10471. }
  10472. if(g_user.bLongin==0)return;
  10473. }
  10474. }
  10475. if(IsHasRightsnew(28)==0)
  10476. {
  10477. return;
  10478. }
  10479. g_bAllBranch=1; // 设置多店汇总标识为true;
  10480. g_pMainWnd2->ShowBar (0);
  10481. g_pMainWnd2->RefreshOutlookBar2();
  10482. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10483. g_branchname.Empty ();
  10484. g_branchip.Empty ();
  10485. g_bBranchModify=0;
  10486. g_pMainWnd2->DrawLogin();
  10487. g_pMainWnd2->EnableBtns(0);
  10488. g_path1=g_path1bak;
  10489. g_path2=g_path2bak;
  10490. g_path3=g_path3bak;
  10491. g_path4=g_path4bak;
  10492. g_path5=g_path5bak;
  10493. g_path6=g_path6bak;
  10494. g_path7=g_path7bak;
  10495. #if 1
  10496. strMSG.Format("3登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10497. AfxMessageBox(strMSG);
  10498. #endif
  10499. }
  10500. else
  10501. {
  10502. AfxMessageBox("非多店汇总");
  10503. if(bNeedCheckRights)
  10504. {
  10505. g_branchname.Empty ();
  10506. g_branchip.Empty ();
  10507. g_bBranchModify=0;
  10508. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
  10509. g_user.bLongin=0;
  10510. if(g_pMainWnd2)
  10511. {
  10512. g_pMainWnd2->DrawLogin();
  10513. g_pMainWnd2->ShowBar (0);
  10514. }
  10515. if(g_bNoLoginLia)
  10516. {
  10517. Login dlg;
  10518. dlg.SetLiaPath ("5.lia");
  10519. dlg.DoModal();
  10520. }
  10521. else
  10522. {
  10523. Login3 dlg;
  10524. dlg.SetLiaPath ("5.lia");
  10525. dlg.DoModal();
  10526. }
  10527. if(g_user.bLongin==0)return;
  10528. }
  10529. if(IsHasRightsnew(28)==0)
  10530. {
  10531. return;
  10532. }
  10533. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10534. #ifndef SQLSERVER_VERSION
  10535. if(nID%2==0)
  10536. g_branchname = g_menubranchname.ElementAt ((nID-2000)/2);
  10537. else
  10538. g_branchname = g_menubranchname.ElementAt ((nID-2001)/2);
  10539. #else
  10540. g_branchname=g_menubranchname.ElementAt(nID-2000);
  10541. #endif
  10542. g_branchip.Empty ();
  10543. CString domainname="";
  10544. for(int i=0; i<g_brancharray.GetSize(); i++)
  10545. {
  10546. if(g_branchname==g_brancharray.ElementAt (i).ElementAt (0))
  10547. {
  10548. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  10549. g_branchip2=g_brancharray.ElementAt (i).ElementAt (4);
  10550. domainname=g_brancharray.ElementAt (i).ElementAt (2);
  10551. }
  10552. }
  10553. g_path1=g_path1bak;
  10554. g_path2=g_path2bak;
  10555. g_path3=g_path3bak;
  10556. g_path4=g_path4bak;
  10557. g_path5=g_path5bak;
  10558. g_path6=g_path6bak;
  10559. g_path7=g_path7bak;
  10560. if(domainname.IsEmpty ())
  10561. {
  10562. g_path1=g_path2=g_path3=g_path4=g_path5=g_path6=g_path7="xxx";
  10563. }
  10564. else
  10565. {
  10566. g_path1+="\\"+domainname;
  10567. g_path2+="\\"+domainname;
  10568. g_path3+="\\"+domainname;
  10569. g_path4+="\\"+domainname;
  10570. g_path5+="\\"+domainname;
  10571. g_path6+="\\"+domainname;
  10572. g_path7+="\\"+domainname;
  10573. }
  10574. #if 1
  10575. strMSG.Format("2登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10576. AfxMessageBox(strMSG);
  10577. #endif
  10578. g_bBranchModify=1;
  10579. if(g_bBranchModify)OnDisconnect();
  10580. if(1)
  10581. {
  10582. g_user.bLongin=0;
  10583. g_user.name.Empty ();
  10584. g_user.rights.Empty ();
  10585. g_user.account.Empty ();
  10586. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  10587. g_pMainWnd2->RefreshOutlookBar();
  10588. m_Mdi.CloseAll();
  10589. if(g_pMainWnd2)
  10590. {
  10591. g_pMainWnd2->DrawLogin();
  10592. g_pMainWnd2->ShowBar (0);
  10593. }
  10594. if(g_bNoLoginLia)
  10595. {
  10596. Login dlg;
  10597. dlg.SetLiaPath ("5.lia");
  10598. dlg.DoModal();
  10599. }
  10600. else
  10601. {
  10602. Login3 dlg;
  10603. dlg.SetLiaPath ("5.lia");
  10604. dlg.DoModal();
  10605. }
  10606. if(g_user.bLongin==0)return;
  10607. if(g_pMainWnd2)g_pMainWnd2->ShowBar (1);
  10608. }
  10609. g_pMainWnd2->DrawLogin();
  10610. g_pMainWnd2->EnableBtns(1);
  10611. }
  10612. g_nYearpos=-1;
  10613. }
  10614. #endif
  10615. }
  10616. void CMainFrame::OnStaffAchievementShow() //Jeff:此机只用于员工看业绩;
  10617. {
  10618. // TODO: Add your command handler code here
  10619. if(g_user.bLongin==0) // 是否登陆系统;
  10620. {
  10621. if(g_bNoLoginLia)
  10622. {
  10623. Login dlg;
  10624. dlg.SetLiaPath ("5.lia");
  10625. dlg.DoModal();
  10626. }
  10627. else
  10628. {
  10629. Login3 dlg;
  10630. dlg.SetLiaPath ("5.lia");
  10631. dlg.DoModal();
  10632. }
  10633. if(g_user.bLongin==0)return;
  10634. }
  10635. if(IsHasRightsnew(49)==0)return;// 是否有权限进行设置;
  10636. CString version = _T ("Version 1.0");
  10637. CMenu *pMenu=GetMenu();
  10638. CMenu* submenu = pMenu->GetSubMenu(1);
  10639. UINT status=submenu->GetMenuState(IDM_StaffAchievementShow, MF_BYCOMMAND );
  10640. if(status&MF_CHECKED)
  10641. {
  10642. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_UNCHECKED);
  10643. AfxGetApp()->WriteProfileInt (version, "status2", 0);
  10644. g_bStaffAchievementShow=0;
  10645. TCHAR szKey[MAX_PATH];
  10646. TCHAR szDir[MAX_PATH];
  10647. ::GetModuleFileName (NULL, szDir, MAX_PATH);
  10648. HKEY hKey=0;
  10649. DWORD disp=0;
  10650. lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  10651. int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp);
  10652. if(lResult==ERROR_SUCCESS)
  10653. {
  10654. RegDeleteValue(hKey,"YLGLMAINAUTORUN");
  10655. RegDeleteKey (hKey,"YLGLMAINAUTORUN");
  10656. RegCloseKey(hKey);
  10657. }
  10658. }
  10659. else
  10660. {
  10661. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  10662. AfxGetApp()->WriteProfileInt (version, "status2", 1);
  10663. g_bStaffAchievementShow=1;
  10664. TCHAR szKey[MAX_PATH];
  10665. TCHAR szDir[MAX_PATH];
  10666. ::GetModuleFileName (NULL, szDir, MAX_PATH);
  10667. HKEY hKey=0;
  10668. DWORD disp=0;
  10669. lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  10670. int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp);
  10671. if(lResult==ERROR_SUCCESS)
  10672. {
  10673. lResult=RegSetValueEx(hKey,"YLGLMAINAUTORUN",0,REG_SZ,(const unsigned char*)szDir,lstrlen(szDir));
  10674. RegCloseKey(hKey);
  10675. }
  10676. StaffAchievementSet dlg;
  10677. dlg.DoModal ();
  10678. }
  10679. }
  10680. void CMainFrame::PrintDinDan2(CString m_id)
  10681. {
  10682. #ifdef MODERN_VERSION
  10683. SelContent seldlg;
  10684. if(seldlg.DoModal()!=IDOK)return;
  10685. CPrintRX m_Print;
  10686. m_Print.InitToPrint(NULL, 1);
  10687. m_Print.StartPrint();
  10688. m_Print.StartPage();
  10689. // CRect StrRect(0,0,560,818);
  10690. LoadRect load;
  10691. LoadRect load2;
  10692. LoadRect load3;
  10693. load.SetLiaPath ("9.lia");
  10694. load.SetMargins(-14,0);
  10695. if(!load.Load ())return;
  10696. int i;
  10697. //////////////////////////////////////////////////////////////
  10698. CStringArray txarray;
  10699. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  10700. g_sendhead.code[0]=11;
  10701. g_sendhead.code[1]=52;
  10702. g_sendhead.code[2]=50;
  10703. g_sendhead.code[3]=38;
  10704. g_sendhead.code[4]=27;
  10705. g_sendhead.tabcount=5;
  10706. g_sendhead.bsql=0;
  10707. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  10708. CArray<CStringArray, CStringArray>sparray;
  10709. CArray<CStringArray, CStringArray>clientarray;
  10710. CArray<CStringArray, CStringArray>phonearray;
  10711. CArray<CStringArray, CStringArray>bukuan2array;
  10712. CArray<CStringArray, CStringArray>bukuanarray;
  10713. DataToArray(&g_List1array, &clientarray, &sparray, &bukuan2array, &bukuanarray);
  10714. CTime tm=CTime::GetCurrentTime ();
  10715. CString str;
  10716. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  10717. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  10718. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  10719. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  10720. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  10721. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  10722. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  10723. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  10724. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  10725. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  10726. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  10727. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  10728. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  10729. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  10730. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  10731. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  10732. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  10733. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  10734. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  10735. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  10736. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  10737. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  10738. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  10739. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  10740. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  10741. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  10742. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  10743. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  10744. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  10745. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  10746. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  10747. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  10748. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  10749. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  10750. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  10751. filter="name='"+m_ren+"'";
  10752. g_sendhead.code[0]=5;
  10753. g_sendhead.tabcount=1;
  10754. g_sendhead.bsql=0;
  10755. int g_nYearposTemp=g_nYearpos;
  10756. g_nYearpos=-1;
  10757. g_pMainWnd->ProcessChatMessageRequest2(filter);
  10758. g_nYearpos=g_nYearposTemp;
  10759. if(g_bSendOK==0)return;
  10760. DataToArray(&phonearray);
  10761. m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
  10762. m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
  10763. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  10764. ConvertToPrice(m_money1);
  10765. ConvertToPrice(m_money2);
  10766. ConvertToPrice(m_money3);
  10767. ////////////////////////////////////////////////////////////////
  10768. int rcpos=-1;
  10769. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  10770. Image *pImg=NULL;
  10771. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo2.jpg");
  10772. if(seldlg.m_bFrame)
  10773. m_Print.DrawImage(pImg, StrRect);
  10774. delete pImg;
  10775. m_Print.SetFontFace(16, 1, "黑体");
  10776. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10777. if(seldlg.m_bFrame)
  10778. ///////////////////////////////不用改
  10779. m_Print.DrawText((LPTSTR)(LPCTSTR)"摩登新娘工作流程单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10780. m_Print.SetFontFace(10, 1, "宋体");
  10781. for( i=3; i<=6; i++)
  10782. {
  10783. StrRect=load.m_rcarray .ElementAt (i-1);
  10784. if(seldlg.m_bFrame)
  10785. m_Print.DrawRect2(StrRect, 1);
  10786. }
  10787. CStringArray strarray;
  10788. if(seldlg.m_bBooking==0)
  10789. {
  10790. m_name1.Empty ();
  10791. m_name2.Empty ();
  10792. m_phone1.Empty ();
  10793. m_phone2.Empty ();
  10794. m_addr1.Empty ();
  10795. m_addr2.Empty ();
  10796. m_taoxiname.Empty ();
  10797. m_taoxijiage.Empty ();
  10798. }
  10799. if(seldlg.m_bFrame )
  10800. {
  10801. strarray.Add("新郎:"+m_name1);
  10802. strarray.Add("H");
  10803. strarray.Add("O");
  10804. strarray.Add("手机:"+m_phone1);
  10805. strarray.Add("新娘:"+m_name2);
  10806. strarray.Add("H");
  10807. strarray.Add("O");
  10808. strarray.Add("手机:"+m_phone2);
  10809. }
  10810. else
  10811. {
  10812. strarray.Add(" "+m_name1);
  10813. strarray.Add("");
  10814. strarray.Add("");
  10815. strarray.Add(" "+m_phone1);
  10816. strarray.Add(" "+m_name2);
  10817. strarray.Add("");
  10818. strarray.Add("");
  10819. strarray.Add(" "+m_phone2);
  10820. }
  10821. for( i=7; i<=14; i++)
  10822. {
  10823. StrRect=load.m_rcarray .ElementAt (i-1);
  10824. StrRect.left +=2;
  10825. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10826. }
  10827. StrRect=load.m_rcarray .ElementAt (3);
  10828. StrRect.left +=2;
  10829. if(seldlg.m_bFrame)
  10830. str="地址:"+m_addr1;
  10831. else
  10832. str=" "+m_addr1;
  10833. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10834. StrRect=load.m_rcarray .ElementAt (5);
  10835. StrRect.left +=2;
  10836. if(seldlg.m_bFrame)
  10837. str="地址:"+m_addr2;
  10838. else
  10839. str=" "+m_addr2;
  10840. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10841. //////////////////////////////////////////////////////
  10842. StrRect=load.m_rcarray .ElementAt (14);
  10843. str="预\r\n约";
  10844. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10845. StrRect.top +=46;
  10846. StrRect.left +=2;
  10847. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10848. m_Print.SetFontFace(10, 1, "宋体");
  10849. StrRect=load.m_rcarray .ElementAt (15);
  10850. if(seldlg.m_bFrame)
  10851. str="套系名称:"+m_taoxiname;
  10852. else
  10853. str=" "+m_taoxiname;
  10854. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10855. StrRect.left +=4;
  10856. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10857. StrRect=load.m_rcarray .ElementAt (16);
  10858. if(seldlg.m_bFrame)
  10859. str="单价:"+m_taoxijiage;
  10860. else
  10861. str=" "+m_taoxijiage;
  10862. StrRect.left +=2;
  10863. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10864. StrRect=load.m_rcarray .ElementAt (21);
  10865. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10866. str="新人签名:";
  10867. StrRect.left +=2;
  10868. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10869. StrRect=load.m_rcarray .ElementAt (22);
  10870. if(seldlg.m_bBooking==0)
  10871. {
  10872. if(seldlg.m_bFrame)
  10873. str="未付款:";
  10874. else
  10875. str=" ";
  10876. }
  10877. else
  10878. {
  10879. if(seldlg.m_bFrame)
  10880. str="未付款:"+m_money3;
  10881. else
  10882. str=" "+m_money3;
  10883. }
  10884. StrRect.left +=2;
  10885. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10886. StrRect=load.m_rcarray .ElementAt (23);
  10887. str="结婚秘书:";
  10888. StrRect.left +=2;
  10889. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10890. StrRect=load.m_rcarray .ElementAt (24);
  10891. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10892. StrRect.left +=3;
  10893. StrRect.top +=3;
  10894. StrRect.right -=2;
  10895. StrRect.bottom -=2;
  10896. int realpos=0;str="";
  10897. for(i=0; i<sparray.GetSize (); i++)
  10898. {
  10899. if(atoi(sparray.ElementAt (i).ElementAt (4))!=1)continue;
  10900. str+=sparray.ElementAt (i).ElementAt (5);
  10901. str+=" 数量:";
  10902. str+=sparray.ElementAt (i).ElementAt (3);
  10903. if(realpos%2)
  10904. str+="\r\n";
  10905. else
  10906. str+=" ";
  10907. realpos++;
  10908. }
  10909. str.TrimRight ("\r\n");
  10910. str.TrimRight (" ");
  10911. if(seldlg.m_bBooking)AutoDraw(m_Print, StrRect, str, 1.4);
  10912. ///////////////////////////////////////////////////////////
  10913. StrRect=load.m_rcarray .ElementAt (14);
  10914. StrRect.top +=1*122;
  10915. StrRect.bottom +=1*122;
  10916. str="拍\r\n照";
  10917. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10918. StrRect.top +=46;
  10919. StrRect.left +=2;
  10920. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10921. m_Print.SetFontFace(10, 1, "宋体");
  10922. StrRect=load.m_rcarray .ElementAt (15);
  10923. StrRect.top +=1*122;
  10924. StrRect.bottom +=1*122;
  10925. str="拍照内容: 白 晚 特 便";
  10926. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10927. StrRect.left +=4;
  10928. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10929. StrRect=load.m_rcarray .ElementAt (21);
  10930. StrRect.top +=1*122;
  10931. StrRect.bottom +=1*122;
  10932. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10933. str=" 新人签名:";
  10934. StrRect.left +=2;
  10935. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10936. StrRect=load.m_rcarray .ElementAt (22);
  10937. StrRect.top +=1*122;
  10938. StrRect.bottom +=1*122;
  10939. if(seldlg.m_bTake)
  10940. {
  10941. if(seldlg.m_bFrame)
  10942. str="未付款:"+m_money3;
  10943. else
  10944. str=" "+m_money3;
  10945. }
  10946. else
  10947. {
  10948. if(seldlg.m_bFrame)
  10949. str="未付款:";
  10950. else
  10951. str=" ";
  10952. }
  10953. StrRect.left +=2;
  10954. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10955. StrRect=load.m_rcarray .ElementAt (23);
  10956. StrRect.top +=1*122;
  10957. StrRect.bottom +=1*122;
  10958. str="结婚秘书:";
  10959. StrRect.left +=2;
  10960. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10961. StrRect=load.m_rcarray .ElementAt (24);
  10962. StrRect.top +=1*122;
  10963. StrRect.bottom +=1*122;
  10964. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10965. StrRect.left +=3;
  10966. StrRect.top +=3;
  10967. StrRect.right -=2;
  10968. StrRect.bottom -=2;
  10969. if(seldlg.m_bTake)
  10970. {
  10971. str="";
  10972. for(i=0; i<bukuan2array.GetSize (); i++)
  10973. {
  10974. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=1)continue;
  10975. str+="加挑: ";
  10976. str+=bukuan2array.ElementAt (i).ElementAt (4);
  10977. str+="\r\n";
  10978. }
  10979. str.TrimRight ("\r\n");
  10980. str.TrimRight (" ");
  10981. AutoDraw(m_Print, StrRect, str, 1.4);
  10982. }
  10983. ///////////////////////////////////////////////////////////
  10984. StrRect=load.m_rcarray .ElementAt (14);
  10985. StrRect.top +=2*122;
  10986. StrRect.bottom +=2*122;
  10987. str="选\r\n样";
  10988. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10989. StrRect.top +=46;
  10990. StrRect.left +=2;
  10991. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10992. m_Print.SetFontFace(10, 1, "宋体");
  10993. StrRect=load.m_rcarray .ElementAt (15);
  10994. StrRect.top +=2*122;
  10995. StrRect.bottom +=2*122;
  10996. str="选片内容:";
  10997. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10998. StrRect.left +=4;
  10999. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11000. StrRect=load.m_rcarray .ElementAt (21);
  11001. StrRect.top +=2*122;
  11002. StrRect.bottom +=2*122;
  11003. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11004. str=" 新人签名:";
  11005. StrRect.left +=2;
  11006. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11007. StrRect=load.m_rcarray .ElementAt (22);
  11008. StrRect.top +=2*122;
  11009. StrRect.bottom +=2*122;
  11010. if(seldlg.m_bChoose)
  11011. {
  11012. if(seldlg.m_bFrame)
  11013. str="未付款:"+m_money3;
  11014. else
  11015. str=" "+m_money3;
  11016. }
  11017. else
  11018. {
  11019. if(seldlg.m_bFrame)
  11020. str="未付款:";
  11021. else
  11022. str=" ";
  11023. }
  11024. StrRect.left +=2;
  11025. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11026. StrRect=load.m_rcarray .ElementAt (23);
  11027. StrRect.top +=2*122;
  11028. StrRect.bottom +=2*122;
  11029. str="结婚秘书:";
  11030. StrRect.left +=2;
  11031. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11032. StrRect=load.m_rcarray .ElementAt (24);
  11033. StrRect.top +=2*122;
  11034. StrRect.bottom +=2*122;
  11035. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11036. if(seldlg.m_bChoose)
  11037. {
  11038. StrRect.left +=3;
  11039. StrRect.top +=3;
  11040. StrRect.right -=2;
  11041. StrRect.bottom -=2;
  11042. str="";
  11043. for(i=0; i<bukuan2array.GetSize (); i++)
  11044. {
  11045. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=2)continue;
  11046. str+="加挑: ";
  11047. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11048. str+="\r\n";
  11049. }
  11050. str.TrimRight ("\r\n");
  11051. str.TrimRight (" ");
  11052. AutoDraw(m_Print, StrRect, str, 1.4);
  11053. }
  11054. ///////////////////////////////////////////////////////////
  11055. StrRect=load.m_rcarray .ElementAt (14);
  11056. StrRect.top +=3*122;
  11057. StrRect.bottom +=3*122;
  11058. str="结\r\n婚";
  11059. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11060. StrRect.top +=46;
  11061. StrRect.left +=2;
  11062. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11063. m_Print.SetFontFace(10, 1, "宋体");
  11064. StrRect=load.m_rcarray .ElementAt (15);
  11065. StrRect.top +=3*122;
  11066. StrRect.bottom +=3*122;
  11067. str="结婚内容: 区 白 晚 押金:";
  11068. if(seldlg.m_bFrame) m_Print.DrawRect2(StrRect, 1);
  11069. StrRect.left +=4;
  11070. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11071. StrRect=load.m_rcarray .ElementAt (21);
  11072. StrRect.top +=3*122;
  11073. StrRect.bottom +=3*122;
  11074. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11075. str=" 新人签名:";
  11076. StrRect.left +=2;
  11077. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11078. StrRect=load.m_rcarray .ElementAt (22);
  11079. StrRect.top +=3*122;
  11080. StrRect.bottom +=3*122;
  11081. if(seldlg.m_bBooking)
  11082. {
  11083. if(seldlg.m_bFrame)
  11084. str="未付款:"+m_money3;
  11085. else
  11086. str=" "+m_money3;
  11087. }
  11088. else
  11089. {
  11090. if(seldlg.m_bFrame)
  11091. str="未付款:";
  11092. else
  11093. str=" ";
  11094. }
  11095. StrRect.left +=2;
  11096. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11097. StrRect=load.m_rcarray .ElementAt (23);
  11098. StrRect.top +=3*122;
  11099. StrRect.bottom +=3*122;
  11100. str="结婚秘书:";
  11101. StrRect.left +=2;
  11102. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11103. StrRect=load.m_rcarray .ElementAt (24);
  11104. StrRect.top +=3*122;
  11105. StrRect.bottom +=3*122;
  11106. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11107. if(seldlg.m_bBooking)
  11108. {
  11109. StrRect.left +=3;
  11110. StrRect.top +=3;
  11111. StrRect.right -=2;
  11112. StrRect.bottom -=2;
  11113. realpos=0;str="";
  11114. for(i=0; i<sparray.GetSize (); i++)
  11115. {
  11116. if(atoi(sparray.ElementAt (i).ElementAt (4))!=2)continue;
  11117. str+=sparray.ElementAt (i).ElementAt (5);
  11118. str+=" 数量:";
  11119. str+=sparray.ElementAt (i).ElementAt (3);
  11120. if(realpos%2)
  11121. str+="\r\n";
  11122. else
  11123. str+=" ";
  11124. realpos++;
  11125. }
  11126. str.TrimRight ("\r\n");
  11127. str.TrimRight (" ");
  11128. AutoDraw(m_Print, StrRect, str, 1.4);
  11129. }
  11130. ///////////////////////////////////////
  11131. strarray.RemoveAll ();
  11132. if(seldlg.m_bFrame)
  11133. {
  11134. strarray.Add ("项目");
  11135. strarray.Add ("万");
  11136. strarray.Add ("千");
  11137. strarray.Add ("百");
  11138. strarray.Add ("十");
  11139. strarray.Add ("个");
  11140. strarray.Add ("收 银");
  11141. }
  11142. else
  11143. {
  11144. strarray.Add ("");
  11145. strarray.Add ("");
  11146. strarray.Add ("");
  11147. strarray.Add ("");
  11148. strarray.Add ("");
  11149. strarray.Add ("");
  11150. strarray.Add ("");
  11151. }
  11152. CStringArray strarray2;
  11153. float ftotal=0;
  11154. int realcount=0;
  11155. if(seldlg.m_bBooking)
  11156. {
  11157. for(i=0; i<bukuanarray.GetSize (); i++)
  11158. {
  11159. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=3 && atoi(bukuanarray.ElementAt (i).ElementAt (6))!=4)continue;
  11160. realcount++;
  11161. if(realcount>6)break;
  11162. str=bukuanarray.ElementAt (i).ElementAt (1);
  11163. ftotal+=atof(str);
  11164. strarray2.Add (GetW(str));
  11165. strarray2.Add (GetK(str));
  11166. strarray2.Add (GetB(str));
  11167. strarray2.Add (GetS(str));
  11168. strarray2.Add (GetG(str));
  11169. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11170. }
  11171. }
  11172. while(strarray2.GetSize ()<36)
  11173. strarray2.Add ("");
  11174. str.Format ("%f", ftotal);
  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 ("");
  11181. //拍照
  11182. ftotal=0;
  11183. realcount=0;
  11184. if(seldlg.m_bTake)
  11185. {
  11186. for(i=0; i<bukuanarray.GetSize (); i++)
  11187. {
  11188. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=1)continue;
  11189. realcount++;
  11190. if(realcount>6)break;
  11191. str=bukuanarray.ElementAt (i).ElementAt (1);
  11192. ftotal+=atof(str);
  11193. strarray2.Add (GetW(str));
  11194. strarray2.Add (GetK(str));
  11195. strarray2.Add (GetB(str));
  11196. strarray2.Add (GetS(str));
  11197. strarray2.Add (GetG(str));
  11198. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11199. }
  11200. }
  11201. while(strarray2.GetSize ()<42+36)
  11202. strarray2.Add ("");
  11203. str.Format ("%f", ftotal);
  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 ("");
  11210. //选片
  11211. ftotal=0;
  11212. realcount=0;
  11213. if(seldlg.m_bChoose)
  11214. {
  11215. for(i=0; i<bukuanarray.GetSize (); i++)
  11216. {
  11217. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=2)continue;
  11218. realcount++;
  11219. if(realcount>6)break;
  11220. str=bukuanarray.ElementAt (i).ElementAt (1);
  11221. ftotal+=atof(str);
  11222. strarray2.Add (GetW(str));
  11223. strarray2.Add (GetK(str));
  11224. strarray2.Add (GetB(str));
  11225. strarray2.Add (GetS(str));
  11226. strarray2.Add (GetG(str));
  11227. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11228. }
  11229. }
  11230. while(strarray2.GetSize ()<42*2+36)
  11231. strarray2.Add ("");
  11232. str.Format ("%f", ftotal);
  11233. strarray2.Add (GetW(str));
  11234. strarray2.Add (GetK(str));
  11235. strarray2.Add (GetB(str));
  11236. strarray2.Add (GetS(str));
  11237. strarray2.Add (GetG(str));
  11238. strarray2.Add ("");
  11239. /////////////////////////////
  11240. CRect temprc;
  11241. for(int n=0; n<4; n++)
  11242. {
  11243. StrRect=load.m_rcarray .ElementAt (17);
  11244. StrRect.top +=n*122;
  11245. StrRect.bottom +=n*122;
  11246. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11247. StrRect=load.m_rcarray .ElementAt (18);
  11248. if(n)
  11249. {
  11250. StrRect.left +=36;
  11251. StrRect.right +=36;
  11252. }
  11253. StrRect.top +=n*122;
  11254. StrRect.bottom +=n*122;
  11255. if(seldlg.m_bFrame)
  11256. str.Format("%d年", tm.GetYear ());
  11257. else
  11258. str.Format("%d ", tm.GetYear ());
  11259. 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))
  11260. {
  11261. if(seldlg.m_bFrame)
  11262. str=" 年";
  11263. else
  11264. str=" ";
  11265. }
  11266. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11267. StrRect=load.m_rcarray .ElementAt (19);
  11268. if(n)
  11269. {
  11270. StrRect.left +=38;
  11271. StrRect.right +=38;
  11272. }
  11273. StrRect.top +=n*122;
  11274. StrRect.bottom +=n*122;
  11275. if(seldlg.m_bFrame)
  11276. str.Format("%02d月", tm.GetMonth ());
  11277. else
  11278. str.Format("%02d ", tm.GetMonth ());
  11279. 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))
  11280. {
  11281. if(seldlg.m_bFrame)
  11282. str=" 月";
  11283. else
  11284. str=" ";
  11285. }
  11286. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11287. StrRect=load.m_rcarray .ElementAt (20);
  11288. if(n)
  11289. {
  11290. StrRect.left +=36;
  11291. StrRect.right +=36;
  11292. }
  11293. StrRect.top +=n*122;
  11294. StrRect.bottom +=n*122;
  11295. if(seldlg.m_bFrame)
  11296. str.Format("%02d日", tm.GetDay ());
  11297. else
  11298. str.Format("%02d ", tm.GetDay ());
  11299. 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))
  11300. {
  11301. if(seldlg.m_bFrame)
  11302. str=" 日";
  11303. else
  11304. str=" ";
  11305. }
  11306. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11307. for(i=26; i<=32; i++)
  11308. {
  11309. StrRect=load.m_rcarray .ElementAt (i-1);
  11310. StrRect.bottom -=14;
  11311. for(int j=0; j<8; j++)
  11312. {
  11313. StrRect.top=StrRect.bottom;
  11314. if(j>2)
  11315. {
  11316. StrRect.bottom =StrRect.top+14;
  11317. }
  11318. else
  11319. {
  11320. StrRect.bottom =StrRect.top+13;
  11321. }
  11322. temprc=StrRect;
  11323. StrRect.top +=n*122;
  11324. StrRect.bottom +=n*122;
  11325. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11326. if(i==26 && j==4 && seldlg.m_bFrame)
  11327. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11328. else if(i==26 && j==5 && seldlg.m_bFrame)
  11329. m_Print.DrawText((LPTSTR)(LPCTSTR)"付款", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11330. else if(i==26 && j==7 && seldlg.m_bFrame)
  11331. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11332. else if(j==0)
  11333. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-26), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11334. else if(j && i>26 && n<3)
  11335. {
  11336. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray2.ElementAt ((j-1)*6+(i-27)+n*42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11337. }
  11338. StrRect=temprc;
  11339. }
  11340. }
  11341. }
  11342. if(seldlg.m_bFrame)
  11343. {
  11344. StrRect=load.m_rcarray .ElementAt (32);
  11345. str="注\r\n意\r\n事\r\n项";
  11346. StrRect.top +=367;
  11347. StrRect.bottom +=367;
  11348. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11349. StrRect.top +=17;
  11350. StrRect.left +=2;
  11351. AutoDraw(m_Print, StrRect, str, 1.4);
  11352. StrRect=load.m_rcarray .ElementAt (33);
  11353. str="1: 本预约单自预定日期起一年内有效.定金在拍照套系金额中扣出.预定金一概不退\r\n\
  11354. 2: 多拍照片只供筛选.恕不奉送.版权所有.不得私自拷贝\r\n\
  11355. 3: 拍照款请于拍照时一次付清\r\n\
  11356. 4: 新娘装AM8:00前钟点费另计.婚纱礼服出租押金500-2000元\r\n\
  11357. 5: 本公司设有豪华VIP礼服区.及皇家御用礼服展区.但需另外加价.详情请咨本店人员\r\n\
  11358. 6: 安瓶, 美甲一次性化妆用具等均属增值服务部分,则需另外加价,详情咨询本店工作人员\r\n\
  11359. 7: 本电脑机械故障导致文件资料丢失.本公司只提供补拍服务\r\n\
  11360. 8: 每次前来请务必携带本单交给工作人员.本单是您在摩登新娘拍照的凭证.办理有关手续凭本单办理盖\r\n\
  11361. 章后方可生效";
  11362. StrRect.top +=367;
  11363. StrRect.bottom +=367;
  11364. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11365. StrRect.top +=4;
  11366. StrRect.left +=2;
  11367. AutoDraw(m_Print, StrRect, str, 1.0);
  11368. StrRect=load.m_rcarray .ElementAt (34);
  11369. 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)";
  11370. AutoDraw(m_Print, StrRect, str, 1.0);
  11371. m_Print.SetFontFace(13, 1, "宋体");
  11372. StrRect=load.m_rcarray .ElementAt (35);
  11373. str="地 址: 汉口 . 解放大道 . 头道街东部购物公园C栋二,三层";
  11374. StrRect.top +=367;
  11375. StrRect.bottom +=367;
  11376. StrRect.left +=2;
  11377. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11378. StrRect=load.m_rcarray .ElementAt (36);
  11379. str="喜讯热线: 027-81888799 81888599 81888699";
  11380. StrRect.top +=367;
  11381. StrRect.bottom +=367;
  11382. StrRect.left +=2;
  11383. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11384. }
  11385. PrintPreview dlg;
  11386. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11387. dlg.m_pDC =m_Print.GetPDC() ;
  11388. if(dlg.DoModal ()!=IDOK)return;
  11389. //结束打印
  11390. m_Print.EndPage();
  11391. m_Print.EndPrint();
  11392. #endif
  11393. }
  11394. void CMainFrame::PrintReceipt3(CString strOrderNumber, CStringArray *pArray, float money)
  11395. {
  11396. int printcot=1;
  11397. for(int aa=0; aa<printcot; aa++)
  11398. {
  11399. g_sendhead.bsql=0;
  11400. g_sendhead.code[0]=24;
  11401. g_sendhead.tabcount=1;
  11402. int g_nYearposTemp=g_nYearpos;
  11403. g_nYearpos=-1;
  11404. g_pMainWnd->ProcessChatMessageRequest2(1);
  11405. g_nYearpos=g_nYearposTemp;
  11406. if(0==g_bSendOK)return;
  11407. DataToArray(&g_cominfoarray);
  11408. CString SerialNo;
  11409. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  11410. CPrintRX m_Print;
  11411. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11412. {
  11413. m_Print.InitToPrint(NULL, 1);
  11414. }
  11415. else
  11416. {
  11417. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  11418. if(name.IsEmpty ())
  11419. m_Print.InitToPrint(NULL, 1);
  11420. else
  11421. {
  11422. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11423. if(nret==-1 && aa==0)
  11424. {
  11425. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11426. }
  11427. }
  11428. }
  11429. m_Print.StartPrint();
  11430. m_Print.StartPage();
  11431. LoadRect load;
  11432. load.SetLiaPath ("15.lia");
  11433. load.SetMargins(0,0);
  11434. if(!load.Load ())return;
  11435. int i;
  11436. //////////////////////////////////////////////////////////////
  11437. CStringArray txarray;
  11438. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  11439. g_sendhead.code[0]=11;
  11440. g_sendhead.code[1]=52;
  11441. g_sendhead.tabcount=2;
  11442. g_sendhead.bsql=0;
  11443. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11444. CArray<CStringArray, CStringArray>sparray;
  11445. CArray<CStringArray, CStringArray>clientarray;
  11446. DataToArray(&g_List1array, &clientarray);
  11447. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11448. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11449. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11450. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11451. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11452. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11453. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11454. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11455. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11456. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11457. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11458. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11459. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11460. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11461. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11462. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11463. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11464. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11465. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11466. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11467. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11468. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11469. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11470. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11471. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11472. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11473. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11474. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11475. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11476. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11477. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11478. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  11479. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  11480. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11481. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11482. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  11483. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  11484. CString m_addr=m_addr1+";";
  11485. m_addr.TrimLeft (";");
  11486. m_addr+=m_addr2;
  11487. CString m_qq=m_qq1+";";
  11488. m_qq.TrimLeft (";");
  11489. m_qq+=m_qq2;
  11490. m_money1.Format ("%f", atof(m_taoxijiage));
  11491. m_money2.Format ("%f", atof(m_payed1));
  11492. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11493. ConvertToPrice(m_money1);
  11494. ConvertToPrice(m_money2);
  11495. ConvertToPrice(m_money3);
  11496. ////////////////////////////////////////////////////////////////
  11497. int rcpos=-1;
  11498. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11499. m_Print.SetFontFace(17, 1, "宋体");
  11500. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11501. StrRect.top -=0;
  11502. StrRect.bottom -=10;
  11503. StrRect.left -=140;
  11504. StrRect.right =StrRect.left+48;
  11505. m_Print.SetFontFace(15, 1, "宋体");
  11506. m_Print.SetColor(0xffffff);
  11507. m_Print.DrawRect(StrRect, 0);
  11508. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11509. StrRect.left =StrRect.right ;
  11510. StrRect.right =StrRect.left+48;
  11511. m_Print.DrawRect(StrRect, RGB(255,0,0));
  11512. m_Print.SetColor(0, RGB(255,0,0));
  11513. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11514. m_Print.SetColor(0);
  11515. m_Print.SetFontFace(12, 1, "宋体");
  11516. StrRect.left -=48;
  11517. int hei=StrRect.Height ();
  11518. StrRect.top =StrRect.bottom+2;
  11519. StrRect.bottom +=hei+2;
  11520. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11521. StrRect.top =StrRect.bottom-2;
  11522. StrRect.bottom +=hei-5;
  11523. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11524. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11525. m_Print.SetFontFace(12, 1, "宋体");
  11526. m_Print.DrawText((LPTSTR)(LPCTSTR)"收款单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11527. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11528. m_Print.SetFontFace(9, 1, "宋体");
  11529. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11530. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11531. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11532. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11533. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11534. m_Print.DrawRect2(StrRect, 2);
  11535. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11536. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11537. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11538. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11539. m_Print.DrawRect2(StrRect, 2);
  11540. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11541. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11542. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11543. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11544. m_Print.DrawRect2(StrRect, 2);
  11545. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11546. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11547. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11548. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11549. m_Print.DrawRect2(StrRect, 2);
  11550. ////////////
  11551. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11552. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11553. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11554. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11555. m_Print.DrawRect2(StrRect, 2);
  11556. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11557. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11558. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11559. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11560. m_Print.DrawRect2(StrRect, 2);
  11561. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11562. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11563. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11564. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11565. m_Print.DrawRect2(StrRect, 2);
  11566. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11567. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11568. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11569. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11570. m_Print.DrawRect2(StrRect, 2);
  11571. for( i=19; i<49; i++)
  11572. {
  11573. if(i>=44)
  11574. {
  11575. StrRect=load.m_rcarray .ElementAt (i-5);
  11576. int hei=StrRect.Height ();
  11577. StrRect.top +=hei;
  11578. StrRect.bottom +=hei;
  11579. }
  11580. else
  11581. StrRect=load.m_rcarray .ElementAt (i);
  11582. m_Print.DrawRect2(StrRect, 1);
  11583. }
  11584. float fmoney=0;
  11585. for( i=19; i<49; i++)
  11586. {
  11587. if(i>=44)
  11588. {
  11589. StrRect=load.m_rcarray .ElementAt (i-5);
  11590. int hei=StrRect.Height ();
  11591. StrRect.top +=hei;
  11592. StrRect.bottom +=hei;
  11593. }
  11594. else
  11595. StrRect=load.m_rcarray .ElementAt (i);
  11596. StrRect.left +=2;
  11597. /* if((i-19)%5==2)
  11598. {
  11599. fmoney+=atof(pArray->ElementAt (i-19));
  11600. }*/
  11601. m_Print.DrawText((LPTSTR)(LPCTSTR)(pArray->ElementAt (i-19)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11602. }
  11603. m_money2.Format ("%f", money);
  11604. ConvertToPrice(m_money2);
  11605. StrRect=load.m_rcarray .ElementAt (44);
  11606. CString str;
  11607. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 实收¥: %s 元 收银员: %s",\
  11608. GetHMoney(GetW(m_money2)),GetHMoney(GetK(m_money2)),GetHMoney(GetB(m_money2)),GetHMoney(GetS(m_money2)),GetHMoney(GetG(m_money2)),\
  11609. m_money2, g_user.name);
  11610. m_Print.DrawRect2(StrRect, 1);
  11611. StrRect.left +=3;
  11612. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11613. StrRect=load.m_rcarray .ElementAt (46);
  11614. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11615. StrRect=load.m_rcarray .ElementAt (47);
  11616. m_Print.DrawRect2(StrRect, 2);
  11617. StrRect=load.m_rcarray .ElementAt (48);
  11618. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11619. StrRect=load.m_rcarray .ElementAt (45);
  11620. str="\
  11621. 顾客须知\r\n\
  11622. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  11623. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  11624. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  11625. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  11626. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  11627. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  11628. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  11629. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  11630. AutoDraw(m_Print, StrRect, str, 1.8);
  11631. PrintPreview dlg;
  11632. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11633. dlg.m_pDC =m_Print.GetPDC() ;
  11634. if(aa==0)
  11635. {
  11636. if(dlg.DoModal ()!=IDOK)
  11637. return;
  11638. printcot=dlg.m_num;
  11639. }
  11640. //结束打印
  11641. m_Print.EndPage();
  11642. m_Print.EndPrint();
  11643. }
  11644. }
  11645. void CMainFrame::PrintReceipt2(CString strOrderNumber)
  11646. {
  11647. int printcot=1;
  11648. for(int aa=0; aa<printcot; aa++)
  11649. {
  11650. g_sendhead.bsql=0;
  11651. g_sendhead.code[0]=24;
  11652. g_sendhead.tabcount=1;
  11653. int g_nYearposTemp=g_nYearpos;
  11654. g_nYearpos=-1;
  11655. g_pMainWnd->ProcessChatMessageRequest2(1);
  11656. g_nYearpos=g_nYearposTemp;
  11657. if(0==g_bSendOK)return;
  11658. DataToArray(&g_cominfoarray);
  11659. CString SerialNo;
  11660. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  11661. CPrintRX m_Print;
  11662. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11663. {
  11664. m_Print.InitToPrint(NULL, 1);
  11665. }
  11666. else
  11667. {
  11668. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  11669. if(name.IsEmpty ())
  11670. m_Print.InitToPrint(NULL, 1);
  11671. else
  11672. {
  11673. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11674. if(nret==-1 && aa==0)
  11675. {
  11676. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11677. }
  11678. }
  11679. }
  11680. m_Print.StartPrint();
  11681. m_Print.StartPage();
  11682. LoadRect load;
  11683. load.SetLiaPath ("14.lia");
  11684. load.SetMargins(0,0);
  11685. if(!load.Load ())return;
  11686. int i;
  11687. //////////////////////////////////////////////////////////////
  11688. CStringArray txarray;
  11689. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  11690. g_sendhead.code[0]=11;
  11691. g_sendhead.code[1]=52;
  11692. g_sendhead.code[2]=93;
  11693. g_sendhead.tabcount=3;
  11694. g_sendhead.bsql=0;
  11695. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11696. CArray<CStringArray, CStringArray>sparray;
  11697. CArray<CStringArray, CStringArray>clientarray;
  11698. CArray<CStringArray, CStringArray>moneyarray;
  11699. DataToArray(&g_List1array, &clientarray, &moneyarray);
  11700. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11701. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11702. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11703. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11704. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11705. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11706. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11707. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11708. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11709. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11710. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11711. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11712. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11713. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11714. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11715. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11716. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11717. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11718. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11719. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11720. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11721. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11722. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11723. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11724. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11725. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11726. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11727. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11728. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11729. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11730. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11731. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  11732. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  11733. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11734. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11735. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  11736. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  11737. CString m_addr=m_addr1+";";
  11738. m_addr.TrimLeft (";");
  11739. m_addr+=m_addr2;
  11740. CString m_qq=m_qq1+";";
  11741. m_qq.TrimLeft (";");
  11742. m_qq+=m_qq2;
  11743. m_money1.Format ("%f", atof(m_taoxijiage));
  11744. m_money2="0";
  11745. for( i=0; i<moneyarray.GetSize (); i++)
  11746. {
  11747. if(moneyarray.ElementAt (i).ElementAt (5)=="预约收款")
  11748. m_money2=moneyarray.ElementAt (i).ElementAt (1);
  11749. }
  11750. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11751. ConvertToPrice(m_money1);
  11752. ConvertToPrice(m_money2);
  11753. ConvertToPrice(m_money3);
  11754. ////////////////////////////////////////////////////////////////
  11755. int rcpos=-1;
  11756. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11757. m_Print.SetFontFace(17, 1, "宋体");
  11758. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11759. StrRect.top -=0;
  11760. StrRect.bottom -=10;
  11761. StrRect.left -=140;
  11762. StrRect.right =StrRect.left+48;
  11763. m_Print.SetFontFace(15, 1, "宋体");
  11764. m_Print.SetColor(0xffffff);
  11765. m_Print.DrawRect(StrRect, 0);
  11766. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11767. StrRect.left =StrRect.right ;
  11768. StrRect.right =StrRect.left+48;
  11769. m_Print.DrawRect(StrRect, RGB(255,0,0));
  11770. m_Print.SetColor(0, RGB(255,0,0));
  11771. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11772. m_Print.SetColor(0);
  11773. m_Print.SetFontFace(12, 1, "宋体");
  11774. StrRect.left -=48;
  11775. int hei=StrRect.Height ();
  11776. StrRect.top =StrRect.bottom+2;
  11777. StrRect.bottom +=hei+2;
  11778. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11779. StrRect.top =StrRect.bottom-2;
  11780. StrRect.bottom +=hei-5;
  11781. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11782. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11783. m_Print.SetFontFace(12, 1, "宋体");
  11784. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约金单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11785. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11786. m_Print.SetFontFace(9, 1, "宋体");
  11787. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11788. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11789. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11790. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11791. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11792. m_Print.DrawRect2(StrRect, 2);
  11793. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11794. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11795. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11796. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11797. m_Print.DrawRect2(StrRect, 2);
  11798. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11799. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11800. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11801. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11802. m_Print.DrawRect2(StrRect, 2);
  11803. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11804. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11805. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11806. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11807. m_Print.DrawRect2(StrRect, 2);
  11808. ////////////
  11809. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11810. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11811. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11812. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11813. m_Print.DrawRect2(StrRect, 2);
  11814. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11815. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11816. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11817. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11818. m_Print.DrawRect2(StrRect, 2);
  11819. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11820. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11821. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11822. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11823. m_Print.DrawRect2(StrRect, 2);
  11824. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11825. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11826. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11827. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11828. m_Print.DrawRect2(StrRect, 2);
  11829. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11830. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11831. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11832. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11833. m_Print.DrawRect2(StrRect, 2);
  11834. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11835. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11836. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11837. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11838. m_Print.DrawRect2(StrRect, 2);
  11839. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11840. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/MSN:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11841. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11842. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11843. m_Print.DrawRect2(StrRect, 2);
  11844. CStringArray strarray;
  11845. strarray.Add("套系名称");
  11846. strarray.Add("总 额");
  11847. strarray.Add("定 金");
  11848. strarray.Add("余 款");
  11849. strarray.Add("摄影日期");
  11850. strarray.Add(m_taoxiname);
  11851. strarray.Add(m_money1);
  11852. strarray.Add(m_money2);
  11853. strarray.Add(m_money3);
  11854. strarray.Add(m_time2);
  11855. for( i=25; i<37; i++)
  11856. {
  11857. StrRect=load.m_rcarray .ElementAt (i);
  11858. m_Print.DrawRect2(StrRect, 1);
  11859. }
  11860. for( i=25; i<35; i++)
  11861. {
  11862. StrRect=load.m_rcarray .ElementAt (i);
  11863. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-25), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11864. }
  11865. StrRect=load.m_rcarray .ElementAt (35);
  11866. StrRect.left +=5;
  11867. StrRect.top +=5;
  11868. m_Print.DrawText((LPTSTR)(LPCTSTR)" 备 注:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  11869. StrRect=load.m_rcarray .ElementAt (36);
  11870. CString str;
  11871. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 ¥: %s 元 收银员: %s",\
  11872. GetHMoney(GetW(m_money2)),GetHMoney(GetK(m_money2)),GetHMoney(GetB(m_money2)),GetHMoney(GetS(m_money2)),GetHMoney(GetG(m_money2)),\
  11873. m_money2, g_user.name);
  11874. StrRect.left +=3;
  11875. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11876. StrRect=load.m_rcarray .ElementAt (38);
  11877. m_Print.DrawText((LPTSTR)(LPCTSTR)"营业员:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11878. StrRect=load.m_rcarray .ElementAt (39);
  11879. m_Print.DrawText((LPTSTR)(LPCTSTR)m_ren, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11880. m_Print.DrawRect2(StrRect, 2);
  11881. StrRect=load.m_rcarray .ElementAt (40);
  11882. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11883. StrRect=load.m_rcarray .ElementAt (41);
  11884. m_Print.DrawRect2(StrRect, 2);
  11885. StrRect=load.m_rcarray .ElementAt (42);
  11886. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11887. StrRect=load.m_rcarray .ElementAt (37);
  11888. str="\
  11889. 顾客须知\r\n\
  11890. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  11891. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  11892. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  11893. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  11894. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  11895. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  11896. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  11897. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  11898. AutoDraw(m_Print, StrRect, str, 1.8);
  11899. PrintPreview dlg;
  11900. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11901. dlg.m_pDC =m_Print.GetPDC() ;
  11902. if(aa==0)
  11903. {
  11904. if(dlg.DoModal ()!=IDOK)
  11905. return;
  11906. printcot=dlg.m_num;
  11907. }
  11908. //结束打印
  11909. m_Print.EndPage();
  11910. m_Print.EndPrint();
  11911. }
  11912. }
  11913. void CMainFrame::OnAutodelphoto()
  11914. {
  11915. // TODO: Add your command handler code here
  11916. if(g_user.bLongin==0)
  11917. {
  11918. if(g_bNoLoginLia)
  11919. {
  11920. Login dlg;
  11921. dlg.SetLiaPath ("5.lia");
  11922. dlg.DoModal();
  11923. }
  11924. else
  11925. {
  11926. Login3 dlg;
  11927. dlg.SetLiaPath ("5.lia");
  11928. dlg.DoModal();
  11929. }
  11930. if(g_user.bLongin==0)return;
  11931. }
  11932. if(IsHasRightsnew(49)==0)return;
  11933. DelPhotoSet dlg;
  11934. dlg.DoModal ();
  11935. }
  11936. void CMainFrame::Onphotomanage()
  11937. {
  11938. // TODO: Add your command handler code here
  11939. if(g_user.bLongin==0)
  11940. {
  11941. if(g_bNoLoginLia)
  11942. {
  11943. Login dlg;
  11944. dlg.SetLiaPath ("5.lia");
  11945. dlg.DoModal();
  11946. }
  11947. else
  11948. {
  11949. Login3 dlg;
  11950. dlg.SetLiaPath ("5.lia");
  11951. dlg.DoModal();
  11952. }
  11953. if(g_user.bLongin==0)return;
  11954. }
  11955. if(IsHasRightsnew(49)==0)return;
  11956. ShowPic3 dlg;
  11957. dlg.DoModal ();
  11958. }
  11959. void CMainFrame::OnCompanyinfo()
  11960. {
  11961. // TODO: Add your command handler code here
  11962. if(g_user.bLongin==0)
  11963. {
  11964. if(g_bNoLoginLia)
  11965. {
  11966. Login dlg;
  11967. dlg.SetLiaPath ("5.lia");
  11968. dlg.DoModal();
  11969. }
  11970. else
  11971. {
  11972. Login3 dlg;
  11973. dlg.SetLiaPath ("5.lia");
  11974. dlg.DoModal();
  11975. }
  11976. if(g_user.bLongin==0)return;
  11977. }
  11978. if(IsHasRightsnew(49)==0)return;
  11979. CompanyInfo dlg;
  11980. dlg.DoModal ();
  11981. }
  11982. void CMainFrame::OnTaoxifg()
  11983. {
  11984. // TODO: Add your command handler code here
  11985. if(g_user.bLongin==0)
  11986. {
  11987. if(g_bNoLoginLia)
  11988. {
  11989. Login dlg;
  11990. dlg.SetLiaPath ("5.lia");
  11991. dlg.DoModal();
  11992. }
  11993. else
  11994. {
  11995. Login3 dlg;
  11996. dlg.SetLiaPath ("5.lia");
  11997. dlg.DoModal();
  11998. }
  11999. if(g_user.bLongin==0)return;
  12000. }
  12001. if(IsHasRightsnew(49)==0)return;
  12002. TXFG dlg;
  12003. dlg.DoModal ();
  12004. }
  12005. void CMainFrame::OnHelpfile()
  12006. {
  12007. // TODO: Add your command handler code here
  12008. // ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  12009. // if(::PathFileExists (g_mainpath+"\\zx.dll"))
  12010. // ShellExecute(NULL, _T("open"), _T("www.zcsmkj.com"), "", NULL, SW_SHOWNORMAL);
  12011. // else
  12012. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  12013. }
  12014. void CMainFrame::OnPhotobak()
  12015. {
  12016. // TODO: Add your command handler code here
  12017. if(g_user.bLongin==0)
  12018. {
  12019. if(g_bNoLoginLia)
  12020. {
  12021. Login dlg;
  12022. dlg.SetLiaPath ("5.lia");
  12023. dlg.DoModal();
  12024. }
  12025. else
  12026. {
  12027. Login3 dlg;
  12028. dlg.SetLiaPath ("5.lia");
  12029. dlg.DoModal();
  12030. }
  12031. if(g_user.bLongin==0)return;
  12032. }
  12033. if(IsHasRightsnew(49)==0)return;
  12034. PhotoBak dlg;
  12035. dlg.DoModal ();
  12036. }
  12037. //客户报表
  12038. void CMainFrame::OnClose2()
  12039. { // TODO: Add your message handler code here and/or call default
  12040. if(AfxMessageBox("是否退出系统?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  12041. WriteLog("退出系统");//Jeff.add
  12042. g_bShowBar=0;
  12043. if(m_Mdi.MainClose())
  12044. CMDIFrameWnd::OnClose();
  12045. }
  12046. //
  12047. void CMainFrame::ResetTimer()
  12048. {
  12049. }
  12050. void CMainFrame::LinkClick(CString str, int nParent)
  12051. {
  12052. g_pMainWnd2->m_bar.LinkClick(str);
  12053. }
  12054. void CMainFrame::PrintFlowChart2(CString m_id)
  12055. {
  12056. CPrintRX m_Print;
  12057. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12058. {
  12059. m_Print.InitToPrint(NULL, 1);
  12060. }
  12061. else
  12062. {
  12063. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  12064. if(name.IsEmpty ())
  12065. m_Print.InitToPrint(NULL, 1);
  12066. else
  12067. {
  12068. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12069. if(nret==-1)
  12070. {
  12071. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12072. }
  12073. }
  12074. }
  12075. m_Print.StartPrint();
  12076. m_Print.StartPage();
  12077. LoadRect load;
  12078. load.SetLiaPath ("16.lia");
  12079. load.SetMargins(0,0);
  12080. if(!load.Load ())return;
  12081. LoadRect load2;
  12082. load2.SetLiaPath ("17.lia");
  12083. load2.SetMargins(0,660);
  12084. if(!load2.Load ())return;
  12085. int i;
  12086. //////////////////////////////////////////////////////////////
  12087. CStringArray txarray;
  12088. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and kind<>'2'";
  12089. g_sendhead.code[0]=11;
  12090. g_sendhead.code[1]=52;
  12091. g_sendhead.code[2]=223;
  12092. g_sendhead.tabcount=3;
  12093. g_sendhead.bsql=0;
  12094. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  12095. CArray<CStringArray, CStringArray>sparray;
  12096. CArray<CStringArray, CStringArray>clientarray;
  12097. DataToArray(&g_List1array, &clientarray, &sparray);
  12098. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  12099. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  12100. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  12101. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  12102. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  12103. CString m_photocount= g_List1array.ElementAt (0).ElementAt (9);
  12104. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  12105. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  12106. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  12107. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  12108. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  12109. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  12110. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  12111. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  12112. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  12113. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  12114. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  12115. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  12116. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  12117. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  12118. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  12119. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  12120. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  12121. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  12122. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  12123. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  12124. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  12125. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  12126. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (39)+g_List1array.ElementAt (0).ElementAt (75);
  12127. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  12128. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  12129. CString spno;
  12130. for( i=0; i<sparray.GetSize (); i++)
  12131. {
  12132. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12133. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  12134. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())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. spno+=" 加挑:";
  12148. for( i=0; i<sparray.GetSize (); i++)
  12149. {
  12150. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  12151. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  12152. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  12153. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  12154. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  12155. spno+=sparray.ElementAt (i).ElementAt (5);
  12156. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  12157. spno+="; ";
  12158. else
  12159. {
  12160. spno+=":";
  12161. spno+=sparray.ElementAt (i).ElementAt (6);
  12162. spno+="; ";
  12163. }
  12164. }
  12165. if(spno.Right (6)==" 加挑:")
  12166. {
  12167. spno=spno.Left (spno.GetLength ()-6);
  12168. }
  12169. ////////////////////////////////////////////////////////////////
  12170. int rcpos=-1;
  12171. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12172. m_Print.SetFontFace(17, 1, "宋体");
  12173. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12174. StrRect.top -=0;
  12175. StrRect.bottom -=10;
  12176. StrRect.left -=140;
  12177. StrRect.right =StrRect.left+48;
  12178. m_Print.SetFontFace(15, 1, "宋体");
  12179. m_Print.SetColor(0xffffff);
  12180. m_Print.DrawRect(StrRect, 0);
  12181. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12182. StrRect.left =StrRect.right ;
  12183. StrRect.right =StrRect.left+48;
  12184. m_Print.DrawRect(StrRect, RGB(255,0,0));
  12185. m_Print.SetColor(0, RGB(255,0,0));
  12186. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12187. m_Print.SetColor(0);
  12188. m_Print.SetFontFace(12, 1, "宋体");
  12189. StrRect.left -=48;
  12190. int hei=StrRect.Height ();
  12191. StrRect.top =StrRect.bottom+2;
  12192. StrRect.bottom +=hei+2;
  12193. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12194. StrRect.top =StrRect.bottom-2;
  12195. StrRect.bottom +=hei-5;
  12196. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12197. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12198. m_Print.SetFontFace(12, 1, "宋体");
  12199. m_Print.DrawText((LPTSTR)(LPCTSTR)"加做取件单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12200. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12201. m_Print.SetFontFace(11, 1, "宋体");
  12202. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+m_id), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12203. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12204. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12205. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12206. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12207. m_Print.DrawRect2(StrRect, 2);
  12208. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12209. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12210. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12211. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12212. m_Print.DrawRect2(StrRect, 2);
  12213. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12214. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12215. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12216. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time4, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12217. m_Print.DrawRect2(StrRect, 2);
  12218. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12219. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12220. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12221. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12222. m_Print.DrawRect2(StrRect, 2);
  12223. ////////////
  12224. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12225. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12226. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12227. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12228. m_Print.DrawRect2(StrRect, 2);
  12229. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12230. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12231. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12232. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12233. m_Print.DrawRect2(StrRect, 2);
  12234. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12235. m_Print.DrawText((LPTSTR)(LPCTSTR)"赠送张数:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12236. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12237. m_Print.DrawText((LPTSTR)(LPCTSTR)m_photocount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12238. m_Print.DrawRect2(StrRect, 2);
  12239. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12240. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12241. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12242. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12243. m_Print.DrawRect2(StrRect, 2);
  12244. ////////////
  12245. ///////////spno
  12246. CRect sprc[22];
  12247. StrRect=load.m_rcarray .ElementAt (19);
  12248. StrRect.left +=4;StrRect.right -=3;
  12249. hei=StrRect.Height ();
  12250. for(i=0; i<22; i++)
  12251. {
  12252. sprc[i]=StrRect;
  12253. m_Print.DrawRect2(StrRect, 1);
  12254. if(i==0)
  12255. {
  12256. StrRect.left +=5;
  12257. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12258. StrRect.left -=5;
  12259. }
  12260. StrRect.top =StrRect.bottom ;
  12261. StrRect.bottom =StrRect.top +hei;
  12262. sprc[i].left +=4;sprc[i].right -=3;
  12263. }
  12264. StrRect.bottom =StrRect.top +60;
  12265. m_Print.DrawRect2(StrRect, 1);
  12266. StrRect.left +=3; StrRect.top +=3;
  12267. StrRect.right -=3; StrRect.bottom -=3;
  12268. AutoDraw(m_Print, StrRect, m_bz, 1.8);
  12269. CString temp,tempspno,tempbz;
  12270. CSize size;
  12271. BOOL bRun=0;
  12272. int fontsize=12;
  12273. ll: tempspno=spno;
  12274. m_Print.SetFontFace(fontsize, 1, "宋体");
  12275. for( i=1; i<22; i++)
  12276. {
  12277. if(!tempspno.IsEmpty ())
  12278. {
  12279. temp=tempspno;
  12280. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12281. int right=0;
  12282. CRect temprc=sprc[i];
  12283. while(size.cx>temprc.Width ())
  12284. {
  12285. right++;
  12286. temp=tempspno.Left (tempspno.GetLength ()-(right));
  12287. if(GIsHalfHZ(temp))
  12288. {
  12289. right++;
  12290. temp.Delete (temp.GetLength ()-1);
  12291. }
  12292. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12293. }
  12294. if(bRun)
  12295. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12296. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  12297. if(tempspno.IsEmpty ())i++;
  12298. }
  12299. }
  12300. if(tempspno.IsEmpty ()==0)//|| tempbz.IsEmpty ()==0)
  12301. {
  12302. fontsize--;
  12303. goto ll;
  12304. }
  12305. if(bRun==0)
  12306. {
  12307. bRun=1;
  12308. goto ll;
  12309. }
  12310. m_Print.SetFontFace(12, 1, "宋体");
  12311. StrRect=load2.m_rcarray .ElementAt (1);
  12312. m_Print.DrawText((LPTSTR)(LPCTSTR)"喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12313. StrRect=load2.m_rcarray .ElementAt (2);
  12314. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12315. StrRect=load2.m_rcarray .ElementAt (3);
  12316. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12317. StrRect=load2.m_rcarray .ElementAt (4);
  12318. m_Print.DrawRect2(StrRect, 2);
  12319. StrRect=load2.m_rcarray .ElementAt (0);
  12320. CString str="\
  12321. 爱心提示:如对制作有任何要求请清楚列出,所有制作内容一经确认将按要求制作。\r\n\
  12322. 选样文件从拍摄日期计算将保留二个月;套相成品按取件日期保留三个月,逾期不做保留。\r\n\
  12323. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12324. AutoDraw(m_Print, StrRect, str, 1.8);
  12325. PrintPreview dlg;dlg.m_mode=2;
  12326. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  12327. dlg.m_pDC =m_Print.GetPDC() ;
  12328. if(dlg.DoModal ()!=IDOK)return;
  12329. //结束打印
  12330. m_Print.EndPage();
  12331. m_Print.EndPrint();
  12332. }
  12333. //分店
  12334. CString CMainFrame::GetDanWei(CString name, CArray<CStringArray, CStringArray>*array)
  12335. {
  12336. for(int i=0; i<array->GetSize (); i++)
  12337. {
  12338. if(name==array->ElementAt (i).ElementAt (1) )
  12339. return array->ElementAt (i).ElementAt (2);
  12340. }
  12341. return "";
  12342. }
  12343. //g_sendhead
  12344. int CMainFrame::GetPort()
  12345. {
  12346. static int aaa=-1;
  12347. if(aaa==-1)
  12348. {
  12349. aaa=CTime::GetCurrentTime ().GetSecond ()%7;
  12350. }
  12351. aaa++;
  12352. if(aaa>=7)aaa=0;
  12353. return 8387+aaa;
  12354. }
  12355. void CMainFrame::OnShowBakState()
  12356. {
  12357. // TODO: Add your command handler code here
  12358. g_sendhead.bsql=0;
  12359. g_sendhead.code[0]=171;
  12360. g_sendhead.tabcount=1;
  12361. g_pMainWnd->ProcessChatMessageRequest2(1);
  12362. if(g_bSendOK==0)
  12363. {
  12364. return;
  12365. }
  12366. CArray<CStringArray, CStringArray>g_bakstatearray;
  12367. DataToArray(&g_bakstatearray);
  12368. while(g_bakstatearray.GetSize()>7)
  12369. {
  12370. g_bakstatearray.RemoveAt(0);
  12371. }
  12372. int photocount=0;
  12373. int infocount=0;
  12374. for(int i=0; i<g_bakstatearray.GetSize(); i++)
  12375. {
  12376. if(g_bakstatearray.ElementAt(i).ElementAt(1)!="1")photocount++;
  12377. if(g_bakstatearray.ElementAt(i).ElementAt(2)!="1")infocount++;
  12378. }
  12379. ShowBakState dlg;
  12380. dlg.m_pArray=&g_bakstatearray;
  12381. dlg.DoModal ();
  12382. }
  12383. void CMainFrame::PrintReceipt2(CStringArray *pArray)
  12384. {
  12385. int i = 0;
  12386. int printcot=1;
  12387. for(int aa=0; aa<printcot; aa++)
  12388. {
  12389. g_sendhead.bsql=0;
  12390. g_sendhead.code[0]=24;
  12391. g_sendhead.tabcount=1;
  12392. int g_nYearposTemp=g_nYearpos;
  12393. g_nYearpos=-1;
  12394. g_pMainWnd->ProcessChatMessageRequest2(1);
  12395. g_nYearpos=g_nYearposTemp;
  12396. if(0==g_bSendOK)return;
  12397. DataToArray(&g_cominfoarray);
  12398. CString SerialNo;
  12399. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127))+1);
  12400. CPrintRX m_Print;
  12401. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12402. {
  12403. m_Print.InitToPrint(NULL, 1);
  12404. }
  12405. else
  12406. {
  12407. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  12408. if(name.IsEmpty ())
  12409. m_Print.InitToPrint(NULL, 1);
  12410. else
  12411. {
  12412. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12413. if(nret==-1 && aa==0)
  12414. {
  12415. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12416. }
  12417. }
  12418. }
  12419. m_Print.StartPrint();
  12420. m_Print.StartPage();
  12421. LoadRect load;
  12422. BOOL bSmall=0;
  12423. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  12424. {
  12425. bSmall=1;
  12426. load.SetLiaPath ("20.lia");
  12427. }
  12428. else
  12429. load.SetLiaPath ("10.lia");
  12430. if(bSmall)
  12431. load.SetMargins(-10,0);
  12432. else
  12433. load.SetMargins(10,0);
  12434. if(!load.Load ())return;
  12435. int rcpos=-1;
  12436. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12437. Image *pImg=NULL;
  12438. #ifdef MNLS_VERSION
  12439. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  12440. #else
  12441. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  12442. #endif
  12443. // m_Print.DrawImage(pImg, StrRect);
  12444. delete pImg;
  12445. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  12446. {
  12447. Image *pImg=NULL;
  12448. g_nSendCode=31;
  12449. int g_nYearposTemp=g_nYearpos;
  12450. g_nYearpos=-1;
  12451. g_pMainWnd->ProcessChatMessageRequest2(1);
  12452. g_nYearpos=g_nYearposTemp;
  12453. g_nSendCode=0;
  12454. if(g_bSendOK==0)return;
  12455. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  12456. if(pImg)
  12457. {
  12458. StrRect.left=65;
  12459. if(bSmall)StrRect.left=55;
  12460. StrRect.top=10;
  12461. StrRect.right=StrRect.left+58;
  12462. StrRect.bottom=StrRect.top+58;
  12463. m_Print.DrawImage(pImg, StrRect);
  12464. delete pImg;pImg=NULL;
  12465. }
  12466. }
  12467. if(bSmall)
  12468. {
  12469. m_Print.SetFontFace(18, 1, "黑体");
  12470. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12471. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12472. m_Print.SetFontFace(9, 1, "宋体");
  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(6, 1, "宋体");
  12476. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12477. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12478. m_Print.SetFontFace(9, 1, "宋体");
  12479. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12480. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12481. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12482. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12483. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12484. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12485. int hei=StrRect.Height ();
  12486. StrRect.bottom=StrRect.top;
  12487. StrRect.top -=8;
  12488. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12489. m_Print.SetFontFace(10, 1, "宋体");
  12490. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12491. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12492. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12493. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12494. m_Print.SetFontFace(9, 1, "宋体");
  12495. for( i=7; i<24; i++)
  12496. {
  12497. StrRect=load.m_rcarray .ElementAt (i);
  12498. m_Print.DrawRect2(StrRect, 1);
  12499. }
  12500. for( i=9; i<24; i++)
  12501. {
  12502. StrRect=load.m_rcarray .ElementAt (i);
  12503. StrRect.left +=2;
  12504. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12505. }
  12506. m_Print.SetFontFace(6, 1, "宋体");
  12507. for(i=24; i<26; i++)
  12508. {
  12509. StrRect=load.m_rcarray .ElementAt (i);
  12510. StrRect.left +=2;
  12511. if(i==24)
  12512. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12513. else
  12514. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12515. }
  12516. }
  12517. else//大单
  12518. {
  12519. m_Print.SetFontFace(20, 1, "黑体");
  12520. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12521. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12522. m_Print.SetFontFace(11, 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);StrRect.right -=15;
  12526. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12527. int hei=StrRect.Height ();
  12528. StrRect.bottom=StrRect.top;
  12529. StrRect.top -=10;
  12530. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12531. m_Print.SetFontFace(8, 1, "宋体");
  12532. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12533. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12534. m_Print.SetFontFace(11, 1, "宋体");
  12535. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12536. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12537. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12538. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12539. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12540. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12541. m_Print.SetFontFace(13, 1, "宋体");
  12542. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12543. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12544. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12545. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12546. m_Print.SetFontFace(11, 1, "宋体");
  12547. for( i=7; i<24; i++)
  12548. {
  12549. StrRect=load.m_rcarray .ElementAt (i);
  12550. m_Print.DrawRect2(StrRect, 1);
  12551. }
  12552. for( i=9; i<24; i++)
  12553. {
  12554. StrRect=load.m_rcarray .ElementAt (i);
  12555. StrRect.left +=2;
  12556. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12557. }
  12558. m_Print.SetFontFace(8, 1, "宋体");
  12559. for(i=24; i<27; i++)
  12560. {
  12561. StrRect=load.m_rcarray .ElementAt (i);
  12562. StrRect.left +=2;
  12563. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12564. }
  12565. }
  12566. PrintPreview dlg;
  12567. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  12568. dlg.m_pDC =m_Print.GetPDC() ;
  12569. if(aa==0)
  12570. {
  12571. if(dlg.DoModal ()!=IDOK)
  12572. return;
  12573. printcot=dlg.m_num;
  12574. }
  12575. //结束打印
  12576. m_Print.EndPage();
  12577. m_Print.EndPrint();
  12578. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127))+1);
  12579. CString sql;
  12580. sql.Format("update version set [serialno2]='%s'", SerialNo);
  12581. g_sendhead.bsql=1;
  12582. g_nYearposTemp=g_nYearpos;
  12583. g_nYearpos=-1;
  12584. g_pMainWnd->ProcessChatMessageRequest2(sql);
  12585. g_nYearpos=g_nYearposTemp;
  12586. }
  12587. }
  12588. //出生年月
  12589. //第一联
  12590. void CMainFrame::OnLog()
  12591. {
  12592. // TODO: Add your command handler code here OnShowBakState
  12593. if(IsHasRightsnew(49)==0)return;
  12594. ShowLOg dlg;
  12595. dlg.DoModal ();
  12596. }
  12597. // www.lyfz.net 8888
  12598. void CMainFrame::PrintDinDan6(CString m_id)
  12599. {
  12600. // TODO: Add your control notification handler code here 预约订单
  12601. int printcot=1;
  12602. for(int aa=0; aa<printcot; aa++)
  12603. {
  12604. PrintPreview dlg;
  12605. CPrintRX m_Print;
  12606. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12607. {
  12608. m_Print.InitToPrint(NULL, 1);
  12609. }
  12610. else
  12611. {
  12612. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  12613. if(name.IsEmpty ())
  12614. m_Print.InitToPrint(NULL, 1);
  12615. else
  12616. {
  12617. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12618. if(nret==-1 && aa==0)
  12619. {
  12620. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12621. }
  12622. }
  12623. }
  12624. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==3)
  12625. {
  12626. m_Print.StartPrint();
  12627. m_Print.StartPage();
  12628. LoadRect load;
  12629. load.SetLiaPath ("6.lia");
  12630. load.SetMargins(-14,15);
  12631. if(!load.Load ())return;
  12632. LoadRect load2;
  12633. load2.SetLiaPath ("7.lia");
  12634. load2.SetMargins(-14,216+15);
  12635. if(!load2.Load ())return;
  12636. LoadRect load3;
  12637. load3.SetLiaPath ("8.lia");
  12638. load3.SetMargins(-14,705+15);
  12639. if(!load3.Load ())return;
  12640. int i;
  12641. //////////////////////////////////////////////////////////////
  12642. CStringArray txarray;
  12643. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  12644. g_sendhead.code[0]=11;
  12645. g_sendhead.code[1]=52;
  12646. g_sendhead.code[2]=50;
  12647. g_sendhead.code[3]=150;
  12648. g_sendhead.code[4]=77;
  12649. g_sendhead.code[5]=4;
  12650. g_sendhead.tabcount=6;
  12651. g_sendhead.bsql=0;
  12652. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  12653. CArray<CStringArray, CStringArray>sparray;
  12654. CArray<CStringArray, CStringArray>clientarray;
  12655. CArray<CStringArray, CStringArray>phonearray;
  12656. CArray<CStringArray, CStringArray>fgarray;
  12657. CArray<CStringArray, CStringArray>danweiarray;
  12658. CArray<CStringArray, CStringArray>jdarray;
  12659. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  12660. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  12661. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  12662. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  12663. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  12664. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  12665. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  12666. CString m_taoxiname;
  12667. if(m_zs.Find ("\\")!=-1)
  12668. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底\\入册:"+g_List1array.ElementAt (0).ElementAt (9);
  12669. else
  12670. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底:"+g_List1array.ElementAt (0).ElementAt (9);
  12671. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  12672. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  12673. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  12674. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  12675. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  12676. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  12677. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  12678. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  12679. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  12680. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  12681. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  12682. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  12683. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  12684. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  12685. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  12686. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  12687. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  12688. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  12689. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  12690. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  12691. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  12692. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  12693. if(jdarray.GetSize ())
  12694. {
  12695. if(m_bz.IsEmpty ()==0)
  12696. m_bz="\r\n"+m_bz;
  12697. m_bz+="景点:";
  12698. }
  12699. for( i=0; i<jdarray.GetSize (); i++)
  12700. {
  12701. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  12702. }
  12703. m_bz.TrimRight (";");
  12704. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  12705. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  12706. if(IsHasRights2new(31)==0)
  12707. {
  12708. m_phone1="***";
  12709. m_phone2="***";
  12710. }
  12711. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  12712. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  12713. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  12714. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  12715. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  12716. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  12717. filter="name='"+m_ren+"'";
  12718. g_sendhead.code[0]=5;
  12719. g_sendhead.tabcount=1;
  12720. g_sendhead.bsql=0;
  12721. int g_nYearposTemp=g_nYearpos;
  12722. g_nYearpos=-1;
  12723. g_pMainWnd->ProcessChatMessageRequest2(filter);
  12724. g_nYearpos=g_nYearposTemp;
  12725. if(g_bSendOK==0)return;
  12726. DataToArray(&phonearray);
  12727. m_money1.Format ("%f", atof(m_taoxijiage));
  12728. m_money2.Format ("%f", atof(m_payed1));
  12729. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  12730. ConvertToPrice(m_money1);
  12731. ConvertToPrice(m_money2);
  12732. ConvertToPrice(m_money3);
  12733. ////////////////////////////////////////////////////////////////
  12734. int rcpos=-1;
  12735. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12736. StrRect.top -=15;StrRect.bottom -=15;
  12737. Image *pImg=NULL;
  12738. #ifdef MNLS_VERSION
  12739. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  12740. #else
  12741. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  12742. #endif
  12743. m_Print.DrawImage(pImg, StrRect);
  12744. delete pImg;
  12745. m_Print.SetFontFace(11, 1, "宋体");
  12746. StrRect=load.m_rcarray .ElementAt (20);
  12747. StrRect.right=load.m_rcarray .ElementAt (23).right;
  12748. StrRect.top -=18;StrRect.bottom -=18;
  12749. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  12750. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12751. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  12752. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12753. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12754. StrRect.top -=15;StrRect.bottom -=15;
  12755. #ifdef MNLS_VERSION
  12756. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12757. #endif
  12758. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12759. StrRect.top -=15;StrRect.bottom -=15;
  12760. #ifdef MNLS_VERSION
  12761. m_Print.DrawRect(StrRect);
  12762. #endif
  12763. m_Print.SetFontFace(7, 1, "黑体");
  12764. m_Print.SetColor(0xffffff);
  12765. #ifdef MNLS_VERSION
  12766. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12767. #endif
  12768. m_Print.SetColor(0);
  12769. m_Print.SetFontFace(15, 1, "宋体");
  12770. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12771. StrRect.top -=15;StrRect.bottom -=15;
  12772. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同拍摄单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12773. CStringArray strarray;
  12774. strarray.Add("NO: "+m_id);
  12775. CString date;
  12776. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  12777. strarray.Add(date);
  12778. strarray.Add("喜爱");
  12779. strarray.Add("格调");
  12780. if(fgarray.GetSize ()==12)
  12781. {
  12782. for(int i=0; i<12; i++)
  12783. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  12784. }
  12785. else
  12786. {
  12787. strarray.Add("复古典雅");
  12788. strarray.Add("温文尔雅");
  12789. strarray.Add("豪华艳丽");
  12790. strarray.Add("传统大方");
  12791. strarray.Add("新潮个性");
  12792. strarray.Add("浪漫奔放");
  12793. strarray.Add("简单素雅");
  12794. strarray.Add("活泼俏丽");
  12795. strarray.Add("妩媚温馨");
  12796. strarray.Add("温柔贤惠");
  12797. strarray.Add("成熟感性");
  12798. strarray.Add("清纯可爱");
  12799. }
  12800. strarray.Add("姓名");
  12801. // strarray.Add("职业");
  12802. strarray.Add("");
  12803. strarray.Add("地址");
  12804. strarray.Add("电话");
  12805. #ifdef CHILD_VERSION
  12806. strarray.Add("家长");
  12807. strarray.Add("宝宝");
  12808. #else
  12809. strarray.Add("先生");
  12810. strarray.Add("女士");
  12811. #endif
  12812. m_Print.SetFontFace(11, 1, "宋体");
  12813. for( i=0; i<strarray.GetSize (); i++)
  12814. {
  12815. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12816. if(i<2)
  12817. {
  12818. StrRect.top -=15;StrRect.bottom -=15;
  12819. }
  12820. if(i>15)
  12821. m_Print.DrawRect2(StrRect, 1);
  12822. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12823. }
  12824. for( i=29; i<=40; i++)
  12825. {
  12826. if(m_style.GetLength ()<=(i-29))continue;
  12827. if(m_style.GetAt (i-29)!='1')continue;
  12828. StrRect=load.m_rcarray .ElementAt (i-1);
  12829. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12830. }
  12831. for( i=27; i<=48; i++)
  12832. {
  12833. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12834. m_Print.DrawRect2(StrRect, 1);
  12835. }
  12836. #ifdef CHILD_VERSION
  12837. StrRect=load.m_rcarray .ElementAt (45);
  12838. StrRect.right =StrRect.left +62;
  12839. m_Print.DrawRect2(StrRect, 1);
  12840. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12841. StrRect.left =StrRect.right ;
  12842. StrRect.right =StrRect.left +62;
  12843. m_Print.DrawRect2(StrRect, 1);
  12844. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12845. StrRect.left =StrRect.right ;
  12846. StrRect.right =StrRect.left +62;
  12847. m_Print.DrawRect2(StrRect, 1);
  12848. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12849. StrRect.left =StrRect.right ;
  12850. StrRect.right =StrRect.left +62;
  12851. m_Print.DrawRect2(StrRect, 1);
  12852. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12853. #endif
  12854. /////////////////////////
  12855. strarray.RemoveAll ();
  12856. CString temp;
  12857. temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  12858. strarray.Add (temp);
  12859. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  12860. strarray.Add (temp);
  12861. strarray.Add ("化妆");
  12862. strarray.Add ("造型");
  12863. #ifdef CHILD_VERSION
  12864. strarray.Add ("");
  12865. #else
  12866. strarray.Add ("婚纱");
  12867. #endif
  12868. strarray.Add ("服饰");
  12869. strarray.Add ("配");
  12870. strarray.Add ("置");
  12871. strarray.Add ("其");
  12872. strarray.Add ("它");
  12873. strarray.Add ("套系名称");
  12874. strarray.Add ("镜款");
  12875. strarray.Add ("套系总价");
  12876. strarray.Add ("主摄影师");
  12877. strarray.Add ("拍摄日期");
  12878. strarray.Add ("预约金");
  12879. #ifdef CHILD_VERSION
  12880. strarray.Add ("主引导师");
  12881. #else
  12882. strarray.Add ("主化妆师");
  12883. #endif
  12884. strarray.Add ("看样日期");
  12885. strarray.Add ("补 余 款");
  12886. strarray.Add ("总监");
  12887. strarray.Add ("取件日期");
  12888. rcpos=-1;
  12889. for( i=0; i<strarray.GetSize (); i++)
  12890. {
  12891. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  12892. if(i>9)
  12893. m_Print.DrawRect2(StrRect, 1);
  12894. #ifdef CHILD_VERSION
  12895. if(i==5)
  12896. StrRect.top -=StrRect.Height ();
  12897. #endif
  12898. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12899. }
  12900. for( i=22; i<=41; i++)
  12901. {
  12902. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  12903. m_Print.DrawRect2(StrRect, 1);
  12904. }
  12905. /////////////////////////////
  12906. strarray.RemoveAll ();
  12907. #ifdef CHILD_VERSION
  12908. strarray.Add ("顾客方 家长:");
  12909. strarray.Add ("宝宝:");
  12910. #else
  12911. strarray.Add ("顾客方 先生:");
  12912. strarray.Add ("女士:");
  12913. #endif
  12914. strarray.Add ("电话:");
  12915. strarray.Add ("影楼方 店长:");
  12916. strarray.Add ("接单人:");
  12917. strarray.Add ("电话:");
  12918. rcpos=-1;
  12919. for( i=0; i<strarray.GetSize (); i++)
  12920. {
  12921. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  12922. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12923. }
  12924. for( i=7; i<=12; i++)
  12925. {
  12926. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  12927. // if(i!=10)
  12928. m_Print.DrawRect2(StrRect, 2);
  12929. }
  12930. //////////////////////////////////////
  12931. //开始打数据
  12932. strarray.RemoveAll ();
  12933. strarray.Add (m_name1);
  12934. strarray.Add (m_name2);
  12935. strarray.Add ("");
  12936. strarray.Add ("");
  12937. strarray.Add (m_addr1);
  12938. #ifdef CHILD_VERSION
  12939. strarray.Add ("");
  12940. #else
  12941. strarray.Add (m_addr2);
  12942. #endif
  12943. strarray.Add (m_phone1);
  12944. strarray.Add (m_phone2);
  12945. for( i=41; i<=48; i++)
  12946. {
  12947. StrRect=load.m_rcarray .ElementAt (i-1);
  12948. StrRect.left +=4;
  12949. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12950. }
  12951. ///////////////////////////////
  12952. strarray.RemoveAll ();
  12953. strarray.Add (m_money1);
  12954. strarray.Add (m_waiter1);
  12955. strarray.Add (m_time2);
  12956. strarray.Add (m_money2);
  12957. strarray.Add (m_waiter2);
  12958. strarray.Add (m_time4);
  12959. strarray.Add (m_money3);
  12960. strarray.Add ("");
  12961. strarray.Add (m_time5);
  12962. for( i=32; i<=40; i++)
  12963. {
  12964. StrRect=load2.m_rcarray .ElementAt (i-1);
  12965. StrRect.left +=4;
  12966. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12967. }
  12968. ///////////////////////////////
  12969. strarray.RemoveAll ();
  12970. strarray.Add ("");//m_name1);
  12971. strarray.Add ("");//m_name2);
  12972. CString phone;
  12973. if(m_phone1.IsEmpty ()==0)
  12974. phone=m_phone1+",";
  12975. phone+=m_phone2;
  12976. phone.TrimRight (",");
  12977. strarray.Add ("");//phone);
  12978. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  12979. strarray.Add (m_ren);
  12980. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  12981. for( i=7; i<=12; i++)
  12982. {
  12983. StrRect=load3.m_rcarray .ElementAt (i-1);
  12984. StrRect.left +=4;
  12985. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12986. }
  12987. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  12988. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12989. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  12990. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12991. StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  12992. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12993. //////////////////////////////
  12994. //开始画文字
  12995. StrRect=load2.m_rcarray .ElementAt (30);
  12996. StrRect.left +=3;
  12997. StrRect.top +=3;
  12998. StrRect.right -=2;
  12999. StrRect.bottom -=2;
  13000. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  13001. StrRect=load2.m_rcarray .ElementAt (29);
  13002. StrRect.left +=3;
  13003. StrRect.top +=3;
  13004. StrRect.right -=2;
  13005. StrRect.bottom -=2;
  13006. str="";
  13007. for(i=0; i<sparray.GetSize (); i++)
  13008. {
  13009. str+=sparray.ElementAt (i).ElementAt (5);
  13010. str+=" 数量:";
  13011. str+=sparray.ElementAt (i).ElementAt (3);
  13012. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  13013. str+="\r\n";
  13014. }
  13015. str.TrimRight ("\r\n");
  13016. AutoDraw(m_Print, StrRect, str, 1.4);
  13017. StrRect=load2.m_rcarray .ElementAt (40);
  13018. StrRect.top +=8;
  13019. m_Print.SetFontFace(12, 1, "黑体");
  13020. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  13021. StrRect.left +=3;
  13022. StrRect.top +=30;
  13023. StrRect.right -=2;
  13024. StrRect.bottom -=2;
  13025. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  13026. if(str.IsEmpty ())
  13027. {
  13028. str="\
  13029. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  13030. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  13031. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  13032. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  13033. 持良好的心境.\r\n\
  13034. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  13035. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  13036. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  13037. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  13038. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  13039. 勿进影室, 以免影响拍摄.\r\n\
  13040. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  13041. 师或店长沟通.\r\n\
  13042. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  13043. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  13044. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  13045. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  13046. 9. 本合同余额欠款须在拍照前付清.\r\n\
  13047. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  13048. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  13049. 还.";
  13050. }
  13051. AutoDraw(m_Print, StrRect, str, 1.8);
  13052. }
  13053. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13054. dlg.m_pDC =m_Print.GetPDC() ;
  13055. dlg.m_mode=1;
  13056. if(aa==0)
  13057. {
  13058. if(dlg.DoModal ()!=IDOK)
  13059. return;
  13060. printcot=dlg.m_num;
  13061. }
  13062. //结束打印
  13063. m_Print.EndPage();
  13064. m_Print.EndPrint();
  13065. }
  13066. }
  13067. void CMainFrame::InsideMsg()
  13068. {
  13069. ///内部消息
  13070. CString str;
  13071. g_sendhead.bsql=0;
  13072. g_sendhead.code[0]=126;
  13073. g_sendhead.tabcount=1;
  13074. g_bNoConnDlg=1;
  13075. g_pMainWnd->ProcessChatMessageRequest2(1);g_bNoConnDlg=0;
  13076. if(g_bSendOK==0)return;
  13077. CArray<CStringArray, CStringArray>m_List1array;
  13078. DataToArray(&g_List1array);//, &m_List1array);
  13079. int i = 0;
  13080. m_List1array.SetSize(g_List1array.GetSize ());
  13081. for( i=0; i<g_List1array.GetSize (); i++)
  13082. {
  13083. m_List1array.ElementAt (i).Copy (g_List1array.ElementAt (i));
  13084. }
  13085. str=","+g_user.name+",";
  13086. for( i=g_List1array.GetSize()-1; i>=0; i--)
  13087. {
  13088. CString receivers2=g_List1array.ElementAt (i).ElementAt (4);
  13089. receivers2.TrimLeft(",");
  13090. receivers2.TrimRight(",");
  13091. receivers2=","+receivers2+",";
  13092. CString receivers=g_List1array.ElementAt (i).ElementAt (3);
  13093. receivers.TrimLeft(",");
  13094. receivers.TrimRight(",");
  13095. receivers=","+receivers+",";
  13096. if(receivers.Find(str)==-1)
  13097. g_List1array.RemoveAt(i);
  13098. else if(receivers2.Find(str)!=-1)
  13099. g_List1array.RemoveAt(i);
  13100. }
  13101. if(g_List1array.GetSize())
  13102. {
  13103. ShowMsg dlg;
  13104. dlg.DoModal();
  13105. }
  13106. for( i=m_List1array.GetSize()-1; i>=0; i--)
  13107. {
  13108. CString receivers2=m_List1array.ElementAt (i).ElementAt (4);
  13109. receivers2.TrimLeft(",");
  13110. receivers2.TrimRight(",");
  13111. receivers2=","+receivers2+",";
  13112. CString receivers=m_List1array.ElementAt (i).ElementAt (3);
  13113. if(receivers!="")
  13114. m_List1array.RemoveAt(i);
  13115. else if(receivers2.Find(str)!=-1)
  13116. m_List1array.RemoveAt(i);
  13117. }
  13118. if(m_List1array.GetSize())
  13119. {
  13120. SendInsideMsg2 dlg;
  13121. dlg.m_bShow=1;
  13122. dlg.m_pArray=&m_List1array;
  13123. dlg.DoModal ();
  13124. }
  13125. }
  13126. //定金
  13127. void CMainFrame::PrintHireDress(CString m_id)
  13128. {
  13129. int printcot=1;
  13130. for(int aa=0; aa<printcot; aa++)
  13131. {
  13132. CPrintRX m_Print;
  13133. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13134. {
  13135. m_Print.InitToPrint(NULL, 1);
  13136. }
  13137. else
  13138. {
  13139. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  13140. if(name.IsEmpty ())
  13141. m_Print.InitToPrint(NULL, 1);
  13142. else
  13143. {
  13144. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13145. if(nret==-1 && aa==0)
  13146. {
  13147. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13148. }
  13149. }
  13150. }
  13151. m_Print.StartPrint();
  13152. m_Print.StartPage();
  13153. LoadRect load;
  13154. load.SetLiaPath ("21.lia");
  13155. load.SetMargins(0,0);
  13156. if(!load.Load ())return;
  13157. int i;
  13158. //////////////////////////////////////////////////////////////
  13159. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  13160. g_sendhead.bsql=0;
  13161. g_sendhead.code[0]=73;
  13162. g_sendhead.code[1]=74;
  13163. g_sendhead.code[2]=52;
  13164. g_sendhead.tabcount=3;
  13165. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13166. if(g_bSendOK==0)
  13167. {
  13168. return ;
  13169. }
  13170. CArray<CStringArray, CStringArray>dresshirearray;
  13171. CArray<CStringArray, CStringArray>dresshiredataarray;
  13172. CArray<CStringArray, CStringArray>clientarray;
  13173. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13174. if(dresshirearray.GetSize ()==0)return;
  13175. CString m_remark = dresshirearray.ElementAt (0).ElementAt (10);
  13176. CString m_date1 = dresshirearray.ElementAt (0).ElementAt (7);
  13177. CString m_date2 = dresshirearray.ElementAt (0).ElementAt (8);
  13178. CString m_inputdate = dresshirearray.ElementAt (0).ElementAt (6);
  13179. if(clientarray.GetSize ()==0)return ;
  13180. CString m_name2=clientarray.ElementAt (0).ElementAt (2);
  13181. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  13182. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  13183. CString m_time3=clientarray.ElementAt (0).ElementAt (20);
  13184. CString sItem;
  13185. for( i=0; i<dresshiredataarray.GetSize (); i++)
  13186. {
  13187. sItem+=dresshiredataarray.ElementAt (i).ElementAt (1);sItem+=" ";
  13188. sItem+=dresshiredataarray.ElementAt (i).ElementAt (2);
  13189. sItem+=" 数量:";
  13190. sItem+=dresshiredataarray.ElementAt (i).ElementAt (3)+"\r\n";
  13191. }
  13192. ////////////////////////////////////////////////////////////////
  13193. int rcpos=-1;
  13194. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  13195. m_Print.SetFontFace(17, 1, "宋体");
  13196. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13197. StrRect=load.m_rcarray .ElementAt (++rcpos);
  13198. m_Print.SetFontFace(10, 1, "宋体");
  13199. m_Print.DrawText((LPTSTR)(LPCTSTR)(m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13200. CStringArray strarray;
  13201. strarray.Add("客户姓名");
  13202. strarray.Add("客户电话");
  13203. strarray.Add("预定日期");
  13204. strarray.Add("结婚日期");
  13205. strarray.Add("取件日期");
  13206. strarray.Add("归还日期");
  13207. strarray.Add("本店地址");
  13208. strarray.Add("电 话");
  13209. strarray.Add("客户地址");
  13210. strarray.Add("客户签名");
  13211. for( i=2; i<12; i++)
  13212. {
  13213. StrRect=load.m_rcarray .ElementAt (i);
  13214. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13215. }
  13216. strarray.RemoveAll();
  13217. strarray.Add(m_name2);
  13218. strarray.Add(m_phone2);
  13219. strarray.Add(m_inputdate);
  13220. strarray.Add(m_time3);
  13221. strarray.Add(m_date1);
  13222. strarray.Add(m_date2);
  13223. strarray.Add(g_cominfoarray.ElementAt (0).ElementAt (12));
  13224. strarray.Add(g_cominfoarray.ElementAt (0).ElementAt (11));
  13225. strarray.Add(m_addr2);
  13226. strarray.Add("");
  13227. for( i=12; i<22; i++)
  13228. {
  13229. StrRect=load.m_rcarray .ElementAt (i);
  13230. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13231. m_Print.DrawRect2(StrRect, 2);
  13232. }
  13233. for( i=25; i<30; i++)
  13234. {
  13235. StrRect=load.m_rcarray .ElementAt (i);
  13236. m_Print.DrawRect2(StrRect, 1);
  13237. }
  13238. StrRect=load.m_rcarray .ElementAt (22);
  13239. StrRect.top +=7;
  13240. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13241. StrRect=load.m_rcarray .ElementAt (23);
  13242. StrRect.top +=7;
  13243. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13244. StrRect=load.m_rcarray .ElementAt (24);
  13245. StrRect.top +=7;
  13246. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13247. StrRect=load.m_rcarray .ElementAt (25);StrRect.left +=75;StrRect.top +=5;
  13248. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13249. StrRect=load.m_rcarray .ElementAt (26);StrRect.left +=75;StrRect.top +=5;
  13250. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13251. StrRect=load.m_rcarray .ElementAt (27);StrRect.left +=75;StrRect.top +=5;
  13252. CString str=(g_cominfoarray.ElementAt (0).ElementAt (132));
  13253. if(str.IsEmpty())
  13254. {
  13255. str="\
  13256. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13257. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13258. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13259. 4. 如有破损酌情赔偿.";
  13260. }
  13261. AutoDraw(m_Print, StrRect, str, 1.5);
  13262. PrintPreview dlg;
  13263. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13264. dlg.m_pDC =m_Print.GetPDC() ;
  13265. if(aa==0)
  13266. {
  13267. if(dlg.DoModal ()!=IDOK)
  13268. return;
  13269. printcot=dlg.m_num;
  13270. }
  13271. //结束打印
  13272. m_Print.EndPage();
  13273. m_Print.EndPrint();
  13274. }
  13275. }
  13276. // ****************************************************************************
  13277. // Jeff:
  13278. // 函数:PrintHireDress2
  13279. // 无参;
  13280. // 调用者:DinDanFrom.cpp
  13281. // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
  13282. // 当订单数大于1000,设置连接公司服务器开关量为真;
  13283. // ****************************************************************************
  13284. void CMainFrame::PrintHireDress2()
  13285. {
  13286. if(g_ncot>1000)g_bSendLYFZ=1;
  13287. // g_pMainWnd->SetTimer (7, 3000, NULL);
  13288. }
  13289. void CMainFrame::PrintTakeForm2(CArray<CStringArray, CStringArray>*Listarray)
  13290. {
  13291. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"选片客人明细表";
  13292. int pages=Listarray->GetSize ()/46;
  13293. if(Listarray->GetSize ()%46)pages++;
  13294. for(int aa=0; aa<pages; aa++)
  13295. {
  13296. PrintPreview dlg;
  13297. CPrintRX m_Print;
  13298. m_Print.InitToPrint(NULL, 1);
  13299. m_Print.StartPrint();
  13300. m_Print.StartPage();
  13301. CRect mainrc(0,0,560,793);
  13302. float fscale;
  13303. {
  13304. int w,h;
  13305. m_Print.GetWidHei(w , h );
  13306. fscale=(float)w/(float)h;
  13307. }
  13308. mainrc.DeflateRect (25, 40, 10, 0);
  13309. CRect rc,rc2;
  13310. rc=mainrc;
  13311. rc.bottom =rc.top ;
  13312. rc.top -=20;
  13313. m_Print.SetFontFace(16, 1, "黑体");
  13314. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13315. m_Print.SetFontFace(9, 1, "宋体");
  13316. CString str;
  13317. int wid[5]={200,110,70,85,62};
  13318. int hei=16;
  13319. if(fscale>0.71)hei=15;
  13320. rc=mainrc;
  13321. rc.bottom =rc.top +hei;
  13322. for(int i=0; i<47; i++)
  13323. {
  13324. rc2.top =rc.top +i*hei;
  13325. rc2.bottom =rc.bottom +i*hei;
  13326. rc2.left =rc.left ;
  13327. rc2.right =rc.left +wid[0];
  13328. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13329. for(int j=0; j<5; j++)
  13330. {
  13331. m_Print.DrawRect2(rc2, 1);
  13332. if(Listarray->GetSize ()>aa*46+i)
  13333. {
  13334. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13335. rc2.left +=3;
  13336. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13337. rc2.left -=3;
  13338. }
  13339. rc2.left +=wid[j];
  13340. rc2.right =rc2.left+wid[j+1];
  13341. }
  13342. }
  13343. rc2.top +=2;
  13344. rc2.left +=2;rc2.right =mainrc.right+4;
  13345. m_Print.SetFontFace(8, 1, "宋体");
  13346. str.Format (" 页:%d/%d", aa+1, pages);
  13347. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13348. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13349. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13350. dlg.m_pDC =m_Print.GetPDC() ;
  13351. // dlg.m_mode=1;
  13352. if(aa==0)
  13353. {
  13354. if(dlg.DoModal ()!=IDOK)
  13355. return;
  13356. }
  13357. //结束打印
  13358. m_Print.EndPage();
  13359. m_Print.EndPrint();
  13360. }
  13361. }
  13362. void CMainFrame::PrintTakeForm3(CArray<CStringArray, CStringArray>*Listarray)
  13363. {
  13364. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"看设计客人明细表";
  13365. int pages=Listarray->GetSize ()/46;
  13366. if(Listarray->GetSize ()%46)pages++;
  13367. for(int aa=0; aa<pages; aa++)
  13368. {
  13369. PrintPreview dlg;
  13370. CPrintRX m_Print;
  13371. m_Print.InitToPrint(NULL, 1);
  13372. m_Print.StartPrint();
  13373. m_Print.StartPage();
  13374. CRect mainrc(0,0,560,793);
  13375. float fscale;
  13376. {
  13377. int w,h;
  13378. m_Print.GetWidHei(w , h );
  13379. fscale=(float)w/(float)h;
  13380. }
  13381. mainrc.DeflateRect (25, 40, 10, 0);
  13382. CRect rc,rc2;
  13383. rc=mainrc;
  13384. rc.bottom =rc.top ;
  13385. rc.top -=20;
  13386. m_Print.SetFontFace(16, 1, "黑体");
  13387. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13388. m_Print.SetFontFace(9, 1, "宋体");
  13389. CString str;
  13390. int wid[5]={200,110,70,85,62};
  13391. int hei=16;
  13392. if(fscale>0.71)hei=15;
  13393. rc=mainrc;
  13394. rc.bottom =rc.top +hei;
  13395. for(int i=0; i<47; i++)
  13396. {
  13397. rc2.top =rc.top +i*hei;
  13398. rc2.bottom =rc.bottom +i*hei;
  13399. rc2.left =rc.left ;
  13400. rc2.right =rc.left +wid[0];
  13401. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13402. for(int j=0; j<5; j++)
  13403. {
  13404. m_Print.DrawRect2(rc2, 1);
  13405. if(Listarray->GetSize ()>aa*46+i)
  13406. {
  13407. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13408. rc2.left +=3;
  13409. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13410. rc2.left -=3;
  13411. }
  13412. rc2.left +=wid[j];
  13413. rc2.right =rc2.left+wid[j+1];
  13414. }
  13415. }
  13416. rc2.top +=2;
  13417. rc2.left +=2;rc2.right =mainrc.right+4;
  13418. m_Print.SetFontFace(8, 1, "宋体");
  13419. str.Format (" 页:%d/%d", aa+1, pages);
  13420. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13421. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13422. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13423. dlg.m_pDC =m_Print.GetPDC() ;
  13424. // dlg.m_mode=1;
  13425. if(aa==0)
  13426. {
  13427. if(dlg.DoModal ()!=IDOK)
  13428. return;
  13429. }
  13430. //结束打印
  13431. m_Print.EndPage();
  13432. m_Print.EndPrint();
  13433. }
  13434. }
  13435. void CMainFrame::PrintTakeForm4(CArray<CStringArray, CStringArray>*Listarray)
  13436. {
  13437. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"取件客人明细表";
  13438. int pages=Listarray->GetSize ()/46;
  13439. if(Listarray->GetSize ()%46)pages++;
  13440. for(int aa=0; aa<pages; aa++)
  13441. {
  13442. PrintPreview dlg;
  13443. CPrintRX m_Print;
  13444. m_Print.InitToPrint(NULL, 1);
  13445. m_Print.StartPrint();
  13446. m_Print.StartPage();
  13447. CRect mainrc(0,0,560,793);
  13448. float fscale;
  13449. {
  13450. int w,h;
  13451. m_Print.GetWidHei(w , h );
  13452. fscale=(float)w/(float)h;
  13453. }
  13454. mainrc.DeflateRect (25, 40, 10, 0);
  13455. CRect rc,rc2;
  13456. rc=mainrc;
  13457. rc.bottom =rc.top ;
  13458. rc.top -=20;
  13459. m_Print.SetFontFace(16, 1, "黑体");
  13460. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13461. m_Print.SetFontFace(9, 1, "宋体");
  13462. CString str;
  13463. int wid[5]={200,110,70,85,62};
  13464. int hei=16;
  13465. if(fscale>0.71)hei=15;
  13466. rc=mainrc;
  13467. rc.bottom =rc.top +hei;
  13468. for(int i=0; i<47; i++)
  13469. {
  13470. rc2.top =rc.top +i*hei;
  13471. rc2.bottom =rc.bottom +i*hei;
  13472. rc2.left =rc.left ;
  13473. rc2.right =rc.left +wid[0];
  13474. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13475. for(int j=0; j<5; j++)
  13476. {
  13477. m_Print.DrawRect2(rc2, 1);
  13478. if(Listarray->GetSize ()>aa*46+i)
  13479. {
  13480. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13481. rc2.left +=3;
  13482. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13483. rc2.left -=3;
  13484. }
  13485. rc2.left +=wid[j];
  13486. rc2.right =rc2.left+wid[j+1];
  13487. }
  13488. }
  13489. rc2.top +=2;
  13490. rc2.left +=2;rc2.right =mainrc.right+4;
  13491. m_Print.SetFontFace(8, 1, "宋体");
  13492. str.Format (" 页:%d/%d", aa+1, pages);
  13493. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13494. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13495. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13496. dlg.m_pDC =m_Print.GetPDC() ;
  13497. // dlg.m_mode=1;
  13498. if(aa==0)
  13499. {
  13500. if(dlg.DoModal ()!=IDOK)
  13501. return;
  13502. }
  13503. //结束打印
  13504. m_Print.EndPage();
  13505. m_Print.EndPrint();
  13506. }
  13507. }
  13508. void CMainFrame::PrintTakeForm5(CArray<CStringArray, CStringArray>*Listarray)
  13509. {
  13510. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"婚庆客人明细表";
  13511. int pages=Listarray->GetSize ()/46;
  13512. if(Listarray->GetSize ()%46)pages++;
  13513. for(int aa=0; aa<pages; aa++)
  13514. {
  13515. PrintPreview dlg;
  13516. CPrintRX m_Print;
  13517. m_Print.InitToPrint(NULL, 1);
  13518. m_Print.StartPrint();
  13519. m_Print.StartPage();
  13520. CRect mainrc(0,0,560,793);
  13521. float fscale;
  13522. {
  13523. int w,h;
  13524. m_Print.GetWidHei(w , h );
  13525. fscale=(float)w/(float)h;
  13526. }
  13527. mainrc.DeflateRect (25, 40, 10, 0);
  13528. CRect rc,rc2;
  13529. rc=mainrc;
  13530. rc.bottom =rc.top ;
  13531. rc.top -=20;
  13532. m_Print.SetFontFace(16, 1, "黑体");
  13533. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13534. m_Print.SetFontFace(8, 1, "宋体");
  13535. CString str;
  13536. int wid[7]={165,90,90,45,45,60,35};
  13537. int hei=16;
  13538. if(fscale>0.71)hei=15;
  13539. rc=mainrc;
  13540. rc.bottom =rc.top +hei;
  13541. for(int i=0; i<47; i++)
  13542. {
  13543. rc2.top =rc.top +i*hei;
  13544. rc2.bottom =rc.bottom +i*hei;
  13545. rc2.left =rc.left ;
  13546. rc2.right =rc.left +wid[0];
  13547. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13548. for(int j=0; j<7; j++)
  13549. {
  13550. m_Print.DrawRect2(rc2, 1);
  13551. if(Listarray->GetSize ()>aa*46+i)
  13552. {
  13553. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13554. rc2.left +=3;
  13555. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13556. rc2.left -=3;
  13557. }
  13558. rc2.left +=wid[j];
  13559. rc2.right =rc2.left+wid[j+1];
  13560. }
  13561. }
  13562. rc2.top +=2;
  13563. rc2.left +=2;rc2.right =mainrc.right+4;
  13564. m_Print.SetFontFace(8, 1, "宋体");
  13565. str.Format (" 页:%d/%d", aa+1, pages);
  13566. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13567. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13568. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13569. dlg.m_pDC =m_Print.GetPDC() ;
  13570. // dlg.m_mode=1;
  13571. if(aa==0)
  13572. {
  13573. if(dlg.DoModal ()!=IDOK)
  13574. return;
  13575. }
  13576. //结束打印
  13577. m_Print.EndPage();
  13578. m_Print.EndPrint();
  13579. }
  13580. }
  13581. void CMainFrame::PrintTakeForm1(CArray<CStringArray, CStringArray>*Listarray)
  13582. {
  13583. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"拍照客人明细表";
  13584. int pages=Listarray->GetSize ()/46;
  13585. if(Listarray->GetSize ()%46)pages++;
  13586. for(int aa=0; aa<pages; aa++)
  13587. {
  13588. PrintPreview dlg;
  13589. CPrintRX m_Print;
  13590. m_Print.InitToPrint(NULL, 1);
  13591. m_Print.StartPrint();
  13592. m_Print.StartPage();
  13593. CRect mainrc(0,0,560,793);
  13594. float fscale;
  13595. {
  13596. int w,h;
  13597. m_Print.GetWidHei(w , h );
  13598. fscale=(float)w/(float)h;
  13599. }
  13600. mainrc.DeflateRect (25, 40, 10, 0);
  13601. CRect rc,rc2;
  13602. rc=mainrc;
  13603. rc.bottom =rc.top ;
  13604. rc.top -=20;
  13605. m_Print.SetFontFace(16, 1, "黑体");
  13606. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13607. m_Print.SetFontFace(8, 1, "宋体");
  13608. CString str;
  13609. int wid[7]={165,60,90,60,60,60,35};
  13610. int hei=16;
  13611. if(fscale>0.71)hei=15;
  13612. rc=mainrc;
  13613. rc.bottom =rc.top +hei;
  13614. for(int i=0; i<47; i++)
  13615. {
  13616. rc2.top =rc.top +i*hei;
  13617. rc2.bottom =rc.bottom +i*hei;
  13618. rc2.left =rc.left ;
  13619. rc2.right =rc.left +wid[0];
  13620. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13621. for(int j=0; j<7; j++)
  13622. {
  13623. m_Print.DrawRect2(rc2, 1);
  13624. if(Listarray->GetSize ()>aa*46+i)
  13625. {
  13626. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13627. rc2.left +=3;
  13628. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13629. rc2.left -=3;
  13630. }
  13631. rc2.left +=wid[j];
  13632. rc2.right =rc2.left+wid[j+1];
  13633. }
  13634. }
  13635. rc2.top +=2;
  13636. rc2.left +=2;rc2.right =mainrc.right+4;
  13637. m_Print.SetFontFace(8, 1, "宋体");
  13638. str.Format (" 页:%d/%d", aa+1, pages);
  13639. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13640. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13641. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13642. dlg.m_pDC =m_Print.GetPDC() ;
  13643. // dlg.m_mode=1;
  13644. if(aa==0)
  13645. {
  13646. if(dlg.DoModal ()!=IDOK)
  13647. return;
  13648. }
  13649. //结束打印
  13650. m_Print.EndPage();
  13651. m_Print.EndPrint();
  13652. }
  13653. }
  13654. void CMainFrame::ShowMonthForm2()
  13655. {
  13656. }
  13657. // dlg;