MainFrm.cpp 444 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309
  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. #ifdef _DEBUG
  140. #define new DEBUG_NEW
  141. #undef THIS_FILE
  142. static char THIS_FILE[] = __FILE__;
  143. #endif
  144. #ifndef WINVER
  145. #define WINVER 0x0400
  146. #endif
  147. #ifndef _WIN32_WINNT
  148. #define _WIN32_WINNT 0x0400
  149. #endif
  150. #ifndef _WIN32_WINDOWS
  151. #define _WIN32_WINDOWS 0x0410
  152. #endif
  153. #ifndef _WIN32_IE
  154. #define _WIN32_IE 0x0400
  155. #endif
  156. #include "uxtheme.h "
  157. typedef HTHEME(__stdcall * POPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
  158. typedef HRESULT(__stdcall * PCLOSETHEMEDATA)(HTHEME hTheme);
  159. HHOOK g_hmouse = NULL; //g_sendhead zx.dll
  160. //extern void WriteClientLog(CString str); // Jeff写客户端日志;
  161. // Jeff.remark;
  162. // 函数:MouseProc
  163. // 参数:
  164. // nCode hook code
  165. // wParam message identifier
  166. // lParam mouse coordinates
  167. // 返回:
  168. //
  169. LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
  170. {
  171. if (g_pMainWnd)
  172. {
  173. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134)) > 1)
  174. {
  175. g_pMainWnd->KillTimer(5);
  176. g_pMainWnd->SetTimer(5, atoi(g_cominfoarray.ElementAt(0).ElementAt(134)) * 60 * 1000, NULL);
  177. }
  178. if (g_bSendLYFZ)
  179. {
  180. g_pMainWnd->KillTimer(7);
  181. g_pMainWnd->SetTimer(7, 5 * 60 * 1000, NULL);
  182. }
  183. }
  184. return CallNextHookEx(g_hmouse, nCode, wParam, lParam);
  185. }
  186. CRect g_rc; // 屏幕坐标值,区域是放置对话框。
  187. CMainFrame *g_pMainWnd = NULL;
  188. extern HWND g_hSendWnd;
  189. extern HWND g_hConnectWnd;
  190. //extern CString newGUID();
  191. /////////////////////////////////////////////////////////////////////////////
  192. // CMainFrame客人付款
  193. /////////////////////////////////////////////////////////////////////////////
  194. /////////////////////////////////////////////////////////////////////////////
  195. static void HandleClientNetEvent(IN SOCKET hSocket,
  196. IN ETransportEvent eEvent,
  197. IN void *pDataBuf,
  198. IN unsigned long nDataLen,
  199. IN int nError,
  200. IN void *pContext)
  201. {
  202. if (nError != TRANSPORT_OK)
  203. return;
  204. CMainFrame *pDlg = (CMainFrame *)pContext;
  205. if (NULL == pDlg)
  206. return;
  207. pDlg->ProcessNetEvent(eEvent, pDataBuf, nDataLen);
  208. }
  209. BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
  210. {
  211. CRect rtCtrl, rtWnd; // 子窗口,父窗口;
  212. if (hwnd)
  213. {
  214. ::GetWindowRect(hwnd, &rtCtrl); // 获取控件大小;
  215. ::GetWindowRect(GetParent(hwnd), &rtWnd); // 获取父窗口大小;
  216. // printf("Jeff:g_WidthScale=%d,g_HeightScale=%d,rtWnd.left=%d,rtWnd.top=%d\n\n",g_WidthScale,g_HeightScale,rtWnd.left,rtWnd.top);
  217. // 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);
  218. rtCtrl.OffsetRect(-rtWnd.left, -rtWnd.top);
  219. float temp;
  220. temp = (float)rtCtrl.left*g_WidthScale;
  221. rtCtrl.left = (int)temp + g_dx;
  222. temp = (float)rtCtrl.top*g_HeightScale;
  223. rtCtrl.top = (int)temp + g_dy;
  224. temp = (float)rtCtrl.right*g_WidthScale;
  225. rtCtrl.right = (int)temp + g_dx;
  226. temp = (float)rtCtrl.bottom*g_HeightScale;
  227. rtCtrl.bottom = (int)temp + g_dy;
  228. //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);
  229. ::MoveWindow(hwnd, rtCtrl.left, rtCtrl.top, rtCtrl.Width(), rtCtrl.Height(), TRUE);
  230. return TRUE;
  231. }
  232. else
  233. {
  234. return FALSE;
  235. }
  236. }
  237. IMPLEMENT_DYNCREATE(CMainFrame, CMDIFrameWnd)
  238. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  239. //{{AFX_MSG_MAP(CMainFrame)
  240. ON_WM_CREATE()
  241. ON_WM_DESTROY()
  242. ON_WM_CLOSE()
  243. ON_WM_TIMER()
  244. ON_COMMAND(IDM_choosephotoskin, Onchoosephotoskin)
  245. ON_COMMAND(IDM_PATH, OnPath)
  246. ON_COMMAND(IDM_SERVER, OnServer)
  247. ON_COMMAND(IDM_SHOWHIS, OnShowhis)
  248. ON_COMMAND(IDM_StaffAchievementShow, OnStaffAchievementShow)
  249. ON_COMMAND(IDM_AUTODELPHOTO, OnAutodelphoto)
  250. ON_COMMAND(IDM_PHOTOMANAGE, Onphotomanage)
  251. ON_COMMAND(IDM_COMPANYINFO, OnCompanyinfo)
  252. ON_COMMAND(IDM_HELPFILE, OnHelpfile)
  253. ON_COMMAND(IDM_PHOTOBAK, OnPhotobak)
  254. ON_COMMAND(IDM_TAOXIFG, OnTaoxifg)
  255. ON_COMMAND(IDM_ShowBakState, OnShowBakState)
  256. ON_WM_NCLBUTTONDBLCLK()
  257. ON_WM_NCHITTEST()
  258. ON_COMMAND(IDM_LOG, OnLog)
  259. //}}AFX_MSG_MAP
  260. ON_COMMAND_RANGE(0, 50000, OnCommandMenu)
  261. END_MESSAGE_MAP()
  262. static UINT indicators[] =
  263. {
  264. ID_SEPARATOR, // status line indicator
  265. ID_INDICATOR_CAPS,
  266. ID_INDICATOR_NUM,
  267. ID_INDICATOR_SCRL,
  268. };
  269. /////////////////////////////////////////////////////////////////////////////
  270. // CMainFrame construction/destruction
  271. UINT CMainFrame::OnNcHitTest(CPoint point)
  272. {
  273. if (CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
  274. return HTCLIENT;
  275. return CWnd::OnNcHitTest(point);
  276. }
  277. void CMainFrame::OnNcLButtonDblClk(UINT nFlags, CPoint point)
  278. {
  279. if (nFlags != HTCAPTION)
  280. CMDIFrameWnd::OnNcLButtonDblClk(nFlags, point);
  281. }
  282. CMainFrame::CMainFrame()
  283. {
  284. // TODO: add member initialization code here
  285. SetConnectionID(INVALID_SOCKET);
  286. m_pMainFrimDlg2 = NULL;
  287. CString version = _T("Version 1.0");
  288. m_bCheckF2F3 = AfxGetApp()->GetProfileInt(version, "f2f3", 0);
  289. if (0 == ::PathFileExists(g_mainpath + "\\skin\\5.lia"))
  290. {
  291. g_bNoLoginLia = 1;
  292. }
  293. }
  294. CMainFrame::~CMainFrame()
  295. {
  296. if (m_pMainFrimDlg2)
  297. {
  298. m_pMainFrimDlg2->DestroyWindow();
  299. delete m_pMainFrimDlg2;
  300. }
  301. }
  302. // void LoadImageFromFile(Bitmap **img, CString path)
  303. // {
  304. // try
  305. // {
  306. // if (!PathFileExists(path))return;
  307. // if (*img)delete *img;
  308. // *img = NULL;
  309. // BSTR bstr = path.AllocSysString();
  310. // *img = Bitmap::FromFile(bstr);
  311. // SysFreeString(bstr);
  312. // }
  313. // catch (...)
  314. // {
  315. // }
  316. // }
  317. void InTheMe(HWND m_hWnd)
  318. {
  319. BOOL bXpVisualStyle = FALSE;
  320. OSVERSIONINFO osvi;
  321. osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  322. ::GetVersionEx(&osvi);
  323. if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvi.dwMajorVersion >= 5) && (osvi.dwMinorVersion >= 1))
  324. {
  325. HMODULE hUxTheme = ::LoadLibrary(_T("UxTheme.dll"));
  326. POPENTHEMEDATA pOpenThemeData;
  327. PCLOSETHEMEDATA pCloseThemeData;
  328. if (hUxTheme != NULL)
  329. {
  330. pOpenThemeData = (POPENTHEMEDATA)::GetProcAddress(hUxTheme, "OpenThemeData");
  331. pCloseThemeData = (PCLOSETHEMEDATA)::GetProcAddress(hUxTheme, "CloseThemeData");
  332. HTHEME hButtonTheme = (*pOpenThemeData)(m_hWnd, L"BUTTON");
  333. if (hButtonTheme != NULL)
  334. bXpVisualStyle = TRUE;
  335. (*pCloseThemeData)(hButtonTheme);
  336. }
  337. ::FreeLibrary(hUxTheme);
  338. }
  339. if (bXpVisualStyle)
  340. AfxMessageBox(_T("正在使用视觉主题 "));
  341. else
  342. AfxMessageBox(_T("没有使用视觉主题 "));
  343. }
  344. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  345. {
  346. if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  347. {
  348. // Jeff.创建失败的可能性小,加日志输出;
  349. return -1;
  350. }
  351. #if 0 // 超时;
  352. if (g_server.Find(".ly.com") != -1)
  353. {
  354. g_ntimeout = 30000;
  355. }
  356. #endif
  357. if (::PathFileExists(g_mainpath + "\\logo.ico"))
  358. {
  359. Bitmap *bmp = NULL;
  360. LoadImageFromFile(&bmp, g_mainpath + "\\logo.ico");
  361. // m_hIcon = AfxGetApp()->LoadIcon(g_mainpath+"\\logo.ico");
  362. bmp->GetHICON(&m_hIcon);
  363. delete bmp;
  364. SetIcon(m_hIcon, TRUE); // Set big icon
  365. SetIcon(m_hIcon, FALSE); // Set small icon
  366. }
  367. if (!m_wndClient.SubclassWindow(m_hWndMDIClient))
  368. {
  369. // Jeff.创建失败的可能性小,加日志输出;
  370. return -1;
  371. }
  372. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  373. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  374. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  375. {
  376. // Jeff.创建失败的可能性小,加日志输出;
  377. TRACE0("Failed to create toolbar\n");
  378. return -1; // fail to create
  379. }
  380. m_wndToolBar.LoadTrueColorToolBar(90, IDB_NORMAL, 0, IDB_DISABLE);
  381. // second toolbar must have different ID
  382. if (!m_wndToolBar2.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT | CBRS_NOALIGN,
  383. AFX_IDW_CONTROLBAR_FIRST + 32) ||
  384. !m_wndToolBar2.LoadToolBar(IDR_TOOLBAR1))
  385. {
  386. // Jeff.创建失败的可能性小,加日志输出;
  387. TRACE0("Failed to create toolbar\n");
  388. return -1; // fail to create
  389. }
  390. #ifndef NEW_SKIN
  391. if (!m_wndStatusBar.Create(this) ||
  392. !m_wndStatusBar.SetIndicators(indicators,
  393. sizeof(indicators)/sizeof(UINT)))
  394. {
  395. // Jeff.创建失败的可能性小,加日志输出;
  396. TRACE0("Failed to create status bar\n");
  397. return -1; // fail to create
  398. }
  399. m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_NORMAL,200);
  400. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  401. #endif
  402. // TODO: Delete these three lines if you don't want the toolbar to
  403. // be dockable
  404. NewMenu2();
  405. ::GetWindowRect(this->m_hWndMDIClient, g_rc);
  406. /* CString ss;
  407. ss.Format ("%d,%d,%d,%d", g_rc.left , g_rc.top , g_rc.right , g_rc.bottom );
  408. AfxMessageBox(ss);*/
  409. g_pMainWnd = this;
  410. m_wndToolBar2.Init();
  411. g_rc.top += 38;
  412. g_rc.left += 160;
  413. /* m_WidthScale = (float)g_rc.Width ()/722;
  414. m_HeightScale = (float)g_rc.Height ()/533;*/
  415. g_user.bLongin = 0;
  416. SetTimer(1, 100, NULL);
  417. return 0;
  418. }
  419. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  420. {
  421. if (!CMDIFrameWnd::PreCreateWindow(cs))
  422. return FALSE;
  423. // TODO: Modify the Window class or styles here by modifying
  424. // the CREATESTRUCT cs
  425. cs.style &= ~WS_MAXIMIZEBOX;
  426. cs.style &= ~WS_THICKFRAME;
  427. cs.lpszName = g_title + "影楼管理系统";
  428. cs.style &= ~FWS_ADDTOTITLE;
  429. RECT rect;
  430. HWND hWnd = ::FindWindow("Shell_TrayWnd", 0);
  431. ::GetWindowRect(hWnd, &rect);
  432. cs.x = 0;
  433. cs.y = 0;
  434. cs.cx = GetSystemMetrics(SM_CXSCREEN);
  435. cs.cy = GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top) + 3;
  436. return TRUE;
  437. }
  438. /////////////////////////////////////////////////////////////////////////////
  439. // CMainFrame diagnostics
  440. #ifdef _DEBUG
  441. void CMainFrame::AssertValid() const
  442. {
  443. CMDIFrameWnd::AssertValid();
  444. }
  445. void CMainFrame::Dump(CDumpContext& dc) const
  446. {
  447. CMDIFrameWnd::Dump(dc);
  448. }
  449. #endif //_DEBUG
  450. /////////////////////////////////////////////////////////////////////////////
  451. // CMainFrame message handlers
  452. void CMainFrame::OnDestroy()
  453. {
  454. //WriteLog("退出系统");//Jeff.add
  455. OnDisconnect();
  456. Transport_UnInit();
  457. m_Mdi.DeleteAll();
  458. if (g_hmouse)UnhookWindowsHookEx(g_hmouse);
  459. CMDIFrameWnd::OnDestroy();
  460. }
  461. void CMainFrame::OnClose()
  462. {
  463. g_bShowBar = 0;
  464. if (m_Mdi.MainClose())
  465. CMDIFrameWnd::OnClose();
  466. }//连接
  467. void CMainFrame::NewMenu2()
  468. {
  469. CMenu *pMemu = GetMenu();
  470. #ifdef BASIC_VERSION
  471. CMenu* submenu = pMemu->GetSubMenu(1);
  472. //submenu->RemoveMenu (IDM_StaffAchievementShow, MF_BYCOMMAND );//Jeff del 2014.06.16
  473. submenu->RemoveMenu (IDM_salaryset, MF_BYCOMMAND );
  474. #endif
  475. #if 0 // 此机用选片菜单项,去掉不用;
  476. {
  477. CString version = _T("Version 1.0");
  478. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  479. if(checked)
  480. {
  481. CMenu* submenu = pMemu->GetSubMenu(1);
  482. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  483. }
  484. }
  485. #endif
  486. #ifndef BASIC_VERSION
  487. {
  488. CString version = _T("Version 1.0");
  489. BOOL checked = AfxGetApp()->GetProfileInt(version, "status2", 0);
  490. if (checked)
  491. {
  492. #if 0 // Jeff:去掉菜单,此机用于员工业绩查看的菜单选项;
  493. CMenu* submenu = pMemu->GetSubMenu(1);
  494. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  495. #endif
  496. g_bStaffAchievementShow = 1;
  497. SetTimer(3, 100, NULL);
  498. }
  499. }
  500. #endif
  501. if (g_bShowOK == 0)
  502. {
  503. CMenu* submenu = pMemu->GetSubMenu(2);
  504. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  505. }
  506. }
  507. HMENU CMainFrame::NewMenu()
  508. {
  509. //设置菜单为XP风格 IDM_SHOWHIS
  510. BCMenu::SetMenuDrawMode(1);
  511. //若取消下面这句注释,则可看到菜单的图标栏和文字栏背景颜色为白色,
  512. //文字颜色为蓝色,选中项的前景色为紫红色
  513. //m_menuXP.SetMenuXPItemColor(0x00FFFFFF,0x00FFFFFF,0x00FF0000,0x00FF00FF);
  514. // 设置菜单中图标大小为32×32
  515. // m_menuXP.SetIconSize(32,32);
  516. // 加载菜单资源
  517. m_menuXP.LoadMenu(IDR_MAINFRAME);
  518. // 加载菜单对应的工具栏资源
  519. // m_menuXP.LoadToolbar(IDR_MAINFRAME);
  520. /*由于菜单左边栏中默认的图标大小为16×16,而与之对应的Toolbar中图标大小为32×32,
  521. 因此菜单中图标不能正确显示,只显示出工具栏中图标的左上角部分,所以修改菜单中各
  522. 项对应的图标为24b色位图资源IDB_***,或者在LoadMenu之前调用SetIconSize,设置菜单
  523. 中图标大小为32×32*/
  524. // m_menuXP.SetIconSize(24,24);
  525. // m_menuXP.ModifyODMenu(NULL,IDM_YWBU,IDB_YW); //
  526. /* m_menuXP.ModifyODMenu(NULL,ID_FILE_OPEN,IDB_BITMAP5);
  527. m_menuXP.ModifyODMenu(NULL,ID_FILE_SAVE,IDB_BITMAP7);
  528. m_menuXP.ModifyODMenu(NULL,ID_FILE_PRINT,IDB_BITMAP6);
  529. m_menuXP.ModifyODMenu(NULL,ID_APP_ABOUT,IDB_BITMAP3);
  530. m_menuXP.ModifyODMenu(NULL,ID_APP_EXIT,IDB_BITMAP2);*/
  531. // m_menuXP.EnableMenuItem (0, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  532. // m_menuXP.EnableMenuItem (2, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  533. // m_menuXP.EnableMenuItem (3, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  534. // m_menuXP.EnableMenuItem (4, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  535. // m_menuXP.EnableMenuItem (5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  536. // m_menuXP.EnableMenuItem (8, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  537. #if 0 // Jeff此机用选片菜单项不用;
  538. {
  539. CString version = _T("Version 1.0");
  540. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  541. if(checked)
  542. {
  543. CMenu* submenu = m_menuXP.GetSubMenu(1);
  544. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  545. }
  546. }
  547. #endif
  548. {
  549. CString version = _T("Version 1.0");
  550. BOOL checked = AfxGetApp()->GetProfileInt(version, "status2", 0);
  551. if (checked)
  552. {
  553. #if 0 // Jeff:去掉此机用于员工业绩查看的菜单选项;
  554. CMenu* submenu = m_menuXP.GetSubMenu(1);
  555. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  556. #endif
  557. g_bStaffAchievementShow = 1;
  558. SetTimer(3, 100, NULL);
  559. }
  560. }
  561. if (g_bShowOK == 0)
  562. {
  563. CMenu* submenu = m_menuXP.GetSubMenu(2);
  564. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  565. }
  566. return(m_menuXP.Detach());
  567. }
  568. ///////////////////////////////////////////////////////
  569. //减少代码
  570. #define OPEN_MENU(x) m_Mdi.Append(pName, RUNTIME_CLASS(x), IDR_MAINFRAME, this, nID)
  571. //响应菜单命令
  572. void CMainFrame::OnCommandMenu(UINT nID)
  573. {
  574. if (nID >= 2000 && nID <= 2100)
  575. {
  576. OnBranchData(nID);
  577. return;
  578. }
  579. if (g_user.bLongin == 0)
  580. {
  581. if (g_bNoLoginLia)
  582. {
  583. Login dlg;
  584. dlg.SetLiaPath("5.lia");
  585. dlg.DoModal();
  586. }
  587. else
  588. {
  589. Login3 dlg;
  590. dlg.SetLiaPath("5.lia");
  591. dlg.DoModal();
  592. }
  593. return;
  594. if (g_user.bLongin == 0)return;
  595. }
  596. else
  597. {
  598. InsideMsg();
  599. }
  600. ResetTimer();
  601. if (nID >= 1000 && nID <= 1100)
  602. {
  603. OnHistory(nID);
  604. return;
  605. }
  606. LPSTR pName;
  607. //打开窗口
  608. switch (nID)
  609. {
  610. case IDM_PayOutSet:
  611. {
  612. if (IsHasRights(16) == 0)return;
  613. PayOutSet dlg;
  614. dlg.DoModal();
  615. return;
  616. }
  617. case IDM_SPLB:
  618. {
  619. if (IsHasRightsnew(29) == 0)return;
  620. SPLBDlg dlg;
  621. dlg.DoModal();
  622. return;
  623. }
  624. case IDM_JD:
  625. {
  626. if (IsHasRightsnew(49) == 0)return;
  627. SPLBDlg dlg;
  628. dlg.m_mode = 1;
  629. dlg.DoModal();
  630. return;
  631. }
  632. case IDM_AREA:
  633. {
  634. if (IsHasRightsnew(47) == 0)return;
  635. AreaDlg dlg;
  636. dlg.DoModal();
  637. return;
  638. }
  639. case IDM_Psw:
  640. {
  641. Psw dlg;
  642. dlg.DoModal();
  643. return;
  644. }
  645. case IDM_Set:
  646. {
  647. if (IsHasRightsnew(49) == 0)return;
  648. /* if(g_bBranchModify)
  649. {
  650. AfxMessageBox("系统设置不支持远程访问,请直接访问该分店!", MB_ICONINFORMATION);
  651. return;
  652. }*/
  653. Set dlg;
  654. dlg.DoModal();
  655. //if(dlg.DoModal() != IDOK)
  656. //{
  657. //AfxMessageBox("789");
  658. //Set::SetCancle();
  659. //}
  660. return;
  661. }
  662. case IDM_HIDEWINDOW:
  663. {
  664. HideWindow dlg;
  665. dlg.DoModal();
  666. return;
  667. }
  668. case IDM_Logout:// Jeff.注销;
  669. {
  670. WriteLog("退出系统");//Jeff.add;
  671. g_user.bLongin = 0;
  672. g_user.name.Empty();
  673. g_user.rights.Empty();
  674. g_user.account.Empty();
  675. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  676. g_pMainWnd2->RefreshOutlookBar();
  677. #ifndef NEW_SKIN
  678. m_wndStatusBar.SetPaneText(1, "未登录", TRUE);
  679. #endif
  680. m_Mdi.CloseAll();
  681. #ifdef ENTERPRISE_VERSION
  682. g_branchname.Empty();
  683. g_branchip.Empty();
  684. g_pMainWnd->OnDisconnect();
  685. g_bBranchModify = 0;
  686. #endif
  687. if (g_pMainWnd2)
  688. {
  689. g_pMainWnd2->DrawLogin();
  690. g_pMainWnd2->ShowBar(0);
  691. }
  692. g_hisyeararray.RemoveAll();
  693. g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
  694. g_brancharray.RemoveAll();
  695. g_pMainWnd->AddBranchMenu(&g_brancharray);
  696. if (g_bNoLoginLia)
  697. {
  698. Login dlg;
  699. dlg.SetLiaPath("5.lia");
  700. dlg.DoModal();
  701. }
  702. else
  703. {
  704. Login3 dlg;
  705. dlg.SetLiaPath("5.lia");
  706. dlg.DoModal();
  707. }
  708. if (g_user.bLongin == 0)
  709. if (g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  710. return;
  711. }
  712. case IDM_TODAY:
  713. pName = (LPSTR)(LPCSTR)"历史订单";
  714. // OPEN_MENU(SalarySet3);
  715. OPEN_MENU(DinDanHistroy);
  716. break;
  717. case IDM_TAKECONTROL:
  718. pName = (LPSTR)(LPCSTR)"摄控表";
  719. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))
  720. OPEN_MENU(TodayForm2);
  721. else
  722. OPEN_MENU(TodayForm);
  723. break;
  724. case IDM_CLIENTMONEY:
  725. pName = (LPSTR)(LPCSTR)"客人付款";
  726. OPEN_MENU(ClientMoney);
  727. break;
  728. case IDM_TAKEAWAYBOOK:
  729. pName = (LPSTR)(LPCSTR)"发片/取件";
  730. OPEN_MENU(outsourcing);
  731. break;
  732. case IDM_CODE:
  733. pName = (LPSTR)(LPCSTR)"商品报表";
  734. OPEN_MENU(SPForm);
  735. break;
  736. case IDM_Daily:
  737. // if(IsHasRightsnew(22)==0)return;
  738. // pName = (LPSTR)(LPCSTR)"日财务表";
  739. // OPEN_MENU(DailyForm);
  740. pName = (LPSTR)(LPCSTR)"沟通助手";
  741. OPEN_MENU(InsideMsg);
  742. break;
  743. case IDM_ProcessAlarm:
  744. pName = (LPSTR)(LPCSTR)"流程监控";
  745. OPEN_MENU(ProcessAlarm);
  746. break;
  747. case IDM_DINDAN:
  748. // if(IsHasRights(7)==0)return;
  749. pName = (LPSTR)(LPCSTR)"订单报表";
  750. OPEN_MENU(DinDanFrom);
  751. break;
  752. case IDM_CLIENT:
  753. //if(IsHasRights(8)==0)return;
  754. pName = (LPSTR)(LPCSTR)"客户报表";
  755. OPEN_MENU(CClientForm);
  756. break;
  757. case IDM_PayOutInput:
  758. if (IsHasRightsnew(20) == 0)return;
  759. pName = (LPSTR)(LPCSTR)"现金支出";
  760. OPEN_MENU(PayOutInput);
  761. break;
  762. case IDM_salaryset:
  763. if (IsHasRightsnew(25) == 0)return;
  764. pName = (LPSTR)(LPCSTR)"工资设置";
  765. OPEN_MENU(SalarySet);
  766. break;
  767. case IDM_mysalary:
  768. if (IsHasRights(16) == 0)return;
  769. pName = (LPSTR)(LPCSTR)"我的工资";
  770. OPEN_MENU(MySalary);
  771. break;
  772. case IDM_SP:
  773. // if(IsHasRightsnew(29)==0)return;
  774. pName = (LPSTR)(LPCSTR)"商品设置";
  775. OPEN_MENU(ShangPin);
  776. break;
  777. case IDM_WORKER:
  778. if (IsHasRightsnew(27) == 0)return;
  779. pName = (LPSTR)(LPCSTR)"员工设置";
  780. OPEN_MENU(Worker);
  781. break;
  782. case IDM_TAOXI:
  783. if (IsHasRightsnew(30) == 0)return;
  784. pName = (LPSTR)(LPCSTR)"套系设置";
  785. OPEN_MENU(TXDlg);
  786. break;
  787. case IDM_TAOXISP:
  788. if (IsHasRightsnew(30) == 0)return;
  789. pName = (LPSTR)(LPCSTR)"套系赠送商品设置";
  790. OPEN_MENU(TXSPDlg);
  791. break;
  792. case IDM_Provider:
  793. if (IsHasRightsnew(32) == 0)return;
  794. pName = (LPSTR)(LPCSTR)"供应商设置";
  795. OPEN_MENU(ProviderDlg);
  796. break;
  797. case IDM_BUMEN:
  798. {
  799. if (IsHasRightsnew(49) == 0)return;
  800. BuMenDlg dlg;
  801. dlg.DoModal();
  802. return;
  803. }
  804. case IDM_Account:
  805. if (IsHasRightsnew(49) == 0)return;
  806. pName = (LPSTR)(LPCSTR)"账号管理";
  807. OPEN_MENU(Account);
  808. break;
  809. case IDM_YLCD:
  810. {
  811. //AfxMessageBox("IDM_YLCD");
  812. ::CopyFile(_T(g_path7 + "\\接单系统\\Regsvr32.exe"), _T(g_mainpath + "\\Regsvr32.exe"), 0);
  813. ::CopyFile(_T(g_path7 + "\\接单系统\\Flash9f.ocx"), _T(g_mainpath + "\\Flash9f.ocx"), 0);
  814. CString temp;
  815. temp.Format("%s\\regsvr32.exe /s %s\\Flash9f.OCX", g_mainpath, g_mainpath);
  816. WinExec(temp, SW_HIDE);
  817. ::CopyFile(_T(g_path7 + "\\接单系统\\接单系统.exe"), _T(g_mainpath + "\\接单系统.exe"), 0);
  818. ::CopyFile(_T(g_path7 + "\\接单系统\\my32.dll"), _T(g_mainpath + "\\my32.dll"), 0);
  819. ::CopyFile(_T(g_path7 + "\\接单系统\\server.dat"), _T(g_mainpath + "\\server.dat"), 0);
  820. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\接单系统.exe"), g_server, NULL, SW_SHOWNORMAL);
  821. }
  822. break;
  823. case IDM_YLCDMANAGE:
  824. ::CopyFile(_T(g_path7 + "\\接单系统\\资源管理器.exe"), _T(g_mainpath + "\\资源管理器.exe"), 0);
  825. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\资源管理器.exe"), g_server, NULL, SW_SHOWNORMAL);
  826. break;
  827. }
  828. }
  829. //减少代码
  830. ///////////////////////////////////////////////////////////////////////////////
  831. void CMainFrame::OnDisconnect()
  832. {
  833. m_tClientTunnel.net_CloseSocket();
  834. SetConnectionID(INVALID_SOCKET);
  835. }
  836. void CMainFrame::ProcessLoginResponse(void *pLoginResult)
  837. {
  838. //printf("Jeff:ProcessLoginResponse\n\n");//Jeff Printf;
  839. if (NULL == pLoginResult) return;
  840. LOGIN_RESULT_STRU *ptLoginResult = (LOGIN_RESULT_STRU *)pLoginResult;
  841. DWORD dwConnectionID = ptLoginResult->tCommonMsg.dwConnectionID;
  842. SetConnectionID(dwConnectionID);
  843. BYTE byResult = ptLoginResult->byResult;
  844. if (LOGIN_RESULT_SUC == byResult)
  845. {
  846. //AfxMessageBox("登录成功"); // Jeff test;
  847. }
  848. else
  849. {
  850. OnDisconnect();
  851. }
  852. }
  853. //-------------------------------------------------------------------
  854. // Remark by Jeff: 2014.10.18
  855. // 函数:ProcessLoginRequest
  856. // 描述:登陆服务器;
  857. // 参数:
  858. // nSrvType:登陆服务器的协议类型;
  859. // 0000 0000: 表示登陆本地服务器;
  860. // 0000 0001: 表示登陆远程服务器(lijiafz.vicp.net等);
  861. //
  862. // 返回:登陆成功返回TRUE;
  863. //
  864. //-------------------------------------------------------------------
  865. BOOL CMainFrame::ProcessLoginRequest()
  866. {
  867. // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
  868. WORD wMessageId = 0;
  869. if (g_conntype == 0 && !g_bConnLYFZ)
  870. wMessageId = (MSG_LOGIN_REQ + 0X1FFF);
  871. else// if (g_bConnLYFZ )
  872. wMessageId = MSG_LOGIN_REQ;
  873. // 2.填充发送数据;
  874. TLOGIN_STRU tLogonInfo = { 0 };
  875. tLogonInfo.tCommonMsg.dwConnectionID = GetConnectionID();//此时m_dwConnectionID为INVALIDE_SOCKET;
  876. tLogonInfo.tCommonMsg.wMessageId = wMessageId;
  877. CString strUserName = newGUID();// 以随机数作为登陆时的用户名称;
  878. strUserName.TrimLeft();
  879. strUserName.TrimRight();
  880. strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
  881. DWORD dwDataLen = sizeof(TLOGIN_STRU);
  882. // 3.填充数据头;
  883. TMessageHeader tHeader = { 0 };
  884. tHeader.wMessageId = wMessageId;
  885. tHeader.dwDataLen = dwDataLen;
  886. // 4.发送数据;
  887. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)&tLogonInfo, dwDataLen);
  888. if (ulSendLen == SOCKET_ERROR)
  889. {
  890. return 0;
  891. }
  892. return 1;
  893. }
  894. DWORD CMainFrame::GetConnectionID()
  895. {
  896. return m_dwConnectionID;
  897. }
  898. void CMainFrame::SetConnectionID(DWORD dwConnection)
  899. {
  900. m_dwConnectionID = dwConnection;
  901. }
  902. //*********************************************//
  903. /*
  904. 函数:ProcessChatMessageRequest2
  905. 参数:BYTE code [IN]
  906. 返回:无
  907. 过程:OnConnect() -> ProcessChatMessageRequest()
  908. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  909. 2.SendDataDlg计时器里调用CConnectDlg对话框
  910. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  911. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  912. 5.关闭对话框和断开连接;
  913. */
  914. //*********************************************//
  915. void CMainFrame::ProcessChatMessageRequest2(BYTE code)
  916. {
  917. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  918. SendDataDlg dlg;
  919. dlg.m_bycode = code;
  920. dlg.DoModal();
  921. }
  922. //*********************************************//
  923. /*
  924. 函数:ProcessChatMessageRequest2
  925. 参数:CString sql [IN]
  926. 返回:无
  927. 过程:OnConnect() -> ProcessChatMessageRequest()
  928. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  929. 2.SendDataDlg计时器里调用CConnectDlg对话框
  930. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  931. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  932. 5.关闭对话框和断开连接;
  933. */
  934. //*********************************************//
  935. void CMainFrame::ProcessChatMessageRequest2(CString sql)
  936. {
  937. if ((sql.Find("insert") != -1 || sql.Find("update") != -1 || sql.Find("delete") != -1) && g_branchname != "" && g_bBranchModify == 0)
  938. {
  939. AfxMessageBox("当前为分店数据查看状态,不能更改分店数据!", MB_ICONSTOP);
  940. g_bSendOK = 0;
  941. return;
  942. }
  943. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  944. SendDataDlg dlg;
  945. dlg.m_strSQL = sql;
  946. dlg.DoModal();
  947. }
  948. //*********************************************//
  949. /*
  950. 函数:ProcessChatMessageRequest2
  951. 参数:BYTE *pData [IN], int length [IN]
  952. 返回:无
  953. 过程:OnConnect() -> ProcessChatMessageRequest()
  954. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  955. 2.SendDataDlg计时器里调用CConnectDlg对话框
  956. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  957. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  958. 5.关闭对话框和断开连接;
  959. */
  960. //*********************************************//
  961. void CMainFrame::ProcessChatMessageRequest2(BYTE *pData, int length)
  962. {
  963. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  964. SendDataDlg dlg;
  965. dlg.m_pData = pData;
  966. dlg.m_nlength = length;
  967. dlg.DoModal();
  968. }
  969. /************************************************************************/
  970. /*
  971. 函数:ProcessChatMessageRequest
  972. 描述:对服务发送数据;
  973. 参数:void *szDataBuf[IN], int nDataLen[IN]
  974. 返回:发送成功与否;
  975. */
  976. /************************************************************************/
  977. BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)
  978. {
  979. // 1.获取当前与服务器连接的id;
  980. DWORD dwFromUserID = GetConnectionID();
  981. // 2.设置通信类型为MSG_CHATMESSAGE_REQ;
  982. WORD wMessageId = 0;
  983. if (g_conntype == 0 && !g_bConnLYFZ)
  984. wMessageId = (MSG_CHATMESSAGE_REQ + 0X3FFF);
  985. else
  986. wMessageId = MSG_CHATMESSAGE_REQ;
  987. // 3.计算出欲发送的数据的长度 dwDataLen;
  988. DWORD dwDataLen = sizeof(TCHAT_MESSAGE_STRU) + nDataLen;
  989. BYTE *pSendData = new BYTE[dwDataLen];
  990. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU*)pSendData;
  991. memset(pChatMessage, 0x00, dwDataLen);
  992. // 3.1.g_nYearpos第一次与服务端通信时为-1;
  993. if (g_nYearpos == -1)
  994. g_sendhead.length[99] = g_nYearpos;
  995. else
  996. g_sendhead.length[99] = g_nYearpos * 32142953 + 10966236;
  997. g_sendhead.length[98] = 987123768;
  998. memcpy(pSendData, &g_sendhead, sizeof(g_sendhead));
  999. #ifdef ENTERPRISE_VERSION
  1000. if (g_bBranchModify == 0)
  1001. strcpy(pChatMessage->szFromUserName, g_branchname);
  1002. #endif
  1003. // 4.填充发送的数据结构;
  1004. pChatMessage->tCommonMsg.dwConnectionID = GetConnectionID();
  1005. pChatMessage->tCommonMsg.wMessageId = wMessageId;
  1006. pChatMessage->dwFromUserID = dwFromUserID;
  1007. pChatMessage->dwToUserID = g_nSendCode;//▲▲g_nSendCode在服务端同为dwToUserID;
  1008. pChatMessage->wMessageLen = nDataLen;
  1009. memcpy(pChatMessage->byFileContent, szDataBuf, nDataLen);
  1010. // 5.填充数据头;
  1011. TMessageHeader tHeader = { 0 };
  1012. tHeader.wMessageId = wMessageId;
  1013. tHeader.dwDataLen = dwDataLen;
  1014. // 6.发送数据;
  1015. BOOL bRet = 0;
  1016. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)pChatMessage, dwDataLen);
  1017. if (ulSendLen != SOCKET_ERROR)
  1018. {
  1019. bRet = 1;
  1020. }
  1021. // 7.发送完毕,释放内存;
  1022. delete[] pSendData;
  1023. return bRet;
  1024. }
  1025. /************************************************************************/
  1026. /*
  1027. 函数:ProcessChatMessageResponse
  1028. 描述:接收服务返回的数据;
  1029. 参数:void *pResponse[IN]
  1030. 返回:无;
  1031. 调用关系:
  1032. 1.由 void CMainFrame::ProcessNetEvent(...)调用
  1033. */
  1034. /************************************************************************/
  1035. void CMainFrame::ProcessChatMessageResponse(void *pResponse)
  1036. {
  1037. //printf("Jeff:ProcessChatMessageResponse**************\n\n");//Jeff Printf;
  1038. // 1.数据空,直接返回;
  1039. if (NULL == pResponse)
  1040. return;
  1041. // 2.数据解析过程;
  1042. //printf("Jeff:ProcessChatMessageResponse**************\数据解析过程\n\n");//Jeff Printf;
  1043. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pResponse;
  1044. int nMessageLen = pChatMessage->wMessageLen;
  1045. int nMessageLen2 = pChatMessage->dwToUserID; // 在服务器中被处理了,一般使dwToUserID=wMessageLen;
  1046. // Jeff.dwFromUserID==8888表示的内容是更新客户端skin界面数据,只有两处dwToUserID==211和dwToUserID==21;
  1047. // Jeff.其余的大多数都是 dwFromUserID = wMessageLen = dwToUserID 三者相等;
  1048. if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID != 8888)
  1049. {
  1050. // 2.1.清除全局变量g_pData数据,用于保存接收的实际数据;
  1051. if (g_pData)
  1052. delete[]g_pData;
  1053. g_pData = NULL;
  1054. g_pData = new BYTE[nMessageLen];
  1055. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1056. memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
  1057. g_nLeng = nMessageLen;
  1058. if (nMessageLen <= sizeof(DWORD))
  1059. {
  1060. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1061. }
  1062. KillTimer(2);
  1063. if (g_hSendWnd)
  1064. {
  1065. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);//关闭发送对话框;
  1066. }
  1067. }
  1068. else if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID == 8888)
  1069. {
  1070. if (g_pData2)
  1071. delete[]g_pData2;
  1072. g_pData2 = NULL;
  1073. g_pData2 = new BYTE[nMessageLen2];
  1074. memcpy(g_pData2, pChatMessage->byFileContent, nMessageLen2);
  1075. g_nLeng2 = nMessageLen2;
  1076. KillTimer(2);
  1077. if (g_hSendWnd)
  1078. {
  1079. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1080. }
  1081. }
  1082. else // 登陆返回;
  1083. {
  1084. if (g_bConnLYFZ)
  1085. {
  1086. if (g_pData)
  1087. delete[]g_pData;
  1088. g_pData = NULL;
  1089. g_pData = new BYTE[nMessageLen];
  1090. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1091. memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
  1092. g_nLeng = nMessageLen;
  1093. if (nMessageLen <= sizeof(DWORD))
  1094. {
  1095. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1096. }
  1097. KillTimer(2);
  1098. if (g_hSendWnd)
  1099. {
  1100. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1101. }
  1102. return;
  1103. }
  1104. if (g_conntype) // Jeff.g_conntype == 1,表示连接公司服务器的返回,用于集团版解析*.ly.com的IP地址;
  1105. {
  1106. // KillTimer(2);
  1107. char *szChatMessage = new char[nMessageLen + 1];
  1108. memset(szChatMessage, 0x00, nMessageLen + 1);
  1109. memcpy(szChatMessage, pChatMessage->byFileContent, nMessageLen);
  1110. g_server = szChatMessage;
  1111. delete[]szChatMessage;
  1112. CStdioFile fp;
  1113. CString path = g_mainpath + "\\ip.txt";
  1114. ::DeleteFile(path);
  1115. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1116. fp.WriteString(g_server);
  1117. fp.Close();
  1118. g_conntype = 0;
  1119. // g_serverip=g_server;
  1120. return;
  1121. }
  1122. if (g_pData2 == NULL)
  1123. {
  1124. g_pData2 = new BYTE[nMessageLen2];
  1125. g_nLeng2 = 0;
  1126. }
  1127. memcpy(g_pData2 + g_nLeng2, pChatMessage->byFileContent, nMessageLen);
  1128. g_nLeng2 += nMessageLen;
  1129. if (g_nLeng2 == nMessageLen2)//已收完
  1130. {
  1131. KillTimer(2);
  1132. if (g_hSendWnd)
  1133. {
  1134. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1135. }
  1136. }
  1137. else
  1138. {
  1139. KillTimer(2);
  1140. SetTimer(2, g_ntimeout, NULL);
  1141. }
  1142. }
  1143. }
  1144. BOOL CMainFrame::OnConnectBranch()
  1145. {
  1146. if (g_branchip == "")
  1147. {
  1148. return 0;
  1149. }
  1150. g_conntype = 0;
  1151. CString strServerAddress = g_branchip;
  1152. char *szServerAddress = strServerAddress.GetBuffer(0);
  1153. strServerAddress.ReleaseBuffer();
  1154. /*for Client, IP and Port can be 0,
  1155. and for Server, IP is LocalIP, and Port is Listening Port*/
  1156. int nResult = m_tClientTunnel.net_OpenSocket(
  1157. Transport_Client,
  1158. 0,
  1159. HandleClientNetEvent,
  1160. this);
  1161. if (TRANSPORT_OK != nResult)
  1162. {
  1163. // AfxMessageBox("网络初始化失败!");
  1164. return 0;
  1165. }
  1166. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1167. DWORD wPort = g_dwCSPort;
  1168. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1169. if (TRANSPORT_OK != nResult)
  1170. {
  1171. m_tClientTunnel.net_CloseSocket();
  1172. return OnConnectBranch2();
  1173. return 0;
  1174. }
  1175. return ProcessLoginRequest();
  1176. }
  1177. BOOL CMainFrame::OnConnectBranch2()
  1178. {
  1179. if (g_branchip2 == "")
  1180. {
  1181. return 0;
  1182. }
  1183. g_conntype = 0;
  1184. CString strServerAddress = g_branchip2;
  1185. char *szServerAddress = strServerAddress.GetBuffer(0);
  1186. strServerAddress.ReleaseBuffer();
  1187. /*for Client, IP and Port can be 0,
  1188. and for Server, IP is LocalIP, and Port is Listening Port*/
  1189. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1190. 0,
  1191. HandleClientNetEvent,
  1192. this);
  1193. if (TRANSPORT_OK != nResult)
  1194. {
  1195. // AfxMessageBox("网络初始化失败!");
  1196. return 0;
  1197. }
  1198. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1199. DWORD wPort = g_dwCSPort;
  1200. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1201. if (TRANSPORT_OK != nResult)
  1202. {
  1203. m_tClientTunnel.net_CloseSocket();
  1204. return 0;
  1205. }
  1206. return ProcessLoginRequest();
  1207. }
  1208. BOOL CMainFrame::OnConnectIP()
  1209. {
  1210. CString strServerAddress = g_server;
  1211. char *szServerAddress = strServerAddress.GetBuffer(0);
  1212. strServerAddress.ReleaseBuffer();
  1213. /*for Client, IP and Port can be 0,
  1214. and for Server, IP is LocalIP, and Port is Listening Port*/
  1215. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1216. 0,
  1217. HandleClientNetEvent,
  1218. this);
  1219. if (TRANSPORT_OK != nResult)
  1220. {
  1221. // AfxMessageBox("网络初始化失败!");
  1222. return 0;
  1223. }
  1224. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1225. DWORD wPort = g_dwCSPort;
  1226. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1227. if (TRANSPORT_OK != nResult)
  1228. {
  1229. m_tClientTunnel.net_CloseSocket();
  1230. return 0;
  1231. }
  1232. return ProcessLoginRequest();
  1233. }
  1234. //ip.txt
  1235. BOOL CMainFrame::OnConnectLYFZ()
  1236. {
  1237. CString strBranchIP = "lijiafz.vicp.net";
  1238. MyGetIPByName2(strBranchIP);
  1239. if (strBranchIP == "")
  1240. {
  1241. return 0;
  1242. }
  1243. g_conntype = 0; // Jeff.Delete at 2014.10.18
  1244. //g_conntype = 1;
  1245. CString strServerAddress = strBranchIP;
  1246. char *szServerAddress = strServerAddress.GetBuffer(0);
  1247. strServerAddress.ReleaseBuffer();
  1248. /*for Client, IP and Port can be 0,
  1249. and for Server, IP is LocalIP, and Port is Listening Port*/
  1250. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1251. 0,
  1252. HandleClientNetEvent,
  1253. this);
  1254. if (TRANSPORT_OK != nResult)
  1255. {
  1256. return 0;
  1257. }
  1258. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1259. DWORD wPort = GetPort();
  1260. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1261. if (TRANSPORT_OK != nResult)
  1262. {
  1263. m_tClientTunnel.net_CloseSocket();
  1264. return 0;
  1265. }
  1266. return ProcessLoginRequest();
  1267. }
  1268. BOOL CMainFrame::OnConnect()
  1269. {
  1270. // 1.Jeff 断开(如果有在在未关的连接)之前的连接;
  1271. OnDisconnect();
  1272. // 2.根据需要连接指定的服务器;
  1273. if (g_bBranchModify)
  1274. {
  1275. // Jeff.g_bBranchModify在g_bGenBranchData=1时,在welcome::OnTimer里被设置为1;
  1276. return OnConnectBranch();// 连接集团版分店;
  1277. }
  1278. if (g_bConnLYFZ)
  1279. {
  1280. return OnConnectLYFZ();// 连接公司服务端程序;
  1281. }
  1282. g_conntype = 0;
  1283. CString strServerAddress = g_server;
  1284. // 3.如果dbconfig.dat里保存的是*.ly.com的信息,就要读取ip.txt里的IP地址;
  1285. if (g_serverbak.Find(".ly.com") != -1)
  1286. {
  1287. strServerAddress = g_serverbak;
  1288. CStdioFile fp;
  1289. CString path = g_mainpath + "\\ip.txt";
  1290. if (::PathFileExists(path))
  1291. {
  1292. fp.Open(path, CFile::modeRead);
  1293. fp.ReadString(g_server);
  1294. fp.Close();
  1295. if (OnConnectIP())
  1296. {
  1297. // g_serverip=g_server;
  1298. return 1;
  1299. }
  1300. g_server = strServerAddress;
  1301. OnDisconnect();//MessageBox("ip失败");
  1302. }
  1303. g_conntype = 1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1304. strServerAddress = "lijiafz.vicp.net";
  1305. MyGetIPByName2(strServerAddress);
  1306. if (strServerAddress.IsEmpty())
  1307. {
  1308. return 0;//OnConnect2();
  1309. }
  1310. }
  1311. else if (g_ntimeout == 29000)//非远程 30000
  1312. {
  1313. strServerAddress = g_serverarray.ElementAt(g_conpos);
  1314. }
  1315. // 4.如果没有IP.txt或dbconfig.dat里的不是ly.com信息,而是一般的计算机名称;
  1316. char *szServerAddress = strServerAddress.GetBuffer(0);
  1317. strServerAddress.ReleaseBuffer();
  1318. // AfxMessageBox("连接:"+strServerAddress);
  1319. /*for Client, IP and Port can be 0,
  1320. and for Server, IP is LocalIP, and Port is Listening Port*/
  1321. // 5.创建通信对象连接;
  1322. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1323. 0,
  1324. HandleClientNetEvent,
  1325. this);
  1326. if (TRANSPORT_OK != nResult)
  1327. {
  1328. return 0;
  1329. }
  1330. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1331. DWORD wPort = g_dwCSPort;
  1332. if (g_conntype) wPort = GetPort();
  1333. // 6.连接公司服务器或影楼服务器;
  1334. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1335. if (TRANSPORT_OK != nResult)
  1336. {
  1337. m_tClientTunnel.net_CloseSocket();
  1338. if (g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1339. {
  1340. return 0;//OnConnect2();
  1341. }
  1342. if (g_serverarray.GetSize() > 1)
  1343. {
  1344. if (g_conpos < (g_serverarray.GetSize() - 1))
  1345. {
  1346. g_conpos++;
  1347. return OnConnect();
  1348. }
  1349. else
  1350. {
  1351. g_conpos = 0;
  1352. return 0;
  1353. }
  1354. }
  1355. return 0;
  1356. }
  1357. return ProcessLoginRequest();
  1358. }
  1359. BOOL CMainFrame::OnConnect2()
  1360. {
  1361. g_conntype = 2;
  1362. CString server = "http://www.lyfz.net/download/ip.txt";
  1363. char buf[MAX_PATH];
  1364. ::GetTempPath(sizeof(buf), buf);
  1365. CString m_strTempDir = buf;
  1366. DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1367. INTERNET_PORT m_dwPort;
  1368. DWORD dwType;
  1369. CInternetSession m_cis;
  1370. CHttpConnection *m_pHttp;
  1371. CString m_strServer;
  1372. CString m_strIniPath;
  1373. AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
  1374. if (dwType != AFX_INET_SERVICE_HTTP)
  1375. {
  1376. return 0;//OnConnect3();
  1377. }
  1378. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
  1379. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1380. try
  1381. {
  1382. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1383. }
  1384. catch (CInternetException* pEx)
  1385. {
  1386. return 0;//OnConnect3();
  1387. }
  1388. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1389. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1390. try
  1391. {
  1392. pFile->SendRequest();
  1393. }
  1394. catch (CInternetException* pEx)
  1395. {
  1396. pFile->Close();
  1397. return 0;//OnConnect3();
  1398. }
  1399. if (pFile)
  1400. {
  1401. CStdioFile csf;
  1402. csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
  1403. char buf[2048];
  1404. int n;
  1405. while ((n = pFile->Read(buf, 2048)) > 0)
  1406. csf.Write(buf, n);
  1407. csf.Close();
  1408. pFile->Close();
  1409. }
  1410. CString strServerAddress;
  1411. CStdioFile fp;
  1412. fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
  1413. fp.ReadString(strServerAddress);
  1414. fp.Close();
  1415. char *szServerAddress = strServerAddress.GetBuffer(0);
  1416. strServerAddress.ReleaseBuffer();
  1417. /*for Client, IP and Port can be 0,
  1418. and for Server, IP is LocalIP, and Port is Listening Port*/
  1419. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1420. 0,
  1421. HandleClientNetEvent,
  1422. this);
  1423. if (TRANSPORT_OK != nResult)
  1424. {
  1425. return 0;
  1426. }
  1427. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1428. DWORD wPort = g_dwCSPort;
  1429. if (g_conntype)wPort = GetPort();
  1430. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1431. if (TRANSPORT_OK != nResult)
  1432. {
  1433. m_tClientTunnel.net_CloseSocket();
  1434. return 0;//OnConnect3();
  1435. }
  1436. return ProcessLoginRequest();
  1437. }
  1438. BOOL CMainFrame::OnConnect3()
  1439. {
  1440. g_conntype = 3;
  1441. CString server = "http://photo.bjlyfz.com/download/ip.txt";
  1442. char buf[MAX_PATH];
  1443. ::GetTempPath(sizeof(buf), buf);
  1444. CString m_strTempDir = buf;
  1445. DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1446. INTERNET_PORT m_dwPort;
  1447. DWORD dwType;
  1448. CInternetSession m_cis;
  1449. CHttpConnection *m_pHttp;
  1450. CString m_strServer;
  1451. CString m_strIniPath;
  1452. AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
  1453. if (dwType != AFX_INET_SERVICE_HTTP)
  1454. {
  1455. return FALSE;
  1456. }
  1457. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
  1458. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1459. try
  1460. {
  1461. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1462. }
  1463. catch (CInternetException* pEx)
  1464. {
  1465. return false;
  1466. }
  1467. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1468. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1469. try
  1470. {
  1471. pFile->SendRequest();
  1472. }
  1473. catch (CInternetException* pEx)
  1474. {
  1475. pFile->Close();
  1476. return false;
  1477. }
  1478. if (pFile)
  1479. {
  1480. CStdioFile csf;
  1481. csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
  1482. char buf[2048];
  1483. int n;
  1484. while ((n = pFile->Read(buf, 2048)) > 0)
  1485. csf.Write(buf, n);
  1486. csf.Close();
  1487. pFile->Close();
  1488. }
  1489. CString strServerAddress;
  1490. CStdioFile fp;
  1491. fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
  1492. fp.ReadString(strServerAddress);
  1493. fp.Close();
  1494. char *szServerAddress = strServerAddress.GetBuffer(0);
  1495. strServerAddress.ReleaseBuffer();
  1496. /*for Client, IP and Port can be 0,
  1497. and for Server, IP is LocalIP, and Port is Listening Port*/
  1498. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1499. 0,
  1500. HandleClientNetEvent,
  1501. this);
  1502. if (TRANSPORT_OK != nResult)
  1503. {
  1504. return 0;
  1505. }
  1506. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1507. DWORD wPort = g_dwCSPort;
  1508. if (g_conntype)wPort = GetPort();
  1509. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1510. if (TRANSPORT_OK != nResult)
  1511. {
  1512. m_tClientTunnel.net_CloseSocket();
  1513. return 0;
  1514. }
  1515. return ProcessLoginRequest();
  1516. }
  1517. void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
  1518. {
  1519. //printf("Jeff:ProcessNetEvent\n\n");//Jeff Printf;
  1520. if (Transport_ReadEv == nEventType)
  1521. {
  1522. if (NULL == pRecvMsg) return;
  1523. TMessageHeader* pHeader = (TMessageHeader *)pRecvMsg;
  1524. char *pDataBuf = (char *)pRecvMsg + MESSAGE_HEADER_LEN;
  1525. WORD dwMessageID = pHeader->wMessageId;
  1526. switch (dwMessageID)
  1527. {
  1528. case MSG_LOGIN_RESP:
  1529. case (MSG_LOGIN_RESP + 0X2FFF) :
  1530. {
  1531. LOGIN_RESULT_STRU tLoginResult = { 0 };
  1532. memcpy(&tLoginResult, pDataBuf, sizeof(LOGIN_RESULT_STRU));
  1533. ProcessLoginResponse(&tLoginResult);
  1534. break;
  1535. }
  1536. case MSG_USERINFO_RESP:
  1537. {
  1538. break;
  1539. }
  1540. case MSG_LOGOUT_RESP:
  1541. {
  1542. break;
  1543. }
  1544. case MSG_CHATMESSAGE_RESP:
  1545. case (MSG_CHATMESSAGE_RESP + 0X4FFF) :
  1546. {
  1547. //AfxMessageBox("登陆成功");
  1548. //printf("Jeff:MSG_CHATMESSAGE_RESP\n\n");//Jeff Printf;
  1549. static int i = 0;
  1550. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pDataBuf;
  1551. ProcessChatMessageResponse((void *)pChatMessage);
  1552. break;
  1553. }
  1554. default:
  1555. {
  1556. break;
  1557. }
  1558. }
  1559. }
  1560. else if (Transport_CloseEv == nEventType)
  1561. {
  1562. OnDisconnect();
  1563. }
  1564. }
  1565. //extern BOOL g_bNeedCoon;
  1566. extern BOOL EncryptFile2(BYTE *buffer, DWORD leng, PCHAR szPassword);
  1567. void CMainFrame::OnTimer(UINT nIDEvent)
  1568. {
  1569. // TODO: Add your message handler code here and/or call default
  1570. if (1 == nIDEvent)
  1571. {
  1572. KillTimer(nIDEvent);
  1573. CString version = _T("Version 1.0");
  1574. BOOL checked = AfxGetApp()->GetProfileInt(version, "status", 0);//status:此机用选片菜单项
  1575. // checked==1:此机用选片菜单项
  1576. // g_bStaffAchievementShow==1:此机用于员工业绩查看
  1577. if (checked && g_bStaffAchievementShow == 0) // .此机用选片菜单项;
  1578. {
  1579. KillTimer(3);
  1580. #ifdef NEW_SKIN
  1581. Welcome weldlg;
  1582. weldlg.DoModal();
  1583. #endif
  1584. ChoosePhotoSkin dlg;
  1585. dlg.SetLiaPath("1.lia");
  1586. if (dlg.DoModal() != IDOK)
  1587. {
  1588. PostMessage(WM_QUIT);
  1589. return;
  1590. }
  1591. if (dlg.m_exitcode == 3)
  1592. {
  1593. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  1594. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  1595. }
  1596. else
  1597. {
  1598. ShowWindow(SW_SHOW);
  1599. #ifdef NEW_SKIN
  1600. if (m_pMainFrimDlg2 == NULL)
  1601. {
  1602. m_pMainFrimDlg2 = new MainFrimDlg2;
  1603. m_pMainFrimDlg2->SetLiaPath("10.lia");
  1604. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  1605. }
  1606. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1607. #endif
  1608. }
  1609. }
  1610. else if (g_bStaffAchievementShow == 0) // .非选片、非查看员工业绩;
  1611. {
  1612. #ifdef NEW_SKIN
  1613. g_bNoConnDlg = 1;
  1614. Welcome weldlg;
  1615. weldlg.DoModal();
  1616. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1617. ShowWindow(SW_SHOW);
  1618. g_bNoConnDlg = 0;
  1619. if (g_bNoLoginLia) // Jeff.OnCreate里判断skin文件有5.lia, g_bNoLoginLia = 0, 无 g_bNoLoginLia = 1;
  1620. {
  1621. Login dlg;
  1622. dlg.SetLiaPath("5.lia");
  1623. dlg.DoModal();
  1624. }
  1625. else
  1626. {
  1627. Login3 dlg;
  1628. dlg.SetLiaPath("5.lia"); // Login3的父类为MyDlg,在BOOL MyDlg::OnInitDialog()里调用了纯虚函数Init();
  1629. dlg.DoModal();
  1630. }
  1631. if (g_user.bLongin && g_pMainWnd2)
  1632. {
  1633. g_pMainWnd2->ShowBar(1);
  1634. InsideMsg();
  1635. }
  1636. #else
  1637. ShowWindow(SW_SHOW);
  1638. if (g_bNoLoginLia)
  1639. {
  1640. Login dlg;
  1641. dlg.SetLiaPath ("5.lia");
  1642. dlg.DoModal();
  1643. }
  1644. else
  1645. {
  1646. Login3 dlg;
  1647. dlg.SetLiaPath ("5.lia");
  1648. dlg.DoModal();
  1649. }
  1650. #endif
  1651. }
  1652. if (g_hmouse == NULL)//&& atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
  1653. {
  1654. g_hmouse = SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId());
  1655. }
  1656. }
  1657. else if (2 == nIDEvent) //29秒后,若连接和发送未完成,将关闭连接和发送框;
  1658. {
  1659. KillTimer(2);
  1660. if (g_hConnectWnd)
  1661. ::SendMessage(g_hConnectWnd, WM_CLOSE, 0, 0);
  1662. if (g_hSendWnd)
  1663. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1664. if (g_bStaffAchievementShow == 0 && g_bConnLYFZ == 0)
  1665. {
  1666. if (g_bGenBranchData == 0)
  1667. {
  1668. if (g_branchip != "")
  1669. AfxMessageBox("连接分店:" + g_branchname + "失败!", MB_ICONINFORMATION);
  1670. else
  1671. AfxMessageBox("连接服务器失败!", MB_ICONINFORMATION);
  1672. }
  1673. OnDisconnect();
  1674. }
  1675. g_bSendOK = 0;
  1676. g_bNeedCoon = 1;
  1677. }
  1678. else if (3 == nIDEvent)
  1679. {
  1680. KillTimer(3);
  1681. #ifdef NEW_SKIN
  1682. Welcome weldlg;
  1683. weldlg.DoModal();
  1684. #endif
  1685. ShowWindow(SW_SHOW);
  1686. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1687. g_sendhead.bsql = 0;
  1688. g_sendhead.code[0] = 24;
  1689. g_sendhead.code[1] = 1;
  1690. g_sendhead.tabcount = 2;
  1691. g_pMainWnd->ProcessChatMessageRequest2(1);
  1692. if (g_bSendOK == 0)
  1693. {
  1694. return;
  1695. }
  1696. CArray<CStringArray, CStringArray>patharray;
  1697. CArray<CStringArray, CStringArray>userarray;
  1698. DataToArray(&g_cominfoarray, &g_hisyeararray);
  1699. g_userarray.SetSize(userarray.GetSize(), 1);
  1700. int count = 0;
  1701. for (int ii = 0; ii < userarray.GetSize(); ii++)
  1702. {
  1703. if (userarray.ElementAt(ii).ElementAt(10) == "在职")
  1704. g_userarray.ElementAt(count++).Copy(userarray.ElementAt(ii));
  1705. }
  1706. g_userarray.SetSize(count, 1);
  1707. StaffAchievementShowAll dlg;
  1708. g_pMainWnd->GetOcx();
  1709. dlg.DoModal();
  1710. }
  1711. else if (5 == nIDEvent)
  1712. {
  1713. if (g_bInSkin)return;
  1714. if (g_nAutoShowStaffAchievement == 1)return;
  1715. if (g_bAllBranch)return;
  1716. if (g_user.bLongin)
  1717. {
  1718. // m_Mdi.CloseAll();
  1719. g_pMainWnd->OnCommandMenu(IDM_Logout);
  1720. }
  1721. /* g_nAutoShowStaffAchievement=1;
  1722. KillTimer(5);
  1723. StaffAchievementShowAll dlg;
  1724. g_pMainWnd->GetOcx();
  1725. dlg.DoModal ();*/
  1726. }
  1727. else if (6 == nIDEvent)
  1728. {
  1729. static BOOL bDouble = 0;
  1730. bDouble = !bDouble;
  1731. if (bDouble)
  1732. g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
  1733. else
  1734. g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
  1735. }
  1736. else if (7 == nIDEvent)
  1737. {
  1738. // Jeff,当g_bSendLYFZ==TRUE时;
  1739. // 向lijiafz.vicp.net发送影楼信息,防止有盗版用户;
  1740. KillTimer(7);
  1741. if (g_bInSkin)return;
  1742. if (g_nAutoShowStaffAchievement == 1)return;
  1743. if (g_bAllBranch)return;
  1744. CString str = g_sInfo;
  1745. g_bConnLYFZ = 1; // Jeff指示连接的服务器为lijiafz.vicp.net
  1746. // 断开当前连接;
  1747. OnDisconnect();
  1748. BYTE *pData = new BYTE[str.GetLength()];
  1749. memcpy(pData, str.GetBuffer(0), str.GetLength());
  1750. str.ReleaseBuffer();
  1751. EncryptFile2(pData, str.GetLength(), "888666333");
  1752. g_nSendCode = 16;
  1753. g_pMainWnd->ProcessChatMessageRequest2(pData, str.GetLength());
  1754. g_nSendCode = 0;
  1755. delete[]pData;
  1756. OnDisconnect();
  1757. g_bSendLYFZ = 0;
  1758. g_bConnLYFZ = 0;
  1759. if (g_bSendOK)
  1760. {
  1761. char *pStr = new char[g_nLeng + 1];
  1762. memset(pStr, 0, g_nLeng + 1);
  1763. memcpy(pStr, g_pData, g_nLeng);
  1764. CString str = pStr;
  1765. delete[]pStr;
  1766. if (str == "g_bInSkin")
  1767. {
  1768. g_sendhead.bsql = 1;
  1769. g_pMainWnd->ProcessChatMessageRequest2("update version set [setcheck1]='ok'");
  1770. }
  1771. }
  1772. }
  1773. /* else if( 4 == nIDEvent )
  1774. {
  1775. if(g_user.bLongin && g_bInSkin==0)
  1776. {
  1777. g_user.bLongin=0;
  1778. g_user.name.Empty ();
  1779. g_user.rights.Empty ();
  1780. #ifndef NEW_SKIN
  1781. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  1782. #endif
  1783. m_Mdi.CloseAll();
  1784. if(g_pMainWnd2)g_pMainWnd2->DrawLogin();
  1785. }
  1786. }*/
  1787. }
  1788. void CMainFrame::OnOutbarNotify(CString strMsg)
  1789. {
  1790. if (g_user.bLongin == 0)
  1791. {
  1792. if (g_bNoLoginLia)
  1793. {
  1794. Login dlg;
  1795. dlg.SetLiaPath("5.lia");
  1796. dlg.DoModal();
  1797. }
  1798. else
  1799. {
  1800. Login3 dlg;
  1801. dlg.SetLiaPath("5.lia");
  1802. dlg.DoModal();
  1803. }
  1804. return;
  1805. if (g_user.bLongin == 0)return;
  1806. }
  1807. else
  1808. {
  1809. InsideMsg();
  1810. }
  1811. ResetTimer();
  1812. if (strMsg == "开单")
  1813. {
  1814. if (IsHasRights(0) == 0)return;
  1815. /* UINT nID=0;
  1816. LPSTR pName ;
  1817. pName = (LPSTR)(LPCSTR)"开单";
  1818. OPEN_MENU(Booking);*/
  1819. Booking2 dlg;
  1820. dlg.DoModal();
  1821. return;
  1822. }
  1823. else if (strMsg == "拍照")
  1824. {
  1825. if (IsHasRights(1) == 0)return;
  1826. UINT nID = 1;
  1827. LPSTR pName;
  1828. pName = (LPSTR)(LPCSTR)"拍照";
  1829. OPEN_MENU(TakeFrom);
  1830. return;
  1831. }
  1832. else if (strMsg == "修片")
  1833. {
  1834. if (IsHasRights(1) == 0)return;
  1835. UINT nID = 1;
  1836. LPSTR pName;
  1837. pName = (LPSTR)(LPCSTR)"修片";
  1838. OPEN_MENU(BeautifySkinFrom);
  1839. return;
  1840. }
  1841. else if (strMsg == "选片")
  1842. {
  1843. if (IsHasRights(2) == 0)return;
  1844. UINT nID = 1;
  1845. LPSTR pName;
  1846. pName = (LPSTR)(LPCSTR)"选片";
  1847. OPEN_MENU(ChoosePhotoForm);
  1848. return;
  1849. }
  1850. else if (strMsg == "精修")
  1851. {
  1852. if (IsHasRights(2) == 0)return;
  1853. UINT nID = 1;
  1854. LPSTR pName;
  1855. pName = (LPSTR)(LPCSTR)"精修";
  1856. OPEN_MENU(BeautifySkinFrom2);
  1857. return;
  1858. }
  1859. else if (strMsg == "设计")
  1860. {
  1861. if (IsHasRights(2) == 0)return;
  1862. UINT nID = 1;
  1863. LPSTR pName;
  1864. pName = (LPSTR)(LPCSTR)"设计";
  1865. OPEN_MENU(DesignFrom);
  1866. return;
  1867. }
  1868. else if (strMsg == "数码安排")
  1869. {
  1870. UINT nID = 1;
  1871. LPSTR pName;
  1872. pName = (LPSTR)(LPCSTR)"数码安排";
  1873. OPEN_MENU(DigitalWork);
  1874. return;
  1875. }
  1876. else if (strMsg == "刻盘")
  1877. {
  1878. UINT nID = 1;
  1879. LPSTR pName;
  1880. pName = (LPSTR)(LPCSTR)"刻盘";
  1881. OPEN_MENU(BurnCD);
  1882. return;
  1883. }
  1884. else if (strMsg == "相片冲印")
  1885. {
  1886. UINT nID = 1;
  1887. LPSTR pName;
  1888. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  1889. OPEN_MENU(PhotoPrintFrom);
  1890. return;
  1891. }
  1892. else if (strMsg == "发片/取件")
  1893. {
  1894. if (IsHasRights(3) == 0)return;
  1895. UINT nID = 1;
  1896. LPSTR pName;
  1897. pName = (LPSTR)(LPCSTR)"发片/取件";
  1898. OPEN_MENU(outsourcing);
  1899. return;
  1900. }
  1901. else if (strMsg == "满意度")
  1902. {
  1903. UINT nID = 1;
  1904. LPSTR pName;
  1905. pName = (LPSTR)(LPCSTR)"满意度";
  1906. OPEN_MENU(Satisfaction);
  1907. return;
  1908. }
  1909. else if (strMsg == "满意度图表")
  1910. {
  1911. UINT nID = 1;
  1912. LPSTR pName;
  1913. pName = (LPSTR)(LPCSTR)"满意度图表";
  1914. OPEN_MENU(SatisfactionForm);
  1915. return;
  1916. }
  1917. #if JEFF_DELETE_ON // 2014.11.14-PM 16:20
  1918. else if (strMsg == "回复统计")
  1919. {
  1920. UINT nID = 1;
  1921. LPSTR pName;
  1922. pName = (LPSTR)(LPCSTR)"回复统计";
  1923. OPEN_MENU(MsgReg2);
  1924. return;
  1925. }
  1926. #endif
  1927. /* else if(strMsg=="取件")
  1928. {
  1929. if(IsHasRights(3)==0)return;
  1930. UINT nID=1;
  1931. LPSTR pName ;
  1932. pName = (LPSTR)(LPCSTR)"取件";
  1933. OPEN_MENU(TakeAwayFrom);
  1934. return;
  1935. }*/
  1936. else if (strMsg == "其它收入")
  1937. {
  1938. if (IsHasRightsnew(16) == 0)return;
  1939. // if(IsHasRightsnew(48)==0)return;
  1940. UINT nID = 1;
  1941. LPSTR pName;
  1942. pName = (LPSTR)(LPCSTR)"其它收入";
  1943. OPEN_MENU(IncomeInput);
  1944. return;
  1945. }
  1946. else if (strMsg == "其它二销")
  1947. {
  1948. if (IsHasRightsnew(16) == 0)return;
  1949. UINT nID = 1;
  1950. LPSTR pName;
  1951. pName = (LPSTR)(LPCSTR)"其它二销";
  1952. OPEN_MENU(IncomeInput2);
  1953. return;
  1954. }
  1955. else if (strMsg == "员工奖罚")
  1956. {
  1957. if (IsHasRightsnew(16) == 0)return;
  1958. UINT nID = 1;
  1959. LPSTR pName;
  1960. pName = (LPSTR)(LPCSTR)"员工奖罚";
  1961. OPEN_MENU(IncomeInput3);
  1962. return;
  1963. }
  1964. else if (strMsg == "员工奖惩")
  1965. {
  1966. if (IsHasRightsnew(16) == 0)return;
  1967. UINT nID = 1;
  1968. LPSTR pName;
  1969. pName = (LPSTR)(LPCSTR)"员工奖惩";
  1970. OPEN_MENU(IncomeInput4);
  1971. return;
  1972. }
  1973. else if (strMsg == "订单收款")
  1974. {
  1975. if (IsHasRights(17) == 0)return;
  1976. UINT nID = 1;
  1977. LPSTR pName;
  1978. pName = (LPSTR)(LPCSTR)"订单收款";
  1979. OPEN_MENU(FinanceForm);
  1980. return;
  1981. }
  1982. else if (strMsg == "日财务表")
  1983. {
  1984. if (IsHasRightsnew(22) == 0)return;
  1985. UINT nID = 2;
  1986. LPSTR pName;
  1987. pName = (LPSTR)(LPCSTR)"日财务表";
  1988. OPEN_MENU(DailyForm);
  1989. return;
  1990. }
  1991. else if (strMsg == "提成比例")
  1992. {
  1993. #ifndef ENTERPRISE_VERSION
  1994. #ifndef CHILD_VERSION
  1995. #ifdef BASIC_VERSION
  1996. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  1997. {
  1998. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  1999. exit(0);return;
  2000. }
  2001. #else
  2002. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2003. {
  2004. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2005. exit(0);return;
  2006. }
  2007. #endif
  2008. #else
  2009. #ifdef BASIC_VERSION
  2010. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2011. {
  2012. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2013. exit(0);return;
  2014. }
  2015. #else
  2016. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2017. {
  2018. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2019. exit(0);return;
  2020. }
  2021. #endif
  2022. #endif
  2023. #else
  2024. #ifndef CHILD_VERSION
  2025. #ifdef BASIC_VERSION
  2026. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2027. {
  2028. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2029. exit(0); return;
  2030. }
  2031. #else
  2032. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2033. {
  2034. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2035. exit(0); return;
  2036. }
  2037. #endif
  2038. #else
  2039. #ifdef BASIC_VERSION
  2040. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2041. {
  2042. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2043. exit(0);return;
  2044. }
  2045. #else
  2046. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2047. {
  2048. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2049. exit(0); return;
  2050. }
  2051. #endif
  2052. #endif
  2053. #endif
  2054. UINT nID = 2;
  2055. LPSTR pName;
  2056. pName = (LPSTR)(LPCSTR)"提成比例";
  2057. OPEN_MENU(SalarySet2);
  2058. return;
  2059. }
  2060. //else if(strMsg=="员工工作")
  2061. else if (strMsg == "计件提成")
  2062. {
  2063. UINT nID = 2;
  2064. LPSTR pName;
  2065. //pName = (LPSTR)(LPCSTR)"员工工作";
  2066. pName = (LPSTR)(LPCSTR)"计件提成";
  2067. OPEN_MENU(SalarySet3);
  2068. return;
  2069. }
  2070. else if (strMsg == "工资管理")
  2071. {
  2072. #ifndef ENTERPRISE_VERSION
  2073. #ifndef CHILD_VERSION
  2074. #ifdef BASIC_VERSION
  2075. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2076. {
  2077. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2078. exit(0);return;
  2079. }
  2080. #else
  2081. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2082. {
  2083. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2084. exit(0);return;
  2085. }
  2086. #endif
  2087. #else
  2088. #ifdef BASIC_VERSION
  2089. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2090. {
  2091. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2092. exit(0);return;
  2093. }
  2094. #else
  2095. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2096. {
  2097. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2098. exit(0);return;
  2099. }
  2100. #endif
  2101. #endif
  2102. #else
  2103. #ifndef CHILD_VERSION
  2104. #ifdef BASIC_VERSION
  2105. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2106. {
  2107. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2108. exit(0); return;
  2109. }
  2110. #else
  2111. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2112. {
  2113. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2114. exit(0); return;
  2115. }
  2116. #endif
  2117. #else
  2118. #ifdef BASIC_VERSION
  2119. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2120. {
  2121. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2122. exit(0);return;
  2123. }
  2124. #else
  2125. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2126. {
  2127. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2128. exit(0); return;
  2129. }
  2130. #endif
  2131. #endif
  2132. #endif
  2133. UINT nID = 2;
  2134. LPSTR pName;
  2135. pName = (LPSTR)(LPCSTR)"工资管理";
  2136. OPEN_MENU(MySalary);
  2137. return;
  2138. }
  2139. else if (strMsg == "客人付款")
  2140. {
  2141. UINT nID = 2;
  2142. LPSTR pName;
  2143. pName = (LPSTR)(LPCSTR)"客人付款";
  2144. OPEN_MENU(ClientMoney);
  2145. return;
  2146. }
  2147. else if (strMsg == "工资报表")
  2148. {
  2149. #ifndef ENTERPRISE_VERSION
  2150. #ifndef CHILD_VERSION
  2151. #ifdef BASIC_VERSION
  2152. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2153. {
  2154. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2155. exit(0);return;
  2156. }
  2157. #else
  2158. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2159. {
  2160. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2161. exit(0);return;
  2162. }
  2163. #endif
  2164. #else
  2165. #ifdef BASIC_VERSION
  2166. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2167. {
  2168. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2169. exit(0);return;
  2170. }
  2171. #else
  2172. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2173. {
  2174. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2175. exit(0);return;
  2176. }
  2177. #endif
  2178. #endif
  2179. #else
  2180. #ifndef CHILD_VERSION
  2181. #ifdef BASIC_VERSION
  2182. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2183. {
  2184. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2185. exit(0); return;
  2186. }
  2187. #else
  2188. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2189. {
  2190. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2191. exit(0); return;
  2192. }
  2193. #endif
  2194. #else
  2195. #ifdef BASIC_VERSION
  2196. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2197. {
  2198. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2199. exit(0);return;
  2200. }
  2201. #else
  2202. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2203. {
  2204. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2205. exit(0); return;
  2206. }
  2207. #endif
  2208. #endif
  2209. #endif
  2210. if (IsHasRightsnew(25) == 0)return;
  2211. UINT nID = 2;
  2212. LPSTR pName;
  2213. pName = (LPSTR)(LPCSTR)"工资报表";
  2214. g_ncount = 100;
  2215. OPEN_MENU(MySalary);
  2216. return;
  2217. }
  2218. else if (strMsg == "员工业绩")
  2219. {
  2220. #ifndef ENTERPRISE_VERSION
  2221. #ifndef CHILD_VERSION
  2222. #ifdef BASIC_VERSION
  2223. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2224. {
  2225. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2226. exit(0);return;
  2227. }
  2228. #else
  2229. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2230. {
  2231. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2232. exit(0);return;
  2233. }
  2234. #endif
  2235. #else
  2236. #ifdef BASIC_VERSION
  2237. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2238. {
  2239. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2240. exit(0);return;
  2241. }
  2242. #else
  2243. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2244. {
  2245. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2246. exit(0);return;
  2247. }
  2248. #endif
  2249. #endif
  2250. #else
  2251. #ifndef CHILD_VERSION
  2252. #ifdef BASIC_VERSION
  2253. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2254. {
  2255. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2256. exit(0); return;
  2257. }
  2258. #else
  2259. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2260. {
  2261. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2262. exit(0); return;
  2263. }
  2264. #endif
  2265. #else
  2266. #ifdef BASIC_VERSION
  2267. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2268. {
  2269. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2270. exit(0);return;
  2271. }
  2272. #else
  2273. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2274. {
  2275. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2276. exit(0); return;
  2277. }
  2278. #endif
  2279. #endif
  2280. #endif
  2281. if (IsHasRightsnew(33) == 0)return;
  2282. UINT nID = 2;
  2283. LPSTR pName;
  2284. pName = (LPSTR)(LPCSTR)"员工业绩";
  2285. OPEN_MENU(StaffAchievement);
  2286. return;
  2287. }
  2288. else if (strMsg == "订单客户")
  2289. {
  2290. UINT nID = 2;
  2291. LPSTR pName;
  2292. pName = (LPSTR)(LPCSTR)"订单客户";
  2293. g_dx += 10000;
  2294. OPEN_MENU(CClientForm);
  2295. if (g_dx >= 10000)g_dx -= 10000;
  2296. return;
  2297. }
  2298. else if (strMsg == "服务记录")
  2299. {
  2300. UINT nID = 2;
  2301. LPSTR pName;
  2302. pName = (LPSTR)(LPCSTR)"服务记录";
  2303. OPEN_MENU(CClientForm2);
  2304. return;
  2305. }
  2306. else if (strMsg == "服务统计")
  2307. {
  2308. UINT nID = 2;
  2309. LPSTR pName;
  2310. pName = (LPSTR)(LPCSTR)"服务统计";
  2311. OPEN_MENU(CClientForm3);
  2312. return;
  2313. }
  2314. else if (strMsg == "意向客户")
  2315. {
  2316. UINT nID = 2;
  2317. LPSTR pName;
  2318. pName = (LPSTR)(LPCSTR)"意向客户";
  2319. #ifdef LYFZ_VERSION
  2320. OPEN_MENU(Client2FormLYFZ);
  2321. #else
  2322. OPEN_MENU(Client2Form);
  2323. #endif
  2324. return;
  2325. }
  2326. else if (strMsg == "老客户")
  2327. {
  2328. UINT nID = 2;
  2329. LPSTR pName;
  2330. pName = (LPSTR)(LPCSTR)"老客户";
  2331. OPEN_MENU(OldClient);
  2332. return;
  2333. }
  2334. else if (strMsg == "客户来电")
  2335. {
  2336. UINT nID = 2;
  2337. LPSTR pName;
  2338. pName = (LPSTR)(LPCSTR)"客户来电";
  2339. OPEN_MENU(PhoneRecord);
  2340. return;
  2341. }
  2342. else if (strMsg == "拨出电话")
  2343. {
  2344. UINT nID = 2;
  2345. LPSTR pName;
  2346. pName = (LPSTR)(LPCSTR)"拨出电话";
  2347. OPEN_MENU(PhoneRecordOut);
  2348. return;
  2349. }
  2350. else if (strMsg == "未接来电")
  2351. {
  2352. UINT nID = 2;
  2353. LPSTR pName;
  2354. pName = (LPSTR)(LPCSTR)"未接来电";
  2355. OPEN_MENU(MissCall);
  2356. return;
  2357. }
  2358. else if (strMsg == "客户流失")
  2359. {
  2360. UINT nID = 2;
  2361. LPSTR pName;
  2362. pName = (LPSTR)(LPCSTR)"客户流失";
  2363. OPEN_MENU(ClientReasonChart);
  2364. return;
  2365. }
  2366. else if (strMsg == "客户来源")
  2367. {
  2368. UINT nID = 2;
  2369. LPSTR pName;
  2370. pName = (LPSTR)(LPCSTR)"客户来源";
  2371. OPEN_MENU(ClientFromChart);
  2372. return;
  2373. }
  2374. else if (strMsg == "月财务表")
  2375. {
  2376. if (IsHasRightsnew(23) == 0)return;
  2377. UINT nID = 2;
  2378. LPSTR pName;
  2379. pName = (LPSTR)(LPCSTR)"月财务表";
  2380. OPEN_MENU(MonthForm);
  2381. return;
  2382. }
  2383. else if (strMsg == "支出报表")
  2384. {
  2385. if (IsHasRightsnew(23) == 0)return;
  2386. UINT nID = 2;
  2387. LPSTR pName;
  2388. pName = (LPSTR)(LPCSTR)"支出报表";
  2389. OPEN_MENU(MonthForm2);
  2390. return;
  2391. }
  2392. else if (strMsg == "年财务表")
  2393. {
  2394. if (IsHasRightsnew(24) == 0)return;
  2395. UINT nID = 2;
  2396. LPSTR pName;
  2397. pName = (LPSTR)(LPCSTR)"年财务表";
  2398. OPEN_MENU(YearForm);
  2399. return;
  2400. }
  2401. else if (strMsg == "年财务图表")
  2402. {
  2403. if (IsHasRightsnew(24) == 0)return;
  2404. GetOcx();
  2405. UINT nID = 2;
  2406. LPSTR pName;
  2407. pName = (LPSTR)(LPCSTR)"年财务图表";
  2408. OPEN_MENU(YearForm2);
  2409. return;
  2410. }
  2411. else if (strMsg == "订单图表")
  2412. {
  2413. GetOcx();
  2414. UINT nID = 2;
  2415. LPSTR pName;
  2416. pName = (LPSTR)(LPCSTR)"订单图表";
  2417. OPEN_MENU(DinDanForm);
  2418. return;
  2419. }
  2420. #ifdef ENTERPRISE_VERSION
  2421. else if (strMsg == "订单报表")
  2422. {
  2423. GetOcx();
  2424. UINT nID = 2;
  2425. LPSTR pName;
  2426. pName = (LPSTR)(LPCSTR)"订单报表2";
  2427. OPEN_MENU(DinDanFromBranch);
  2428. return;
  2429. }
  2430. else if (strMsg == "财务图表")
  2431. {
  2432. GetOcx();
  2433. UINT nID = 2;
  2434. LPSTR pName;
  2435. pName = (LPSTR)(LPCSTR)"财务图表";
  2436. OPEN_MENU(YearFormBranch);
  2437. return;
  2438. }
  2439. else if (strMsg == "订单图表")
  2440. {
  2441. GetOcx();
  2442. UINT nID = 2;
  2443. LPSTR pName;
  2444. pName = (LPSTR)(LPCSTR)"订单图表";
  2445. OPEN_MENU(YearFormBranch2);
  2446. return;
  2447. }
  2448. else if (strMsg == "摄控安排")
  2449. {
  2450. UINT nID = 2;
  2451. LPSTR pName;
  2452. pName = (LPSTR)(LPCSTR)"摄控安排";
  2453. g_bookingtype = 0;
  2454. OPEN_MENU(TodayForm);
  2455. return;
  2456. }
  2457. else if (strMsg == "选片预约")
  2458. {
  2459. UINT nID = 2;
  2460. LPSTR pName;
  2461. pName = (LPSTR)(LPCSTR)"选片预约";
  2462. g_bookingtype = 1;
  2463. OPEN_MENU(TodayForm);
  2464. return;
  2465. }
  2466. else if (strMsg == "看样预约")
  2467. {
  2468. UINT nID = 2;
  2469. LPSTR pName;
  2470. pName = (LPSTR)(LPCSTR)"看样预约";
  2471. g_bookingtype = 2;
  2472. OPEN_MENU(TodayForm);
  2473. return;
  2474. }
  2475. else if (strMsg == "取件预约")
  2476. {
  2477. UINT nID = 2;
  2478. LPSTR pName;
  2479. pName = (LPSTR)(LPCSTR)"取件预约";
  2480. g_bookingtype = 3;
  2481. OPEN_MENU(TodayForm);
  2482. return;
  2483. }
  2484. else if (strMsg == "婚庆安排")
  2485. {
  2486. UINT nID = 2;
  2487. LPSTR pName;
  2488. pName = (LPSTR)(LPCSTR)"婚庆安排";
  2489. g_bookingtype = 4;
  2490. OPEN_MENU(TodayForm);
  2491. return;
  2492. }
  2493. #endif
  2494. else if (strMsg == "员工资料")
  2495. {
  2496. UINT nID = 2;
  2497. LPSTR pName;
  2498. pName = (LPSTR)(LPCSTR)"员工资料";
  2499. if (g_bAllBranch)
  2500. OPEN_MENU(EmployeeForm2);
  2501. else
  2502. OPEN_MENU(EmployeeForm);
  2503. return;
  2504. }
  2505. else if (strMsg == "客户区域")
  2506. {
  2507. // if(IsHasRightsnew(48)==0)return;
  2508. GetOcx();
  2509. UINT nID = 2;
  2510. LPSTR pName;
  2511. pName = (LPSTR)(LPCSTR)"客户区域";
  2512. OPEN_MENU(AreaClient);
  2513. return;
  2514. }
  2515. else if (strMsg == "客户报表")
  2516. {
  2517. UINT nID = 3;
  2518. LPSTR pName;
  2519. pName = (LPSTR)(LPCSTR)"客户报表";
  2520. OPEN_MENU(CClientForm);
  2521. return;
  2522. }
  2523. else if (strMsg == "每日签到")
  2524. {
  2525. UINT nID = 3;
  2526. LPSTR pName;
  2527. pName = (LPSTR)(LPCSTR)"每日签到";
  2528. OPEN_MENU(WorkerReport);
  2529. return;
  2530. }
  2531. else if (strMsg == "服务费")
  2532. {
  2533. UINT nID = 3;
  2534. LPSTR pName;
  2535. pName = (LPSTR)(LPCSTR)"服务费";
  2536. OPEN_MENU(annualfee);
  2537. return;
  2538. }
  2539. else if (strMsg == "现金支出")
  2540. {
  2541. if (IsHasRightsnew(16) == 0)return;
  2542. UINT nID = 3;
  2543. LPSTR pName;
  2544. pName = (LPSTR)(LPCSTR)"现金支出";
  2545. OPEN_MENU(PayOutInput);
  2546. return;
  2547. }
  2548. else if (strMsg == "短信群发")
  2549. {
  2550. UINT nID = 3;
  2551. LPSTR pName;
  2552. pName = (LPSTR)(LPCSTR)"短信群发";
  2553. OPEN_MENU(SendMsg);
  2554. return;
  2555. }
  2556. else if (strMsg == "短信发送")
  2557. {
  2558. UINT nID = 3;
  2559. LPSTR pName;
  2560. pName = (LPSTR)(LPCSTR)"客户报表";
  2561. OPEN_MENU(CClientForm);
  2562. return;
  2563. }
  2564. else if (strMsg == "流程短信")
  2565. {
  2566. UINT nID = 3;
  2567. LPSTR pName;
  2568. pName = (LPSTR)(LPCSTR)"流程短信";
  2569. OPEN_MENU(WorkMsg);
  2570. return;
  2571. }
  2572. else if (strMsg == "员工短信")
  2573. {
  2574. UINT nID = 3;
  2575. LPSTR pName;
  2576. pName = (LPSTR)(LPCSTR)"员工短信";
  2577. OPEN_MENU(EmployeeMsg);
  2578. return;
  2579. }
  2580. else if (strMsg == "发送记录")
  2581. {
  2582. UINT nID = 3;
  2583. LPSTR pName;
  2584. pName = (LPSTR)(LPCSTR)"发送记录";
  2585. OPEN_MENU(MsgReg);
  2586. return;
  2587. }
  2588. else if (strMsg == "短信设置")
  2589. {
  2590. if (IsHasRightsnew(49) == 0)return;
  2591. MsgSet dlg;
  2592. dlg.DoModal();
  2593. return;
  2594. }
  2595. else if (strMsg == "金卡会员")
  2596. {
  2597. #ifndef ENTERPRISE_VERSION
  2598. #ifndef CHILD_VERSION
  2599. #ifdef BASIC_VERSION
  2600. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2601. {
  2602. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2603. exit(0);return;
  2604. }
  2605. #else
  2606. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2607. {
  2608. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2609. exit(0);return;
  2610. }
  2611. #endif
  2612. #else
  2613. #ifdef BASIC_VERSION
  2614. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2615. {
  2616. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2617. exit(0);return;
  2618. }
  2619. #else
  2620. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2621. {
  2622. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2623. exit(0);return;
  2624. }
  2625. #endif
  2626. #endif
  2627. #else
  2628. #ifndef CHILD_VERSION
  2629. #ifdef BASIC_VERSION
  2630. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2631. {
  2632. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2633. exit(0); return;
  2634. }
  2635. #else
  2636. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2637. {
  2638. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2639. exit(0); return;
  2640. }
  2641. #endif
  2642. #else
  2643. #ifdef BASIC_VERSION
  2644. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2645. {
  2646. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2647. exit(0);return;
  2648. }
  2649. #else
  2650. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2651. {
  2652. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2653. exit(0); return;
  2654. }
  2655. #endif
  2656. #endif
  2657. #endif
  2658. UINT nID = 3;
  2659. LPSTR pName;
  2660. pName = (LPSTR)(LPCSTR)"金卡会员";
  2661. OPEN_MENU(ShowMember);
  2662. return;
  2663. }
  2664. else if (strMsg == "现金子卡")
  2665. {
  2666. UINT nID = 3;
  2667. LPSTR pName;
  2668. pName = (LPSTR)(LPCSTR)"现金子卡";
  2669. OPEN_MENU(ShowMember2);
  2670. return;
  2671. }
  2672. else if (strMsg == "蓝钻会员")
  2673. {
  2674. #ifndef ENTERPRISE_VERSION
  2675. #ifndef CHILD_VERSION
  2676. #ifdef BASIC_VERSION
  2677. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2678. {
  2679. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2680. exit(0);return;
  2681. }
  2682. #else
  2683. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2684. {
  2685. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2686. exit(0);return;
  2687. }
  2688. #endif
  2689. #else
  2690. #ifdef BASIC_VERSION
  2691. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2692. {
  2693. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2694. exit(0);return;
  2695. }
  2696. #else
  2697. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2698. {
  2699. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2700. exit(0);return;
  2701. }
  2702. #endif
  2703. #endif
  2704. #else
  2705. #ifndef CHILD_VERSION
  2706. #ifdef BASIC_VERSION
  2707. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2708. {
  2709. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2710. exit(0); return;
  2711. }
  2712. #else
  2713. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2714. {
  2715. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2716. exit(0); return;
  2717. }
  2718. #endif
  2719. #else
  2720. #ifdef BASIC_VERSION
  2721. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2722. {
  2723. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2724. exit(0);return;
  2725. }
  2726. #else
  2727. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2728. {
  2729. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2730. exit(0); return;
  2731. }
  2732. #endif
  2733. #endif
  2734. #endif
  2735. UINT nID = 3;
  2736. LPSTR pName;
  2737. pName = (LPSTR)(LPCSTR)"蓝钻会员";
  2738. OPEN_MENU(ShowMemberBlue);
  2739. return;
  2740. }
  2741. else if (strMsg == "转介绍积分")
  2742. {
  2743. #ifndef ENTERPRISE_VERSION
  2744. #ifndef CHILD_VERSION
  2745. #ifdef BASIC_VERSION
  2746. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  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)!="1")
  2753. {
  2754. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2755. exit(0);return;
  2756. }
  2757. #endif
  2758. #else
  2759. #ifdef BASIC_VERSION
  2760. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2761. {
  2762. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2763. exit(0);return;
  2764. }
  2765. #else
  2766. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2767. {
  2768. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2769. exit(0);return;
  2770. }
  2771. #endif
  2772. #endif
  2773. #else
  2774. #ifndef CHILD_VERSION
  2775. #ifdef BASIC_VERSION
  2776. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2777. {
  2778. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2779. exit(0); return;
  2780. }
  2781. #else
  2782. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2783. {
  2784. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2785. exit(0); return;
  2786. }
  2787. #endif
  2788. #else
  2789. #ifdef BASIC_VERSION
  2790. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2791. {
  2792. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2793. exit(0);return;
  2794. }
  2795. #else
  2796. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2797. {
  2798. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2799. exit(0); return;
  2800. }
  2801. #endif
  2802. #endif
  2803. #endif
  2804. UINT nID = 3;
  2805. LPSTR pName;
  2806. pName = (LPSTR)(LPCSTR)"转介绍积分";
  2807. OPEN_MENU(Card2Reg);
  2808. return;
  2809. }
  2810. /* else if(strMsg=="转介绍图表")
  2811. {
  2812. #ifndef ENTERPRISE_VERSION
  2813. #ifndef CHILD_VERSION
  2814. #ifdef BASIC_VERSION
  2815. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  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)!="1")
  2822. {
  2823. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2824. exit(0);return;
  2825. }
  2826. #endif
  2827. #else
  2828. #ifdef BASIC_VERSION
  2829. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2830. {
  2831. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2832. exit(0);return;
  2833. }
  2834. #else
  2835. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2836. {
  2837. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2838. exit(0);return;
  2839. }
  2840. #endif
  2841. #endif
  2842. #else
  2843. #ifndef CHILD_VERSION
  2844. #ifdef BASIC_VERSION
  2845. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2846. {
  2847. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2848. exit(0);return;
  2849. }
  2850. #else
  2851. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2852. {
  2853. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2854. exit(0);return;
  2855. }
  2856. #endif
  2857. #else
  2858. #ifdef BASIC_VERSION
  2859. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2860. {
  2861. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2862. exit(0);return;
  2863. }
  2864. #else
  2865. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2866. {
  2867. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2868. exit(0);return;
  2869. }
  2870. #endif
  2871. #endif
  2872. #endif
  2873. UINT nID=3;
  2874. LPSTR pName ;
  2875. pName = (LPSTR)(LPCSTR)"转介绍图表";
  2876. OPEN_MENU(Card2RegChart);
  2877. return;
  2878. }*/
  2879. else if (strMsg == "金卡图表")
  2880. {
  2881. UINT nID = 3;
  2882. LPSTR pName;
  2883. pName = (LPSTR)(LPCSTR)"金卡图表";
  2884. OPEN_MENU(MemberChart);
  2885. return;
  2886. }
  2887. else if (strMsg == "积分短信")
  2888. {
  2889. UINT nID = 3;
  2890. LPSTR pName;
  2891. pName = (LPSTR)(LPCSTR)"积分短信";
  2892. OPEN_MENU(ShowMemberMsg);
  2893. return;
  2894. }
  2895. else if (strMsg == "转介绍返现")
  2896. {
  2897. #ifndef ENTERPRISE_VERSION
  2898. #ifndef CHILD_VERSION
  2899. #ifdef BASIC_VERSION
  2900. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2901. {
  2902. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2903. exit(0);return;
  2904. }
  2905. #else
  2906. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2907. {
  2908. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2909. exit(0);return;
  2910. }
  2911. #endif
  2912. #else
  2913. #ifdef BASIC_VERSION
  2914. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2915. {
  2916. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2917. exit(0);return;
  2918. }
  2919. #else
  2920. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2921. {
  2922. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2923. exit(0);return;
  2924. }
  2925. #endif
  2926. #endif
  2927. #else
  2928. #ifndef CHILD_VERSION
  2929. #ifdef BASIC_VERSION
  2930. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2931. {
  2932. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2933. exit(0); return;
  2934. }
  2935. #else
  2936. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2937. {
  2938. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2939. exit(0); return;
  2940. }
  2941. #endif
  2942. #else
  2943. #ifdef BASIC_VERSION
  2944. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2945. {
  2946. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2947. exit(0);return;
  2948. }
  2949. #else
  2950. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2951. {
  2952. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2953. exit(0); return;
  2954. }
  2955. #endif
  2956. #endif
  2957. #endif
  2958. UINT nID = 3;
  2959. LPSTR pName;
  2960. pName = (LPSTR)(LPCSTR)"转介绍返现";
  2961. OPEN_MENU(Card2RegBlue);
  2962. return;
  2963. }
  2964. else if (strMsg == "转介绍图表")
  2965. {
  2966. #ifndef ENTERPRISE_VERSION
  2967. #ifndef CHILD_VERSION
  2968. #ifdef BASIC_VERSION
  2969. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  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)!="1")
  2976. {
  2977. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2978. exit(0);return;
  2979. }
  2980. #endif
  2981. #else
  2982. #ifdef BASIC_VERSION
  2983. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2984. {
  2985. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2986. exit(0);return;
  2987. }
  2988. #else
  2989. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2990. {
  2991. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2992. exit(0);return;
  2993. }
  2994. #endif
  2995. #endif
  2996. #else
  2997. #ifndef CHILD_VERSION
  2998. #ifdef BASIC_VERSION
  2999. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3000. {
  3001. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3002. exit(0); return;
  3003. }
  3004. #else
  3005. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3006. {
  3007. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3008. exit(0); return;
  3009. }
  3010. #endif
  3011. #else
  3012. #ifdef BASIC_VERSION
  3013. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3014. {
  3015. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3016. exit(0);return;
  3017. }
  3018. #else
  3019. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3020. {
  3021. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3022. exit(0); return;
  3023. }
  3024. #endif
  3025. #endif
  3026. #endif
  3027. UINT nID = 3;
  3028. LPSTR pName;
  3029. pName = (LPSTR)(LPCSTR)"转介绍图表";
  3030. OPEN_MENU(Card2RegChartBlue);
  3031. return;
  3032. }
  3033. else if (strMsg == "积分设置")
  3034. {
  3035. if (IsHasRightsnew(49) == 0)return;
  3036. MemberSet dlg;
  3037. dlg.DoModal();
  3038. return;
  3039. }
  3040. else if (strMsg == "礼服录入")
  3041. {
  3042. if (IsHasRightsnew(39) == 0)return;
  3043. UINT nID = 3;
  3044. LPSTR pName;
  3045. pName = (LPSTR)(LPCSTR)"礼服录入";
  3046. OPEN_MENU(DressManage);
  3047. return;
  3048. }
  3049. else if (strMsg == "礼服查看")
  3050. {
  3051. #ifndef ENTERPRISE_VERSION
  3052. #ifndef CHILD_VERSION
  3053. #ifdef BASIC_VERSION
  3054. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3055. {
  3056. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3057. exit(0);return;
  3058. }
  3059. #else
  3060. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3061. {
  3062. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3063. exit(0);return;
  3064. }
  3065. #endif
  3066. #else
  3067. #ifdef BASIC_VERSION
  3068. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3069. {
  3070. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3071. exit(0);return;
  3072. }
  3073. #else
  3074. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3075. {
  3076. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3077. exit(0);return;
  3078. }
  3079. #endif
  3080. #endif
  3081. #else
  3082. #ifndef CHILD_VERSION
  3083. #ifdef BASIC_VERSION
  3084. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3085. {
  3086. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3087. exit(0); return;
  3088. }
  3089. #else
  3090. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3091. {
  3092. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3093. exit(0); return;
  3094. }
  3095. #endif
  3096. #else
  3097. #ifdef BASIC_VERSION
  3098. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3099. {
  3100. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3101. exit(0);return;
  3102. }
  3103. #else
  3104. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3105. {
  3106. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3107. exit(0); return;
  3108. }
  3109. #endif
  3110. #endif
  3111. #endif
  3112. if (IsHasRightsnew(40) == 0)return;
  3113. UINT nID = 3;
  3114. LPSTR pName;
  3115. pName = (LPSTR)(LPCSTR)"礼服查看";
  3116. OPEN_MENU(ShowDress);
  3117. return;
  3118. }
  3119. else if (strMsg == "撞期预警")
  3120. {
  3121. UINT nID = 3;
  3122. LPSTR pName;
  3123. pName = (LPSTR)(LPCSTR)"撞期预警";
  3124. OPEN_MENU(DressEarlyWarning);
  3125. return;
  3126. }
  3127. else if (strMsg == "礼服出租")
  3128. {
  3129. UINT nID = 3;
  3130. LPSTR pName;
  3131. pName = (LPSTR)(LPCSTR)"礼服出租";
  3132. OPEN_MENU(ShowHireReg);
  3133. return;
  3134. }
  3135. else if (strMsg == "礼服图片")
  3136. {
  3137. ShowPic dlg;
  3138. dlg.m_mode = 4;
  3139. dlg.m_path = g_path5 + "\\";
  3140. dlg.DoModal();
  3141. return;
  3142. }
  3143. else if (strMsg == "商品类别设置")
  3144. {
  3145. if (IsHasRightsnew(29) == 0)return;
  3146. SPLBDlg dlg;
  3147. dlg.DoModal();
  3148. return;
  3149. }
  3150. else if (strMsg == "商品名称设置")
  3151. {
  3152. if (IsHasRightsnew(29) == 0)return;
  3153. UINT nID = 3;
  3154. LPSTR pName;
  3155. pName = (LPSTR)(LPCSTR)"商品设置";
  3156. OPEN_MENU(ShangPin);
  3157. return;
  3158. }
  3159. else if (strMsg == "固定资产管理")
  3160. {
  3161. UINT nID = 3;
  3162. LPSTR pName;
  3163. pName = (LPSTR)(LPCSTR)"固定资产管理";
  3164. OPEN_MENU(FixedAssets);
  3165. return;
  3166. }
  3167. else if (strMsg == "入库单")
  3168. {
  3169. if (IsHasRightsnew(44) == 0)return;
  3170. InputGoods dlg;
  3171. dlg.DoModal();
  3172. return;
  3173. }
  3174. else if (strMsg == "出库单")
  3175. {
  3176. #ifndef ENTERPRISE_VERSION
  3177. #ifndef CHILD_VERSION
  3178. #ifdef BASIC_VERSION
  3179. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3180. {
  3181. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3182. exit(0);return;
  3183. }
  3184. #else
  3185. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3186. {
  3187. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3188. exit(0);return;
  3189. }
  3190. #endif
  3191. #else
  3192. #ifdef BASIC_VERSION
  3193. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3194. {
  3195. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3196. exit(0);return;
  3197. }
  3198. #else
  3199. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3200. {
  3201. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3202. exit(0);return;
  3203. }
  3204. #endif
  3205. #endif
  3206. #else
  3207. #ifndef CHILD_VERSION
  3208. #ifdef BASIC_VERSION
  3209. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3210. {
  3211. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3212. exit(0); return;
  3213. }
  3214. #else
  3215. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3216. {
  3217. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3218. exit(0); return;
  3219. }
  3220. #endif
  3221. #else
  3222. #ifdef BASIC_VERSION
  3223. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3224. {
  3225. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3226. exit(0);return;
  3227. }
  3228. #else
  3229. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3230. {
  3231. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3232. exit(0); return;
  3233. }
  3234. #endif
  3235. #endif
  3236. #endif
  3237. if (IsHasRightsnew(45) == 0)return;
  3238. InputGoods dlg;
  3239. dlg.m_mode = 1;
  3240. dlg.DoModal();
  3241. return;
  3242. }
  3243. else if (strMsg == "库存查询")
  3244. {
  3245. #ifndef ENTERPRISE_VERSION
  3246. #ifndef CHILD_VERSION
  3247. #ifdef BASIC_VERSION
  3248. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  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)!="1")
  3255. {
  3256. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3257. exit(0);return;
  3258. }
  3259. #endif
  3260. #else
  3261. #ifdef BASIC_VERSION
  3262. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3263. {
  3264. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3265. exit(0);return;
  3266. }
  3267. #else
  3268. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3269. {
  3270. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3271. exit(0);return;
  3272. }
  3273. #endif
  3274. #endif
  3275. #else
  3276. #ifndef CHILD_VERSION
  3277. #ifdef BASIC_VERSION
  3278. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3279. {
  3280. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3281. exit(0); return;
  3282. }
  3283. #else
  3284. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3285. {
  3286. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3287. exit(0); return;
  3288. }
  3289. #endif
  3290. #else
  3291. #ifdef BASIC_VERSION
  3292. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3293. {
  3294. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3295. exit(0);return;
  3296. }
  3297. #else
  3298. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3299. {
  3300. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3301. exit(0); return;
  3302. }
  3303. #endif
  3304. #endif
  3305. #endif
  3306. UINT nID = 3;
  3307. LPSTR pName;
  3308. pName = (LPSTR)(LPCSTR)"库存查询";
  3309. OPEN_MENU(ShowGoods);
  3310. return;
  3311. }
  3312. else if (strMsg == "商品图表")
  3313. {
  3314. UINT nID = 3;
  3315. LPSTR pName;
  3316. pName = (LPSTR)(LPCSTR)"商品图表";
  3317. OPEN_MENU(StoreInfoChart);
  3318. return;
  3319. }
  3320. else if (strMsg == "成本核算")
  3321. {
  3322. UINT nID = 3;
  3323. LPSTR pName;
  3324. pName = (LPSTR)(LPCSTR)"成本核算";
  3325. OPEN_MENU(CostCal);
  3326. return;
  3327. }
  3328. else if (strMsg == "考勤记录")
  3329. {
  3330. UINT nID = 3;
  3331. LPSTR pName;
  3332. pName = (LPSTR)(LPCSTR)"考勤记录";
  3333. OPEN_MENU(LoginReg);
  3334. return;
  3335. }
  3336. else if (strMsg == "月统计")
  3337. {
  3338. UINT nID = 3;
  3339. LPSTR pName;
  3340. pName = (LPSTR)(LPCSTR)"月统计";
  3341. OPEN_MENU(LoginReg2);
  3342. return;
  3343. }
  3344. else if (strMsg == "时间设置")
  3345. {
  3346. if (IsHasRightsnew(21) == 0)return;
  3347. SetLoginTime dlg;
  3348. dlg.DoModal();
  3349. return;
  3350. }
  3351. else if (strMsg == "排班设置")
  3352. {
  3353. if (IsHasRightsnew(21) == 0)return;
  3354. SetLoginBan dlg;
  3355. dlg.DoModal();
  3356. return;
  3357. }
  3358. else if (strMsg == "意向查询")
  3359. {
  3360. UINT nID = 3;
  3361. LPSTR pName;
  3362. pName = (LPSTR)(LPCSTR)"意向查询";
  3363. OPEN_MENU(HospitalClient);
  3364. return;
  3365. }
  3366. else if (strMsg == "今日提醒")
  3367. {
  3368. UINT nID = 3;
  3369. LPSTR pName;
  3370. pName = (LPSTR)(LPCSTR)"今日提醒";
  3371. OPEN_MENU(HospitalClientAlarm);
  3372. return;
  3373. }
  3374. else if (strMsg == "跟踪短信")
  3375. {
  3376. UINT nID = 3;
  3377. LPSTR pName;
  3378. pName = (LPSTR)(LPCSTR)"跟踪短信";
  3379. OPEN_MENU(HospitalClientMsg);
  3380. return;
  3381. }
  3382. else if (strMsg == "意向单录入")
  3383. {
  3384. AddHospitalClient dlg;
  3385. dlg.DoModal();
  3386. return;
  3387. }
  3388. else if (strMsg == "资料设置")
  3389. {
  3390. HospitalInfoSet dlg;
  3391. dlg.DoModal();
  3392. return;
  3393. }
  3394. AfxMessageBox(strMsg + ",开发中...");
  3395. }
  3396. // Jeff.当版本号不一致时,调用AutoUpdate.exe来升级YLGL.exe
  3397. void CMainFrame::AutoUpdate()
  3398. {
  3399. if (g_bBranchModify)
  3400. {
  3401. AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
  3402. return;
  3403. }
  3404. else if (g_branchname != "")
  3405. {
  3406. AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
  3407. return;
  3408. }
  3409. #if 0
  3410. g_ntimeout = 30000;
  3411. #endif
  3412. if (!::PathFileExists(g_mainpath + "\\AutoUpdate.exe"))
  3413. {
  3414. g_sendhead.bsql = 0;
  3415. g_sendhead.code[0] = 99;
  3416. g_sendhead.tabcount = 1;
  3417. g_pMainWnd->ProcessChatMessageRequest2(99);
  3418. if (g_bSendOK == 0)
  3419. goto failed;
  3420. CFile fp;
  3421. fp.Open(g_mainpath + "\\AutoUpdate.exe", CFile::modeWrite | CFile::modeCreate);
  3422. fp.Write(g_pData, g_nLeng);
  3423. fp.Close();
  3424. }
  3425. {
  3426. ::DeleteFile(g_mainpath + "\\YLGL2.exe");
  3427. g_sendhead.bsql = 0;
  3428. g_sendhead.code[0] = 98;
  3429. g_sendhead.tabcount = 1;
  3430. g_pMainWnd->ProcessChatMessageRequest2(99); if (g_bSendOK == 0)goto failed;
  3431. CFile fp;
  3432. fp.Open(g_mainpath + "\\YLGL2.exe", CFile::modeWrite | CFile::modeCreate);
  3433. fp.Write(g_pData, g_nLeng);
  3434. fp.Close();
  3435. }
  3436. AfxMessageBox("自动升级成功!", MB_ICONINFORMATION);
  3437. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\AutoUpdate.exe"), "12345", NULL, SW_SHOWNORMAL);
  3438. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3439. exit(0);
  3440. return;
  3441. failed:
  3442. AfxMessageBox("自动升级失败!", MB_ICONINFORMATION);
  3443. if (g_ntimeout == 30000)//非远程
  3444. {
  3445. AfxMessageBox("提醒:升级过程中需要传输较多的数据,如果网速慢可能导致远程升级失败!\r\n\
  3446. 可拷贝店内客户端用QQ传过来覆盖除dbconfig.dat的文件即可。", MB_ICONINFORMATION);
  3447. }
  3448. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3449. }
  3450. void CMainFrame::Onchoosephotoskin() //Jeff:此机用于选片菜单项;不在使用2014.06.16
  3451. {
  3452. if (g_user.bLongin == 0)
  3453. {
  3454. if (g_bNoLoginLia)
  3455. {
  3456. Login dlg;
  3457. dlg.SetLiaPath("5.lia");
  3458. dlg.DoModal();
  3459. }
  3460. else
  3461. {
  3462. Login3 dlg;
  3463. dlg.SetLiaPath("5.lia");
  3464. dlg.DoModal();
  3465. }
  3466. if (g_user.bLongin == 0)return;
  3467. }
  3468. // TODO: Add your command handler code here
  3469. CString version = _T("Version 1.0");
  3470. CMenu *pMenu = GetMenu();
  3471. CMenu* submenu = pMenu->GetSubMenu(1);
  3472. UINT status = submenu->GetMenuState(IDM_choosephotoskin, MF_BYCOMMAND);
  3473. if (status&MF_CHECKED)
  3474. {
  3475. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_UNCHECKED);
  3476. AfxGetApp()->WriteProfileInt(version, "status", 0);
  3477. }
  3478. else
  3479. {
  3480. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  3481. AfxGetApp()->WriteProfileInt(version, "status", 1);
  3482. }
  3483. }
  3484. /*BOOL g_bInSkin = 0;*/
  3485. BOOL CMainFrame::IsCtrlDown()
  3486. {
  3487. short state = GetKeyState(VK_LCONTROL);
  3488. BYTE sta = (BYTE)(state >> 8);
  3489. state = GetKeyState(VK_RCONTROL);
  3490. BYTE sta2 = (BYTE)(state >> 8);
  3491. if (sta || sta2)
  3492. return 1;
  3493. else
  3494. return 0;
  3495. }//IsShiftDown
  3496. BOOL CMainFrame::IsShiftDown()
  3497. {
  3498. short state = GetKeyState(VK_LSHIFT);
  3499. BYTE sta = (BYTE)(state >> 8);
  3500. state = GetKeyState(VK_RSHIFT);
  3501. BYTE sta2 = (BYTE)(state >> 8);
  3502. if (sta || sta2)
  3503. return 1;
  3504. else
  3505. return 0;
  3506. }
  3507. BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
  3508. {
  3509. // TODO: Add your specialized code here and/or call the base class IDM_Logout
  3510. if (pMsg->message == WM_KEYDOWN)
  3511. {
  3512. switch (pMsg->wParam)
  3513. {
  3514. case VK_F12:
  3515. g_pMainWnd->OnCommandMenu(IDM_Logout);
  3516. return 1;
  3517. case VK_F1:
  3518. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  3519. return 1;
  3520. case VK_F2:
  3521. {
  3522. if (g_pMainWnd->m_bCheckF2F3 && (IsShiftDown() == 0 || IsCtrlDown() == 0))return 1;
  3523. m_Mdi.MainClose();
  3524. if (g_user.bLongin)
  3525. {
  3526. SearchClient dlg;
  3527. dlg.SetLiaPath("2.lia");
  3528. if (dlg.DoModal() != IDOK)
  3529. {
  3530. if (dlg.m_bLogout)
  3531. {
  3532. g_user.bLongin = 0;
  3533. g_user.name.Empty();
  3534. g_user.rights.Empty();
  3535. g_user.account.Empty();
  3536. goto ll;
  3537. }
  3538. PostMessage(WM_QUIT);
  3539. return 1;
  3540. }
  3541. if (dlg.m_exitcode == 3)
  3542. {
  3543. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3544. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3545. }
  3546. else
  3547. {
  3548. ShowWindow(SW_SHOW);
  3549. #ifdef NEW_SKIN
  3550. if (m_pMainFrimDlg2 == NULL)
  3551. {
  3552. m_pMainFrimDlg2 = new MainFrimDlg2;
  3553. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3554. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3555. }
  3556. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3557. g_bInSkin = 0;
  3558. #endif
  3559. }
  3560. }
  3561. else
  3562. {
  3563. ll:
  3564. ChoosePhotoSkin dlg;
  3565. dlg.SetLiaPath("1.lia");
  3566. if (dlg.DoModal() != IDOK)
  3567. {
  3568. PostMessage(WM_QUIT);
  3569. return 1;
  3570. }
  3571. if (dlg.m_exitcode == 3)
  3572. {
  3573. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3574. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3575. }
  3576. else
  3577. {
  3578. ShowWindow(SW_SHOW);
  3579. #ifdef NEW_SKIN
  3580. if (m_pMainFrimDlg2 == NULL)
  3581. {
  3582. m_pMainFrimDlg2 = new MainFrimDlg2;
  3583. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3584. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3585. }
  3586. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin = 0;
  3587. #endif
  3588. }
  3589. }
  3590. }
  3591. return 1;
  3592. case VK_F3:
  3593. {
  3594. if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
  3595. m_Mdi.MainClose();
  3596. if (g_user.bLongin)
  3597. {
  3598. SearchClient dlg;
  3599. dlg.m_mode = 1;
  3600. dlg.SetLiaPath("2.lia");
  3601. if (dlg.DoModal() != IDOK)
  3602. {
  3603. if (dlg.m_bLogout)
  3604. {
  3605. g_user.bLongin = 0;
  3606. g_user.name.Empty();
  3607. g_user.rights.Empty();
  3608. g_user.account.Empty();
  3609. goto mm;
  3610. }
  3611. PostMessage(WM_QUIT);
  3612. return 1;
  3613. }
  3614. if (dlg.m_exitcode == 2)
  3615. {
  3616. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3617. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3618. }
  3619. else
  3620. {
  3621. ShowWindow(SW_SHOW);
  3622. #ifdef NEW_SKIN
  3623. if (m_pMainFrimDlg2 == NULL)
  3624. {
  3625. m_pMainFrimDlg2 = new MainFrimDlg2;
  3626. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3627. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3628. }
  3629. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin = 0;
  3630. #endif
  3631. }
  3632. }
  3633. else
  3634. {
  3635. mm:
  3636. ChoosePhotoSkin dlg;
  3637. dlg.m_mode = 1;
  3638. dlg.SetLiaPath("1.lia");
  3639. if (dlg.DoModal() != IDOK)
  3640. {
  3641. PostMessage(WM_QUIT);
  3642. return 1;
  3643. }
  3644. if (dlg.m_exitcode == 2)
  3645. {
  3646. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3647. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3648. }
  3649. else
  3650. {
  3651. ShowWindow(SW_SHOW);
  3652. #ifdef NEW_SKIN
  3653. if (m_pMainFrimDlg2 == NULL)
  3654. {
  3655. m_pMainFrimDlg2 = new MainFrimDlg2;
  3656. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3657. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3658. }
  3659. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin = 0;
  3660. #endif
  3661. }
  3662. }
  3663. }
  3664. return 1;
  3665. case VK_F11:
  3666. /* if (g_bInSkin)return 1;
  3667. if (g_user.bLongin)
  3668. {
  3669. SqlDlg dlg;
  3670. dlg.DoModal();
  3671. } */
  3672. break;
  3673. #ifdef LYFZ_VERSION
  3674. case VK_F4:
  3675. if (g_user.bLongin)
  3676. {
  3677. g_sendhead.bsql=0;
  3678. g_sendhead.code[0]=199;
  3679. g_sendhead.tabcount=1;
  3680. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return 0;
  3681. DataToArray(&g_List1array);
  3682. CStdioFile fp;
  3683. CString path=g_mainpath+"\\NullBalance.txt";
  3684. ::DeleteFile (path);
  3685. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  3686. CString str;
  3687. for(int i=0; i<g_List1array.GetSize (); i++)
  3688. {
  3689. for(int j=0; j<g_List1array.ElementAt (0).GetSize (); j++)
  3690. {
  3691. str=g_List1array.ElementAt (0).ElementAt (j)+"\n";
  3692. str.TrimLeft ();
  3693. fp.WriteString (str);
  3694. }
  3695. }
  3696. fp.Close ();
  3697. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  3698. }
  3699. break;
  3700. #endif
  3701. }
  3702. }
  3703. return CMDIFrameWnd::PreTranslateMessage(pMsg);
  3704. }
  3705. void CMainFrame::GetSkin()
  3706. {
  3707. return;
  3708. #ifdef MNLS_VERSION
  3709. if (::PathFileExists(g_mainpath + "\\skin\\4.lia"))
  3710. {
  3711. CFile fp;
  3712. fp.Open(g_mainpath + "\\skin\\4.lia", CFile::modeRead);
  3713. DWORD leng=fp.GetLength ();
  3714. fp.Close ();
  3715. if(leng!=194987)
  3716. ::DeleteFile (g_mainpath+"\\skin\\4.lia");
  3717. }
  3718. if(!::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3719. {
  3720. ::CreateDirectory (g_mainpath+"\\skin", NULL);
  3721. g_sendhead.bsql=0;
  3722. g_sendhead.code[0]=100;
  3723. g_sendhead.tabcount=1;
  3724. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  3725. CFile fp;
  3726. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeWrite|CFile::modeCreate);
  3727. fp.Write (g_pData, g_nLeng);
  3728. fp.Close ();
  3729. }
  3730. #endif
  3731. }
  3732. void AutoDraw(CPrintRX &m_Print, CRect &StrRect, CString &str, float fscale)
  3733. {
  3734. CString tempbz, temp;
  3735. BOOL bRun = 0;
  3736. CSize size;
  3737. int fontsize = 12;
  3738. int i = 0;
  3739. ll: tempbz = str;
  3740. i = 0;
  3741. m_Print.SetFontFace(fontsize, 1, "宋体");
  3742. while (1)
  3743. {
  3744. if (!tempbz.IsEmpty())
  3745. {
  3746. temp = tempbz;
  3747. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3748. int right = 0;
  3749. CRect temprc = StrRect;
  3750. temprc.top += i*(fontsize*fscale); i++;
  3751. temprc.bottom = temprc.top + fontsize;
  3752. if (temprc.bottom > StrRect.bottom)break;
  3753. while (size.cx > temprc.Width())
  3754. {
  3755. right++;
  3756. temp = tempbz.Left(tempbz.GetLength() - (right));
  3757. if (GIsHalfHZ(temp))
  3758. {
  3759. right++;
  3760. temp.Delete(temp.GetLength() - 1);
  3761. }
  3762. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3763. }
  3764. if (temp.Find("\r\n") != -1)
  3765. {
  3766. temp = temp.Left(temp.Find("\r\n"));//i++;
  3767. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength() - 2);
  3768. }
  3769. else
  3770. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
  3771. if (bRun)
  3772. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, temprc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3773. }
  3774. else
  3775. break;
  3776. }
  3777. if (tempbz.IsEmpty() == 0)
  3778. {
  3779. fontsize--;
  3780. goto ll;
  3781. }
  3782. if (bRun == 0)
  3783. {
  3784. bRun = 1;
  3785. goto ll;
  3786. }
  3787. }
  3788. void CMainFrame::PrintDinDan3(CString strOrderNumber)
  3789. {
  3790. // TODO: Add your control notification handler code here
  3791. CPrintRX m_Print;
  3792. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  3793. {
  3794. m_Print.InitToPrint(NULL, 1);
  3795. }
  3796. else
  3797. {
  3798. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  3799. if (name.IsEmpty())
  3800. m_Print.InitToPrint(NULL, 1);
  3801. else
  3802. {
  3803. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  3804. if (nret == -1)
  3805. {
  3806. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  3807. }
  3808. }
  3809. }
  3810. m_Print.StartPrint();
  3811. m_Print.StartPage();
  3812. LoadRect load;
  3813. load.SetLiaPath("11.lia");
  3814. load.SetMargins(0, 0);
  3815. if (!load.Load())return;
  3816. LoadRect load2;
  3817. load2.SetLiaPath("12.lia");
  3818. load2.SetMargins(0, 0);
  3819. if (!load2.Load())return;
  3820. LoadRect load3;
  3821. load3.SetLiaPath("13.lia");
  3822. load3.SetMargins(-6, 520);
  3823. if (!load3.Load())return;
  3824. int i;
  3825. //////////////////////////////////////////////////////////////
  3826. CStringArray txarray;
  3827. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "'";
  3828. g_sendhead.code[0] = 11;
  3829. g_sendhead.code[1] = 52;
  3830. g_sendhead.code[2] = 50;
  3831. g_sendhead.code[3] = 150;
  3832. g_sendhead.tabcount = 4;
  3833. g_sendhead.bsql = 0;
  3834. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  3835. CArray<CStringArray, CStringArray>sparray;
  3836. CArray<CStringArray, CStringArray>clientarray;
  3837. CArray<CStringArray, CStringArray>jdarray;
  3838. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray);
  3839. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  3840. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  3841. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  3842. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  3843. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  3844. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
  3845. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  3846. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  3847. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  3848. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  3849. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  3850. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  3851. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  3852. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  3853. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  3854. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  3855. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  3856. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  3857. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  3858. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  3859. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  3860. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  3861. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  3862. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  3863. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  3864. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  3865. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  3866. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  3867. CString m_bz = "其它要求: " + g_List1array.ElementAt(0).ElementAt(38);
  3868. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  3869. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  3870. if (IsHasRights2new(31) == 0)
  3871. {
  3872. m_phone1 = "***";
  3873. m_phone2 = "***";
  3874. }
  3875. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  3876. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  3877. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  3878. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  3879. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  3880. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  3881. CString m_addr = m_addr1 + ";";
  3882. m_addr.TrimLeft(";");
  3883. m_addr += m_addr2;
  3884. CString m_qq = m_qq1 + ";";
  3885. m_qq.TrimLeft(";");
  3886. m_qq += m_qq2;
  3887. CString m_jd;
  3888. for (i = 0; i < jdarray.GetSize(); i++)
  3889. {
  3890. m_jd += jdarray.ElementAt(i).ElementAt(1);
  3891. m_jd += ";";
  3892. }
  3893. m_jd.TrimRight(";");
  3894. m_money1.Format("%f", atof(m_taoxijiage));
  3895. m_money2.Format("%f", atof(m_payed1));
  3896. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  3897. ConvertToPrice(m_money1);
  3898. ConvertToPrice(m_money2);
  3899. ConvertToPrice(m_money3);
  3900. ////////////////////////////////////////////////////////////////
  3901. int rcpos = -1;
  3902. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  3903. m_Print.SetFontFace(17, 1, "宋体");
  3904. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3905. StrRect.top -= 0;
  3906. StrRect.bottom -= 10;
  3907. StrRect.left -= 140;
  3908. StrRect.right = StrRect.left + 48;
  3909. m_Print.SetFontFace(15, 1, "宋体");
  3910. m_Print.SetColor(0xffffff);
  3911. m_Print.DrawRect(StrRect, 0);
  3912. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3913. StrRect.left = StrRect.right;
  3914. StrRect.right = StrRect.left + 48;
  3915. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  3916. m_Print.SetColor(0, RGB(255, 0, 0));
  3917. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3918. m_Print.SetColor(0);
  3919. m_Print.SetFontFace(12, 1, "宋体");
  3920. StrRect.left -= 48;
  3921. int hei = StrRect.Height();
  3922. StrRect.top = StrRect.bottom + 2;
  3923. StrRect.bottom += hei + 2;
  3924. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3925. StrRect.top = StrRect.bottom - 2;
  3926. StrRect.bottom += hei - 5;
  3927. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  3928. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3929. m_Print.SetFontFace(12, 1, "宋体");
  3930. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3931. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3932. m_Print.SetFontFace(11, 1, "宋体");
  3933. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3934. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3935. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3936. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3937. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3938. m_Print.DrawRect2(StrRect, 2);
  3939. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3940. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3941. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3942. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3943. m_Print.DrawRect2(StrRect, 2);
  3944. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3945. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3946. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3947. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3948. m_Print.DrawRect2(StrRect, 2);
  3949. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3950. m_Print.DrawText((LPTSTR)(LPCTSTR)"约单时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3951. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3952. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3953. m_Print.DrawRect2(StrRect, 2);
  3954. ////////////
  3955. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3956. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3957. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3958. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3959. m_Print.DrawRect2(StrRect, 2);
  3960. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3961. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3962. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3963. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3964. m_Print.DrawRect2(StrRect, 2);
  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_birthday2, 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_time3, 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_addr, 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)"QQ/邮箱:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3982. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3983. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3984. m_Print.DrawRect2(StrRect, 2);
  3985. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3986. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系金额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3987. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3988. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3989. m_Print.DrawRect2(StrRect, 2);
  3990. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3991. m_Print.DrawText((LPTSTR)(LPCTSTR)"定金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3992. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3993. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3994. m_Print.DrawRect2(StrRect, 2);
  3995. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3996. m_Print.DrawText((LPTSTR)(LPCTSTR)"余额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3997. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3998. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3999. m_Print.DrawRect2(StrRect, 2);
  4000. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4001. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4002. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4003. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4004. m_Print.DrawRect2(StrRect, 2);
  4005. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4006. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍摄景点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4007. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4008. m_Print.DrawText((LPTSTR)(LPCTSTR)m_jd, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4009. m_Print.DrawRect2(StrRect, 2);
  4010. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4011. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容提供: 男士服装:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4012. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4013. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4014. m_Print.DrawRect2(StrRect, 2);
  4015. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4016. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4017. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4018. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4019. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4020. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4021. m_Print.DrawRect2(StrRect, 2);
  4022. StrRect = load.m_rcarray.ElementAt(++rcpos);
  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)"套系内提供拍摄区服装/头饰造型", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4026. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4027. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4028. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4029. m_Print.DrawText((LPTSTR)(LPCTSTR)" ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4030. m_Print.DrawRect2(StrRect, 2);
  4031. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4032. m_Print.DrawText((LPTSTR)(LPCTSTR)"专业数码拍摄:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4033. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4034. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4035. m_Print.DrawRect2(StrRect, 2);
  4036. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4037. m_Print.DrawText((LPTSTR)(LPCTSTR)"张", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4038. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4039. m_Print.DrawText((LPTSTR)(LPCTSTR)"(JPG格式数据)", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4040. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4041. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内赠送:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4042. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4043. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_List1array.ElementAt(0).ElementAt(9)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4044. m_Print.DrawRect2(StrRect, 2);
  4045. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4046. m_Print.DrawText((LPTSTR)(LPCTSTR)"张设计排版精修入册", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4047. //////////////////////load2
  4048. rcpos = -1;
  4049. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4050. m_Print.DrawText((LPTSTR)(LPCTSTR)"原始数据套系内张数JPG格式光盘壹只", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4051. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4052. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4053. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4054. // m_Print.DrawText((LPTSTR)(LPCTSTR)"", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4055. // AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4056. m_Print.DrawRect2(StrRect, 2);
  4057. m_Print.SetFontFace(11, 1, "宋体");
  4058. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4059. m_Print.DrawText((LPTSTR)(LPCTSTR)"客人产品:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4060. int rowcount = sparray.GetSize() / 8;
  4061. int needaddrow = 0;
  4062. while (sparray.GetSize() > rowcount * 8 + needaddrow)
  4063. needaddrow++;
  4064. int pos = 0;
  4065. CString str = "";
  4066. int addcount = 0;
  4067. if (needaddrow > 0)
  4068. addcount = 1;
  4069. else
  4070. addcount = 0;
  4071. needaddrow--;
  4072. str.Empty();
  4073. for (i = 0; i < rowcount + addcount; i++)
  4074. {
  4075. str += sparray.ElementAt(pos).ElementAt(5);
  4076. str += " 数量:";
  4077. str += sparray.ElementAt(pos).ElementAt(3);
  4078. str += ";";
  4079. pos++;
  4080. }
  4081. StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
  4082. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4083. m_Print.DrawRect2(StrRect, 2);
  4084. StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
  4085. if (needaddrow > 0)
  4086. addcount = 1;
  4087. else
  4088. addcount = 0;
  4089. needaddrow--;
  4090. str.Empty();
  4091. for (i = 0; i < rowcount + addcount; i++)
  4092. {
  4093. str += sparray.ElementAt(pos).ElementAt(5);
  4094. str += " 数量:";
  4095. str += sparray.ElementAt(pos).ElementAt(3);
  4096. str += ";";
  4097. pos++;
  4098. }
  4099. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4100. m_Print.DrawRect2(StrRect, 2);
  4101. StrRect = load2.m_rcarray.ElementAt(++rcpos);//7
  4102. if (needaddrow > 0)
  4103. addcount = 1;
  4104. else
  4105. addcount = 0;
  4106. needaddrow--;
  4107. str.Empty();
  4108. for (i = 0; i < rowcount + addcount; i++)
  4109. {
  4110. str += sparray.ElementAt(pos).ElementAt(5);
  4111. str += " 数量:";
  4112. str += sparray.ElementAt(pos).ElementAt(3);
  4113. str += ";";
  4114. pos++;
  4115. }
  4116. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4117. m_Print.DrawRect2(StrRect, 2);
  4118. StrRect = load2.m_rcarray.ElementAt(++rcpos);//8
  4119. if (needaddrow > 0)
  4120. addcount = 1;
  4121. else
  4122. addcount = 0;
  4123. needaddrow--;
  4124. str.Empty();
  4125. for (i = 0; i < rowcount + addcount; i++)
  4126. {
  4127. str += sparray.ElementAt(pos).ElementAt(5);
  4128. str += " 数量:";
  4129. str += sparray.ElementAt(pos).ElementAt(3);
  4130. str += ";";
  4131. pos++;
  4132. }
  4133. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4134. m_Print.DrawRect2(StrRect, 2);
  4135. StrRect = load2.m_rcarray.ElementAt(++rcpos);//9
  4136. if (needaddrow > 0)
  4137. addcount = 1;
  4138. else
  4139. addcount = 0;
  4140. needaddrow--;
  4141. str.Empty();
  4142. for (i = 0; i < rowcount + addcount; i++)
  4143. {
  4144. str += sparray.ElementAt(pos).ElementAt(5);
  4145. str += " 数量:";
  4146. str += sparray.ElementAt(pos).ElementAt(3);
  4147. str += ";";
  4148. pos++;
  4149. }
  4150. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4151. m_Print.DrawRect2(StrRect, 2);
  4152. StrRect = load2.m_rcarray.ElementAt(++rcpos);//10
  4153. if (needaddrow > 0)
  4154. addcount = 1;
  4155. else
  4156. addcount = 0;
  4157. needaddrow--;
  4158. str.Empty();
  4159. for (i = 0; i < rowcount + addcount; i++)
  4160. {
  4161. str += sparray.ElementAt(pos).ElementAt(5);
  4162. str += " 数量:";
  4163. str += sparray.ElementAt(pos).ElementAt(3);
  4164. str += ";";
  4165. pos++;
  4166. }
  4167. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4168. m_Print.DrawRect2(StrRect, 2);
  4169. StrRect = load2.m_rcarray.ElementAt(++rcpos);//11
  4170. if (needaddrow > 0)
  4171. addcount = 1;
  4172. else
  4173. addcount = 0;
  4174. needaddrow--;
  4175. str.Empty();
  4176. for (i = 0; i < rowcount + addcount; i++)
  4177. {
  4178. str += sparray.ElementAt(pos).ElementAt(5);
  4179. str += " 数量:";
  4180. str += sparray.ElementAt(pos).ElementAt(3);
  4181. str += ";";
  4182. pos++;
  4183. }
  4184. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4185. m_Print.DrawRect2(StrRect, 2);
  4186. StrRect = load2.m_rcarray.ElementAt(++rcpos);//12
  4187. if (needaddrow > 0)
  4188. addcount = 1;
  4189. else
  4190. addcount = 0;
  4191. needaddrow--;
  4192. str.Empty();
  4193. for (i = 0; i < rowcount + addcount; i++)
  4194. {
  4195. str += sparray.ElementAt(pos).ElementAt(5);
  4196. str += " 数量:";
  4197. str += sparray.ElementAt(pos).ElementAt(3);
  4198. str += ";";
  4199. pos++;
  4200. }
  4201. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4202. m_Print.DrawRect2(StrRect, 2);
  4203. /* StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4204. if(needaddrow>0)
  4205. addcount=1;
  4206. else
  4207. addcount=0;
  4208. needaddrow--;
  4209. str.Empty ();
  4210. for( i=0; i<rowcount+addcount; i++)
  4211. {
  4212. str+=sparray.ElementAt (pos).ElementAt (5);
  4213. str+=" 数量:";
  4214. str+=sparray.ElementAt (pos).ElementAt (3);
  4215. str+=";";
  4216. pos++;
  4217. }
  4218. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4219. m_Print.DrawRect2(StrRect, 2);
  4220. StrRect=load2.m_rcarray .ElementAt (++rcpos);//14
  4221. if(needaddrow>0)
  4222. addcount=1;
  4223. else
  4224. addcount=0;
  4225. needaddrow--;
  4226. str.Empty ();
  4227. for( i=0; i<rowcount+addcount; i++)
  4228. {
  4229. str+=sparray.ElementAt (pos).ElementAt (5);
  4230. str+=" 数量:";
  4231. str+=sparray.ElementAt (pos).ElementAt (3);
  4232. str+=";";
  4233. pos++;
  4234. }
  4235. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4236. m_Print.DrawRect2(StrRect, 2);*/
  4237. CRect sprc[2];
  4238. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4239. // AutoDraw(m_Print, StrRect, m_bz.Left (leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4240. m_Print.DrawRect2(StrRect, 2);
  4241. sprc[0] = StrRect;
  4242. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4243. // AutoDraw(m_Print, StrRect, m_bz.Right (leng-leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4244. m_Print.DrawRect2(StrRect, 2);
  4245. sprc[1] = StrRect;
  4246. //AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4247. {
  4248. CString temp, tempspno, tempbz;
  4249. CSize size;
  4250. BOOL bRun = 0;
  4251. int fontsize = 12;
  4252. ll: tempspno = m_bz;
  4253. m_Print.SetFontFace(fontsize, 1, "宋体");
  4254. for (i = 0; i<2; i++)
  4255. {
  4256. if (!tempspno.IsEmpty())
  4257. {
  4258. temp = tempspno;
  4259. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4260. int right = 0;
  4261. CRect temprc = sprc[i];
  4262. while (size.cx>temprc.Width())
  4263. {
  4264. right++;
  4265. temp = tempspno.Left(tempspno.GetLength() - (right));
  4266. if (GIsHalfHZ(temp))
  4267. {
  4268. right++;
  4269. temp.Delete(temp.GetLength() - 1);
  4270. }
  4271. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4272. }
  4273. if (bRun)
  4274. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4275. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  4276. if (tempspno.IsEmpty())i++;
  4277. }
  4278. }
  4279. if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
  4280. {
  4281. fontsize--;
  4282. goto ll;
  4283. }
  4284. if (bRun == 0)
  4285. {
  4286. bRun = 1;
  4287. goto ll;
  4288. }
  4289. }
  4290. m_Print.SetFontFace(11, 1, "宋体");
  4291. //////////////////////load3
  4292. rcpos = -1;
  4293. for (i = 0; i < 24; i++)
  4294. {
  4295. StrRect = load3.m_rcarray.ElementAt(i);
  4296. m_Print.DrawRect2(StrRect, 1);
  4297. }
  4298. CStringArray strarray;
  4299. strarray.Add("营业员");
  4300. strarray.Add("前台接待");
  4301. strarray.Add("化妆师");
  4302. strarray.Add("礼服师");
  4303. strarray.Add("摄影师");
  4304. strarray.Add("摄影助理");
  4305. strarray.Add("美工师");
  4306. strarray.Add("设计师");
  4307. for (i = 0; i < 8; i++)
  4308. {
  4309. StrRect = load3.m_rcarray.ElementAt(i);
  4310. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4311. }
  4312. strarray.RemoveAll();
  4313. strarray.Add(m_ren);
  4314. strarray.Add(g_List1array.ElementAt(0).ElementAt(49));
  4315. strarray.Add(m_waiter2);
  4316. strarray.Add(g_List1array.ElementAt(0).ElementAt(51));
  4317. strarray.Add(m_waiter1);
  4318. strarray.Add(g_List1array.ElementAt(0).ElementAt(50));
  4319. strarray.Add("");
  4320. strarray.Add(m_waiter4);
  4321. for (i = 8; i < 16; i++)
  4322. {
  4323. StrRect = load3.m_rcarray.ElementAt(i);
  4324. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 8), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4325. }
  4326. StrRect = load3.m_rcarray.ElementAt(27);
  4327. m_Print.DrawText((LPTSTR)(LPCTSTR)"客户电话: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4328. StrRect = load3.m_rcarray.ElementAt(28);
  4329. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4330. m_Print.SetFontFace(13, 1, "宋体");
  4331. StrRect = load3.m_rcarray.ElementAt(25);
  4332. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4333. StrRect = load3.m_rcarray.ElementAt(26);
  4334. m_Print.DrawRect2(StrRect, 2);
  4335. StrRect = load3.m_rcarray.ElementAt(24);
  4336. str = "\
  4337. 顾客须知\r\n\
  4338. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  4339. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  4340. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  4341. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  4342. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  4343. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  4344. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  4345. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  4346. AutoDraw(m_Print, StrRect, str, 1.8);
  4347. PrintPreview dlg;
  4348. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4349. dlg.m_pDC = m_Print.GetPDC();
  4350. if (dlg.DoModal() != IDOK)return;
  4351. //结束打印
  4352. m_Print.EndPage();
  4353. m_Print.EndPrint();
  4354. }
  4355. void CMainFrame::PrintDailyForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4356. {
  4357. // TODO: Add your control notification handler code here
  4358. int pages = Listarray->GetSize() / 46;
  4359. if (Listarray->GetSize() % 46)pages++;
  4360. for (int aa = 0; aa < pages; aa++)
  4361. {
  4362. PrintPreview dlg;
  4363. CPrintRX m_Print;
  4364. m_Print.InitToPrint(NULL, 1);
  4365. m_Print.StartPrint();
  4366. m_Print.StartPage();
  4367. CRect mainrc(0, 0, 560, 793);
  4368. float fscale;
  4369. {
  4370. int w, h;
  4371. m_Print.GetWidHei(w, h);
  4372. fscale = (float)w / (float)h;
  4373. }
  4374. mainrc.DeflateRect(25, 40, 10, 0);
  4375. CRect rc, rc2;
  4376. rc = mainrc;
  4377. rc.bottom = rc.top;
  4378. rc.top -= 20;
  4379. m_Print.SetFontFace(16, 1, "黑体");
  4380. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4381. m_Print.SetFontFace(9, 1, "宋体");
  4382. CString str;
  4383. int wid[4] = { 320, 60, 60, 90 };
  4384. int hei = 16;
  4385. if (fscale > 0.71)hei = 15;
  4386. rc = mainrc;
  4387. rc.bottom = rc.top + hei;
  4388. for (int i = 0; i < 47; i++)
  4389. {
  4390. rc2.top = rc.top + i*hei;
  4391. rc2.bottom = rc.bottom + i*hei;
  4392. rc2.left = rc.left;
  4393. rc2.right = rc.left + wid[0];
  4394. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  4395. for (int j = 0; j<4; j++)
  4396. {
  4397. m_Print.DrawRect2(rc2, 1);
  4398. if (Listarray->GetSize()>aa * 46 + i)
  4399. {
  4400. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  4401. rc2.left += 3;
  4402. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4403. rc2.left -= 3;
  4404. }
  4405. rc2.left += wid[j];
  4406. rc2.right = rc2.left + wid[j + 1];
  4407. }
  4408. }
  4409. rc2.top += 2;
  4410. rc2.left += 2; rc2.right = mainrc.right + 4;
  4411. m_Print.SetFontFace(8, 1, "宋体");
  4412. int infopos = info.Find("***");
  4413. if (infopos != -1)
  4414. {
  4415. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Left(infopos), rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4416. CRect rc3 = rc2;
  4417. rc3.top = rc2.bottom - 4;
  4418. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Right(info.GetLength() - infopos - 3), rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4419. }
  4420. else
  4421. m_Print.DrawText((LPTSTR)(LPCTSTR)info, rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4422. str.Format(" 页:%d/%d", aa + 1, pages);
  4423. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4424. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  4425. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4426. dlg.m_pDC = m_Print.GetPDC();
  4427. // dlg.m_mode=1;
  4428. if (aa == 0)
  4429. {
  4430. if (dlg.DoModal() != IDOK)
  4431. return;
  4432. }
  4433. //结束打印
  4434. m_Print.EndPage();
  4435. m_Print.EndPrint();
  4436. }
  4437. }
  4438. void CMainFrame::PrintLoginForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4439. {
  4440. // TODO: Add your control notification handler code here
  4441. int sinlecount = 33 * 6;
  4442. int pages = Listarray->GetSize() / sinlecount;
  4443. if (Listarray->GetSize() % sinlecount)pages++;
  4444. for (int aa = 0; aa < pages; aa++)
  4445. {
  4446. PrintPreview dlg;
  4447. CPrintRX m_Print;
  4448. m_Print.InitToPrint(NULL, 1);
  4449. m_Print.StartPrint();
  4450. m_Print.StartPage();
  4451. CRect mainrc(0, 0, 560, 793);
  4452. float fscale;
  4453. {
  4454. int w, h;
  4455. m_Print.GetWidHei(w, h);
  4456. fscale = (float)w / (float)h;
  4457. }
  4458. mainrc.DeflateRect(25, 40, 10, 0);
  4459. CString str;
  4460. CRect rc, rc2;
  4461. rc = mainrc;
  4462. rc.bottom = rc.top;
  4463. rc.top -= 20;
  4464. rc.left -= 20;
  4465. m_Print.SetFontFace(12, 1, "黑体");
  4466. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4467. m_Print.SetFontFace(6, 1, "宋体");
  4468. str.Format(" 页:%d/%d", aa + 1, pages);
  4469. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4470. rc.right = mainrc.right + 20;
  4471. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4472. int wid[2] = { 50, 110 };
  4473. int hei = 11;
  4474. rc = mainrc;
  4475. rc.bottom = rc.top + hei;
  4476. rc.top += 10;
  4477. rc.bottom += 10;
  4478. int dtx = rc.Width() / 3 + 18;
  4479. int dty = 380;
  4480. for (int j = 0; j < 6; j++)
  4481. {
  4482. if (Listarray->GetSize() < aa*sinlecount + 33 * (j + 1))continue;
  4483. for (int i = 0; i < 33; i++)
  4484. {
  4485. rc2.top = rc.top + i*hei;
  4486. rc2.bottom = rc.bottom + i*hei;
  4487. rc2.left = rc.left;
  4488. rc2.right = rc.left + wid[0];
  4489. if (i == 0)
  4490. {
  4491. // rc2.left +=wid[1];
  4492. rc2.right += wid[1];
  4493. }
  4494. if (j == 1 || j == 4)
  4495. {
  4496. rc2.left += dtx;
  4497. rc2.right += dtx;
  4498. }
  4499. if (j == 2 || j == 5)
  4500. {
  4501. rc2.left += dtx * 2;
  4502. rc2.right += dtx * 2;
  4503. }
  4504. if (j == 3 || j == 4 || j == 5)
  4505. {
  4506. rc2.top += dty;
  4507. rc2.bottom += dty;
  4508. }
  4509. m_Print.DrawRect2(rc2, 1);
  4510. if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
  4511. {
  4512. str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(0);
  4513. rc2.left += 3;
  4514. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4515. rc2.left -= 3;
  4516. }
  4517. if (i == 0)continue;
  4518. rc2.left = rc2.right;
  4519. rc2.right += wid[1];
  4520. m_Print.DrawRect2(rc2, 1);
  4521. if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
  4522. {
  4523. if (Listarray->ElementAt(aa*sinlecount + 33 * j + i).GetSize() > 1)
  4524. {
  4525. str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(1);
  4526. rc2.left += 3;
  4527. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4528. rc2.left -= 3;
  4529. }
  4530. }
  4531. /* if(Listarray->GetSize ()>aa*46+i)
  4532. {
  4533. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4534. rc2.left +=3;
  4535. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4536. rc2.left -=3;
  4537. }
  4538. rc2.left +=wid[j];
  4539. rc2.right =rc2.left+wid[j+1];*/
  4540. }
  4541. }
  4542. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4543. dlg.m_pDC = m_Print.GetPDC();
  4544. if (aa == 0)
  4545. {
  4546. if (dlg.DoModal() != IDOK)
  4547. return;
  4548. }
  4549. //结束打印
  4550. m_Print.EndPage();
  4551. m_Print.EndPrint();
  4552. }
  4553. }
  4554. void CMainFrame::PrintTakeForm(CArray<CStringArray, CStringArray>*Listarray)
  4555. {
  4556. CString title;
  4557. CString info;
  4558. // TODO: Add your control notification handler code here
  4559. int sinlecount = 4;
  4560. int pages = Listarray->GetSize() / sinlecount;
  4561. if (Listarray->GetSize() % sinlecount)pages++;
  4562. for (int aa = 0; aa < pages; aa++)
  4563. {
  4564. PrintPreview dlg;
  4565. CPrintRX m_Print;
  4566. m_Print.InitToPrint(NULL, 1);
  4567. m_Print.StartPrint();
  4568. m_Print.StartPage();
  4569. CRect mainrc(0, 0, 560, 793);
  4570. float fscale;
  4571. {
  4572. int w, h;
  4573. m_Print.GetWidHei(w, h);
  4574. fscale = (float)w / (float)h;
  4575. }
  4576. mainrc.DeflateRect(25, 40, 10, 0);
  4577. CString str;
  4578. CRect rc, rc2;
  4579. rc = mainrc;
  4580. rc.bottom = rc.top;
  4581. rc.top -= 20;
  4582. rc.left -= 20;
  4583. m_Print.SetFontFace(6, 1, "宋体");
  4584. str.Format(" 页:%d/%d", aa + 1, pages);
  4585. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4586. rc.right = mainrc.right + 10;
  4587. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4588. m_Print.SetFontFace(12, 1, "宋体");
  4589. int wid[2] = { 70, 190 };
  4590. int hei = 22;
  4591. rc = mainrc;
  4592. rc.bottom = rc.top + hei;
  4593. rc.top += 10;
  4594. rc.bottom += 10;
  4595. int dtx = rc.Width() / 2 + 18;
  4596. int dty = 380;
  4597. int arraysize = Listarray->ElementAt(0).GetSize();
  4598. for (int j = 0; j < 4; j++)
  4599. {
  4600. if (Listarray->GetSize() <= aa*sinlecount + j)continue;
  4601. for (int i = 0; i < arraysize; i++)
  4602. {
  4603. rc2.top = rc.top + i / 2 * hei;
  4604. rc2.bottom = rc.bottom + i / 2 * hei;
  4605. rc2.left = rc.left;
  4606. rc2.right = rc.left + wid[0];
  4607. if (i % 2)
  4608. {
  4609. rc2.left = rc2.right;
  4610. rc2.right += wid[1];
  4611. }
  4612. if (j == 1 || j == 3)
  4613. {
  4614. rc2.left += dtx;
  4615. rc2.right += dtx;
  4616. }
  4617. if (j == 2 || j == 3)
  4618. {
  4619. rc2.top += dty;
  4620. rc2.bottom += dty;
  4621. }
  4622. if (i == arraysize - 1 || i == arraysize - 2)
  4623. {
  4624. rc2.bottom += hei * 2;
  4625. }
  4626. m_Print.DrawRect2(rc2, 1);
  4627. {
  4628. str = Listarray->ElementAt(aa*sinlecount + j).ElementAt(i);
  4629. if (i == arraysize - 1)
  4630. {
  4631. CRect rc3 = rc2;
  4632. rc3.left += 3;
  4633. rc3.top += 3;
  4634. AutoDraw(m_Print, rc3, str, 1.4);
  4635. }
  4636. else if (i == arraysize - 2)
  4637. {
  4638. CRect rc3 = rc2;
  4639. rc3.left += 3;
  4640. rc3.top += 3;
  4641. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4642. }
  4643. else
  4644. {
  4645. rc2.left += 3;
  4646. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4647. rc2.left -= 3;
  4648. }
  4649. }
  4650. }
  4651. }
  4652. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4653. dlg.m_pDC = m_Print.GetPDC();
  4654. if (aa == 0)
  4655. {
  4656. if (dlg.DoModal() != IDOK)
  4657. return;
  4658. }
  4659. //结束打印
  4660. m_Print.EndPage();
  4661. m_Print.EndPrint();
  4662. }
  4663. }
  4664. void CMainFrame::PrintThumbNail(CStringArray *array, CString client, BOOL bDir, CString m_size)
  4665. {
  4666. // TODO: Add your control notification handler code here
  4667. CStringArray titlearray;
  4668. CStringArray namearray;
  4669. CStringArray noarray;
  4670. CArray<CRect, CRect>rcarray;
  4671. CArray<CRect, CRect>widtharray;
  4672. if (m_size != "")
  4673. {
  4674. int pos = m_size.Find(";");
  4675. while (pos != -1)
  4676. {
  4677. CString size = m_size.Left(pos);
  4678. int pos2 = size.Find(":");
  4679. if (pos2 != -1)
  4680. {
  4681. CString str;
  4682. CRect rc;
  4683. str = size.Left(pos2);
  4684. noarray.Add(str);
  4685. str = size.Right(size.GetLength() - pos2 - 1);
  4686. pos2 = str.Find(",");
  4687. namearray.Add(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4688. pos2 = str.Find(",");
  4689. rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4690. pos2 = str.Find(",");
  4691. rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4692. widtharray.Add(rc);
  4693. pos2 = str.Find(",");
  4694. rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4695. pos2 = str.Find(",");
  4696. rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4697. pos2 = str.Find(",");
  4698. rc.right = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4699. rc.bottom = atoi(str);
  4700. rcarray.Add(rc);
  4701. }
  4702. m_size = m_size.Right(m_size.GetLength() - pos - 1);
  4703. pos = m_size.Find(";");
  4704. }
  4705. }
  4706. PrintPreview dlg;
  4707. CPrintRX m_Print;
  4708. m_Print.InitToPrint(NULL, 1);
  4709. m_Print.StartPrint();
  4710. m_Print.StartPage();
  4711. CRect mainrc(0, 0, 560, 793);
  4712. mainrc.DeflateRect(25, 50, 10, 0);
  4713. m_Print.SetFontFace(10, 1, "宋体");
  4714. CRect rc, rc2;
  4715. rc = mainrc;
  4716. rc.bottom = rc.top;
  4717. rc.top -= 20;
  4718. m_Print.DrawText((LPTSTR)(LPCTSTR)client, rc, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4719. rc.bottom -= 5;
  4720. m_Print.DrawRect2(rc, 2);
  4721. if (array->GetSize() > 130)m_Print.SetFontFace(8, 1, "宋体");
  4722. if (bDir)m_Print.SetFontFace(6, 1, "宋体");
  4723. ////////////////////////////////////////////////////////////////
  4724. int imgcount = array->GetSize();
  4725. int dtx = 5;
  4726. int dty = 15;
  4727. int cx, cy;
  4728. int countx = 5;
  4729. int county = 1;
  4730. while (1)
  4731. {
  4732. if (countx*county >= imgcount)
  4733. {
  4734. cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
  4735. cy = cx * 4 / 3;
  4736. break;
  4737. }
  4738. else
  4739. {
  4740. cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
  4741. cy = cx * 4 / 3;
  4742. if (cy*(county + 1) + dty*county < mainrc.Height())//Y方向可以增加一个
  4743. {
  4744. county++;
  4745. }
  4746. else//Y方向不能加,X方向加
  4747. {
  4748. countx++;
  4749. county = 1;
  4750. }
  4751. }
  4752. }
  4753. int imgpos = 0;
  4754. CString stemp;
  4755. CPen pen(PS_SOLID, 1, RGB(255, 0, 0));
  4756. CPen *oldpen = m_Print.m_DC.SelectObject(&pen);
  4757. CPen *oldpen2 = m_Print.m_memdc.SelectObject(&pen);
  4758. for (int i = 0; i < county; i++)
  4759. {
  4760. for (int j = 0; j < countx; j++)
  4761. {
  4762. rc = mainrc;
  4763. rc.top += i*(cy + dty);
  4764. rc.left += j*(cx + dtx);
  4765. rc.right = rc.left + cx;
  4766. rc.bottom = rc.top + cy;
  4767. Image *pImg = NULL;
  4768. if (imgpos >= array->GetSize())break;
  4769. CString str = array->ElementAt(imgpos);
  4770. CString spath = str.Left(str.ReverseFind('\\') + 1);
  4771. spath += "m";
  4772. spath += str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4773. if (PathFileExists(spath))
  4774. ::LoadImageFromBuf(&pImg, spath);
  4775. else
  4776. {
  4777. ::LoadImageFromBuf(&pImg, str);
  4778. if (pImg == NULL)continue;
  4779. int orientation = GetOrientation(pImg);
  4780. if (orientation == 8)
  4781. pImg->RotateFlip(Rotate270FlipNone);
  4782. else if (orientation == 6)
  4783. pImg->RotateFlip(Rotate90FlipNone);
  4784. }
  4785. if (pImg == NULL)continue;
  4786. rc2 = rc;
  4787. RectFitDes(pImg->GetWidth(), pImg->GetHeight(), rc);
  4788. imgpos++;
  4789. m_Print.DrawImage(pImg, rc);
  4790. int imgwidth = pImg->GetWidth();
  4791. delete pImg;
  4792. rc2.top = rc2.bottom + 3;
  4793. rc2.bottom += 10;
  4794. if (bDir == 0)
  4795. str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4796. else
  4797. {
  4798. stemp = str.Left(str.ReverseFind('\\'));
  4799. str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4800. if (stemp.ReverseFind('\\') != -1)
  4801. {
  4802. stemp = stemp.Right(stemp.GetLength() - stemp.ReverseFind('\\') - 1);
  4803. str = stemp + "\\" + str;
  4804. }
  4805. }
  4806. if (str.Find(".") != -1)
  4807. str = str.Left(str.Find("."));
  4808. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  4809. if (noarray.GetSize())
  4810. {
  4811. rc2 = rc;
  4812. for (int aa = 0; aa < noarray.GetSize(); aa++)
  4813. {
  4814. float scale = (float)rc2.Width() / (float)imgwidth;
  4815. if (noarray.ElementAt(aa) == str)
  4816. {
  4817. int nIndex = aa;
  4818. CRect rc = rcarray.ElementAt(nIndex);
  4819. int wid = widtharray.ElementAt(nIndex).left;
  4820. int hei = widtharray.ElementAt(nIndex).top;
  4821. scale *= (float)imgwidth / (float)wid;
  4822. rc.left *= scale;
  4823. rc.right *= scale;
  4824. rc.top *= scale;
  4825. rc.bottom *= scale;
  4826. rc.left += rc2.left;
  4827. rc.right += rc2.left;
  4828. rc.top += rc2.top;
  4829. rc.bottom += rc2.top;
  4830. if (rc.left < rc2.left)rc.left = rc2.left;
  4831. if (rc.right > rc2.right)rc.right = rc2.right;
  4832. if (rc.top < rc2.top)rc.top = rc2.top;
  4833. if (rc.bottom > rc2.bottom)rc.bottom = rc2.bottom;
  4834. m_Print.DrawRect2(rc, 1);
  4835. }
  4836. }
  4837. }
  4838. }
  4839. }
  4840. m_Print.m_DC.SelectObject(oldpen);
  4841. m_Print.m_memdc.SelectObject(oldpen2);
  4842. /* CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  4843. StrRect.top -=15;StrRect.bottom -=15;
  4844. Image *pImg=NULL;
  4845. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  4846. m_Print.DrawImage(pImg, StrRect);
  4847. delete pImg;
  4848. m_Print.SetFontFace(10, 1, "宋体");
  4849. StrRect=load.m_rcarray .ElementAt (20);
  4850. StrRect.right=load.m_rcarray .ElementAt (23).right;
  4851. StrRect.top -=18;StrRect.bottom -=18;
  4852. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  4853. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4854. */
  4855. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4856. dlg.m_pDC = m_Print.GetPDC();
  4857. if (dlg.DoModal() != IDOK)
  4858. return;
  4859. //结束打印
  4860. m_Print.EndPage();
  4861. m_Print.EndPrint();
  4862. }
  4863. // remark by Jeff
  4864. // 函数:PrintDinDan
  4865. // 参数:
  4866. // strOrderNumber:订单单号;(Order number)
  4867. // 返回:void
  4868. // 注意:#
  4869. void CMainFrame::PrintDinDan(CString strOrderNumber)//打印订单报表;
  4870. {
  4871. int printcot = 1;
  4872. for (int aa = 0; aa < printcot; aa++)
  4873. {
  4874. PrintPreview dlg;
  4875. CPrintRX m_Print;
  4876. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  4877. {
  4878. m_Print.InitToPrint(NULL, 1);
  4879. }
  4880. else
  4881. {
  4882. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  4883. if (name.IsEmpty())
  4884. m_Print.InitToPrint(NULL, 1);
  4885. else
  4886. {
  4887. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  4888. if (nret == -1 && aa == 0)
  4889. {
  4890. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  4891. }
  4892. }
  4893. }
  4894. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 0)
  4895. {
  4896. #ifdef ZHIAI_VERSION
  4897. PrintDinDan3(strOrderNumber);
  4898. return;
  4899. #endif
  4900. #ifdef SZBLCT_VERSION
  4901. PrintDinDan4(strOrderNumber);
  4902. return;
  4903. #endif
  4904. m_Print.StartPrint();
  4905. m_Print.StartPage();
  4906. LoadRect load;
  4907. load.SetLiaPath("6.lia");
  4908. load.SetMargins(-14, 15);
  4909. if (!load.Load())return;
  4910. LoadRect load2;
  4911. load2.SetLiaPath("7.lia");
  4912. load2.SetMargins(-14, 216 + 15);
  4913. if (!load2.Load())return;
  4914. LoadRect load3;
  4915. load3.SetLiaPath("8.lia");
  4916. load3.SetMargins(-14, 705 + 15);
  4917. if (!load3.Load())return;
  4918. int i;
  4919. //////////////////////////////////////////////////////////////
  4920. CStringArray txarray;
  4921. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
  4922. g_sendhead.code[0] = 11;
  4923. g_sendhead.code[1] = 52;
  4924. g_sendhead.code[2] = 50;
  4925. g_sendhead.code[3] = 150;
  4926. g_sendhead.code[4] = 77;
  4927. g_sendhead.code[5] = 4;
  4928. g_sendhead.tabcount = 6;
  4929. g_sendhead.bsql = 0;
  4930. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  4931. CArray<CStringArray, CStringArray>sparray;
  4932. CArray<CStringArray, CStringArray>clientarray;
  4933. CArray<CStringArray, CStringArray>phonearray;
  4934. CArray<CStringArray, CStringArray>fgarray;
  4935. CArray<CStringArray, CStringArray>danweiarray;
  4936. CArray<CStringArray, CStringArray>jdarray;
  4937. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  4938. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  4939. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  4940. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  4941. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  4942. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  4943. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  4944. CString m_taoxiname;
  4945. if (m_zs.Find("\\") != -1)
  4946. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
  4947. else
  4948. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
  4949. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  4950. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  4951. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  4952. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  4953. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  4954. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  4955. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  4956. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  4957. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  4958. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  4959. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  4960. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  4961. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  4962. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  4963. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  4964. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  4965. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  4966. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  4967. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  4968. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  4969. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  4970. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  4971. if (jdarray.GetSize())
  4972. {
  4973. if (m_bz.IsEmpty() == 0)
  4974. m_bz = "\r\n" + m_bz;
  4975. m_bz += "景点:";
  4976. }
  4977. #ifdef DDF_VERSION
  4978. m_bz += "219店:219路馨园小区对面\r\n";
  4979. m_bz += "金色店:万科金色家园小区东门南走20米荣光社区一楼\r\n";
  4980. m_bz += "万泰店:万泰锦绣华城小区正门\r\n";
  4981. #else
  4982. for (i = 0; i < jdarray.GetSize(); i++)
  4983. {
  4984. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  4985. }
  4986. m_bz.TrimRight(";");
  4987. #endif
  4988. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  4989. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  4990. if (IsHasRights2new(31) == 0)
  4991. {
  4992. m_phone1 = "***";
  4993. m_phone2 = "***";
  4994. }
  4995. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  4996. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  4997. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  4998. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  4999. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  5000. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  5001. filter = "name='" + m_ren + "'";
  5002. g_sendhead.code[0] = 5;
  5003. g_sendhead.tabcount = 1;
  5004. g_sendhead.bsql = 0;
  5005. int g_nYearposTemp = g_nYearpos;
  5006. g_nYearpos = -1;
  5007. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5008. g_nYearpos = g_nYearposTemp;
  5009. if (g_bSendOK == 0)return;
  5010. DataToArray(&phonearray);
  5011. m_money1.Format("%f", atof(m_taoxijiage));
  5012. m_money2.Format("%f", atof(m_payed1));
  5013. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5014. ConvertToPrice(m_money1);
  5015. ConvertToPrice(m_money2);
  5016. ConvertToPrice(m_money3);
  5017. ////////////////////////////////////////////////////////////////
  5018. int rcpos = -1;
  5019. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  5020. StrRect.top -= 15; StrRect.bottom -= 15;
  5021. Image *pImg = NULL;
  5022. #ifdef MNLS_VERSION
  5023. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  5024. #else
  5025. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  5026. #endif
  5027. m_Print.DrawImage(pImg, StrRect);
  5028. delete pImg;
  5029. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5030. {
  5031. Image *pImg = NULL;
  5032. g_nSendCode = 31;
  5033. int g_nYearposTemp = g_nYearpos;
  5034. g_nYearpos = -1;
  5035. g_pMainWnd->ProcessChatMessageRequest2(1);
  5036. g_nYearpos = g_nYearposTemp;
  5037. g_nSendCode = 0;
  5038. if (g_bSendOK == 0)return;
  5039. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  5040. if (pImg)
  5041. {
  5042. StrRect.left = 30;
  5043. StrRect.top = 12;
  5044. StrRect.right = StrRect.left + 60;
  5045. StrRect.bottom = StrRect.top + 60;
  5046. m_Print.DrawImage(pImg, StrRect);
  5047. delete pImg; pImg = NULL;
  5048. }
  5049. }
  5050. m_Print.SetFontFace(11, 1, "宋体");
  5051. StrRect = load.m_rcarray.ElementAt(20);
  5052. StrRect.right = load.m_rcarray.ElementAt(23).right;
  5053. StrRect.top -= 18; StrRect.bottom -= 18;
  5054. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  5055. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5056. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  5057. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5058. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5059. StrRect.top -= 15; StrRect.bottom -= 15;
  5060. #ifdef MNLS_VERSION
  5061. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5062. #endif
  5063. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5064. StrRect.top -= 15; StrRect.bottom -= 15;
  5065. #ifdef MNLS_VERSION
  5066. m_Print.DrawRect(StrRect);
  5067. #endif
  5068. m_Print.SetFontFace(7, 1, "黑体");
  5069. m_Print.SetColor(0xffffff);
  5070. #ifdef MNLS_VERSION
  5071. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5072. #endif
  5073. m_Print.SetColor(0);
  5074. m_Print.SetFontFace(15, 1, "宋体");
  5075. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5076. StrRect.top -= 15; StrRect.bottom -= 15;
  5077. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5078. CStringArray strarray;
  5079. strarray.Add("NO: " + strOrderNumber);
  5080. CString date;
  5081. date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  5082. strarray.Add(date);
  5083. strarray.Add("喜爱");
  5084. strarray.Add("格调");
  5085. if (fgarray.GetSize() == 12)
  5086. {
  5087. for (int i = 0; i < 12; i++)
  5088. strarray.Add(fgarray.ElementAt(i).ElementAt(0));
  5089. }
  5090. else
  5091. {
  5092. strarray.Add("复古典雅");
  5093. strarray.Add("温文尔雅");
  5094. strarray.Add("豪华艳丽");
  5095. strarray.Add("传统大方");
  5096. strarray.Add("新潮个性");
  5097. strarray.Add("浪漫奔放");
  5098. strarray.Add("简单素雅");
  5099. strarray.Add("活泼俏丽");
  5100. strarray.Add("妩媚温馨");
  5101. strarray.Add("温柔贤惠");
  5102. strarray.Add("成熟感性");
  5103. strarray.Add("清纯可爱");
  5104. }
  5105. strarray.Add("姓名");
  5106. // strarray.Add("职业");
  5107. strarray.Add("");
  5108. strarray.Add("地址");
  5109. strarray.Add("电话");
  5110. #ifdef CHILD_VERSION
  5111. strarray.Add("家长");
  5112. strarray.Add("宝宝");
  5113. #else
  5114. strarray.Add("先生");
  5115. strarray.Add("女士");
  5116. #endif
  5117. m_Print.SetFontFace(11, 1, "宋体");
  5118. for (i = 0; i < strarray.GetSize(); i++)
  5119. {
  5120. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5121. if (i < 2)
  5122. {
  5123. StrRect.top -= 15; StrRect.bottom -= 15;
  5124. }
  5125. if (i>15)
  5126. m_Print.DrawRect2(StrRect, 1);
  5127. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5128. }
  5129. for (i = 29; i <= 40; i++)
  5130. {
  5131. if (m_style.GetLength() <= (i - 29))continue;
  5132. if (m_style.GetAt(i - 29) != '1')continue;
  5133. StrRect = load.m_rcarray.ElementAt(i - 1);
  5134. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5135. }
  5136. for (i = 27; i <= 48; i++)
  5137. {
  5138. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5139. m_Print.DrawRect2(StrRect, 1);
  5140. }
  5141. #ifdef CHILD_VERSION
  5142. StrRect = load.m_rcarray.ElementAt(45);
  5143. StrRect.right = StrRect.left + 62;
  5144. m_Print.DrawRect2(StrRect, 1);
  5145. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5146. StrRect.left = StrRect.right;
  5147. StrRect.right = StrRect.left + 62;
  5148. m_Print.DrawRect2(StrRect, 1);
  5149. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5150. StrRect.left = StrRect.right;
  5151. StrRect.right = StrRect.left + 62;
  5152. m_Print.DrawRect2(StrRect, 1);
  5153. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5154. StrRect.left = StrRect.right;
  5155. StrRect.right = StrRect.left + 62;
  5156. m_Print.DrawRect2(StrRect, 1);
  5157. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5158. #endif
  5159. /////////////////////////
  5160. strarray.RemoveAll();
  5161. CString temp;
  5162. temp.Format("拍摄多款选 %d 款,其中影", atoi(m_outside) + atoi(m_outside2));
  5163. strarray.Add(temp);
  5164. temp.Format("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  5165. strarray.Add(temp);
  5166. strarray.Add("化妆");
  5167. strarray.Add("造型");
  5168. #ifdef CHILD_VERSION
  5169. strarray.Add("");
  5170. #else
  5171. strarray.Add("婚纱");
  5172. #endif
  5173. strarray.Add("服饰");
  5174. strarray.Add("配");
  5175. strarray.Add("置");
  5176. strarray.Add("其");
  5177. strarray.Add("它");
  5178. strarray.Add("套系名称");
  5179. strarray.Add("镜款");
  5180. strarray.Add("套系总价");
  5181. strarray.Add("主摄影师");
  5182. strarray.Add("拍摄日期");
  5183. strarray.Add("定金");
  5184. #ifdef CHILD_VERSION
  5185. strarray.Add("主引导师");
  5186. #else
  5187. strarray.Add("主化妆师");
  5188. #endif
  5189. strarray.Add("看样日期");
  5190. strarray.Add("欠款余额");
  5191. strarray.Add("总监");
  5192. strarray.Add("取件日期");
  5193. rcpos = -1;
  5194. for (i = 0; i < strarray.GetSize(); i++)
  5195. {
  5196. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  5197. if (i>9)
  5198. m_Print.DrawRect2(StrRect, 1);
  5199. #ifdef CHILD_VERSION
  5200. if (i == 5)
  5201. StrRect.top -= StrRect.Height();
  5202. #endif
  5203. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5204. }
  5205. for (i = 22; i <= 41; i++)
  5206. {
  5207. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  5208. m_Print.DrawRect2(StrRect, 1);
  5209. }
  5210. /////////////////////////////
  5211. strarray.RemoveAll();
  5212. #ifdef CHILD_VERSION
  5213. strarray.Add("顾客方 家长:");
  5214. strarray.Add("宝宝:");
  5215. #else
  5216. strarray.Add("顾客方 先生:");
  5217. strarray.Add("女士:");
  5218. #endif
  5219. strarray.Add("电话:");
  5220. strarray.Add("影楼方 店长:");
  5221. strarray.Add("接单人:");
  5222. strarray.Add("电话:");
  5223. rcpos = -1;
  5224. for (i = 0; i < strarray.GetSize(); i++)
  5225. {
  5226. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  5227. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5228. }
  5229. for (i = 7; i <= 12; i++)
  5230. {
  5231. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  5232. // if(i!=10)
  5233. m_Print.DrawRect2(StrRect, 2);
  5234. }
  5235. //////////////////////////////////////
  5236. //开始打数据
  5237. strarray.RemoveAll();
  5238. strarray.Add(m_name1);
  5239. strarray.Add(m_name2);
  5240. /// strarray.Add (m_occupation1);
  5241. // strarray.Add (m_occupation2);
  5242. strarray.Add("");
  5243. strarray.Add("");
  5244. strarray.Add(m_addr1);
  5245. #ifdef CHILD_VERSION
  5246. strarray.Add("");
  5247. #else
  5248. strarray.Add(m_addr2);
  5249. #endif
  5250. strarray.Add(m_phone1);
  5251. strarray.Add(m_phone2);
  5252. for (i = 41; i <= 48; i++)
  5253. {
  5254. StrRect = load.m_rcarray.ElementAt(i - 1);
  5255. StrRect.left += 4;
  5256. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5257. }
  5258. ///////////////////////////////
  5259. strarray.RemoveAll();
  5260. strarray.Add(m_money1);
  5261. strarray.Add(m_waiter1);
  5262. strarray.Add(m_time2);
  5263. strarray.Add(m_money2);
  5264. strarray.Add(m_waiter2);
  5265. strarray.Add(m_time4);
  5266. strarray.Add(m_money3);
  5267. strarray.Add("");
  5268. strarray.Add(m_time5);
  5269. for (i = 32; i <= 40; i++)
  5270. {
  5271. StrRect = load2.m_rcarray.ElementAt(i - 1);
  5272. StrRect.left += 4;
  5273. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5274. }
  5275. ///////////////////////////////
  5276. strarray.RemoveAll();
  5277. strarray.Add(m_name1);
  5278. strarray.Add(m_name2);
  5279. CString phone;
  5280. if (m_phone1.IsEmpty() == 0)
  5281. phone = m_phone1 + ",";
  5282. phone += m_phone2;
  5283. phone.TrimRight(",");
  5284. strarray.Add(phone);
  5285. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
  5286. strarray.Add(m_ren);
  5287. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  5288. for (i = 7; i <= 12; i++)
  5289. {
  5290. StrRect = load3.m_rcarray.ElementAt(i - 1);
  5291. StrRect.left += 4;
  5292. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5293. }
  5294. StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
  5295. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5296. StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
  5297. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5298. StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
  5299. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5300. //////////////////////////////
  5301. //开始画文字
  5302. StrRect = load2.m_rcarray.ElementAt(30);
  5303. StrRect.left += 3;
  5304. StrRect.top += 3;
  5305. StrRect.right -= 2;
  5306. StrRect.bottom -= 2;
  5307. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5308. StrRect = load2.m_rcarray.ElementAt(29);
  5309. StrRect.left += 3;
  5310. StrRect.top += 3;
  5311. StrRect.right -= 2;
  5312. StrRect.bottom -= 2;
  5313. str = "";
  5314. for (i = 0; i < sparray.GetSize(); i++)
  5315. {
  5316. str += sparray.ElementAt(i).ElementAt(5);
  5317. str += " 数量:";
  5318. str += sparray.ElementAt(i).ElementAt(3);
  5319. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5320. str += "\r\n";
  5321. }
  5322. str.TrimRight("\r\n");
  5323. AutoDraw(m_Print, StrRect, str, 1.4);
  5324. StrRect = load2.m_rcarray.ElementAt(40);
  5325. StrRect.top += 8;
  5326. m_Print.SetFontFace(12, 1, "黑体");
  5327. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5328. StrRect.left += 3;
  5329. StrRect.top += 30;
  5330. StrRect.right -= 2;
  5331. StrRect.bottom -= 2;
  5332. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5333. if (str.IsEmpty())
  5334. {
  5335. str = "\
  5336. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5337. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5338. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5339. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5340. 持良好的心境.\r\n\
  5341. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5342. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5343. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5344. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5345. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5346. 勿进影室, 以免影响拍摄.\r\n\
  5347. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5348. 师或店长沟通.\r\n\
  5349. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5350. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5351. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5352. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5353. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5354. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5355. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5356. 还.";
  5357. }
  5358. AutoDraw(m_Print, StrRect, str, 1.8);
  5359. }
  5360. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 1)
  5361. {//AfxMessageBox("yyy");
  5362. m_Print.StartPrint();
  5363. m_Print.StartPage();
  5364. LoadRect load;
  5365. load.SetLiaPath("6-2.lia");
  5366. load.SetMargins(0, 0);
  5367. if (!load.Load())return;
  5368. int i;
  5369. //////////////////////////////////////////////////////////////
  5370. CStringArray txarray;
  5371. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
  5372. g_sendhead.code[0] = 11;
  5373. g_sendhead.code[1] = 52;
  5374. g_sendhead.code[2] = 50;
  5375. g_sendhead.code[3] = 150;
  5376. g_sendhead.code[4] = 77;
  5377. g_sendhead.code[5] = 4;
  5378. g_sendhead.tabcount = 6;
  5379. g_sendhead.bsql = 0;
  5380. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5381. CArray<CStringArray, CStringArray>sparray;
  5382. CArray<CStringArray, CStringArray>clientarray;
  5383. CArray<CStringArray, CStringArray>phonearray;
  5384. CArray<CStringArray, CStringArray>fgarray;
  5385. CArray<CStringArray, CStringArray>danweiarray;
  5386. CArray<CStringArray, CStringArray>jdarray;
  5387. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5388. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5389. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5390. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5391. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5392. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5393. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  5394. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5395. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5396. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5397. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5398. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5399. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5400. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5401. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5402. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5403. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5404. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  5405. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  5406. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  5407. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  5408. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  5409. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  5410. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  5411. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  5412. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  5413. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  5414. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  5415. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  5416. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5417. if (jdarray.GetSize())
  5418. {
  5419. if (m_bz.IsEmpty() == 0)
  5420. m_bz = "\r\n" + m_bz;
  5421. m_bz += "景点:";
  5422. }
  5423. for (i = 0; i < jdarray.GetSize(); i++)
  5424. {
  5425. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  5426. }
  5427. m_bz.TrimRight(";");
  5428. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  5429. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  5430. if (IsHasRights2new(31) == 0)
  5431. {
  5432. m_phone1 = "***";
  5433. m_phone2 = "***";
  5434. }
  5435. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5436. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5437. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  5438. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  5439. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  5440. CString str;
  5441. filter = "name='" + m_ren + "'";
  5442. g_sendhead.code[0] = 5;
  5443. g_sendhead.tabcount = 1;
  5444. g_sendhead.bsql = 0;
  5445. int g_nYearposTemp = g_nYearpos;
  5446. g_nYearpos = -1;
  5447. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5448. g_nYearpos = g_nYearposTemp;
  5449. if (g_bSendOK == 0)return;
  5450. DataToArray(&phonearray);
  5451. m_money1.Format("%f", atof(m_taoxijiage));
  5452. m_money2.Format("%f", atof(m_payed1));
  5453. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5454. ConvertToPrice(m_money1);
  5455. ConvertToPrice(m_money2);
  5456. ConvertToPrice(m_money3);
  5457. ////////////////////////////////////////////////////////////////
  5458. int rcpos = -1;
  5459. CRect StrRect = load.m_rcarray.ElementAt(0);
  5460. m_Print.SetFontFace(25, 1, "黑体");
  5461. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "预约单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5462. m_Print.SetFontFace(11, 1, "宋体");
  5463. StrRect = load.m_rcarray.ElementAt(1);
  5464. if (m_time1.GetLength() == 10)
  5465. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  5466. else
  5467. str = "开单日期:";
  5468. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5469. StrRect = load.m_rcarray.ElementAt(2);
  5470. m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + strOrderNumber), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5471. CStringArray strarray;
  5472. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5473. {
  5474. Image *pImg = NULL;
  5475. g_nSendCode = 31;
  5476. int g_nYearposTemp = g_nYearpos;
  5477. g_nYearpos = -1;
  5478. g_pMainWnd->ProcessChatMessageRequest2(1);
  5479. g_nYearpos = g_nYearposTemp;
  5480. g_nSendCode = 0;
  5481. if (g_bSendOK == 0)return;
  5482. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  5483. if (pImg)
  5484. {
  5485. StrRect.left = 47;
  5486. StrRect.top = 12;
  5487. StrRect.right = StrRect.left + 60;
  5488. StrRect.bottom = StrRect.top + 60;
  5489. m_Print.DrawImage(pImg, StrRect);
  5490. delete pImg; pImg = NULL;
  5491. }
  5492. }
  5493. #ifdef CHILD_VERSION
  5494. strarray.Add("家长姓名");
  5495. strarray.Add("宝宝姓名");
  5496. #else
  5497. strarray.Add("先生姓名");
  5498. strarray.Add("女士姓名");
  5499. #endif
  5500. strarray.Add("服装套数");
  5501. // strarray.Add ("拍摄张数");
  5502. #ifdef CHILD_VERSION
  5503. strarray.Add("出生日期");
  5504. #else
  5505. strarray.Add("结婚日期");
  5506. #endif
  5507. strarray.Add("拍摄日期");
  5508. strarray.Add("联系电话");
  5509. strarray.Add("联系电话");
  5510. strarray.Add("造型套数");
  5511. if (m_zs.Find("\\") != -1)
  5512. strarray.Add("入底\\入册");
  5513. else
  5514. strarray.Add("入底张数");
  5515. strarray.Add("选片日期");
  5516. strarray.Add("QQ/邮箱");
  5517. strarray.Add("套系总额");
  5518. strarray.Add("定金");
  5519. strarray.Add("余款金额");
  5520. strarray.Add("取件日期");
  5521. strarray.Add(m_name1);
  5522. strarray.Add(m_name2);
  5523. strarray.Add(m_clothescount);
  5524. // str.Format("%d", atoi(m_zs)*3);
  5525. // strarray.Add (str);
  5526. #ifdef CHILD_VERSION
  5527. strarray.Add(m_birthday1);
  5528. #else
  5529. strarray.Add(m_time3);
  5530. #endif
  5531. strarray.Add(m_time2);
  5532. strarray.Add(m_phone1);
  5533. strarray.Add(m_phone2);
  5534. strarray.Add(m_clothescount2);
  5535. strarray.Add(m_zs);
  5536. strarray.Add(m_time4);
  5537. strarray.Add(m_qq1);
  5538. strarray.Add(m_money1);
  5539. strarray.Add(m_money2);
  5540. strarray.Add(m_money3);
  5541. strarray.Add(m_time5);
  5542. for (i = 4; i <= 33; i++)
  5543. {
  5544. StrRect = load.m_rcarray.ElementAt(i - 1);
  5545. m_Print.DrawRect2(StrRect, 1);
  5546. if (strarray.GetSize() > (i - 4))
  5547. {
  5548. if (i <= 18)
  5549. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5550. else
  5551. {
  5552. StrRect.left += 4;
  5553. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5554. }
  5555. }
  5556. }
  5557. int dt = 413;
  5558. StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5559. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5560. StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5561. StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5562. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5563. StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5564. StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
  5565. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5566. StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
  5567. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5568. StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
  5569. m_Print.DrawText((LPTSTR)(LPCTSTR)("网址:" + g_cominfoarray.ElementAt(0).ElementAt(13)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5570. //////////////////////////////
  5571. //开始画文字
  5572. StrRect = load.m_rcarray.ElementAt(7);
  5573. int hei = StrRect.Height();
  5574. StrRect.top += hei;
  5575. StrRect.bottom += hei;
  5576. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5577. StrRect.top += dt;
  5578. StrRect.bottom += dt;
  5579. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5580. StrRect = load.m_rcarray.ElementAt(17);
  5581. StrRect.top += hei;
  5582. StrRect.bottom += hei;
  5583. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5584. StrRect = load.m_rcarray.ElementAt(33);
  5585. StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
  5586. StrRect.top += hei;
  5587. StrRect.left += 3;
  5588. StrRect.top += 3;
  5589. StrRect.right -= 2;
  5590. StrRect.bottom -= 2;
  5591. str = "";
  5592. for (i = 0; i < sparray.GetSize(); i++)
  5593. {
  5594. str += sparray.ElementAt(i).ElementAt(5);
  5595. str += " 数量:";
  5596. str += sparray.ElementAt(i).ElementAt(3);
  5597. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5598. str += "\r\n";
  5599. }
  5600. str.TrimRight("\r\n");
  5601. AutoDraw(m_Print, StrRect, str, 1.4);
  5602. StrRect = load.m_rcarray.ElementAt(33);
  5603. StrRect.top += dt;
  5604. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  5605. StrRect.top += hei;
  5606. StrRect.left += 3;
  5607. StrRect.top += 3;
  5608. StrRect.right -= 2;
  5609. StrRect.bottom -= 2;
  5610. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5611. StrRect = load.m_rcarray.ElementAt(34);
  5612. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  5613. StrRect.top += hei;
  5614. StrRect.left += 3;
  5615. StrRect.top += 3;
  5616. StrRect.right -= 2;
  5617. StrRect.bottom -= 2;
  5618. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5619. if (str.IsEmpty())
  5620. {
  5621. str = "\
  5622. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5623. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5624. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5625. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5626. 持良好的心境.\r\n\
  5627. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5628. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5629. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5630. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5631. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5632. 勿进影室, 以免影响拍摄.\r\n\
  5633. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5634. 师或店长沟通.\r\n\
  5635. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5636. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5637. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5638. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5639. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5640. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5641. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5642. 还.";
  5643. }
  5644. AutoDraw(m_Print, StrRect, str, 1.8);
  5645. StrRect = load.m_rcarray.ElementAt(35);
  5646. StrRect.bottom += 100;
  5647. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  5648. 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∨";
  5649. // AutoDraw(m_Print, StrRect, str, 1.4);
  5650. }
  5651. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 2)
  5652. {
  5653. PrintDinDan5(strOrderNumber);
  5654. return;
  5655. }
  5656. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
  5657. {
  5658. PrintDinDan6(strOrderNumber);
  5659. return;
  5660. }
  5661. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  5662. dlg.m_pDC = m_Print.GetPDC();
  5663. dlg.m_mode = 1;
  5664. if (aa == 0)
  5665. {
  5666. if (dlg.DoModal() != IDOK)
  5667. return;
  5668. printcot = dlg.m_num;
  5669. }
  5670. //结束打印
  5671. m_Print.EndPage();
  5672. m_Print.EndPrint();
  5673. }
  5674. }
  5675. void CovertDate2(CString date, CString &date2)
  5676. {
  5677. try
  5678. {
  5679. if (date == "2013-04-09")
  5680. {
  5681. date2 = "2013-02-29";
  5682. return;
  5683. }
  5684. ///////////////////////////////////
  5685. date2 = date;
  5686. GongToLong(date2);
  5687. ////////////////////////////////////
  5688. return;
  5689. CCalendarConvert m_CalendarConvert;
  5690. SYSTEMTIME src = { 0 };
  5691. SYSTEMTIME dst = { 0 };
  5692. COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0);
  5693. COleDateTime m_timeGregorian;
  5694. m_timeLunar.GetAsSystemTime(src);
  5695. BOOL bEmbolism = 0;
  5696. if (m_CalendarConvert.Gregorian2Lunar(&src, &dst, &bEmbolism))
  5697. {
  5698. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst);
  5699. date2.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay());
  5700. if (m_timeGregorian.GetYear() == -1)date2 = "2000-13-32";
  5701. }
  5702. else
  5703. {
  5704. date2.Empty();
  5705. }
  5706. }
  5707. catch (...)
  5708. {
  5709. }
  5710. }
  5711. void CMainFrame::PrintDinDan5(CString m_id)
  5712. {
  5713. int printcot = 1;
  5714. for (int aa = 0; aa < printcot; aa++)
  5715. {
  5716. PrintPreview dlg;
  5717. CPrintRX m_Print;
  5718. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  5719. {
  5720. m_Print.InitToPrint(NULL, 1);
  5721. }
  5722. else
  5723. {
  5724. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  5725. if (name.IsEmpty())
  5726. m_Print.InitToPrint(NULL, 1);
  5727. else
  5728. {
  5729. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  5730. if (nret == -1 && aa == 0)
  5731. {
  5732. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  5733. }
  5734. }
  5735. }
  5736. {
  5737. m_Print.StartPrint();
  5738. m_Print.StartPage();
  5739. LoadRect load;
  5740. load.SetLiaPath("19.lia");
  5741. load.SetMargins(0, -20);
  5742. if (!load.Load())return;
  5743. int i;
  5744. //////////////////////////////////////////////////////////////
  5745. CStringArray txarray;
  5746. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  5747. g_sendhead.code[0] = 11;
  5748. g_sendhead.code[1] = 52;
  5749. g_sendhead.code[2] = 50;
  5750. g_sendhead.code[3] = 150;
  5751. g_sendhead.code[4] = 77;
  5752. g_sendhead.code[5] = 4;
  5753. g_sendhead.tabcount = 6;
  5754. g_sendhead.bsql = 0;
  5755. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5756. CArray<CStringArray, CStringArray>sparray;
  5757. CArray<CStringArray, CStringArray>clientarray;
  5758. CArray<CStringArray, CStringArray>phonearray;
  5759. CArray<CStringArray, CStringArray>fgarray;
  5760. CArray<CStringArray, CStringArray>danweiarray;
  5761. CArray<CStringArray, CStringArray>jdarray;
  5762. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5763. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5764. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5765. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5766. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5767. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5768. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
  5769. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5770. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5771. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5772. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5773. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5774. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5775. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5776. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5777. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5778. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5779. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  5780. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  5781. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  5782. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  5783. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  5784. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  5785. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  5786. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  5787. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  5788. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  5789. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  5790. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(36);
  5791. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  5792. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5793. CString m_txtype = g_List1array.ElementAt(0).ElementAt(52);
  5794. CString m_memberno = g_List1array.ElementAt(0).ElementAt(47);
  5795. CString str;
  5796. if (jdarray.GetSize())
  5797. {
  5798. if (m_bz.IsEmpty() == 0)
  5799. m_bz = "\r\n" + m_bz;
  5800. m_bz += "景点:";
  5801. }
  5802. for (i = 0; i < jdarray.GetSize(); i++)
  5803. {
  5804. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  5805. }
  5806. m_bz.TrimRight(";");
  5807. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  5808. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  5809. if (IsHasRights2new(31) == 0)
  5810. {
  5811. m_phone1 = "***";
  5812. m_phone2 = "***";
  5813. }
  5814. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5815. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5816. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  5817. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  5818. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  5819. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  5820. BOOL check1 = atoi(clientarray.ElementAt(0).ElementAt(15));
  5821. filter = "name='" + m_ren + "'";
  5822. g_sendhead.code[0] = 5;
  5823. g_sendhead.tabcount = 1;
  5824. g_sendhead.bsql = 0;
  5825. int g_nYearposTemp = g_nYearpos;
  5826. g_nYearpos = -1;
  5827. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5828. g_nYearpos = g_nYearposTemp;
  5829. if (g_bSendOK == 0)return;
  5830. DataToArray(&phonearray);
  5831. m_money1.Format("%f", atof(m_taoxijiage));
  5832. m_money2.Format("%f", atof(m_payed1));
  5833. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5834. ConvertToPrice(m_money1);
  5835. ConvertToPrice(m_money2);
  5836. ConvertToPrice(m_money3);
  5837. ////////////////////////////////////////////////////////////////
  5838. int rcpos = -1;
  5839. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  5840. //Image *pImg=NULL;
  5841. // ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  5842. // m_Print.DrawImage(pImg, StrRect);
  5843. // delete pImg;
  5844. m_Print.SetFontFace(20, 1, "宋体");
  5845. StrRect = load.m_rcarray.ElementAt(1);
  5846. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "定单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5847. m_Print.SetFontFace(12, 1, "宋体");
  5848. StrRect = load.m_rcarray.ElementAt(2);
  5849. m_Print.DrawText((LPTSTR)(LPCTSTR)("NO." + m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5850. StrRect = load.m_rcarray.ElementAt(3);
  5851. str.Format("%s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  5852. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5853. StrRect = load.m_rcarray.ElementAt(4);
  5854. m_Print.DrawText((LPTSTR)(LPCTSTR)("联系人:" + m_name1), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5855. CStringArray strarray;
  5856. strarray.Add("姓名");
  5857. strarray.Add("性别");
  5858. strarray.Add("年龄");
  5859. strarray.Add("出生年月");
  5860. strarray.Add("套系价格");
  5861. strarray.Add("定金");
  5862. strarray.Add("欠款");
  5863. strarray.Add("拍摄类型");
  5864. strarray.Add("会员卡号");
  5865. strarray.Add("定单人");
  5866. strarray.Add("入底\\入册");
  5867. strarray.Add("联系电话");
  5868. for (i = 6; i <= 17; i++)
  5869. {
  5870. StrRect = load.m_rcarray.ElementAt(i - 1);
  5871. m_Print.DrawRect2(StrRect, 1);
  5872. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 6), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5873. }
  5874. strarray.RemoveAll();
  5875. strarray.Add(m_name2);
  5876. strarray.Add(m_sex);
  5877. if (m_birthday.GetLength() != 10)
  5878. strarray.Add("");
  5879. else
  5880. {
  5881. int year = 0;
  5882. if (check1)
  5883. {
  5884. CString date2;
  5885. CovertDate2(g_date, date2);
  5886. year = atoi(date2.Left(4)) - atoi(m_birthday.Left(4));
  5887. if (date2.Right(5) >= m_birthday.Right(5))
  5888. year++;
  5889. }
  5890. else
  5891. {
  5892. year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  5893. if (g_date.Right(5) >= m_birthday.Right(5))
  5894. year++;
  5895. }
  5896. str.Format("%d", year);
  5897. strarray.Add(str);
  5898. }
  5899. strarray.Add(m_birthday);
  5900. strarray.Add(m_money1);
  5901. strarray.Add(m_money2);
  5902. strarray.Add(m_money3);
  5903. strarray.Add(m_txtype);
  5904. strarray.Add(m_memberno);
  5905. strarray.Add(m_ren);
  5906. strarray.Add(m_zs);
  5907. if (!m_phone1.IsEmpty())
  5908. strarray.Add(m_phone1);
  5909. else
  5910. strarray.Add(m_phone2);
  5911. for (i = 18; i <= 29; i++)
  5912. {
  5913. StrRect = load.m_rcarray.ElementAt(i - 1);
  5914. m_Print.DrawRect2(StrRect, 1);
  5915. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5916. }
  5917. strarray.RemoveAll();
  5918. strarray.Add("摄影师");
  5919. strarray.Add("拍照时间");
  5920. strarray.Add("选片人");
  5921. strarray.Add("选片时间");
  5922. strarray.Add("引导师");
  5923. strarray.Add("设计师");
  5924. strarray.Add("取件时间");
  5925. strarray.Add("顾客签字");
  5926. for (i = 34; i <= 41; i++)
  5927. {
  5928. StrRect = load.m_rcarray.ElementAt(i - 1);
  5929. m_Print.DrawRect2(StrRect, 1);
  5930. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 34), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5931. }
  5932. strarray.RemoveAll();
  5933. strarray.Add(m_waiter1);
  5934. strarray.Add(m_time2);
  5935. strarray.Add(m_waiter3);
  5936. strarray.Add(m_time4);
  5937. strarray.Add(m_waiter2);
  5938. strarray.Add(m_waiter4);
  5939. strarray.Add(m_time5);
  5940. strarray.Add("");
  5941. for (i = 42; i <= 49; i++)
  5942. {
  5943. StrRect = load.m_rcarray.ElementAt(i - 1);
  5944. m_Print.DrawRect2(StrRect, 1);
  5945. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5946. }
  5947. m_Print.SetFontFace(15, 1, "宋体");
  5948. StrRect = load.m_rcarray.ElementAt(29);
  5949. m_Print.DrawRect2(StrRect, 1);
  5950. StrRect.top += 45;
  5951. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5952. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5953. m_Print.DrawText((LPTSTR)(LPCTSTR)"内", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5954. m_Print.DrawText((LPTSTR)(LPCTSTR)"容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5955. StrRect = load.m_rcarray.ElementAt(30);
  5956. m_Print.DrawRect2(StrRect, 1);
  5957. StrRect.top += 45;
  5958. m_Print.DrawText((LPTSTR)(LPCTSTR)"友", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5959. m_Print.DrawText((LPTSTR)(LPCTSTR)"情", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5960. m_Print.DrawText((LPTSTR)(LPCTSTR)"提", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5961. m_Print.DrawText((LPTSTR)(LPCTSTR)"示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5962. m_Print.SetFontFace(10, 1, "宋体");
  5963. StrRect = load.m_rcarray.ElementAt(37); StrRect.top = StrRect.bottom + 2;
  5964. str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  5965. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  5966. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  5967. StrRect = load.m_rcarray.ElementAt(48); StrRect.top = StrRect.bottom + 2; StrRect.left -= 200;
  5968. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  5969. //开始画文字
  5970. StrRect = load.m_rcarray.ElementAt(31);
  5971. StrRect.left += 3;
  5972. StrRect.top += 3;
  5973. StrRect.right -= 2;
  5974. StrRect.bottom -= 2;
  5975. str = "";
  5976. for (i = 0; i < sparray.GetSize(); i++)
  5977. {
  5978. str += sparray.ElementAt(i).ElementAt(5);
  5979. str += " 数量:";
  5980. str += sparray.ElementAt(i).ElementAt(3);
  5981. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5982. str += "\r\n";
  5983. }
  5984. str.TrimRight("\r\n");
  5985. m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5986. m_bz.TrimLeft();
  5987. if (m_bz != "")
  5988. {
  5989. str += "\r\n"; str += "\r\n";
  5990. str += "备注:" + m_bz;
  5991. }
  5992. AutoDraw(m_Print, StrRect, str, 1.4);
  5993. StrRect = load.m_rcarray.ElementAt(32); m_Print.DrawRect2(StrRect, 1);
  5994. StrRect.left += 3;
  5995. StrRect.top += 3;
  5996. StrRect.right -= 2;
  5997. StrRect.bottom -= 2;
  5998. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5999. if (str.IsEmpty())
  6000. {
  6001. str = "\
  6002. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6003. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6004. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6005. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6006. 持良好的心境.\r\n\
  6007. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6008. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6009. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6010. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6011. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6012. 勿进影室, 以免影响拍摄.\r\n\
  6013. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6014. 师或店长沟通.\r\n\
  6015. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6016. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6017. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6018. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6019. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6020. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6021. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6022. 还.";
  6023. }
  6024. AutoDraw(m_Print, StrRect, str, 1.8);
  6025. }
  6026. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6027. dlg.m_pDC = m_Print.GetPDC();
  6028. dlg.m_mode = 1;
  6029. if (aa == 0)
  6030. {
  6031. if (dlg.DoModal() != IDOK)
  6032. return;
  6033. printcot = dlg.m_num;
  6034. }
  6035. //结束打印
  6036. m_Print.EndPage();
  6037. m_Print.EndPrint();
  6038. }
  6039. }
  6040. void CMainFrame::PrintDinDan4(CString m_id)
  6041. {
  6042. // TODO: Add your control notification handler code here
  6043. CPrintRX m_Print;
  6044. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6045. {
  6046. m_Print.InitToPrint(NULL, 1);
  6047. }
  6048. else
  6049. {
  6050. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  6051. if (name.IsEmpty())
  6052. m_Print.InitToPrint(NULL, 1);
  6053. else
  6054. {
  6055. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6056. if (nret == -1)
  6057. {
  6058. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6059. }
  6060. }
  6061. }
  6062. m_Print.StartPrint();
  6063. m_Print.StartPage();
  6064. LoadRect load;
  6065. load.SetLiaPath("6-2.lia");
  6066. load.SetMargins(0, 0);
  6067. if (!load.Load())return;
  6068. int i;
  6069. //////////////////////////////////////////////////////////////
  6070. CStringArray txarray;
  6071. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  6072. g_sendhead.code[0] = 11;
  6073. g_sendhead.code[1] = 52;
  6074. g_sendhead.code[2] = 50;
  6075. g_sendhead.code[3] = 150;
  6076. g_sendhead.code[4] = 77;
  6077. g_sendhead.code[5] = 4;
  6078. g_sendhead.tabcount = 6;
  6079. g_sendhead.bsql = 0;
  6080. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  6081. CArray<CStringArray, CStringArray>sparray;
  6082. CArray<CStringArray, CStringArray>clientarray;
  6083. CArray<CStringArray, CStringArray>phonearray;
  6084. CArray<CStringArray, CStringArray>fgarray;
  6085. CArray<CStringArray, CStringArray>danweiarray;
  6086. CArray<CStringArray, CStringArray>jdarray;
  6087. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  6088. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  6089. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  6090. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  6091. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  6092. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  6093. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  6094. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  6095. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  6096. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  6097. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  6098. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  6099. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  6100. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  6101. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  6102. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  6103. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  6104. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  6105. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  6106. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  6107. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  6108. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  6109. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  6110. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  6111. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  6112. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  6113. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  6114. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  6115. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  6116. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  6117. if (jdarray.GetSize())
  6118. {
  6119. if (m_bz.IsEmpty() == 0)
  6120. m_bz = "\r\n" + m_bz;
  6121. m_bz += "景点:";
  6122. }
  6123. for (i = 0; i < jdarray.GetSize(); i++)
  6124. {
  6125. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  6126. }
  6127. m_bz.TrimRight(";");
  6128. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  6129. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  6130. if (IsHasRights2new(31) == 0)
  6131. {
  6132. m_phone1 = "***";
  6133. m_phone2 = "***";
  6134. }
  6135. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  6136. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  6137. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  6138. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  6139. CString str;
  6140. filter = "name='" + m_ren + "'";
  6141. g_sendhead.code[0] = 5;
  6142. g_sendhead.tabcount = 1;
  6143. g_sendhead.bsql = 0;
  6144. int g_nYearposTemp = g_nYearpos;
  6145. g_nYearpos = -1;
  6146. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6147. g_nYearpos = g_nYearposTemp;
  6148. if (g_bSendOK == 0)return;
  6149. DataToArray(&phonearray);
  6150. m_money1.Format("%f", atof(m_taoxijiage));
  6151. m_money2.Format("%f", atof(m_payed1));
  6152. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  6153. ConvertToPrice(m_money1);
  6154. ConvertToPrice(m_money2);
  6155. ConvertToPrice(m_money3);
  6156. ////////////////////////////////////////////////////////////////
  6157. int rcpos = -1;
  6158. CRect StrRect = load.m_rcarray.ElementAt(0);
  6159. m_Print.SetFontFace(25, 1, "黑体");
  6160. m_Print.DrawText((LPTSTR)(LPCTSTR)"巴黎春天婚纱摄影预约单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6161. m_Print.SetFontFace(11, 1, "宋体");
  6162. StrRect = load.m_rcarray.ElementAt(1);
  6163. if (m_time1.GetLength() == 10)
  6164. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  6165. else
  6166. str = "开单日期:";
  6167. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6168. StrRect = load.m_rcarray.ElementAt(2);
  6169. m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + m_id), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6170. CStringArray strarray;
  6171. strarray.Add("先生姓名");
  6172. strarray.Add("女士姓名");
  6173. strarray.Add("服装套数");
  6174. strarray.Add("拍摄张数");
  6175. strarray.Add("拍摄日期");
  6176. strarray.Add("联系电话");
  6177. strarray.Add("联系电话");
  6178. strarray.Add("造型套数");
  6179. strarray.Add("入册张数");
  6180. strarray.Add("选片日期");
  6181. strarray.Add("QQ/邮箱");
  6182. strarray.Add("套系总额");
  6183. strarray.Add("定金");
  6184. strarray.Add("余款金额");
  6185. strarray.Add("取件日期");
  6186. strarray.Add(m_name1);
  6187. strarray.Add(m_name2);
  6188. strarray.Add(m_clothescount);
  6189. str.Format("%d", atoi(m_zs) * 3);
  6190. strarray.Add(str);
  6191. strarray.Add(m_time2);
  6192. strarray.Add(m_phone1);
  6193. strarray.Add(m_phone2);
  6194. strarray.Add(m_clothescount2);
  6195. strarray.Add(m_zs);
  6196. strarray.Add(m_time4);
  6197. strarray.Add(m_qq1);
  6198. strarray.Add(m_money1);
  6199. strarray.Add(m_money2);
  6200. strarray.Add(m_money3);
  6201. strarray.Add(m_time5);
  6202. for (i = 4; i <= 33; i++)
  6203. {
  6204. StrRect = load.m_rcarray.ElementAt(i - 1);
  6205. m_Print.DrawRect2(StrRect, 1);
  6206. if (strarray.GetSize() > (i - 4))
  6207. {
  6208. if (i <= 18)
  6209. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6210. else
  6211. {
  6212. StrRect.left += 4;
  6213. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6214. }
  6215. }
  6216. }
  6217. int dt = 413;
  6218. StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6219. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6220. StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6221. StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6222. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6223. StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6224. StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
  6225. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址:深圳市红岭中路中深国际大厦首层,二十二层", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6226. StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
  6227. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:0755-61308198 61308199 25860696 25860697", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6228. StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
  6229. m_Print.DrawText((LPTSTR)(LPCTSTR)"网址:www.paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6230. StrRect = load.m_rcarray.ElementAt(43); StrRect.top += dt; StrRect.bottom += dt;
  6231. m_Print.DrawText((LPTSTR)(LPCTSTR)"邮箱:blct@paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6232. //////////////////////////////
  6233. //开始画文字
  6234. StrRect = load.m_rcarray.ElementAt(7);
  6235. int hei = StrRect.Height();
  6236. StrRect.top += hei;
  6237. StrRect.bottom += hei;
  6238. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6239. StrRect.top += dt;
  6240. StrRect.bottom += dt;
  6241. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6242. StrRect = load.m_rcarray.ElementAt(17);
  6243. StrRect.top += hei;
  6244. StrRect.bottom += hei;
  6245. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6246. StrRect = load.m_rcarray.ElementAt(33);
  6247. StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
  6248. StrRect.top += hei;
  6249. StrRect.left += 3;
  6250. StrRect.top += 3;
  6251. StrRect.right -= 2;
  6252. StrRect.bottom -= 2;
  6253. str = "";
  6254. for (i = 0; i < sparray.GetSize(); i++)
  6255. {
  6256. str += sparray.ElementAt(i).ElementAt(5);
  6257. str += " 数量:";
  6258. str += sparray.ElementAt(i).ElementAt(3);
  6259. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  6260. str += "\r\n";
  6261. }
  6262. str.TrimRight("\r\n");
  6263. AutoDraw(m_Print, StrRect, str, 1.4);
  6264. StrRect = load.m_rcarray.ElementAt(33);
  6265. StrRect.top += dt;
  6266. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  6267. StrRect.top += hei;
  6268. StrRect.left += 3;
  6269. StrRect.top += 3;
  6270. StrRect.right -= 2;
  6271. StrRect.bottom -= 2;
  6272. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6273. StrRect = load.m_rcarray.ElementAt(34);
  6274. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  6275. StrRect.top += hei;
  6276. StrRect.left += 3;
  6277. StrRect.top += 3;
  6278. StrRect.right -= 2;
  6279. StrRect.bottom -= 2;
  6280. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  6281. if (str.IsEmpty())
  6282. {
  6283. str = "\
  6284. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6285. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6286. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6287. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6288. 持良好的心境.\r\n\
  6289. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6290. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6291. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6292. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6293. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6294. 勿进影室, 以免影响拍摄.\r\n\
  6295. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6296. 师或店长沟通.\r\n\
  6297. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6298. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6299. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6300. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6301. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6302. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6303. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6304. 还.";
  6305. }
  6306. AutoDraw(m_Print, StrRect, str, 1.8);
  6307. StrRect = load.m_rcarray.ElementAt(35);
  6308. StrRect.bottom += 100;
  6309. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  6310. 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∨";
  6311. AutoDraw(m_Print, StrRect, str, 1.4);
  6312. PrintPreview dlg;
  6313. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6314. dlg.m_pDC = m_Print.GetPDC();
  6315. if (dlg.DoModal() != IDOK)return;
  6316. //结束打印
  6317. m_Print.EndPage();
  6318. m_Print.EndPrint();
  6319. }
  6320. int CalHeight_01(CRect &rc, CStringArray *saContent, CPrintRX *Print, int FORMAT)
  6321. {
  6322. CSize size;
  6323. int nMaxheight = 0;
  6324. CString strTemp;
  6325. CString strContent;
  6326. int nSize = saContent->GetSize();
  6327. int nRow = 0; // 行数;
  6328. for (int i = 0; i < nSize; i++)
  6329. {
  6330. strTemp = "";
  6331. strContent = saContent->ElementAt(i);
  6332. while (FALSE == strContent.IsEmpty())
  6333. {
  6334. strContent = strContent.Mid(strTemp.GetLength());
  6335. if (strContent.IsEmpty())
  6336. break;
  6337. Print->GetStrSize((LPTSTR)(LPCTSTR)strContent, size);
  6338. if (size.cx <= rc.Width())
  6339. {
  6340. CRect rc2 = rc;
  6341. rc2.top += nRow*(size.cy + 1);
  6342. rc2.bottom = rc2.top + (size.cy + 1);
  6343. Print->DrawText((LPTSTR)(LPCTSTR)strContent, rc2, 0, 0, FORMAT | FORMAT_UP);
  6344. nMaxheight = max(nMaxheight, rc2.bottom);
  6345. nRow++;
  6346. break;
  6347. }
  6348. int right = 0;
  6349. while (size.cx > rc.Width())
  6350. {
  6351. right++;
  6352. strTemp = strContent.Left(strContent.GetLength() - (right));
  6353. if (GIsHalfHZ(strTemp))
  6354. {
  6355. right++;
  6356. strTemp.Delete(strTemp.GetLength() - 1);
  6357. }
  6358. Print->GetStrSize((LPTSTR)(LPCTSTR)strTemp, size);
  6359. }
  6360. CRect rc2 = rc;
  6361. rc2.top += nRow*(size.cy + 1);
  6362. rc2.bottom = rc2.top + (size.cy + 1);
  6363. Print->DrawText((LPTSTR)(LPCTSTR)strTemp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6364. nRow++;
  6365. nMaxheight = max(nMaxheight, rc2.bottom);
  6366. }
  6367. }
  6368. return (nMaxheight == 0 ) ? (rc.bottom+1) : (nMaxheight+1);
  6369. }
  6370. int CalHeight(CArray<CRect, CRect>*rcarray, CStringArray *strarray2, CPrintRX *Print, int FORMAT)
  6371. {
  6372. CSize size;
  6373. CString str, temp;
  6374. CRect rc;
  6375. int maxhei = 1;
  6376. int fonthei;
  6377. for (int i = 0; i < rcarray->GetSize(); i++)
  6378. {
  6379. rc = rcarray->ElementAt(i);
  6380. maxhei = max(maxhei, rc.bottom);
  6381. str = strarray2->ElementAt(i);
  6382. temp.Empty();
  6383. int hei = 0;
  6384. while (str.IsEmpty() == 0)
  6385. {
  6386. str = str.Right(str.GetLength() - temp.GetLength());
  6387. if (str.IsEmpty())break;
  6388. Print->GetStrSize((LPTSTR)(LPCTSTR)str, size);
  6389. fonthei = size.cy + 1;
  6390. if (size.cx <= rc.Width())
  6391. {
  6392. CRect rc2 = rc;
  6393. rc2.top += hei*fonthei;
  6394. rc2.bottom = rc2.top + fonthei;
  6395. Print->DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT | FORMAT_UP);
  6396. //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6397. maxhei = max(maxhei, rc2.bottom);
  6398. break;
  6399. }
  6400. int right = 0;
  6401. while (size.cx > rc.Width())
  6402. {
  6403. right++;
  6404. temp = str.Left(str.GetLength() - (right));
  6405. if (GIsHalfHZ(temp))
  6406. {
  6407. right++;
  6408. temp.Delete(temp.GetLength() - 1);
  6409. }
  6410. Print->GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  6411. }
  6412. CRect rc2 = rc;
  6413. rc2.top += hei*fonthei;
  6414. rc2.bottom = rc2.top + fonthei;
  6415. Print->DrawText((LPTSTR)(LPCTSTR)temp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6416. hei++;
  6417. maxhei = max(maxhei, rc2.bottom);
  6418. }
  6419. }
  6420. return maxhei + 1;
  6421. }
  6422. void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  6423. {
  6424. //AfxMessageBox("abce");
  6425. int printcot = 1;
  6426. for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
  6427. {
  6428. g_sendhead.bsql = 0;
  6429. g_sendhead.code[0] = 24;
  6430. g_sendhead.tabcount = 1;
  6431. int g_nYearposTemp = g_nYearpos;
  6432. g_nYearpos = -1;
  6433. g_pMainWnd->ProcessChatMessageRequest2(1);
  6434. g_nYearpos = g_nYearposTemp;
  6435. if (0 == g_bSendOK)return;
  6436. DataToArray(&g_cominfoarray);
  6437. CString SerialNo;
  6438. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  6439. #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  6440. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  6441. CString sql;
  6442. sql.Format("update version set [serialno]='%s'", SerialNo);
  6443. g_sendhead.bsql=1;
  6444. g_nYearposTemp=g_nYearpos;
  6445. g_nYearpos=-1;
  6446. g_pMainWnd->ProcessChatMessageRequest2(sql);
  6447. g_nYearpos=g_nYearposTemp;
  6448. #endif
  6449. // 1.创建打印对象
  6450. CPrintRX m_Print;
  6451. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6452. {
  6453. m_Print.InitToPrint(NULL, 1);
  6454. }
  6455. else
  6456. {
  6457. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  6458. if (name.IsEmpty())
  6459. m_Print.InitToPrint(NULL, 1);
  6460. else
  6461. {
  6462. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6463. if (nret == -1 && aa == 0)
  6464. {
  6465. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6466. }
  6467. }
  6468. }
  6469. // 2.开始打印
  6470. m_Print.StartPrint();
  6471. m_Print.StartPage();
  6472. LoadRect load;
  6473. BOOL bSmall = 0;
  6474. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  6475. {
  6476. bSmall = 1;
  6477. load.SetLiaPath("20.lia");
  6478. }
  6479. else
  6480. load.SetLiaPath("10.lia");
  6481. if (bSmall)
  6482. load.SetMargins(0, 0);
  6483. else
  6484. load.SetMargins(10, 0);
  6485. if (!load.Load())return;
  6486. int rcpos = -1;
  6487. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  6488. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  6489. {
  6490. Image *pImg = NULL;
  6491. g_nSendCode = 31;
  6492. int g_nYearposTemp = g_nYearpos;
  6493. g_nYearpos = -1;
  6494. g_pMainWnd->ProcessChatMessageRequest2(1);
  6495. g_nYearpos = g_nYearposTemp;
  6496. g_nSendCode = 0;
  6497. if (g_bSendOK == 0)return;
  6498. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  6499. if (pImg)
  6500. {
  6501. StrRect.left = 65;
  6502. if (bSmall) StrRect.left = 55;
  6503. StrRect.top = 10;
  6504. StrRect.right = StrRect.left + 58;
  6505. StrRect.bottom = StrRect.top + 58;
  6506. // 3.打印2维码图像;
  6507. m_Print.DrawImage(pImg, StrRect);
  6508. delete pImg;
  6509. pImg = NULL;
  6510. }
  6511. }
  6512. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  6513. if (bSmall)
  6514. {
  6515. m_Print.SetFontFace(18, 1, "黑体");
  6516. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6517. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6518. m_Print.SetFontFace(9, 1, "宋体");
  6519. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6520. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6521. m_Print.SetFontFace(6, 1, "宋体");
  6522. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6523. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6524. m_Print.SetFontFace(9, 1, "宋体");
  6525. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6526. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6527. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6528. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6529. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6530. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6531. int hei = StrRect.Height();
  6532. StrRect.bottom = StrRect.top;
  6533. StrRect.top -= 8;
  6534. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6535. m_Print.SetFontFace(11, 1, "宋体");
  6536. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6537. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6538. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6539. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6540. m_Print.SetFontFace(8, 1, "宋体");
  6541. int i = 0;
  6542. for ( i = 7; i < 24; i++)
  6543. {
  6544. StrRect = load.m_rcarray.ElementAt(i);
  6545. m_Print.DrawRect2(StrRect, 1);
  6546. }
  6547. for (i = 9; i < 24; i++)
  6548. {
  6549. StrRect = load.m_rcarray.ElementAt(i);
  6550. StrRect.left += 2;
  6551. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6552. }
  6553. m_Print.SetFontFace(6, 1, "宋体");
  6554. for (i = 24; i < 26; i++)
  6555. {
  6556. StrRect = load.m_rcarray.ElementAt(i);
  6557. StrRect.left += 2;
  6558. if (i == 24)
  6559. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6560. else
  6561. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6562. }
  6563. // StrRect=load.m_rcarray .ElementAt (27);
  6564. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6565. }
  6566. else//大单
  6567. {
  6568. // 1.打印表头(蒙娜丽莎收款单)
  6569. m_Print.SetFontFace(20, 1, "黑体");
  6570. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6571. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6572. m_Print.SetFontFace(11, 1, "宋体");
  6573. // 2.打印订单号(NO.20140608-001)
  6574. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6575. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6576. // 3.打印SerialNo(SerialNo.01062)
  6577. int hei = StrRect.Height();
  6578. StrRect.bottom = StrRect.top;
  6579. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6580. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6581. // 4.打印影楼地址信息、电话;
  6582. m_Print.SetFontFace(8, 1, "宋体");
  6583. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6584. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6585. #ifdef LYFZ_VERSION
  6586. m_Print.SetFontFace(9, 1, "宋体");
  6587. #else
  6588. m_Print.SetFontFace(11, 1, "宋体");
  6589. #endif
  6590. // 5.打印客户姓名
  6591. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6592. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6593. // 6.打印客户联系电话
  6594. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6595. #ifdef LYFZ_VERSION
  6596. StrRect.left += 30;
  6597. StrRect.right += 30;
  6598. #endif
  6599. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6600. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6601. // 7.打印开单日期
  6602. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6603. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6604. // 8.打印列字段:收款项目
  6605. m_Print.SetFontFace(13, 1, "宋体");
  6606. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6607. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6608. //printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6609. // 9.打印列字段:金额
  6610. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6611. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6612. //printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6613. // 10.打印列字段:开单人
  6614. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6615. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6616. //printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6617. // 11.画表格-画3列;
  6618. m_Print.SetFontFace(11, 1, "宋体");
  6619. int i;
  6620. for (i = 7; i < 10; i++)
  6621. {
  6622. StrRect = load.m_rcarray.ElementAt(i);
  6623. m_Print.DrawRect2(StrRect, 1);
  6624. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6625. }
  6626. // 12.打印详细内容
  6627. int dty = 0;
  6628. int dtytemp = 0;
  6629. // for( i=10; i<14; i+=3)
  6630. for (i = 10; i<22; i += 3) // 循环4次,再画
  6631. {
  6632. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  6633. CArray<CRect, CRect>rcarray;
  6634. CStringArray strarray2;
  6635. StrRect = load.m_rcarray.ElementAt(i);
  6636. StrRect.top += dty;
  6637. StrRect.bottom += dty;
  6638. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  6639. {
  6640. StrRect = load.m_rcarray.ElementAt(i - 1);
  6641. StrRect.top += dty;
  6642. StrRect.bottom += dty;
  6643. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  6644. break;
  6645. }
  6646. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  6647. StrRect.left += 2;
  6648. StrRect.right -= 2;
  6649. StrRect.top += 4;
  6650. rcarray.Add(StrRect);
  6651. strarray2.Add(pArray->ElementAt(i));
  6652. // 指定格子宽度,计算字符串占几行(高度).
  6653. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  6654. dtytemp = bottom - StrRect.bottom;
  6655. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  6656. // 重新获取表格大小,并画出表格;
  6657. StrRect = load.m_rcarray.ElementAt(i);
  6658. StrRect.bottom += dtytemp;
  6659. StrRect.top += dty;
  6660. StrRect.bottom += dty;
  6661. m_Print.DrawRect2(StrRect, 1);
  6662. // 获取下一表格大小,并画出表格;
  6663. StrRect = load.m_rcarray.ElementAt(i + 1);
  6664. StrRect.top += dty;
  6665. StrRect.bottom += dty;
  6666. StrRect.bottom += dtytemp;
  6667. m_Print.DrawRect2(StrRect, 1);
  6668. StrRect.left += 2;
  6669. // 打印出金额字段内容
  6670. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6671. //printf("Jeff:%d:%s\n\n",i+1,pArray->ElementAt(i+1));//Jeff Printf;
  6672. StrRect = load.m_rcarray.ElementAt(i + 2);
  6673. StrRect.top += dty;
  6674. StrRect.bottom += dty;
  6675. StrRect.bottom += dtytemp;
  6676. m_Print.DrawRect2(StrRect, 1);
  6677. StrRect.left += 2;
  6678. // 打印开单人字段内容
  6679. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6680. //printf("Jeff:%d:%s\n\n",i+2,pArray->ElementAt(i+2));//Jeff Printf;
  6681. dty += dtytemp;
  6682. }
  6683. //.打印->付款情况 应付 实付 欠款.
  6684. i = 22;
  6685. StrRect = load.m_rcarray.ElementAt(i);
  6686. StrRect.top += dty;
  6687. StrRect.bottom += dty;
  6688. m_Print.DrawRect2(StrRect, 1);
  6689. StrRect.left += 2;
  6690. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6691. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  6692. //.打印->合计人民币(大写):.......
  6693. i = 23;
  6694. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  6695. m_Print.DrawRect2(StrRect, 1);
  6696. StrRect.left += 2;
  6697. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6698. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  6699. #ifdef LYFZ_VERSION
  6700. m_Print.SetFontFace(7, 1, "宋体");
  6701. for (i = 24; i < 25; i++)
  6702. {
  6703. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  6704. StrRect.left +=2;
  6705. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6706. }
  6707. #else
  6708. m_Print.SetFontFace(7, 1, "宋体");
  6709. for (i = 24; i < 27; i++)
  6710. {
  6711. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  6712. StrRect.left += 2;
  6713. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6714. }
  6715. #endif
  6716. StrRect = load.m_rcarray.ElementAt(24); StrRect.top += dty; StrRect.bottom += dty;
  6717. hei = StrRect.Height();
  6718. StrRect.top += hei;
  6719. StrRect.bottom += hei;
  6720. StrRect.right += 100;
  6721. StrRect.left += 2;
  6722. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  6723. AutoDraw(m_Print, StrRect, pArray->ElementAt(27), 1.0);
  6724. }
  6725. PrintPreview dlg;
  6726. dlg.m_mode = 3;
  6727. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6728. dlg.m_pDC = m_Print.GetPDC();
  6729. if (aa == 0)
  6730. {
  6731. if (dlg.DoModal() != IDOK)
  6732. return;
  6733. printcot = dlg.m_num;
  6734. }
  6735. //结束打印
  6736. m_Print.EndPage();
  6737. m_Print.EndPrint();
  6738. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  6739. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  6740. CString sql;
  6741. sql.Format("update version set [serialno]='%s'", SerialNo);
  6742. g_sendhead.bsql = 1;
  6743. g_nYearposTemp = g_nYearpos;
  6744. g_nYearpos = -1;
  6745. g_pMainWnd->ProcessChatMessageRequest2(sql);
  6746. g_nYearpos = g_nYearposTemp;
  6747. #endif
  6748. }
  6749. }
  6750. void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  6751. {
  6752. //AfxMessageBox("abce");
  6753. int printcot = 1;
  6754. for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
  6755. {
  6756. g_sendhead.bsql = 0;
  6757. g_sendhead.code[0] = 24;
  6758. g_sendhead.tabcount = 1;
  6759. int g_nYearposTemp = g_nYearpos;
  6760. g_nYearpos = -1;
  6761. g_pMainWnd->ProcessChatMessageRequest2(1);
  6762. g_nYearpos = g_nYearposTemp;
  6763. if (0 == g_bSendOK)return;
  6764. DataToArray(&g_cominfoarray);
  6765. CString SerialNo;
  6766. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  6767. #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  6768. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  6769. CString sql;
  6770. sql.Format("update version set [serialno]='%s'", SerialNo);
  6771. g_sendhead.bsql=1;
  6772. g_nYearposTemp=g_nYearpos;
  6773. g_nYearpos=-1;
  6774. g_pMainWnd->ProcessChatMessageRequest2(sql);
  6775. g_nYearpos=g_nYearposTemp;
  6776. #endif
  6777. // 1.创建打印对象
  6778. CPrintRX m_Print;
  6779. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6780. {
  6781. m_Print.InitToPrint(NULL, 1);
  6782. }
  6783. else
  6784. {
  6785. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  6786. if (name.IsEmpty())
  6787. m_Print.InitToPrint(NULL, 1);
  6788. else
  6789. {
  6790. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6791. if (nret == -1 && aa == 0)
  6792. {
  6793. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  6794. m_Print.InitToPrint(NULL, 1);
  6795. }
  6796. }
  6797. }
  6798. // 2.开始打印
  6799. m_Print.StartPrint();
  6800. m_Print.StartPage();
  6801. LoadRect load;
  6802. BOOL bSmall = 0;
  6803. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  6804. {
  6805. bSmall = 1;
  6806. load.SetLiaPath("20.lia");
  6807. }
  6808. else
  6809. load.SetLiaPath("10.lia");
  6810. if (bSmall)
  6811. load.SetMargins(0, 0);
  6812. else
  6813. load.SetMargins(10, 0);
  6814. if (!load.Load())return;
  6815. int rcpos = -1;
  6816. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  6817. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  6818. {
  6819. Image *pImg = NULL;
  6820. g_nSendCode = 31;
  6821. int g_nYearposTemp = g_nYearpos;
  6822. g_nYearpos = -1;
  6823. g_pMainWnd->ProcessChatMessageRequest2(1);
  6824. g_nYearpos = g_nYearposTemp;
  6825. g_nSendCode = 0;
  6826. if (g_bSendOK == 0)return;
  6827. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  6828. if (pImg)
  6829. {
  6830. StrRect.left = 65;
  6831. if (bSmall) StrRect.left = 55;
  6832. StrRect.top = 10;
  6833. StrRect.right = StrRect.left + 58;
  6834. StrRect.bottom = StrRect.top + 58;
  6835. // 3.打印2维码图像;
  6836. m_Print.DrawImage(pImg, StrRect);
  6837. delete pImg;
  6838. pImg = NULL;
  6839. }
  6840. }
  6841. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  6842. if (bSmall)
  6843. {
  6844. m_Print.SetFontFace(18, 1, "黑体");
  6845. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6846. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6847. m_Print.SetFontFace(9, 1, "宋体");
  6848. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6849. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6850. m_Print.SetFontFace(6, 1, "宋体");
  6851. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6852. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6853. m_Print.SetFontFace(9, 1, "宋体");
  6854. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6855. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6856. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6857. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6858. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6859. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6860. int hei = StrRect.Height();
  6861. StrRect.bottom = StrRect.top;
  6862. StrRect.top -= 8;
  6863. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6864. m_Print.SetFontFace(11, 1, "宋体");
  6865. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6866. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6867. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6868. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6869. m_Print.SetFontFace(8, 1, "宋体");
  6870. int i = 0 ;
  6871. for ( i = 7; i < 24; i++)
  6872. {
  6873. StrRect = load.m_rcarray.ElementAt(i);
  6874. m_Print.DrawRect2(StrRect, 1);
  6875. }
  6876. for (i = 9; i < 24; i++)
  6877. {
  6878. StrRect = load.m_rcarray.ElementAt(i);
  6879. StrRect.left += 2;
  6880. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6881. }
  6882. m_Print.SetFontFace(6, 1, "宋体");
  6883. for (i = 24; i < 26; i++)
  6884. {
  6885. StrRect = load.m_rcarray.ElementAt(i);
  6886. StrRect.left += 2;
  6887. if (i == 24)
  6888. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6889. else
  6890. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6891. }
  6892. // StrRect=load.m_rcarray .ElementAt (27);
  6893. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6894. }
  6895. else//大单
  6896. {
  6897. // 1.打印表头(蒙娜丽莎收款单)
  6898. m_Print.SetFontFace(20, 1, "黑体");
  6899. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6900. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6901. m_Print.SetFontFace(11, 1, "宋体");
  6902. // 2.打印订单号(NO.20140608-001)
  6903. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6904. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6905. // 3.打印SerialNo(SerialNo.01062)
  6906. int hei = StrRect.Height();
  6907. StrRect.bottom = StrRect.top;
  6908. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6909. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6910. // 4.打印影楼地址信息、电话;
  6911. m_Print.SetFontFace(8, 1, "宋体");
  6912. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6913. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6914. #ifdef LYFZ_VERSION
  6915. m_Print.SetFontFace(9, 1, "宋体");
  6916. #else
  6917. m_Print.SetFontFace(11, 1, "宋体");
  6918. #endif
  6919. // 5.打印客户姓名
  6920. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6921. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6922. // 6.打印客户联系电话
  6923. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6924. #ifdef LYFZ_VERSION
  6925. StrRect.left += 30;
  6926. StrRect.right += 30;
  6927. #endif
  6928. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6929. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6930. // 7.打印开单日期
  6931. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6932. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6933. #if 0 // Original Edition
  6934. // 8.打印列字段:收款项目
  6935. m_Print.SetFontFace(13, 1, "宋体");
  6936. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6937. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6938. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6939. // 9.打印列字段:金额
  6940. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6941. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6942. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6943. // 10.打印列字段:开单人
  6944. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6945. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6946. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6947. #else
  6948. // 8.打印列字段:收款项目
  6949. m_Print.SetFontFace(13, 1, "宋体");
  6950. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6951. StrRect = CRect(66, 85, 280, 105);
  6952. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6953. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  6954. // 8.1 Jeff add:支付方式
  6955. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6956. StrRect = CRect(280, 85, 350, 105);
  6957. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6958. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  6959. // 9.打印列字段:金额
  6960. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6961. StrRect = CRect(350, 85, 442, 105);
  6962. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6963. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  6964. // 10.打印列字段:开单人
  6965. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6966. StrRect = CRect(442, 85, 535, 105);
  6967. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6968. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  6969. //rcpos += 3;
  6970. #endif
  6971. // 11.画表格-画3列;old
  6972. // 11.draw 4 column
  6973. m_Print.SetFontFace(11, 1, "宋体");
  6974. int i;
  6975. //for( i=7; i<10; i++)
  6976. //{
  6977. // StrRect=load.m_rcarray.ElementAt(i);
  6978. // m_Print.DrawRect2(StrRect, 1);
  6979. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6980. //}
  6981. m_Print.DrawRect2(CRect(66, 85, 280, 105), 1);
  6982. m_Print.DrawRect2(CRect(280, 85, 350, 105), 1);
  6983. m_Print.DrawRect2(CRect(350, 85, 442, 105), 1);
  6984. m_Print.DrawRect2(CRect(442, 85, 535, 105), 1);
  6985. // 12.打印详细内容
  6986. int dty = 0;
  6987. int dtytemp = 0;
  6988. // for( i=10; i<14; i+=3)
  6989. //for( i=10; i<22; i+=3) // 循环4次,再画
  6990. int j = 0;
  6991. for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
  6992. {
  6993. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  6994. CArray<CRect, CRect>rcarray;
  6995. CStringArray strarray2;
  6996. StrRect = load.m_rcarray.ElementAt(i);
  6997. StrRect.top += dty;
  6998. StrRect.bottom += dty;
  6999. StrRect.right -= 70; // Jeff add
  7000. //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;
  7001. /*
  7002. 4次的CRect
  7003. 66,105,350,125
  7004. 66,126,350,146
  7005. 66,147,350,167
  7006. 66,168,350,188
  7007. */
  7008. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  7009. {
  7010. StrRect = load.m_rcarray.ElementAt(i - 1);
  7011. StrRect.top += dty;
  7012. StrRect.bottom += dty;
  7013. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  7014. break;
  7015. }
  7016. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7017. StrRect.left += 2;
  7018. StrRect.right -= 2;
  7019. StrRect.top += 4;
  7020. rcarray.Add(StrRect);
  7021. //strarray2.Add(pArray->ElementAt(i+1));
  7022. strarray2.Add(pArray->ElementAt(j));
  7023. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7024. // 指定格子宽度,计算字符串占几行(高度).
  7025. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7026. dtytemp = bottom - StrRect.bottom;
  7027. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7028. // 重新获取表格大小,并画出表格;
  7029. /*
  7030. CRect(66,85,280,105),
  7031. CRect(280,85,350,105)
  7032. CRect(350,85,442,105)
  7033. CRect(442,85,535,105)
  7034. CRect(66,105,350,125),
  7035. CRect(66,126,350,146)
  7036. CRect(66,147,350,167)
  7037. CRect(66,168,350,188)
  7038. */
  7039. // 画收款项目框及打印内容;
  7040. StrRect = load.m_rcarray.ElementAt(i);
  7041. //StrRect=CRect(66,85,280,105);
  7042. StrRect.bottom += dtytemp;
  7043. StrRect.top += dty;
  7044. StrRect.bottom += dty;
  7045. //StrRect.left -= 70; // Jeff add
  7046. StrRect.right -= 70; // Jeff add
  7047. //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;
  7048. m_Print.DrawRect2(StrRect, 1);
  7049. // 画支付方式框及打印内容;
  7050. StrRect = load.m_rcarray.ElementAt(i);
  7051. //StrRect=CRect(280,85,350,105);
  7052. StrRect.bottom += dtytemp;
  7053. StrRect.top += dty;
  7054. StrRect.bottom += dty;
  7055. StrRect.left += StrRect.Width() - 70;
  7056. //StrRect.right += 70; // Jeff add
  7057. //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;
  7058. m_Print.DrawRect2(StrRect, 1);
  7059. StrRect.left += 2;
  7060. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7061. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7062. // 画金额框及打印内容;
  7063. StrRect = load.m_rcarray.ElementAt(i + 1);
  7064. //StrRect=CRect(350,85,442,105);
  7065. StrRect.top += dty;
  7066. StrRect.bottom += dty;
  7067. StrRect.bottom += dtytemp;
  7068. //StrRect.right -= 70; // Jeff add
  7069. //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;
  7070. m_Print.DrawRect2(StrRect, 1);
  7071. StrRect.left += 2;
  7072. // 打印出金额字段内容
  7073. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7074. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7075. // 画开单人框及打印内容;
  7076. StrRect = load.m_rcarray.ElementAt(i + 2);
  7077. //StrRect=CRect(442,85,535,105);
  7078. StrRect.top += dty;
  7079. StrRect.bottom += dty;
  7080. StrRect.bottom += dtytemp;
  7081. //StrRect.right -= 70; // Jeff add
  7082. //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;
  7083. m_Print.DrawRect2(StrRect, 1);
  7084. StrRect.left += 2;
  7085. // 打印开单人字段内容
  7086. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7087. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7088. dty += dtytemp;
  7089. }
  7090. //.打印->付款情况 应付 实付 欠款.
  7091. i = 22;
  7092. j = 27;
  7093. StrRect = load.m_rcarray.ElementAt(i);
  7094. StrRect.top += dty;
  7095. StrRect.bottom += dty;
  7096. m_Print.DrawRect2(StrRect, 1);
  7097. StrRect.left += 2;
  7098. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7099. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7100. //.打印->合计人民币(大写):.......
  7101. i = 23;
  7102. j = 28;
  7103. StrRect = load.m_rcarray.ElementAt(i);
  7104. StrRect.top += dty;
  7105. StrRect.bottom += dty;
  7106. m_Print.DrawRect2(StrRect, 1);
  7107. StrRect.left += 2;
  7108. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7109. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7110. // 打印总金额;
  7111. #ifdef LYFZ_VERSION
  7112. m_Print.SetFontFace(7, 1, "宋体");
  7113. for (i = 24; i < 25; i++)
  7114. {
  7115. StrRect = load.m_rcarray.ElementAt(i);
  7116. StrRect.top +=dty;
  7117. StrRect.bottom +=dty;
  7118. StrRect.left +=2;
  7119. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7120. }
  7121. #else
  7122. m_Print.SetFontFace(7, 1, "宋体");
  7123. for (i = 24, j = 29; i < 27; i++, j++)
  7124. {
  7125. StrRect = load.m_rcarray.ElementAt(i);
  7126. StrRect.top += dty;
  7127. StrRect.bottom += dty;
  7128. StrRect.left += 2;
  7129. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7130. }
  7131. #endif
  7132. StrRect = load.m_rcarray.ElementAt(24);
  7133. StrRect.top += dty;
  7134. StrRect.bottom += dty;
  7135. hei = StrRect.Height();
  7136. StrRect.top += hei;
  7137. StrRect.bottom += hei;
  7138. StrRect.right += 100;
  7139. StrRect.left += 2;
  7140. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  7141. AutoDraw(m_Print, StrRect, pArray->ElementAt(32), 1.0);
  7142. }
  7143. PrintPreview dlg;
  7144. dlg.m_mode = 3;
  7145. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  7146. dlg.m_pDC = m_Print.GetPDC();
  7147. if (aa == 0)
  7148. {
  7149. if (dlg.DoModal() != IDOK)
  7150. {
  7151. return;
  7152. }
  7153. printcot = dlg.m_num;
  7154. }
  7155. //结束打印
  7156. m_Print.EndPage();
  7157. m_Print.EndPrint();
  7158. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7159. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7160. CString sql;
  7161. sql.Format("update version set [serialno]='%s'", SerialNo);
  7162. g_sendhead.bsql = 1;
  7163. g_nYearposTemp = g_nYearpos;
  7164. g_nYearpos = -1;
  7165. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7166. g_nYearpos = g_nYearposTemp;
  7167. #endif
  7168. }
  7169. }
  7170. void CMainFrame::PrintReceipt_02(CStringArray *pArray, CPrintRX *pPrinter, const int &nCount, const BOOL bPrintImmediately) // 打印订单*预约收款、预约补款*
  7171. {
  7172. //AfxMessageBox("abce");
  7173. int printcot = 1;
  7174. // for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7175. // {
  7176. g_sendhead.bsql = 0;
  7177. g_sendhead.code[0] = 24;
  7178. g_sendhead.tabcount = 1;
  7179. int g_nYearposTemp = g_nYearpos;
  7180. g_nYearpos = -1;
  7181. g_pMainWnd->ProcessChatMessageRequest2(1);
  7182. g_nYearpos = g_nYearposTemp;
  7183. if (0 == g_bSendOK)return;
  7184. DataToArray(&g_cominfoarray);
  7185. CString SerialNo;
  7186. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7187. CPrintRX *tagPrinter = NULL;
  7188. if (pPrinter == NULL)
  7189. {
  7190. // 1.创建打印对象
  7191. tagPrinter = new CPrintRX;
  7192. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7193. {
  7194. tagPrinter->InitToPrint(NULL, 1);
  7195. }
  7196. else
  7197. {
  7198. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7199. if (name.IsEmpty())
  7200. {
  7201. tagPrinter->InitToPrint(NULL, 1);
  7202. }
  7203. else
  7204. {
  7205. int nret = tagPrinter->InitToPrint((char*)(LPCTSTR)name, 1);
  7206. ///if(nret==-1 && aa==0)
  7207. if (nret == -1)
  7208. {
  7209. if (bPrintImmediately == FALSE)
  7210. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  7211. tagPrinter->InitToPrint(NULL, 1);
  7212. }
  7213. }
  7214. }
  7215. // 2.开始打印
  7216. tagPrinter->StartPrint();
  7217. tagPrinter->StartPage();
  7218. }
  7219. else
  7220. {
  7221. //SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7222. tagPrinter = pPrinter;
  7223. }
  7224. LoadRect load;
  7225. BOOL bSmall = 0;
  7226. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7227. {
  7228. bSmall = 1;
  7229. load.SetLiaPath("20.lia");
  7230. }
  7231. else
  7232. load.SetLiaPath("10.lia");
  7233. if (bSmall)
  7234. load.SetMargins(0, 0);
  7235. else
  7236. load.SetMargins(10, 0);
  7237. if (!load.Load())return;
  7238. int rcpos = -1;
  7239. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7240. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7241. {
  7242. Image *pImg = NULL;
  7243. g_nSendCode = 31;
  7244. int g_nYearposTemp = g_nYearpos;
  7245. g_nYearpos = -1;
  7246. g_pMainWnd->ProcessChatMessageRequest2(1);
  7247. g_nYearpos = g_nYearposTemp;
  7248. g_nSendCode = 0;
  7249. if (g_bSendOK == 0)return;
  7250. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7251. if (pImg)
  7252. {
  7253. StrRect.left = 65;
  7254. if (bSmall) StrRect.left = 55;
  7255. StrRect.top = 10;
  7256. StrRect.right = StrRect.left + 58;
  7257. StrRect.bottom = StrRect.top + 58;
  7258. // 3.打印2维码图像;
  7259. tagPrinter->DrawImage(pImg, StrRect);
  7260. delete pImg;
  7261. pImg = NULL;
  7262. }
  7263. }
  7264. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7265. if (bSmall)
  7266. {
  7267. tagPrinter->SetFontFace(18, 1, "黑体");
  7268. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7269. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7270. tagPrinter->SetFontFace(9, 1, "宋体");
  7271. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7272. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7273. tagPrinter->SetFontFace(6, 1, "宋体");
  7274. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7275. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7276. tagPrinter->SetFontFace(9, 1, "宋体");
  7277. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7278. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7279. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7280. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7281. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7282. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7283. int hei = StrRect.Height();
  7284. StrRect.bottom = StrRect.top;
  7285. StrRect.top -= 8;
  7286. tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7287. tagPrinter->SetFontFace(11, 1, "宋体");
  7288. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7289. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7290. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7291. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7292. tagPrinter->SetFontFace(8, 1, "宋体");
  7293. int i = 0;
  7294. for ( i = 7; i < 24; i++)
  7295. {
  7296. StrRect = load.m_rcarray.ElementAt(i);
  7297. tagPrinter->DrawRect2(StrRect, 1);
  7298. }
  7299. for (i = 9; i < 24; i++)
  7300. {
  7301. StrRect = load.m_rcarray.ElementAt(i);
  7302. StrRect.left += 2;
  7303. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7304. }
  7305. tagPrinter->SetFontFace(6, 1, "宋体");
  7306. for (i = 24; i < 26; i++)
  7307. {
  7308. StrRect = load.m_rcarray.ElementAt(i);
  7309. StrRect.left += 2;
  7310. if (i == 24)
  7311. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7312. else
  7313. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7314. }
  7315. // StrRect=load.m_rcarray .ElementAt (27);
  7316. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7317. }
  7318. else//大单
  7319. {
  7320. // 1.打印表头(蒙娜丽莎收款单)
  7321. tagPrinter->SetFontFace(20, 1, "黑体");
  7322. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7323. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7324. tagPrinter->SetFontFace(11, 1, "宋体");
  7325. // 2.打印订单号(NO.20140608-001)
  7326. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7327. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7328. // 3.打印SerialNo(SerialNo.01062)
  7329. int hei = StrRect.Height();
  7330. StrRect.bottom = StrRect.top;
  7331. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7332. tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7333. // 4.打印影楼地址信息、电话;
  7334. tagPrinter->SetFontFace(8, 1, "宋体");
  7335. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7336. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7337. #ifdef LYFZ_VERSION
  7338. tagPrinter->SetFontFace(9, 1, "宋体");
  7339. #else
  7340. tagPrinter->SetFontFace(11, 1, "宋体");
  7341. #endif
  7342. // 5.打印客户姓名
  7343. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7344. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7345. // 6.打印客户联系电话
  7346. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7347. #ifdef LYFZ_VERSION
  7348. StrRect.left += 30;
  7349. StrRect.right += 30;
  7350. #endif
  7351. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7352. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7353. // 7.打印开单日期
  7354. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7355. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7356. #if 0 // Original Edition
  7357. // 8.打印列字段:收款项目
  7358. tagPrinter->SetFontFace(13, 1, "宋体");
  7359. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7360. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7361. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7362. // 9.打印列字段:金额
  7363. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7364. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7365. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7366. // 10.打印列字段:开单人
  7367. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7368. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7369. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7370. #else
  7371. // 8.打印列字段:收款项目
  7372. tagPrinter->SetFontFace(13, 1, "宋体");
  7373. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7374. StrRect = CRect(66, 85, 280, 105);
  7375. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7376. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7377. // 8.1 Jeff add:支付方式
  7378. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7379. StrRect = CRect(280, 85, 350, 105);
  7380. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7381. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7382. // 9.打印列字段:金额
  7383. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7384. StrRect = CRect(350, 85, 442, 105);
  7385. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7386. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7387. // 10.打印列字段:开单人
  7388. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7389. StrRect = CRect(442, 85, 535, 105);
  7390. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7391. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7392. //rcpos += 3;
  7393. #endif
  7394. // 11.画表格-画3列;old
  7395. // 11.draw 4 column
  7396. tagPrinter->SetFontFace(11, 1, "宋体");
  7397. int i;
  7398. //for( i=7; i<10; i++)
  7399. //{
  7400. // StrRect=load.m_rcarray.ElementAt(i);
  7401. // m_Print.DrawRect2(StrRect, 1);
  7402. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7403. //}
  7404. tagPrinter->DrawRect2(CRect(66, 85, 280, 105), 1);
  7405. tagPrinter->DrawRect2(CRect(280, 85, 350, 105), 1);
  7406. tagPrinter->DrawRect2(CRect(350, 85, 442, 105), 1);
  7407. tagPrinter->DrawRect2(CRect(442, 85, 535, 105), 1);
  7408. // 12.打印详细内容
  7409. int dty = 0;
  7410. int dtytemp = 0;
  7411. // for( i=10; i<14; i+=3)
  7412. //for( i=10; i<22; i+=3) // 循环4次,再画
  7413. int j = 0;
  7414. for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
  7415. {
  7416. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7417. CArray<CRect, CRect>rcarray;
  7418. CStringArray strarray2;
  7419. StrRect = load.m_rcarray.ElementAt(i);
  7420. StrRect.top += dty;
  7421. StrRect.bottom += dty;
  7422. StrRect.right -= 70; // Jeff add
  7423. //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;
  7424. /*
  7425. 4次的CRect
  7426. 66,105,350,125
  7427. 66,126,350,146
  7428. 66,147,350,167
  7429. 66,168,350,188
  7430. */
  7431. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  7432. {
  7433. StrRect = load.m_rcarray.ElementAt(i - 1);
  7434. StrRect.top += dty;
  7435. StrRect.bottom += dty;
  7436. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  7437. break;
  7438. }
  7439. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7440. StrRect.left += 2;
  7441. StrRect.right -= 2;
  7442. StrRect.top += 4;
  7443. rcarray.Add(StrRect);
  7444. //strarray2.Add(pArray->ElementAt(i+1));
  7445. strarray2.Add(pArray->ElementAt(j));
  7446. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7447. // 指定格子宽度,计算字符串占几行(高度).
  7448. int bottom = CalHeight(&rcarray, &strarray2, tagPrinter, FORMAT_LEFT);
  7449. dtytemp = bottom - StrRect.bottom;
  7450. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7451. // 重新获取表格大小,并画出表格;
  7452. /*
  7453. CRect(66,85,280,105),
  7454. CRect(280,85,350,105)
  7455. CRect(350,85,442,105)
  7456. CRect(442,85,535,105)
  7457. CRect(66,105,350,125),
  7458. CRect(66,126,350,146)
  7459. CRect(66,147,350,167)
  7460. CRect(66,168,350,188)
  7461. */
  7462. // 画收款项目框及打印内容;
  7463. StrRect = load.m_rcarray.ElementAt(i);
  7464. //StrRect=CRect(66,85,280,105);
  7465. StrRect.bottom += dtytemp;
  7466. StrRect.top += dty;
  7467. StrRect.bottom += dty;
  7468. //StrRect.left -= 70; // Jeff add
  7469. StrRect.right -= 70; // Jeff add
  7470. //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;
  7471. tagPrinter->DrawRect2(StrRect, 1);
  7472. // 画支付方式框及打印内容;
  7473. StrRect = load.m_rcarray.ElementAt(i);
  7474. //StrRect=CRect(280,85,350,105);
  7475. StrRect.bottom += dtytemp;
  7476. StrRect.top += dty;
  7477. StrRect.bottom += dty;
  7478. StrRect.left += StrRect.Width() - 70;
  7479. //StrRect.right += 70; // Jeff add
  7480. //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;
  7481. tagPrinter->DrawRect2(StrRect, 1);
  7482. StrRect.left += 2;
  7483. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7484. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7485. // 画金额框及打印内容;
  7486. StrRect = load.m_rcarray.ElementAt(i + 1);
  7487. //StrRect=CRect(350,85,442,105);
  7488. StrRect.top += dty;
  7489. StrRect.bottom += dty;
  7490. StrRect.bottom += dtytemp;
  7491. //StrRect.right -= 70; // Jeff add
  7492. //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;
  7493. tagPrinter->DrawRect2(StrRect, 1);
  7494. StrRect.left += 2;
  7495. // 打印出金额字段内容
  7496. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7497. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7498. // 画开单人框及打印内容;
  7499. StrRect = load.m_rcarray.ElementAt(i + 2);
  7500. //StrRect=CRect(442,85,535,105);
  7501. StrRect.top += dty;
  7502. StrRect.bottom += dty;
  7503. StrRect.bottom += dtytemp;
  7504. //StrRect.right -= 70; // Jeff add
  7505. //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;
  7506. tagPrinter->DrawRect2(StrRect, 1);
  7507. StrRect.left += 2;
  7508. // 打印开单人字段内容
  7509. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7510. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7511. dty += dtytemp;
  7512. }
  7513. //.打印->付款情况 应付 实付 欠款.
  7514. i = 22;
  7515. j = 27;
  7516. StrRect = load.m_rcarray.ElementAt(i);
  7517. StrRect.top += dty;
  7518. StrRect.bottom += dty;
  7519. tagPrinter->DrawRect2(StrRect, 1);
  7520. StrRect.left += 2;
  7521. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7522. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7523. //.打印->合计人民币(大写):.......
  7524. i = 23;
  7525. j = 28;
  7526. StrRect = load.m_rcarray.ElementAt(i);
  7527. StrRect.top += dty;
  7528. StrRect.bottom += dty;
  7529. tagPrinter->DrawRect2(StrRect, 1);
  7530. StrRect.left += 2;
  7531. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7532. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7533. // 打印总金额;
  7534. #ifdef LYFZ_VERSION
  7535. tagPrinter->SetFontFace(7, 1, "宋体");
  7536. for (i = 24; i < 25; i++)
  7537. {
  7538. StrRect = load.m_rcarray.ElementAt(i);
  7539. StrRect.top +=dty;
  7540. StrRect.bottom +=dty;
  7541. StrRect.left +=2;
  7542. tagPrinter->DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7543. }
  7544. #else
  7545. tagPrinter->SetFontFace(7, 1, "宋体");
  7546. for (i = 24, j = 29; i < 27; i++, j++)
  7547. {
  7548. StrRect = load.m_rcarray.ElementAt(i);
  7549. StrRect.top += dty;
  7550. StrRect.bottom += dty;
  7551. StrRect.left += 2;
  7552. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7553. }
  7554. #endif
  7555. StrRect = load.m_rcarray.ElementAt(24);
  7556. StrRect.top += dty;
  7557. StrRect.bottom += dty;
  7558. hei = StrRect.Height();
  7559. StrRect.top += hei;
  7560. StrRect.bottom += hei;
  7561. StrRect.right += 100;
  7562. StrRect.left += 2;
  7563. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  7564. AutoDraw(*tagPrinter, StrRect, pArray->ElementAt(32), 1.0);
  7565. }
  7566. if (bPrintImmediately == TRUE)
  7567. {
  7568. printcot = nCount;
  7569. ////结束打印
  7570. tagPrinter->EndPage();
  7571. tagPrinter->EndPrint();
  7572. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7573. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7574. CString sql;
  7575. sql.Format("update version set [serialno]='%s'", SerialNo);
  7576. g_sendhead.bsql = 1;
  7577. g_nYearposTemp = g_nYearpos;
  7578. g_nYearpos = -1;
  7579. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7580. g_nYearpos = g_nYearposTemp;
  7581. #endif
  7582. }
  7583. else
  7584. {
  7585. PrintPreview dlg;
  7586. dlg.m_mode = 3;
  7587. tagPrinter->GetWidHei(dlg.m_w, dlg.m_h);
  7588. dlg.m_pDC = tagPrinter->GetPDC();
  7589. //if(aa==0)
  7590. //{
  7591. if (dlg.DoModal() != IDOK)
  7592. {
  7593. return;
  7594. }
  7595. else
  7596. {
  7597. printcot = dlg.m_num;
  7598. //m_Print.deletePrinter();
  7599. for (int i = 0; i < printcot; i++)
  7600. {
  7601. //tagPrinter->EndPage();
  7602. //tagPrinter->m_DC.AbortDoc(); // 结束清空由StartDoc写入的内容;2014-09-15;
  7603. //tagPrinter->m_DC.EndDoc();
  7604. //Sleep(10000);
  7605. //tagPrinter->StartPrint();
  7606. //tagPrinter->NewPage();
  7607. //PrintReceipt_02(pArray,/*tagPrinter*/NULL,printcot,TRUE);
  7608. PrintReceipt_02(pArray, tagPrinter, printcot, TRUE);
  7609. }
  7610. }
  7611. if (tagPrinter) delete tagPrinter;
  7612. //}
  7613. }
  7614. //}
  7615. }
  7616. void CMainFrame::PrintFlowChart(CString strOrderNumber) // 选片打单;
  7617. {
  7618. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
  7619. {
  7620. // Jeff 使用风格2打印;
  7621. PrintFlowChart3(strOrderNumber);
  7622. return;
  7623. }
  7624. #ifdef ZHIAI_VERSION
  7625. PrintFlowChart2(strOrderNumber);
  7626. return;
  7627. #endif
  7628. int printcot = 1;
  7629. for (int aa = 0; aa < printcot; aa++)
  7630. {
  7631. CPrintRX m_Print;
  7632. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7633. {
  7634. m_Print.InitToPrint(NULL, 1);
  7635. }
  7636. else
  7637. {
  7638. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  7639. if (name.IsEmpty())
  7640. m_Print.InitToPrint(NULL, 1);
  7641. else
  7642. {
  7643. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7644. if (nret == -1 && aa == 0)
  7645. {
  7646. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7647. }
  7648. }
  7649. }
  7650. m_Print.StartPrint();
  7651. m_Print.StartPage();
  7652. // CRect StrRect(0,0,560,818);
  7653. LoadRect load;
  7654. load.SetLiaPath("4.lia");
  7655. load.SetMargins(-14, -14);
  7656. if (!load.Load())return;
  7657. LoadRect load2;
  7658. load2.SetMargins(-14, 472 + 27 - 14);
  7659. load2.SetLiaPath("5.lia");
  7660. if (!load2.Load())return;
  7661. //////////////////////////////////////////////////////////////
  7662. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2'";
  7663. g_sendhead.code[0] = 54;
  7664. g_sendhead.code[1] = 223;
  7665. g_sendhead.tabcount = 2;
  7666. g_sendhead.bsql = 0;
  7667. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  7668. CArray<CStringArray, CStringArray>sparray;
  7669. DataToArray(&g_List1array, &sparray);
  7670. CString spno;
  7671. int i = 0;
  7672. for ( i = 0; i < sparray.GetSize(); i++)
  7673. {
  7674. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  7675. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  7676. if (sparray.ElementAt(i).ElementAt(5) == "入册" && sparray.ElementAt(i).ElementAt(5) == "入底" && sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  7677. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  7678. spno += sparray.ElementAt(i).ElementAt(5);
  7679. if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7680. spno += "; ";
  7681. else
  7682. {
  7683. spno += ":";
  7684. spno += sparray.ElementAt(i).ElementAt(6);
  7685. spno += "; ";
  7686. }
  7687. }
  7688. spno += " 加挑:";
  7689. for (i = 0; i < sparray.GetSize(); i++)
  7690. {
  7691. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  7692. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  7693. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  7694. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  7695. spno += sparray.ElementAt(i).ElementAt(5);
  7696. if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7697. spno += "; ";
  7698. else
  7699. {
  7700. spno += ":";
  7701. spno += sparray.ElementAt(i).ElementAt(6);
  7702. spno += "; ";
  7703. }
  7704. }
  7705. if (spno.Right(6) == " 加挑:")
  7706. {
  7707. spno = spno.Left(spno.GetLength() - 6);
  7708. }
  7709. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  7710. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  7711. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  7712. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  7713. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  7714. if (m_urgent.IsEmpty())m_urgent = "否";
  7715. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  7716. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  7717. // CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  7718. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  7719. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  7720. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  7721. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  7722. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  7723. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  7724. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  7725. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  7726. CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(17) + g_List1array.ElementAt(0).ElementAt(29);
  7727. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  7728. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  7729. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  7730. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  7731. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  7732. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  7733. CString m_sum3;
  7734. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  7735. ::ConvertToPrice(m_sum3);
  7736. if (m_money3.IsEmpty())m_money3 = "0";
  7737. // m_money3=m_money3+"/"+m_sum3;
  7738. CString name;
  7739. if (!m_name1.IsEmpty())
  7740. name = m_name1 + ",";
  7741. name += m_name2;
  7742. name.TrimRight(",");
  7743. CString phone;
  7744. if (!m_phone1.IsEmpty())
  7745. phone = m_phone1 + ",";
  7746. phone += m_phone2; phone.TrimRight(",");
  7747. if (IsHasRights2new(31) == 0)
  7748. phone = "***";
  7749. CStringArray strarray;
  7750. strarray.Add(m_urgent);
  7751. strarray.Add(m_ren);
  7752. strarray.Add(m_waiter3);
  7753. strarray.Add(name);
  7754. strarray.Add(m_time2);
  7755. strarray.Add(m_time4);
  7756. strarray.Add(m_money3);
  7757. strarray.Add(m_sum3);
  7758. strarray.Add(m_takezs);
  7759. strarray.Add(m_taoxizs);
  7760. strarray.Add(m_choosezs);
  7761. strarray.Add(strOrderNumber);
  7762. strarray.Add(phone);
  7763. ////////////////////////////////////////////////////////////////
  7764. int rcpos = -1;
  7765. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7766. Image *pImg = NULL;
  7767. #ifdef MNLS_VERSION
  7768. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  7769. #else
  7770. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  7771. #endif
  7772. m_Print.DrawImage(pImg, StrRect);
  7773. delete pImg;
  7774. m_Print.SetFontFace(11, 1, "宋体");
  7775. StrRect = load2.m_rcarray.ElementAt(7);
  7776. StrRect.top = load2.m_rcarray.ElementAt(15).top - 15;
  7777. StrRect.bottom = load2.m_rcarray.ElementAt(15).bottom - 15;
  7778. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  7779. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7780. StrRect.top += 15;
  7781. StrRect.bottom += 15;
  7782. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  7783. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7784. m_Print.SetFontFace(15, 1, "宋体");
  7785. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7786. #ifdef MNLS_VERSION
  7787. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7788. #endif
  7789. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7790. #ifdef MNLS_VERSION
  7791. m_Print.DrawRect(StrRect);
  7792. #endif
  7793. m_Print.SetFontFace(7, 1, "黑体");
  7794. m_Print.SetColor(0xffffff);
  7795. #ifdef MNLS_VERSION
  7796. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7797. #endif
  7798. m_Print.SetColor(0);
  7799. m_Print.SetFontFace(25, 1, "黑体");
  7800. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7801. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7802. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  7803. {
  7804. Image *pImg = NULL;
  7805. g_nSendCode = 31;
  7806. int g_nYearposTemp = g_nYearpos;
  7807. g_nYearpos = -1;
  7808. g_pMainWnd->ProcessChatMessageRequest2(1);
  7809. g_nYearpos = g_nYearposTemp;
  7810. g_nSendCode = 0;
  7811. if (g_bSendOK == 0)return;
  7812. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7813. if (pImg)
  7814. {
  7815. StrRect.left = 450;
  7816. StrRect.top = 22;
  7817. StrRect.right = StrRect.left + 60;
  7818. StrRect.bottom = StrRect.top + 60;
  7819. m_Print.DrawImage(pImg, StrRect);
  7820. delete pImg; pImg = NULL;
  7821. }
  7822. }
  7823. #ifdef CHILD_VERSION
  7824. CString title[13] = { "是否加急:", "接单门市:", \
  7825. "选样人员:", "客人姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
  7826. "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:"
  7827. };
  7828. #else
  7829. CString title[13] = { "是否加急:", "接单门市:", \
  7830. "选样人员:", "新郎新娘姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
  7831. "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:" };
  7832. #endif
  7833. m_Print.SetFontFace(12, 1, "宋体");
  7834. for (i = 0; i < 13; i++)
  7835. {
  7836. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7837. if (i < 3)
  7838. m_Print.DrawRect2(StrRect, 0);
  7839. else
  7840. m_Print.DrawRect2(StrRect, 1);
  7841. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7842. }
  7843. for (i = 18; i <= 37; i++)
  7844. {
  7845. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7846. if (i >= 19 && i <= 21)
  7847. m_Print.DrawRect2(StrRect, 2);
  7848. /* else if(i==26)
  7849. {
  7850. CRect rc=StrRect;
  7851. CRect rc2=rc;
  7852. rc.right -=rc2.Width ()/2;
  7853. m_Print.DrawRect2(rc, 1);
  7854. rc2.left +=rc.Width ();
  7855. m_Print.DrawRect2(rc2, 1);
  7856. }*/
  7857. else
  7858. m_Print.DrawRect2(StrRect, 1);
  7859. if (i == 18)
  7860. {
  7861. StrRect.left += 5;
  7862. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7863. }
  7864. }
  7865. //////////////////////////////////////
  7866. rcpos = -1;
  7867. for (i = 0; i < 8; i++)
  7868. {
  7869. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  7870. m_Print.DrawRect2(StrRect, 1);
  7871. }
  7872. #ifdef CHILD_VERSION
  7873. CString title2[4] = { "引导师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
  7874. #else
  7875. CString title2[4] = { "化妆师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
  7876. #endif
  7877. for (i = 0; i < 4; i++)
  7878. {
  7879. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  7880. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7881. }
  7882. for (i = 0; i < 4; i++)
  7883. {
  7884. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  7885. m_Print.DrawRect2(StrRect, 2);
  7886. }
  7887. StrRect = load2.m_rcarray.ElementAt(11);
  7888. StrRect.top -= 15;
  7889. StrRect.bottom -= 15;
  7890. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客选片签名:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7891. StrRect = load2.m_rcarray.ElementAt(15);
  7892. StrRect.top -= 15;
  7893. StrRect.bottom -= 15;
  7894. m_Print.DrawRect2(StrRect, 2);
  7895. ///////////////////////////////////////////
  7896. for (i = 19; i <= 31; i++)
  7897. {
  7898. StrRect = load.m_rcarray.ElementAt(i - 1);
  7899. StrRect.left += 4;
  7900. if (i == 31)
  7901. {
  7902. if (m_phone1.IsEmpty() == 0 && m_phone2.IsEmpty() == 0)
  7903. {
  7904. StrRect.top += 2;
  7905. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  7906. StrRect.top += 8;
  7907. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7908. }
  7909. else
  7910. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7911. }
  7912. /* else if((i-19)==7)
  7913. {
  7914. CRect rc=StrRect;
  7915. CRect rc2=rc;
  7916. rc.right -=rc2.Width ()/2;
  7917. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7918. rc2.left +=rc.Width ()+3;
  7919. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7920. }*/
  7921. else
  7922. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7923. }
  7924. strarray.RemoveAll();
  7925. strarray.Add(m_waiter2);
  7926. strarray.Add(m_waiter1);
  7927. strarray.Add(m_waiter4);
  7928. for (i = 13; i <= 15; i++)
  7929. {
  7930. StrRect = load2.m_rcarray.ElementAt(i - 1);
  7931. StrRect.left += 4;
  7932. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7933. }
  7934. ///////////spno
  7935. CRect sprc[14];
  7936. for (i = 0; i < 14; i++)
  7937. {
  7938. if (i < 7)
  7939. {
  7940. if (i == 0)
  7941. {
  7942. StrRect = load.m_rcarray.ElementAt(17); StrRect.left += 94; StrRect.right -= 3;
  7943. }
  7944. else
  7945. {
  7946. StrRect = load.m_rcarray.ElementAt(30 + i); StrRect.left += 4; StrRect.right -= 3;
  7947. }
  7948. }
  7949. else
  7950. {
  7951. StrRect = load2.m_rcarray.ElementAt(i - 7); StrRect.left += 4; StrRect.right -= 3;
  7952. }
  7953. sprc[i] = StrRect;
  7954. }
  7955. CString temp, tempspno, tempbz;
  7956. CSize size;
  7957. BOOL bRun = 0;
  7958. int fontsize = 12;
  7959. ll: tempspno = spno;
  7960. tempbz = m_bz;
  7961. m_Print.SetFontFace(fontsize, 1, "宋体");
  7962. for (i = 0; i<14; i++)
  7963. {
  7964. if (!tempspno.IsEmpty())
  7965. {
  7966. temp = tempspno;
  7967. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  7968. int right = 0;
  7969. CRect temprc = sprc[i];
  7970. while (size.cx>temprc.Width())
  7971. {
  7972. right++;
  7973. temp = tempspno.Left(tempspno.GetLength() - (right));
  7974. if (GIsHalfHZ(temp))
  7975. {
  7976. right++;
  7977. temp.Delete(temp.GetLength() - 1);
  7978. }
  7979. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  7980. }
  7981. if (bRun)
  7982. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7983. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  7984. if (tempspno.IsEmpty())i++;
  7985. }
  7986. else if (!tempbz.IsEmpty())
  7987. {
  7988. temp = tempbz;
  7989. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  7990. int right = 0;
  7991. CRect temprc = sprc[i];
  7992. while (size.cx > temprc.Width())
  7993. {
  7994. right++;
  7995. temp = tempbz.Left(tempbz.GetLength() - (right));
  7996. if (GIsHalfHZ(temp))
  7997. {
  7998. right++;
  7999. temp.Delete(temp.GetLength() - 1);
  8000. }
  8001. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8002. }
  8003. if (bRun)
  8004. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8005. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
  8006. }
  8007. }
  8008. if (tempspno.IsEmpty() == 0 || tempbz.IsEmpty() == 0)
  8009. {
  8010. fontsize--;
  8011. goto ll;
  8012. }
  8013. if (bRun == 0)
  8014. {
  8015. bRun = 1;
  8016. goto ll;
  8017. }
  8018. PrintPreview dlg;
  8019. dlg.m_mode = 2;
  8020. dlg.m_name = name;
  8021. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  8022. dlg.m_pDC = m_Print.GetPDC();
  8023. if (aa == 0)
  8024. {
  8025. if (dlg.DoModal() != IDOK)
  8026. return;
  8027. printcot = dlg.m_num;
  8028. }
  8029. //结束打印
  8030. m_Print.EndPage();
  8031. m_Print.EndPrint();
  8032. }
  8033. }
  8034. void CMainFrame::PrintFlowChart3LKAY(CString strOrderNumber)
  8035. {
  8036. int printcot = 1;
  8037. for (int aa = 0; aa < printcot; aa++)
  8038. {
  8039. CPrintRX m_Print;
  8040. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8041. {
  8042. m_Print.InitToPrint(NULL, 1);
  8043. }
  8044. else
  8045. {
  8046. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  8047. if (name.IsEmpty())
  8048. m_Print.InitToPrint(NULL, 1);
  8049. else
  8050. {
  8051. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8052. if (nret == -1 && aa == 0)
  8053. {
  8054. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8055. }
  8056. }
  8057. }
  8058. m_Print.StartPrint();
  8059. m_Print.StartPage();
  8060. LoadRect load;
  8061. load.SetLiaPath("18.lia");
  8062. load.SetMargins(10, 0);
  8063. if (!load.Load())return;
  8064. CString str;
  8065. int rcpos = -1;
  8066. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8067. m_Print.SetFontFace(25, 1, "宋体");
  8068. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8069. m_Print.SetFontFace(15, 1, "宋体");
  8070. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8071. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8072. m_Print.SetFontFace(9, 1, "宋体");
  8073. //////////////////////////////////////////////////////////////
  8074. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  8075. g_sendhead.code[0] = 54;
  8076. g_sendhead.code[1] = 223;
  8077. g_sendhead.code[2] = 52;
  8078. g_sendhead.tabcount = 3;
  8079. g_sendhead.bsql = 0;
  8080. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  8081. CArray<CStringArray, CStringArray>sparray;
  8082. CArray<CStringArray, CStringArray>clientarray;
  8083. DataToArray(&g_List1array, &sparray, &clientarray);
  8084. CString spno;
  8085. CStringArray sparray2;
  8086. int i = 0;
  8087. for ( i = 0; i < sparray.GetSize(); i++)
  8088. {
  8089. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8090. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  8091. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8092. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8093. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8094. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  8095. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8096. sparray2.Add(sparray.ElementAt(i).ElementAt(9));
  8097. sparray2.Add(sparray.ElementAt(i).ElementAt(10));
  8098. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8099. }
  8100. for (i = 0; i < sparray.GetSize(); i++)
  8101. {
  8102. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  8103. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  8104. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  8105. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8106. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8107. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  8108. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8109. sparray2.Add(sparray.ElementAt(i).ElementAt(9));
  8110. sparray2.Add(sparray.ElementAt(i).ElementAt(10));
  8111. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8112. }
  8113. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  8114. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  8115. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  8116. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  8117. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  8118. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  8119. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  8120. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  8121. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  8122. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  8123. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  8124. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  8125. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  8126. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  8127. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  8128. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  8129. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  8130. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  8131. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  8132. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  8133. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  8134. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  8135. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  8136. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  8137. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  8138. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  8139. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  8140. CString m_sum3;
  8141. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  8142. ::ConvertToPrice(m_sum3);
  8143. if (m_money3.IsEmpty())m_money3 = "0";
  8144. int dty = 0;
  8145. CString name;
  8146. if (!m_name1.IsEmpty())
  8147. name = m_name1 + ",";
  8148. name += m_name2;
  8149. name.TrimRight(",");
  8150. CString phone;
  8151. if (!m_phone1.IsEmpty())
  8152. phone = m_phone1 + ",";
  8153. phone += m_phone2; phone.TrimRight(",");
  8154. if (IsHasRights2new(31) == 0)
  8155. phone = "***";
  8156. CStringArray strarray;
  8157. #ifdef CHILD_VERSION
  8158. if (m_birthday.IsEmpty())
  8159. strarray.Add("姓名/性别");
  8160. else
  8161. strarray.Add("姓名/性别/年龄");
  8162. #else
  8163. strarray.Add("客人姓名");
  8164. #endif
  8165. strarray.Add("电话");
  8166. strarray.Add("单号");
  8167. strarray.Add("套系");
  8168. strarray.Add("选样");
  8169. strarray.Add("余款/加挑");
  8170. strarray.Add("选片/日期");
  8171. #ifdef CHILD_VERSION
  8172. if (m_birthday.IsEmpty())
  8173. strarray.Add(name + "/" + m_sex);
  8174. else
  8175. {
  8176. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  8177. m_birthday.Format("%d", year + 1);
  8178. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  8179. }
  8180. #else
  8181. strarray.Add(name);
  8182. #endif
  8183. strarray.Add(phone);
  8184. strarray.Add(strOrderNumber);
  8185. strarray.Add(m_taoxiname);
  8186. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8187. strarray.Add(str);
  8188. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  8189. strarray.Add(str);
  8190. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  8191. for (i = 3; i <= 16; i++)
  8192. {
  8193. StrRect = load.m_rcarray.ElementAt(i - 1);
  8194. if (i < 10)
  8195. {
  8196. m_Print.DrawRect2(StrRect, 1);
  8197. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8198. }
  8199. }
  8200. StrRect = load.m_rcarray.ElementAt(29);
  8201. m_Print.DrawRect2(StrRect, 1);
  8202. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8203. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8204. {
  8205. Image *pImg = NULL;
  8206. g_nSendCode = 31;
  8207. int g_nYearposTemp = g_nYearpos;
  8208. g_nYearpos = -1;
  8209. g_pMainWnd->ProcessChatMessageRequest2(1);
  8210. g_nYearpos = g_nYearposTemp;
  8211. g_nSendCode = 0;
  8212. if (g_bSendOK == 0)return;
  8213. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8214. if (pImg)
  8215. {
  8216. StrRect.left = 485;
  8217. StrRect.top = 12;
  8218. StrRect.right = StrRect.left + 60;
  8219. StrRect.bottom = StrRect.top + 60;
  8220. m_Print.DrawImage(pImg, StrRect);
  8221. delete pImg; pImg = NULL;
  8222. }
  8223. }
  8224. CArray<CRect, CRect>rcarray;
  8225. CStringArray strarray2;
  8226. for (i = 10; i <= 16; i++)
  8227. {
  8228. StrRect = load.m_rcarray.ElementAt(i - 1);
  8229. StrRect.left += 2;
  8230. StrRect.right -= 2;
  8231. StrRect.top += 2;
  8232. rcarray.Add(StrRect);
  8233. strarray2.Add(strarray.ElementAt(7 + i - 10));
  8234. }
  8235. if (1)
  8236. {
  8237. StrRect = load.m_rcarray.ElementAt(30);
  8238. StrRect.left += 2;
  8239. StrRect.right -= 2;
  8240. StrRect.top += 2;
  8241. rcarray.Add(StrRect);
  8242. strarray2.Add(m_time6 + "/" + m_time5);
  8243. }
  8244. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8245. for (i = 10; i <= 16; i++)
  8246. {
  8247. StrRect = load.m_rcarray.ElementAt(i - 1);
  8248. if (i == 10)
  8249. {
  8250. dty += bottom - StrRect.bottom;
  8251. }
  8252. StrRect.bottom = bottom;
  8253. m_Print.DrawRect2(StrRect, 1);
  8254. }
  8255. if (1)
  8256. {
  8257. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  8258. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  8259. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  8260. }
  8261. m_Print.SetFontFace(15, 1, "宋体");
  8262. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  8263. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8264. m_Print.SetFontFace(9, 1, "宋体");
  8265. strarray.RemoveAll();
  8266. strarray.Add("产品名称");
  8267. strarray.Add("数量");
  8268. strarray.Add("P数");
  8269. strarray.Add("张数");
  8270. strarray.Add("照片编号");
  8271. CArray<CRect, CRect>rc2array;
  8272. int wid = 25;
  8273. for (i = 18; i <= 22; i++)
  8274. {
  8275. StrRect = load.m_rcarray.ElementAt(i - 1);
  8276. if (i == 19)
  8277. {
  8278. StrRect.right = StrRect.left + wid;
  8279. }
  8280. if (i == 20)
  8281. {
  8282. StrRect = load.m_rcarray.ElementAt(i - 2);
  8283. StrRect.left += wid; StrRect.right = StrRect.left;
  8284. StrRect.right += wid;
  8285. }
  8286. if (i == 21)
  8287. {
  8288. StrRect = load.m_rcarray.ElementAt(i - 3);
  8289. StrRect.left += wid * 2; StrRect.right = StrRect.left;
  8290. StrRect.right += wid;
  8291. wid = StrRect.right;
  8292. }
  8293. if (i == 22)
  8294. {
  8295. StrRect = load.m_rcarray.ElementAt(i - 3);
  8296. StrRect.left = wid;
  8297. }
  8298. StrRect.top += dty; StrRect.bottom += dty;
  8299. m_Print.DrawRect2(StrRect, 1);
  8300. StrRect.left += 2;
  8301. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8302. StrRect.left -= 2;
  8303. StrRect.top = StrRect.bottom;
  8304. StrRect.bottom += 18;
  8305. rc2array.Add(StrRect);
  8306. }
  8307. int curypos = 0;
  8308. for (i = 0; i < sparray2.GetSize(); i += 5)
  8309. {
  8310. rcarray.RemoveAll();
  8311. strarray2.RemoveAll();
  8312. int j = 0;
  8313. for ( j = 0; j < 5; j++)
  8314. {
  8315. StrRect = rc2array.ElementAt(j);
  8316. StrRect.left += 2;
  8317. StrRect.right -= 2;
  8318. StrRect.top += 2;
  8319. rcarray.Add(StrRect);
  8320. strarray2.Add(sparray2.ElementAt(i + j));
  8321. }
  8322. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8323. rcarray.RemoveAll();
  8324. for (j = 0; j < 5; j++)
  8325. {
  8326. StrRect = rc2array.ElementAt(j);
  8327. if (j == 0)
  8328. {
  8329. dty += bottom - StrRect.bottom;
  8330. }
  8331. StrRect.bottom = bottom;
  8332. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  8333. StrRect.top = StrRect.bottom;
  8334. StrRect.bottom += 18;
  8335. rcarray.Add(StrRect);
  8336. }
  8337. rc2array.RemoveAll();
  8338. rc2array.Copy(rcarray);
  8339. }
  8340. m_Print.SetFontFace(15, 1, "宋体");
  8341. StrRect = load.m_rcarray.ElementAt(20);
  8342. dty = curypos - StrRect.bottom + 35;
  8343. StrRect.top += dty; StrRect.bottom += dty;
  8344. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8345. m_Print.SetFontFace(9, 1, "宋体");
  8346. rcarray.RemoveAll();
  8347. strarray2.RemoveAll();
  8348. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  8349. StrRect.left += 2;
  8350. StrRect.right -= 2;
  8351. StrRect.top += 2;
  8352. rcarray.Add(StrRect);
  8353. strarray2.Add(m_bz);
  8354. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8355. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  8356. dty += bottom - StrRect.bottom;
  8357. StrRect.bottom = bottom;
  8358. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  8359. m_Print.SetFontFace(10, 1, "宋体");
  8360. StrRect = load.m_rcarray.ElementAt(22);
  8361. dty = curypos - StrRect.bottom + 25;
  8362. StrRect.top += dty; StrRect.bottom += dty;
  8363. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  8364. if (m_edit9.IsEmpty())
  8365. {
  8366. m_edit9 = "\
  8367. 经确认后的照片均排入制作流程,\r\n\
  8368. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8369. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8370. }
  8371. CString info1, info2, info3;
  8372. int newlinepos = m_edit9.Find("\r\n");
  8373. if (newlinepos != -1)
  8374. {
  8375. info1 = m_edit9.Left(newlinepos);
  8376. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8377. }
  8378. newlinepos = m_edit9.Find("\r\n");
  8379. if (newlinepos != -1)
  8380. {
  8381. info2 = m_edit9.Left(newlinepos);
  8382. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8383. info3 = m_edit9;
  8384. }
  8385. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8386. StrRect = load.m_rcarray.ElementAt(23);
  8387. StrRect.top += dty; StrRect.bottom += dty;
  8388. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8389. StrRect = load.m_rcarray.ElementAt(24);
  8390. StrRect.top += dty; StrRect.bottom += dty;
  8391. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8392. StrRect.top += 15;
  8393. StrRect.bottom += 15;
  8394. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8395. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  8396. StrRect = load.m_rcarray.ElementAt(25);
  8397. StrRect.top += dty - dy;
  8398. StrRect.bottom += dty - dy;
  8399. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8400. StrRect = load.m_rcarray.ElementAt(26);
  8401. StrRect.top += dty - dy;
  8402. StrRect.bottom += dty - dy;
  8403. m_Print.DrawRect2(StrRect, 2);
  8404. StrRect = load.m_rcarray.ElementAt(25);
  8405. StrRect.top += dty + 15 - dy;
  8406. StrRect.bottom += dty + 15 - dy;
  8407. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8408. StrRect = load.m_rcarray.ElementAt(26);
  8409. StrRect.top += dty + 15 - dy;
  8410. StrRect.bottom += dty + 15 - dy;
  8411. m_Print.DrawRect2(StrRect, 2);
  8412. StrRect = load.m_rcarray.ElementAt(25);
  8413. StrRect.top += dty + 15 * 2 - dy;
  8414. StrRect.bottom += dty + 15 * 2 - dy;
  8415. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8416. StrRect = load.m_rcarray.ElementAt(26);
  8417. StrRect.top += dty + 15 * 2 - dy;
  8418. StrRect.bottom += dty + 15 * 2 - dy;
  8419. m_Print.DrawRect2(StrRect, 2);
  8420. PrintPreview dlg; dlg.m_mode = 2;
  8421. dlg.m_name = name;
  8422. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  8423. dlg.m_pDC = m_Print.GetPDC();
  8424. if (aa == 0)
  8425. {
  8426. if (dlg.DoModal() != IDOK)
  8427. return;
  8428. printcot = dlg.m_num;
  8429. }
  8430. //结束打印
  8431. m_Print.EndPage();
  8432. m_Print.EndPrint();
  8433. }
  8434. }
  8435. void CMainFrame::PrintFlowChart3(CString strOrderNumber) // 选片打单 风格2;
  8436. {
  8437. #ifdef LKAY_VERSION
  8438. PrintFlowChart3LKAY(strOrderNumber);
  8439. return;
  8440. #endif
  8441. int printcot = 1;
  8442. for (int aa = 0; aa < printcot; aa++)
  8443. {
  8444. BOOL bSecondPage = 0;
  8445. int nPrintedPos = 0;
  8446. for (int bb = 0; bb < 2; bb++)
  8447. {
  8448. if (bb && bSecondPage == 0)break;
  8449. CPrintRX m_Print;
  8450. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58))) // 58-[version].[setcheck1] ==1,使用默认打印机;
  8451. {
  8452. m_Print.InitToPrint(NULL, 1);
  8453. }
  8454. else // 否则使用指定的打印机;
  8455. {
  8456. CString name = g_cominfoarray.ElementAt(0).ElementAt(64); // 64-[version].[printer2] 制作单打印机;
  8457. if (name.IsEmpty())
  8458. m_Print.InitToPrint(NULL, 1);
  8459. else
  8460. {
  8461. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8462. if (nret == -1 && aa == 0)
  8463. {
  8464. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8465. }
  8466. }
  8467. }
  8468. m_Print.StartPrint();
  8469. m_Print.StartPage();
  8470. LoadRect load;
  8471. load.SetLiaPath("18.lia");
  8472. load.SetMargins(10, 0);
  8473. if (!load.Load())return;
  8474. CString str;
  8475. int rcpos = -1;
  8476. // ■■■■■■从18.lia获取到第一个区域大小 - 1.显示店名;
  8477. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8478. if ((bb == 0 && bSecondPage == 0))
  8479. {
  8480. m_Print.SetFontFace(25, 1, "宋体");
  8481. // 10-[version].[info1] 店名;
  8482. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8483. m_Print.SetFontFace(15, 1, "宋体");
  8484. // ■■■■■■从18.lia获取第二个区域大小 - 2.显示"基本资料";
  8485. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8486. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8487. m_Print.SetFontFace(9, 1, "宋体");
  8488. }
  8489. //////////////////////////////////////////////////////////////
  8490. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  8491. g_sendhead.code[0] = 54; // dindan;
  8492. g_sendhead.code[1] = 223; // dindanspview2; shangpin+dindansp;
  8493. g_sendhead.code[2] = 52; // client;
  8494. g_sendhead.tabcount = 3;
  8495. g_sendhead.bsql = 0;
  8496. g_pMainWnd->ProcessChatMessageRequest2(filter);
  8497. if (g_bSendOK == 0)return;
  8498. CArray<CStringArray, CStringArray>sparray;
  8499. CArray<CStringArray, CStringArray>clientarray;
  8500. DataToArray(&g_List1array, &sparray, &clientarray);
  8501. CString spno;
  8502. CStringArray sparray2;
  8503. int i = 0;
  8504. for ( i = 0; i < sparray.GetSize(); i++)
  8505. {
  8506. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8507. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  8508. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8509. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8510. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  8511. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8512. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  8513. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8514. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8515. }
  8516. for (i = 0; i < sparray.GetSize(); i++)
  8517. {
  8518. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  8519. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  8520. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  8521. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8522. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  8523. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8524. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  8525. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8526. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8527. }
  8528. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  8529. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  8530. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  8531. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  8532. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  8533. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  8534. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  8535. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  8536. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  8537. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  8538. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  8539. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  8540. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  8541. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  8542. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  8543. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  8544. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  8545. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  8546. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  8547. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  8548. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  8549. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  8550. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  8551. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  8552. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  8553. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  8554. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  8555. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  8556. CString m_sum3;
  8557. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  8558. ::ConvertToPrice(m_sum3);
  8559. if (m_money3.IsEmpty())m_money3 = "0";
  8560. int dty = 0;
  8561. CString name;
  8562. if (!m_name1.IsEmpty())
  8563. name = m_name1 + ",";
  8564. name += m_name2;
  8565. name.TrimRight(",");
  8566. CString phone;
  8567. if (!m_phone1.IsEmpty())
  8568. phone = m_phone1 + ",";
  8569. phone += m_phone2; phone.TrimRight(",");
  8570. if (IsHasRights2new(31) == 0)
  8571. phone = "***";
  8572. CStringArray strarray;
  8573. CArray<CRect, CRect>rcarray;
  8574. CStringArray strarray2; CArray<CRect, CRect>rc2array;
  8575. int bottom;
  8576. if ((bb == 0 && bSecondPage == 0))
  8577. {
  8578. #ifdef CHILD_VERSION
  8579. if (m_birthday.IsEmpty())
  8580. strarray.Add("姓名/性别");
  8581. else
  8582. strarray.Add("姓名/性别/年龄");
  8583. #else
  8584. strarray.Add("客人姓名"); // 第3.1区域 -3.显示客人姓名;
  8585. #endif
  8586. strarray.Add("电话");
  8587. strarray.Add("单号");
  8588. strarray.Add("套系");
  8589. strarray.Add("选样");
  8590. strarray.Add("余款/加挑");
  8591. strarray.Add("选片/日期");
  8592. #ifdef CHILD_VERSION
  8593. if (m_birthday.IsEmpty())
  8594. strarray.Add(name + "/" + m_sex);
  8595. else
  8596. {
  8597. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  8598. m_birthday.Format("%d", year + 1);
  8599. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  8600. }
  8601. #else
  8602. strarray.Add(name); // 第4.1区域 -3.显示客人姓名;
  8603. #endif
  8604. strarray.Add(phone);
  8605. strarray.Add(strOrderNumber);
  8606. strarray.Add(m_taoxiname);
  8607. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8608. strarray.Add(str);
  8609. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  8610. strarray.Add(str);
  8611. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  8612. for (i = 3; i <= 16; i++)
  8613. {
  8614. // ■■■■■■从18.lia中获取第3~16的区域大小;
  8615. StrRect = load.m_rcarray.ElementAt(i - 1);
  8616. if (i < 10)
  8617. {
  8618. m_Print.DrawRect2(StrRect, 1);
  8619. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8620. }
  8621. }
  8622. // ■■■■■■从18.lia中获取第30的区域大小;
  8623. StrRect = load.m_rcarray.ElementAt(29);
  8624. m_Print.DrawRect2(StrRect, 1);
  8625. BOOL bPrintDate = 1;
  8626. #ifdef DDF_VERSION
  8627. // bPrintDate=0;
  8628. #else
  8629. if (m_time5 == "" && m_time6 == "")
  8630. bPrintDate = 0;
  8631. #endif
  8632. if (bPrintDate)
  8633. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8634. else
  8635. {
  8636. #ifdef CHILD_VERSION
  8637. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8638. #else
  8639. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8640. #endif
  8641. }
  8642. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138))) // [version].[reverse3]
  8643. {
  8644. Image *pImg = NULL;
  8645. g_nSendCode = 31;
  8646. int g_nYearposTemp = g_nYearpos;
  8647. g_nYearpos = -1;
  8648. g_pMainWnd->ProcessChatMessageRequest2(1);
  8649. g_nYearpos = g_nYearposTemp;
  8650. g_nSendCode = 0;
  8651. if (g_bSendOK == 0)return;
  8652. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8653. // Jeff二维码的区域不是从18.lia里获取的,是固定在右上角指定区域;
  8654. if (pImg)
  8655. {
  8656. StrRect.left = 485;
  8657. StrRect.top = 12;
  8658. StrRect.right = StrRect.left + 60;
  8659. StrRect.bottom = StrRect.top + 60;
  8660. m_Print.DrawImage(pImg, StrRect);
  8661. delete pImg; pImg = NULL;
  8662. }
  8663. }
  8664. // CArray<CRect,CRect>rcarray;
  8665. // CStringArray strarray2;
  8666. // ■■■■■■从18.lia中获取第10的区域大小;
  8667. for (i = 10; i <= 16; i++)
  8668. {
  8669. StrRect = load.m_rcarray.ElementAt(i - 1);
  8670. StrRect.left += 2;
  8671. StrRect.right -= 2;
  8672. StrRect.top += 2;
  8673. rcarray.Add(StrRect);
  8674. strarray2.Add(strarray.ElementAt(7 + i - 10));
  8675. }
  8676. if (1)
  8677. {
  8678. // ■■■■■■从18.lia中获取第31的区域大小;
  8679. StrRect = load.m_rcarray.ElementAt(30);
  8680. StrRect.left += 2;
  8681. StrRect.right -= 2;
  8682. StrRect.top += 2;
  8683. rcarray.Add(StrRect);
  8684. if (bPrintDate)
  8685. strarray2.Add(m_time6 + "/" + m_time5);
  8686. else
  8687. {
  8688. strarray2.Add(m_waiter1 + "/" + m_waiter2);
  8689. }
  8690. }
  8691. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8692. for (i = 10; i <= 16; i++)
  8693. {
  8694. StrRect = load.m_rcarray.ElementAt(i - 1);
  8695. if (i == 10)
  8696. {
  8697. dty += bottom - StrRect.bottom;
  8698. }
  8699. StrRect.bottom = bottom;
  8700. m_Print.DrawRect2(StrRect, 1);
  8701. }
  8702. if (1)
  8703. {
  8704. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  8705. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  8706. }
  8707. m_Print.SetFontFace(15, 1, "宋体");
  8708. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  8709. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8710. }
  8711. int curypos = 0;
  8712. int oldpos = 0;
  8713. if (bb == 1)
  8714. {
  8715. dty = -100;
  8716. oldpos = nPrintedPos;
  8717. if (oldpos == 0)oldpos = 10000;
  8718. }
  8719. m_Print.SetFontFace(9, 1, "宋体");
  8720. strarray.RemoveAll();
  8721. if ((oldpos != 10000 && oldpos < sparray2.GetSize()) || bb == 0)
  8722. {
  8723. strarray.Add("产品名称");
  8724. strarray.Add("数量");
  8725. strarray.Add("照片编号");
  8726. for (i = 18; i <= 20; i++)
  8727. {
  8728. StrRect = load.m_rcarray.ElementAt(i - 1);
  8729. StrRect.top += dty;
  8730. StrRect.bottom += dty;
  8731. m_Print.DrawRect2(StrRect, 1);
  8732. StrRect.left += 2;
  8733. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8734. StrRect.left -= 2;
  8735. StrRect.top = StrRect.bottom;
  8736. StrRect.bottom += 18;
  8737. rc2array.Add(StrRect);
  8738. }
  8739. }
  8740. for (i = oldpos; i < sparray2.GetSize(); i += 3)
  8741. {
  8742. rcarray.RemoveAll();
  8743. strarray2.RemoveAll();
  8744. int j = 0;
  8745. for ( j = 0; j < 3; j++)
  8746. {
  8747. StrRect = rc2array.ElementAt(j);
  8748. StrRect.left += 2;
  8749. StrRect.right -= 2;
  8750. StrRect.top += 2;
  8751. rcarray.Add(StrRect);
  8752. #if JEFF_TEST_ON
  8753. if ( 2 == j )
  8754. {
  8755. CString strImg = sparray2.ElementAt(i + 2);
  8756. int nImgCount = strImg.Replace(",", ",");
  8757. if (nImgCount != 0 )
  8758. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount+1);
  8759. else if (!strImg.IsEmpty())
  8760. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  8761. strarray2.Add(strImg);
  8762. }
  8763. else
  8764. strarray2.Add(sparray2.ElementAt(i + j));
  8765. #else
  8766. strarray2.Add(sparray2.ElementAt(i + j));
  8767. #endif
  8768. }
  8769. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8770. rcarray.RemoveAll();
  8771. for (j = 0; j < 3; j++)
  8772. {
  8773. StrRect = rc2array.ElementAt(j);
  8774. if (j == 0)
  8775. {
  8776. dty += bottom - StrRect.bottom;
  8777. }
  8778. StrRect.bottom = bottom;
  8779. m_Print.DrawRect2(StrRect, 1);
  8780. curypos = StrRect.bottom;
  8781. StrRect.top = StrRect.bottom;
  8782. StrRect.bottom += 18;
  8783. rcarray.Add(StrRect);
  8784. }
  8785. rc2array.RemoveAll();
  8786. rc2array.Copy(rcarray);
  8787. if (bottom > 750)
  8788. {
  8789. bSecondPage = 1;
  8790. nPrintedPos = i + 3;
  8791. break;
  8792. }
  8793. }
  8794. if ((bb == 0 && bSecondPage == 0) || (bb == 1 && bSecondPage == 1))
  8795. {
  8796. m_Print.SetFontFace(15, 1, "宋体");
  8797. StrRect = load.m_rcarray.ElementAt(20);
  8798. dty = curypos - StrRect.bottom + 35;
  8799. StrRect.top += dty;
  8800. StrRect.bottom += dty;
  8801. if (StrRect.bottom > 700 && bb == 0)
  8802. {
  8803. bSecondPage = 1;
  8804. }
  8805. else
  8806. {
  8807. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8808. m_Print.SetFontFace(9, 1, "宋体");
  8809. rcarray.RemoveAll();
  8810. strarray2.RemoveAll();
  8811. StrRect = load.m_rcarray.ElementAt(21);
  8812. StrRect.top += dty;
  8813. StrRect.bottom += dty;
  8814. StrRect.left += 2;
  8815. StrRect.right -= 2;
  8816. StrRect.top += 2;
  8817. rcarray.Add(StrRect);
  8818. #if JEFF_TEST_ON
  8819. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  8820. strarray2.RemoveAll();
  8821. CString strFind = "要求:";
  8822. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  8823. do
  8824. {
  8825. int nIndex = strbz3.Find(strFind, 1);
  8826. if (nIndex != -1)
  8827. {
  8828. CString strbz = strbz3.Left(nIndex);
  8829. strbz3 = strbz3.Mid(nIndex);
  8830. strarray2.Add(strbz);
  8831. }
  8832. else
  8833. {
  8834. strarray2.Add(strbz3);
  8835. strbz3 = "";
  8836. }
  8837. } while (strbz3.Find(strFind) != -1);
  8838. strarray2.Add(g_List1array.ElementAt(0).ElementAt(29));
  8839. strarray2.Add(g_List1array.ElementAt(0).ElementAt(23));
  8840. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  8841. #else
  8842. strarray2.Add(m_bz);
  8843. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8844. #endif
  8845. StrRect = load.m_rcarray.ElementAt(21);
  8846. StrRect.top += dty;
  8847. StrRect.bottom += dty;
  8848. dty += bottom - StrRect.bottom;
  8849. StrRect.bottom = bottom;
  8850. m_Print.DrawRect2(StrRect, 1);
  8851. curypos = StrRect.bottom;
  8852. m_Print.SetFontFace(10, 1, "宋体");
  8853. StrRect = load.m_rcarray.ElementAt(22);
  8854. dty = curypos - StrRect.bottom + 25;
  8855. StrRect.top += dty;
  8856. StrRect.bottom += dty;
  8857. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  8858. if (m_edit9.IsEmpty())
  8859. {
  8860. m_edit9 = "\
  8861. 经确认后的照片均排入制作流程,\r\n\
  8862. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8863. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8864. }
  8865. CString info1, info2, info3;
  8866. int newlinepos = m_edit9.Find("\r\n");
  8867. if (newlinepos != -1)
  8868. {
  8869. info1 = m_edit9.Left(newlinepos);
  8870. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8871. }
  8872. newlinepos = m_edit9.Find("\r\n");
  8873. if (newlinepos != -1)
  8874. {
  8875. info2 = m_edit9.Left(newlinepos);
  8876. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8877. info3 = m_edit9;
  8878. }
  8879. #ifdef QCH_VERSION
  8880. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8881. StrRect = load.m_rcarray.ElementAt(23);
  8882. StrRect.top += dty; StrRect.bottom += dty;
  8883. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8884. StrRect=load.m_rcarray .ElementAt (24);
  8885. StrRect.top +=dty;StrRect.bottom +=dty;
  8886. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8887. StrRect.top +=15;
  8888. StrRect.bottom +=15;
  8889. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8890. #else
  8891. if (1)
  8892. {
  8893. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8894. StrRect = load.m_rcarray.ElementAt(23);
  8895. StrRect.top += dty; StrRect.bottom += dty;
  8896. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8897. StrRect = load.m_rcarray.ElementAt(24);
  8898. StrRect.top += dty; StrRect.bottom += dty;
  8899. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8900. }
  8901. else
  8902. {
  8903. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8904. StrRect = load.m_rcarray.ElementAt(23);
  8905. StrRect.top += dty; StrRect.bottom += dty;
  8906. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8907. StrRect = load.m_rcarray.ElementAt(24);
  8908. StrRect.top += dty; StrRect.bottom += dty;
  8909. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8910. }
  8911. StrRect.top += 15;
  8912. StrRect.bottom += 15;
  8913. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8914. #endif
  8915. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  8916. StrRect = load.m_rcarray.ElementAt(25);
  8917. StrRect.top += dty - dy;
  8918. StrRect.bottom += dty - dy;
  8919. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8920. StrRect = load.m_rcarray.ElementAt(26);
  8921. StrRect.top += dty - dy;
  8922. StrRect.bottom += dty - dy;
  8923. m_Print.DrawRect2(StrRect, 2);
  8924. StrRect = load.m_rcarray.ElementAt(25);
  8925. StrRect.top += dty + 15 - dy;
  8926. StrRect.bottom += dty + 15 - dy;
  8927. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8928. StrRect = load.m_rcarray.ElementAt(26);
  8929. StrRect.top += dty + 15 - dy;
  8930. StrRect.bottom += dty + 15 - dy;
  8931. m_Print.DrawRect2(StrRect, 2);
  8932. StrRect = load.m_rcarray.ElementAt(25);
  8933. StrRect.top += dty + 15 * 2 - dy;
  8934. StrRect.bottom += dty + 15 * 2 - dy;
  8935. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8936. StrRect = load.m_rcarray.ElementAt(26);
  8937. StrRect.top += dty + 15 * 2 - dy;
  8938. StrRect.bottom += dty + 15 * 2 - dy;
  8939. m_Print.DrawRect2(StrRect, 2);
  8940. }
  8941. }
  8942. PrintPreview dlg; dlg.m_mode = 2;
  8943. dlg.m_name = name;
  8944. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  8945. dlg.m_pDC = m_Print.GetPDC();
  8946. if (aa == 0)
  8947. {
  8948. if (dlg.DoModal() != IDOK)
  8949. return;
  8950. printcot = dlg.m_num;
  8951. }
  8952. //结束打印
  8953. m_Print.EndPage();
  8954. m_Print.EndPrint();
  8955. }
  8956. }
  8957. }
  8958. /*
  8959. void CMainFrame::PrintFlowChart3(CString m_id)
  8960. {
  8961. #ifdef LKAY_VERSION
  8962. PrintFlowChart3LKAY(m_id);
  8963. return;
  8964. #endif
  8965. int printcot=1;
  8966. for(int aa=0; aa<printcot; aa++)
  8967. {
  8968. CPrintRX m_Print;
  8969. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8970. {
  8971. m_Print.InitToPrint(NULL, 1);
  8972. }
  8973. else
  8974. {
  8975. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  8976. if(name.IsEmpty ())
  8977. m_Print.InitToPrint(NULL, 1);
  8978. else
  8979. {
  8980. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8981. if(nret==-1 && aa==0)
  8982. {
  8983. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8984. }
  8985. }
  8986. }
  8987. m_Print.StartPrint();
  8988. m_Print.StartPage();
  8989. LoadRect load;
  8990. load.SetLiaPath ("18.lia");
  8991. load.SetMargins(10,0);
  8992. if(!load.Load ())return;
  8993. CString str;
  8994. int rcpos=-1;
  8995. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  8996. m_Print.SetFontFace(25, 1, "宋体");
  8997. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8998. m_Print.SetFontFace(15, 1, "宋体");
  8999. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9000. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9001. m_Print.SetFontFace(9, 1, "宋体");
  9002. //////////////////////////////////////////////////////////////
  9003. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9004. g_sendhead.code[0]=54;
  9005. g_sendhead.code[1]=50;
  9006. g_sendhead.code[2]=52;
  9007. g_sendhead.tabcount=3;
  9008. g_sendhead.bsql=0;
  9009. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9010. CArray<CStringArray, CStringArray>sparray;
  9011. CArray<CStringArray, CStringArray>clientarray;
  9012. DataToArray(&g_List1array,&sparray,&clientarray);
  9013. CString spno;
  9014. CStringArray sparray2;
  9015. for(int i=0; i<sparray.GetSize (); i++)
  9016. {
  9017. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9018. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9019. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9020. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9021. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9022. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9023. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9024. }
  9025. for( i=0; i<sparray.GetSize (); i++)
  9026. {
  9027. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9028. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9029. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9030. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9031. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9032. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9033. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9034. }
  9035. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9036. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9037. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9038. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9039. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9040. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9041. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9042. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9043. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9044. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9045. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9046. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9047. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9048. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9049. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9050. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9051. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9052. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9053. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  9054. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  9055. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9056. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9057. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9058. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9059. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9060. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9061. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9062. CString m_sum3;
  9063. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9064. ::ConvertToPrice (m_sum3);
  9065. if(m_money3.IsEmpty ())m_money3="0";
  9066. int dty=0;
  9067. CString name;
  9068. if(!m_name1.IsEmpty ())
  9069. name=m_name1+",";
  9070. name+=m_name2;
  9071. name.TrimRight (",");
  9072. CString phone;
  9073. if(!m_phone1.IsEmpty ())
  9074. phone=m_phone1+",";
  9075. phone+=m_phone2;phone.TrimRight (",");
  9076. if(IsHasRights2new(31)==0)
  9077. phone="***";
  9078. CStringArray strarray;
  9079. #ifdef CHILD_VERSION
  9080. if(m_birthday.IsEmpty ())
  9081. strarray.Add ("姓名/性别");
  9082. else
  9083. strarray.Add ("姓名/性别/年龄");
  9084. #else
  9085. strarray.Add ("客人姓名");
  9086. #endif
  9087. strarray.Add ("电话");
  9088. strarray.Add ("单号");
  9089. strarray.Add ("套系");
  9090. strarray.Add ("选样");
  9091. strarray.Add ("余款/加挑");
  9092. strarray.Add ("选片/日期");
  9093. #ifdef CHILD_VERSION
  9094. if(m_birthday.IsEmpty ())
  9095. strarray.Add (name+"/"+m_sex);
  9096. else
  9097. {
  9098. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9099. m_birthday.Format ("%d", year+1);
  9100. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9101. }
  9102. #else
  9103. strarray.Add (name);
  9104. #endif
  9105. strarray.Add (phone);
  9106. strarray.Add (m_id);
  9107. strarray.Add (m_taoxiname);
  9108. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9109. strarray.Add (str);
  9110. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9111. strarray.Add (str);
  9112. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  9113. for( i=3; i<=16; i++)
  9114. {
  9115. StrRect=load.m_rcarray .ElementAt (i-1);
  9116. if(i<10)
  9117. {
  9118. m_Print.DrawRect2(StrRect, 1);
  9119. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9120. }
  9121. }
  9122. StrRect=load.m_rcarray .ElementAt (29);
  9123. m_Print.DrawRect2(StrRect, 1);
  9124. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9125. CArray<CRect,CRect>rcarray;
  9126. CStringArray strarray2;
  9127. for( i=10; i<=16; i++)
  9128. {
  9129. StrRect=load.m_rcarray .ElementAt (i-1);
  9130. StrRect.left +=2;
  9131. StrRect.right -=2;
  9132. StrRect.top +=2;
  9133. rcarray.Add (StrRect);
  9134. strarray2.Add (strarray.ElementAt (7+i-10));
  9135. }
  9136. if(1)
  9137. {
  9138. StrRect=load.m_rcarray .ElementAt (30);
  9139. StrRect.left +=2;
  9140. StrRect.right -=2;
  9141. StrRect.top +=2;
  9142. rcarray.Add (StrRect);
  9143. strarray2.Add (m_time6+"/"+m_time5);
  9144. }
  9145. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9146. for( i=10; i<=16; i++)
  9147. {
  9148. StrRect=load.m_rcarray .ElementAt (i-1);
  9149. if(i==10)
  9150. {
  9151. dty+=bottom-StrRect.bottom;
  9152. }
  9153. StrRect.bottom =bottom;
  9154. m_Print.DrawRect2(StrRect, 1);
  9155. }
  9156. if(1)
  9157. {
  9158. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9159. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9160. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  9161. }
  9162. m_Print.SetFontFace(15, 1, "宋体");
  9163. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9164. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9165. m_Print.SetFontFace(9, 1, "宋体");
  9166. strarray.RemoveAll ();
  9167. strarray.Add ("产品名称");
  9168. strarray.Add ("数量");
  9169. strarray.Add ("照片编号");
  9170. CArray<CRect,CRect>rc2array;
  9171. for( i=18; i<=20; i++)
  9172. {
  9173. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9174. m_Print.DrawRect2(StrRect, 1);
  9175. StrRect.left +=2;
  9176. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9177. StrRect.left -=2;
  9178. StrRect.top =StrRect.bottom ;
  9179. StrRect.bottom +=18;
  9180. rc2array.Add (StrRect);
  9181. }
  9182. int curypos=0;
  9183. for(i=0; i<sparray2.GetSize (); i+=3)
  9184. {
  9185. rcarray.RemoveAll ();
  9186. strarray2.RemoveAll ();
  9187. for(int j=0; j<3; j++)
  9188. {
  9189. StrRect=rc2array.ElementAt (j);
  9190. StrRect.left +=2;
  9191. StrRect.right -=2;
  9192. StrRect.top +=2;
  9193. rcarray.Add (StrRect);
  9194. strarray2.Add (sparray2.ElementAt (i+j));
  9195. }
  9196. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9197. rcarray.RemoveAll ();
  9198. for( j=0; j<3; j++)
  9199. {
  9200. StrRect=rc2array.ElementAt (j);
  9201. if(j==0)
  9202. {
  9203. dty+=bottom-StrRect.bottom;
  9204. }
  9205. StrRect.bottom =bottom;
  9206. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9207. StrRect.top =StrRect.bottom ;
  9208. StrRect.bottom +=18;
  9209. rcarray.Add (StrRect);
  9210. }
  9211. rc2array.RemoveAll ();
  9212. rc2array.Copy(rcarray);
  9213. }
  9214. m_Print.SetFontFace(15, 1, "宋体");
  9215. StrRect=load.m_rcarray .ElementAt (20);
  9216. dty=curypos-StrRect.bottom+35;
  9217. StrRect.top +=dty;StrRect.bottom +=dty;
  9218. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9219. m_Print.SetFontFace(9, 1, "宋体");
  9220. rcarray.RemoveAll ();
  9221. strarray2.RemoveAll ();
  9222. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9223. StrRect.left +=2;
  9224. StrRect.right -=2;
  9225. StrRect.top +=2;
  9226. rcarray.Add (StrRect);
  9227. strarray2.Add (m_bz);
  9228. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9229. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9230. dty+=bottom-StrRect.bottom;
  9231. StrRect.bottom =bottom;
  9232. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9233. m_Print.SetFontFace(10, 1, "宋体");
  9234. StrRect=load.m_rcarray .ElementAt (22);
  9235. dty=curypos-StrRect.bottom+25;
  9236. StrRect.top +=dty;StrRect.bottom +=dty;
  9237. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9238. if(m_edit9.IsEmpty())
  9239. {
  9240. m_edit9="\
  9241. 经确认后的照片均排入制作流程,\r\n\
  9242. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9243. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9244. }
  9245. CString info1,info2,info3;
  9246. int newlinepos=m_edit9.Find("\r\n");
  9247. if(newlinepos!=-1)
  9248. {
  9249. info1=m_edit9.Left(newlinepos);
  9250. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9251. }
  9252. newlinepos=m_edit9.Find("\r\n");
  9253. if(newlinepos!=-1)
  9254. {
  9255. info2=m_edit9.Left(newlinepos);
  9256. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9257. info3=m_edit9;
  9258. }
  9259. #ifdef QCH_VERSION
  9260. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9261. StrRect=load.m_rcarray .ElementAt (23);
  9262. StrRect.top +=dty;StrRect.bottom +=dty;
  9263. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9264. StrRect=load.m_rcarray .ElementAt (24);
  9265. StrRect.top +=dty;StrRect.bottom +=dty;
  9266. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9267. StrRect.top +=15;
  9268. StrRect.bottom +=15;
  9269. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9270. #else
  9271. if(1)
  9272. {
  9273. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9274. StrRect=load.m_rcarray .ElementAt (23);
  9275. StrRect.top +=dty;StrRect.bottom +=dty;
  9276. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9277. StrRect=load.m_rcarray .ElementAt (24);
  9278. StrRect.top +=dty;StrRect.bottom +=dty;
  9279. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9280. }
  9281. else
  9282. {
  9283. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9284. StrRect=load.m_rcarray .ElementAt (23);
  9285. StrRect.top +=dty;StrRect.bottom +=dty;
  9286. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9287. StrRect=load.m_rcarray .ElementAt (24);
  9288. StrRect.top +=dty;StrRect.bottom +=dty;
  9289. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9290. }
  9291. StrRect.top +=15;
  9292. StrRect.bottom +=15;
  9293. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9294. #endif
  9295. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  9296. StrRect=load.m_rcarray .ElementAt (25);
  9297. StrRect.top +=dty-dy;
  9298. StrRect.bottom +=dty-dy;
  9299. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9300. StrRect=load.m_rcarray .ElementAt (26);
  9301. StrRect.top +=dty-dy;
  9302. StrRect.bottom +=dty-dy;
  9303. m_Print.DrawRect2(StrRect, 2);
  9304. StrRect=load.m_rcarray .ElementAt (25);
  9305. StrRect.top +=dty+15-dy;
  9306. StrRect.bottom +=dty+15-dy;
  9307. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9308. StrRect=load.m_rcarray .ElementAt (26);
  9309. StrRect.top +=dty+15-dy;
  9310. StrRect.bottom +=dty+15-dy;
  9311. m_Print.DrawRect2(StrRect, 2);
  9312. StrRect=load.m_rcarray .ElementAt (25);
  9313. StrRect.top +=dty+15*2-dy;
  9314. StrRect.bottom +=dty+15*2-dy;
  9315. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9316. StrRect=load.m_rcarray .ElementAt (26);
  9317. StrRect.top +=dty+15*2-dy;
  9318. StrRect.bottom +=dty+15*2-dy;
  9319. m_Print.DrawRect2(StrRect, 2);
  9320. PrintPreview dlg;dlg.m_mode=2;
  9321. dlg.m_name =name;
  9322. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9323. dlg.m_pDC =m_Print.GetPDC() ;
  9324. if(aa==0)
  9325. {
  9326. if(dlg.DoModal ()!=IDOK)
  9327. return;
  9328. printcot=dlg.m_num;
  9329. }
  9330. //结束打印
  9331. m_Print.EndPage();
  9332. m_Print.EndPrint();
  9333. }
  9334. }
  9335. */
  9336. //void CMainFrame::PrintFlowChart4(CString m_id) // 选设计打单函数;
  9337. void CMainFrame::PrintFlowChart4(CString strOrderNumber) // 选设计打单函数,使用18.lia文件;
  9338. {
  9339. int printcot = 1;
  9340. for (int aa = 0; aa < printcot; aa++)
  9341. {
  9342. CPrintRX m_Print;
  9343. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9344. {
  9345. m_Print.InitToPrint(NULL, 1);
  9346. }
  9347. else
  9348. {
  9349. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  9350. if (name.IsEmpty())
  9351. m_Print.InitToPrint(NULL, 1);
  9352. else
  9353. {
  9354. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9355. if (nret == -1 && aa == 0)
  9356. {
  9357. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9358. }
  9359. }
  9360. }
  9361. m_Print.StartPrint();
  9362. m_Print.StartPage();
  9363. LoadRect load;
  9364. load.SetLiaPath("18.lia");
  9365. load.SetMargins(10, 0);
  9366. if (!load.Load())return;
  9367. CString str;
  9368. int rcpos = -1;
  9369. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  9370. m_Print.SetFontFace(25, 1, "宋体");
  9371. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9372. m_Print.SetFontFace(15, 1, "宋体");
  9373. StrRect = load.m_rcarray.ElementAt(++rcpos);
  9374. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9375. m_Print.SetFontFace(9, 1, "宋体");
  9376. //////////////////////////////////////////////////////////////
  9377. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  9378. g_sendhead.code[0] = 54;
  9379. g_sendhead.code[1] = 223;
  9380. g_sendhead.code[2] = 52;
  9381. g_sendhead.tabcount = 3;
  9382. g_sendhead.bsql = 0;
  9383. g_pMainWnd->ProcessChatMessageRequest2(filter);
  9384. if (g_bSendOK == 0)return;
  9385. CArray<CStringArray, CStringArray>sparray;
  9386. CArray<CStringArray, CStringArray>clientarray;
  9387. DataToArray(&g_List1array, &sparray, &clientarray);
  9388. CString spno;
  9389. CStringArray sparray2;
  9390. int i = 0;
  9391. for ( i = 0; i < sparray.GetSize(); i++)
  9392. {
  9393. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  9394. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(8).IsEmpty())continue;
  9395. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9396. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9397. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  9398. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  9399. sparray2.Add(sparray.ElementAt(i).ElementAt(8));
  9400. }
  9401. for (i = 0; i < sparray.GetSize(); i++)
  9402. {
  9403. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  9404. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  9405. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  9406. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9407. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9408. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  9409. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  9410. sparray2.Add(sparray.ElementAt(i).ElementAt(8));
  9411. }
  9412. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  9413. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  9414. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  9415. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  9416. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  9417. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  9418. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  9419. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  9420. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  9421. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  9422. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  9423. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  9424. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  9425. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  9426. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  9427. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  9428. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  9429. CString m_bz = g_List1array.ElementAt(0).ElementAt(17);
  9430. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(25);
  9431. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  9432. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  9433. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  9434. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  9435. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  9436. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  9437. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  9438. CString m_waiter8 = g_List1array.ElementAt(0).ElementAt(27);
  9439. CString m_replace = g_List1array.ElementAt(0).ElementAt(28);
  9440. if (!m_replace.IsEmpty())
  9441. {
  9442. m_replace = "设计替换照片:" + m_replace;
  9443. m_replace.Replace("$", ";");
  9444. m_replace.TrimLeft(";");
  9445. m_bz += ";";
  9446. m_bz += m_replace;
  9447. }
  9448. CString m_sum3;
  9449. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  9450. ::ConvertToPrice(m_sum3);
  9451. if (m_money3.IsEmpty())m_money3 = "0";
  9452. int dty = 0;
  9453. CString name;
  9454. if (!m_name1.IsEmpty())
  9455. name = m_name1 + ",";
  9456. name += m_name2;
  9457. name.TrimRight(",");
  9458. CString phone;
  9459. if (!m_phone1.IsEmpty())
  9460. phone = m_phone1 + ",";
  9461. phone += m_phone2; phone.TrimRight(",");
  9462. if (IsHasRights2new(31) == 0)
  9463. phone = "***";
  9464. CStringArray strarray;
  9465. #ifdef CHILD_VERSION
  9466. if (m_birthday.IsEmpty())
  9467. strarray.Add("姓名/性别");
  9468. else
  9469. strarray.Add("姓名/性别/年龄");
  9470. #else
  9471. strarray.Add("客人姓名");
  9472. #endif
  9473. strarray.Add("电话");
  9474. strarray.Add("单号");
  9475. strarray.Add("套系");
  9476. strarray.Add("");
  9477. strarray.Add("余款/加挑");
  9478. strarray.Add("看设计/日期");
  9479. #ifdef CHILD_VERSION
  9480. if (m_birthday.IsEmpty())
  9481. strarray.Add(name + "/" + m_sex);
  9482. else
  9483. {
  9484. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  9485. m_birthday.Format("%d", year + 1);
  9486. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  9487. }
  9488. #else
  9489. strarray.Add(name);
  9490. #endif
  9491. strarray.Add(phone);
  9492. strarray.Add(strOrderNumber);
  9493. strarray.Add(m_taoxiname);
  9494. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9495. strarray.Add("");
  9496. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  9497. strarray.Add(str);
  9498. strarray.Add(m_waiter8 + "/" + m_time6);
  9499. //////////////////////////////////////////////
  9500. if (1)
  9501. {
  9502. StrRect = load.m_rcarray.ElementAt(6);
  9503. int addwid = StrRect.Width() / 6;
  9504. for (i = 3; i <= 6; i++)
  9505. {
  9506. StrRect = load.m_rcarray.ElementAt(i - 1);
  9507. StrRect.left += (i - 3)*addwid;
  9508. StrRect.right += (i - 2)*addwid;
  9509. load.m_rcarray.SetAt(i - 1, StrRect);
  9510. }
  9511. StrRect.left = StrRect.right = -1;
  9512. load.m_rcarray.SetAt(6, StrRect);
  9513. for (i = 10; i <= 13; i++)
  9514. {
  9515. StrRect = load.m_rcarray.ElementAt(i - 1);
  9516. StrRect.left += (i - 10)*addwid;
  9517. StrRect.right += (i - 9)*addwid;
  9518. load.m_rcarray.SetAt(i - 1, StrRect);
  9519. }
  9520. StrRect.left = StrRect.right = -1;
  9521. load.m_rcarray.SetAt(13, StrRect);
  9522. StrRect = load.m_rcarray.ElementAt(7);
  9523. int rcwid = StrRect.Width();
  9524. StrRect.left = load.m_rcarray.ElementAt(5).right;
  9525. StrRect.right = StrRect.left + rcwid + addwid;
  9526. load.m_rcarray.SetAt(7, StrRect);
  9527. StrRect = load.m_rcarray.ElementAt(8);
  9528. StrRect.left = load.m_rcarray.ElementAt(7).right;
  9529. StrRect.right = load.m_rcarray.ElementAt(29).left;
  9530. load.m_rcarray.SetAt(8, StrRect);
  9531. StrRect = load.m_rcarray.ElementAt(14);
  9532. rcwid = StrRect.Width();
  9533. StrRect.left = load.m_rcarray.ElementAt(12).right;
  9534. StrRect.right = StrRect.left + rcwid + addwid;
  9535. load.m_rcarray.SetAt(14, StrRect);
  9536. StrRect = load.m_rcarray.ElementAt(15);
  9537. StrRect.left = load.m_rcarray.ElementAt(14).right;
  9538. StrRect.right = load.m_rcarray.ElementAt(29).left;
  9539. load.m_rcarray.SetAt(15, StrRect);
  9540. }
  9541. ////////////////////////////////////////////////
  9542. for (i = 3; i <= 16; i++)
  9543. {
  9544. StrRect = load.m_rcarray.ElementAt(i - 1);
  9545. if (i < 10)
  9546. {
  9547. m_Print.DrawRect2(StrRect, 1);
  9548. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9549. }
  9550. }
  9551. StrRect = load.m_rcarray.ElementAt(29);
  9552. m_Print.DrawRect2(StrRect, 1);
  9553. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9554. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  9555. {
  9556. Image *pImg = NULL;
  9557. g_nSendCode = 31;
  9558. int g_nYearposTemp = g_nYearpos;
  9559. g_nYearpos = -1;
  9560. g_pMainWnd->ProcessChatMessageRequest2(1);
  9561. g_nYearpos = g_nYearposTemp;
  9562. g_nSendCode = 0;
  9563. if (g_bSendOK == 0)return;
  9564. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  9565. if (pImg)
  9566. {
  9567. StrRect.left = 485;
  9568. StrRect.top = 12;
  9569. StrRect.right = StrRect.left + 60;
  9570. StrRect.bottom = StrRect.top + 60;
  9571. m_Print.DrawImage(pImg, StrRect);
  9572. delete pImg; pImg = NULL;
  9573. }
  9574. }
  9575. CArray<CRect, CRect>rcarray;
  9576. CStringArray strarray2;
  9577. for (i = 10; i <= 16; i++)
  9578. {
  9579. StrRect = load.m_rcarray.ElementAt(i - 1);
  9580. StrRect.left += 2;
  9581. StrRect.right -= 2;
  9582. StrRect.top += 2;
  9583. rcarray.Add(StrRect);
  9584. strarray2.Add(strarray.ElementAt(7 + i - 10));
  9585. }
  9586. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9587. for (i = 10; i <= 16; i++)
  9588. {
  9589. StrRect = load.m_rcarray.ElementAt(i - 1);
  9590. if (i == 10)
  9591. {
  9592. dty += bottom - StrRect.bottom;
  9593. }
  9594. StrRect.bottom = bottom;
  9595. m_Print.DrawRect2(StrRect, 1);
  9596. }
  9597. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  9598. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  9599. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  9600. m_Print.SetFontFace(15, 1, "宋体");
  9601. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  9602. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9603. m_Print.SetFontFace(9, 1, "宋体");
  9604. strarray.RemoveAll();
  9605. strarray.Add("产品名称");
  9606. strarray.Add("数量");
  9607. strarray.Add("照片编号");
  9608. CArray<CRect, CRect>rc2array;
  9609. for (i = 18; i <= 20; i++)
  9610. {
  9611. StrRect = load.m_rcarray.ElementAt(i - 1); StrRect.top += dty; StrRect.bottom += dty;
  9612. m_Print.DrawRect2(StrRect, 1);
  9613. StrRect.left += 2;
  9614. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9615. StrRect.left -= 2;
  9616. StrRect.top = StrRect.bottom;
  9617. StrRect.bottom += 18;
  9618. rc2array.Add(StrRect);
  9619. }
  9620. int curypos = 0;
  9621. for (i = 0; i < sparray2.GetSize(); i += 3)
  9622. {
  9623. rcarray.RemoveAll();
  9624. strarray2.RemoveAll();
  9625. int j = 0;
  9626. for ( j = 0; j < 3; j++)
  9627. {
  9628. StrRect = rc2array.ElementAt(j);
  9629. StrRect.left += 2;
  9630. StrRect.right -= 2;
  9631. StrRect.top += 2;
  9632. rcarray.Add(StrRect);
  9633. #if JEFF_TEST_ON
  9634. if (2 == j)
  9635. {
  9636. CString strImg = sparray2.ElementAt(i + 2);
  9637. int nImgCount = strImg.Replace(",", ",");
  9638. if (nImgCount != 0)
  9639. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
  9640. else if (!strImg.IsEmpty())
  9641. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  9642. strarray2.Add(strImg);
  9643. }
  9644. else
  9645. strarray2.Add(sparray2.ElementAt(i + j));
  9646. #else
  9647. strarray2.Add(sparray2.ElementAt(i + j));
  9648. #endif
  9649. }
  9650. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9651. rcarray.RemoveAll();
  9652. for (j = 0; j < 3; j++)
  9653. {
  9654. StrRect = rc2array.ElementAt(j);
  9655. if (j == 0)
  9656. {
  9657. dty += bottom - StrRect.bottom;
  9658. }
  9659. StrRect.bottom = bottom;
  9660. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  9661. StrRect.top = StrRect.bottom;
  9662. StrRect.bottom += 18;
  9663. rcarray.Add(StrRect);
  9664. }
  9665. rc2array.RemoveAll();
  9666. rc2array.Copy(rcarray);
  9667. }
  9668. m_Print.SetFontFace(15, 1, "宋体");
  9669. StrRect = load.m_rcarray.ElementAt(20);
  9670. dty = curypos - StrRect.bottom + 35;
  9671. StrRect.top += dty; StrRect.bottom += dty;
  9672. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9673. m_Print.SetFontFace(9, 1, "宋体");
  9674. rcarray.RemoveAll();
  9675. strarray2.RemoveAll();
  9676. StrRect = load.m_rcarray.ElementAt(21);
  9677. StrRect.top += dty;
  9678. StrRect.bottom += dty;
  9679. StrRect.left += 2;
  9680. StrRect.right -= 2;
  9681. StrRect.top += 2;
  9682. rcarray.Add(StrRect);
  9683. #if JEFF_TEST_ON
  9684. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  9685. strarray2.RemoveAll();
  9686. CString strFind = "要求:";
  9687. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  9688. do
  9689. {
  9690. int nIndex = strbz3.Find(strFind, 1);
  9691. if (nIndex != -1)
  9692. {
  9693. CString strbz = strbz3.Left(nIndex);
  9694. strbz3 = strbz3.Mid(nIndex);
  9695. strarray2.Add(strbz);
  9696. }
  9697. else
  9698. {
  9699. strarray2.Add(strbz3);
  9700. strbz3 = "";
  9701. }
  9702. } while (strbz3.Find(strFind) != -1);
  9703. strarray2.Add(g_List1array.ElementAt(0).ElementAt(25));
  9704. if (!m_replace.IsEmpty())
  9705. {
  9706. m_replace = "设计替换照片:" + m_replace;
  9707. m_replace.Replace("$", ";");
  9708. m_replace.TrimLeft(";");
  9709. }
  9710. strarray2.Add(m_replace);
  9711. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  9712. #else
  9713. strarray2.Add(m_bz);
  9714. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9715. #endif
  9716. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  9717. dty += bottom - StrRect.bottom;
  9718. StrRect.bottom = bottom;
  9719. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  9720. m_Print.SetFontFace(10, 1, "宋体");
  9721. StrRect = load.m_rcarray.ElementAt(22);
  9722. dty = curypos - StrRect.bottom + 25;
  9723. StrRect.top += dty; StrRect.bottom += dty;
  9724. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  9725. if (m_edit9.IsEmpty())
  9726. {
  9727. m_edit9 = "\
  9728. 经确认后的照片均排入制作流程,\r\n\
  9729. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9730. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9731. }
  9732. CString info1, info2, info3;
  9733. int newlinepos = m_edit9.Find("\r\n");
  9734. if (newlinepos != -1)
  9735. {
  9736. info1 = m_edit9.Left(newlinepos);
  9737. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9738. }
  9739. newlinepos = m_edit9.Find("\r\n");
  9740. if (newlinepos != -1)
  9741. {
  9742. info2 = m_edit9.Left(newlinepos);
  9743. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9744. info3 = m_edit9;
  9745. }
  9746. if (1)
  9747. {
  9748. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9749. StrRect = load.m_rcarray.ElementAt(23);
  9750. StrRect.top += dty; StrRect.bottom += dty;
  9751. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9752. StrRect = load.m_rcarray.ElementAt(24);
  9753. StrRect.top += dty; StrRect.bottom += dty;
  9754. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9755. }
  9756. else
  9757. {
  9758. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9759. StrRect = load.m_rcarray.ElementAt(23);
  9760. StrRect.top += dty; StrRect.bottom += dty;
  9761. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9762. StrRect = load.m_rcarray.ElementAt(24);
  9763. StrRect.top += dty; StrRect.bottom += dty;
  9764. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9765. }
  9766. StrRect = load.m_rcarray.ElementAt(25);
  9767. StrRect.top += dty; StrRect.bottom += dty;
  9768. m_Print.DrawText((LPTSTR)(LPCTSTR)"贵宾签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9769. StrRect = load.m_rcarray.ElementAt(26);
  9770. StrRect.top += dty; StrRect.bottom += dty;
  9771. m_Print.DrawRect2(StrRect, 2);
  9772. m_Print.SetFontFace(9, 1, "宋体");
  9773. StrRect = load.m_rcarray.ElementAt(27);
  9774. StrRect.top += dty; StrRect.bottom += dty;
  9775. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9776. StrRect = load.m_rcarray.ElementAt(28);
  9777. StrRect.top += dty; StrRect.bottom += dty;
  9778. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9779. PrintPreview dlg;//dlg.m_mode=2;
  9780. dlg.m_name = name;
  9781. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  9782. dlg.m_pDC = m_Print.GetPDC();
  9783. if (aa == 0)
  9784. {
  9785. if (dlg.DoModal() != IDOK)
  9786. return;
  9787. printcot = dlg.m_num;
  9788. }
  9789. //结束打印
  9790. m_Print.EndPage();
  9791. m_Print.EndPrint();
  9792. }
  9793. }
  9794. /*
  9795. void CMainFrame::PrintFlowChart(CString m_id)
  9796. {
  9797. CPrintRX m_Print;
  9798. m_Print.InitToPrint(NULL, 1);
  9799. m_Print.StartPrint();
  9800. m_Print.StartPage();
  9801. // CRect StrRect(0,0,560,818);
  9802. LoadRect load;
  9803. load.SetLiaPath ("4.lia");
  9804. load.SetMargins(-14,-14);
  9805. if(!load.Load ())return;
  9806. LoadRect load2;
  9807. load2.SetMargins(-14,472+27-14);
  9808. load2.SetLiaPath ("5.lia");
  9809. if(!load2.Load ())return;
  9810. //////////////////////////////////////////////////////////////
  9811. CString filter="id='"+m_id+"';id='"+m_id+"'";
  9812. g_sendhead.code[0]=54;
  9813. g_sendhead.code[1]=50;
  9814. g_sendhead.tabcount=2;
  9815. g_sendhead.bsql=0;
  9816. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9817. CArray<CStringArray, CStringArray>sparray;
  9818. DataToArray(&g_List1array,&sparray);
  9819. CString spno;
  9820. for(int i=0; i<sparray.GetSize (); i++)
  9821. {
  9822. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册")continue;
  9823. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9824. spno+=sparray.ElementAt (i).ElementAt (5);
  9825. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  9826. spno+=";";
  9827. else
  9828. {
  9829. spno+=":";
  9830. spno+=sparray.ElementAt (i).ElementAt (6);
  9831. spno+=";";
  9832. }
  9833. }
  9834. spno+=" 加挑:";
  9835. for( i=0; i<sparray.GetSize (); i++)
  9836. {
  9837. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9838. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9839. spno+=sparray.ElementAt (i).ElementAt (5);
  9840. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  9841. spno+=";";
  9842. else
  9843. {
  9844. spno+=":";
  9845. spno+=sparray.ElementAt (i).ElementAt (6);
  9846. spno+=";";
  9847. }
  9848. }
  9849. if(spno.Right (6)==" 加挑:")
  9850. {
  9851. spno=spno.Left (spno.GetLength ()-6);
  9852. }
  9853. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9854. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9855. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9856. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9857. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9858. if(m_urgent.IsEmpty ())m_urgent="否";
  9859. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9860. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9861. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9862. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9863. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9864. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9865. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9866. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9867. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9868. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9869. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9870. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17);
  9871. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9872. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9873. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9874. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9875. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9876. CString m_sum3;
  9877. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9878. ::ConvertToPrice (m_sum3);
  9879. if(m_money3.IsEmpty ())m_money3="0";
  9880. // m_money3=m_money3+"/"+m_sum3;
  9881. CString name;
  9882. if(!m_name1.IsEmpty ())
  9883. name=m_name1+",";
  9884. name+=m_name2;
  9885. name.TrimRight (",");
  9886. CString phone;
  9887. if(!m_phone1.IsEmpty ())
  9888. phone=m_phone1+",";
  9889. phone+=m_phone2;phone.TrimRight (",");
  9890. CStringArray strarray;
  9891. strarray.Add (m_urgent);
  9892. strarray.Add (m_ren);
  9893. strarray.Add (m_waiter3);
  9894. strarray.Add (name);
  9895. strarray.Add (m_time2);
  9896. strarray.Add (m_time4);
  9897. strarray.Add (m_time5);
  9898. strarray.Add (m_money3);
  9899. strarray.Add (m_takezs);
  9900. strarray.Add (m_taoxizs);
  9901. strarray.Add (m_choosezs);
  9902. strarray.Add (m_id);
  9903. strarray.Add (phone);
  9904. ////////////////////////////////////////////////////////////////
  9905. int rcpos=-1;
  9906. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9907. Image *pImg=NULL;
  9908. #ifdef MNLS_VERSION
  9909. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  9910. #else
  9911. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  9912. #endif
  9913. m_Print.DrawImage(pImg, StrRect);
  9914. delete pImg;
  9915. m_Print.SetFontFace(15, 1, "宋体");
  9916. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9917. #ifdef MNLS_VERSION
  9918. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9919. #endif
  9920. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9921. #ifdef MNLS_VERSION
  9922. m_Print.DrawRect(StrRect);
  9923. #endif
  9924. m_Print.SetFontFace(7, 1, "黑体");
  9925. m_Print.SetColor(0xffffff);
  9926. #ifdef MNLS_VERSION
  9927. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9928. #endif
  9929. m_Print.SetColor(0);
  9930. m_Print.SetFontFace(25, 1, "黑体");
  9931. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9932. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9933. CString title[13]={"是否加急:","接单门市:","选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","取件日期:","加挑/余款:","拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  9934. m_Print.SetFontFace(12, 1, "宋体");
  9935. for( i=0; i<13; i++)
  9936. {
  9937. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9938. if(i<3)
  9939. m_Print.DrawRect2(StrRect, 0);
  9940. else
  9941. m_Print.DrawRect2(StrRect, 1);
  9942. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9943. }
  9944. for( i=18; i<=37; i++)
  9945. {
  9946. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9947. if(i>=19&&i<=21)
  9948. m_Print.DrawRect2(StrRect, 2);
  9949. else if(i==26)
  9950. {
  9951. CRect rc=StrRect;
  9952. CRect rc2=rc;
  9953. rc.right -=rc2.Width ()/2;
  9954. m_Print.DrawRect2(rc, 1);
  9955. rc2.left +=rc.Width ();
  9956. m_Print.DrawRect2(rc2, 1);
  9957. }
  9958. else
  9959. m_Print.DrawRect2(StrRect, 1);
  9960. if(i==18)
  9961. {
  9962. StrRect.left +=5;
  9963. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9964. }
  9965. }
  9966. //////////////////////////////////////
  9967. rcpos=-1;
  9968. for( i=0; i<8; i++)
  9969. {
  9970. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9971. m_Print.DrawRect2(StrRect, 1);
  9972. }
  9973. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客签名:"};
  9974. for( i=0; i<4; i++)
  9975. {
  9976. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9977. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9978. }
  9979. for( i=0; i<4; i++)
  9980. {
  9981. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9982. m_Print.DrawRect2(StrRect, 2);
  9983. }
  9984. ///////////////////////////////////////////
  9985. for( i=19; i<=31; i++)
  9986. {
  9987. StrRect=load.m_rcarray .ElementAt (i-1);
  9988. StrRect.left +=4;
  9989. if(i==31)
  9990. {
  9991. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  9992. {
  9993. StrRect.top +=2;
  9994. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  9995. StrRect.top +=8;
  9996. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9997. }
  9998. else
  9999. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10000. }
  10001. else if((i-19)==7)
  10002. {
  10003. CRect rc=StrRect;
  10004. CRect rc2=rc;
  10005. rc.right -=rc2.Width ()/2;
  10006. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10007. rc2.left +=rc.Width ()+3;
  10008. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10009. }
  10010. else
  10011. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10012. }
  10013. strarray.RemoveAll ();
  10014. strarray.Add (m_waiter2);
  10015. strarray.Add (m_waiter1);
  10016. strarray.Add (m_waiter4);
  10017. for( i=13; i<=15; i++)
  10018. {
  10019. StrRect=load2.m_rcarray .ElementAt (i-1);
  10020. StrRect.left +=4;
  10021. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10022. }
  10023. ///////////spno
  10024. CRect sprc[14];
  10025. for(i=0; i<14; i++)
  10026. {
  10027. if(i<7)
  10028. {
  10029. if(i==0)
  10030. {
  10031. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  10032. }
  10033. else
  10034. {
  10035. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  10036. }
  10037. }
  10038. else
  10039. {
  10040. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  10041. }
  10042. sprc[i]=StrRect;
  10043. // m_Print.DrawText((LPTSTR)(LPCTSTR)"xxx", sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10044. }
  10045. CString temp,tempspno,tempbz;
  10046. CSize size;
  10047. BOOL bRun=0;
  10048. int fontsize=12;
  10049. ll: tempspno=spno;
  10050. tempbz=m_bz;
  10051. m_Print.SetFontFace(fontsize, 1, "宋体");
  10052. for( i=0; i<14; i++)
  10053. {
  10054. if(!tempspno.IsEmpty ())
  10055. {
  10056. temp=tempspno;
  10057. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10058. int right=0;
  10059. CRect temprc=sprc[i];
  10060. while(size.cx>temprc.Width ())
  10061. {
  10062. right++;
  10063. temp=tempspno.Left (tempspno.GetLength ()-(right));
  10064. if(GIsHalfHZ(temp))
  10065. {
  10066. right++;
  10067. temp.Delete (temp.GetLength ()-1);
  10068. }
  10069. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10070. }
  10071. if(bRun)
  10072. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10073. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  10074. if(tempspno.IsEmpty ())i++;
  10075. }
  10076. else if(!tempbz.IsEmpty ())
  10077. {
  10078. temp=tempbz;
  10079. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10080. int right=0;
  10081. CRect temprc=sprc[i];
  10082. while(size.cx>temprc.Width ())
  10083. {
  10084. right++;
  10085. temp=tempbz.Left (tempbz.GetLength ()-(right));
  10086. if(GIsHalfHZ(temp))
  10087. {
  10088. right++;
  10089. temp.Delete (temp.GetLength ()-1);
  10090. }
  10091. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10092. }
  10093. if(bRun)
  10094. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10095. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  10096. }
  10097. }
  10098. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  10099. {
  10100. fontsize--;
  10101. goto ll;
  10102. }
  10103. if(bRun==0)
  10104. {
  10105. bRun=1;
  10106. goto ll;
  10107. }
  10108. PrintPreview dlg;
  10109. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  10110. dlg.m_pDC =m_Print.GetPDC() ;
  10111. if(dlg.DoModal ()!=IDOK)return;
  10112. //结束打印
  10113. m_Print.EndPage();
  10114. m_Print.EndPrint();
  10115. }
  10116. void CMainFrame::SetSelFolder(int pos)
  10117. {
  10118. m_wndToolBar2.SetSelFolder(pos);
  10119. }*/
  10120. void CMainFrame::ToPhotoPrint()
  10121. {
  10122. UINT nID = 1;
  10123. LPSTR pName;
  10124. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  10125. OPEN_MENU(PhotoPrintFrom);
  10126. }
  10127. void CMainFrame::GetOcx()
  10128. {
  10129. char path[MAX_PATH];
  10130. ::GetSystemDirectory(path, MAX_PATH);
  10131. CString syspath = path;
  10132. try
  10133. {
  10134. if (!::PathFileExists(syspath + "\\MSCHRT20.OCX"))
  10135. {
  10136. g_sendhead.bsql = 0;
  10137. g_sendhead.code[0] = 103;
  10138. g_sendhead.tabcount = 1;
  10139. g_pMainWnd->ProcessChatMessageRequest2(1); if (g_bSendOK == 0)return;
  10140. CFile fp;
  10141. if (fp.Open(syspath + "\\MSCHRT20.OCX", CFile::modeWrite | CFile::modeCreate))
  10142. {
  10143. fp.Write(g_pData, g_nLeng);
  10144. fp.Close();
  10145. ::Sleep(1000);
  10146. }
  10147. }
  10148. CString temp;
  10149. temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10150. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10151. }
  10152. catch (...)
  10153. {
  10154. }
  10155. try
  10156. {
  10157. CString temp;
  10158. temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10159. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10160. }
  10161. catch (...)
  10162. {
  10163. }
  10164. }
  10165. void CMainFrame::OnServer()
  10166. {
  10167. // TODO: Add your command handler code here
  10168. DBConfig dlg;
  10169. dlg.DoModal();
  10170. }
  10171. void CMainFrame::OnPath()
  10172. {
  10173. // TODO: Add your command handler code here
  10174. if (g_user.bLongin == 0)
  10175. {
  10176. if (g_bNoLoginLia)
  10177. {
  10178. Login dlg;
  10179. dlg.SetLiaPath("5.lia");
  10180. dlg.DoModal();
  10181. }
  10182. else
  10183. {
  10184. Login3 dlg;
  10185. dlg.SetLiaPath("5.lia");
  10186. dlg.DoModal();
  10187. }
  10188. if (g_user.bLongin == 0)return;
  10189. }
  10190. if (IsHasRightsnew(49) == 0)return;
  10191. SetPathDlg2 dlg;
  10192. dlg.DoModal();
  10193. }
  10194. void CMainFrame::OnShowhis()
  10195. {
  10196. // TODO: Add your command handler code here
  10197. if (g_user.bLongin == 0)
  10198. {
  10199. if (g_bNoLoginLia)
  10200. {
  10201. Login dlg;
  10202. dlg.SetLiaPath("5.lia");
  10203. dlg.DoModal();
  10204. }
  10205. else
  10206. {
  10207. Login3 dlg;
  10208. dlg.SetLiaPath("5.lia");
  10209. dlg.DoModal();
  10210. }
  10211. if (g_user.bLongin == 0)return;
  10212. }
  10213. if (IsHasRightsnew(52) == 0)return;
  10214. CMenu *pMenu = GetMenu();
  10215. CMenu* submenu = pMenu->GetSubMenu(2);
  10216. UINT status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
  10217. if (status&MF_CHECKED)
  10218. {
  10219. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_UNCHECKED);
  10220. g_bShowOK = 1;
  10221. }
  10222. else
  10223. {
  10224. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  10225. g_bShowOK = 0;
  10226. } m_Mdi.CloseAll();
  10227. }
  10228. void CMainFrame::AddHistoryMenu(CArray<CStringArray, CStringArray>*hisyeararray)
  10229. {
  10230. #ifdef NEW_SKIN
  10231. CMenu *m_menuXP = GetMenu();
  10232. CMenu* submenu = m_menuXP->GetSubMenu(2);
  10233. int i = 0;
  10234. for ( i = 0; i < 100; i++)
  10235. {
  10236. submenu->DeleteMenu(1000 + i, MF_BYCOMMAND);
  10237. }
  10238. for (i = 0; i < hisyeararray->GetSize(); i++)
  10239. {
  10240. submenu->AppendMenu(MF_STRING, 1000 + i, "查看历史数据:" + hisyeararray->ElementAt(i).ElementAt(0)); // 第一项菜单项
  10241. }
  10242. g_nYearpos = -1;
  10243. #else
  10244. HMENU hMenu = ::GetMenu(m_hWnd);
  10245. m_menuXP.Attach(hMenu);
  10246. BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
  10247. for (int i = 0; i < 100; i++)
  10248. {
  10249. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10250. }
  10251. for( i=0; i<hisyeararray->GetSize (); i++)
  10252. {
  10253. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10254. }
  10255. m_menuXP.Detach ();
  10256. g_nYearpos = -1;
  10257. #endif
  10258. }
  10259. /************************************************************************/
  10260. /*
  10261. Jeff
  10262. 函数:AddBranchMenu()
  10263. 参数:CArray<CStringArray, CStringArray> *hisyeararray
  10264. 返回:void
  10265. 注意:
  10266. 调用关系:
  10267. */
  10268. /************************************************************************/
  10269. void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*hisyeararray)
  10270. {
  10271. //WriteClientLog("AddBranchMenu,添加集团版菜单");
  10272. #ifdef ENTERPRISE_VERSION
  10273. CMenu *m_menuXP = GetMenu();
  10274. CMenu* submenu = m_menuXP->GetSubMenu(0);
  10275. for (int i = 0; i < 100; i++)
  10276. {
  10277. submenu->DeleteMenu(2000 + i, MF_BYCOMMAND);
  10278. }
  10279. g_menubranchname.RemoveAll();
  10280. CString name;
  10281. int a = 0;
  10282. #if 0 // Jeff.add for test
  10283. CString strCount;
  10284. strCount.Format("历史数据库个数=%d", hisyeararray->GetSize());
  10285. WriteClientLog(strCount);
  10286. #endif
  10287. for (i = 0; i < hisyeararray->GetSize() - 1; i++)
  10288. {
  10289. //WriteClientLog("111");
  10290. //WriteClientLog(hisyeararray->ElementAt(i).ElementAt(0));
  10291. //WriteClientLog(name);
  10292. if (name == "")
  10293. {
  10294. name = hisyeararray->ElementAt(i).ElementAt(0);
  10295. #ifndef SQLSERVER_VERSION
  10296. submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
  10297. a++;
  10298. #endif
  10299. submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
  10300. a++;
  10301. g_menubranchname.Add(name);
  10302. continue;
  10303. }
  10304. else if (hisyeararray->ElementAt(i).ElementAt(0).Find(name) != -1 && ((hisyeararray->ElementAt(i).ElementAt(0).GetLength() - name.GetLength()) == 4))
  10305. {
  10306. continue;
  10307. }
  10308. name = hisyeararray->ElementAt(i).ElementAt(0);
  10309. #ifndef SQLSERVER_VERSION
  10310. submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
  10311. a++;
  10312. #endif
  10313. submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
  10314. g_menubranchname.Add(name);
  10315. a++;
  10316. //WriteClientLog("222");
  10317. }
  10318. if ((hisyeararray->GetSize() - 1) > 0)
  10319. {
  10320. if (hisyeararray->ElementAt(0).ElementAt(3) == "总店")
  10321. submenu->AppendMenu(MF_STRING, 2000 + a, "多店数据汇总");
  10322. }
  10323. #endif
  10324. }
  10325. void CMainFrame::OnHistory(UINT nID)
  10326. {
  10327. CMenu *pMenu = GetMenu();
  10328. CMenu* submenu = pMenu->GetSubMenu(2);
  10329. UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
  10330. if (g_user.bLongin == 0)
  10331. {
  10332. if (g_bNoLoginLia)
  10333. {
  10334. Login dlg;
  10335. dlg.SetLiaPath("5.lia");
  10336. dlg.DoModal();
  10337. }
  10338. else
  10339. {
  10340. Login3 dlg;
  10341. dlg.SetLiaPath("5.lia");
  10342. dlg.DoModal();
  10343. }
  10344. if (g_user.bLongin == 0)return;
  10345. }
  10346. if (IsHasRightsnew(52) == 0)return;
  10347. m_Mdi.CloseAll();
  10348. for (int i = 0; i < 100; i++)
  10349. {
  10350. submenu->CheckMenuItem(1000 + i, MF_BYCOMMAND | MF_UNCHECKED);
  10351. }
  10352. if (status&MF_CHECKED)
  10353. {
  10354. g_nYearpos = -1;
  10355. status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
  10356. if (status&MF_CHECKED)
  10357. g_bShowOK = 0;
  10358. else
  10359. g_bShowOK = 1;
  10360. }
  10361. else
  10362. {
  10363. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10364. g_nYearpos = nID - 1000;
  10365. g_bShowOK = 1;
  10366. }
  10367. }
  10368. void CMainFrame::OnBranchData(UINT nID)
  10369. {
  10370. #ifdef ENTERPRISE_VERSION
  10371. #ifdef SQLSERVER_VERSION
  10372. OnBranchData2(nID);
  10373. return;
  10374. #endif
  10375. /* g_bAllBranch=0;
  10376. m_Mdi.CloseAll();
  10377. OnDisconnect();
  10378. CMenu *pMenu=GetMenu();
  10379. CMenu* submenu = pMenu->GetSubMenu(0);
  10380. UINT status=submenu->GetMenuState(nID, MF_BYCOMMAND );
  10381. for(int i=0; i<100; i++)
  10382. {
  10383. submenu-> CheckMenuItem(2000+i, MF_BYCOMMAND | MF_UNCHECKED);
  10384. }
  10385. if(status&MF_CHECKED)
  10386. {
  10387. g_branchname.Empty (); g_branchip.Empty (); g_bBranchModify=0;
  10388. g_user.bLongin=0;
  10389. if(g_bNoLoginLia)
  10390. {
  10391. Login dlg;
  10392. dlg.SetLiaPath ("5.lia");
  10393. dlg.DoModal();
  10394. }
  10395. else
  10396. {
  10397. Login3 dlg;
  10398. dlg.SetLiaPath ("5.lia");
  10399. dlg.DoModal();
  10400. }
  10401. g_pMainWnd2->RefreshOutlookBar();
  10402. g_pMainWnd2->DrawLogin();
  10403. g_path1=g_path1bak;
  10404. g_path2=g_path2bak;
  10405. g_path3=g_path3bak;
  10406. g_path4=g_path4bak;
  10407. g_path5=g_path5bak;
  10408. g_path6=g_path6bak;
  10409. g_path7=g_path7bak;
  10410. g_pMainWnd2->EnableBtns(1);
  10411. }
  10412. else
  10413. {
  10414. BOOL bNeedCheckRights=1;
  10415. if(g_user.bLongin && g_branchname=="")//无需登陆本店判断其访问分店权限
  10416. {
  10417. bNeedCheckRights=0;
  10418. }
  10419. #ifndef SQLSERVER_VERSION
  10420. if((g_menubranchname.GetSize ()*2)==nID-2000)//多店数据汇总
  10421. #else
  10422. if((g_menubranchname.GetSize ())==nID-2000)//多店数据汇总
  10423. #endif
  10424. {
  10425. g_branchname.Empty ();
  10426. g_branchip.Empty (); g_bBranchModify=0;
  10427. if(bNeedCheckRights)
  10428. {
  10429. g_user.bLongin=0;
  10430. if(g_user.bLongin==0)
  10431. {
  10432. if(g_bNoLoginLia)
  10433. {
  10434. Login dlg;
  10435. dlg.SetLiaPath ("5.lia");
  10436. dlg.DoModal();
  10437. }
  10438. else
  10439. {
  10440. Login3 dlg;
  10441. dlg.SetLiaPath ("5.lia");
  10442. dlg.DoModal();
  10443. }
  10444. if(g_user.bLongin==0)return;
  10445. }
  10446. }
  10447. if(IsHasRightsnew(28)==0)
  10448. {
  10449. return;
  10450. }
  10451. g_bAllBranch=1;g_pMainWnd2->ShowBar (0);
  10452. g_pMainWnd2->RefreshOutlookBar2();
  10453. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10454. g_branchname.Empty ();
  10455. g_branchip.Empty ();
  10456. g_bBranchModify=0;
  10457. g_pMainWnd2->DrawLogin();
  10458. g_pMainWnd2->EnableBtns(0);
  10459. g_path1=g_path1bak;
  10460. g_path2=g_path2bak;
  10461. g_path3=g_path3bak;
  10462. g_path4=g_path4bak;
  10463. g_path5=g_path5bak;
  10464. g_path6=g_path6bak;
  10465. g_path7=g_path7bak;
  10466. }
  10467. else
  10468. {
  10469. if(bNeedCheckRights)
  10470. {
  10471. g_branchname.Empty ();
  10472. g_branchip.Empty ();
  10473. g_bBranchModify=0;
  10474. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
  10475. g_user.bLongin=0;
  10476. if(g_pMainWnd2)
  10477. {
  10478. g_pMainWnd2->DrawLogin();
  10479. g_pMainWnd2->ShowBar (0);
  10480. }
  10481. if(g_bNoLoginLia)
  10482. {
  10483. Login dlg;
  10484. dlg.SetLiaPath ("5.lia");
  10485. dlg.DoModal();
  10486. }
  10487. else
  10488. {
  10489. Login3 dlg;
  10490. dlg.SetLiaPath ("5.lia");
  10491. dlg.DoModal();
  10492. }
  10493. if(g_user.bLongin==0)return;
  10494. }
  10495. if(IsHasRightsnew(28)==0)
  10496. {
  10497. return;
  10498. }
  10499. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10500. #ifndef SQLSERVER_VERSION
  10501. if(nID%2==0)
  10502. g_branchname=g_menubranchname.ElementAt ((nID-2000)/2);
  10503. else
  10504. g_branchname=g_menubranchname.ElementAt ((nID-2001)/2);
  10505. #else
  10506. g_branchname=g_menubranchname.ElementAt (nID-2000);
  10507. #endif
  10508. g_branchip.Empty ();
  10509. CString domainname="";
  10510. for(int i=0; i<g_brancharray.GetSize (); i++)
  10511. {
  10512. if(g_branchname==g_brancharray.ElementAt (i).ElementAt (0))
  10513. {
  10514. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  10515. g_branchip2=g_brancharray.ElementAt (i).ElementAt (4);
  10516. domainname=g_brancharray.ElementAt (i).ElementAt (2);
  10517. }
  10518. }
  10519. g_path1=g_path1bak;
  10520. g_path2=g_path2bak;
  10521. g_path3=g_path3bak;
  10522. g_path4=g_path4bak;
  10523. g_path5=g_path5bak;
  10524. g_path6=g_path6bak;
  10525. g_path7=g_path7bak;
  10526. if(domainname.IsEmpty ())
  10527. {
  10528. g_path1=g_path2=g_path3=g_path4=g_path5=g_path6=g_path7="xxx";
  10529. }
  10530. else
  10531. {
  10532. g_path1+="\\"+domainname;
  10533. g_path2+="\\"+domainname;
  10534. g_path3+="\\"+domainname;
  10535. g_path4+="\\"+domainname;
  10536. g_path5+="\\"+domainname;
  10537. g_path6+="\\"+domainname;
  10538. g_path7+="\\"+domainname;
  10539. }
  10540. if(nID%2==0)
  10541. {
  10542. g_bBranchModify=0;
  10543. }
  10544. else
  10545. {
  10546. g_bBranchModify=1;
  10547. }
  10548. CArray<CStringArray, CStringArray>yeararray;
  10549. for( i=0; i<g_brancharray.GetSize (); i++)
  10550. {
  10551. if(g_brancharray.ElementAt (i).ElementAt (0).Find (g_branchname)!=-1 && g_branchname!=g_brancharray.ElementAt (i).ElementAt (0))
  10552. {
  10553. int size=yeararray.GetSize ();
  10554. yeararray.SetSize(size+1,1);
  10555. CString str=g_brancharray.ElementAt (i).ElementAt (0);
  10556. str.Delete (0, g_branchname.GetLength ());
  10557. yeararray.ElementAt (size).Add (str);
  10558. }
  10559. }
  10560. AddHistoryMenu(&yeararray);
  10561. if(g_bBranchModify)OnDisconnect();
  10562. if(1)
  10563. {
  10564. g_user.bLongin=0;
  10565. g_user.name.Empty ();
  10566. g_user.rights.Empty ();
  10567. g_user.account.Empty ();
  10568. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  10569. g_pMainWnd2->RefreshOutlookBar();
  10570. m_Mdi.CloseAll();
  10571. if(g_pMainWnd2)
  10572. {
  10573. g_pMainWnd2->DrawLogin();
  10574. g_pMainWnd2->ShowBar (0);
  10575. }
  10576. if(g_bNoLoginLia)
  10577. {
  10578. Login dlg;
  10579. dlg.SetLiaPath ("5.lia");
  10580. dlg.DoModal();
  10581. }
  10582. else
  10583. {
  10584. Login3 dlg;
  10585. dlg.SetLiaPath ("5.lia");
  10586. dlg.DoModal();
  10587. }
  10588. if(g_user.bLongin==0)return;
  10589. if(g_pMainWnd2)g_pMainWnd2->ShowBar (1);
  10590. }
  10591. g_pMainWnd2->DrawLogin();
  10592. g_pMainWnd2->EnableBtns(1);
  10593. }
  10594. g_nYearpos=-1;
  10595. }
  10596. */
  10597. #endif
  10598. }
  10599. void CMainFrame::OnBranchData2(UINT nID)
  10600. {
  10601. #ifdef ENTERPRISE_VERSION
  10602. g_bAllBranch = 0;
  10603. m_Mdi.CloseAll();
  10604. OnDisconnect();
  10605. CMenu *pMenu = GetMenu();
  10606. CMenu* submenu = pMenu->GetSubMenu(0);
  10607. UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
  10608. for (int i = 0; i < 100; i++)
  10609. {
  10610. submenu->CheckMenuItem(2000 + i, MF_BYCOMMAND | MF_UNCHECKED);
  10611. }
  10612. if (status&MF_CHECKED)
  10613. {
  10614. g_branchname.Empty();
  10615. g_branchip.Empty();
  10616. g_bBranchModify = 0;
  10617. g_user.bLongin = 0;
  10618. if (g_bNoLoginLia)
  10619. {
  10620. Login dlg;
  10621. dlg.SetLiaPath("5.lia");
  10622. dlg.DoModal();
  10623. }
  10624. else
  10625. {
  10626. Login3 dlg;
  10627. dlg.SetLiaPath("5.lia");
  10628. dlg.DoModal();
  10629. }
  10630. g_pMainWnd2->RefreshOutlookBar();
  10631. g_pMainWnd2->DrawLogin();
  10632. g_path1 = g_path1bak;
  10633. g_path2 = g_path2bak;
  10634. g_path3 = g_path3bak;
  10635. g_path4 = g_path4bak;
  10636. g_path5 = g_path5bak;
  10637. g_path6 = g_path6bak;
  10638. g_path7 = g_path7bak;
  10639. g_pMainWnd2->EnableBtns(1);
  10640. }
  10641. else
  10642. {
  10643. BOOL bNeedCheckRights = 1;
  10644. if (g_user.bLongin && g_branchname == "")//无需登陆本店判断其访问分店权限
  10645. {
  10646. bNeedCheckRights = 0;
  10647. }
  10648. #ifndef SQLSERVER_VERSION
  10649. if ((g_menubranchname.GetSize() * 2) == nID - 2000)//多店数据汇总
  10650. #else
  10651. if ((g_menubranchname.GetSize()) == nID - 2000)//多店数据汇总
  10652. #endif
  10653. {
  10654. g_branchname.Empty();
  10655. g_branchip.Empty();
  10656. g_bBranchModify = 0;
  10657. if (bNeedCheckRights)
  10658. {
  10659. g_user.bLongin = 0;
  10660. if (g_user.bLongin == 0)
  10661. {
  10662. if (g_bNoLoginLia)
  10663. {
  10664. Login dlg;
  10665. dlg.SetLiaPath("5.lia");
  10666. dlg.DoModal();
  10667. }
  10668. else
  10669. {
  10670. Login3 dlg;
  10671. dlg.SetLiaPath("5.lia");
  10672. dlg.DoModal();
  10673. }
  10674. if (g_user.bLongin == 0)return;
  10675. }
  10676. }
  10677. if (IsHasRightsnew(28) == 0)
  10678. {
  10679. return;
  10680. }
  10681. g_bAllBranch = 1; g_pMainWnd2->ShowBar(0);
  10682. g_pMainWnd2->RefreshOutlookBar2();
  10683. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10684. g_branchname.Empty();
  10685. g_branchip.Empty();
  10686. g_bBranchModify = 0;
  10687. g_pMainWnd2->DrawLogin();
  10688. g_pMainWnd2->EnableBtns(0);
  10689. g_path1 = g_path1bak;
  10690. g_path2 = g_path2bak;
  10691. g_path3 = g_path3bak;
  10692. g_path4 = g_path4bak;
  10693. g_path5 = g_path5bak;
  10694. g_path6 = g_path6bak;
  10695. g_path7 = g_path7bak;
  10696. }
  10697. else
  10698. {
  10699. if (bNeedCheckRights)
  10700. {
  10701. g_branchname.Empty();
  10702. g_branchip.Empty();
  10703. g_bBranchModify = 0;
  10704. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
  10705. g_user.bLongin = 0;
  10706. if (g_pMainWnd2)
  10707. {
  10708. g_pMainWnd2->DrawLogin();
  10709. g_pMainWnd2->ShowBar(0);
  10710. }
  10711. if (g_bNoLoginLia)
  10712. {
  10713. Login dlg;
  10714. dlg.SetLiaPath("5.lia");
  10715. dlg.DoModal();
  10716. }
  10717. else
  10718. {
  10719. Login3 dlg;
  10720. dlg.SetLiaPath("5.lia");
  10721. dlg.DoModal();
  10722. }
  10723. if (g_user.bLongin == 0)return;
  10724. }
  10725. if (IsHasRightsnew(28) == 0)
  10726. {
  10727. return;
  10728. }
  10729. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10730. #ifndef SQLSERVER_VERSION
  10731. if (nID % 2 == 0)
  10732. g_branchname = g_menubranchname.ElementAt((nID - 2000) / 2);
  10733. else
  10734. g_branchname = g_menubranchname.ElementAt((nID - 2001) / 2);
  10735. #else
  10736. g_branchname = g_menubranchname.ElementAt(nID - 2000);
  10737. #endif
  10738. g_branchip.Empty();
  10739. CString domainname = "";
  10740. for (int i = 0; i < g_brancharray.GetSize(); i++)
  10741. {
  10742. if (g_branchname == g_brancharray.ElementAt(i).ElementAt(0))
  10743. {
  10744. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  10745. g_branchip2 = g_brancharray.ElementAt(i).ElementAt(4);
  10746. domainname = g_brancharray.ElementAt(i).ElementAt(2);
  10747. }
  10748. }
  10749. g_path1 = g_path1bak;
  10750. g_path2 = g_path2bak;
  10751. g_path3 = g_path3bak;
  10752. g_path4 = g_path4bak;
  10753. g_path5 = g_path5bak;
  10754. g_path6 = g_path6bak;
  10755. g_path7 = g_path7bak;
  10756. if (domainname.IsEmpty())
  10757. {
  10758. g_path1 = g_path2 = g_path3 = g_path4 = g_path5 = g_path6 = g_path7 = "xxx";
  10759. }
  10760. else
  10761. {
  10762. g_path1 += "\\" + domainname;
  10763. g_path2 += "\\" + domainname;
  10764. g_path3 += "\\" + domainname;
  10765. g_path4 += "\\" + domainname;
  10766. g_path5 += "\\" + domainname;
  10767. g_path6 += "\\" + domainname;
  10768. g_path7 += "\\" + domainname;
  10769. }
  10770. g_bBranchModify = 1;
  10771. /* CArray<CStringArray, CStringArray>yeararray;
  10772. for( i=0; i<g_brancharray.GetSize (); i++)
  10773. {
  10774. if(g_brancharray.ElementAt (i).ElementAt (0).Find (g_branchname)!=-1 && g_branchname!=g_brancharray.ElementAt (i).ElementAt (0))
  10775. {
  10776. int size=yeararray.GetSize ();
  10777. yeararray.SetSize(size+1,1);
  10778. CString str=g_brancharray.ElementAt (i).ElementAt (0);
  10779. str.Delete (0, g_branchname.GetLength ());
  10780. yeararray.ElementAt (size).Add (str);
  10781. }
  10782. }
  10783. AddHistoryMenu(&yeararray);*/
  10784. if (g_bBranchModify)OnDisconnect();
  10785. if (1)
  10786. {
  10787. g_user.bLongin = 0;
  10788. g_user.name.Empty();
  10789. g_user.rights.Empty();
  10790. g_user.account.Empty();
  10791. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  10792. g_pMainWnd2->RefreshOutlookBar();
  10793. m_Mdi.CloseAll();
  10794. if (g_pMainWnd2)
  10795. {
  10796. g_pMainWnd2->DrawLogin();
  10797. g_pMainWnd2->ShowBar(0);
  10798. }
  10799. if (g_bNoLoginLia)
  10800. {
  10801. Login dlg;
  10802. dlg.SetLiaPath("5.lia");
  10803. dlg.DoModal();
  10804. }
  10805. else
  10806. {
  10807. Login3 dlg;
  10808. dlg.SetLiaPath("5.lia");
  10809. dlg.DoModal();
  10810. }
  10811. if (g_user.bLongin == 0)return;
  10812. if (g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  10813. }
  10814. g_pMainWnd2->DrawLogin();
  10815. g_pMainWnd2->EnableBtns(1);
  10816. }
  10817. g_nYearpos = -1;
  10818. }
  10819. #endif
  10820. }
  10821. void CMainFrame::OnStaffAchievementShow() //Jeff:此机只用于员工看业绩;
  10822. {
  10823. // TODO: Add your command handler code here
  10824. if (g_user.bLongin == 0) // 是否登陆系统;
  10825. {
  10826. if (g_bNoLoginLia)
  10827. {
  10828. Login dlg;
  10829. dlg.SetLiaPath("5.lia");
  10830. dlg.DoModal();
  10831. }
  10832. else
  10833. {
  10834. Login3 dlg;
  10835. dlg.SetLiaPath("5.lia");
  10836. dlg.DoModal();
  10837. }
  10838. if (g_user.bLongin == 0)return;
  10839. }
  10840. if (IsHasRightsnew(49) == 0)return;// 是否有权限进行设置;
  10841. CString version = _T("Version 1.0");
  10842. CMenu *pMenu = GetMenu();
  10843. CMenu* submenu = pMenu->GetSubMenu(1);
  10844. UINT status = submenu->GetMenuState(IDM_StaffAchievementShow, MF_BYCOMMAND);
  10845. if (status&MF_CHECKED)
  10846. {
  10847. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_UNCHECKED);
  10848. AfxGetApp()->WriteProfileInt(version, "status2", 0);
  10849. g_bStaffAchievementShow = 0;
  10850. TCHAR szKey[MAX_PATH];
  10851. TCHAR szDir[MAX_PATH];
  10852. ::GetModuleFileName(NULL, szDir, MAX_PATH);
  10853. HKEY hKey = 0;
  10854. DWORD disp = 0;
  10855. lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  10856. int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
  10857. if (lResult == ERROR_SUCCESS)
  10858. {
  10859. RegDeleteValue(hKey, "YLGLMAINAUTORUN");
  10860. RegDeleteKey(hKey, "YLGLMAINAUTORUN");
  10861. RegCloseKey(hKey);
  10862. }
  10863. }
  10864. else
  10865. {
  10866. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  10867. AfxGetApp()->WriteProfileInt(version, "status2", 1);
  10868. g_bStaffAchievementShow = 1;
  10869. TCHAR szKey[MAX_PATH];
  10870. TCHAR szDir[MAX_PATH];
  10871. ::GetModuleFileName(NULL, szDir, MAX_PATH);
  10872. HKEY hKey = 0;
  10873. DWORD disp = 0;
  10874. lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  10875. int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
  10876. if (lResult == ERROR_SUCCESS)
  10877. {
  10878. lResult = RegSetValueEx(hKey, "YLGLMAINAUTORUN", 0, REG_SZ, (const unsigned char*)szDir, lstrlen(szDir));
  10879. RegCloseKey(hKey);
  10880. }
  10881. StaffAchievementSet dlg;
  10882. dlg.DoModal();
  10883. }
  10884. }
  10885. void CMainFrame::PrintDinDan2(CString m_id)
  10886. {
  10887. #ifdef MODERN_VERSION
  10888. SelContent seldlg;
  10889. if (seldlg.DoModal() != IDOK)return;
  10890. CPrintRX m_Print;
  10891. m_Print.InitToPrint(NULL, 1);
  10892. m_Print.StartPrint();
  10893. m_Print.StartPage();
  10894. // CRect StrRect(0,0,560,818);
  10895. LoadRect load;
  10896. LoadRect load2;
  10897. LoadRect load3;
  10898. load.SetLiaPath ("9.lia");
  10899. load.SetMargins(-14,0);
  10900. if(!load.Load ())return;
  10901. int i;
  10902. //////////////////////////////////////////////////////////////
  10903. CStringArray txarray;
  10904. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  10905. g_sendhead.code[0]=11;
  10906. g_sendhead.code[1]=52;
  10907. g_sendhead.code[2]=50;
  10908. g_sendhead.code[3]=38;
  10909. g_sendhead.code[4]=27;
  10910. g_sendhead.tabcount=5;
  10911. g_sendhead.bsql=0;
  10912. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  10913. CArray<CStringArray, CStringArray>sparray;
  10914. CArray<CStringArray, CStringArray>clientarray;
  10915. CArray<CStringArray, CStringArray>phonearray;
  10916. CArray<CStringArray, CStringArray>bukuan2array;
  10917. CArray<CStringArray, CStringArray>bukuanarray;
  10918. DataToArray(&g_List1array, &clientarray, &sparray, &bukuan2array, &bukuanarray);
  10919. CTime tm=CTime::GetCurrentTime ();
  10920. CString str;
  10921. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  10922. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  10923. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  10924. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  10925. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  10926. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  10927. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  10928. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  10929. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  10930. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  10931. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  10932. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  10933. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  10934. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  10935. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  10936. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  10937. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  10938. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  10939. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  10940. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  10941. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  10942. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  10943. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  10944. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  10945. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  10946. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  10947. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  10948. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  10949. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  10950. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  10951. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  10952. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  10953. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  10954. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  10955. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  10956. filter="name='"+m_ren+"'";
  10957. g_sendhead.code[0]=5;
  10958. g_sendhead.tabcount=1;
  10959. g_sendhead.bsql=0;
  10960. int g_nYearposTemp=g_nYearpos;
  10961. g_nYearpos=-1;
  10962. g_pMainWnd->ProcessChatMessageRequest2(filter);
  10963. g_nYearpos=g_nYearposTemp;
  10964. if(g_bSendOK==0)return;
  10965. DataToArray(&phonearray);
  10966. m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
  10967. m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
  10968. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  10969. ConvertToPrice(m_money1);
  10970. ConvertToPrice(m_money2);
  10971. ConvertToPrice(m_money3);
  10972. ////////////////////////////////////////////////////////////////
  10973. int rcpos=-1;
  10974. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  10975. Image *pImg=NULL;
  10976. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo2.jpg");
  10977. if(seldlg.m_bFrame)
  10978. m_Print.DrawImage(pImg, StrRect);
  10979. delete pImg;
  10980. m_Print.SetFontFace(16, 1, "黑体");
  10981. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10982. if(seldlg.m_bFrame)
  10983. ///////////////////////////////不用改
  10984. m_Print.DrawText((LPTSTR)(LPCTSTR)"摩登新娘工作流程单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10985. m_Print.SetFontFace(10, 1, "宋体");
  10986. for( i=3; i<=6; i++)
  10987. {
  10988. StrRect=load.m_rcarray .ElementAt (i-1);
  10989. if(seldlg.m_bFrame)
  10990. m_Print.DrawRect2(StrRect, 1);
  10991. }
  10992. CStringArray strarray;
  10993. if(seldlg.m_bBooking==0)
  10994. {
  10995. m_name1.Empty ();
  10996. m_name2.Empty ();
  10997. m_phone1.Empty ();
  10998. m_phone2.Empty ();
  10999. m_addr1.Empty ();
  11000. m_addr2.Empty ();
  11001. m_taoxiname.Empty ();
  11002. m_taoxijiage.Empty ();
  11003. }
  11004. if(seldlg.m_bFrame )
  11005. {
  11006. strarray.Add("新郎:"+m_name1);
  11007. strarray.Add("H");
  11008. strarray.Add("O");
  11009. strarray.Add("手机:"+m_phone1);
  11010. strarray.Add("新娘:"+m_name2);
  11011. strarray.Add("H");
  11012. strarray.Add("O");
  11013. strarray.Add("手机:"+m_phone2);
  11014. }
  11015. else
  11016. {
  11017. strarray.Add(" "+m_name1);
  11018. strarray.Add("");
  11019. strarray.Add("");
  11020. strarray.Add(" "+m_phone1);
  11021. strarray.Add(" "+m_name2);
  11022. strarray.Add("");
  11023. strarray.Add("");
  11024. strarray.Add(" "+m_phone2);
  11025. }
  11026. for( i=7; i<=14; i++)
  11027. {
  11028. StrRect=load.m_rcarray .ElementAt (i-1);
  11029. StrRect.left +=2;
  11030. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11031. }
  11032. StrRect=load.m_rcarray .ElementAt (3);
  11033. StrRect.left +=2;
  11034. if(seldlg.m_bFrame)
  11035. str="地址:"+m_addr1;
  11036. else
  11037. str=" "+m_addr1;
  11038. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11039. StrRect=load.m_rcarray .ElementAt (5);
  11040. StrRect.left +=2;
  11041. if(seldlg.m_bFrame)
  11042. str="地址:"+m_addr2;
  11043. else
  11044. str=" "+m_addr2;
  11045. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11046. //////////////////////////////////////////////////////
  11047. StrRect=load.m_rcarray .ElementAt (14);
  11048. str="预\r\n约";
  11049. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11050. StrRect.top +=46;
  11051. StrRect.left +=2;
  11052. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11053. m_Print.SetFontFace(10, 1, "宋体");
  11054. StrRect=load.m_rcarray .ElementAt (15);
  11055. if(seldlg.m_bFrame)
  11056. str="套系名称:"+m_taoxiname;
  11057. else
  11058. str=" "+m_taoxiname;
  11059. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11060. StrRect.left +=4;
  11061. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11062. StrRect=load.m_rcarray .ElementAt (16);
  11063. if(seldlg.m_bFrame)
  11064. str="单价:"+m_taoxijiage;
  11065. else
  11066. str=" "+m_taoxijiage;
  11067. StrRect.left +=2;
  11068. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11069. StrRect=load.m_rcarray .ElementAt (21);
  11070. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11071. str="新人签名:";
  11072. StrRect.left +=2;
  11073. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11074. StrRect=load.m_rcarray .ElementAt (22);
  11075. if(seldlg.m_bBooking==0)
  11076. {
  11077. if(seldlg.m_bFrame)
  11078. str="未付款:";
  11079. else
  11080. str=" ";
  11081. }
  11082. else
  11083. {
  11084. if(seldlg.m_bFrame)
  11085. str="未付款:"+m_money3;
  11086. else
  11087. str=" "+m_money3;
  11088. }
  11089. StrRect.left +=2;
  11090. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11091. StrRect=load.m_rcarray .ElementAt (23);
  11092. str="结婚秘书:";
  11093. StrRect.left +=2;
  11094. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11095. StrRect=load.m_rcarray .ElementAt (24);
  11096. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11097. StrRect.left +=3;
  11098. StrRect.top +=3;
  11099. StrRect.right -=2;
  11100. StrRect.bottom -=2;
  11101. int realpos=0;str="";
  11102. for(i=0; i<sparray.GetSize (); i++)
  11103. {
  11104. if(atoi(sparray.ElementAt (i).ElementAt (4))!=1)continue;
  11105. str+=sparray.ElementAt (i).ElementAt (5);
  11106. str+=" 数量:";
  11107. str+=sparray.ElementAt (i).ElementAt (3);
  11108. if(realpos%2)
  11109. str+="\r\n";
  11110. else
  11111. str+=" ";
  11112. realpos++;
  11113. }
  11114. str.TrimRight ("\r\n");
  11115. str.TrimRight (" ");
  11116. if(seldlg.m_bBooking)AutoDraw(m_Print, StrRect, str, 1.4);
  11117. ///////////////////////////////////////////////////////////
  11118. StrRect=load.m_rcarray .ElementAt (14);
  11119. StrRect.top +=1*122;
  11120. StrRect.bottom +=1*122;
  11121. str="拍\r\n照";
  11122. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11123. StrRect.top +=46;
  11124. StrRect.left +=2;
  11125. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11126. m_Print.SetFontFace(10, 1, "宋体");
  11127. StrRect=load.m_rcarray .ElementAt (15);
  11128. StrRect.top +=1*122;
  11129. StrRect.bottom +=1*122;
  11130. str="拍照内容: 白 晚 特 便";
  11131. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11132. StrRect.left +=4;
  11133. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11134. StrRect=load.m_rcarray .ElementAt (21);
  11135. StrRect.top +=1*122;
  11136. StrRect.bottom +=1*122;
  11137. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11138. str=" 新人签名:";
  11139. StrRect.left +=2;
  11140. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11141. StrRect=load.m_rcarray .ElementAt (22);
  11142. StrRect.top +=1*122;
  11143. StrRect.bottom +=1*122;
  11144. if(seldlg.m_bTake)
  11145. {
  11146. if(seldlg.m_bFrame)
  11147. str="未付款:"+m_money3;
  11148. else
  11149. str=" "+m_money3;
  11150. }
  11151. else
  11152. {
  11153. if(seldlg.m_bFrame)
  11154. str="未付款:";
  11155. else
  11156. str=" ";
  11157. }
  11158. StrRect.left +=2;
  11159. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11160. StrRect=load.m_rcarray .ElementAt (23);
  11161. StrRect.top +=1*122;
  11162. StrRect.bottom +=1*122;
  11163. str="结婚秘书:";
  11164. StrRect.left +=2;
  11165. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11166. StrRect=load.m_rcarray .ElementAt (24);
  11167. StrRect.top +=1*122;
  11168. StrRect.bottom +=1*122;
  11169. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11170. StrRect.left +=3;
  11171. StrRect.top +=3;
  11172. StrRect.right -=2;
  11173. StrRect.bottom -=2;
  11174. if(seldlg.m_bTake)
  11175. {
  11176. str="";
  11177. for(i=0; i<bukuan2array.GetSize (); i++)
  11178. {
  11179. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=1)continue;
  11180. str+="加挑: ";
  11181. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11182. str+="\r\n";
  11183. }
  11184. str.TrimRight ("\r\n");
  11185. str.TrimRight (" ");
  11186. AutoDraw(m_Print, StrRect, str, 1.4);
  11187. }
  11188. ///////////////////////////////////////////////////////////
  11189. StrRect=load.m_rcarray .ElementAt (14);
  11190. StrRect.top +=2*122;
  11191. StrRect.bottom +=2*122;
  11192. str="选\r\n样";
  11193. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11194. StrRect.top +=46;
  11195. StrRect.left +=2;
  11196. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11197. m_Print.SetFontFace(10, 1, "宋体");
  11198. StrRect=load.m_rcarray .ElementAt (15);
  11199. StrRect.top +=2*122;
  11200. StrRect.bottom +=2*122;
  11201. str="选片内容:";
  11202. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11203. StrRect.left +=4;
  11204. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11205. StrRect=load.m_rcarray .ElementAt (21);
  11206. StrRect.top +=2*122;
  11207. StrRect.bottom +=2*122;
  11208. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11209. str=" 新人签名:";
  11210. StrRect.left +=2;
  11211. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11212. StrRect=load.m_rcarray .ElementAt (22);
  11213. StrRect.top +=2*122;
  11214. StrRect.bottom +=2*122;
  11215. if(seldlg.m_bChoose)
  11216. {
  11217. if(seldlg.m_bFrame)
  11218. str="未付款:"+m_money3;
  11219. else
  11220. str=" "+m_money3;
  11221. }
  11222. else
  11223. {
  11224. if(seldlg.m_bFrame)
  11225. str="未付款:";
  11226. else
  11227. str=" ";
  11228. }
  11229. StrRect.left +=2;
  11230. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11231. StrRect=load.m_rcarray .ElementAt (23);
  11232. StrRect.top +=2*122;
  11233. StrRect.bottom +=2*122;
  11234. str="结婚秘书:";
  11235. StrRect.left +=2;
  11236. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11237. StrRect=load.m_rcarray .ElementAt (24);
  11238. StrRect.top +=2*122;
  11239. StrRect.bottom +=2*122;
  11240. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11241. if(seldlg.m_bChoose)
  11242. {
  11243. StrRect.left +=3;
  11244. StrRect.top +=3;
  11245. StrRect.right -=2;
  11246. StrRect.bottom -=2;
  11247. str="";
  11248. for(i=0; i<bukuan2array.GetSize (); i++)
  11249. {
  11250. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=2)continue;
  11251. str+="加挑: ";
  11252. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11253. str+="\r\n";
  11254. }
  11255. str.TrimRight ("\r\n");
  11256. str.TrimRight (" ");
  11257. AutoDraw(m_Print, StrRect, str, 1.4);
  11258. }
  11259. ///////////////////////////////////////////////////////////
  11260. StrRect=load.m_rcarray .ElementAt (14);
  11261. StrRect.top +=3*122;
  11262. StrRect.bottom +=3*122;
  11263. str="结\r\n婚";
  11264. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11265. StrRect.top +=46;
  11266. StrRect.left +=2;
  11267. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11268. m_Print.SetFontFace(10, 1, "宋体");
  11269. StrRect=load.m_rcarray .ElementAt (15);
  11270. StrRect.top +=3*122;
  11271. StrRect.bottom +=3*122;
  11272. str="结婚内容: 区 白 晚 押金:";
  11273. if(seldlg.m_bFrame) m_Print.DrawRect2(StrRect, 1);
  11274. StrRect.left +=4;
  11275. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11276. StrRect=load.m_rcarray .ElementAt (21);
  11277. StrRect.top +=3*122;
  11278. StrRect.bottom +=3*122;
  11279. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11280. str=" 新人签名:";
  11281. StrRect.left +=2;
  11282. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11283. StrRect=load.m_rcarray .ElementAt (22);
  11284. StrRect.top +=3*122;
  11285. StrRect.bottom +=3*122;
  11286. if(seldlg.m_bBooking)
  11287. {
  11288. if(seldlg.m_bFrame)
  11289. str="未付款:"+m_money3;
  11290. else
  11291. str=" "+m_money3;
  11292. }
  11293. else
  11294. {
  11295. if(seldlg.m_bFrame)
  11296. str="未付款:";
  11297. else
  11298. str=" ";
  11299. }
  11300. StrRect.left +=2;
  11301. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11302. StrRect=load.m_rcarray .ElementAt (23);
  11303. StrRect.top +=3*122;
  11304. StrRect.bottom +=3*122;
  11305. str="结婚秘书:";
  11306. StrRect.left +=2;
  11307. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11308. StrRect=load.m_rcarray .ElementAt (24);
  11309. StrRect.top +=3*122;
  11310. StrRect.bottom +=3*122;
  11311. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11312. if(seldlg.m_bBooking)
  11313. {
  11314. StrRect.left +=3;
  11315. StrRect.top +=3;
  11316. StrRect.right -=2;
  11317. StrRect.bottom -=2;
  11318. realpos=0;str="";
  11319. for(i=0; i<sparray.GetSize (); i++)
  11320. {
  11321. if(atoi(sparray.ElementAt (i).ElementAt (4))!=2)continue;
  11322. str+=sparray.ElementAt (i).ElementAt (5);
  11323. str+=" 数量:";
  11324. str+=sparray.ElementAt (i).ElementAt (3);
  11325. if(realpos%2)
  11326. str+="\r\n";
  11327. else
  11328. str+=" ";
  11329. realpos++;
  11330. }
  11331. str.TrimRight ("\r\n");
  11332. str.TrimRight (" ");
  11333. AutoDraw(m_Print, StrRect, str, 1.4);
  11334. }
  11335. ///////////////////////////////////////
  11336. strarray.RemoveAll ();
  11337. if(seldlg.m_bFrame)
  11338. {
  11339. strarray.Add ("项目");
  11340. strarray.Add ("万");
  11341. strarray.Add ("千");
  11342. strarray.Add ("百");
  11343. strarray.Add ("十");
  11344. strarray.Add ("个");
  11345. strarray.Add ("收 银");
  11346. }
  11347. else
  11348. {
  11349. strarray.Add ("");
  11350. strarray.Add ("");
  11351. strarray.Add ("");
  11352. strarray.Add ("");
  11353. strarray.Add ("");
  11354. strarray.Add ("");
  11355. strarray.Add ("");
  11356. }
  11357. CStringArray strarray2;
  11358. float ftotal=0;
  11359. int realcount=0;
  11360. if(seldlg.m_bBooking)
  11361. {
  11362. for(i=0; i<bukuanarray.GetSize (); i++)
  11363. {
  11364. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=3 && atoi(bukuanarray.ElementAt (i).ElementAt (6))!=4)continue;
  11365. realcount++;
  11366. if(realcount>6)break;
  11367. str=bukuanarray.ElementAt (i).ElementAt (1);
  11368. ftotal+=atof(str);
  11369. strarray2.Add (GetW(str));
  11370. strarray2.Add (GetK(str));
  11371. strarray2.Add (GetB(str));
  11372. strarray2.Add (GetS(str));
  11373. strarray2.Add (GetG(str));
  11374. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11375. }
  11376. }
  11377. while(strarray2.GetSize ()<36)
  11378. strarray2.Add ("");
  11379. str.Format ("%f", ftotal);
  11380. strarray2.Add (GetW(str));
  11381. strarray2.Add (GetK(str));
  11382. strarray2.Add (GetB(str));
  11383. strarray2.Add (GetS(str));
  11384. strarray2.Add (GetG(str));
  11385. strarray2.Add ("");
  11386. //拍照
  11387. ftotal=0;
  11388. realcount=0;
  11389. if(seldlg.m_bTake)
  11390. {
  11391. for(i=0; i<bukuanarray.GetSize (); i++)
  11392. {
  11393. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=1)continue;
  11394. realcount++;
  11395. if(realcount>6)break;
  11396. str=bukuanarray.ElementAt (i).ElementAt (1);
  11397. ftotal+=atof(str);
  11398. strarray2.Add (GetW(str));
  11399. strarray2.Add (GetK(str));
  11400. strarray2.Add (GetB(str));
  11401. strarray2.Add (GetS(str));
  11402. strarray2.Add (GetG(str));
  11403. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11404. }
  11405. }
  11406. while(strarray2.GetSize ()<42+36)
  11407. strarray2.Add ("");
  11408. str.Format ("%f", ftotal);
  11409. strarray2.Add (GetW(str));
  11410. strarray2.Add (GetK(str));
  11411. strarray2.Add (GetB(str));
  11412. strarray2.Add (GetS(str));
  11413. strarray2.Add (GetG(str));
  11414. strarray2.Add ("");
  11415. //选片
  11416. ftotal=0;
  11417. realcount=0;
  11418. if(seldlg.m_bChoose)
  11419. {
  11420. for(i=0; i<bukuanarray.GetSize (); i++)
  11421. {
  11422. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=2)continue;
  11423. realcount++;
  11424. if(realcount>6)break;
  11425. str=bukuanarray.ElementAt (i).ElementAt (1);
  11426. ftotal+=atof(str);
  11427. strarray2.Add (GetW(str));
  11428. strarray2.Add (GetK(str));
  11429. strarray2.Add (GetB(str));
  11430. strarray2.Add (GetS(str));
  11431. strarray2.Add (GetG(str));
  11432. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11433. }
  11434. }
  11435. while(strarray2.GetSize ()<42*2+36)
  11436. strarray2.Add ("");
  11437. str.Format ("%f", ftotal);
  11438. strarray2.Add (GetW(str));
  11439. strarray2.Add (GetK(str));
  11440. strarray2.Add (GetB(str));
  11441. strarray2.Add (GetS(str));
  11442. strarray2.Add (GetG(str));
  11443. strarray2.Add ("");
  11444. /////////////////////////////
  11445. CRect temprc;
  11446. for(int n=0; n<4; n++)
  11447. {
  11448. StrRect=load.m_rcarray .ElementAt (17);
  11449. StrRect.top +=n*122;
  11450. StrRect.bottom +=n*122;
  11451. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11452. StrRect=load.m_rcarray .ElementAt (18);
  11453. if(n)
  11454. {
  11455. StrRect.left +=36;
  11456. StrRect.right +=36;
  11457. }
  11458. StrRect.top +=n*122;
  11459. StrRect.bottom +=n*122;
  11460. if(seldlg.m_bFrame)
  11461. str.Format("%d年", tm.GetYear ());
  11462. else
  11463. str.Format("%d ", tm.GetYear ());
  11464. 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))
  11465. {
  11466. if(seldlg.m_bFrame)
  11467. str=" 年";
  11468. else
  11469. str=" ";
  11470. }
  11471. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11472. StrRect=load.m_rcarray .ElementAt (19);
  11473. if(n)
  11474. {
  11475. StrRect.left +=38;
  11476. StrRect.right +=38;
  11477. }
  11478. StrRect.top +=n*122;
  11479. StrRect.bottom +=n*122;
  11480. if(seldlg.m_bFrame)
  11481. str.Format("%02d月", tm.GetMonth ());
  11482. else
  11483. str.Format("%02d ", tm.GetMonth ());
  11484. 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))
  11485. {
  11486. if(seldlg.m_bFrame)
  11487. str=" 月";
  11488. else
  11489. str=" ";
  11490. }
  11491. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11492. StrRect=load.m_rcarray .ElementAt (20);
  11493. if(n)
  11494. {
  11495. StrRect.left +=36;
  11496. StrRect.right +=36;
  11497. }
  11498. StrRect.top +=n*122;
  11499. StrRect.bottom +=n*122;
  11500. if(seldlg.m_bFrame)
  11501. str.Format("%02d日", tm.GetDay ());
  11502. else
  11503. str.Format("%02d ", tm.GetDay ());
  11504. 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))
  11505. {
  11506. if(seldlg.m_bFrame)
  11507. str=" 日";
  11508. else
  11509. str=" ";
  11510. }
  11511. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11512. for(i=26; i<=32; i++)
  11513. {
  11514. StrRect=load.m_rcarray .ElementAt (i-1);
  11515. StrRect.bottom -=14;
  11516. for(int j=0; j<8; j++)
  11517. {
  11518. StrRect.top=StrRect.bottom;
  11519. if(j>2)
  11520. {
  11521. StrRect.bottom =StrRect.top+14;
  11522. }
  11523. else
  11524. {
  11525. StrRect.bottom =StrRect.top+13;
  11526. }
  11527. temprc=StrRect;
  11528. StrRect.top +=n*122;
  11529. StrRect.bottom +=n*122;
  11530. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11531. if(i==26 && j==4 && seldlg.m_bFrame)
  11532. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11533. else if(i==26 && j==5 && seldlg.m_bFrame)
  11534. m_Print.DrawText((LPTSTR)(LPCTSTR)"付款", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11535. else if(i==26 && j==7 && seldlg.m_bFrame)
  11536. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11537. else if(j==0)
  11538. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-26), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11539. else if(j && i>26 && n<3)
  11540. {
  11541. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray2.ElementAt ((j-1)*6+(i-27)+n*42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11542. }
  11543. StrRect=temprc;
  11544. }
  11545. }
  11546. }
  11547. if(seldlg.m_bFrame)
  11548. {
  11549. StrRect=load.m_rcarray .ElementAt (32);
  11550. str="注\r\n意\r\n事\r\n项";
  11551. StrRect.top +=367;
  11552. StrRect.bottom +=367;
  11553. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11554. StrRect.top +=17;
  11555. StrRect.left +=2;
  11556. AutoDraw(m_Print, StrRect, str, 1.4);
  11557. StrRect=load.m_rcarray .ElementAt (33);
  11558. str="1: 本预约单自预定日期起一年内有效.定金在拍照套系金额中扣出.预定金一概不退\r\n\
  11559. 2: 多拍照片只供筛选.恕不奉送.版权所有.不得私自拷贝\r\n\
  11560. 3: 拍照款请于拍照时一次付清\r\n\
  11561. 4: 新娘装AM8:00前钟点费另计.婚纱礼服出租押金500-2000元\r\n\
  11562. 5: 本公司设有豪华VIP礼服区.及皇家御用礼服展区.但需另外加价.详情请咨本店人员\r\n\
  11563. 6: 安瓶, 美甲一次性化妆用具等均属增值服务部分,则需另外加价,详情咨询本店工作人员\r\n\
  11564. 7: 本电脑机械故障导致文件资料丢失.本公司只提供补拍服务\r\n\
  11565. 8: 每次前来请务必携带本单交给工作人员.本单是您在摩登新娘拍照的凭证.办理有关手续凭本单办理盖\r\n\
  11566. 章后方可生效";
  11567. StrRect.top +=367;
  11568. StrRect.bottom +=367;
  11569. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11570. StrRect.top +=4;
  11571. StrRect.left +=2;
  11572. AutoDraw(m_Print, StrRect, str, 1.0);
  11573. StrRect=load.m_rcarray .ElementAt (34);
  11574. 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)";
  11575. AutoDraw(m_Print, StrRect, str, 1.0);
  11576. m_Print.SetFontFace(13, 1, "宋体");
  11577. StrRect=load.m_rcarray .ElementAt (35);
  11578. str="地 址: 汉口 . 解放大道 . 头道街东部购物公园C栋二,三层";
  11579. StrRect.top +=367;
  11580. StrRect.bottom +=367;
  11581. StrRect.left +=2;
  11582. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11583. StrRect=load.m_rcarray .ElementAt (36);
  11584. str="喜讯热线: 027-81888799 81888599 81888699";
  11585. StrRect.top +=367;
  11586. StrRect.bottom +=367;
  11587. StrRect.left +=2;
  11588. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11589. }
  11590. PrintPreview dlg;
  11591. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11592. dlg.m_pDC =m_Print.GetPDC() ;
  11593. if(dlg.DoModal ()!=IDOK)return;
  11594. //结束打印
  11595. m_Print.EndPage();
  11596. m_Print.EndPrint();
  11597. #endif
  11598. }
  11599. extern CString GetHMoney(CString str);
  11600. void CMainFrame::PrintReceipt3(CString strOrderNumber, CStringArray *pArray, float money)
  11601. {
  11602. int printcot = 1;
  11603. for (int aa = 0; aa < printcot; aa++)
  11604. {
  11605. g_sendhead.bsql = 0;
  11606. g_sendhead.code[0] = 24;
  11607. g_sendhead.tabcount = 1;
  11608. int g_nYearposTemp = g_nYearpos;
  11609. g_nYearpos = -1;
  11610. g_pMainWnd->ProcessChatMessageRequest2(1);
  11611. g_nYearpos = g_nYearposTemp;
  11612. if (0 == g_bSendOK)return;
  11613. DataToArray(&g_cominfoarray);
  11614. CString SerialNo;
  11615. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  11616. CPrintRX m_Print;
  11617. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11618. {
  11619. m_Print.InitToPrint(NULL, 1);
  11620. }
  11621. else
  11622. {
  11623. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  11624. if (name.IsEmpty())
  11625. m_Print.InitToPrint(NULL, 1);
  11626. else
  11627. {
  11628. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11629. if (nret == -1 && aa == 0)
  11630. {
  11631. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11632. }
  11633. }
  11634. }
  11635. m_Print.StartPrint();
  11636. m_Print.StartPage();
  11637. LoadRect load;
  11638. load.SetLiaPath("15.lia");
  11639. load.SetMargins(0, 0);
  11640. if (!load.Load())return;
  11641. int i;
  11642. //////////////////////////////////////////////////////////////
  11643. CStringArray txarray;
  11644. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  11645. g_sendhead.code[0] = 11;
  11646. g_sendhead.code[1] = 52;
  11647. g_sendhead.tabcount = 2;
  11648. g_sendhead.bsql = 0;
  11649. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  11650. CArray<CStringArray, CStringArray>sparray;
  11651. CArray<CStringArray, CStringArray>clientarray;
  11652. DataToArray(&g_List1array, &clientarray);
  11653. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  11654. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  11655. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  11656. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  11657. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  11658. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11659. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  11660. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  11661. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  11662. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  11663. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  11664. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  11665. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  11666. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  11667. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  11668. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  11669. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  11670. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  11671. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  11672. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  11673. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  11674. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  11675. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  11676. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  11677. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  11678. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  11679. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  11680. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  11681. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  11682. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  11683. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  11684. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  11685. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  11686. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  11687. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  11688. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  11689. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  11690. CString m_addr = m_addr1 + ";";
  11691. m_addr.TrimLeft(";");
  11692. m_addr += m_addr2;
  11693. CString m_qq = m_qq1 + ";";
  11694. m_qq.TrimLeft(";");
  11695. m_qq += m_qq2;
  11696. m_money1.Format("%f", atof(m_taoxijiage));
  11697. m_money2.Format("%f", atof(m_payed1));
  11698. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  11699. ConvertToPrice(m_money1);
  11700. ConvertToPrice(m_money2);
  11701. ConvertToPrice(m_money3);
  11702. ////////////////////////////////////////////////////////////////
  11703. int rcpos = -1;
  11704. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  11705. m_Print.SetFontFace(17, 1, "宋体");
  11706. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11707. StrRect.top -= 0;
  11708. StrRect.bottom -= 10;
  11709. StrRect.left -= 140;
  11710. StrRect.right = StrRect.left + 48;
  11711. m_Print.SetFontFace(15, 1, "宋体");
  11712. m_Print.SetColor(0xffffff);
  11713. m_Print.DrawRect(StrRect, 0);
  11714. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11715. StrRect.left = StrRect.right;
  11716. StrRect.right = StrRect.left + 48;
  11717. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  11718. m_Print.SetColor(0, RGB(255, 0, 0));
  11719. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11720. m_Print.SetColor(0);
  11721. m_Print.SetFontFace(12, 1, "宋体");
  11722. StrRect.left -= 48;
  11723. int hei = StrRect.Height();
  11724. StrRect.top = StrRect.bottom + 2;
  11725. StrRect.bottom += hei + 2;
  11726. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11727. StrRect.top = StrRect.bottom - 2;
  11728. StrRect.bottom += hei - 5;
  11729. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11730. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11731. m_Print.SetFontFace(12, 1, "宋体");
  11732. m_Print.DrawText((LPTSTR)(LPCTSTR)"收款单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11733. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11734. m_Print.SetFontFace(9, 1, "宋体");
  11735. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11736. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11737. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11738. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11739. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11740. m_Print.DrawRect2(StrRect, 2);
  11741. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11742. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11743. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11744. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11745. m_Print.DrawRect2(StrRect, 2);
  11746. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11747. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11748. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11749. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11750. m_Print.DrawRect2(StrRect, 2);
  11751. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11752. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11753. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11754. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11755. m_Print.DrawRect2(StrRect, 2);
  11756. ////////////
  11757. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11758. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11759. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11760. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11761. m_Print.DrawRect2(StrRect, 2);
  11762. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11763. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11764. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11765. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11766. m_Print.DrawRect2(StrRect, 2);
  11767. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11768. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11769. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11770. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11771. m_Print.DrawRect2(StrRect, 2);
  11772. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11773. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11774. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11775. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11776. m_Print.DrawRect2(StrRect, 2);
  11777. for (i = 19; i < 49; i++)
  11778. {
  11779. if (i >= 44)
  11780. {
  11781. StrRect = load.m_rcarray.ElementAt(i - 5);
  11782. int hei = StrRect.Height();
  11783. StrRect.top += hei;
  11784. StrRect.bottom += hei;
  11785. }
  11786. else
  11787. StrRect = load.m_rcarray.ElementAt(i);
  11788. m_Print.DrawRect2(StrRect, 1);
  11789. }
  11790. float fmoney = 0;
  11791. for (i = 19; i < 49; i++)
  11792. {
  11793. if (i >= 44)
  11794. {
  11795. StrRect = load.m_rcarray.ElementAt(i - 5);
  11796. int hei = StrRect.Height();
  11797. StrRect.top += hei;
  11798. StrRect.bottom += hei;
  11799. }
  11800. else
  11801. StrRect = load.m_rcarray.ElementAt(i);
  11802. StrRect.left += 2;
  11803. /* if((i-19)%5==2)
  11804. {
  11805. fmoney+=atof(pArray->ElementAt (i-19));
  11806. }*/
  11807. m_Print.DrawText((LPTSTR)(LPCTSTR)(pArray->ElementAt(i - 19)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11808. }
  11809. m_money2.Format("%f", money);
  11810. ConvertToPrice(m_money2);
  11811. StrRect = load.m_rcarray.ElementAt(44);
  11812. CString str;
  11813. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 实收¥: %s 元 收银员: %s", \
  11814. GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
  11815. m_money2, g_user.name);
  11816. m_Print.DrawRect2(StrRect, 1);
  11817. StrRect.left += 3;
  11818. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11819. StrRect = load.m_rcarray.ElementAt(46);
  11820. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11821. StrRect = load.m_rcarray.ElementAt(47);
  11822. m_Print.DrawRect2(StrRect, 2);
  11823. StrRect = load.m_rcarray.ElementAt(48);
  11824. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11825. StrRect = load.m_rcarray.ElementAt(45);
  11826. str = "\
  11827. 顾客须知\r\n\
  11828. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  11829. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  11830. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  11831. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  11832. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  11833. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  11834. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  11835. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  11836. AutoDraw(m_Print, StrRect, str, 1.8);
  11837. PrintPreview dlg;
  11838. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  11839. dlg.m_pDC = m_Print.GetPDC();
  11840. if (aa == 0)
  11841. {
  11842. if (dlg.DoModal() != IDOK)
  11843. return;
  11844. printcot = dlg.m_num;
  11845. }
  11846. //结束打印
  11847. m_Print.EndPage();
  11848. m_Print.EndPrint();
  11849. }
  11850. }
  11851. void CMainFrame::PrintReceipt2(CString strOrderNumber)
  11852. {
  11853. int printcot = 1;
  11854. for (int aa = 0; aa < printcot; aa++)
  11855. {
  11856. g_sendhead.bsql = 0;
  11857. g_sendhead.code[0] = 24;
  11858. g_sendhead.tabcount = 1;
  11859. int g_nYearposTemp = g_nYearpos;
  11860. g_nYearpos = -1;
  11861. g_pMainWnd->ProcessChatMessageRequest2(1);
  11862. g_nYearpos = g_nYearposTemp;
  11863. if (0 == g_bSendOK)return;
  11864. DataToArray(&g_cominfoarray);
  11865. CString SerialNo;
  11866. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  11867. CPrintRX m_Print;
  11868. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11869. {
  11870. m_Print.InitToPrint(NULL, 1);
  11871. }
  11872. else
  11873. {
  11874. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  11875. if (name.IsEmpty())
  11876. m_Print.InitToPrint(NULL, 1);
  11877. else
  11878. {
  11879. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11880. if (nret == -1 && aa == 0)
  11881. {
  11882. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11883. }
  11884. }
  11885. }
  11886. m_Print.StartPrint();
  11887. m_Print.StartPage();
  11888. LoadRect load;
  11889. load.SetLiaPath("14.lia");
  11890. load.SetMargins(0, 0);
  11891. if (!load.Load())return;
  11892. int i;
  11893. //////////////////////////////////////////////////////////////
  11894. CStringArray txarray;
  11895. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  11896. g_sendhead.code[0] = 11;
  11897. g_sendhead.code[1] = 52;
  11898. g_sendhead.code[2] = 93;
  11899. g_sendhead.tabcount = 3;
  11900. g_sendhead.bsql = 0;
  11901. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  11902. CArray<CStringArray, CStringArray>sparray;
  11903. CArray<CStringArray, CStringArray>clientarray;
  11904. CArray<CStringArray, CStringArray>moneyarray;
  11905. DataToArray(&g_List1array, &clientarray, &moneyarray);
  11906. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  11907. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  11908. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  11909. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  11910. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  11911. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11912. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  11913. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  11914. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  11915. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  11916. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  11917. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  11918. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  11919. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  11920. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  11921. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  11922. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  11923. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  11924. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  11925. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  11926. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  11927. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  11928. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  11929. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  11930. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  11931. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  11932. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  11933. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  11934. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  11935. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  11936. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  11937. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  11938. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  11939. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  11940. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  11941. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  11942. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  11943. CString m_addr = m_addr1 + ";";
  11944. m_addr.TrimLeft(";");
  11945. m_addr += m_addr2;
  11946. CString m_qq = m_qq1 + ";";
  11947. m_qq.TrimLeft(";");
  11948. m_qq += m_qq2;
  11949. m_money1.Format("%f", atof(m_taoxijiage));
  11950. m_money2 = "0";
  11951. for (i = 0; i < moneyarray.GetSize(); i++)
  11952. {
  11953. if (moneyarray.ElementAt(i).ElementAt(5) == "预约收款")
  11954. m_money2 = moneyarray.ElementAt(i).ElementAt(1);
  11955. }
  11956. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  11957. ConvertToPrice(m_money1);
  11958. ConvertToPrice(m_money2);
  11959. ConvertToPrice(m_money3);
  11960. ////////////////////////////////////////////////////////////////
  11961. int rcpos = -1;
  11962. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  11963. m_Print.SetFontFace(17, 1, "宋体");
  11964. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11965. StrRect.top -= 0;
  11966. StrRect.bottom -= 10;
  11967. StrRect.left -= 140;
  11968. StrRect.right = StrRect.left + 48;
  11969. m_Print.SetFontFace(15, 1, "宋体");
  11970. m_Print.SetColor(0xffffff);
  11971. m_Print.DrawRect(StrRect, 0);
  11972. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11973. StrRect.left = StrRect.right;
  11974. StrRect.right = StrRect.left + 48;
  11975. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  11976. m_Print.SetColor(0, RGB(255, 0, 0));
  11977. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11978. m_Print.SetColor(0);
  11979. m_Print.SetFontFace(12, 1, "宋体");
  11980. StrRect.left -= 48;
  11981. int hei = StrRect.Height();
  11982. StrRect.top = StrRect.bottom + 2;
  11983. StrRect.bottom += hei + 2;
  11984. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11985. StrRect.top = StrRect.bottom - 2;
  11986. StrRect.bottom += hei - 5;
  11987. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11988. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11989. m_Print.SetFontFace(12, 1, "宋体");
  11990. m_Print.DrawText((LPTSTR)(LPCTSTR)"定金单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11991. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11992. m_Print.SetFontFace(9, 1, "宋体");
  11993. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11994. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11995. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11996. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11997. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11998. m_Print.DrawRect2(StrRect, 2);
  11999. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12000. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12001. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12002. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12003. m_Print.DrawRect2(StrRect, 2);
  12004. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12005. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12006. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12007. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12008. m_Print.DrawRect2(StrRect, 2);
  12009. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12010. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12011. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12012. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12013. m_Print.DrawRect2(StrRect, 2);
  12014. ////////////
  12015. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12016. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12017. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12018. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12019. m_Print.DrawRect2(StrRect, 2);
  12020. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12021. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12022. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12023. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12024. m_Print.DrawRect2(StrRect, 2);
  12025. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12026. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12027. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12028. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12029. m_Print.DrawRect2(StrRect, 2);
  12030. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12031. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12032. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12033. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12034. m_Print.DrawRect2(StrRect, 2);
  12035. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12036. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12037. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12038. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12039. m_Print.DrawRect2(StrRect, 2);
  12040. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12041. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12042. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12043. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12044. m_Print.DrawRect2(StrRect, 2);
  12045. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12046. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/MSN:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12047. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12048. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12049. m_Print.DrawRect2(StrRect, 2);
  12050. CStringArray strarray;
  12051. strarray.Add("套系名称");
  12052. strarray.Add("总 额");
  12053. strarray.Add("定 金");
  12054. strarray.Add("余 款");
  12055. strarray.Add("摄影日期");
  12056. strarray.Add(m_taoxiname);
  12057. strarray.Add(m_money1);
  12058. strarray.Add(m_money2);
  12059. strarray.Add(m_money3);
  12060. strarray.Add(m_time2);
  12061. for (i = 25; i < 37; i++)
  12062. {
  12063. StrRect = load.m_rcarray.ElementAt(i);
  12064. m_Print.DrawRect2(StrRect, 1);
  12065. }
  12066. for (i = 25; i < 35; i++)
  12067. {
  12068. StrRect = load.m_rcarray.ElementAt(i);
  12069. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 25), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12070. }
  12071. StrRect = load.m_rcarray.ElementAt(35);
  12072. StrRect.left += 5;
  12073. StrRect.top += 5;
  12074. m_Print.DrawText((LPTSTR)(LPCTSTR)" 备 注:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  12075. StrRect = load.m_rcarray.ElementAt(36);
  12076. CString str;
  12077. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 ¥: %s 元 收银员: %s", \
  12078. GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
  12079. m_money2, g_user.name);
  12080. StrRect.left += 3;
  12081. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12082. StrRect = load.m_rcarray.ElementAt(38);
  12083. m_Print.DrawText((LPTSTR)(LPCTSTR)"营业员:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12084. StrRect = load.m_rcarray.ElementAt(39);
  12085. m_Print.DrawText((LPTSTR)(LPCTSTR)m_ren, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12086. m_Print.DrawRect2(StrRect, 2);
  12087. StrRect = load.m_rcarray.ElementAt(40);
  12088. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12089. StrRect = load.m_rcarray.ElementAt(41);
  12090. m_Print.DrawRect2(StrRect, 2);
  12091. StrRect = load.m_rcarray.ElementAt(42);
  12092. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12093. StrRect = load.m_rcarray.ElementAt(37);
  12094. str = "\
  12095. 顾客须知\r\n\
  12096. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  12097. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  12098. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  12099. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  12100. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  12101. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  12102. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  12103. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12104. AutoDraw(m_Print, StrRect, str, 1.8);
  12105. PrintPreview dlg;
  12106. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12107. dlg.m_pDC = m_Print.GetPDC();
  12108. if (aa == 0)
  12109. {
  12110. if (dlg.DoModal() != IDOK)
  12111. return;
  12112. printcot = dlg.m_num;
  12113. }
  12114. //结束打印
  12115. m_Print.EndPage();
  12116. m_Print.EndPrint();
  12117. }
  12118. }
  12119. void CMainFrame::OnAutodelphoto()
  12120. {
  12121. // TODO: Add your command handler code here
  12122. if (g_user.bLongin == 0)
  12123. {
  12124. if (g_bNoLoginLia)
  12125. {
  12126. Login dlg;
  12127. dlg.SetLiaPath("5.lia");
  12128. dlg.DoModal();
  12129. }
  12130. else
  12131. {
  12132. Login3 dlg;
  12133. dlg.SetLiaPath("5.lia");
  12134. dlg.DoModal();
  12135. }
  12136. if (g_user.bLongin == 0)return;
  12137. }
  12138. if (IsHasRightsnew(49) == 0)return;
  12139. DelPhotoSet dlg;
  12140. dlg.DoModal();
  12141. }
  12142. void CMainFrame::Onphotomanage()
  12143. {
  12144. // TODO: Add your command handler code here
  12145. if (g_user.bLongin == 0)
  12146. {
  12147. if (g_bNoLoginLia)
  12148. {
  12149. Login dlg;
  12150. dlg.SetLiaPath("5.lia");
  12151. dlg.DoModal();
  12152. }
  12153. else
  12154. {
  12155. Login3 dlg;
  12156. dlg.SetLiaPath("5.lia");
  12157. dlg.DoModal();
  12158. }
  12159. if (g_user.bLongin == 0)return;
  12160. }
  12161. if (IsHasRightsnew(49) == 0)return;
  12162. ShowPic3 dlg;
  12163. dlg.DoModal();
  12164. }
  12165. void CMainFrame::OnCompanyinfo()
  12166. {
  12167. // TODO: Add your command handler code here
  12168. if (g_user.bLongin == 0)
  12169. {
  12170. if (g_bNoLoginLia)
  12171. {
  12172. Login dlg;
  12173. dlg.SetLiaPath("5.lia");
  12174. dlg.DoModal();
  12175. }
  12176. else
  12177. {
  12178. Login3 dlg;
  12179. dlg.SetLiaPath("5.lia");
  12180. dlg.DoModal();
  12181. }
  12182. if (g_user.bLongin == 0)return;
  12183. }
  12184. if (IsHasRightsnew(49) == 0)return;
  12185. CompanyInfo dlg;
  12186. dlg.DoModal();
  12187. }
  12188. void CMainFrame::OnTaoxifg()
  12189. {
  12190. // TODO: Add your command handler code here
  12191. if (g_user.bLongin == 0)
  12192. {
  12193. if (g_bNoLoginLia)
  12194. {
  12195. Login dlg;
  12196. dlg.SetLiaPath("5.lia");
  12197. dlg.DoModal();
  12198. }
  12199. else
  12200. {
  12201. Login3 dlg;
  12202. dlg.SetLiaPath("5.lia");
  12203. dlg.DoModal();
  12204. }
  12205. if (g_user.bLongin == 0)return;
  12206. }
  12207. if (IsHasRightsnew(49) == 0)return;
  12208. TXFG dlg;
  12209. dlg.DoModal();
  12210. }
  12211. void CMainFrame::OnHelpfile()
  12212. {
  12213. // TODO: Add your command handler code here
  12214. // ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  12215. // if(::PathFileExists (g_mainpath+"\\zx.dll"))
  12216. // ShellExecute(NULL, _T("open"), _T("www.zcsmkj.com"), "", NULL, SW_SHOWNORMAL);
  12217. // else
  12218. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  12219. }
  12220. void CMainFrame::OnPhotobak()
  12221. {
  12222. // TODO: Add your command handler code here
  12223. if (g_user.bLongin == 0)
  12224. {
  12225. if (g_bNoLoginLia)
  12226. {
  12227. Login dlg;
  12228. dlg.SetLiaPath("5.lia");
  12229. dlg.DoModal();
  12230. }
  12231. else
  12232. {
  12233. Login3 dlg;
  12234. dlg.SetLiaPath("5.lia");
  12235. dlg.DoModal();
  12236. }
  12237. if (g_user.bLongin == 0)return;
  12238. }
  12239. if (IsHasRightsnew(49) == 0)return;
  12240. PhotoBak dlg;
  12241. dlg.DoModal();
  12242. }
  12243. //客户报表
  12244. void CMainFrame::OnClose2()
  12245. { // TODO: Add your message handler code here and/or call default
  12246. if (AfxMessageBox("是否退出系统?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
  12247. WriteLog("退出系统");//Jeff.add
  12248. g_bShowBar = 0;
  12249. if (m_Mdi.MainClose())
  12250. CMDIFrameWnd::OnClose();
  12251. }
  12252. //
  12253. void CMainFrame::ResetTimer()
  12254. {
  12255. }
  12256. void CMainFrame::LinkClick(CString str, int nParent)
  12257. {
  12258. g_pMainWnd2->m_bar.LinkClick(str);
  12259. }
  12260. void CMainFrame::PrintFlowChart2(CString m_id)
  12261. {
  12262. CPrintRX m_Print;
  12263. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12264. {
  12265. m_Print.InitToPrint(NULL, 1);
  12266. }
  12267. else
  12268. {
  12269. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  12270. if (name.IsEmpty())
  12271. m_Print.InitToPrint(NULL, 1);
  12272. else
  12273. {
  12274. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12275. if (nret == -1)
  12276. {
  12277. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12278. }
  12279. }
  12280. }
  12281. m_Print.StartPrint();
  12282. m_Print.StartPage();
  12283. LoadRect load;
  12284. load.SetLiaPath("16.lia");
  12285. load.SetMargins(0, 0);
  12286. if (!load.Load())return;
  12287. LoadRect load2;
  12288. load2.SetLiaPath("17.lia");
  12289. load2.SetMargins(0, 660);
  12290. if (!load2.Load())return;
  12291. int i;
  12292. //////////////////////////////////////////////////////////////
  12293. CStringArray txarray;
  12294. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and kind<>'2'";
  12295. g_sendhead.code[0] = 11;
  12296. g_sendhead.code[1] = 52;
  12297. g_sendhead.code[2] = 223;
  12298. g_sendhead.tabcount = 3;
  12299. g_sendhead.bsql = 0;
  12300. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12301. CArray<CStringArray, CStringArray>sparray;
  12302. CArray<CStringArray, CStringArray>clientarray;
  12303. DataToArray(&g_List1array, &clientarray, &sparray);
  12304. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12305. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12306. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12307. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12308. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12309. CString m_photocount = g_List1array.ElementAt(0).ElementAt(9);
  12310. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12311. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12312. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12313. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12314. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12315. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12316. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12317. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12318. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12319. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12320. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12321. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12322. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12323. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12324. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12325. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12326. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12327. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12328. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12329. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12330. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12331. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12332. CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(39) + g_List1array.ElementAt(0).ElementAt(75);
  12333. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12334. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12335. CString spno;
  12336. for (i = 0; i < sparray.GetSize(); i++)
  12337. {
  12338. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12339. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  12340. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  12341. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  12342. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  12343. spno += sparray.ElementAt(i).ElementAt(5);
  12344. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
  12345. spno += "; ";
  12346. else
  12347. {
  12348. spno += ":";
  12349. spno += sparray.ElementAt(i).ElementAt(6);
  12350. spno += "; ";
  12351. }
  12352. }
  12353. spno += " 加挑:";
  12354. for (i = 0; i < sparray.GetSize(); i++)
  12355. {
  12356. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  12357. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  12358. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  12359. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  12360. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  12361. spno += sparray.ElementAt(i).ElementAt(5);
  12362. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
  12363. spno += "; ";
  12364. else
  12365. {
  12366. spno += ":";
  12367. spno += sparray.ElementAt(i).ElementAt(6);
  12368. spno += "; ";
  12369. }
  12370. }
  12371. if (spno.Right(6) == " 加挑:")
  12372. {
  12373. spno = spno.Left(spno.GetLength() - 6);
  12374. }
  12375. ////////////////////////////////////////////////////////////////
  12376. int rcpos = -1;
  12377. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12378. m_Print.SetFontFace(17, 1, "宋体");
  12379. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12380. StrRect.top -= 0;
  12381. StrRect.bottom -= 10;
  12382. StrRect.left -= 140;
  12383. StrRect.right = StrRect.left + 48;
  12384. m_Print.SetFontFace(15, 1, "宋体");
  12385. m_Print.SetColor(0xffffff);
  12386. m_Print.DrawRect(StrRect, 0);
  12387. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12388. StrRect.left = StrRect.right;
  12389. StrRect.right = StrRect.left + 48;
  12390. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12391. m_Print.SetColor(0, RGB(255, 0, 0));
  12392. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12393. m_Print.SetColor(0);
  12394. m_Print.SetFontFace(12, 1, "宋体");
  12395. StrRect.left -= 48;
  12396. int hei = StrRect.Height();
  12397. StrRect.top = StrRect.bottom + 2;
  12398. StrRect.bottom += hei + 2;
  12399. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12400. StrRect.top = StrRect.bottom - 2;
  12401. StrRect.bottom += hei - 5;
  12402. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12403. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12404. m_Print.SetFontFace(12, 1, "宋体");
  12405. m_Print.DrawText((LPTSTR)(LPCTSTR)"加做取件单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12406. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12407. m_Print.SetFontFace(11, 1, "宋体");
  12408. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + m_id), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12409. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12410. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12411. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12412. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12413. m_Print.DrawRect2(StrRect, 2);
  12414. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12415. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12416. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12417. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12418. m_Print.DrawRect2(StrRect, 2);
  12419. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12420. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12421. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12422. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time4, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12423. m_Print.DrawRect2(StrRect, 2);
  12424. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12425. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12426. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12427. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12428. m_Print.DrawRect2(StrRect, 2);
  12429. ////////////
  12430. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12431. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12432. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12433. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12434. m_Print.DrawRect2(StrRect, 2);
  12435. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12436. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12437. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12438. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12439. m_Print.DrawRect2(StrRect, 2);
  12440. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12441. m_Print.DrawText((LPTSTR)(LPCTSTR)"赠送张数:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12442. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12443. m_Print.DrawText((LPTSTR)(LPCTSTR)m_photocount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12444. m_Print.DrawRect2(StrRect, 2);
  12445. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12446. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12447. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12448. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12449. m_Print.DrawRect2(StrRect, 2);
  12450. ////////////
  12451. ///////////spno
  12452. CRect sprc[22];
  12453. StrRect = load.m_rcarray.ElementAt(19);
  12454. StrRect.left += 4; StrRect.right -= 3;
  12455. hei = StrRect.Height();
  12456. for (i = 0; i < 22; i++)
  12457. {
  12458. sprc[i] = StrRect;
  12459. m_Print.DrawRect2(StrRect, 1);
  12460. if (i == 0)
  12461. {
  12462. StrRect.left += 5;
  12463. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12464. StrRect.left -= 5;
  12465. }
  12466. StrRect.top = StrRect.bottom;
  12467. StrRect.bottom = StrRect.top + hei;
  12468. sprc[i].left += 4; sprc[i].right -= 3;
  12469. }
  12470. StrRect.bottom = StrRect.top + 60;
  12471. m_Print.DrawRect2(StrRect, 1);
  12472. StrRect.left += 3; StrRect.top += 3;
  12473. StrRect.right -= 3; StrRect.bottom -= 3;
  12474. AutoDraw(m_Print, StrRect, m_bz, 1.8);
  12475. CString temp, tempspno, tempbz;
  12476. CSize size;
  12477. BOOL bRun = 0;
  12478. int fontsize = 12;
  12479. ll: tempspno = spno;
  12480. m_Print.SetFontFace(fontsize, 1, "宋体");
  12481. for (i = 1; i<22; i++)
  12482. {
  12483. if (!tempspno.IsEmpty())
  12484. {
  12485. temp = tempspno;
  12486. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12487. int right = 0;
  12488. CRect temprc = sprc[i];
  12489. while (size.cx>temprc.Width())
  12490. {
  12491. right++;
  12492. temp = tempspno.Left(tempspno.GetLength() - (right));
  12493. if (GIsHalfHZ(temp))
  12494. {
  12495. right++;
  12496. temp.Delete(temp.GetLength() - 1);
  12497. }
  12498. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12499. }
  12500. if (bRun)
  12501. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12502. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  12503. if (tempspno.IsEmpty())i++;
  12504. }
  12505. }
  12506. if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
  12507. {
  12508. fontsize--;
  12509. goto ll;
  12510. }
  12511. if (bRun == 0)
  12512. {
  12513. bRun = 1;
  12514. goto ll;
  12515. }
  12516. m_Print.SetFontFace(12, 1, "宋体");
  12517. StrRect = load2.m_rcarray.ElementAt(1);
  12518. m_Print.DrawText((LPTSTR)(LPCTSTR)"喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12519. StrRect = load2.m_rcarray.ElementAt(2);
  12520. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12521. StrRect = load2.m_rcarray.ElementAt(3);
  12522. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12523. StrRect = load2.m_rcarray.ElementAt(4);
  12524. m_Print.DrawRect2(StrRect, 2);
  12525. StrRect = load2.m_rcarray.ElementAt(0);
  12526. CString str = "\
  12527. 爱心提示:如对制作有任何要求请清楚列出,所有制作内容一经确认将按要求制作。\r\n\
  12528. 选样文件从拍摄日期计算将保留二个月;套相成品按取件日期保留三个月,逾期不做保留。\r\n\
  12529. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12530. AutoDraw(m_Print, StrRect, str, 1.8);
  12531. PrintPreview dlg; dlg.m_mode = 2;
  12532. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12533. dlg.m_pDC = m_Print.GetPDC();
  12534. if (dlg.DoModal() != IDOK)return;
  12535. //结束打印
  12536. m_Print.EndPage();
  12537. m_Print.EndPrint();
  12538. }
  12539. //分店
  12540. CString CMainFrame::GetDanWei(CString name, CArray<CStringArray, CStringArray>*array)
  12541. {
  12542. for (int i = 0; i < array->GetSize(); i++)
  12543. {
  12544. if (name == array->ElementAt(i).ElementAt(1))
  12545. return array->ElementAt(i).ElementAt(2);
  12546. }
  12547. return "";
  12548. }
  12549. //g_sendhead
  12550. int CMainFrame::GetPort()
  12551. {
  12552. static int aaa = -1;
  12553. if (aaa == -1)
  12554. {
  12555. aaa = CTime::GetCurrentTime().GetSecond() % 7;
  12556. }
  12557. aaa++;
  12558. if (aaa >= 7)aaa = 0;
  12559. return 8387 + aaa;
  12560. }
  12561. void CMainFrame::OnShowBakState()
  12562. {
  12563. // TODO: Add your command handler code here
  12564. g_sendhead.bsql = 0;
  12565. g_sendhead.code[0] = 171;
  12566. g_sendhead.tabcount = 1;
  12567. g_pMainWnd->ProcessChatMessageRequest2(1);
  12568. if (g_bSendOK == 0)
  12569. {
  12570. return;
  12571. }
  12572. CArray<CStringArray, CStringArray>g_bakstatearray;
  12573. DataToArray(&g_bakstatearray);
  12574. while (g_bakstatearray.GetSize() > 7)
  12575. {
  12576. g_bakstatearray.RemoveAt(0);
  12577. }
  12578. int photocount = 0;
  12579. int infocount = 0;
  12580. for (int i = 0; i < g_bakstatearray.GetSize(); i++)
  12581. {
  12582. if (g_bakstatearray.ElementAt(i).ElementAt(1) != "1")photocount++;
  12583. if (g_bakstatearray.ElementAt(i).ElementAt(2) != "1")infocount++;
  12584. }
  12585. ShowBakState dlg;
  12586. dlg.m_pArray = &g_bakstatearray;
  12587. dlg.DoModal();
  12588. }
  12589. void CMainFrame::PrintReceipt2(CStringArray *pArray)
  12590. {
  12591. int printcot = 1;
  12592. for (int aa = 0; aa < printcot; aa++)
  12593. {
  12594. g_sendhead.bsql = 0;
  12595. g_sendhead.code[0] = 24;
  12596. g_sendhead.tabcount = 1;
  12597. int g_nYearposTemp = g_nYearpos;
  12598. g_nYearpos = -1;
  12599. g_pMainWnd->ProcessChatMessageRequest2(1);
  12600. g_nYearpos = g_nYearposTemp;
  12601. if (0 == g_bSendOK)return;
  12602. DataToArray(&g_cominfoarray);
  12603. CString SerialNo;
  12604. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
  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(65);
  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. m_Print.StartPrint();
  12625. m_Print.StartPage();
  12626. LoadRect load;
  12627. BOOL bSmall = 0;
  12628. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  12629. {
  12630. bSmall = 1;
  12631. load.SetLiaPath("20.lia");
  12632. }
  12633. else
  12634. load.SetLiaPath("10.lia");
  12635. if (bSmall)
  12636. load.SetMargins(-10, 0);
  12637. else
  12638. load.SetMargins(10, 0);
  12639. if (!load.Load())return;
  12640. int rcpos = -1;
  12641. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12642. Image *pImg = NULL;
  12643. #ifdef MNLS_VERSION
  12644. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  12645. #else
  12646. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  12647. #endif
  12648. // m_Print.DrawImage(pImg, StrRect);
  12649. delete pImg;
  12650. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  12651. {
  12652. Image *pImg = NULL;
  12653. g_nSendCode = 31;
  12654. int g_nYearposTemp = g_nYearpos;
  12655. g_nYearpos = -1;
  12656. g_pMainWnd->ProcessChatMessageRequest2(1);
  12657. g_nYearpos = g_nYearposTemp;
  12658. g_nSendCode = 0;
  12659. if (g_bSendOK == 0)return;
  12660. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  12661. if (pImg)
  12662. {
  12663. StrRect.left = 65;
  12664. if (bSmall)StrRect.left = 55;
  12665. StrRect.top = 10;
  12666. StrRect.right = StrRect.left + 58;
  12667. StrRect.bottom = StrRect.top + 58;
  12668. m_Print.DrawImage(pImg, StrRect);
  12669. delete pImg; pImg = NULL;
  12670. }
  12671. }
  12672. if (bSmall)
  12673. {
  12674. m_Print.SetFontFace(18, 1, "黑体");
  12675. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12676. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12677. m_Print.SetFontFace(9, 1, "宋体");
  12678. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12679. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12680. m_Print.SetFontFace(6, 1, "宋体");
  12681. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12682. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12683. m_Print.SetFontFace(9, 1, "宋体");
  12684. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12685. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12686. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12687. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12688. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12689. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12690. int hei = StrRect.Height();
  12691. StrRect.bottom = StrRect.top;
  12692. StrRect.top -= 8;
  12693. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12694. m_Print.SetFontFace(10, 1, "宋体");
  12695. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12696. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12697. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12698. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12699. m_Print.SetFontFace(9, 1, "宋体");
  12700. int i = 0;
  12701. for ( i = 7; i < 24; i++)
  12702. {
  12703. StrRect = load.m_rcarray.ElementAt(i);
  12704. m_Print.DrawRect2(StrRect, 1);
  12705. }
  12706. for (i = 9; i < 24; i++)
  12707. {
  12708. StrRect = load.m_rcarray.ElementAt(i);
  12709. StrRect.left += 2;
  12710. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12711. }
  12712. m_Print.SetFontFace(6, 1, "宋体");
  12713. for (i = 24; i < 26; i++)
  12714. {
  12715. StrRect = load.m_rcarray.ElementAt(i);
  12716. StrRect.left += 2;
  12717. if (i == 24)
  12718. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12719. else
  12720. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12721. }
  12722. }
  12723. else//大单
  12724. {
  12725. m_Print.SetFontFace(20, 1, "黑体");
  12726. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12727. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12728. m_Print.SetFontFace(11, 1, "宋体");
  12729. // StrRect=load.m_rcarray .ElementAt (++rcpos);
  12730. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12731. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15;
  12732. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12733. int hei = StrRect.Height();
  12734. StrRect.bottom = StrRect.top;
  12735. StrRect.top -= 10;
  12736. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12737. m_Print.SetFontFace(8, 1, "宋体");
  12738. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12739. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12740. m_Print.SetFontFace(11, 1, "宋体");
  12741. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12742. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12743. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12744. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12745. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12746. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12747. m_Print.SetFontFace(13, 1, "宋体");
  12748. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12749. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12750. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12751. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12752. m_Print.SetFontFace(11, 1, "宋体");
  12753. int i = 0;
  12754. for ( i = 7; i < 24; i++)
  12755. {
  12756. StrRect = load.m_rcarray.ElementAt(i);
  12757. m_Print.DrawRect2(StrRect, 1);
  12758. }
  12759. for (i = 9; i < 24; i++)
  12760. {
  12761. StrRect = load.m_rcarray.ElementAt(i);
  12762. StrRect.left += 2;
  12763. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12764. }
  12765. m_Print.SetFontFace(8, 1, "宋体");
  12766. for (i = 24; i < 27; i++)
  12767. {
  12768. StrRect = load.m_rcarray.ElementAt(i);
  12769. StrRect.left += 2;
  12770. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12771. }
  12772. }
  12773. PrintPreview dlg;
  12774. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12775. dlg.m_pDC = m_Print.GetPDC();
  12776. if (aa == 0)
  12777. {
  12778. if (dlg.DoModal() != IDOK)
  12779. return;
  12780. printcot = dlg.m_num;
  12781. }
  12782. //结束打印
  12783. m_Print.EndPage();
  12784. m_Print.EndPrint();
  12785. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
  12786. CString sql;
  12787. sql.Format("update version set [serialno2]='%s'", SerialNo);
  12788. g_sendhead.bsql = 1;
  12789. g_nYearposTemp = g_nYearpos;
  12790. g_nYearpos = -1;
  12791. g_pMainWnd->ProcessChatMessageRequest2(sql);
  12792. g_nYearpos = g_nYearposTemp;
  12793. }
  12794. }
  12795. //出生年月
  12796. //第一联
  12797. void CMainFrame::OnLog()
  12798. {
  12799. // TODO: Add your command handler code here OnShowBakState
  12800. if (IsHasRightsnew(49) == 0)return;
  12801. ShowLOg dlg;
  12802. dlg.DoModal();
  12803. }
  12804. // www.lyfz.net 8888
  12805. void CMainFrame::PrintDinDan6(CString m_id)
  12806. {
  12807. // TODO: Add your control notification handler code here 预约订单
  12808. int printcot = 1;
  12809. for (int aa = 0; aa < printcot; aa++)
  12810. {
  12811. PrintPreview dlg;
  12812. CPrintRX m_Print;
  12813. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12814. {
  12815. m_Print.InitToPrint(NULL, 1);
  12816. }
  12817. else
  12818. {
  12819. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  12820. if (name.IsEmpty())
  12821. m_Print.InitToPrint(NULL, 1);
  12822. else
  12823. {
  12824. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12825. if (nret == -1 && aa == 0)
  12826. {
  12827. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12828. }
  12829. }
  12830. }
  12831. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
  12832. {
  12833. m_Print.StartPrint();
  12834. m_Print.StartPage();
  12835. LoadRect load;
  12836. load.SetLiaPath("6.lia");
  12837. load.SetMargins(-14, 15);
  12838. if (!load.Load())return;
  12839. LoadRect load2;
  12840. load2.SetLiaPath("7.lia");
  12841. load2.SetMargins(-14, 216 + 15);
  12842. if (!load2.Load())return;
  12843. LoadRect load3;
  12844. load3.SetLiaPath("8.lia");
  12845. load3.SetMargins(-14, 705 + 15);
  12846. if (!load3.Load())return;
  12847. int i;
  12848. //////////////////////////////////////////////////////////////
  12849. CStringArray txarray;
  12850. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  12851. g_sendhead.code[0] = 11;
  12852. g_sendhead.code[1] = 52;
  12853. g_sendhead.code[2] = 50;
  12854. g_sendhead.code[3] = 150;
  12855. g_sendhead.code[4] = 77;
  12856. g_sendhead.code[5] = 4;
  12857. g_sendhead.tabcount = 6;
  12858. g_sendhead.bsql = 0;
  12859. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12860. CArray<CStringArray, CStringArray>sparray;
  12861. CArray<CStringArray, CStringArray>clientarray;
  12862. CArray<CStringArray, CStringArray>phonearray;
  12863. CArray<CStringArray, CStringArray>fgarray;
  12864. CArray<CStringArray, CStringArray>danweiarray;
  12865. CArray<CStringArray, CStringArray>jdarray;
  12866. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  12867. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12868. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12869. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12870. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12871. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12872. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12873. CString m_taoxiname;
  12874. if (m_zs.Find("\\") != -1)
  12875. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
  12876. else
  12877. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
  12878. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12879. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12880. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12881. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12882. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12883. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12884. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12885. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12886. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12887. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12888. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12889. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12890. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12891. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12892. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12893. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12894. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12895. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12896. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12897. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12898. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12899. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  12900. if (jdarray.GetSize())
  12901. {
  12902. if (m_bz.IsEmpty() == 0)
  12903. m_bz = "\r\n" + m_bz;
  12904. m_bz += "景点:";
  12905. }
  12906. for (i = 0; i < jdarray.GetSize(); i++)
  12907. {
  12908. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  12909. }
  12910. m_bz.TrimRight(";");
  12911. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12912. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12913. if (IsHasRights2new(31) == 0)
  12914. {
  12915. m_phone1 = "***";
  12916. m_phone2 = "***";
  12917. }
  12918. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  12919. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  12920. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  12921. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  12922. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  12923. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  12924. filter = "name='" + m_ren + "'";
  12925. g_sendhead.code[0] = 5;
  12926. g_sendhead.tabcount = 1;
  12927. g_sendhead.bsql = 0;
  12928. int g_nYearposTemp = g_nYearpos;
  12929. g_nYearpos = -1;
  12930. g_pMainWnd->ProcessChatMessageRequest2(filter);
  12931. g_nYearpos = g_nYearposTemp;
  12932. if (g_bSendOK == 0)return;
  12933. DataToArray(&phonearray);
  12934. m_money1.Format("%f", atof(m_taoxijiage));
  12935. m_money2.Format("%f", atof(m_payed1));
  12936. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  12937. ConvertToPrice(m_money1);
  12938. ConvertToPrice(m_money2);
  12939. ConvertToPrice(m_money3);
  12940. ////////////////////////////////////////////////////////////////
  12941. int rcpos = -1;
  12942. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12943. StrRect.top -= 15; StrRect.bottom -= 15;
  12944. Image *pImg = NULL;
  12945. #ifdef MNLS_VERSION
  12946. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  12947. #else
  12948. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  12949. #endif
  12950. m_Print.DrawImage(pImg, StrRect);
  12951. delete pImg;
  12952. m_Print.SetFontFace(11, 1, "宋体");
  12953. StrRect = load.m_rcarray.ElementAt(20);
  12954. StrRect.right = load.m_rcarray.ElementAt(23).right;
  12955. StrRect.top -= 18; StrRect.bottom -= 18;
  12956. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  12957. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12958. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  12959. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12960. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12961. StrRect.top -= 15; StrRect.bottom -= 15;
  12962. #ifdef MNLS_VERSION
  12963. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12964. #endif
  12965. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12966. StrRect.top -= 15; StrRect.bottom -= 15;
  12967. #ifdef MNLS_VERSION
  12968. m_Print.DrawRect(StrRect);
  12969. #endif
  12970. m_Print.SetFontFace(7, 1, "黑体");
  12971. m_Print.SetColor(0xffffff);
  12972. #ifdef MNLS_VERSION
  12973. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12974. #endif
  12975. m_Print.SetColor(0);
  12976. m_Print.SetFontFace(15, 1, "宋体");
  12977. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12978. StrRect.top -= 15; StrRect.bottom -= 15;
  12979. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同拍摄单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12980. CStringArray strarray;
  12981. strarray.Add("NO: " + m_id);
  12982. CString date;
  12983. date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  12984. strarray.Add(date);
  12985. strarray.Add("喜爱");
  12986. strarray.Add("格调");
  12987. if (fgarray.GetSize() == 12)
  12988. {
  12989. for (int i = 0; i < 12; i++)
  12990. strarray.Add(fgarray.ElementAt(i).ElementAt(0));
  12991. }
  12992. else
  12993. {
  12994. strarray.Add("复古典雅");
  12995. strarray.Add("温文尔雅");
  12996. strarray.Add("豪华艳丽");
  12997. strarray.Add("传统大方");
  12998. strarray.Add("新潮个性");
  12999. strarray.Add("浪漫奔放");
  13000. strarray.Add("简单素雅");
  13001. strarray.Add("活泼俏丽");
  13002. strarray.Add("妩媚温馨");
  13003. strarray.Add("温柔贤惠");
  13004. strarray.Add("成熟感性");
  13005. strarray.Add("清纯可爱");
  13006. }
  13007. strarray.Add("姓名");
  13008. // strarray.Add("职业");
  13009. strarray.Add("");
  13010. strarray.Add("地址");
  13011. strarray.Add("电话");
  13012. #ifdef CHILD_VERSION
  13013. strarray.Add("家长");
  13014. strarray.Add("宝宝");
  13015. #else
  13016. strarray.Add("先生");
  13017. strarray.Add("女士");
  13018. #endif
  13019. m_Print.SetFontFace(11, 1, "宋体");
  13020. for (i = 0; i < strarray.GetSize(); i++)
  13021. {
  13022. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13023. if (i < 2)
  13024. {
  13025. StrRect.top -= 15; StrRect.bottom -= 15;
  13026. }
  13027. if (i>15)
  13028. m_Print.DrawRect2(StrRect, 1);
  13029. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13030. }
  13031. for (i = 29; i <= 40; i++)
  13032. {
  13033. if (m_style.GetLength() <= (i - 29))continue;
  13034. if (m_style.GetAt(i - 29) != '1')continue;
  13035. StrRect = load.m_rcarray.ElementAt(i - 1);
  13036. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13037. }
  13038. for (i = 27; i <= 48; i++)
  13039. {
  13040. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13041. m_Print.DrawRect2(StrRect, 1);
  13042. }
  13043. #ifdef CHILD_VERSION
  13044. StrRect = load.m_rcarray.ElementAt(45);
  13045. StrRect.right = StrRect.left + 62;
  13046. m_Print.DrawRect2(StrRect, 1);
  13047. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13048. StrRect.left = StrRect.right;
  13049. StrRect.right = StrRect.left + 62;
  13050. m_Print.DrawRect2(StrRect, 1);
  13051. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13052. StrRect.left = StrRect.right;
  13053. StrRect.right = StrRect.left + 62;
  13054. m_Print.DrawRect2(StrRect, 1);
  13055. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13056. StrRect.left = StrRect.right;
  13057. StrRect.right = StrRect.left + 62;
  13058. m_Print.DrawRect2(StrRect, 1);
  13059. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13060. #endif
  13061. /////////////////////////
  13062. strarray.RemoveAll();
  13063. CString temp;
  13064. temp.Format("拍摄多款选 %d 款,其中影", atoi(m_outside) + atoi(m_outside2));
  13065. strarray.Add(temp);
  13066. temp.Format("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  13067. strarray.Add(temp);
  13068. strarray.Add("化妆");
  13069. strarray.Add("造型");
  13070. #ifdef CHILD_VERSION
  13071. strarray.Add("");
  13072. #else
  13073. strarray.Add("婚纱");
  13074. #endif
  13075. strarray.Add("服饰");
  13076. strarray.Add("配");
  13077. strarray.Add("置");
  13078. strarray.Add("其");
  13079. strarray.Add("它");
  13080. strarray.Add("套系名称");
  13081. strarray.Add("镜款");
  13082. strarray.Add("套系总价");
  13083. strarray.Add("主摄影师");
  13084. strarray.Add("拍摄日期");
  13085. strarray.Add("定金");
  13086. #ifdef CHILD_VERSION
  13087. strarray.Add("主引导师");
  13088. #else
  13089. strarray.Add("主化妆师");
  13090. #endif
  13091. strarray.Add("看样日期");
  13092. strarray.Add("补 余 款");
  13093. strarray.Add("总监");
  13094. strarray.Add("取件日期");
  13095. rcpos = -1;
  13096. for (i = 0; i < strarray.GetSize(); i++)
  13097. {
  13098. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  13099. if (i>9)
  13100. m_Print.DrawRect2(StrRect, 1);
  13101. #ifdef CHILD_VERSION
  13102. if (i == 5)
  13103. StrRect.top -= StrRect.Height();
  13104. #endif
  13105. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13106. }
  13107. for (i = 22; i <= 41; i++)
  13108. {
  13109. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  13110. m_Print.DrawRect2(StrRect, 1);
  13111. }
  13112. /////////////////////////////
  13113. strarray.RemoveAll();
  13114. #ifdef CHILD_VERSION
  13115. strarray.Add("顾客方 家长:");
  13116. strarray.Add("宝宝:");
  13117. #else
  13118. strarray.Add("顾客方 先生:");
  13119. strarray.Add("女士:");
  13120. #endif
  13121. strarray.Add("电话:");
  13122. strarray.Add("影楼方 店长:");
  13123. strarray.Add("接单人:");
  13124. strarray.Add("电话:");
  13125. rcpos = -1;
  13126. for (i = 0; i < strarray.GetSize(); i++)
  13127. {
  13128. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  13129. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13130. }
  13131. for (i = 7; i <= 12; i++)
  13132. {
  13133. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  13134. // if(i!=10)
  13135. m_Print.DrawRect2(StrRect, 2);
  13136. }
  13137. //////////////////////////////////////
  13138. //开始打数据
  13139. strarray.RemoveAll();
  13140. strarray.Add(m_name1);
  13141. strarray.Add(m_name2);
  13142. strarray.Add("");
  13143. strarray.Add("");
  13144. strarray.Add(m_addr1);
  13145. #ifdef CHILD_VERSION
  13146. strarray.Add("");
  13147. #else
  13148. strarray.Add(m_addr2);
  13149. #endif
  13150. strarray.Add(m_phone1);
  13151. strarray.Add(m_phone2);
  13152. for (i = 41; i <= 48; i++)
  13153. {
  13154. StrRect = load.m_rcarray.ElementAt(i - 1);
  13155. StrRect.left += 4;
  13156. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13157. }
  13158. ///////////////////////////////
  13159. strarray.RemoveAll();
  13160. strarray.Add(m_money1);
  13161. strarray.Add(m_waiter1);
  13162. strarray.Add(m_time2);
  13163. strarray.Add(m_money2);
  13164. strarray.Add(m_waiter2);
  13165. strarray.Add(m_time4);
  13166. strarray.Add(m_money3);
  13167. strarray.Add("");
  13168. strarray.Add(m_time5);
  13169. for (i = 32; i <= 40; i++)
  13170. {
  13171. StrRect = load2.m_rcarray.ElementAt(i - 1);
  13172. StrRect.left += 4;
  13173. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13174. }
  13175. ///////////////////////////////
  13176. strarray.RemoveAll();
  13177. strarray.Add("");//m_name1);
  13178. strarray.Add("");//m_name2);
  13179. CString phone;
  13180. if (m_phone1.IsEmpty() == 0)
  13181. phone = m_phone1 + ",";
  13182. phone += m_phone2;
  13183. phone.TrimRight(",");
  13184. strarray.Add("");//phone);
  13185. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
  13186. strarray.Add(m_ren);
  13187. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13188. for (i = 7; i <= 12; i++)
  13189. {
  13190. StrRect = load3.m_rcarray.ElementAt(i - 1);
  13191. StrRect.left += 4;
  13192. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13193. }
  13194. StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
  13195. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13196. StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
  13197. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13198. StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
  13199. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13200. //////////////////////////////
  13201. //开始画文字
  13202. StrRect = load2.m_rcarray.ElementAt(30);
  13203. StrRect.left += 3;
  13204. StrRect.top += 3;
  13205. StrRect.right -= 2;
  13206. StrRect.bottom -= 2;
  13207. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  13208. StrRect = load2.m_rcarray.ElementAt(29);
  13209. StrRect.left += 3;
  13210. StrRect.top += 3;
  13211. StrRect.right -= 2;
  13212. StrRect.bottom -= 2;
  13213. str = "";
  13214. for (i = 0; i < sparray.GetSize(); i++)
  13215. {
  13216. str += sparray.ElementAt(i).ElementAt(5);
  13217. str += " 数量:";
  13218. str += sparray.ElementAt(i).ElementAt(3);
  13219. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  13220. str += "\r\n";
  13221. }
  13222. str.TrimRight("\r\n");
  13223. AutoDraw(m_Print, StrRect, str, 1.4);
  13224. StrRect = load2.m_rcarray.ElementAt(40);
  13225. StrRect.top += 8;
  13226. m_Print.SetFontFace(12, 1, "黑体");
  13227. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  13228. StrRect.left += 3;
  13229. StrRect.top += 30;
  13230. StrRect.right -= 2;
  13231. StrRect.bottom -= 2;
  13232. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  13233. if (str.IsEmpty())
  13234. {
  13235. str = "\
  13236. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  13237. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  13238. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  13239. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  13240. 持良好的心境.\r\n\
  13241. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  13242. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  13243. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  13244. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  13245. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  13246. 勿进影室, 以免影响拍摄.\r\n\
  13247. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  13248. 师或店长沟通.\r\n\
  13249. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  13250. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  13251. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  13252. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  13253. 9. 本合同余额欠款须在拍照前付清.\r\n\
  13254. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  13255. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  13256. 还.";
  13257. }
  13258. AutoDraw(m_Print, StrRect, str, 1.8);
  13259. }
  13260. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13261. dlg.m_pDC = m_Print.GetPDC();
  13262. dlg.m_mode = 1;
  13263. if (aa == 0)
  13264. {
  13265. if (dlg.DoModal() != IDOK)
  13266. return;
  13267. printcot = dlg.m_num;
  13268. }
  13269. //结束打印
  13270. m_Print.EndPage();
  13271. m_Print.EndPrint();
  13272. }
  13273. }
  13274. void CMainFrame::InsideMsg()
  13275. {
  13276. ///内部消息
  13277. CString str;
  13278. g_sendhead.bsql = 0;
  13279. g_sendhead.code[0] = 126;
  13280. g_sendhead.tabcount = 1;
  13281. g_bNoConnDlg = 1;
  13282. g_pMainWnd->ProcessChatMessageRequest2(1); g_bNoConnDlg = 0;
  13283. if (g_bSendOK == 0)return;
  13284. CArray<CStringArray, CStringArray>m_List1array;
  13285. DataToArray(&g_List1array);//, &m_List1array);
  13286. m_List1array.SetSize(g_List1array.GetSize());
  13287. int i = 0;
  13288. for ( i = 0; i < g_List1array.GetSize(); i++)
  13289. {
  13290. m_List1array.ElementAt(i).Copy(g_List1array.ElementAt(i));
  13291. }
  13292. str = "," + g_user.name + ",";
  13293. for (i = g_List1array.GetSize() - 1; i >= 0; i--)
  13294. {
  13295. CString receivers2 = g_List1array.ElementAt(i).ElementAt(4);
  13296. receivers2.TrimLeft(",");
  13297. receivers2.TrimRight(",");
  13298. receivers2 = "," + receivers2 + ",";
  13299. CString receivers = g_List1array.ElementAt(i).ElementAt(3);
  13300. receivers.TrimLeft(",");
  13301. receivers.TrimRight(",");
  13302. receivers = "," + receivers + ",";
  13303. if (receivers.Find(str) == -1)
  13304. g_List1array.RemoveAt(i);
  13305. else if (receivers2.Find(str) != -1)
  13306. g_List1array.RemoveAt(i);
  13307. }
  13308. if (g_List1array.GetSize())
  13309. {
  13310. ShowMsg dlg;
  13311. dlg.DoModal();
  13312. }
  13313. for (i = m_List1array.GetSize() - 1; i >= 0; i--)
  13314. {
  13315. CString receivers2 = m_List1array.ElementAt(i).ElementAt(4);
  13316. receivers2.TrimLeft(",");
  13317. receivers2.TrimRight(",");
  13318. receivers2 = "," + receivers2 + ",";
  13319. CString receivers = m_List1array.ElementAt(i).ElementAt(3);
  13320. if (receivers != "")
  13321. m_List1array.RemoveAt(i);
  13322. else if (receivers2.Find(str) != -1)
  13323. m_List1array.RemoveAt(i);
  13324. }
  13325. if (m_List1array.GetSize())
  13326. {
  13327. SendInsideMsg2 dlg;
  13328. dlg.m_bShow = 1;
  13329. dlg.m_pArray = &m_List1array;
  13330. dlg.DoModal();
  13331. }
  13332. }
  13333. //定金
  13334. void CMainFrame::PrintHireDress(CString strOrderNumber) // 打印礼服出租单;
  13335. {
  13336. int printcot = 1;
  13337. for (int aa = 0; aa < printcot; aa++)
  13338. {
  13339. CPrintRX m_Print;
  13340. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13341. {
  13342. m_Print.InitToPrint(NULL, 1);
  13343. }
  13344. else
  13345. {
  13346. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13347. if (name.IsEmpty())
  13348. m_Print.InitToPrint(NULL, 1);
  13349. else
  13350. {
  13351. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13352. if (nret == -1 && aa == 0)
  13353. {
  13354. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13355. }
  13356. }
  13357. }
  13358. m_Print.StartPrint();
  13359. m_Print.StartPage();
  13360. LoadRect load;
  13361. load.SetLiaPath("21.lia");
  13362. load.SetMargins(0, 0);
  13363. if (!load.Load())
  13364. {
  13365. return;
  13366. }
  13367. int i;
  13368. //////////////////////////////////////////////////////////////
  13369. //CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  13370. CString strFilter;
  13371. strFilter.Format("id='%s';id='%s';id='%s'", strOrderNumber, strOrderNumber, strOrderNumber);
  13372. g_sendhead.bsql = 0;
  13373. g_sendhead.code[0] = 73;
  13374. g_sendhead.code[1] = 74;
  13375. g_sendhead.code[2] = 52;
  13376. g_sendhead.tabcount = 3;
  13377. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  13378. if (g_bSendOK == 0)
  13379. {
  13380. return;
  13381. }
  13382. CArray<CStringArray, CStringArray>dresshirearray;
  13383. CArray<CStringArray, CStringArray>dresshiredataarray;
  13384. CArray<CStringArray, CStringArray>clientarray;
  13385. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13386. if (dresshirearray.GetSize() == 0)
  13387. {
  13388. return;
  13389. }
  13390. CString m_remark = dresshirearray.ElementAt(0).ElementAt(10);
  13391. CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7);
  13392. CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8);
  13393. CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6);
  13394. if (clientarray.GetSize() == 0)
  13395. {
  13396. return;
  13397. }
  13398. //AfxMessageBox("打印礼服出租单-()");
  13399. CString m_name2 = clientarray.ElementAt(0).ElementAt(2);
  13400. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  13401. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  13402. CString m_time3 = clientarray.ElementAt(0).ElementAt(20);
  13403. //#if JEFF_TEST
  13404. // if ( dresshiredataarray.GetSize() == 0 )
  13405. // {
  13406. // AfxMessageBox("没衣服");
  13407. // }
  13408. //#endif
  13409. CString sItem;
  13410. for (i = 0; i < dresshiredataarray.GetSize(); i++)
  13411. {
  13412. sItem += dresshiredataarray.ElementAt(i).ElementAt(1);
  13413. sItem += " ";
  13414. sItem += dresshiredataarray.ElementAt(i).ElementAt(2);
  13415. sItem += " 数量:";
  13416. sItem += dresshiredataarray.ElementAt(i).ElementAt(3);
  13417. sItem += " 金额:";
  13418. sItem += dresshirearray.ElementAt(i).ElementAt(1);
  13419. sItem += " 押金:";
  13420. sItem += dresshirearray.ElementAt(i).ElementAt(2) + "\r\n";
  13421. }
  13422. ////////////////////////////////////////////////////////////////
  13423. int rcpos = -1;
  13424. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13425. m_Print.SetFontFace(17, 1, "宋体");
  13426. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13427. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13428. m_Print.SetFontFace(10, 1, "宋体");
  13429. m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13430. CStringArray strarray;
  13431. strarray.Add("客户姓名");
  13432. strarray.Add("客户电话");
  13433. strarray.Add("预定日期");
  13434. strarray.Add("结婚日期");
  13435. strarray.Add("取件日期");
  13436. strarray.Add("归还日期");
  13437. strarray.Add("本店地址");
  13438. strarray.Add("电 话");
  13439. strarray.Add("客户地址");
  13440. strarray.Add("客户签名");
  13441. for (i = 2; i < 12; i++)
  13442. {
  13443. StrRect = load.m_rcarray.ElementAt(i);
  13444. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13445. }
  13446. strarray.RemoveAll();
  13447. strarray.Add(m_name2);
  13448. strarray.Add(m_phone2);
  13449. strarray.Add(m_inputdate);
  13450. strarray.Add(m_time3);
  13451. strarray.Add(m_date1);
  13452. strarray.Add(m_date2);
  13453. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
  13454. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13455. strarray.Add(m_addr2);
  13456. strarray.Add("");
  13457. for (i = 12; i < 22; i++)
  13458. {
  13459. StrRect = load.m_rcarray.ElementAt(i);
  13460. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13461. m_Print.DrawRect2(StrRect, 2);
  13462. }
  13463. for (i = 25; i < 30; i++)
  13464. {
  13465. StrRect = load.m_rcarray.ElementAt(i);
  13466. m_Print.DrawRect2(StrRect, 1);
  13467. }
  13468. StrRect = load.m_rcarray.ElementAt(22);
  13469. StrRect.top += 7;
  13470. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13471. StrRect = load.m_rcarray.ElementAt(23);
  13472. StrRect.top += 7;
  13473. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13474. StrRect = load.m_rcarray.ElementAt(24);
  13475. StrRect.top += 7;
  13476. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13477. StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
  13478. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13479. StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
  13480. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13481. StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
  13482. CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
  13483. if (str.IsEmpty())
  13484. {
  13485. str = "\
  13486. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13487. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13488. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13489. 4. 如有破损酌情赔偿.";
  13490. }
  13491. AutoDraw(m_Print, StrRect, str, 1.5);
  13492. PrintPreview dlg;
  13493. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13494. dlg.m_pDC = m_Print.GetPDC();
  13495. if (aa == 0)
  13496. {
  13497. if (dlg.DoModal() != IDOK)
  13498. return;
  13499. printcot = dlg.m_num;
  13500. }
  13501. //结束打印
  13502. m_Print.EndPage();
  13503. m_Print.EndPrint();
  13504. }
  13505. }
  13506. void CMainFrame::PrintHireDress_01(CString strOrderNumber) // 打印礼服出租单,无法改变结构,需要修改21.lia才能改变打印的布局;
  13507. {
  13508. int printcot = 1;
  13509. for (int aa = 0; aa < printcot; aa++)
  13510. {
  13511. CPrintRX m_Print;
  13512. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13513. {
  13514. m_Print.InitToPrint(NULL, 1);
  13515. }
  13516. else
  13517. {
  13518. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13519. if (name.IsEmpty())
  13520. m_Print.InitToPrint(NULL, 1);
  13521. else
  13522. {
  13523. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13524. if (nret == -1 && aa == 0)
  13525. {
  13526. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13527. }
  13528. }
  13529. }
  13530. m_Print.StartPrint();
  13531. m_Print.StartPage();
  13532. LoadRect load;
  13533. load.SetLiaPath("21.lia");
  13534. load.SetMargins(0, 0);
  13535. if (!load.Load())return;
  13536. int i;
  13537. //////////////////////////////////////////////////////////////
  13538. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  13539. g_sendhead.bsql = 0;
  13540. g_sendhead.code[0] = 73;
  13541. g_sendhead.code[1] = 74;
  13542. g_sendhead.code[2] = 52;
  13543. g_sendhead.tabcount = 3;
  13544. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13545. if (g_bSendOK == 0)
  13546. {
  13547. return;
  13548. }
  13549. CArray<CStringArray, CStringArray>dresshirearray;
  13550. CArray<CStringArray, CStringArray>dresshiredataarray;
  13551. CArray<CStringArray, CStringArray>clientarray;
  13552. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13553. if (dresshirearray.GetSize() == 0)return;
  13554. CString m_remark = dresshirearray.ElementAt(0).ElementAt(10);
  13555. CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7);
  13556. CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8);
  13557. CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6);
  13558. CString strPrice = dresshirearray.ElementAt(0).ElementAt(1); // 金额;
  13559. CString strDeposit = dresshirearray.ElementAt(0).ElementAt(2); // 押金;
  13560. if (clientarray.GetSize() == 0)return;
  13561. CString m_name2 = clientarray.ElementAt(0).ElementAt(2);
  13562. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  13563. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  13564. CString m_time3 = clientarray.ElementAt(0).ElementAt(20);
  13565. CString sItem;
  13566. for (i = 0; i < dresshiredataarray.GetSize(); i++)
  13567. {
  13568. sItem += dresshiredataarray.ElementAt(i).ElementAt(1);
  13569. sItem += " ";
  13570. sItem += dresshiredataarray.ElementAt(i).ElementAt(2);
  13571. sItem += " 数量:";
  13572. //sItem+=dresshiredataarray.ElementAt (i).ElementAt (3);
  13573. sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n";
  13574. }
  13575. ////////////////////////////////////////////////////////////////
  13576. int rcpos = -1;
  13577. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13578. m_Print.SetFontFace(17, 1, "宋体");
  13579. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13580. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13581. m_Print.SetFontFace(10, 1, "宋体");
  13582. m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13583. CStringArray strarray;
  13584. strarray.Add("客户姓名"); // 1.
  13585. strarray.Add("客户电话");
  13586. strarray.Add("预定日期");
  13587. strarray.Add("结婚日期");
  13588. strarray.Add("取件日期"); // 5.
  13589. strarray.Add("归还日期");
  13590. strarray.Add("本店地址");
  13591. strarray.Add("电 话");
  13592. strarray.Add("客户地址");
  13593. strarray.Add("客户签名"); // 10.
  13594. strarray.Add("金额");
  13595. strarray.Add("押金");
  13596. //for( i=2; i<12; i++)
  13597. for (i = 2; i < 14; i++)
  13598. {
  13599. StrRect = load.m_rcarray.ElementAt(i);
  13600. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13601. }
  13602. strarray.RemoveAll();
  13603. strarray.Add(m_name2);
  13604. strarray.Add(m_phone2);
  13605. strarray.Add(m_inputdate);
  13606. strarray.Add(m_time3);
  13607. strarray.Add(m_date1);
  13608. strarray.Add(m_date2);
  13609. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
  13610. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13611. strarray.Add(m_addr2);
  13612. strarray.Add("");
  13613. strarray.Add(strPrice); // 金额;
  13614. strarray.Add(strDeposit); // 押金;
  13615. //for( i=12; i<22; i++)
  13616. for (i = 14; i < 24; i++)
  13617. {
  13618. StrRect = load.m_rcarray.ElementAt(i);
  13619. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13620. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 14), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13621. m_Print.DrawRect2(StrRect, 2);
  13622. }
  13623. for (i = 25; i < 30; i++)
  13624. {
  13625. StrRect = load.m_rcarray.ElementAt(i);
  13626. m_Print.DrawRect2(StrRect, 1);
  13627. }
  13628. StrRect = load.m_rcarray.ElementAt(22);
  13629. StrRect.top += 7;
  13630. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13631. StrRect = load.m_rcarray.ElementAt(23);
  13632. StrRect.top += 7;
  13633. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13634. StrRect = load.m_rcarray.ElementAt(24);
  13635. StrRect.top += 7;
  13636. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13637. StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
  13638. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13639. StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
  13640. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13641. StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
  13642. CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
  13643. if (str.IsEmpty())
  13644. {
  13645. str = "\
  13646. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13647. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13648. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13649. 4. 如有破损酌情赔偿.";
  13650. }
  13651. AutoDraw(m_Print, StrRect, str, 1.5);
  13652. PrintPreview dlg;
  13653. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13654. dlg.m_pDC = m_Print.GetPDC();
  13655. if (aa == 0)
  13656. {
  13657. if (dlg.DoModal() != IDOK)
  13658. return;
  13659. printcot = dlg.m_num;
  13660. }
  13661. //结束打印
  13662. m_Print.EndPage();
  13663. m_Print.EndPrint();
  13664. }
  13665. }
  13666. // ****************************************************************************
  13667. // Jeff:
  13668. // 函数:PrintHireDress2
  13669. // 无参;
  13670. // 调用者:DinDanFrom.cpp
  13671. // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
  13672. // 当订单数大于1000,设置连接公司服务器开关量为真;
  13673. // -----------------------------------------------------------------------------
  13674. // 修改:Jeff
  13675. // 时间:2014.10.18
  13676. // 内容:将 g_ncot 比较值改为100;
  13677. // ****************************************************************************
  13678. void CMainFrame::PrintHireDress2()
  13679. {
  13680. if (g_ncot > 100) g_bSendLYFZ = 1;
  13681. // g_pMainWnd->SetTimer (7, 3000, NULL);
  13682. }
  13683. void CMainFrame::PrintTakeForm2(CArray<CStringArray, CStringArray>*Listarray)
  13684. {
  13685. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "选片客人明细表";
  13686. int pages = Listarray->GetSize() / 46;
  13687. if (Listarray->GetSize() % 46)pages++;
  13688. for (int aa = 0; aa < pages; aa++)
  13689. {
  13690. PrintPreview dlg;
  13691. CPrintRX m_Print;
  13692. m_Print.InitToPrint(NULL, 1);
  13693. m_Print.StartPrint();
  13694. m_Print.StartPage();
  13695. CRect mainrc(0, 0, 560, 793);
  13696. float fscale;
  13697. {
  13698. int w, h;
  13699. m_Print.GetWidHei(w, h);
  13700. fscale = (float)w / (float)h;
  13701. }
  13702. mainrc.DeflateRect(25, 40, 10, 0);
  13703. CRect rc, rc2;
  13704. rc = mainrc;
  13705. rc.bottom = rc.top;
  13706. rc.top -= 20;
  13707. m_Print.SetFontFace(16, 1, "黑体");
  13708. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13709. m_Print.SetFontFace(9, 1, "宋体");
  13710. CString str;
  13711. int wid[5] = { 200, 110, 70, 85, 62 };
  13712. int hei = 16;
  13713. if (fscale > 0.71)hei = 15;
  13714. rc = mainrc;
  13715. rc.bottom = rc.top + hei;
  13716. for (int i = 0; i < 47; i++)
  13717. {
  13718. rc2.top = rc.top + i*hei;
  13719. rc2.bottom = rc.bottom + i*hei;
  13720. rc2.left = rc.left;
  13721. rc2.right = rc.left + wid[0];
  13722. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  13723. for (int j = 0; j<5; j++)
  13724. {
  13725. m_Print.DrawRect2(rc2, 1);
  13726. if (Listarray->GetSize()>aa * 46 + i)
  13727. {
  13728. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  13729. rc2.left += 3;
  13730. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13731. rc2.left -= 3;
  13732. }
  13733. rc2.left += wid[j];
  13734. rc2.right = rc2.left + wid[j + 1];
  13735. }
  13736. }
  13737. rc2.top += 2;
  13738. rc2.left += 2; rc2.right = mainrc.right + 4;
  13739. m_Print.SetFontFace(8, 1, "宋体");
  13740. str.Format(" 页:%d/%d", aa + 1, pages);
  13741. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  13742. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13743. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13744. dlg.m_pDC = m_Print.GetPDC();
  13745. // dlg.m_mode=1;
  13746. if (aa == 0)
  13747. {
  13748. if (dlg.DoModal() != IDOK)
  13749. return;
  13750. }
  13751. //结束打印
  13752. m_Print.EndPage();
  13753. m_Print.EndPrint();
  13754. }
  13755. }
  13756. void CMainFrame::PrintTakeForm3(CArray<CStringArray, CStringArray>*Listarray)
  13757. {
  13758. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "看设计客人明细表";
  13759. int pages = Listarray->GetSize() / 46;
  13760. if (Listarray->GetSize() % 46)pages++;
  13761. for (int aa = 0; aa < pages; aa++)
  13762. {
  13763. PrintPreview dlg;
  13764. CPrintRX m_Print;
  13765. m_Print.InitToPrint(NULL, 1);
  13766. m_Print.StartPrint();
  13767. m_Print.StartPage();
  13768. CRect mainrc(0, 0, 560, 793);
  13769. float fscale;
  13770. {
  13771. int w, h;
  13772. m_Print.GetWidHei(w, h);
  13773. fscale = (float)w / (float)h;
  13774. }
  13775. mainrc.DeflateRect(25, 40, 10, 0);
  13776. CRect rc, rc2;
  13777. rc = mainrc;
  13778. rc.bottom = rc.top;
  13779. rc.top -= 20;
  13780. m_Print.SetFontFace(16, 1, "黑体");
  13781. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13782. m_Print.SetFontFace(9, 1, "宋体");
  13783. CString str;
  13784. int wid[5] = { 200, 110, 70, 85, 62 };
  13785. int hei = 16;
  13786. if (fscale > 0.71)hei = 15;
  13787. rc = mainrc;
  13788. rc.bottom = rc.top + hei;
  13789. for (int i = 0; i < 47; i++)
  13790. {
  13791. rc2.top = rc.top + i*hei;
  13792. rc2.bottom = rc.bottom + i*hei;
  13793. rc2.left = rc.left;
  13794. rc2.right = rc.left + wid[0];
  13795. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  13796. for (int j = 0; j<5; j++)
  13797. {
  13798. m_Print.DrawRect2(rc2, 1);
  13799. if (Listarray->GetSize()>aa * 46 + i)
  13800. {
  13801. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  13802. rc2.left += 3;
  13803. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13804. rc2.left -= 3;
  13805. }
  13806. rc2.left += wid[j];
  13807. rc2.right = rc2.left + wid[j + 1];
  13808. }
  13809. }
  13810. rc2.top += 2;
  13811. rc2.left += 2; rc2.right = mainrc.right + 4;
  13812. m_Print.SetFontFace(8, 1, "宋体");
  13813. str.Format(" 页:%d/%d", aa + 1, pages);
  13814. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  13815. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13816. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13817. dlg.m_pDC = m_Print.GetPDC();
  13818. // dlg.m_mode=1;
  13819. if (aa == 0)
  13820. {
  13821. if (dlg.DoModal() != IDOK)
  13822. return;
  13823. }
  13824. //结束打印
  13825. m_Print.EndPage();
  13826. m_Print.EndPrint();
  13827. }
  13828. }
  13829. void CMainFrame::PrintTakeForm4(CArray<CStringArray, CStringArray>*Listarray)
  13830. {
  13831. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "取件客人明细表";
  13832. int pages = Listarray->GetSize() / 46;
  13833. if (Listarray->GetSize() % 46)pages++;
  13834. for (int aa = 0; aa < pages; aa++)
  13835. {
  13836. PrintPreview dlg;
  13837. CPrintRX m_Print;
  13838. m_Print.InitToPrint(NULL, 1);
  13839. m_Print.StartPrint();
  13840. m_Print.StartPage();
  13841. CRect mainrc(0, 0, 560, 793);
  13842. float fscale;
  13843. {
  13844. int w, h;
  13845. m_Print.GetWidHei(w, h);
  13846. fscale = (float)w / (float)h;
  13847. }
  13848. mainrc.DeflateRect(25, 40, 10, 0);
  13849. CRect rc, rc2;
  13850. rc = mainrc;
  13851. rc.bottom = rc.top;
  13852. rc.top -= 20;
  13853. m_Print.SetFontFace(16, 1, "黑体");
  13854. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13855. m_Print.SetFontFace(9, 1, "宋体");
  13856. CString str;
  13857. int wid[5] = { 200, 110, 70, 85, 62 };
  13858. int hei = 16;
  13859. if (fscale > 0.71)hei = 15;
  13860. rc = mainrc;
  13861. rc.bottom = rc.top + hei;
  13862. for (int i = 0; i < 47; i++)
  13863. {
  13864. rc2.top = rc.top + i*hei;
  13865. rc2.bottom = rc.bottom + i*hei;
  13866. rc2.left = rc.left;
  13867. rc2.right = rc.left + wid[0];
  13868. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  13869. for (int j = 0; j<5; j++)
  13870. {
  13871. m_Print.DrawRect2(rc2, 1);
  13872. if (Listarray->GetSize()>aa * 46 + i)
  13873. {
  13874. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  13875. rc2.left += 3;
  13876. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13877. rc2.left -= 3;
  13878. }
  13879. rc2.left += wid[j];
  13880. rc2.right = rc2.left + wid[j + 1];
  13881. }
  13882. }
  13883. rc2.top += 2;
  13884. rc2.left += 2; rc2.right = mainrc.right + 4;
  13885. m_Print.SetFontFace(8, 1, "宋体");
  13886. str.Format(" 页:%d/%d", aa + 1, pages);
  13887. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  13888. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13889. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13890. dlg.m_pDC = m_Print.GetPDC();
  13891. // dlg.m_mode=1;
  13892. if (aa == 0)
  13893. {
  13894. if (dlg.DoModal() != IDOK)
  13895. return;
  13896. }
  13897. //结束打印
  13898. m_Print.EndPage();
  13899. m_Print.EndPrint();
  13900. }
  13901. }
  13902. void CMainFrame::PrintTakeForm5(CArray<CStringArray, CStringArray>*Listarray)
  13903. {
  13904. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "婚庆客人明细表";
  13905. int pages = Listarray->GetSize() / 46;
  13906. if (Listarray->GetSize() % 46)pages++;
  13907. for (int aa = 0; aa < pages; aa++)
  13908. {
  13909. PrintPreview dlg;
  13910. CPrintRX m_Print;
  13911. m_Print.InitToPrint(NULL, 1);
  13912. m_Print.StartPrint();
  13913. m_Print.StartPage();
  13914. CRect mainrc(0, 0, 560, 793);
  13915. float fscale;
  13916. {
  13917. int w, h;
  13918. m_Print.GetWidHei(w, h);
  13919. fscale = (float)w / (float)h;
  13920. }
  13921. mainrc.DeflateRect(25, 40, 10, 0);
  13922. CRect rc, rc2;
  13923. rc = mainrc;
  13924. rc.bottom = rc.top;
  13925. rc.top -= 20;
  13926. m_Print.SetFontFace(16, 1, "黑体");
  13927. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13928. m_Print.SetFontFace(8, 1, "宋体");
  13929. CString str;
  13930. int wid[7] = { 165, 90, 90, 45, 45, 60, 35 };
  13931. int hei = 16;
  13932. if (fscale > 0.71)hei = 15;
  13933. rc = mainrc;
  13934. rc.bottom = rc.top + hei;
  13935. for (int i = 0; i < 47; i++)
  13936. {
  13937. rc2.top = rc.top + i*hei;
  13938. rc2.bottom = rc.bottom + i*hei;
  13939. rc2.left = rc.left;
  13940. rc2.right = rc.left + wid[0];
  13941. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  13942. for (int j = 0; j<7; j++)
  13943. {
  13944. m_Print.DrawRect2(rc2, 1);
  13945. if (Listarray->GetSize()>aa * 46 + i)
  13946. {
  13947. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  13948. rc2.left += 3;
  13949. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13950. rc2.left -= 3;
  13951. }
  13952. rc2.left += wid[j];
  13953. rc2.right = rc2.left + wid[j + 1];
  13954. }
  13955. }
  13956. rc2.top += 2;
  13957. rc2.left += 2; rc2.right = mainrc.right + 4;
  13958. m_Print.SetFontFace(8, 1, "宋体");
  13959. str.Format(" 页:%d/%d", aa + 1, pages);
  13960. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  13961. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13962. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13963. dlg.m_pDC = m_Print.GetPDC();
  13964. // dlg.m_mode=1;
  13965. if (aa == 0)
  13966. {
  13967. if (dlg.DoModal() != IDOK)
  13968. return;
  13969. }
  13970. //结束打印
  13971. m_Print.EndPage();
  13972. m_Print.EndPrint();
  13973. }
  13974. }
  13975. void CMainFrame::PrintTakeForm1(CArray<CStringArray, CStringArray>*Listarray)
  13976. {
  13977. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "拍照客人明细表";
  13978. int pages = Listarray->GetSize() / 46;
  13979. if (Listarray->GetSize() % 46)pages++;
  13980. for (int aa = 0; aa < pages; aa++)
  13981. {
  13982. PrintPreview dlg;
  13983. CPrintRX m_Print;
  13984. m_Print.InitToPrint(NULL, 1);
  13985. m_Print.StartPrint();
  13986. m_Print.StartPage();
  13987. CRect mainrc(0, 0, 560, 793);
  13988. float fscale;
  13989. {
  13990. int w, h;
  13991. m_Print.GetWidHei(w, h);
  13992. fscale = (float)w / (float)h;
  13993. }
  13994. mainrc.DeflateRect(25, 40, 10, 0);
  13995. CRect rc, rc2;
  13996. rc = mainrc;
  13997. rc.bottom = rc.top;
  13998. rc.top -= 20;
  13999. m_Print.SetFontFace(16, 1, "黑体");
  14000. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14001. m_Print.SetFontFace(8, 1, "宋体");
  14002. CString str;
  14003. int wid[7] = { 165, 60, 90, 60, 60, 60, 35 };
  14004. int hei = 16;
  14005. if (fscale > 0.71)hei = 15;
  14006. rc = mainrc;
  14007. rc.bottom = rc.top + hei;
  14008. for (int i = 0; i < 47; i++)
  14009. {
  14010. rc2.top = rc.top + i*hei;
  14011. rc2.bottom = rc.bottom + i*hei;
  14012. rc2.left = rc.left;
  14013. rc2.right = rc.left + wid[0];
  14014. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14015. for (int j = 0; j<7; j++)
  14016. {
  14017. m_Print.DrawRect2(rc2, 1);
  14018. if (Listarray->GetSize()>aa * 46 + i)
  14019. {
  14020. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14021. rc2.left += 3;
  14022. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14023. rc2.left -= 3;
  14024. }
  14025. rc2.left += wid[j];
  14026. rc2.right = rc2.left + wid[j + 1];
  14027. }
  14028. }
  14029. rc2.top += 2;
  14030. rc2.left += 2; rc2.right = mainrc.right + 4;
  14031. m_Print.SetFontFace(8, 1, "宋体");
  14032. str.Format(" 页:%d/%d", aa + 1, pages);
  14033. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14034. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14035. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14036. dlg.m_pDC = m_Print.GetPDC();
  14037. // dlg.m_mode=1;
  14038. if (aa == 0)
  14039. {
  14040. if (dlg.DoModal() != IDOK)
  14041. return;
  14042. }
  14043. //结束打印
  14044. m_Print.EndPage();
  14045. m_Print.EndPrint();
  14046. }
  14047. }
  14048. void CMainFrame::ShowMonthForm2()
  14049. {
  14050. }
  14051. // dlg;