MainFrm.cpp 461 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761
  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 (g_server.Find(".ly.com") != -1)
  352. {
  353. g_ntimeout = 30000;
  354. }
  355. if (::PathFileExists(g_mainpath + "\\logo.ico"))
  356. {
  357. Bitmap *bmp = NULL;
  358. LoadImageFromFile(&bmp, g_mainpath + "\\logo.ico");
  359. // m_hIcon = AfxGetApp()->LoadIcon(g_mainpath+"\\logo.ico");
  360. bmp->GetHICON(&m_hIcon);
  361. delete bmp;
  362. SetIcon(m_hIcon, TRUE); // Set big icon
  363. SetIcon(m_hIcon, FALSE); // Set small icon
  364. }
  365. if (!m_wndClient.SubclassWindow(m_hWndMDIClient))
  366. {
  367. // Jeff.创建失败的可能性小,加日志输出;
  368. return -1;
  369. }
  370. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  371. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  372. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  373. {
  374. // Jeff.创建失败的可能性小,加日志输出;
  375. TRACE0("Failed to create toolbar\n");
  376. return -1; // fail to create
  377. }
  378. m_wndToolBar.LoadTrueColorToolBar(90, IDB_NORMAL, 0, IDB_DISABLE);
  379. // second toolbar must have different ID
  380. if (!m_wndToolBar2.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT | CBRS_NOALIGN,
  381. AFX_IDW_CONTROLBAR_FIRST + 32) ||
  382. !m_wndToolBar2.LoadToolBar(IDR_TOOLBAR1))
  383. {
  384. // Jeff.创建失败的可能性小,加日志输出;
  385. TRACE0("Failed to create toolbar\n");
  386. return -1; // fail to create
  387. }
  388. #ifndef NEW_SKIN
  389. if (!m_wndStatusBar.Create(this) ||
  390. !m_wndStatusBar.SetIndicators(indicators,
  391. sizeof(indicators)/sizeof(UINT)))
  392. {
  393. // Jeff.创建失败的可能性小,加日志输出;
  394. TRACE0("Failed to create status bar\n");
  395. return -1; // fail to create
  396. }
  397. m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_NORMAL,200);
  398. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  399. #endif
  400. // TODO: Delete these three lines if you don't want the toolbar to
  401. // be dockable
  402. NewMenu2();
  403. ::GetWindowRect(this->m_hWndMDIClient, g_rc);
  404. /* CString ss;
  405. ss.Format ("%d,%d,%d,%d", g_rc.left , g_rc.top , g_rc.right , g_rc.bottom );
  406. AfxMessageBox(ss);*/
  407. g_pMainWnd = this;
  408. m_wndToolBar2.Init();
  409. g_rc.top += 38;
  410. g_rc.left += 160;
  411. /* m_WidthScale = (float)g_rc.Width ()/722;
  412. m_HeightScale = (float)g_rc.Height ()/533;*/
  413. g_user.bLongin = 0;
  414. SetTimer(1, 100, NULL);
  415. return 0;
  416. }
  417. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  418. {
  419. if (!CMDIFrameWnd::PreCreateWindow(cs))
  420. return FALSE;
  421. // TODO: Modify the Window class or styles here by modifying
  422. // the CREATESTRUCT cs
  423. cs.style &= ~WS_MAXIMIZEBOX;
  424. cs.style &= ~WS_THICKFRAME;
  425. cs.lpszName = g_title + "影楼管理系统";
  426. cs.style &= ~FWS_ADDTOTITLE;
  427. RECT rect;
  428. HWND hWnd = ::FindWindow("Shell_TrayWnd", 0);
  429. ::GetWindowRect(hWnd, &rect);
  430. cs.x = 0;
  431. cs.y = 0;
  432. cs.cx = GetSystemMetrics(SM_CXSCREEN);
  433. cs.cy = GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top) + 3;
  434. return TRUE;
  435. }
  436. /////////////////////////////////////////////////////////////////////////////
  437. // CMainFrame diagnostics
  438. #ifdef _DEBUG
  439. void CMainFrame::AssertValid() const
  440. {
  441. CMDIFrameWnd::AssertValid();
  442. }
  443. void CMainFrame::Dump(CDumpContext& dc) const
  444. {
  445. CMDIFrameWnd::Dump(dc);
  446. }
  447. #endif //_DEBUG
  448. /////////////////////////////////////////////////////////////////////////////
  449. // CMainFrame message handlers
  450. void CMainFrame::OnDestroy()
  451. {
  452. //WriteLog("退出系统");//Jeff.add
  453. OnDisconnect();
  454. Transport_UnInit();
  455. m_Mdi.DeleteAll();
  456. if (g_hmouse)UnhookWindowsHookEx(g_hmouse);
  457. CMDIFrameWnd::OnDestroy();
  458. }
  459. void CMainFrame::OnClose()
  460. {
  461. g_bShowBar = 0;
  462. if (m_Mdi.MainClose())
  463. CMDIFrameWnd::OnClose();
  464. }//连接
  465. void CMainFrame::NewMenu2()
  466. {
  467. CMenu *pMemu = GetMenu();
  468. #ifdef BASIC_VERSION
  469. CMenu* submenu = pMemu->GetSubMenu(1);
  470. //submenu->RemoveMenu (IDM_StaffAchievementShow, MF_BYCOMMAND );//Jeff del 2014.06.16
  471. submenu->RemoveMenu (IDM_salaryset, MF_BYCOMMAND );
  472. #endif
  473. #if 0 // 此机用选片菜单项,去掉不用;
  474. {
  475. CString version = _T("Version 1.0");
  476. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  477. if(checked)
  478. {
  479. CMenu* submenu = pMemu->GetSubMenu(1);
  480. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  481. }
  482. }
  483. #endif
  484. #ifndef BASIC_VERSION
  485. {
  486. CString version = _T("Version 1.0");
  487. BOOL checked = AfxGetApp()->GetProfileInt(version, "status2", 0);
  488. if (checked)
  489. {
  490. #if 0 // Jeff:去掉菜单,此机用于员工业绩查看的菜单选项;
  491. CMenu* submenu = pMemu->GetSubMenu(1);
  492. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  493. #endif
  494. g_bStaffAchievementShow = 1;
  495. SetTimer(3, 100, NULL);
  496. }
  497. }
  498. #endif
  499. if (g_bShowOK == 0)
  500. {
  501. CMenu* submenu = pMemu->GetSubMenu(2);
  502. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  503. }
  504. }
  505. HMENU CMainFrame::NewMenu()
  506. {
  507. //设置菜单为XP风格 IDM_SHOWHIS
  508. BCMenu::SetMenuDrawMode(1);
  509. //若取消下面这句注释,则可看到菜单的图标栏和文字栏背景颜色为白色,
  510. //文字颜色为蓝色,选中项的前景色为紫红色
  511. //m_menuXP.SetMenuXPItemColor(0x00FFFFFF,0x00FFFFFF,0x00FF0000,0x00FF00FF);
  512. // 设置菜单中图标大小为32×32
  513. // m_menuXP.SetIconSize(32,32);
  514. // 加载菜单资源
  515. m_menuXP.LoadMenu(IDR_MAINFRAME);
  516. // 加载菜单对应的工具栏资源
  517. // m_menuXP.LoadToolbar(IDR_MAINFRAME);
  518. /*由于菜单左边栏中默认的图标大小为16×16,而与之对应的Toolbar中图标大小为32×32,
  519. 因此菜单中图标不能正确显示,只显示出工具栏中图标的左上角部分,所以修改菜单中各
  520. 项对应的图标为24b色位图资源IDB_***,或者在LoadMenu之前调用SetIconSize,设置菜单
  521. 中图标大小为32×32*/
  522. // m_menuXP.SetIconSize(24,24);
  523. // m_menuXP.ModifyODMenu(NULL,IDM_YWBU,IDB_YW); //
  524. /* m_menuXP.ModifyODMenu(NULL,ID_FILE_OPEN,IDB_BITMAP5);
  525. m_menuXP.ModifyODMenu(NULL,ID_FILE_SAVE,IDB_BITMAP7);
  526. m_menuXP.ModifyODMenu(NULL,ID_FILE_PRINT,IDB_BITMAP6);
  527. m_menuXP.ModifyODMenu(NULL,ID_APP_ABOUT,IDB_BITMAP3);
  528. m_menuXP.ModifyODMenu(NULL,ID_APP_EXIT,IDB_BITMAP2);*/
  529. // m_menuXP.EnableMenuItem (0, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  530. // m_menuXP.EnableMenuItem (2, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  531. // m_menuXP.EnableMenuItem (3, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  532. // m_menuXP.EnableMenuItem (4, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  533. // m_menuXP.EnableMenuItem (5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  534. // m_menuXP.EnableMenuItem (8, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  535. #if 0 // Jeff此机用选片菜单项不用;
  536. {
  537. CString version = _T("Version 1.0");
  538. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  539. if(checked)
  540. {
  541. CMenu* submenu = m_menuXP.GetSubMenu(1);
  542. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  543. }
  544. }
  545. #endif
  546. {
  547. CString version = _T("Version 1.0");
  548. BOOL checked = AfxGetApp()->GetProfileInt(version, "status2", 0);
  549. if (checked)
  550. {
  551. #if 0 // Jeff:去掉此机用于员工业绩查看的菜单选项;
  552. CMenu* submenu = m_menuXP.GetSubMenu(1);
  553. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  554. #endif
  555. g_bStaffAchievementShow = 1;
  556. SetTimer(3, 100, NULL);
  557. }
  558. }
  559. if (g_bShowOK == 0)
  560. {
  561. CMenu* submenu = m_menuXP.GetSubMenu(2);
  562. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  563. }
  564. return(m_menuXP.Detach());
  565. }
  566. ///////////////////////////////////////////////////////
  567. //减少代码
  568. #define OPEN_MENU(x) m_Mdi.Append(pName, RUNTIME_CLASS(x), IDR_MAINFRAME, this, nID)
  569. //响应菜单命令
  570. void CMainFrame::OnCommandMenu(UINT nID) // 所有菜单命令都在这里处理;
  571. {
  572. if (nID >= 2000 && nID <= 2100)
  573. {
  574. OnBranchData(nID);
  575. return;
  576. }
  577. if (g_user.bLongin == 0)
  578. {
  579. if (g_bNoLoginLia)
  580. {
  581. Login dlg;
  582. dlg.SetLiaPath("5.lia");
  583. dlg.DoModal();
  584. }
  585. else
  586. {
  587. Login3 dlg;
  588. dlg.SetLiaPath("5.lia");
  589. dlg.DoModal();
  590. }
  591. return;
  592. if (g_user.bLongin == 0)return;
  593. }
  594. else
  595. {
  596. InsideMsg();
  597. }
  598. ResetTimer();
  599. if (nID >= 1000 && nID <= 1100)
  600. {
  601. OnHistory(nID);
  602. return;
  603. }
  604. LPSTR pName;
  605. //打开窗口
  606. switch (nID)
  607. {
  608. case IDM_PayOutSet:
  609. {
  610. if (IsHasRights(16) == 0)return;
  611. PayOutSet dlg;
  612. dlg.DoModal();
  613. return;
  614. }
  615. case IDM_SPLB:
  616. {
  617. if (IsHasRightsnew(29) == 0)return;
  618. SPLBDlg dlg;
  619. dlg.DoModal();
  620. return;
  621. }
  622. case IDM_JD:
  623. {
  624. if (IsHasRightsnew(49) == 0)return;
  625. SPLBDlg dlg;
  626. dlg.m_mode = 1;
  627. dlg.DoModal();
  628. return;
  629. }
  630. case IDM_AREA:
  631. {
  632. if (IsHasRightsnew(47) == 0)return;
  633. AreaDlg dlg;
  634. dlg.DoModal();
  635. return;
  636. }
  637. case IDM_Psw:
  638. {
  639. Psw dlg;
  640. dlg.DoModal();
  641. return;
  642. }
  643. case IDM_Set:
  644. {
  645. if (IsHasRightsnew(49) == 0)return;
  646. /* if(g_bBranchModify)
  647. {
  648. AfxMessageBox("系统设置不支持远程访问,请直接访问该分店!", MB_ICONINFORMATION);
  649. return;
  650. }*/
  651. Set dlg;
  652. dlg.DoModal();
  653. //if(dlg.DoModal() != IDOK)
  654. //{
  655. //AfxMessageBox("789");
  656. //Set::SetCancle();
  657. //}
  658. return;
  659. }
  660. case IDM_HIDEWINDOW:
  661. {
  662. HideWindow dlg;
  663. dlg.DoModal();
  664. return;
  665. }
  666. case IDM_Logout:// Jeff.注销;
  667. {
  668. WriteLog("退出系统");//Jeff.add;
  669. g_user.bLongin = 0;
  670. g_user.name.Empty();
  671. g_user.rights.Empty();
  672. g_user.account.Empty();
  673. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  674. g_pMainWnd2->RefreshOutlookBar();
  675. #ifndef NEW_SKIN
  676. m_wndStatusBar.SetPaneText(1, "未登录", TRUE);
  677. #endif
  678. m_Mdi.CloseAll();
  679. #ifdef ENTERPRISE_VERSION
  680. g_branchname.Empty();
  681. g_branchip.Empty();
  682. g_pMainWnd->OnDisconnect();
  683. g_bBranchModify = 0;
  684. #endif
  685. if (g_pMainWnd2)
  686. {
  687. g_pMainWnd2->DrawLogin();
  688. g_pMainWnd2->ShowBar(0);
  689. }
  690. g_hisyeararray.RemoveAll();
  691. g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
  692. g_brancharray.RemoveAll();
  693. g_pMainWnd->AddBranchMenu(&g_brancharray);
  694. if (g_bNoLoginLia)
  695. {
  696. Login dlg;
  697. dlg.SetLiaPath("5.lia");
  698. dlg.DoModal();
  699. }
  700. else
  701. {
  702. Login3 dlg;
  703. dlg.SetLiaPath("5.lia");
  704. dlg.DoModal();
  705. }
  706. if (g_user.bLongin == 0)
  707. if (g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  708. return;
  709. }
  710. case IDM_TODAY:
  711. pName = (LPSTR)(LPCSTR)"历史订单";
  712. // OPEN_MENU(SalarySet3);
  713. OPEN_MENU(DinDanHistroy);
  714. break;
  715. case IDM_TAKECONTROL:
  716. pName = (LPSTR)(LPCSTR)"摄控表";
  717. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))
  718. OPEN_MENU(TodayForm2);
  719. else
  720. OPEN_MENU(TodayForm);
  721. break;
  722. case IDM_CLIENTMONEY:
  723. pName = (LPSTR)(LPCSTR)"客人付款";
  724. OPEN_MENU(ClientMoney);
  725. break;
  726. case IDM_TAKEAWAYBOOK:
  727. pName = (LPSTR)(LPCSTR)"发片/取件";
  728. OPEN_MENU(outsourcing);
  729. break;
  730. case IDM_CODE:
  731. pName = (LPSTR)(LPCSTR)"商品报表";
  732. OPEN_MENU(SPForm);
  733. break;
  734. case IDM_Daily:
  735. // if(IsHasRightsnew(22)==0)return;
  736. // pName = (LPSTR)(LPCSTR)"日财务表";
  737. // OPEN_MENU(DailyForm);
  738. pName = (LPSTR)(LPCSTR)"沟通助手";
  739. OPEN_MENU(InsideMsg);
  740. break;
  741. case IDM_ProcessAlarm:
  742. pName = (LPSTR)(LPCSTR)"流程监控";
  743. OPEN_MENU(ProcessAlarm);
  744. break;
  745. case IDM_DINDAN:
  746. // if(IsHasRights(7)==0)return;
  747. pName = (LPSTR)(LPCSTR)"订单报表";
  748. OPEN_MENU(DinDanFrom);
  749. break;
  750. case IDM_CLIENT:
  751. //if(IsHasRights(8)==0)return;
  752. pName = (LPSTR)(LPCSTR)"客户报表";
  753. OPEN_MENU(CClientForm);
  754. break;
  755. case IDM_PayOutInput:
  756. if (IsHasRightsnew(20) == 0)return;
  757. pName = (LPSTR)(LPCSTR)"现金支出";
  758. OPEN_MENU(PayOutInput);
  759. break;
  760. case IDM_salaryset:
  761. if (IsHasRightsnew(25) == 0)return;
  762. pName = (LPSTR)(LPCSTR)"工资设置";
  763. OPEN_MENU(SalarySet);
  764. break;
  765. case IDM_mysalary:
  766. if (IsHasRights(16) == 0)return;
  767. pName = (LPSTR)(LPCSTR)"我的工资";
  768. OPEN_MENU(MySalary);
  769. break;
  770. case IDM_SP:
  771. // if(IsHasRightsnew(29)==0)return;
  772. pName = (LPSTR)(LPCSTR)"商品设置";
  773. OPEN_MENU(ShangPin);
  774. break;
  775. case IDM_WORKER:
  776. if (IsHasRightsnew(27) == 0)return;
  777. pName = (LPSTR)(LPCSTR)"员工设置";
  778. OPEN_MENU(Worker);
  779. break;
  780. case IDM_TAOXI:
  781. if (IsHasRightsnew(30) == 0)return;
  782. pName = (LPSTR)(LPCSTR)"套系设置";
  783. OPEN_MENU(TXDlg);
  784. break;
  785. case IDM_TAOXISP:
  786. if (IsHasRightsnew(30) == 0)return;
  787. pName = (LPSTR)(LPCSTR)"套系赠送商品设置";
  788. OPEN_MENU(TXSPDlg);
  789. break;
  790. case IDM_Provider:
  791. if (IsHasRightsnew(32) == 0)return;
  792. pName = (LPSTR)(LPCSTR)"供应商设置";
  793. OPEN_MENU(ProviderDlg);
  794. break;
  795. case IDM_BUMEN:
  796. {
  797. if (IsHasRightsnew(49) == 0)return;
  798. BuMenDlg dlg;
  799. dlg.DoModal();
  800. return;
  801. }
  802. case IDM_Account:
  803. if (IsHasRightsnew(49) == 0)return;
  804. pName = (LPSTR)(LPCSTR)"账号管理";
  805. OPEN_MENU(Account);
  806. break;
  807. case IDM_YLCD:
  808. {
  809. //AfxMessageBox("IDM_YLCD");
  810. ::CopyFile(_T(g_path7 + "\\接单系统\\Regsvr32.exe"), _T(g_mainpath + "\\Regsvr32.exe"), 0);
  811. ::CopyFile(_T(g_path7 + "\\接单系统\\Flash9f.ocx"), _T(g_mainpath + "\\Flash9f.ocx"), 0);
  812. CString temp;
  813. temp.Format("%s\\regsvr32.exe /s %s\\Flash9f.OCX", g_mainpath, g_mainpath);
  814. WinExec(temp, SW_HIDE);
  815. ::CopyFile(_T(g_path7 + "\\接单系统\\接单系统.exe"), _T(g_mainpath + "\\接单系统.exe"), 0);
  816. ::CopyFile(_T(g_path7 + "\\接单系统\\my32.dll"), _T(g_mainpath + "\\my32.dll"), 0);
  817. ::CopyFile(_T(g_path7 + "\\接单系统\\server.dat"), _T(g_mainpath + "\\server.dat"), 0);
  818. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\接单系统.exe"), g_server, NULL, SW_SHOWNORMAL);
  819. }
  820. break;
  821. case IDM_YLCDMANAGE:
  822. ::CopyFile(_T(g_path7 + "\\接单系统\\资源管理器.exe"), _T(g_mainpath + "\\资源管理器.exe"), 0);
  823. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\资源管理器.exe"), g_server, NULL, SW_SHOWNORMAL);
  824. break;
  825. }
  826. }
  827. //减少代码
  828. ///////////////////////////////////////////////////////////////////////////////
  829. void CMainFrame::OnDisconnect()
  830. {
  831. m_tClientTunnel.net_CloseSocket();
  832. SetConnectionID(INVALID_SOCKET);
  833. }
  834. void CMainFrame::ProcessLoginResponse(void *pLoginResult)
  835. {
  836. //printf("Jeff:ProcessLoginResponse\n\n");//Jeff Printf;
  837. if (NULL == pLoginResult) return;
  838. LOGIN_RESULT_STRU *ptLoginResult = (LOGIN_RESULT_STRU *)pLoginResult;
  839. DWORD dwConnectionID = ptLoginResult->tCommonMsg.dwConnectionID;
  840. SetConnectionID(dwConnectionID);
  841. BYTE byResult = ptLoginResult->byResult;
  842. if (LOGIN_RESULT_SUC == byResult)
  843. {
  844. //AfxMessageBox("登录成功"); // Jeff test;
  845. }
  846. else
  847. {
  848. OnDisconnect();
  849. }
  850. }
  851. //-------------------------------------------------------------------
  852. // Remark by Jeff: 2014.10.18
  853. // 函数:ProcessLoginRequest
  854. // 描述:登陆服务器;
  855. // 参数:
  856. // nSrvType:登陆服务器的协议类型;
  857. // 0000 0000: 表示登陆本地服务器;
  858. // 0000 0001: 表示登陆远程服务器(lijiafz.vicp.net等);
  859. //
  860. // 返回:登陆成功返回TRUE;
  861. //
  862. //-------------------------------------------------------------------
  863. BOOL CMainFrame::ProcessLoginRequest()
  864. {
  865. // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
  866. WORD wMessageId = 0;
  867. if (g_conntype == 0 && !g_bConnLYFZ)
  868. wMessageId = (MSG_LOGIN_REQ + 0X1FFF);
  869. else// if (g_bConnLYFZ )
  870. wMessageId = MSG_LOGIN_REQ;
  871. // 2.填充发送数据;
  872. TLOGIN_STRU tLogonInfo = { 0 };
  873. tLogonInfo.tCommonMsg.dwConnectionID = GetConnectionID();//此时m_dwConnectionID为INVALIDE_SOCKET;
  874. tLogonInfo.tCommonMsg.wMessageId = wMessageId;
  875. CString strUserName = newGUID();// 以随机数作为登陆时的用户名称;
  876. strUserName.TrimLeft();
  877. strUserName.TrimRight();
  878. strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
  879. DWORD dwDataLen = sizeof(TLOGIN_STRU);
  880. // 3.填充数据头;
  881. TMessageHeader tHeader = { 0 };
  882. tHeader.wMessageId = wMessageId;
  883. tHeader.dwDataLen = dwDataLen;
  884. // 4.发送数据;
  885. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)&tLogonInfo, dwDataLen);
  886. if (ulSendLen == SOCKET_ERROR)
  887. {
  888. return 0;
  889. }
  890. return 1;
  891. }
  892. DWORD CMainFrame::GetConnectionID()
  893. {
  894. return m_dwConnectionID;
  895. }
  896. void CMainFrame::SetConnectionID(DWORD dwConnection)
  897. {
  898. m_dwConnectionID = dwConnection;
  899. }
  900. //*********************************************//
  901. /*
  902. 函数:ProcessChatMessageRequest2
  903. 参数:BYTE code [IN]
  904. 返回:无
  905. 过程:OnConnect() -> ProcessChatMessageRequest()
  906. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  907. 2.SendDataDlg计时器里调用CConnectDlg对话框
  908. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  909. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  910. 5.关闭对话框和断开连接;
  911. */
  912. //*********************************************//
  913. void CMainFrame::ProcessChatMessageRequest2(BYTE code)
  914. {
  915. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  916. SendDataDlg dlg;
  917. dlg.m_bycode = code;
  918. dlg.DoModal();
  919. }
  920. //*********************************************//
  921. /*
  922. 函数:ProcessChatMessageRequest2
  923. 参数:CString sql [IN]
  924. 返回:无
  925. 过程:OnConnect() -> ProcessChatMessageRequest()
  926. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  927. 2.SendDataDlg计时器里调用CConnectDlg对话框
  928. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  929. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  930. 5.关闭对话框和断开连接;
  931. */
  932. //*********************************************//
  933. void CMainFrame::ProcessChatMessageRequest2(CString sql)
  934. {
  935. if ((sql.Find("insert") != -1 || sql.Find("update") != -1 || sql.Find("delete") != -1) && g_branchname != "" && g_bBranchModify == 0)
  936. {
  937. AfxMessageBox("当前为分店数据查看状态,不能更改分店数据!", MB_ICONSTOP);
  938. g_bSendOK = 0;
  939. return;
  940. }
  941. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  942. SendDataDlg dlg;
  943. dlg.m_strSQL = sql;
  944. dlg.DoModal();
  945. }
  946. //*********************************************//
  947. /*
  948. 函数:ProcessChatMessageRequest2
  949. 参数:BYTE *pData [IN], int length [IN]
  950. 返回:无
  951. 过程:OnConnect() -> ProcessChatMessageRequest()
  952. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  953. 2.SendDataDlg计时器里调用CConnectDlg对话框
  954. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  955. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  956. 5.关闭对话框和断开连接;
  957. */
  958. //*********************************************//
  959. void CMainFrame::ProcessChatMessageRequest2(BYTE *pData, int length)
  960. {
  961. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  962. SendDataDlg dlg;
  963. dlg.m_pData = pData;
  964. dlg.m_nlength = length;
  965. dlg.DoModal();
  966. }
  967. /************************************************************************/
  968. /*
  969. 函数:ProcessChatMessageRequest
  970. 描述:对服务发送数据;
  971. 参数:void *szDataBuf[IN], int nDataLen[IN]
  972. 返回:发送成功与否;
  973. */
  974. /************************************************************************/
  975. BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)
  976. {
  977. // 1.获取当前与服务器连接的id;
  978. DWORD dwFromUserID = GetConnectionID();
  979. // 2.设置通信类型为MSG_CHATMESSAGE_REQ;
  980. WORD wMessageId = 0;
  981. if (g_conntype == 0 && !g_bConnLYFZ)
  982. wMessageId = (MSG_CHATMESSAGE_REQ + 0X3FFF);
  983. else
  984. wMessageId = MSG_CHATMESSAGE_REQ;
  985. // 3.计算出欲发送的数据的长度 dwDataLen;
  986. DWORD dwDataLen = sizeof(TCHAT_MESSAGE_STRU) + nDataLen;
  987. BYTE *pSendData = new BYTE[dwDataLen];
  988. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU*)pSendData;
  989. memset(pChatMessage, 0x00, dwDataLen);
  990. // 3.1.g_nYearpos==-1,表示连接是当前主数据库,其他值表示历史数据库;
  991. if (g_nYearpos == -1)
  992. g_sendhead.length[99] = g_nYearpos;
  993. else
  994. g_sendhead.length[99] = g_nYearpos * 32142953 + 10966236;
  995. g_sendhead.length[98] = 987123768;
  996. memcpy(pSendData, &g_sendhead, sizeof(g_sendhead));
  997. #ifdef ENTERPRISE_VERSION
  998. if (g_bBranchModify == 0)
  999. strcpy(pChatMessage->szFromUserName, g_branchname);
  1000. #endif
  1001. // 4.填充发送的数据结构;
  1002. pChatMessage->tCommonMsg.dwConnectionID = GetConnectionID();
  1003. pChatMessage->tCommonMsg.wMessageId = wMessageId;
  1004. pChatMessage->dwFromUserID = dwFromUserID;
  1005. pChatMessage->dwToUserID = g_nSendCode;//▲▲g_nSendCode在服务端同为dwToUserID;
  1006. pChatMessage->wMessageLen = nDataLen;
  1007. memcpy(pChatMessage->byFileContent, szDataBuf, nDataLen);
  1008. // 5.填充数据头;
  1009. TMessageHeader tHeader = { 0 };
  1010. tHeader.wMessageId = wMessageId;
  1011. tHeader.dwDataLen = dwDataLen;
  1012. // 6.发送数据;
  1013. BOOL bRet = 0;
  1014. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)pChatMessage, dwDataLen);
  1015. if (ulSendLen != SOCKET_ERROR)
  1016. {
  1017. bRet = 1;
  1018. }
  1019. // 7.发送完毕,释放内存;
  1020. delete[] pSendData;
  1021. return bRet;
  1022. }
  1023. /************************************************************************/
  1024. /*
  1025. 函数:ProcessChatMessageResponse
  1026. 描述:接收服务返回的数据;
  1027. 参数:void *pResponse[IN]
  1028. 返回:无;
  1029. 调用关系:
  1030. 1.由 void CMainFrame::ProcessNetEvent(...)调用
  1031. */
  1032. /************************************************************************/
  1033. void CMainFrame::ProcessChatMessageResponse(void *pResponse)
  1034. {
  1035. //printf("Jeff:ProcessChatMessageResponse**************\n\n");//Jeff Printf;
  1036. // 1.数据空,直接返回;
  1037. if (NULL == pResponse)
  1038. return;
  1039. // 2.数据解析过程;
  1040. //printf("Jeff:ProcessChatMessageResponse**************\数据解析过程\n\n");//Jeff Printf;
  1041. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pResponse;
  1042. int nMessageLen = pChatMessage->wMessageLen;
  1043. int nMessageLen2 = pChatMessage->dwToUserID; // 在服务器中被处理了,一般使dwToUserID=wMessageLen;
  1044. // Jeff.dwFromUserID==8888表示的内容是更新客户端skin界面数据,只有两处dwToUserID==211和dwToUserID==21;
  1045. // Jeff.其余的大多数都是 dwFromUserID = wMessageLen = dwToUserID 三者相等;
  1046. if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID != 8888)
  1047. {
  1048. // 2.1.清除全局变量g_pData数据,用于保存接收的实际数据;
  1049. if (g_pData)
  1050. delete[]g_pData;
  1051. g_pData = NULL;
  1052. g_pData = new BYTE[nMessageLen];
  1053. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1054. memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
  1055. g_nLeng = nMessageLen;
  1056. if (nMessageLen <= sizeof(DWORD))
  1057. {
  1058. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1059. }
  1060. KillTimer(2);
  1061. if (g_hSendWnd)
  1062. {
  1063. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);//关闭发送对话框;
  1064. }
  1065. }
  1066. else if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID == 8888)
  1067. {
  1068. if (g_pData2)
  1069. delete[]g_pData2;
  1070. g_pData2 = NULL;
  1071. g_pData2 = new BYTE[nMessageLen2];
  1072. memcpy(g_pData2, pChatMessage->byFileContent, nMessageLen2);
  1073. g_nLeng2 = nMessageLen2;
  1074. KillTimer(2);
  1075. if (g_hSendWnd)
  1076. {
  1077. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1078. }
  1079. }
  1080. else // 登陆返回;
  1081. {
  1082. if (g_bConnLYFZ)
  1083. {
  1084. if (g_pData)
  1085. delete[]g_pData;
  1086. g_pData = NULL;
  1087. g_pData = new BYTE[nMessageLen];
  1088. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1089. memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
  1090. g_nLeng = nMessageLen;
  1091. if (nMessageLen <= sizeof(DWORD))
  1092. {
  1093. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1094. }
  1095. KillTimer(2);
  1096. if (g_hSendWnd)
  1097. {
  1098. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1099. }
  1100. return;
  1101. }
  1102. if (g_conntype) // Jeff.g_conntype == 1,表示连接公司服务器的返回,用于集团版解析*.ly.com的IP地址;
  1103. {
  1104. // KillTimer(2);
  1105. char *szChatMessage = new char[nMessageLen + 1];
  1106. memset(szChatMessage, 0x00, nMessageLen + 1);
  1107. memcpy(szChatMessage, pChatMessage->byFileContent, nMessageLen);
  1108. g_server = szChatMessage;
  1109. delete[]szChatMessage;
  1110. CStdioFile fp;
  1111. CString path = g_mainpath + "\\ip.txt";
  1112. ::DeleteFile(path);
  1113. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1114. fp.WriteString(g_server);
  1115. fp.Close();
  1116. g_conntype = 0;
  1117. // g_serverip=g_server;
  1118. return;
  1119. }
  1120. if (g_pData2 == NULL)
  1121. {
  1122. g_pData2 = new BYTE[nMessageLen2];
  1123. g_nLeng2 = 0;
  1124. }
  1125. memcpy(g_pData2 + g_nLeng2, pChatMessage->byFileContent, nMessageLen);
  1126. g_nLeng2 += nMessageLen;
  1127. if (g_nLeng2 == nMessageLen2)//已收完
  1128. {
  1129. KillTimer(2);
  1130. if (g_hSendWnd)
  1131. {
  1132. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1133. }
  1134. }
  1135. else
  1136. {
  1137. KillTimer(2);
  1138. SetTimer(2, g_ntimeout, NULL);
  1139. }
  1140. }
  1141. }
  1142. BOOL CMainFrame::OnConnectBranch()
  1143. {
  1144. if (g_branchip == "")
  1145. {
  1146. return 0;
  1147. }
  1148. g_conntype = 0;
  1149. CString strServerAddress = g_branchip;
  1150. char *szServerAddress = strServerAddress.GetBuffer(0);
  1151. strServerAddress.ReleaseBuffer();
  1152. /*for Client, IP and Port can be 0,
  1153. and for Server, IP is LocalIP, and Port is Listening Port*/
  1154. int nResult = m_tClientTunnel.net_OpenSocket(
  1155. Transport_Client,
  1156. 0,
  1157. HandleClientNetEvent,
  1158. this);
  1159. if (TRANSPORT_OK != nResult)
  1160. {
  1161. // AfxMessageBox("网络初始化失败!");
  1162. return 0;
  1163. }
  1164. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1165. WORD wPort = SERVER_PORT;
  1166. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1167. if (TRANSPORT_OK != nResult)
  1168. {
  1169. m_tClientTunnel.net_CloseSocket();
  1170. return OnConnectBranch2();
  1171. return 0;
  1172. }
  1173. return ProcessLoginRequest();
  1174. }
  1175. BOOL CMainFrame::OnConnectBranch2()
  1176. {
  1177. if (g_branchip2 == "")
  1178. {
  1179. return 0;
  1180. }
  1181. g_conntype = 0;
  1182. CString strServerAddress = g_branchip2;
  1183. char *szServerAddress = strServerAddress.GetBuffer(0);
  1184. strServerAddress.ReleaseBuffer();
  1185. /*for Client, IP and Port can be 0,
  1186. and for Server, IP is LocalIP, and Port is Listening Port*/
  1187. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1188. 0,
  1189. HandleClientNetEvent,
  1190. this);
  1191. if (TRANSPORT_OK != nResult)
  1192. {
  1193. // AfxMessageBox("网络初始化失败!");
  1194. return 0;
  1195. }
  1196. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1197. WORD wPort = SERVER_PORT;
  1198. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1199. if (TRANSPORT_OK != nResult)
  1200. {
  1201. m_tClientTunnel.net_CloseSocket();
  1202. return 0;
  1203. }
  1204. return ProcessLoginRequest();
  1205. }
  1206. BOOL CMainFrame::OnConnectIP()
  1207. {
  1208. CString strServerAddress = g_server;
  1209. char *szServerAddress = strServerAddress.GetBuffer(0);
  1210. strServerAddress.ReleaseBuffer();
  1211. /*for Client, IP and Port can be 0,
  1212. and for Server, IP is LocalIP, and Port is Listening Port*/
  1213. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1214. 0,
  1215. HandleClientNetEvent,
  1216. this);
  1217. if (TRANSPORT_OK != nResult)
  1218. {
  1219. // AfxMessageBox("网络初始化失败!");
  1220. return 0;
  1221. }
  1222. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1223. WORD wPort = SERVER_PORT;
  1224. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1225. if (TRANSPORT_OK != nResult)
  1226. {
  1227. m_tClientTunnel.net_CloseSocket();
  1228. return 0;
  1229. }
  1230. return ProcessLoginRequest();
  1231. }
  1232. //ip.txt
  1233. BOOL CMainFrame::OnConnectLYFZ()
  1234. {
  1235. CString strBranchIP = "lijiafz.vicp.net";
  1236. MyGetIPByName2(strBranchIP);
  1237. if (strBranchIP == "")
  1238. {
  1239. return 0;
  1240. }
  1241. g_conntype = 0; // Jeff.Delete at 2014.10.18
  1242. //g_conntype = 1;
  1243. CString strServerAddress = strBranchIP;
  1244. char *szServerAddress = strServerAddress.GetBuffer(0);
  1245. strServerAddress.ReleaseBuffer();
  1246. /*for Client, IP and Port can be 0,
  1247. and for Server, IP is LocalIP, and Port is Listening Port*/
  1248. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1249. 0,
  1250. HandleClientNetEvent,
  1251. this);
  1252. if (TRANSPORT_OK != nResult)
  1253. {
  1254. return 0;
  1255. }
  1256. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1257. WORD wPort = GetPort();
  1258. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1259. if (TRANSPORT_OK != nResult)
  1260. {
  1261. m_tClientTunnel.net_CloseSocket();
  1262. return 0;
  1263. }
  1264. return ProcessLoginRequest();
  1265. }
  1266. BOOL CMainFrame::OnConnect()
  1267. {
  1268. // 1.Jeff 断开(如果有在在未关的连接)之前的连接;
  1269. OnDisconnect();
  1270. // 2.根据需要连接指定的服务器;
  1271. if (g_bBranchModify)
  1272. {
  1273. // Jeff.g_bBranchModify在g_bGenBranchData=1时,在welcome::OnTimer里被设置为1;
  1274. return OnConnectBranch();// 连接集团版分店;
  1275. }
  1276. if (g_bConnLYFZ)
  1277. {
  1278. return OnConnectLYFZ();// 连接公司服务端程序;
  1279. }
  1280. g_conntype = 0;
  1281. CString strServerAddress = g_server;
  1282. // 3.如果dbconfig.dat里保存的是*.ly.com的信息,就要读取ip.txt里的IP地址;
  1283. if (g_serverbak.Find(".ly.com") != -1)
  1284. {
  1285. strServerAddress = g_serverbak;
  1286. CStdioFile fp;
  1287. CString path = g_mainpath + "\\ip.txt";
  1288. if (::PathFileExists(path))
  1289. {
  1290. fp.Open(path, CFile::modeRead);
  1291. fp.ReadString(g_server);
  1292. fp.Close();
  1293. if (OnConnectIP())
  1294. {
  1295. // g_serverip=g_server;
  1296. return 1;
  1297. }
  1298. g_server = strServerAddress;
  1299. OnDisconnect();//MessageBox("ip失败");
  1300. }
  1301. g_conntype = 1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1302. strServerAddress = "lijiafz.vicp.net";
  1303. MyGetIPByName2(strServerAddress);
  1304. if (strServerAddress.IsEmpty())
  1305. {
  1306. return 0;//OnConnect2();
  1307. }
  1308. }
  1309. else if (g_ntimeout == 29000)//非远程 30000
  1310. {
  1311. strServerAddress = g_serverarray.ElementAt(g_conpos);
  1312. }
  1313. // 4.如果没有IP.txt或dbconfig.dat里的不是ly.com信息,而是一般的计算机名称;
  1314. char *szServerAddress = strServerAddress.GetBuffer(0);
  1315. strServerAddress.ReleaseBuffer();
  1316. // AfxMessageBox("连接:"+strServerAddress);
  1317. /*for Client, IP and Port can be 0,
  1318. and for Server, IP is LocalIP, and Port is Listening Port*/
  1319. // 5.创建通信对象连接;
  1320. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1321. 0,
  1322. HandleClientNetEvent,
  1323. this);
  1324. if (TRANSPORT_OK != nResult)
  1325. {
  1326. return 0;
  1327. }
  1328. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1329. WORD wPort = SERVER_PORT;
  1330. if (g_conntype) wPort = GetPort();
  1331. // 6.连接公司服务器或影楼服务器;
  1332. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1333. if (TRANSPORT_OK != nResult)
  1334. {
  1335. m_tClientTunnel.net_CloseSocket();
  1336. if (g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1337. {
  1338. return 0;//OnConnect2();
  1339. }
  1340. if (g_serverarray.GetSize() > 1)
  1341. {
  1342. if (g_conpos < (g_serverarray.GetSize() - 1))
  1343. {
  1344. g_conpos++;
  1345. return OnConnect();
  1346. }
  1347. else
  1348. {
  1349. g_conpos = 0;
  1350. return 0;
  1351. }
  1352. }
  1353. return 0;
  1354. }
  1355. return ProcessLoginRequest();
  1356. }
  1357. BOOL CMainFrame::OnConnect2()
  1358. {
  1359. g_conntype = 2;
  1360. CString server = "http://www.lyfz.net/download/ip.txt";
  1361. char buf[MAX_PATH];
  1362. ::GetTempPath(sizeof(buf), buf);
  1363. CString m_strTempDir = buf;
  1364. DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1365. INTERNET_PORT m_dwPort;
  1366. DWORD dwType;
  1367. CInternetSession m_cis;
  1368. CHttpConnection *m_pHttp;
  1369. CString m_strServer;
  1370. CString m_strIniPath;
  1371. AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
  1372. if (dwType != AFX_INET_SERVICE_HTTP)
  1373. {
  1374. return 0;//OnConnect3();
  1375. }
  1376. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
  1377. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1378. try
  1379. {
  1380. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1381. }
  1382. catch (CInternetException* pEx)
  1383. {
  1384. return 0;//OnConnect3();
  1385. }
  1386. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1387. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1388. try
  1389. {
  1390. pFile->SendRequest();
  1391. }
  1392. catch (CInternetException* pEx)
  1393. {
  1394. pFile->Close();
  1395. return 0;//OnConnect3();
  1396. }
  1397. if (pFile)
  1398. {
  1399. CStdioFile csf;
  1400. csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
  1401. char buf[2048];
  1402. int n;
  1403. while ((n = pFile->Read(buf, 2048)) > 0)
  1404. csf.Write(buf, n);
  1405. csf.Close();
  1406. pFile->Close();
  1407. }
  1408. CString strServerAddress;
  1409. CStdioFile fp;
  1410. fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
  1411. fp.ReadString(strServerAddress);
  1412. fp.Close();
  1413. char *szServerAddress = strServerAddress.GetBuffer(0);
  1414. strServerAddress.ReleaseBuffer();
  1415. /*for Client, IP and Port can be 0,
  1416. and for Server, IP is LocalIP, and Port is Listening Port*/
  1417. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1418. 0,
  1419. HandleClientNetEvent,
  1420. this);
  1421. if (TRANSPORT_OK != nResult)
  1422. {
  1423. return 0;
  1424. }
  1425. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1426. WORD wPort = SERVER_PORT;
  1427. if (g_conntype)wPort = GetPort();
  1428. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1429. if (TRANSPORT_OK != nResult)
  1430. {
  1431. m_tClientTunnel.net_CloseSocket();
  1432. return 0;//OnConnect3();
  1433. }
  1434. return ProcessLoginRequest();
  1435. }
  1436. BOOL CMainFrame::OnConnect3()
  1437. {
  1438. g_conntype = 3;
  1439. CString server = "http://photo.bjlyfz.com/download/ip.txt";
  1440. char buf[MAX_PATH];
  1441. ::GetTempPath(sizeof(buf), buf);
  1442. CString m_strTempDir = buf;
  1443. DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1444. INTERNET_PORT m_dwPort;
  1445. DWORD dwType;
  1446. CInternetSession m_cis;
  1447. CHttpConnection *m_pHttp;
  1448. CString m_strServer;
  1449. CString m_strIniPath;
  1450. AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
  1451. if (dwType != AFX_INET_SERVICE_HTTP)
  1452. {
  1453. return FALSE;
  1454. }
  1455. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
  1456. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1457. try
  1458. {
  1459. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1460. }
  1461. catch (CInternetException* pEx)
  1462. {
  1463. return false;
  1464. }
  1465. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1466. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1467. try
  1468. {
  1469. pFile->SendRequest();
  1470. }
  1471. catch (CInternetException* pEx)
  1472. {
  1473. pFile->Close();
  1474. return false;
  1475. }
  1476. if (pFile)
  1477. {
  1478. CStdioFile csf;
  1479. csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
  1480. char buf[2048];
  1481. int n;
  1482. while ((n = pFile->Read(buf, 2048)) > 0)
  1483. csf.Write(buf, n);
  1484. csf.Close();
  1485. pFile->Close();
  1486. }
  1487. CString strServerAddress;
  1488. CStdioFile fp;
  1489. fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
  1490. fp.ReadString(strServerAddress);
  1491. fp.Close();
  1492. char *szServerAddress = strServerAddress.GetBuffer(0);
  1493. strServerAddress.ReleaseBuffer();
  1494. /*for Client, IP and Port can be 0,
  1495. and for Server, IP is LocalIP, and Port is Listening Port*/
  1496. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1497. 0,
  1498. HandleClientNetEvent,
  1499. this);
  1500. if (TRANSPORT_OK != nResult)
  1501. {
  1502. return 0;
  1503. }
  1504. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1505. WORD wPort = SERVER_PORT;
  1506. if (g_conntype)wPort = GetPort();
  1507. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1508. if (TRANSPORT_OK != nResult)
  1509. {
  1510. m_tClientTunnel.net_CloseSocket();
  1511. return 0;
  1512. }
  1513. return ProcessLoginRequest();
  1514. }
  1515. void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
  1516. {
  1517. //printf("Jeff:ProcessNetEvent\n\n");//Jeff Printf;
  1518. if (Transport_ReadEv == nEventType)
  1519. {
  1520. if (NULL == pRecvMsg) return;
  1521. TMessageHeader* pHeader = (TMessageHeader *)pRecvMsg;
  1522. char *pDataBuf = (char *)pRecvMsg + MESSAGE_HEADER_LEN;
  1523. WORD dwMessageID = pHeader->wMessageId;
  1524. switch (dwMessageID)
  1525. {
  1526. case MSG_LOGIN_RESP:
  1527. case (MSG_LOGIN_RESP + 0X2FFF) :
  1528. {
  1529. LOGIN_RESULT_STRU tLoginResult = { 0 };
  1530. memcpy(&tLoginResult, pDataBuf, sizeof(LOGIN_RESULT_STRU));
  1531. ProcessLoginResponse(&tLoginResult);
  1532. break;
  1533. }
  1534. case MSG_USERINFO_RESP:
  1535. {
  1536. break;
  1537. }
  1538. case MSG_LOGOUT_RESP:
  1539. {
  1540. break;
  1541. }
  1542. case MSG_CHATMESSAGE_RESP:
  1543. case (MSG_CHATMESSAGE_RESP + 0X4FFF) :
  1544. {
  1545. //AfxMessageBox("登陆成功");
  1546. //printf("Jeff:MSG_CHATMESSAGE_RESP\n\n");//Jeff Printf;
  1547. static int i = 0;
  1548. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pDataBuf;
  1549. ProcessChatMessageResponse((void *)pChatMessage);
  1550. break;
  1551. }
  1552. default:
  1553. {
  1554. break;
  1555. }
  1556. }
  1557. }
  1558. else if (Transport_CloseEv == nEventType)
  1559. {
  1560. OnDisconnect();
  1561. }
  1562. }
  1563. //extern BOOL g_bNeedCoon;
  1564. extern BOOL EncryptFile2(BYTE *buffer, DWORD leng, PCHAR szPassword);
  1565. void CMainFrame::OnTimer(UINT nIDEvent)
  1566. {
  1567. // TODO: Add your message handler code here and/or call default
  1568. if (1 == nIDEvent)
  1569. {
  1570. KillTimer(nIDEvent);
  1571. CString version = _T("Version 1.0");
  1572. BOOL checked = AfxGetApp()->GetProfileInt(version, "status", 0);//status:此机用选片菜单项
  1573. // checked==1:此机用选片菜单项
  1574. // g_bStaffAchievementShow==1:此机用于员工业绩查看
  1575. if (checked && g_bStaffAchievementShow == 0) // .此机用选片菜单项;
  1576. {
  1577. KillTimer(3);
  1578. #ifdef NEW_SKIN
  1579. Welcome weldlg;
  1580. weldlg.DoModal();
  1581. #endif
  1582. ChoosePhotoSkin dlg;
  1583. dlg.SetLiaPath("1.lia");
  1584. if (dlg.DoModal() != IDOK)
  1585. {
  1586. PostMessage(WM_QUIT);
  1587. return;
  1588. }
  1589. if (dlg.m_exitcode == 3)
  1590. {
  1591. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  1592. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  1593. }
  1594. else
  1595. {
  1596. ShowWindow(SW_SHOW);
  1597. #ifdef NEW_SKIN
  1598. if (m_pMainFrimDlg2 == NULL)
  1599. {
  1600. m_pMainFrimDlg2 = new MainFrimDlg2;
  1601. m_pMainFrimDlg2->SetLiaPath("10.lia");
  1602. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  1603. }
  1604. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1605. #endif
  1606. }
  1607. }
  1608. else if (g_bStaffAchievementShow == 0) // .非选片、非查看员工业绩;
  1609. {
  1610. #ifdef NEW_SKIN
  1611. g_bNoConnDlg = 1;
  1612. Welcome weldlg;
  1613. weldlg.DoModal();
  1614. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1615. ShowWindow(SW_SHOW);
  1616. g_bNoConnDlg = 0;
  1617. if (g_bNoLoginLia) // Jeff.OnCreate里判断skin文件有5.lia, g_bNoLoginLia = 0, 无 g_bNoLoginLia = 1;
  1618. {
  1619. Login dlg;
  1620. dlg.SetLiaPath("5.lia");
  1621. dlg.DoModal();
  1622. }
  1623. else
  1624. {
  1625. Login3 dlg;
  1626. dlg.SetLiaPath("5.lia"); // Login3的父类为MyDlg,在BOOL MyDlg::OnInitDialog()里调用了纯虚函数Init();
  1627. dlg.DoModal();
  1628. }
  1629. if (g_user.bLongin && g_pMainWnd2)
  1630. {
  1631. g_pMainWnd2->ShowBar(1);
  1632. InsideMsg();
  1633. }
  1634. #else
  1635. ShowWindow(SW_SHOW);
  1636. if (g_bNoLoginLia)
  1637. {
  1638. Login dlg;
  1639. dlg.SetLiaPath ("5.lia");
  1640. dlg.DoModal();
  1641. }
  1642. else
  1643. {
  1644. Login3 dlg;
  1645. dlg.SetLiaPath ("5.lia");
  1646. dlg.DoModal();
  1647. }
  1648. #endif
  1649. }
  1650. if (g_hmouse == NULL)//&& atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
  1651. {
  1652. g_hmouse = SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId());
  1653. }
  1654. }
  1655. else if (2 == nIDEvent) //29秒后,若连接和发送未完成,将关闭连接和发送框;
  1656. {
  1657. KillTimer(2);
  1658. if (g_hConnectWnd)
  1659. ::SendMessage(g_hConnectWnd, WM_CLOSE, 0, 0);
  1660. if (g_hSendWnd)
  1661. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1662. if (g_bStaffAchievementShow == 0 && g_bConnLYFZ == 0)
  1663. {
  1664. if (g_bGenBranchData == 0)
  1665. {
  1666. if (g_branchip != "")
  1667. AfxMessageBox("连接分店:" + g_branchname + "失败!", MB_ICONINFORMATION);
  1668. else
  1669. AfxMessageBox("连接服务器失败!", MB_ICONINFORMATION);
  1670. }
  1671. OnDisconnect();
  1672. }
  1673. g_bSendOK = 0;
  1674. g_bNeedCoon = 1;
  1675. }
  1676. else if (3 == nIDEvent)
  1677. {
  1678. KillTimer(3);
  1679. #ifdef NEW_SKIN
  1680. Welcome weldlg;
  1681. weldlg.DoModal();
  1682. #endif
  1683. ShowWindow(SW_SHOW);
  1684. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1685. g_sendhead.bsql = 0;
  1686. g_sendhead.code[0] = 24;
  1687. g_sendhead.code[1] = 1;
  1688. g_sendhead.tabcount = 2;
  1689. g_pMainWnd->ProcessChatMessageRequest2(1);
  1690. if (g_bSendOK == 0)
  1691. {
  1692. return;
  1693. }
  1694. CArray<CStringArray, CStringArray>patharray;
  1695. CArray<CStringArray, CStringArray>userarray;
  1696. DataToArray(&g_cominfoarray, &g_hisyeararray);
  1697. g_userarray.SetSize(userarray.GetSize(), 1);
  1698. int count = 0;
  1699. for (int ii = 0; ii < userarray.GetSize(); ii++)
  1700. {
  1701. if (userarray.ElementAt(ii).ElementAt(10) == "在职")
  1702. g_userarray.ElementAt(count++).Copy(userarray.ElementAt(ii));
  1703. }
  1704. g_userarray.SetSize(count, 1);
  1705. StaffAchievementShowAll dlg;
  1706. g_pMainWnd->GetOcx();
  1707. dlg.DoModal();
  1708. }
  1709. else if (5 == nIDEvent)
  1710. {
  1711. if (g_bInSkin)return;
  1712. if (g_nAutoShowStaffAchievement == 1)return;
  1713. if (g_bAllBranch)return;
  1714. if (g_user.bLongin)
  1715. {
  1716. // m_Mdi.CloseAll();
  1717. g_pMainWnd->OnCommandMenu(IDM_Logout);
  1718. }
  1719. /* g_nAutoShowStaffAchievement=1;
  1720. KillTimer(5);
  1721. StaffAchievementShowAll dlg;
  1722. g_pMainWnd->GetOcx();
  1723. dlg.DoModal ();*/
  1724. }
  1725. else if (6 == nIDEvent)
  1726. {
  1727. static BOOL bDouble = 0;
  1728. bDouble = !bDouble;
  1729. if (bDouble)
  1730. g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
  1731. else
  1732. g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
  1733. }
  1734. else if (7 == nIDEvent)
  1735. {
  1736. // Jeff,当g_bSendLYFZ==TRUE时;
  1737. // 向lijiafz.vicp.net发送影楼信息,防止有盗版用户;
  1738. KillTimer(7);
  1739. if (g_bInSkin)return;
  1740. if (g_nAutoShowStaffAchievement == 1)return;
  1741. if (g_bAllBranch)return;
  1742. CString str = g_sInfo;
  1743. g_bConnLYFZ = 1; // Jeff指示连接的服务器为lijiafz.vicp.net
  1744. // 断开当前连接;
  1745. OnDisconnect();
  1746. BYTE *pData = new BYTE[str.GetLength()];
  1747. memcpy(pData, str.GetBuffer(0), str.GetLength());
  1748. str.ReleaseBuffer();
  1749. EncryptFile2(pData, str.GetLength(), "888666333");
  1750. g_nSendCode = 16;
  1751. g_pMainWnd->ProcessChatMessageRequest2(pData, str.GetLength());
  1752. g_nSendCode = 0;
  1753. delete[]pData;
  1754. OnDisconnect();
  1755. g_bSendLYFZ = 0;
  1756. g_bConnLYFZ = 0;
  1757. if (g_bSendOK)
  1758. {
  1759. char *pStr = new char[g_nLeng + 1];
  1760. memset(pStr, 0, g_nLeng + 1);
  1761. memcpy(pStr, g_pData, g_nLeng);
  1762. CString str = pStr;
  1763. delete[]pStr;
  1764. if (str == "g_bInSkin")
  1765. {
  1766. g_sendhead.bsql = 1;
  1767. g_pMainWnd->ProcessChatMessageRequest2("update version set [setcheck1]='ok'");
  1768. }
  1769. }
  1770. }
  1771. /* else if( 4 == nIDEvent )
  1772. {
  1773. if(g_user.bLongin && g_bInSkin==0)
  1774. {
  1775. g_user.bLongin=0;
  1776. g_user.name.Empty ();
  1777. g_user.rights.Empty ();
  1778. #ifndef NEW_SKIN
  1779. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  1780. #endif
  1781. m_Mdi.CloseAll();
  1782. if(g_pMainWnd2)g_pMainWnd2->DrawLogin();
  1783. }
  1784. }*/
  1785. }
  1786. void CMainFrame::OnOutbarNotify(CString strMsg)
  1787. {
  1788. if (g_user.bLongin == 0)
  1789. {
  1790. if (g_bNoLoginLia)
  1791. {
  1792. Login dlg;
  1793. dlg.SetLiaPath("5.lia");
  1794. dlg.DoModal();
  1795. }
  1796. else
  1797. {
  1798. Login3 dlg;
  1799. dlg.SetLiaPath("5.lia");
  1800. dlg.DoModal();
  1801. }
  1802. return;
  1803. if (g_user.bLongin == 0)return;
  1804. }
  1805. else
  1806. {
  1807. InsideMsg();
  1808. }
  1809. ResetTimer();
  1810. if (strMsg == "开单")
  1811. {
  1812. if (IsHasRights(0) == 0)return;
  1813. /* UINT nID=0;
  1814. LPSTR pName ;
  1815. pName = (LPSTR)(LPCSTR)"开单";
  1816. OPEN_MENU(Booking);*/
  1817. Booking2 dlg;
  1818. dlg.DoModal();
  1819. return;
  1820. }
  1821. else if (strMsg == "拍照")
  1822. {
  1823. if (IsHasRights(1) == 0)return;
  1824. UINT nID = 1;
  1825. LPSTR pName;
  1826. pName = (LPSTR)(LPCSTR)"拍照";
  1827. OPEN_MENU(TakeFrom);
  1828. return;
  1829. }
  1830. else if (strMsg == "修片")
  1831. {
  1832. if (IsHasRights(1) == 0)return;
  1833. UINT nID = 1;
  1834. LPSTR pName;
  1835. pName = (LPSTR)(LPCSTR)"修片";
  1836. OPEN_MENU(BeautifySkinFrom);
  1837. return;
  1838. }
  1839. else if (strMsg == "选片")
  1840. {
  1841. if (IsHasRights(2) == 0)return;
  1842. UINT nID = 1;
  1843. LPSTR pName;
  1844. pName = (LPSTR)(LPCSTR)"选片";
  1845. OPEN_MENU(ChoosePhotoForm);
  1846. return;
  1847. }
  1848. else if (strMsg == "精修")
  1849. {
  1850. if (IsHasRights(2) == 0)return;
  1851. UINT nID = 1;
  1852. LPSTR pName;
  1853. pName = (LPSTR)(LPCSTR)"精修";
  1854. OPEN_MENU(BeautifySkinFrom2);
  1855. return;
  1856. }
  1857. else if (strMsg == "设计")
  1858. {
  1859. if (IsHasRights(2) == 0)return;
  1860. UINT nID = 1;
  1861. LPSTR pName;
  1862. pName = (LPSTR)(LPCSTR)"设计";
  1863. OPEN_MENU(DesignFrom);
  1864. return;
  1865. }
  1866. else if (strMsg == "数码安排")
  1867. {
  1868. UINT nID = 1;
  1869. LPSTR pName;
  1870. pName = (LPSTR)(LPCSTR)"数码安排";
  1871. OPEN_MENU(DigitalWork);
  1872. return;
  1873. }
  1874. else if (strMsg == "刻盘")
  1875. {
  1876. UINT nID = 1;
  1877. LPSTR pName;
  1878. pName = (LPSTR)(LPCSTR)"刻盘";
  1879. OPEN_MENU(BurnCD);
  1880. return;
  1881. }
  1882. else if (strMsg == "相片冲印")
  1883. {
  1884. UINT nID = 1;
  1885. LPSTR pName;
  1886. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  1887. OPEN_MENU(PhotoPrintFrom);
  1888. return;
  1889. }
  1890. else if (strMsg == "发片/取件")
  1891. {
  1892. if (IsHasRights(3) == 0)return;
  1893. UINT nID = 1;
  1894. LPSTR pName;
  1895. pName = (LPSTR)(LPCSTR)"发片/取件";
  1896. OPEN_MENU(outsourcing);
  1897. return;
  1898. }
  1899. else if (strMsg == "满意度")
  1900. {
  1901. UINT nID = 1;
  1902. LPSTR pName;
  1903. pName = (LPSTR)(LPCSTR)"满意度";
  1904. OPEN_MENU(Satisfaction);
  1905. return;
  1906. }
  1907. else if (strMsg == "满意度图表")
  1908. {
  1909. UINT nID = 1;
  1910. LPSTR pName;
  1911. pName = (LPSTR)(LPCSTR)"满意度图表";
  1912. OPEN_MENU(SatisfactionForm);
  1913. return;
  1914. }
  1915. #if JEFF_DELETE_ON // 2014.11.14-PM 16:20
  1916. else if (strMsg == "回复统计")
  1917. {
  1918. UINT nID = 1;
  1919. LPSTR pName;
  1920. pName = (LPSTR)(LPCSTR)"回复统计";
  1921. OPEN_MENU(MsgReg2);
  1922. return;
  1923. }
  1924. #endif
  1925. /* else if(strMsg=="取件")
  1926. {
  1927. if(IsHasRights(3)==0)return;
  1928. UINT nID=1;
  1929. LPSTR pName ;
  1930. pName = (LPSTR)(LPCSTR)"取件";
  1931. OPEN_MENU(TakeAwayFrom);
  1932. return;
  1933. }*/
  1934. else if (strMsg == "其它收入")
  1935. {
  1936. if (IsHasRightsnew(16) == 0)return;
  1937. // if(IsHasRightsnew(48)==0)return;
  1938. UINT nID = 1;
  1939. LPSTR pName;
  1940. pName = (LPSTR)(LPCSTR)"其它收入";
  1941. OPEN_MENU(IncomeInput);
  1942. return;
  1943. }
  1944. else if (strMsg == "其它二销")
  1945. {
  1946. if (IsHasRightsnew(16) == 0)return;
  1947. UINT nID = 1;
  1948. LPSTR pName;
  1949. pName = (LPSTR)(LPCSTR)"其它二销";
  1950. OPEN_MENU(IncomeInput2);
  1951. return;
  1952. }
  1953. else if (strMsg == "员工奖罚")
  1954. {
  1955. if (IsHasRightsnew(16) == 0)return;
  1956. UINT nID = 1;
  1957. LPSTR pName;
  1958. pName = (LPSTR)(LPCSTR)"员工奖罚";
  1959. OPEN_MENU(IncomeInput3);
  1960. return;
  1961. }
  1962. else if (strMsg == "员工奖惩")
  1963. {
  1964. if (IsHasRightsnew(16) == 0)return;
  1965. UINT nID = 1;
  1966. LPSTR pName;
  1967. pName = (LPSTR)(LPCSTR)"员工奖惩";
  1968. OPEN_MENU(IncomeInput4);
  1969. return;
  1970. }
  1971. else if (strMsg == "订单收款")
  1972. {
  1973. if (IsHasRights(17) == 0)return;
  1974. UINT nID = 1;
  1975. LPSTR pName;
  1976. pName = (LPSTR)(LPCSTR)"订单收款";
  1977. OPEN_MENU(FinanceForm);
  1978. return;
  1979. }
  1980. else if (strMsg == "日财务表")
  1981. {
  1982. if (IsHasRightsnew(22) == 0)return;
  1983. UINT nID = 2;
  1984. LPSTR pName;
  1985. pName = (LPSTR)(LPCSTR)"日财务表";
  1986. OPEN_MENU(DailyForm);
  1987. return;
  1988. }
  1989. else if (strMsg == "提成比例")
  1990. {
  1991. #ifndef ENTERPRISE_VERSION
  1992. #ifndef CHILD_VERSION
  1993. #ifdef BASIC_VERSION
  1994. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  1995. {
  1996. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  1997. exit(0);return;
  1998. }
  1999. #else
  2000. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2001. {
  2002. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2003. exit(0);return;
  2004. }
  2005. #endif
  2006. #else
  2007. #ifdef BASIC_VERSION
  2008. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2009. {
  2010. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2011. exit(0);return;
  2012. }
  2013. #else
  2014. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2015. {
  2016. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2017. exit(0); return;
  2018. }
  2019. #endif
  2020. #endif
  2021. #else
  2022. #ifndef CHILD_VERSION
  2023. #ifdef BASIC_VERSION
  2024. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2025. {
  2026. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2027. exit(0); return;
  2028. }
  2029. #else
  2030. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2031. {
  2032. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2033. exit(0); return;
  2034. }
  2035. #endif
  2036. #else
  2037. #ifdef BASIC_VERSION
  2038. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2039. {
  2040. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2041. exit(0);return;
  2042. }
  2043. #else
  2044. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2045. {
  2046. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2047. exit(0); return;
  2048. }
  2049. #endif
  2050. #endif
  2051. #endif
  2052. UINT nID = 2;
  2053. LPSTR pName;
  2054. pName = (LPSTR)(LPCSTR)"提成比例";
  2055. OPEN_MENU(SalarySet2);
  2056. return;
  2057. }
  2058. //else if(strMsg=="员工工作")
  2059. else if (strMsg == "计件提成")
  2060. {
  2061. UINT nID = 2;
  2062. LPSTR pName;
  2063. //pName = (LPSTR)(LPCSTR)"员工工作";
  2064. pName = (LPSTR)(LPCSTR)"计件提成";
  2065. OPEN_MENU(SalarySet3);
  2066. return;
  2067. }
  2068. else if (strMsg == "工资管理")
  2069. {
  2070. #ifndef ENTERPRISE_VERSION
  2071. #ifndef CHILD_VERSION
  2072. #ifdef BASIC_VERSION
  2073. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2074. {
  2075. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2076. exit(0);return;
  2077. }
  2078. #else
  2079. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2080. {
  2081. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2082. exit(0);return;
  2083. }
  2084. #endif
  2085. #else
  2086. #ifdef BASIC_VERSION
  2087. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2088. {
  2089. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2090. exit(0);return;
  2091. }
  2092. #else
  2093. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2094. {
  2095. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2096. exit(0); return;
  2097. }
  2098. #endif
  2099. #endif
  2100. #else
  2101. #ifndef CHILD_VERSION
  2102. #ifdef BASIC_VERSION
  2103. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2104. {
  2105. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2106. exit(0); return;
  2107. }
  2108. #else
  2109. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2110. {
  2111. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2112. exit(0); return;
  2113. }
  2114. #endif
  2115. #else
  2116. #ifdef BASIC_VERSION
  2117. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2118. {
  2119. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2120. exit(0);return;
  2121. }
  2122. #else
  2123. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2124. {
  2125. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2126. exit(0); return;
  2127. }
  2128. #endif
  2129. #endif
  2130. #endif
  2131. UINT nID = 2;
  2132. LPSTR pName;
  2133. pName = (LPSTR)(LPCSTR)"工资管理";
  2134. OPEN_MENU(MySalary);
  2135. return;
  2136. }
  2137. else if (strMsg == "客人付款")
  2138. {
  2139. UINT nID = 2;
  2140. LPSTR pName;
  2141. pName = (LPSTR)(LPCSTR)"客人付款";
  2142. OPEN_MENU(ClientMoney);
  2143. return;
  2144. }
  2145. else if (strMsg == "工资报表")
  2146. {
  2147. #ifndef ENTERPRISE_VERSION
  2148. #ifndef CHILD_VERSION
  2149. #ifdef BASIC_VERSION
  2150. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2151. {
  2152. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2153. exit(0);return;
  2154. }
  2155. #else
  2156. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2157. {
  2158. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2159. exit(0);return;
  2160. }
  2161. #endif
  2162. #else
  2163. #ifdef BASIC_VERSION
  2164. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2165. {
  2166. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2167. exit(0);return;
  2168. }
  2169. #else
  2170. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2171. {
  2172. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2173. exit(0); return;
  2174. }
  2175. #endif
  2176. #endif
  2177. #else
  2178. #ifndef CHILD_VERSION
  2179. #ifdef BASIC_VERSION
  2180. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2181. {
  2182. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2183. exit(0); return;
  2184. }
  2185. #else
  2186. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2187. {
  2188. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2189. exit(0); return;
  2190. }
  2191. #endif
  2192. #else
  2193. #ifdef BASIC_VERSION
  2194. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2195. {
  2196. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2197. exit(0);return;
  2198. }
  2199. #else
  2200. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2201. {
  2202. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2203. exit(0); return;
  2204. }
  2205. #endif
  2206. #endif
  2207. #endif
  2208. if (IsHasRightsnew(25) == 0)return;
  2209. UINT nID = 2;
  2210. LPSTR pName;
  2211. pName = (LPSTR)(LPCSTR)"工资报表";
  2212. g_ncount = 100;
  2213. OPEN_MENU(MySalary);
  2214. return;
  2215. }
  2216. else if (strMsg == "员工业绩")
  2217. {
  2218. #ifndef ENTERPRISE_VERSION
  2219. #ifndef CHILD_VERSION
  2220. #ifdef BASIC_VERSION
  2221. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2222. {
  2223. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2224. exit(0);return;
  2225. }
  2226. #else
  2227. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2228. {
  2229. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2230. exit(0);return;
  2231. }
  2232. #endif
  2233. #else
  2234. #ifdef BASIC_VERSION
  2235. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2236. {
  2237. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2238. exit(0);return;
  2239. }
  2240. #else
  2241. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2242. {
  2243. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2244. exit(0); return;
  2245. }
  2246. #endif
  2247. #endif
  2248. #else
  2249. #ifndef CHILD_VERSION
  2250. #ifdef BASIC_VERSION
  2251. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2252. {
  2253. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2254. exit(0); return;
  2255. }
  2256. #else
  2257. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2258. {
  2259. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2260. exit(0); return;
  2261. }
  2262. #endif
  2263. #else
  2264. #ifdef BASIC_VERSION
  2265. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2266. {
  2267. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2268. exit(0);return;
  2269. }
  2270. #else
  2271. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2272. {
  2273. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2274. exit(0); return;
  2275. }
  2276. #endif
  2277. #endif
  2278. #endif
  2279. if (IsHasRightsnew(33) == 0)return;
  2280. UINT nID = 2;
  2281. LPSTR pName;
  2282. pName = (LPSTR)(LPCSTR)"员工业绩";
  2283. OPEN_MENU(StaffAchievement);
  2284. return;
  2285. }
  2286. else if (strMsg == "订单客户")
  2287. {
  2288. UINT nID = 2;
  2289. LPSTR pName;
  2290. pName = (LPSTR)(LPCSTR)"订单客户";
  2291. g_dx += 10000;
  2292. OPEN_MENU(CClientForm);
  2293. if (g_dx >= 10000)g_dx -= 10000;
  2294. return;
  2295. }
  2296. else if (strMsg == "服务记录")
  2297. {
  2298. UINT nID = 2;
  2299. LPSTR pName;
  2300. pName = (LPSTR)(LPCSTR)"服务记录";
  2301. OPEN_MENU(CClientForm2);
  2302. return;
  2303. }
  2304. else if (strMsg == "服务统计")
  2305. {
  2306. UINT nID = 2;
  2307. LPSTR pName;
  2308. pName = (LPSTR)(LPCSTR)"服务统计";
  2309. OPEN_MENU(CClientForm3);
  2310. return;
  2311. }
  2312. else if (strMsg == "意向客户")
  2313. {
  2314. UINT nID = 2;
  2315. LPSTR pName;
  2316. pName = (LPSTR)(LPCSTR)"意向客户";
  2317. #ifdef LYFZ_VERSION
  2318. OPEN_MENU(Client2FormLYFZ);
  2319. #else
  2320. OPEN_MENU(Client2Form);
  2321. #endif
  2322. return;
  2323. }
  2324. else if (strMsg == "老客户")
  2325. {
  2326. UINT nID = 2;
  2327. LPSTR pName;
  2328. pName = (LPSTR)(LPCSTR)"老客户";
  2329. OPEN_MENU(OldClient);
  2330. return;
  2331. }
  2332. else if (strMsg == "客户来电")
  2333. {
  2334. UINT nID = 2;
  2335. LPSTR pName;
  2336. pName = (LPSTR)(LPCSTR)"客户来电";
  2337. OPEN_MENU(PhoneRecord);
  2338. return;
  2339. }
  2340. else if (strMsg == "拨出电话")
  2341. {
  2342. UINT nID = 2;
  2343. LPSTR pName;
  2344. pName = (LPSTR)(LPCSTR)"拨出电话";
  2345. OPEN_MENU(PhoneRecordOut);
  2346. return;
  2347. }
  2348. else if (strMsg == "未接来电")
  2349. {
  2350. UINT nID = 2;
  2351. LPSTR pName;
  2352. pName = (LPSTR)(LPCSTR)"未接来电";
  2353. OPEN_MENU(MissCall);
  2354. return;
  2355. }
  2356. else if (strMsg == "客户流失")
  2357. {
  2358. UINT nID = 2;
  2359. LPSTR pName;
  2360. pName = (LPSTR)(LPCSTR)"客户流失";
  2361. OPEN_MENU(ClientReasonChart);
  2362. return;
  2363. }
  2364. else if (strMsg == "客户来源")
  2365. {
  2366. UINT nID = 2;
  2367. LPSTR pName;
  2368. pName = (LPSTR)(LPCSTR)"客户来源";
  2369. OPEN_MENU(ClientFromChart);
  2370. return;
  2371. }
  2372. else if (strMsg == "月财务表")
  2373. {
  2374. if (IsHasRightsnew(23) == 0)return;
  2375. UINT nID = 2;
  2376. LPSTR pName;
  2377. pName = (LPSTR)(LPCSTR)"月财务表";
  2378. OPEN_MENU(MonthForm);
  2379. return;
  2380. }
  2381. else if (strMsg == "支出报表")
  2382. {
  2383. if (IsHasRightsnew(23) == 0)return;
  2384. UINT nID = 2;
  2385. LPSTR pName;
  2386. pName = (LPSTR)(LPCSTR)"支出报表";
  2387. OPEN_MENU(MonthForm2);
  2388. return;
  2389. }
  2390. else if (strMsg == "年财务表")
  2391. {
  2392. if (IsHasRightsnew(24) == 0)return;
  2393. UINT nID = 2;
  2394. LPSTR pName;
  2395. pName = (LPSTR)(LPCSTR)"年财务表";
  2396. OPEN_MENU(YearForm);
  2397. return;
  2398. }
  2399. else if (strMsg == "年财务图表")
  2400. {
  2401. if (IsHasRightsnew(24) == 0)return;
  2402. GetOcx();
  2403. UINT nID = 2;
  2404. LPSTR pName;
  2405. pName = (LPSTR)(LPCSTR)"年财务图表";
  2406. OPEN_MENU(YearForm2);
  2407. return;
  2408. }
  2409. else if (strMsg == "订单图表")
  2410. {
  2411. GetOcx();
  2412. UINT nID = 2;
  2413. LPSTR pName;
  2414. pName = (LPSTR)(LPCSTR)"订单图表";
  2415. OPEN_MENU(DinDanForm);
  2416. return;
  2417. }
  2418. #ifdef ENTERPRISE_VERSION
  2419. else if (strMsg == "订单报表")
  2420. {
  2421. GetOcx();
  2422. UINT nID = 2;
  2423. LPSTR pName;
  2424. pName = (LPSTR)(LPCSTR)"订单报表2";
  2425. OPEN_MENU(DinDanFromBranch);
  2426. return;
  2427. }
  2428. else if (strMsg == "财务图表")
  2429. {
  2430. GetOcx();
  2431. UINT nID = 2;
  2432. LPSTR pName;
  2433. pName = (LPSTR)(LPCSTR)"财务图表";
  2434. OPEN_MENU(YearFormBranch);
  2435. return;
  2436. }
  2437. else if (strMsg == "订单图表")
  2438. {
  2439. GetOcx();
  2440. UINT nID = 2;
  2441. LPSTR pName;
  2442. pName = (LPSTR)(LPCSTR)"订单图表";
  2443. OPEN_MENU(YearFormBranch2);
  2444. return;
  2445. }
  2446. else if (strMsg == "摄控安排")
  2447. {
  2448. UINT nID = 2;
  2449. LPSTR pName;
  2450. pName = (LPSTR)(LPCSTR)"摄控安排";
  2451. g_bookingtype = 0;
  2452. OPEN_MENU(TodayForm);
  2453. return;
  2454. }
  2455. else if (strMsg == "选片预约")
  2456. {
  2457. UINT nID = 2;
  2458. LPSTR pName;
  2459. pName = (LPSTR)(LPCSTR)"选片预约";
  2460. g_bookingtype = 1;
  2461. OPEN_MENU(TodayForm);
  2462. return;
  2463. }
  2464. else if (strMsg == "看样预约")
  2465. {
  2466. UINT nID = 2;
  2467. LPSTR pName;
  2468. pName = (LPSTR)(LPCSTR)"看样预约";
  2469. g_bookingtype = 2;
  2470. OPEN_MENU(TodayForm);
  2471. return;
  2472. }
  2473. else if (strMsg == "取件预约")
  2474. {
  2475. UINT nID = 2;
  2476. LPSTR pName;
  2477. pName = (LPSTR)(LPCSTR)"取件预约";
  2478. g_bookingtype = 3;
  2479. OPEN_MENU(TodayForm);
  2480. return;
  2481. }
  2482. else if (strMsg == "婚庆安排")
  2483. {
  2484. UINT nID = 2;
  2485. LPSTR pName;
  2486. pName = (LPSTR)(LPCSTR)"婚庆安排";
  2487. g_bookingtype = 4;
  2488. OPEN_MENU(TodayForm);
  2489. return;
  2490. }
  2491. #endif
  2492. else if (strMsg == "员工资料")
  2493. {
  2494. UINT nID = 2;
  2495. LPSTR pName;
  2496. pName = (LPSTR)(LPCSTR)"员工资料";
  2497. if (g_bAllBranch)
  2498. OPEN_MENU(EmployeeForm2);
  2499. else
  2500. OPEN_MENU(EmployeeForm);
  2501. return;
  2502. }
  2503. else if (strMsg == "客户区域")
  2504. {
  2505. // if(IsHasRightsnew(48)==0)return;
  2506. GetOcx();
  2507. UINT nID = 2;
  2508. LPSTR pName;
  2509. pName = (LPSTR)(LPCSTR)"客户区域";
  2510. OPEN_MENU(AreaClient);
  2511. return;
  2512. }
  2513. else if (strMsg == "客户报表")
  2514. {
  2515. UINT nID = 3;
  2516. LPSTR pName;
  2517. pName = (LPSTR)(LPCSTR)"客户报表";
  2518. OPEN_MENU(CClientForm);
  2519. return;
  2520. }
  2521. else if (strMsg == "每日签到")
  2522. {
  2523. UINT nID = 3;
  2524. LPSTR pName;
  2525. pName = (LPSTR)(LPCSTR)"每日签到";
  2526. OPEN_MENU(WorkerReport);
  2527. return;
  2528. }
  2529. else if (strMsg == "服务费")
  2530. {
  2531. UINT nID = 3;
  2532. LPSTR pName;
  2533. pName = (LPSTR)(LPCSTR)"服务费";
  2534. OPEN_MENU(annualfee);
  2535. return;
  2536. }
  2537. else if (strMsg == "现金支出")
  2538. {
  2539. if (IsHasRightsnew(16) == 0)return;
  2540. UINT nID = 3;
  2541. LPSTR pName;
  2542. pName = (LPSTR)(LPCSTR)"现金支出";
  2543. OPEN_MENU(PayOutInput);
  2544. return;
  2545. }
  2546. else if (strMsg == "短信群发")
  2547. {
  2548. UINT nID = 3;
  2549. LPSTR pName;
  2550. pName = (LPSTR)(LPCSTR)"短信群发";
  2551. OPEN_MENU(SendMsg);
  2552. return;
  2553. }
  2554. else if (strMsg == "短信发送")
  2555. {
  2556. UINT nID = 3;
  2557. LPSTR pName;
  2558. pName = (LPSTR)(LPCSTR)"客户报表";
  2559. OPEN_MENU(CClientForm);
  2560. return;
  2561. }
  2562. else if (strMsg == "流程短信")
  2563. {
  2564. UINT nID = 3;
  2565. LPSTR pName;
  2566. pName = (LPSTR)(LPCSTR)"流程短信";
  2567. OPEN_MENU(WorkMsg);
  2568. return;
  2569. }
  2570. else if (strMsg == "员工短信")
  2571. {
  2572. UINT nID = 3;
  2573. LPSTR pName;
  2574. pName = (LPSTR)(LPCSTR)"员工短信";
  2575. OPEN_MENU(EmployeeMsg);
  2576. return;
  2577. }
  2578. else if (strMsg == "发送记录")
  2579. {
  2580. UINT nID = 3;
  2581. LPSTR pName;
  2582. pName = (LPSTR)(LPCSTR)"发送记录";
  2583. OPEN_MENU(MsgReg);
  2584. return;
  2585. }
  2586. else if (strMsg == "短信设置")
  2587. {
  2588. if (IsHasRightsnew(49) == 0)return;
  2589. MsgSet dlg;
  2590. dlg.DoModal();
  2591. return;
  2592. }
  2593. else if (strMsg == "金卡会员")
  2594. {
  2595. #ifndef ENTERPRISE_VERSION
  2596. #ifndef CHILD_VERSION
  2597. #ifdef BASIC_VERSION
  2598. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2599. {
  2600. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2601. exit(0);return;
  2602. }
  2603. #else
  2604. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2605. {
  2606. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2607. exit(0);return;
  2608. }
  2609. #endif
  2610. #else
  2611. #ifdef BASIC_VERSION
  2612. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2613. {
  2614. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2615. exit(0);return;
  2616. }
  2617. #else
  2618. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2619. {
  2620. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2621. exit(0); return;
  2622. }
  2623. #endif
  2624. #endif
  2625. #else
  2626. #ifndef CHILD_VERSION
  2627. #ifdef BASIC_VERSION
  2628. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2629. {
  2630. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2631. exit(0); return;
  2632. }
  2633. #else
  2634. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2635. {
  2636. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2637. exit(0); return;
  2638. }
  2639. #endif
  2640. #else
  2641. #ifdef BASIC_VERSION
  2642. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2643. {
  2644. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2645. exit(0);return;
  2646. }
  2647. #else
  2648. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2649. {
  2650. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2651. exit(0); return;
  2652. }
  2653. #endif
  2654. #endif
  2655. #endif
  2656. UINT nID = 3;
  2657. LPSTR pName;
  2658. pName = (LPSTR)(LPCSTR)"金卡会员";
  2659. OPEN_MENU(ShowMember);
  2660. return;
  2661. }
  2662. else if (strMsg == "现金子卡")
  2663. {
  2664. UINT nID = 3;
  2665. LPSTR pName;
  2666. pName = (LPSTR)(LPCSTR)"现金子卡";
  2667. OPEN_MENU(ShowMember2);
  2668. return;
  2669. }
  2670. else if (strMsg == "蓝钻会员")
  2671. {
  2672. #ifndef ENTERPRISE_VERSION
  2673. #ifndef CHILD_VERSION
  2674. #ifdef BASIC_VERSION
  2675. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2676. {
  2677. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2678. exit(0);return;
  2679. }
  2680. #else
  2681. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2682. {
  2683. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2684. exit(0);return;
  2685. }
  2686. #endif
  2687. #else
  2688. #ifdef BASIC_VERSION
  2689. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2690. {
  2691. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2692. exit(0);return;
  2693. }
  2694. #else
  2695. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2696. {
  2697. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2698. exit(0); return;
  2699. }
  2700. #endif
  2701. #endif
  2702. #else
  2703. #ifndef CHILD_VERSION
  2704. #ifdef BASIC_VERSION
  2705. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2706. {
  2707. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2708. exit(0); return;
  2709. }
  2710. #else
  2711. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2712. {
  2713. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2714. exit(0); return;
  2715. }
  2716. #endif
  2717. #else
  2718. #ifdef BASIC_VERSION
  2719. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2720. {
  2721. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2722. exit(0);return;
  2723. }
  2724. #else
  2725. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2726. {
  2727. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2728. exit(0); return;
  2729. }
  2730. #endif
  2731. #endif
  2732. #endif
  2733. UINT nID = 3;
  2734. LPSTR pName;
  2735. pName = (LPSTR)(LPCSTR)"蓝钻会员";
  2736. OPEN_MENU(ShowMemberBlue);
  2737. return;
  2738. }
  2739. else if (strMsg == "转介绍积分")
  2740. {
  2741. #ifndef ENTERPRISE_VERSION
  2742. #ifndef CHILD_VERSION
  2743. #ifdef BASIC_VERSION
  2744. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2745. {
  2746. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2747. exit(0);return;
  2748. }
  2749. #else
  2750. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2751. {
  2752. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2753. exit(0);return;
  2754. }
  2755. #endif
  2756. #else
  2757. #ifdef BASIC_VERSION
  2758. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2759. {
  2760. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2761. exit(0);return;
  2762. }
  2763. #else
  2764. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2765. {
  2766. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2767. exit(0); return;
  2768. }
  2769. #endif
  2770. #endif
  2771. #else
  2772. #ifndef CHILD_VERSION
  2773. #ifdef BASIC_VERSION
  2774. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2775. {
  2776. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2777. exit(0); return;
  2778. }
  2779. #else
  2780. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2781. {
  2782. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2783. exit(0); return;
  2784. }
  2785. #endif
  2786. #else
  2787. #ifdef BASIC_VERSION
  2788. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2789. {
  2790. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2791. exit(0);return;
  2792. }
  2793. #else
  2794. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2795. {
  2796. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2797. exit(0); return;
  2798. }
  2799. #endif
  2800. #endif
  2801. #endif
  2802. UINT nID = 3;
  2803. LPSTR pName;
  2804. pName = (LPSTR)(LPCSTR)"转介绍积分";
  2805. OPEN_MENU(Card2Reg);
  2806. return;
  2807. }
  2808. /* else if(strMsg=="转介绍图表")
  2809. {
  2810. #ifndef ENTERPRISE_VERSION
  2811. #ifndef CHILD_VERSION
  2812. #ifdef BASIC_VERSION
  2813. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2814. {
  2815. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2816. exit(0);return;
  2817. }
  2818. #else
  2819. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2820. {
  2821. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2822. exit(0);return;
  2823. }
  2824. #endif
  2825. #else
  2826. #ifdef BASIC_VERSION
  2827. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2828. {
  2829. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2830. exit(0);return;
  2831. }
  2832. #else
  2833. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2834. {
  2835. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2836. exit(0);return;
  2837. }
  2838. #endif
  2839. #endif
  2840. #else
  2841. #ifndef CHILD_VERSION
  2842. #ifdef BASIC_VERSION
  2843. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2844. {
  2845. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2846. exit(0);return;
  2847. }
  2848. #else
  2849. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2850. {
  2851. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2852. exit(0);return;
  2853. }
  2854. #endif
  2855. #else
  2856. #ifdef BASIC_VERSION
  2857. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2858. {
  2859. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2860. exit(0);return;
  2861. }
  2862. #else
  2863. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2864. {
  2865. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2866. exit(0);return;
  2867. }
  2868. #endif
  2869. #endif
  2870. #endif
  2871. UINT nID=3;
  2872. LPSTR pName ;
  2873. pName = (LPSTR)(LPCSTR)"转介绍图表";
  2874. OPEN_MENU(Card2RegChart);
  2875. return;
  2876. }*/
  2877. else if (strMsg == "金卡图表")
  2878. {
  2879. UINT nID = 3;
  2880. LPSTR pName;
  2881. pName = (LPSTR)(LPCSTR)"金卡图表";
  2882. OPEN_MENU(MemberChart);
  2883. return;
  2884. }
  2885. else if (strMsg == "积分短信")
  2886. {
  2887. UINT nID = 3;
  2888. LPSTR pName;
  2889. pName = (LPSTR)(LPCSTR)"积分短信";
  2890. OPEN_MENU(ShowMemberMsg);
  2891. return;
  2892. }
  2893. else if (strMsg == "转介绍返现")
  2894. {
  2895. #ifndef ENTERPRISE_VERSION
  2896. #ifndef CHILD_VERSION
  2897. #ifdef BASIC_VERSION
  2898. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2899. {
  2900. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2901. exit(0);return;
  2902. }
  2903. #else
  2904. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2905. {
  2906. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2907. exit(0);return;
  2908. }
  2909. #endif
  2910. #else
  2911. #ifdef BASIC_VERSION
  2912. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2913. {
  2914. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2915. exit(0);return;
  2916. }
  2917. #else
  2918. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2919. {
  2920. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2921. exit(0); return;
  2922. }
  2923. #endif
  2924. #endif
  2925. #else
  2926. #ifndef CHILD_VERSION
  2927. #ifdef BASIC_VERSION
  2928. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2929. {
  2930. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2931. exit(0); return;
  2932. }
  2933. #else
  2934. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2935. {
  2936. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2937. exit(0); return;
  2938. }
  2939. #endif
  2940. #else
  2941. #ifdef BASIC_VERSION
  2942. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2943. {
  2944. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2945. exit(0);return;
  2946. }
  2947. #else
  2948. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2949. {
  2950. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2951. exit(0); return;
  2952. }
  2953. #endif
  2954. #endif
  2955. #endif
  2956. UINT nID = 3;
  2957. LPSTR pName;
  2958. pName = (LPSTR)(LPCSTR)"转介绍返现";
  2959. OPEN_MENU(Card2RegBlue);
  2960. return;
  2961. }
  2962. else if (strMsg == "转介绍图表")
  2963. {
  2964. #ifndef ENTERPRISE_VERSION
  2965. #ifndef CHILD_VERSION
  2966. #ifdef BASIC_VERSION
  2967. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2968. {
  2969. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2970. exit(0);return;
  2971. }
  2972. #else
  2973. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2974. {
  2975. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2976. exit(0);return;
  2977. }
  2978. #endif
  2979. #else
  2980. #ifdef BASIC_VERSION
  2981. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2982. {
  2983. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2984. exit(0);return;
  2985. }
  2986. #else
  2987. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2988. {
  2989. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2990. exit(0); return;
  2991. }
  2992. #endif
  2993. #endif
  2994. #else
  2995. #ifndef CHILD_VERSION
  2996. #ifdef BASIC_VERSION
  2997. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2998. {
  2999. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3000. exit(0); return;
  3001. }
  3002. #else
  3003. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3004. {
  3005. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3006. exit(0); return;
  3007. }
  3008. #endif
  3009. #else
  3010. #ifdef BASIC_VERSION
  3011. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3012. {
  3013. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3014. exit(0);return;
  3015. }
  3016. #else
  3017. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3018. {
  3019. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3020. exit(0); return;
  3021. }
  3022. #endif
  3023. #endif
  3024. #endif
  3025. UINT nID = 3;
  3026. LPSTR pName;
  3027. pName = (LPSTR)(LPCSTR)"转介绍图表";
  3028. OPEN_MENU(Card2RegChartBlue);
  3029. return;
  3030. }
  3031. else if (strMsg == "积分设置")
  3032. {
  3033. if (IsHasRightsnew(49) == 0)return;
  3034. MemberSet dlg;
  3035. dlg.DoModal();
  3036. return;
  3037. }
  3038. else if (strMsg == "礼服录入")
  3039. {
  3040. if (IsHasRightsnew(39) == 0)return;
  3041. UINT nID = 3;
  3042. LPSTR pName;
  3043. pName = (LPSTR)(LPCSTR)"礼服录入";
  3044. OPEN_MENU(DressManage);
  3045. return;
  3046. }
  3047. else if (strMsg == "礼服查看")
  3048. {
  3049. #ifndef ENTERPRISE_VERSION
  3050. #ifndef CHILD_VERSION
  3051. #ifdef BASIC_VERSION
  3052. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3053. {
  3054. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3055. exit(0);return;
  3056. }
  3057. #else
  3058. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3059. {
  3060. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3061. exit(0);return;
  3062. }
  3063. #endif
  3064. #else
  3065. #ifdef BASIC_VERSION
  3066. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3067. {
  3068. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3069. exit(0);return;
  3070. }
  3071. #else
  3072. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3073. {
  3074. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3075. exit(0); return;
  3076. }
  3077. #endif
  3078. #endif
  3079. #else
  3080. #ifndef CHILD_VERSION
  3081. #ifdef BASIC_VERSION
  3082. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3083. {
  3084. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3085. exit(0); return;
  3086. }
  3087. #else
  3088. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3089. {
  3090. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3091. exit(0); return;
  3092. }
  3093. #endif
  3094. #else
  3095. #ifdef BASIC_VERSION
  3096. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3097. {
  3098. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3099. exit(0);return;
  3100. }
  3101. #else
  3102. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3103. {
  3104. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3105. exit(0); return;
  3106. }
  3107. #endif
  3108. #endif
  3109. #endif
  3110. if (IsHasRightsnew(40) == 0)return;
  3111. UINT nID = 3;
  3112. LPSTR pName;
  3113. pName = (LPSTR)(LPCSTR)"礼服查看";
  3114. OPEN_MENU(ShowDress);
  3115. return;
  3116. }
  3117. else if (strMsg == "撞期预警")
  3118. {
  3119. UINT nID = 3;
  3120. LPSTR pName;
  3121. pName = (LPSTR)(LPCSTR)"撞期预警";
  3122. OPEN_MENU(DressEarlyWarning);
  3123. return;
  3124. }
  3125. else if (strMsg == "礼服出租")
  3126. {
  3127. UINT nID = 3;
  3128. LPSTR pName;
  3129. pName = (LPSTR)(LPCSTR)"礼服出租";
  3130. OPEN_MENU(ShowHireReg);
  3131. return;
  3132. }
  3133. else if (strMsg == "礼服图片")
  3134. {
  3135. ShowPic dlg;
  3136. dlg.m_mode = 4;
  3137. dlg.m_path = g_path5 + "\\";
  3138. dlg.DoModal();
  3139. return;
  3140. }
  3141. else if (strMsg == "商品类别设置")
  3142. {
  3143. if (IsHasRightsnew(29) == 0)return;
  3144. SPLBDlg dlg;
  3145. dlg.DoModal();
  3146. return;
  3147. }
  3148. else if (strMsg == "商品名称设置")
  3149. {
  3150. if (IsHasRightsnew(29) == 0)return;
  3151. UINT nID = 3;
  3152. LPSTR pName;
  3153. pName = (LPSTR)(LPCSTR)"商品设置";
  3154. OPEN_MENU(ShangPin);
  3155. return;
  3156. }
  3157. else if (strMsg == "固定资产管理")
  3158. {
  3159. UINT nID = 3;
  3160. LPSTR pName;
  3161. pName = (LPSTR)(LPCSTR)"固定资产管理";
  3162. OPEN_MENU(FixedAssets);
  3163. return;
  3164. }
  3165. else if (strMsg == "入库单")
  3166. {
  3167. if (IsHasRightsnew(44) == 0)return;
  3168. InputGoods dlg;
  3169. dlg.DoModal();
  3170. return;
  3171. }
  3172. else if (strMsg == "出库单")
  3173. {
  3174. #ifndef ENTERPRISE_VERSION
  3175. #ifndef CHILD_VERSION
  3176. #ifdef BASIC_VERSION
  3177. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3178. {
  3179. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3180. exit(0);return;
  3181. }
  3182. #else
  3183. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3184. {
  3185. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3186. exit(0);return;
  3187. }
  3188. #endif
  3189. #else
  3190. #ifdef BASIC_VERSION
  3191. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3192. {
  3193. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3194. exit(0);return;
  3195. }
  3196. #else
  3197. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3198. {
  3199. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3200. exit(0); return;
  3201. }
  3202. #endif
  3203. #endif
  3204. #else
  3205. #ifndef CHILD_VERSION
  3206. #ifdef BASIC_VERSION
  3207. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3208. {
  3209. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3210. exit(0); return;
  3211. }
  3212. #else
  3213. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3214. {
  3215. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3216. exit(0); return;
  3217. }
  3218. #endif
  3219. #else
  3220. #ifdef BASIC_VERSION
  3221. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3222. {
  3223. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3224. exit(0);return;
  3225. }
  3226. #else
  3227. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3228. {
  3229. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3230. exit(0); return;
  3231. }
  3232. #endif
  3233. #endif
  3234. #endif
  3235. if (IsHasRightsnew(45) == 0)return;
  3236. InputGoods dlg;
  3237. dlg.m_mode = 1;
  3238. dlg.DoModal();
  3239. return;
  3240. }
  3241. else if (strMsg == "库存查询")
  3242. {
  3243. #ifndef ENTERPRISE_VERSION
  3244. #ifndef CHILD_VERSION
  3245. #ifdef BASIC_VERSION
  3246. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3247. {
  3248. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3249. exit(0);return;
  3250. }
  3251. #else
  3252. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3253. {
  3254. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3255. exit(0);return;
  3256. }
  3257. #endif
  3258. #else
  3259. #ifdef BASIC_VERSION
  3260. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3261. {
  3262. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3263. exit(0);return;
  3264. }
  3265. #else
  3266. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3267. {
  3268. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3269. exit(0); return;
  3270. }
  3271. #endif
  3272. #endif
  3273. #else
  3274. #ifndef CHILD_VERSION
  3275. #ifdef BASIC_VERSION
  3276. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3277. {
  3278. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3279. exit(0); return;
  3280. }
  3281. #else
  3282. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3283. {
  3284. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3285. exit(0); return;
  3286. }
  3287. #endif
  3288. #else
  3289. #ifdef BASIC_VERSION
  3290. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3291. {
  3292. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3293. exit(0);return;
  3294. }
  3295. #else
  3296. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3297. {
  3298. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3299. exit(0); return;
  3300. }
  3301. #endif
  3302. #endif
  3303. #endif
  3304. UINT nID = 3;
  3305. LPSTR pName;
  3306. pName = (LPSTR)(LPCSTR)"库存查询";
  3307. OPEN_MENU(ShowGoods);
  3308. return;
  3309. }
  3310. else if (strMsg == "商品图表")
  3311. {
  3312. UINT nID = 3;
  3313. LPSTR pName;
  3314. pName = (LPSTR)(LPCSTR)"商品图表";
  3315. OPEN_MENU(StoreInfoChart);
  3316. return;
  3317. }
  3318. else if (strMsg == "成本核算")
  3319. {
  3320. UINT nID = 3;
  3321. LPSTR pName;
  3322. pName = (LPSTR)(LPCSTR)"成本核算";
  3323. OPEN_MENU(CostCal);
  3324. return;
  3325. }
  3326. else if (strMsg == "考勤记录")
  3327. {
  3328. UINT nID = 3;
  3329. LPSTR pName;
  3330. pName = (LPSTR)(LPCSTR)"考勤记录";
  3331. OPEN_MENU(LoginReg);
  3332. return;
  3333. }
  3334. else if (strMsg == "月统计")
  3335. {
  3336. UINT nID = 3;
  3337. LPSTR pName;
  3338. pName = (LPSTR)(LPCSTR)"月统计";
  3339. OPEN_MENU(LoginReg2);
  3340. return;
  3341. }
  3342. else if (strMsg == "时间设置")
  3343. {
  3344. if (IsHasRightsnew(21) == 0)return;
  3345. SetLoginTime dlg;
  3346. dlg.DoModal();
  3347. return;
  3348. }
  3349. else if (strMsg == "排班设置")
  3350. {
  3351. if (IsHasRightsnew(21) == 0)return;
  3352. SetLoginBan dlg;
  3353. dlg.DoModal();
  3354. return;
  3355. }
  3356. else if (strMsg == "意向查询")
  3357. {
  3358. UINT nID = 3;
  3359. LPSTR pName;
  3360. pName = (LPSTR)(LPCSTR)"意向查询";
  3361. OPEN_MENU(HospitalClient);
  3362. return;
  3363. }
  3364. else if (strMsg == "今日提醒")
  3365. {
  3366. UINT nID = 3;
  3367. LPSTR pName;
  3368. pName = (LPSTR)(LPCSTR)"今日提醒";
  3369. OPEN_MENU(HospitalClientAlarm);
  3370. return;
  3371. }
  3372. else if (strMsg == "跟踪短信")
  3373. {
  3374. UINT nID = 3;
  3375. LPSTR pName;
  3376. pName = (LPSTR)(LPCSTR)"跟踪短信";
  3377. OPEN_MENU(HospitalClientMsg);
  3378. return;
  3379. }
  3380. else if (strMsg == "意向单录入")
  3381. {
  3382. AddHospitalClient dlg;
  3383. dlg.DoModal();
  3384. return;
  3385. }
  3386. else if (strMsg == "资料设置")
  3387. {
  3388. HospitalInfoSet dlg;
  3389. dlg.DoModal();
  3390. return;
  3391. }
  3392. AfxMessageBox(strMsg + ",开发中...");
  3393. }
  3394. // Jeff.当版本号不一致时,调用AutoUpdate.exe来升级YLGL.exe
  3395. void CMainFrame::AutoUpdate()
  3396. {
  3397. if (g_bBranchModify)
  3398. {
  3399. AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
  3400. return;
  3401. }
  3402. else if (g_branchname != "")
  3403. {
  3404. AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
  3405. return;
  3406. }
  3407. g_ntimeout = 30000;
  3408. if (!::PathFileExists(g_mainpath + "\\AutoUpdate.exe"))
  3409. {
  3410. g_sendhead.bsql = 0;
  3411. g_sendhead.code[0] = 99;
  3412. g_sendhead.tabcount = 1;
  3413. g_pMainWnd->ProcessChatMessageRequest2(99);
  3414. if (g_bSendOK == 0)
  3415. goto failed;
  3416. CFile fp;
  3417. fp.Open(g_mainpath + "\\AutoUpdate.exe", CFile::modeWrite | CFile::modeCreate);
  3418. fp.Write(g_pData, g_nLeng);
  3419. fp.Close();
  3420. }
  3421. {
  3422. ::DeleteFile(g_mainpath + "\\YLGL2.exe");
  3423. g_sendhead.bsql = 0;
  3424. g_sendhead.code[0] = 98;
  3425. g_sendhead.tabcount = 1;
  3426. g_pMainWnd->ProcessChatMessageRequest2(99); if (g_bSendOK == 0)goto failed;
  3427. CFile fp;
  3428. fp.Open(g_mainpath + "\\YLGL2.exe", CFile::modeWrite | CFile::modeCreate);
  3429. fp.Write(g_pData, g_nLeng);
  3430. fp.Close();
  3431. }
  3432. AfxMessageBox("自动升级成功!", MB_ICONINFORMATION);
  3433. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\AutoUpdate.exe"), "12345", NULL, SW_SHOWNORMAL);
  3434. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3435. exit(0);
  3436. return;
  3437. failed:
  3438. AfxMessageBox("自动升级失败!", MB_ICONINFORMATION);
  3439. if (g_ntimeout == 30000)//非远程
  3440. {
  3441. AfxMessageBox("提醒:升级过程中需要传输较多的数据,如果网速慢可能导致远程升级失败!\r\n\
  3442. 可拷贝店内客户端用QQ传过来覆盖除dbconfig.dat的文件即可。", MB_ICONINFORMATION);
  3443. }
  3444. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3445. }
  3446. void CMainFrame::Onchoosephotoskin() //Jeff:此机用于选片菜单项;不在使用2014.06.16
  3447. {
  3448. if (g_user.bLongin == 0)
  3449. {
  3450. if (g_bNoLoginLia)
  3451. {
  3452. Login dlg;
  3453. dlg.SetLiaPath("5.lia");
  3454. dlg.DoModal();
  3455. }
  3456. else
  3457. {
  3458. Login3 dlg;
  3459. dlg.SetLiaPath("5.lia");
  3460. dlg.DoModal();
  3461. }
  3462. if (g_user.bLongin == 0)return;
  3463. }
  3464. // TODO: Add your command handler code here
  3465. CString version = _T("Version 1.0");
  3466. CMenu *pMenu = GetMenu();
  3467. CMenu* submenu = pMenu->GetSubMenu(1);
  3468. UINT status = submenu->GetMenuState(IDM_choosephotoskin, MF_BYCOMMAND);
  3469. if (status&MF_CHECKED)
  3470. {
  3471. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_UNCHECKED);
  3472. AfxGetApp()->WriteProfileInt(version, "status", 0);
  3473. }
  3474. else
  3475. {
  3476. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  3477. AfxGetApp()->WriteProfileInt(version, "status", 1);
  3478. }
  3479. }
  3480. /*BOOL g_bInSkin = 0;*/
  3481. BOOL CMainFrame::IsCtrlDown()
  3482. {
  3483. short state = GetKeyState(VK_LCONTROL);
  3484. BYTE sta = (BYTE)(state >> 8);
  3485. state = GetKeyState(VK_RCONTROL);
  3486. BYTE sta2 = (BYTE)(state >> 8);
  3487. if (sta || sta2)
  3488. return 1;
  3489. else
  3490. return 0;
  3491. }//IsShiftDown
  3492. BOOL CMainFrame::IsShiftDown()
  3493. {
  3494. short state = GetKeyState(VK_LSHIFT);
  3495. BYTE sta = (BYTE)(state >> 8);
  3496. state = GetKeyState(VK_RSHIFT);
  3497. BYTE sta2 = (BYTE)(state >> 8);
  3498. if (sta || sta2)
  3499. return 1;
  3500. else
  3501. return 0;
  3502. }
  3503. BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
  3504. {
  3505. // TODO: Add your specialized code here and/or call the base class IDM_Logout
  3506. if (pMsg->message == WM_KEYDOWN)
  3507. {
  3508. switch (pMsg->wParam)
  3509. {
  3510. case VK_F12:
  3511. g_pMainWnd->OnCommandMenu(IDM_Logout);
  3512. return 1;
  3513. case VK_F1:
  3514. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  3515. return 1;
  3516. case VK_F2: // 此机用于选片和选设计;
  3517. {
  3518. if (g_pMainWnd->m_bCheckF2F3 && (IsShiftDown() == 0 || IsCtrlDown() == 0))return 1;
  3519. m_Mdi.MainClose();
  3520. if (g_user.bLongin)
  3521. {
  3522. SearchClient dlg;
  3523. dlg.SetLiaPath("2.lia");
  3524. if (dlg.DoModal() != IDOK)
  3525. {
  3526. if (dlg.m_bLogout)
  3527. {
  3528. g_user.bLongin = 0;
  3529. g_user.name.Empty();
  3530. g_user.rights.Empty();
  3531. g_user.account.Empty();
  3532. goto ll;
  3533. }
  3534. PostMessage(WM_QUIT);
  3535. return 1;
  3536. }
  3537. if (dlg.m_exitcode == 3)
  3538. {
  3539. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3540. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3541. }
  3542. else
  3543. {
  3544. ShowWindow(SW_SHOW);
  3545. #ifdef NEW_SKIN
  3546. if (m_pMainFrimDlg2 == NULL)
  3547. {
  3548. m_pMainFrimDlg2 = new MainFrimDlg2;
  3549. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3550. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3551. }
  3552. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3553. g_bInSkin = 0;
  3554. #endif
  3555. }
  3556. }
  3557. else
  3558. {
  3559. ll:
  3560. ChoosePhotoSkin dlg;
  3561. dlg.SetLiaPath("1.lia");
  3562. if (dlg.DoModal() != IDOK)
  3563. {
  3564. PostMessage(WM_QUIT);
  3565. return 1;
  3566. }
  3567. if (dlg.m_exitcode == 3)
  3568. {
  3569. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3570. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3571. }
  3572. else
  3573. {
  3574. ShowWindow(SW_SHOW);
  3575. #ifdef NEW_SKIN
  3576. if (m_pMainFrimDlg2 == NULL)
  3577. {
  3578. m_pMainFrimDlg2 = new MainFrimDlg2;
  3579. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3580. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3581. }
  3582. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin = 0;
  3583. #endif
  3584. }
  3585. }
  3586. }
  3587. return 1;
  3588. case VK_F3: // 此机用于选片和选设计;
  3589. {
  3590. if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
  3591. m_Mdi.MainClose();
  3592. if (g_user.bLongin)
  3593. {
  3594. SearchClient dlg;
  3595. dlg.m_mode = 1;
  3596. dlg.SetLiaPath("2.lia");
  3597. if (dlg.DoModal() != IDOK)
  3598. {
  3599. if (dlg.m_bLogout)
  3600. {
  3601. g_user.bLongin = 0;
  3602. g_user.name.Empty();
  3603. g_user.rights.Empty();
  3604. g_user.account.Empty();
  3605. goto mm;
  3606. }
  3607. PostMessage(WM_QUIT);
  3608. return 1;
  3609. }
  3610. if (dlg.m_exitcode == 2)
  3611. {
  3612. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3613. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3614. }
  3615. else
  3616. {
  3617. ShowWindow(SW_SHOW);
  3618. #ifdef NEW_SKIN
  3619. if (m_pMainFrimDlg2 == NULL)
  3620. {
  3621. m_pMainFrimDlg2 = new MainFrimDlg2;
  3622. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3623. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3624. }
  3625. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin = 0;
  3626. #endif
  3627. }
  3628. }
  3629. else
  3630. {
  3631. mm:
  3632. ChoosePhotoSkin dlg;
  3633. dlg.m_mode = 1;
  3634. dlg.SetLiaPath("1.lia");
  3635. if (dlg.DoModal() != IDOK)
  3636. {
  3637. PostMessage(WM_QUIT);
  3638. return 1;
  3639. }
  3640. if (dlg.m_exitcode == 2)
  3641. {
  3642. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3643. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3644. }
  3645. else
  3646. {
  3647. ShowWindow(SW_SHOW);
  3648. #ifdef NEW_SKIN
  3649. if (m_pMainFrimDlg2 == NULL)
  3650. {
  3651. m_pMainFrimDlg2 = new MainFrimDlg2;
  3652. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3653. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3654. }
  3655. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin = 0;
  3656. #endif
  3657. }
  3658. }
  3659. }
  3660. return 1;
  3661. case VK_F11:
  3662. if (g_bInSkin)return 1;
  3663. if (g_user.bLongin)
  3664. {
  3665. SqlDlg dlg;
  3666. dlg.DoModal();
  3667. }
  3668. break;
  3669. #ifdef LYFZ_VERSION
  3670. case VK_F4:
  3671. if (g_user.bLongin)
  3672. {
  3673. g_sendhead.bsql=0;
  3674. g_sendhead.code[0]=199;
  3675. g_sendhead.tabcount=1;
  3676. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return 0;
  3677. DataToArray(&g_List1array);
  3678. CStdioFile fp;
  3679. CString path=g_mainpath+"\\NullBalance.txt";
  3680. ::DeleteFile (path);
  3681. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  3682. CString str;
  3683. for(int i=0; i<g_List1array.GetSize (); i++)
  3684. {
  3685. for(int j=0; j<g_List1array.ElementAt (0).GetSize (); j++)
  3686. {
  3687. str=g_List1array.ElementAt (0).ElementAt (j)+"\n";
  3688. str.TrimLeft ();
  3689. fp.WriteString (str);
  3690. }
  3691. }
  3692. fp.Close ();
  3693. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  3694. }
  3695. break;
  3696. #endif
  3697. }
  3698. }
  3699. return CMDIFrameWnd::PreTranslateMessage(pMsg);
  3700. }
  3701. void CMainFrame::GetSkin()
  3702. {
  3703. return;
  3704. #ifdef MNLS_VERSION
  3705. if (::PathFileExists(g_mainpath + "\\skin\\4.lia"))
  3706. {
  3707. CFile fp;
  3708. fp.Open(g_mainpath + "\\skin\\4.lia", CFile::modeRead);
  3709. DWORD leng=fp.GetLength ();
  3710. fp.Close ();
  3711. if(leng!=194987)
  3712. ::DeleteFile (g_mainpath+"\\skin\\4.lia");
  3713. }
  3714. if(!::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3715. {
  3716. ::CreateDirectory (g_mainpath+"\\skin", NULL);
  3717. g_sendhead.bsql=0;
  3718. g_sendhead.code[0]=100;
  3719. g_sendhead.tabcount=1;
  3720. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  3721. CFile fp;
  3722. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeWrite|CFile::modeCreate);
  3723. fp.Write (g_pData, g_nLeng);
  3724. fp.Close ();
  3725. }
  3726. #endif
  3727. }
  3728. void AutoDraw(CPrintRX &m_Print, CRect &StrRect, CString &str, float fscale)
  3729. {
  3730. CString tempbz, temp;
  3731. BOOL bRun = 0;
  3732. CSize size;
  3733. int fontsize = 12;
  3734. int i = 0;
  3735. ll: tempbz = str;
  3736. i = 0;
  3737. m_Print.SetFontFace(fontsize, 1, "宋体");
  3738. while (1)
  3739. {
  3740. if (!tempbz.IsEmpty())
  3741. {
  3742. temp = tempbz;
  3743. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3744. int right = 0;
  3745. CRect temprc = StrRect;
  3746. temprc.top += i*(fontsize*fscale); i++;
  3747. temprc.bottom = temprc.top + fontsize;
  3748. if (temprc.bottom > StrRect.bottom)break;
  3749. while (size.cx > temprc.Width())
  3750. {
  3751. right++;
  3752. temp = tempbz.Left(tempbz.GetLength() - (right));
  3753. if (GIsHalfHZ(temp))
  3754. {
  3755. right++;
  3756. temp.Delete(temp.GetLength() - 1);
  3757. }
  3758. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3759. }
  3760. if (temp.Find("\r\n") != -1)
  3761. {
  3762. temp = temp.Left(temp.Find("\r\n"));//i++;
  3763. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength() - 2);
  3764. }
  3765. else
  3766. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
  3767. if (bRun)
  3768. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, temprc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3769. }
  3770. else
  3771. break;
  3772. }
  3773. if (tempbz.IsEmpty() == 0)
  3774. {
  3775. fontsize--;
  3776. goto ll;
  3777. }
  3778. if (bRun == 0)
  3779. {
  3780. bRun = 1;
  3781. goto ll;
  3782. }
  3783. }
  3784. void CMainFrame::PrintDinDan3(CString strOrderNumber)
  3785. {
  3786. // TODO: Add your control notification handler code here
  3787. CPrintRX m_Print;
  3788. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  3789. {
  3790. m_Print.InitToPrint(NULL, 1);
  3791. }
  3792. else
  3793. {
  3794. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  3795. if (name.IsEmpty())
  3796. m_Print.InitToPrint(NULL, 1);
  3797. else
  3798. {
  3799. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  3800. if (nret == -1)
  3801. {
  3802. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  3803. }
  3804. }
  3805. }
  3806. m_Print.StartPrint();
  3807. m_Print.StartPage();
  3808. LoadRect load;
  3809. load.SetLiaPath("11.lia");
  3810. load.SetMargins(0, 0);
  3811. if (!load.Load())return;
  3812. LoadRect load2;
  3813. load2.SetLiaPath("12.lia");
  3814. load2.SetMargins(0, 0);
  3815. if (!load2.Load())return;
  3816. LoadRect load3;
  3817. load3.SetLiaPath("13.lia");
  3818. load3.SetMargins(-6, 520);
  3819. if (!load3.Load())return;
  3820. int i;
  3821. //////////////////////////////////////////////////////////////
  3822. CStringArray txarray;
  3823. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "'";
  3824. g_sendhead.code[0] = 11;
  3825. g_sendhead.code[1] = 52;
  3826. g_sendhead.code[2] = 50;
  3827. g_sendhead.code[3] = 150;
  3828. g_sendhead.tabcount = 4;
  3829. g_sendhead.bsql = 0;
  3830. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  3831. CArray<CStringArray, CStringArray>sparray;
  3832. CArray<CStringArray, CStringArray>clientarray;
  3833. CArray<CStringArray, CStringArray>jdarray;
  3834. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray);
  3835. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  3836. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  3837. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  3838. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  3839. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  3840. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
  3841. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  3842. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  3843. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  3844. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  3845. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  3846. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  3847. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  3848. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  3849. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  3850. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  3851. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  3852. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  3853. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  3854. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  3855. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  3856. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  3857. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  3858. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  3859. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  3860. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  3861. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  3862. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  3863. CString m_bz = "其它要求: " + g_List1array.ElementAt(0).ElementAt(38);
  3864. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  3865. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  3866. if (IsHasRights2new(31) == 0)
  3867. {
  3868. m_phone1 = "***";
  3869. m_phone2 = "***";
  3870. }
  3871. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  3872. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  3873. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  3874. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  3875. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  3876. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  3877. CString m_addr = m_addr1 + ";";
  3878. m_addr.TrimLeft(";");
  3879. m_addr += m_addr2;
  3880. CString m_qq = m_qq1 + ";";
  3881. m_qq.TrimLeft(";");
  3882. m_qq += m_qq2;
  3883. CString m_jd;
  3884. for (i = 0; i < jdarray.GetSize(); i++)
  3885. {
  3886. m_jd += jdarray.ElementAt(i).ElementAt(1);
  3887. m_jd += ";";
  3888. }
  3889. m_jd.TrimRight(";");
  3890. m_money1.Format("%f", atof(m_taoxijiage));
  3891. m_money2.Format("%f", atof(m_payed1));
  3892. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  3893. ConvertToPrice(m_money1);
  3894. ConvertToPrice(m_money2);
  3895. ConvertToPrice(m_money3);
  3896. ////////////////////////////////////////////////////////////////
  3897. int rcpos = -1;
  3898. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  3899. m_Print.SetFontFace(17, 1, "宋体");
  3900. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3901. StrRect.top -= 0;
  3902. StrRect.bottom -= 10;
  3903. StrRect.left -= 140;
  3904. StrRect.right = StrRect.left + 48;
  3905. m_Print.SetFontFace(15, 1, "宋体");
  3906. m_Print.SetColor(0xffffff);
  3907. m_Print.DrawRect(StrRect, 0);
  3908. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3909. StrRect.left = StrRect.right;
  3910. StrRect.right = StrRect.left + 48;
  3911. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  3912. m_Print.SetColor(0, RGB(255, 0, 0));
  3913. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3914. m_Print.SetColor(0);
  3915. m_Print.SetFontFace(12, 1, "宋体");
  3916. StrRect.left -= 48;
  3917. int hei = StrRect.Height();
  3918. StrRect.top = StrRect.bottom + 2;
  3919. StrRect.bottom += hei + 2;
  3920. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3921. StrRect.top = StrRect.bottom - 2;
  3922. StrRect.bottom += hei - 5;
  3923. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  3924. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3925. m_Print.SetFontFace(12, 1, "宋体");
  3926. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3927. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3928. m_Print.SetFontFace(11, 1, "宋体");
  3929. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3930. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3931. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3932. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3933. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3934. m_Print.DrawRect2(StrRect, 2);
  3935. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3936. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3937. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3938. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3939. m_Print.DrawRect2(StrRect, 2);
  3940. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3941. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3942. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3943. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3944. m_Print.DrawRect2(StrRect, 2);
  3945. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3946. m_Print.DrawText((LPTSTR)(LPCTSTR)"约单时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3947. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3948. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3949. m_Print.DrawRect2(StrRect, 2);
  3950. ////////////
  3951. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3952. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3953. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3954. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3955. m_Print.DrawRect2(StrRect, 2);
  3956. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3957. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3958. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3959. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3960. m_Print.DrawRect2(StrRect, 2);
  3961. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3962. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3963. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3964. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3965. m_Print.DrawRect2(StrRect, 2);
  3966. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3967. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3968. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3969. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3970. m_Print.DrawRect2(StrRect, 2);
  3971. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3972. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3973. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3974. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3975. m_Print.DrawRect2(StrRect, 2);
  3976. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3977. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/邮箱:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3978. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3979. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3980. m_Print.DrawRect2(StrRect, 2);
  3981. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3982. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系金额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3983. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3984. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3985. m_Print.DrawRect2(StrRect, 2);
  3986. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3987. m_Print.DrawText((LPTSTR)(LPCTSTR)"定金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3988. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3989. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3990. m_Print.DrawRect2(StrRect, 2);
  3991. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3992. m_Print.DrawText((LPTSTR)(LPCTSTR)"余额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3993. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3994. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3995. m_Print.DrawRect2(StrRect, 2);
  3996. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3997. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3998. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3999. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4000. m_Print.DrawRect2(StrRect, 2);
  4001. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4002. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍摄景点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4003. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4004. m_Print.DrawText((LPTSTR)(LPCTSTR)m_jd, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4005. m_Print.DrawRect2(StrRect, 2);
  4006. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4007. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容提供: 男士服装:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4008. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4009. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4010. m_Print.DrawRect2(StrRect, 2);
  4011. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4012. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4013. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4014. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4015. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4016. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4017. m_Print.DrawRect2(StrRect, 2);
  4018. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4019. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4020. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4021. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内提供拍摄区服装/头饰造型", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  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. m_Print.DrawRect2(StrRect, 2);
  4027. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4028. m_Print.DrawText((LPTSTR)(LPCTSTR)"专业数码拍摄:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4029. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4030. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4031. m_Print.DrawRect2(StrRect, 2);
  4032. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4033. m_Print.DrawText((LPTSTR)(LPCTSTR)"张", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4034. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4035. m_Print.DrawText((LPTSTR)(LPCTSTR)"(JPG格式数据)", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  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)(g_List1array.ElementAt(0).ElementAt(9)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4040. m_Print.DrawRect2(StrRect, 2);
  4041. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4042. m_Print.DrawText((LPTSTR)(LPCTSTR)"张设计排版精修入册", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4043. //////////////////////load2
  4044. rcpos = -1;
  4045. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4046. m_Print.DrawText((LPTSTR)(LPCTSTR)"原始数据套系内张数JPG格式光盘壹只", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4047. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4048. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4049. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4050. // m_Print.DrawText((LPTSTR)(LPCTSTR)"", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4051. // AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4052. m_Print.DrawRect2(StrRect, 2);
  4053. m_Print.SetFontFace(11, 1, "宋体");
  4054. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4055. m_Print.DrawText((LPTSTR)(LPCTSTR)"客人产品:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4056. int rowcount = sparray.GetSize() / 8;
  4057. int needaddrow = 0;
  4058. while (sparray.GetSize() > rowcount * 8 + needaddrow)
  4059. needaddrow++;
  4060. int pos = 0;
  4061. CString str = "";
  4062. int addcount = 0;
  4063. if (needaddrow > 0)
  4064. addcount = 1;
  4065. else
  4066. addcount = 0;
  4067. needaddrow--;
  4068. str.Empty();
  4069. for (i = 0; i < rowcount + addcount; i++)
  4070. {
  4071. str += sparray.ElementAt(pos).ElementAt(5);
  4072. str += " 数量:";
  4073. str += sparray.ElementAt(pos).ElementAt(3);
  4074. str += ";";
  4075. pos++;
  4076. }
  4077. StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
  4078. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4079. m_Print.DrawRect2(StrRect, 2);
  4080. StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
  4081. if (needaddrow > 0)
  4082. addcount = 1;
  4083. else
  4084. addcount = 0;
  4085. needaddrow--;
  4086. str.Empty();
  4087. for (i = 0; i < rowcount + addcount; i++)
  4088. {
  4089. str += sparray.ElementAt(pos).ElementAt(5);
  4090. str += " 数量:";
  4091. str += sparray.ElementAt(pos).ElementAt(3);
  4092. str += ";";
  4093. pos++;
  4094. }
  4095. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4096. m_Print.DrawRect2(StrRect, 2);
  4097. StrRect = load2.m_rcarray.ElementAt(++rcpos);//7
  4098. if (needaddrow > 0)
  4099. addcount = 1;
  4100. else
  4101. addcount = 0;
  4102. needaddrow--;
  4103. str.Empty();
  4104. for (i = 0; i < rowcount + addcount; i++)
  4105. {
  4106. str += sparray.ElementAt(pos).ElementAt(5);
  4107. str += " 数量:";
  4108. str += sparray.ElementAt(pos).ElementAt(3);
  4109. str += ";";
  4110. pos++;
  4111. }
  4112. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4113. m_Print.DrawRect2(StrRect, 2);
  4114. StrRect = load2.m_rcarray.ElementAt(++rcpos);//8
  4115. if (needaddrow > 0)
  4116. addcount = 1;
  4117. else
  4118. addcount = 0;
  4119. needaddrow--;
  4120. str.Empty();
  4121. for (i = 0; i < rowcount + addcount; i++)
  4122. {
  4123. str += sparray.ElementAt(pos).ElementAt(5);
  4124. str += " 数量:";
  4125. str += sparray.ElementAt(pos).ElementAt(3);
  4126. str += ";";
  4127. pos++;
  4128. }
  4129. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4130. m_Print.DrawRect2(StrRect, 2);
  4131. StrRect = load2.m_rcarray.ElementAt(++rcpos);//9
  4132. if (needaddrow > 0)
  4133. addcount = 1;
  4134. else
  4135. addcount = 0;
  4136. needaddrow--;
  4137. str.Empty();
  4138. for (i = 0; i < rowcount + addcount; i++)
  4139. {
  4140. str += sparray.ElementAt(pos).ElementAt(5);
  4141. str += " 数量:";
  4142. str += sparray.ElementAt(pos).ElementAt(3);
  4143. str += ";";
  4144. pos++;
  4145. }
  4146. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4147. m_Print.DrawRect2(StrRect, 2);
  4148. StrRect = load2.m_rcarray.ElementAt(++rcpos);//10
  4149. if (needaddrow > 0)
  4150. addcount = 1;
  4151. else
  4152. addcount = 0;
  4153. needaddrow--;
  4154. str.Empty();
  4155. for (i = 0; i < rowcount + addcount; i++)
  4156. {
  4157. str += sparray.ElementAt(pos).ElementAt(5);
  4158. str += " 数量:";
  4159. str += sparray.ElementAt(pos).ElementAt(3);
  4160. str += ";";
  4161. pos++;
  4162. }
  4163. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4164. m_Print.DrawRect2(StrRect, 2);
  4165. StrRect = load2.m_rcarray.ElementAt(++rcpos);//11
  4166. if (needaddrow > 0)
  4167. addcount = 1;
  4168. else
  4169. addcount = 0;
  4170. needaddrow--;
  4171. str.Empty();
  4172. for (i = 0; i < rowcount + addcount; i++)
  4173. {
  4174. str += sparray.ElementAt(pos).ElementAt(5);
  4175. str += " 数量:";
  4176. str += sparray.ElementAt(pos).ElementAt(3);
  4177. str += ";";
  4178. pos++;
  4179. }
  4180. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4181. m_Print.DrawRect2(StrRect, 2);
  4182. StrRect = load2.m_rcarray.ElementAt(++rcpos);//12
  4183. if (needaddrow > 0)
  4184. addcount = 1;
  4185. else
  4186. addcount = 0;
  4187. needaddrow--;
  4188. str.Empty();
  4189. for (i = 0; i < rowcount + addcount; i++)
  4190. {
  4191. str += sparray.ElementAt(pos).ElementAt(5);
  4192. str += " 数量:";
  4193. str += sparray.ElementAt(pos).ElementAt(3);
  4194. str += ";";
  4195. pos++;
  4196. }
  4197. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4198. m_Print.DrawRect2(StrRect, 2);
  4199. /* StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4200. if(needaddrow>0)
  4201. addcount=1;
  4202. else
  4203. addcount=0;
  4204. needaddrow--;
  4205. str.Empty ();
  4206. for( i=0; i<rowcount+addcount; i++)
  4207. {
  4208. str+=sparray.ElementAt (pos).ElementAt (5);
  4209. str+=" 数量:";
  4210. str+=sparray.ElementAt (pos).ElementAt (3);
  4211. str+=";";
  4212. pos++;
  4213. }
  4214. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4215. m_Print.DrawRect2(StrRect, 2);
  4216. StrRect=load2.m_rcarray .ElementAt (++rcpos);//14
  4217. if(needaddrow>0)
  4218. addcount=1;
  4219. else
  4220. addcount=0;
  4221. needaddrow--;
  4222. str.Empty ();
  4223. for( i=0; i<rowcount+addcount; i++)
  4224. {
  4225. str+=sparray.ElementAt (pos).ElementAt (5);
  4226. str+=" 数量:";
  4227. str+=sparray.ElementAt (pos).ElementAt (3);
  4228. str+=";";
  4229. pos++;
  4230. }
  4231. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4232. m_Print.DrawRect2(StrRect, 2);*/
  4233. CRect sprc[2];
  4234. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4235. // AutoDraw(m_Print, StrRect, m_bz.Left (leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4236. m_Print.DrawRect2(StrRect, 2);
  4237. sprc[0] = StrRect;
  4238. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4239. // AutoDraw(m_Print, StrRect, m_bz.Right (leng-leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4240. m_Print.DrawRect2(StrRect, 2);
  4241. sprc[1] = StrRect;
  4242. //AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4243. {
  4244. CString temp, tempspno, tempbz;
  4245. CSize size;
  4246. BOOL bRun = 0;
  4247. int fontsize = 12;
  4248. ll: tempspno = m_bz;
  4249. m_Print.SetFontFace(fontsize, 1, "宋体");
  4250. for (i = 0; i<2; i++)
  4251. {
  4252. if (!tempspno.IsEmpty())
  4253. {
  4254. temp = tempspno;
  4255. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4256. int right = 0;
  4257. CRect temprc = sprc[i];
  4258. while (size.cx>temprc.Width())
  4259. {
  4260. right++;
  4261. temp = tempspno.Left(tempspno.GetLength() - (right));
  4262. if (GIsHalfHZ(temp))
  4263. {
  4264. right++;
  4265. temp.Delete(temp.GetLength() - 1);
  4266. }
  4267. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4268. }
  4269. if (bRun)
  4270. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4271. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  4272. if (tempspno.IsEmpty())i++;
  4273. }
  4274. }
  4275. if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
  4276. {
  4277. fontsize--;
  4278. goto ll;
  4279. }
  4280. if (bRun == 0)
  4281. {
  4282. bRun = 1;
  4283. goto ll;
  4284. }
  4285. }
  4286. m_Print.SetFontFace(11, 1, "宋体");
  4287. //////////////////////load3
  4288. rcpos = -1;
  4289. for (i = 0; i < 24; i++)
  4290. {
  4291. StrRect = load3.m_rcarray.ElementAt(i);
  4292. m_Print.DrawRect2(StrRect, 1);
  4293. }
  4294. CStringArray strarray;
  4295. strarray.Add("营业员");
  4296. strarray.Add("前台接待");
  4297. strarray.Add("化妆师");
  4298. strarray.Add("礼服师");
  4299. strarray.Add("摄影师");
  4300. strarray.Add("摄影助理");
  4301. strarray.Add("美工师");
  4302. strarray.Add("设计师");
  4303. for (i = 0; i < 8; i++)
  4304. {
  4305. StrRect = load3.m_rcarray.ElementAt(i);
  4306. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4307. }
  4308. strarray.RemoveAll();
  4309. strarray.Add(m_ren);
  4310. strarray.Add(g_List1array.ElementAt(0).ElementAt(49));
  4311. strarray.Add(m_waiter2);
  4312. strarray.Add(g_List1array.ElementAt(0).ElementAt(51));
  4313. strarray.Add(m_waiter1);
  4314. strarray.Add(g_List1array.ElementAt(0).ElementAt(50));
  4315. strarray.Add("");
  4316. strarray.Add(m_waiter4);
  4317. for (i = 8; i < 16; i++)
  4318. {
  4319. StrRect = load3.m_rcarray.ElementAt(i);
  4320. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 8), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4321. }
  4322. StrRect = load3.m_rcarray.ElementAt(27);
  4323. m_Print.DrawText((LPTSTR)(LPCTSTR)"客户电话: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4324. StrRect = load3.m_rcarray.ElementAt(28);
  4325. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4326. m_Print.SetFontFace(13, 1, "宋体");
  4327. StrRect = load3.m_rcarray.ElementAt(25);
  4328. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4329. StrRect = load3.m_rcarray.ElementAt(26);
  4330. m_Print.DrawRect2(StrRect, 2);
  4331. StrRect = load3.m_rcarray.ElementAt(24);
  4332. str = "\
  4333. 顾客须知\r\n\
  4334. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  4335. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  4336. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  4337. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  4338. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  4339. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  4340. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  4341. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  4342. AutoDraw(m_Print, StrRect, str, 1.8);
  4343. PrintPreview dlg;
  4344. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4345. dlg.m_pDC = m_Print.GetPDC();
  4346. if (dlg.DoModal() != IDOK)return;
  4347. //结束打印
  4348. m_Print.EndPage();
  4349. m_Print.EndPrint();
  4350. }
  4351. void CMainFrame::PrintDailyForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4352. {
  4353. // TODO: Add your control notification handler code here
  4354. int pages = Listarray->GetSize() / 46;
  4355. if (Listarray->GetSize() % 46)pages++;
  4356. for (int aa = 0; aa < pages; aa++)
  4357. {
  4358. PrintPreview dlg;
  4359. CPrintRX m_Print;
  4360. m_Print.InitToPrint(NULL, 1);
  4361. m_Print.StartPrint();
  4362. m_Print.StartPage();
  4363. CRect mainrc(0, 0, 560, 793);
  4364. float fscale;
  4365. {
  4366. int w, h;
  4367. m_Print.GetWidHei(w, h);
  4368. fscale = (float)w / (float)h;
  4369. }
  4370. mainrc.DeflateRect(25, 40, 10, 0);
  4371. CRect rc, rc2;
  4372. rc = mainrc;
  4373. rc.bottom = rc.top;
  4374. rc.top -= 20;
  4375. m_Print.SetFontFace(16, 1, "黑体");
  4376. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4377. m_Print.SetFontFace(9, 1, "宋体");
  4378. CString str;
  4379. int wid[4] = { 320, 60, 60, 90 };
  4380. int hei = 16;
  4381. if (fscale > 0.71)hei = 15;
  4382. rc = mainrc;
  4383. rc.bottom = rc.top + hei;
  4384. for (int i = 0; i < 47; i++)
  4385. {
  4386. rc2.top = rc.top + i*hei;
  4387. rc2.bottom = rc.bottom + i*hei;
  4388. rc2.left = rc.left;
  4389. rc2.right = rc.left + wid[0];
  4390. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  4391. for (int j = 0; j<4; j++)
  4392. {
  4393. m_Print.DrawRect2(rc2, 1);
  4394. if (Listarray->GetSize()>aa * 46 + i)
  4395. {
  4396. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  4397. rc2.left += 3;
  4398. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4399. rc2.left -= 3;
  4400. }
  4401. rc2.left += wid[j];
  4402. rc2.right = rc2.left + wid[j + 1];
  4403. }
  4404. }
  4405. rc2.top += 2;
  4406. rc2.left += 2; rc2.right = mainrc.right + 4;
  4407. m_Print.SetFontFace(8, 1, "宋体");
  4408. int infopos = info.Find("***");
  4409. if (infopos != -1)
  4410. {
  4411. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Left(infopos), rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4412. CRect rc3 = rc2;
  4413. rc3.top = rc2.bottom - 4;
  4414. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Right(info.GetLength() - infopos - 3), rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4415. }
  4416. else
  4417. m_Print.DrawText((LPTSTR)(LPCTSTR)info, rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4418. str.Format(" 页:%d/%d", aa + 1, pages);
  4419. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4420. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  4421. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4422. dlg.m_pDC = m_Print.GetPDC();
  4423. // dlg.m_mode=1;
  4424. if (aa == 0)
  4425. {
  4426. if (dlg.DoModal() != IDOK)
  4427. return;
  4428. }
  4429. //结束打印
  4430. m_Print.EndPage();
  4431. m_Print.EndPrint();
  4432. }
  4433. }
  4434. void CMainFrame::PrintLoginForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4435. {
  4436. // TODO: Add your control notification handler code here
  4437. int sinlecount = 33 * 6;
  4438. int pages = Listarray->GetSize() / sinlecount;
  4439. if (Listarray->GetSize() % sinlecount)pages++;
  4440. for (int aa = 0; aa < pages; aa++)
  4441. {
  4442. PrintPreview dlg;
  4443. CPrintRX m_Print;
  4444. m_Print.InitToPrint(NULL, 1);
  4445. m_Print.StartPrint();
  4446. m_Print.StartPage();
  4447. CRect mainrc(0, 0, 560, 793);
  4448. float fscale;
  4449. {
  4450. int w, h;
  4451. m_Print.GetWidHei(w, h);
  4452. fscale = (float)w / (float)h;
  4453. }
  4454. mainrc.DeflateRect(25, 40, 10, 0);
  4455. CString str;
  4456. CRect rc, rc2;
  4457. rc = mainrc;
  4458. rc.bottom = rc.top;
  4459. rc.top -= 20;
  4460. rc.left -= 20;
  4461. m_Print.SetFontFace(12, 1, "黑体");
  4462. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4463. m_Print.SetFontFace(6, 1, "宋体");
  4464. str.Format(" 页:%d/%d", aa + 1, pages);
  4465. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4466. rc.right = mainrc.right + 20;
  4467. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4468. int wid[2] = { 50, 110 };
  4469. int hei = 11;
  4470. rc = mainrc;
  4471. rc.bottom = rc.top + hei;
  4472. rc.top += 10;
  4473. rc.bottom += 10;
  4474. int dtx = rc.Width() / 3 + 18;
  4475. int dty = 380;
  4476. for (int j = 0; j < 6; j++)
  4477. {
  4478. if (Listarray->GetSize() < aa*sinlecount + 33 * (j + 1))continue;
  4479. for (int i = 0; i < 33; i++)
  4480. {
  4481. rc2.top = rc.top + i*hei;
  4482. rc2.bottom = rc.bottom + i*hei;
  4483. rc2.left = rc.left;
  4484. rc2.right = rc.left + wid[0];
  4485. if (i == 0)
  4486. {
  4487. // rc2.left +=wid[1];
  4488. rc2.right += wid[1];
  4489. }
  4490. if (j == 1 || j == 4)
  4491. {
  4492. rc2.left += dtx;
  4493. rc2.right += dtx;
  4494. }
  4495. if (j == 2 || j == 5)
  4496. {
  4497. rc2.left += dtx * 2;
  4498. rc2.right += dtx * 2;
  4499. }
  4500. if (j == 3 || j == 4 || j == 5)
  4501. {
  4502. rc2.top += dty;
  4503. rc2.bottom += dty;
  4504. }
  4505. m_Print.DrawRect2(rc2, 1);
  4506. if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
  4507. {
  4508. str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(0);
  4509. rc2.left += 3;
  4510. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4511. rc2.left -= 3;
  4512. }
  4513. if (i == 0)continue;
  4514. rc2.left = rc2.right;
  4515. rc2.right += wid[1];
  4516. m_Print.DrawRect2(rc2, 1);
  4517. if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
  4518. {
  4519. if (Listarray->ElementAt(aa*sinlecount + 33 * j + i).GetSize() > 1)
  4520. {
  4521. str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(1);
  4522. rc2.left += 3;
  4523. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4524. rc2.left -= 3;
  4525. }
  4526. }
  4527. /* if(Listarray->GetSize ()>aa*46+i)
  4528. {
  4529. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4530. rc2.left +=3;
  4531. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4532. rc2.left -=3;
  4533. }
  4534. rc2.left +=wid[j];
  4535. rc2.right =rc2.left+wid[j+1];*/
  4536. }
  4537. }
  4538. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4539. dlg.m_pDC = m_Print.GetPDC();
  4540. if (aa == 0)
  4541. {
  4542. if (dlg.DoModal() != IDOK)
  4543. return;
  4544. }
  4545. //结束打印
  4546. m_Print.EndPage();
  4547. m_Print.EndPrint();
  4548. }
  4549. }
  4550. void CMainFrame::PrintTakeForm(CArray<CStringArray, CStringArray>*Listarray)
  4551. {
  4552. CString title;
  4553. CString info;
  4554. // TODO: Add your control notification handler code here
  4555. int sinlecount = 4;
  4556. int pages = Listarray->GetSize() / sinlecount;
  4557. if (Listarray->GetSize() % sinlecount)pages++;
  4558. for (int aa = 0; aa < pages; aa++)
  4559. {
  4560. PrintPreview dlg;
  4561. CPrintRX m_Print;
  4562. m_Print.InitToPrint(NULL, 1);
  4563. m_Print.StartPrint();
  4564. m_Print.StartPage();
  4565. CRect mainrc(0, 0, 560, 793);
  4566. float fscale;
  4567. {
  4568. int w, h;
  4569. m_Print.GetWidHei(w, h);
  4570. fscale = (float)w / (float)h;
  4571. }
  4572. mainrc.DeflateRect(25, 40, 10, 0);
  4573. CString str;
  4574. CRect rc, rc2;
  4575. rc = mainrc;
  4576. rc.bottom = rc.top;
  4577. rc.top -= 20;
  4578. rc.left -= 20;
  4579. m_Print.SetFontFace(6, 1, "宋体");
  4580. str.Format(" 页:%d/%d", aa + 1, pages);
  4581. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4582. rc.right = mainrc.right + 10;
  4583. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4584. m_Print.SetFontFace(12, 1, "宋体");
  4585. int wid[2] = { 70, 190 };
  4586. int hei = 22;
  4587. rc = mainrc;
  4588. rc.bottom = rc.top + hei;
  4589. rc.top += 10;
  4590. rc.bottom += 10;
  4591. int dtx = rc.Width() / 2 + 18;
  4592. int dty = 380;
  4593. int arraysize = Listarray->ElementAt(0).GetSize();
  4594. for (int j = 0; j < 4; j++)
  4595. {
  4596. if (Listarray->GetSize() <= aa*sinlecount + j)continue;
  4597. for (int i = 0; i < arraysize; i++)
  4598. {
  4599. rc2.top = rc.top + i / 2 * hei;
  4600. rc2.bottom = rc.bottom + i / 2 * hei;
  4601. rc2.left = rc.left;
  4602. rc2.right = rc.left + wid[0];
  4603. if (i % 2)
  4604. {
  4605. rc2.left = rc2.right;
  4606. rc2.right += wid[1];
  4607. }
  4608. if (j == 1 || j == 3)
  4609. {
  4610. rc2.left += dtx;
  4611. rc2.right += dtx;
  4612. }
  4613. if (j == 2 || j == 3)
  4614. {
  4615. rc2.top += dty;
  4616. rc2.bottom += dty;
  4617. }
  4618. if (i == arraysize - 1 || i == arraysize - 2)
  4619. {
  4620. rc2.bottom += hei * 2;
  4621. }
  4622. m_Print.DrawRect2(rc2, 1);
  4623. {
  4624. str = Listarray->ElementAt(aa*sinlecount + j).ElementAt(i);
  4625. if (i == arraysize - 1)
  4626. {
  4627. CRect rc3 = rc2;
  4628. rc3.left += 3;
  4629. rc3.top += 3;
  4630. AutoDraw(m_Print, rc3, str, 1.4);
  4631. }
  4632. else if (i == arraysize - 2)
  4633. {
  4634. CRect rc3 = rc2;
  4635. rc3.left += 3;
  4636. rc3.top += 3;
  4637. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4638. }
  4639. else
  4640. {
  4641. rc2.left += 3;
  4642. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4643. rc2.left -= 3;
  4644. }
  4645. }
  4646. }
  4647. }
  4648. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4649. dlg.m_pDC = m_Print.GetPDC();
  4650. if (aa == 0)
  4651. {
  4652. if (dlg.DoModal() != IDOK)
  4653. return;
  4654. }
  4655. //结束打印
  4656. m_Print.EndPage();
  4657. m_Print.EndPrint();
  4658. }
  4659. }
  4660. void CMainFrame::PrintThumbNail(CStringArray *array, CString client, BOOL bDir, CString m_size)
  4661. {
  4662. // TODO: Add your control notification handler code here
  4663. CStringArray titlearray;
  4664. CStringArray namearray;
  4665. CStringArray noarray;
  4666. CArray<CRect, CRect>rcarray;
  4667. CArray<CRect, CRect>widtharray;
  4668. if (m_size != "")
  4669. {
  4670. int pos = m_size.Find(";");
  4671. while (pos != -1)
  4672. {
  4673. CString size = m_size.Left(pos);
  4674. int pos2 = size.Find(":");
  4675. if (pos2 != -1)
  4676. {
  4677. CString str;
  4678. CRect rc;
  4679. str = size.Left(pos2);
  4680. noarray.Add(str);
  4681. str = size.Right(size.GetLength() - pos2 - 1);
  4682. pos2 = str.Find(",");
  4683. namearray.Add(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4684. pos2 = str.Find(",");
  4685. rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4686. pos2 = str.Find(",");
  4687. rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4688. widtharray.Add(rc);
  4689. pos2 = str.Find(",");
  4690. rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4691. pos2 = str.Find(",");
  4692. rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4693. pos2 = str.Find(",");
  4694. rc.right = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4695. rc.bottom = atoi(str);
  4696. rcarray.Add(rc);
  4697. }
  4698. m_size = m_size.Right(m_size.GetLength() - pos - 1);
  4699. pos = m_size.Find(";");
  4700. }
  4701. }
  4702. PrintPreview dlg;
  4703. CPrintRX m_Print;
  4704. m_Print.InitToPrint(NULL, 1);
  4705. m_Print.StartPrint();
  4706. m_Print.StartPage();
  4707. CRect mainrc(0, 0, 560, 793);
  4708. mainrc.DeflateRect(25, 50, 10, 0);
  4709. m_Print.SetFontFace(10, 1, "宋体");
  4710. CRect rc, rc2;
  4711. rc = mainrc;
  4712. rc.bottom = rc.top;
  4713. rc.top -= 20;
  4714. m_Print.DrawText((LPTSTR)(LPCTSTR)client, rc, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4715. rc.bottom -= 5;
  4716. m_Print.DrawRect2(rc, 2);
  4717. if (array->GetSize() > 130)m_Print.SetFontFace(8, 1, "宋体");
  4718. if (bDir)m_Print.SetFontFace(6, 1, "宋体");
  4719. ////////////////////////////////////////////////////////////////
  4720. int imgcount = array->GetSize();
  4721. int dtx = 5;
  4722. int dty = 15;
  4723. int cx, cy;
  4724. int countx = 5;
  4725. int county = 1;
  4726. while (1)
  4727. {
  4728. if (countx*county >= imgcount)
  4729. {
  4730. cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
  4731. cy = cx * 4 / 3;
  4732. break;
  4733. }
  4734. else
  4735. {
  4736. cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
  4737. cy = cx * 4 / 3;
  4738. if (cy*(county + 1) + dty*county < mainrc.Height())//Y方向可以增加一个
  4739. {
  4740. county++;
  4741. }
  4742. else//Y方向不能加,X方向加
  4743. {
  4744. countx++;
  4745. county = 1;
  4746. }
  4747. }
  4748. }
  4749. int imgpos = 0;
  4750. CString stemp;
  4751. CPen pen(PS_SOLID, 1, RGB(255, 0, 0));
  4752. CPen *oldpen = m_Print.m_DC.SelectObject(&pen);
  4753. CPen *oldpen2 = m_Print.m_memdc.SelectObject(&pen);
  4754. for (int i = 0; i < county; i++)
  4755. {
  4756. for (int j = 0; j < countx; j++)
  4757. {
  4758. rc = mainrc;
  4759. rc.top += i*(cy + dty);
  4760. rc.left += j*(cx + dtx);
  4761. rc.right = rc.left + cx;
  4762. rc.bottom = rc.top + cy;
  4763. Image *pImg = NULL;
  4764. if (imgpos >= array->GetSize())break;
  4765. CString str = array->ElementAt(imgpos);
  4766. CString spath = str.Left(str.ReverseFind('\\') + 1);
  4767. spath += "m";
  4768. spath += str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4769. if (PathFileExists(spath))
  4770. ::LoadImageFromBuf(&pImg, spath);
  4771. else
  4772. {
  4773. ::LoadImageFromBuf(&pImg, str);
  4774. if (pImg == NULL)continue;
  4775. int orientation = GetOrientation(pImg);
  4776. if (orientation == 8)
  4777. pImg->RotateFlip(Rotate270FlipNone);
  4778. else if (orientation == 6)
  4779. pImg->RotateFlip(Rotate90FlipNone);
  4780. }
  4781. if (pImg == NULL)continue;
  4782. rc2 = rc;
  4783. RectFitDes(pImg->GetWidth(), pImg->GetHeight(), rc);
  4784. imgpos++;
  4785. m_Print.DrawImage(pImg, rc);
  4786. int imgwidth = pImg->GetWidth();
  4787. delete pImg;
  4788. rc2.top = rc2.bottom + 3;
  4789. rc2.bottom += 10;
  4790. if (bDir == 0)
  4791. str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4792. else
  4793. {
  4794. stemp = str.Left(str.ReverseFind('\\'));
  4795. str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4796. if (stemp.ReverseFind('\\') != -1)
  4797. {
  4798. stemp = stemp.Right(stemp.GetLength() - stemp.ReverseFind('\\') - 1);
  4799. str = stemp + "\\" + str;
  4800. }
  4801. }
  4802. if (str.Find(".") != -1)
  4803. str = str.Left(str.Find("."));
  4804. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  4805. if (noarray.GetSize())
  4806. {
  4807. rc2 = rc;
  4808. for (int aa = 0; aa < noarray.GetSize(); aa++)
  4809. {
  4810. float scale = (float)rc2.Width() / (float)imgwidth;
  4811. if (noarray.ElementAt(aa) == str)
  4812. {
  4813. int nIndex = aa;
  4814. CRect rc = rcarray.ElementAt(nIndex);
  4815. int wid = widtharray.ElementAt(nIndex).left;
  4816. int hei = widtharray.ElementAt(nIndex).top;
  4817. scale *= (float)imgwidth / (float)wid;
  4818. rc.left *= scale;
  4819. rc.right *= scale;
  4820. rc.top *= scale;
  4821. rc.bottom *= scale;
  4822. rc.left += rc2.left;
  4823. rc.right += rc2.left;
  4824. rc.top += rc2.top;
  4825. rc.bottom += rc2.top;
  4826. if (rc.left < rc2.left)rc.left = rc2.left;
  4827. if (rc.right > rc2.right)rc.right = rc2.right;
  4828. if (rc.top < rc2.top)rc.top = rc2.top;
  4829. if (rc.bottom > rc2.bottom)rc.bottom = rc2.bottom;
  4830. m_Print.DrawRect2(rc, 1);
  4831. }
  4832. }
  4833. }
  4834. }
  4835. }
  4836. m_Print.m_DC.SelectObject(oldpen);
  4837. m_Print.m_memdc.SelectObject(oldpen2);
  4838. /* CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  4839. StrRect.top -=15;StrRect.bottom -=15;
  4840. Image *pImg=NULL;
  4841. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  4842. m_Print.DrawImage(pImg, StrRect);
  4843. delete pImg;
  4844. m_Print.SetFontFace(10, 1, "宋体");
  4845. StrRect=load.m_rcarray .ElementAt (20);
  4846. StrRect.right=load.m_rcarray .ElementAt (23).right;
  4847. StrRect.top -=18;StrRect.bottom -=18;
  4848. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  4849. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4850. */
  4851. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4852. dlg.m_pDC = m_Print.GetPDC();
  4853. if (dlg.DoModal() != IDOK)
  4854. return;
  4855. //结束打印
  4856. m_Print.EndPage();
  4857. m_Print.EndPrint();
  4858. }
  4859. // remark by Jeff
  4860. // 函数:PrintDinDan
  4861. // 参数:
  4862. // strOrderNumber:订单单号;(Order number)
  4863. // 返回:void
  4864. // 注意:#
  4865. void CMainFrame::PrintDinDan(CString strOrderNumber)//打印订单报表;
  4866. {
  4867. int printcot = 1;
  4868. for (int aa = 0; aa < printcot; aa++)
  4869. {
  4870. PrintPreview dlg;
  4871. CPrintRX m_Print;
  4872. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  4873. {
  4874. m_Print.InitToPrint(NULL, 1);
  4875. }
  4876. else
  4877. {
  4878. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  4879. if (name.IsEmpty())
  4880. m_Print.InitToPrint(NULL, 1);
  4881. else
  4882. {
  4883. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  4884. if (nret == -1 && aa == 0)
  4885. {
  4886. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  4887. }
  4888. }
  4889. }
  4890. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 0)
  4891. {
  4892. #ifdef ZHIAI_VERSION
  4893. PrintDinDan3(strOrderNumber);
  4894. return;
  4895. #endif
  4896. #ifdef SZBLCT_VERSION
  4897. PrintDinDan4(strOrderNumber);
  4898. return;
  4899. #endif
  4900. m_Print.StartPrint();
  4901. m_Print.StartPage();
  4902. LoadRect load;
  4903. load.SetLiaPath("6.lia");
  4904. load.SetMargins(-14, 15);
  4905. if (!load.Load())return;
  4906. LoadRect load2;
  4907. load2.SetLiaPath("7.lia");
  4908. load2.SetMargins(-14, 216 + 15);
  4909. if (!load2.Load())return;
  4910. LoadRect load3;
  4911. load3.SetLiaPath("8.lia");
  4912. load3.SetMargins(-14, 705 + 15);
  4913. if (!load3.Load())return;
  4914. int i;
  4915. //////////////////////////////////////////////////////////////
  4916. CStringArray txarray;
  4917. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
  4918. g_sendhead.code[0] = 11;
  4919. g_sendhead.code[1] = 52;
  4920. g_sendhead.code[2] = 50;
  4921. g_sendhead.code[3] = 150;
  4922. g_sendhead.code[4] = 77;
  4923. g_sendhead.code[5] = 4;
  4924. g_sendhead.tabcount = 6;
  4925. g_sendhead.bsql = 0;
  4926. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  4927. CArray<CStringArray, CStringArray>sparray;
  4928. CArray<CStringArray, CStringArray>clientarray;
  4929. CArray<CStringArray, CStringArray>phonearray;
  4930. CArray<CStringArray, CStringArray>fgarray;
  4931. CArray<CStringArray, CStringArray>danweiarray;
  4932. CArray<CStringArray, CStringArray>jdarray;
  4933. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  4934. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  4935. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  4936. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  4937. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  4938. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  4939. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  4940. CString m_taoxiname;
  4941. if (m_zs.Find("\\") != -1)
  4942. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
  4943. else
  4944. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
  4945. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  4946. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  4947. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  4948. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  4949. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  4950. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  4951. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  4952. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  4953. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  4954. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  4955. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  4956. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  4957. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  4958. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  4959. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  4960. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  4961. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  4962. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  4963. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  4964. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  4965. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  4966. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  4967. if (jdarray.GetSize())
  4968. {
  4969. if (m_bz.IsEmpty() == 0)
  4970. m_bz = "\r\n" + m_bz;
  4971. m_bz += "景点:";
  4972. }
  4973. #ifdef DDF_VERSION
  4974. m_bz += "219店:219路馨园小区对面\r\n";
  4975. m_bz += "金色店:万科金色家园小区东门南走20米荣光社区一楼\r\n";
  4976. m_bz += "万泰店:万泰锦绣华城小区正门\r\n";
  4977. #else
  4978. for (i = 0; i < jdarray.GetSize(); i++)
  4979. {
  4980. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  4981. }
  4982. m_bz.TrimRight(";");
  4983. #endif
  4984. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  4985. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  4986. if (IsHasRights2new(31) == 0)
  4987. {
  4988. m_phone1 = "***";
  4989. m_phone2 = "***";
  4990. }
  4991. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  4992. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  4993. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  4994. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  4995. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  4996. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  4997. filter = "name='" + m_ren + "'";
  4998. g_sendhead.code[0] = 5;
  4999. g_sendhead.tabcount = 1;
  5000. g_sendhead.bsql = 0;
  5001. int g_nYearposTemp = g_nYearpos;
  5002. g_nYearpos = -1;
  5003. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5004. g_nYearpos = g_nYearposTemp;
  5005. if (g_bSendOK == 0)return;
  5006. DataToArray(&phonearray);
  5007. m_money1.Format("%f", atof(m_taoxijiage));
  5008. m_money2.Format("%f", atof(m_payed1));
  5009. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5010. ConvertToPrice(m_money1);
  5011. ConvertToPrice(m_money2);
  5012. ConvertToPrice(m_money3);
  5013. ////////////////////////////////////////////////////////////////
  5014. int rcpos = -1;
  5015. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  5016. StrRect.top -= 15; StrRect.bottom -= 15;
  5017. Image *pImg = NULL;
  5018. #ifdef MNLS_VERSION
  5019. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  5020. #else
  5021. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  5022. #endif
  5023. m_Print.DrawImage(pImg, StrRect);
  5024. delete pImg;
  5025. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5026. {
  5027. Image *pImg = NULL;
  5028. g_nSendCode = 31;
  5029. int g_nYearposTemp = g_nYearpos;
  5030. g_nYearpos = -1;
  5031. g_pMainWnd->ProcessChatMessageRequest2(1);
  5032. g_nYearpos = g_nYearposTemp;
  5033. g_nSendCode = 0;
  5034. if (g_bSendOK == 0)return;
  5035. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  5036. if (pImg)
  5037. {
  5038. StrRect.left = 30;
  5039. StrRect.top = 12;
  5040. StrRect.right = StrRect.left + 60;
  5041. StrRect.bottom = StrRect.top + 60;
  5042. m_Print.DrawImage(pImg, StrRect);
  5043. delete pImg; pImg = NULL;
  5044. }
  5045. }
  5046. m_Print.SetFontFace(11, 1, "宋体");
  5047. StrRect = load.m_rcarray.ElementAt(20);
  5048. StrRect.right = load.m_rcarray.ElementAt(23).right;
  5049. StrRect.top -= 18; StrRect.bottom -= 18;
  5050. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  5051. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5052. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  5053. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5054. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5055. StrRect.top -= 15; StrRect.bottom -= 15;
  5056. #ifdef MNLS_VERSION
  5057. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5058. #endif
  5059. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5060. StrRect.top -= 15; StrRect.bottom -= 15;
  5061. #ifdef MNLS_VERSION
  5062. m_Print.DrawRect(StrRect);
  5063. #endif
  5064. m_Print.SetFontFace(7, 1, "黑体");
  5065. m_Print.SetColor(0xffffff);
  5066. #ifdef MNLS_VERSION
  5067. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5068. #endif
  5069. m_Print.SetColor(0);
  5070. m_Print.SetFontFace(15, 1, "宋体");
  5071. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5072. StrRect.top -= 15; StrRect.bottom -= 15;
  5073. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5074. CStringArray strarray;
  5075. strarray.Add("NO: " + strOrderNumber);
  5076. CString date;
  5077. date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  5078. strarray.Add(date);
  5079. strarray.Add("喜爱");
  5080. strarray.Add("格调");
  5081. if (fgarray.GetSize() == 12)
  5082. {
  5083. for (int i = 0; i < 12; i++)
  5084. strarray.Add(fgarray.ElementAt(i).ElementAt(0));
  5085. }
  5086. else
  5087. {
  5088. strarray.Add("复古典雅");
  5089. strarray.Add("温文尔雅");
  5090. strarray.Add("豪华艳丽");
  5091. strarray.Add("传统大方");
  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. }
  5101. strarray.Add("姓名");
  5102. // strarray.Add("职业");
  5103. strarray.Add("");
  5104. strarray.Add("地址");
  5105. strarray.Add("电话");
  5106. #ifdef CHILD_VERSION
  5107. strarray.Add("家长");
  5108. strarray.Add("宝宝");
  5109. #else
  5110. strarray.Add("先生");
  5111. strarray.Add("女士");
  5112. #endif
  5113. m_Print.SetFontFace(11, 1, "宋体");
  5114. for (i = 0; i < strarray.GetSize(); i++)
  5115. {
  5116. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5117. if (i < 2)
  5118. {
  5119. StrRect.top -= 15; StrRect.bottom -= 15;
  5120. }
  5121. if (i>15)
  5122. m_Print.DrawRect2(StrRect, 1);
  5123. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5124. }
  5125. for (i = 29; i <= 40; i++)
  5126. {
  5127. if (m_style.GetLength() <= (i - 29))continue;
  5128. if (m_style.GetAt(i - 29) != '1')continue;
  5129. StrRect = load.m_rcarray.ElementAt(i - 1);
  5130. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5131. }
  5132. for (i = 27; i <= 48; i++)
  5133. {
  5134. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5135. m_Print.DrawRect2(StrRect, 1);
  5136. }
  5137. #ifdef CHILD_VERSION
  5138. StrRect = load.m_rcarray.ElementAt(45);
  5139. StrRect.right = StrRect.left + 62;
  5140. m_Print.DrawRect2(StrRect, 1);
  5141. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5142. StrRect.left = StrRect.right;
  5143. StrRect.right = StrRect.left + 62;
  5144. m_Print.DrawRect2(StrRect, 1);
  5145. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, 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)"出生日期", 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)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5154. #endif
  5155. /////////////////////////
  5156. strarray.RemoveAll();
  5157. CString temp;
  5158. temp.Format("拍摄多款选 %d 款,其中影", atoi(m_outside) + atoi(m_outside2));
  5159. strarray.Add(temp);
  5160. temp.Format("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  5161. strarray.Add(temp);
  5162. strarray.Add("化妆");
  5163. strarray.Add("造型");
  5164. #ifdef CHILD_VERSION
  5165. strarray.Add("");
  5166. #else
  5167. strarray.Add("婚纱");
  5168. #endif
  5169. strarray.Add("服饰");
  5170. strarray.Add("配");
  5171. strarray.Add("置");
  5172. strarray.Add("其");
  5173. strarray.Add("它");
  5174. strarray.Add("套系名称");
  5175. strarray.Add("镜款");
  5176. strarray.Add("套系总价");
  5177. strarray.Add("主摄影师");
  5178. strarray.Add("拍摄日期");
  5179. strarray.Add("定金");
  5180. #ifdef CHILD_VERSION
  5181. strarray.Add("主引导师");
  5182. #else
  5183. strarray.Add("主化妆师");
  5184. #endif
  5185. strarray.Add("看样日期");
  5186. strarray.Add("欠款余额");
  5187. strarray.Add("总监");
  5188. strarray.Add("取件日期");
  5189. rcpos = -1;
  5190. for (i = 0; i < strarray.GetSize(); i++)
  5191. {
  5192. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  5193. if (i>9)
  5194. m_Print.DrawRect2(StrRect, 1);
  5195. #ifdef CHILD_VERSION
  5196. if (i == 5)
  5197. StrRect.top -= StrRect.Height();
  5198. #endif
  5199. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5200. }
  5201. for (i = 22; i <= 41; i++)
  5202. {
  5203. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  5204. m_Print.DrawRect2(StrRect, 1);
  5205. }
  5206. /////////////////////////////
  5207. strarray.RemoveAll();
  5208. #ifdef CHILD_VERSION
  5209. strarray.Add("顾客方 家长:");
  5210. strarray.Add("宝宝:");
  5211. #else
  5212. strarray.Add("顾客方 先生:");
  5213. strarray.Add("女士:");
  5214. #endif
  5215. strarray.Add("电话:");
  5216. strarray.Add("影楼方 店长:");
  5217. strarray.Add("接单人:");
  5218. strarray.Add("电话:");
  5219. rcpos = -1;
  5220. for (i = 0; i < strarray.GetSize(); i++)
  5221. {
  5222. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  5223. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5224. }
  5225. for (i = 7; i <= 12; i++)
  5226. {
  5227. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  5228. // if(i!=10)
  5229. m_Print.DrawRect2(StrRect, 2);
  5230. }
  5231. //////////////////////////////////////
  5232. //开始打数据
  5233. strarray.RemoveAll();
  5234. strarray.Add(m_name1);
  5235. strarray.Add(m_name2);
  5236. /// strarray.Add (m_occupation1);
  5237. // strarray.Add (m_occupation2);
  5238. strarray.Add("");
  5239. strarray.Add("");
  5240. strarray.Add(m_addr1);
  5241. #ifdef CHILD_VERSION
  5242. strarray.Add("");
  5243. #else
  5244. strarray.Add(m_addr2);
  5245. #endif
  5246. strarray.Add(m_phone1);
  5247. strarray.Add(m_phone2);
  5248. for (i = 41; i <= 48; i++)
  5249. {
  5250. StrRect = load.m_rcarray.ElementAt(i - 1);
  5251. StrRect.left += 4;
  5252. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5253. }
  5254. ///////////////////////////////
  5255. strarray.RemoveAll();
  5256. strarray.Add(m_money1);
  5257. strarray.Add(m_waiter1);
  5258. strarray.Add(m_time2);
  5259. strarray.Add(m_money2);
  5260. strarray.Add(m_waiter2);
  5261. strarray.Add(m_time4);
  5262. strarray.Add(m_money3);
  5263. strarray.Add("");
  5264. strarray.Add(m_time5);
  5265. for (i = 32; i <= 40; i++)
  5266. {
  5267. StrRect = load2.m_rcarray.ElementAt(i - 1);
  5268. StrRect.left += 4;
  5269. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5270. }
  5271. ///////////////////////////////
  5272. strarray.RemoveAll();
  5273. strarray.Add(m_name1);
  5274. strarray.Add(m_name2);
  5275. CString phone;
  5276. if (m_phone1.IsEmpty() == 0)
  5277. phone = m_phone1 + ",";
  5278. phone += m_phone2;
  5279. phone.TrimRight(",");
  5280. strarray.Add(phone);
  5281. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
  5282. strarray.Add(m_ren);
  5283. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  5284. for (i = 7; i <= 12; i++)
  5285. {
  5286. StrRect = load3.m_rcarray.ElementAt(i - 1);
  5287. StrRect.left += 4;
  5288. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5289. }
  5290. StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
  5291. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5292. StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
  5293. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5294. StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
  5295. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5296. //////////////////////////////
  5297. //开始画文字
  5298. StrRect = load2.m_rcarray.ElementAt(30);
  5299. StrRect.left += 3;
  5300. StrRect.top += 3;
  5301. StrRect.right -= 2;
  5302. StrRect.bottom -= 2;
  5303. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5304. StrRect = load2.m_rcarray.ElementAt(29);
  5305. StrRect.left += 3;
  5306. StrRect.top += 3;
  5307. StrRect.right -= 2;
  5308. StrRect.bottom -= 2;
  5309. str = "";
  5310. for (i = 0; i < sparray.GetSize(); i++)
  5311. {
  5312. str += sparray.ElementAt(i).ElementAt(5);
  5313. str += " 数量:";
  5314. str += sparray.ElementAt(i).ElementAt(3);
  5315. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5316. str += "\r\n";
  5317. }
  5318. str.TrimRight("\r\n");
  5319. AutoDraw(m_Print, StrRect, str, 1.4);
  5320. StrRect = load2.m_rcarray.ElementAt(40);
  5321. StrRect.top += 8;
  5322. m_Print.SetFontFace(12, 1, "黑体");
  5323. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5324. StrRect.left += 3;
  5325. StrRect.top += 30;
  5326. StrRect.right -= 2;
  5327. StrRect.bottom -= 2;
  5328. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5329. if (str.IsEmpty())
  5330. {
  5331. str = "\
  5332. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5333. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5334. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5335. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5336. 持良好的心境.\r\n\
  5337. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5338. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5339. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5340. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5341. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5342. 勿进影室, 以免影响拍摄.\r\n\
  5343. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5344. 师或店长沟通.\r\n\
  5345. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5346. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5347. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5348. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5349. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5350. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5351. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5352. 还.";
  5353. }
  5354. AutoDraw(m_Print, StrRect, str, 1.8);
  5355. }
  5356. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 1)
  5357. {//AfxMessageBox("yyy");
  5358. m_Print.StartPrint();
  5359. m_Print.StartPage();
  5360. LoadRect load;
  5361. load.SetLiaPath("6-2.lia");
  5362. load.SetMargins(0, 0);
  5363. if (!load.Load())return;
  5364. int i;
  5365. //////////////////////////////////////////////////////////////
  5366. CStringArray txarray;
  5367. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
  5368. g_sendhead.code[0] = 11;
  5369. g_sendhead.code[1] = 52;
  5370. g_sendhead.code[2] = 50;
  5371. g_sendhead.code[3] = 150;
  5372. g_sendhead.code[4] = 77;
  5373. g_sendhead.code[5] = 4;
  5374. g_sendhead.tabcount = 6;
  5375. g_sendhead.bsql = 0;
  5376. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5377. CArray<CStringArray, CStringArray>sparray;
  5378. CArray<CStringArray, CStringArray>clientarray;
  5379. CArray<CStringArray, CStringArray>phonearray;
  5380. CArray<CStringArray, CStringArray>fgarray;
  5381. CArray<CStringArray, CStringArray>danweiarray;
  5382. CArray<CStringArray, CStringArray>jdarray;
  5383. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5384. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5385. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5386. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5387. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5388. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5389. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  5390. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5391. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5392. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5393. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5394. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5395. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5396. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5397. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5398. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5399. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5400. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  5401. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  5402. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  5403. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  5404. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  5405. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  5406. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  5407. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  5408. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  5409. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  5410. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  5411. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  5412. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5413. if (jdarray.GetSize())
  5414. {
  5415. if (m_bz.IsEmpty() == 0)
  5416. m_bz = "\r\n" + m_bz;
  5417. m_bz += "景点:";
  5418. }
  5419. for (i = 0; i < jdarray.GetSize(); i++)
  5420. {
  5421. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  5422. }
  5423. m_bz.TrimRight(";");
  5424. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  5425. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  5426. if (IsHasRights2new(31) == 0)
  5427. {
  5428. m_phone1 = "***";
  5429. m_phone2 = "***";
  5430. }
  5431. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5432. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5433. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  5434. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  5435. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  5436. CString str;
  5437. filter = "name='" + m_ren + "'";
  5438. g_sendhead.code[0] = 5;
  5439. g_sendhead.tabcount = 1;
  5440. g_sendhead.bsql = 0;
  5441. int g_nYearposTemp = g_nYearpos;
  5442. g_nYearpos = -1;
  5443. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5444. g_nYearpos = g_nYearposTemp;
  5445. if (g_bSendOK == 0)return;
  5446. DataToArray(&phonearray);
  5447. m_money1.Format("%f", atof(m_taoxijiage));
  5448. m_money2.Format("%f", atof(m_payed1));
  5449. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5450. ConvertToPrice(m_money1);
  5451. ConvertToPrice(m_money2);
  5452. ConvertToPrice(m_money3);
  5453. ////////////////////////////////////////////////////////////////
  5454. int rcpos = -1;
  5455. CRect StrRect = load.m_rcarray.ElementAt(0);
  5456. m_Print.SetFontFace(25, 1, "黑体");
  5457. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "预约单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5458. m_Print.SetFontFace(11, 1, "宋体");
  5459. StrRect = load.m_rcarray.ElementAt(1);
  5460. if (m_time1.GetLength() == 10)
  5461. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  5462. else
  5463. str = "开单日期:";
  5464. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5465. StrRect = load.m_rcarray.ElementAt(2);
  5466. m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + strOrderNumber), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5467. CStringArray strarray;
  5468. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5469. {
  5470. Image *pImg = NULL;
  5471. g_nSendCode = 31;
  5472. int g_nYearposTemp = g_nYearpos;
  5473. g_nYearpos = -1;
  5474. g_pMainWnd->ProcessChatMessageRequest2(1);
  5475. g_nYearpos = g_nYearposTemp;
  5476. g_nSendCode = 0;
  5477. if (g_bSendOK == 0)return;
  5478. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  5479. if (pImg)
  5480. {
  5481. StrRect.left = 47;
  5482. StrRect.top = 12;
  5483. StrRect.right = StrRect.left + 60;
  5484. StrRect.bottom = StrRect.top + 60;
  5485. m_Print.DrawImage(pImg, StrRect);
  5486. delete pImg; pImg = NULL;
  5487. }
  5488. }
  5489. #ifdef CHILD_VERSION
  5490. strarray.Add("家长姓名");
  5491. strarray.Add("宝宝姓名");
  5492. #else
  5493. strarray.Add("先生姓名");
  5494. strarray.Add("女士姓名");
  5495. #endif
  5496. strarray.Add("服装套数");
  5497. // strarray.Add ("拍摄张数");
  5498. #ifdef CHILD_VERSION
  5499. strarray.Add("出生日期");
  5500. #else
  5501. strarray.Add("结婚日期");
  5502. #endif
  5503. strarray.Add("拍摄日期");
  5504. strarray.Add("联系电话");
  5505. strarray.Add("联系电话");
  5506. strarray.Add("造型套数");
  5507. if (m_zs.Find("\\") != -1)
  5508. strarray.Add("入底\\入册");
  5509. else
  5510. strarray.Add("入底张数");
  5511. strarray.Add("选片日期");
  5512. strarray.Add("QQ/邮箱");
  5513. strarray.Add("套系总额");
  5514. strarray.Add("定金");
  5515. strarray.Add("余款金额");
  5516. strarray.Add("取件日期");
  5517. strarray.Add(m_name1);
  5518. strarray.Add(m_name2);
  5519. strarray.Add(m_clothescount);
  5520. // str.Format("%d", atoi(m_zs)*3);
  5521. // strarray.Add (str);
  5522. #ifdef CHILD_VERSION
  5523. strarray.Add(m_birthday1);
  5524. #else
  5525. strarray.Add(m_time3);
  5526. #endif
  5527. strarray.Add(m_time2);
  5528. strarray.Add(m_phone1);
  5529. strarray.Add(m_phone2);
  5530. strarray.Add(m_clothescount2);
  5531. strarray.Add(m_zs);
  5532. strarray.Add(m_time4);
  5533. strarray.Add(m_qq1);
  5534. strarray.Add(m_money1);
  5535. strarray.Add(m_money2);
  5536. strarray.Add(m_money3);
  5537. strarray.Add(m_time5);
  5538. for (i = 4; i <= 33; i++)
  5539. {
  5540. StrRect = load.m_rcarray.ElementAt(i - 1);
  5541. m_Print.DrawRect2(StrRect, 1);
  5542. if (strarray.GetSize() > (i - 4))
  5543. {
  5544. if (i <= 18)
  5545. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5546. else
  5547. {
  5548. StrRect.left += 4;
  5549. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5550. }
  5551. }
  5552. }
  5553. int dt = 413;
  5554. StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5555. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5556. StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5557. StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5558. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5559. StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5560. StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
  5561. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5562. StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
  5563. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5564. StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
  5565. m_Print.DrawText((LPTSTR)(LPCTSTR)("网址:" + g_cominfoarray.ElementAt(0).ElementAt(13)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5566. //////////////////////////////
  5567. //开始画文字
  5568. StrRect = load.m_rcarray.ElementAt(7);
  5569. int hei = StrRect.Height();
  5570. StrRect.top += hei;
  5571. StrRect.bottom += hei;
  5572. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5573. StrRect.top += dt;
  5574. StrRect.bottom += dt;
  5575. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5576. StrRect = load.m_rcarray.ElementAt(17);
  5577. StrRect.top += hei;
  5578. StrRect.bottom += hei;
  5579. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5580. StrRect = load.m_rcarray.ElementAt(33);
  5581. StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
  5582. StrRect.top += hei;
  5583. StrRect.left += 3;
  5584. StrRect.top += 3;
  5585. StrRect.right -= 2;
  5586. StrRect.bottom -= 2;
  5587. str = "";
  5588. for (i = 0; i < sparray.GetSize(); i++)
  5589. {
  5590. str += sparray.ElementAt(i).ElementAt(5);
  5591. str += " 数量:";
  5592. str += sparray.ElementAt(i).ElementAt(3);
  5593. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5594. str += "\r\n";
  5595. }
  5596. str.TrimRight("\r\n");
  5597. AutoDraw(m_Print, StrRect, str, 1.4);
  5598. StrRect = load.m_rcarray.ElementAt(33);
  5599. StrRect.top += dt;
  5600. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  5601. StrRect.top += hei;
  5602. StrRect.left += 3;
  5603. StrRect.top += 3;
  5604. StrRect.right -= 2;
  5605. StrRect.bottom -= 2;
  5606. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5607. StrRect = load.m_rcarray.ElementAt(34);
  5608. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  5609. StrRect.top += hei;
  5610. StrRect.left += 3;
  5611. StrRect.top += 3;
  5612. StrRect.right -= 2;
  5613. StrRect.bottom -= 2;
  5614. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5615. if (str.IsEmpty())
  5616. {
  5617. str = "\
  5618. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5619. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5620. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5621. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5622. 持良好的心境.\r\n\
  5623. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5624. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5625. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5626. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5627. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5628. 勿进影室, 以免影响拍摄.\r\n\
  5629. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5630. 师或店长沟通.\r\n\
  5631. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5632. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5633. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5634. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5635. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5636. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5637. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5638. 还.";
  5639. }
  5640. AutoDraw(m_Print, StrRect, str, 1.8);
  5641. StrRect = load.m_rcarray.ElementAt(35);
  5642. StrRect.bottom += 100;
  5643. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  5644. 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∨";
  5645. // AutoDraw(m_Print, StrRect, str, 1.4);
  5646. }
  5647. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 2)
  5648. {
  5649. PrintDinDan5(strOrderNumber);
  5650. return;
  5651. }
  5652. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
  5653. {
  5654. PrintDinDan6(strOrderNumber);
  5655. return;
  5656. }
  5657. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  5658. dlg.m_pDC = m_Print.GetPDC();
  5659. dlg.m_mode = 1;
  5660. if (aa == 0)
  5661. {
  5662. if (dlg.DoModal() != IDOK)
  5663. return;
  5664. printcot = dlg.m_num;
  5665. }
  5666. //结束打印
  5667. m_Print.EndPage();
  5668. m_Print.EndPrint();
  5669. }
  5670. }
  5671. void CovertDate2(CString date, CString &date2)
  5672. {
  5673. try
  5674. {
  5675. if (date == "2013-04-09")
  5676. {
  5677. date2 = "2013-02-29";
  5678. return;
  5679. }
  5680. ///////////////////////////////////
  5681. date2 = date;
  5682. GongToLong(date2);
  5683. ////////////////////////////////////
  5684. return;
  5685. CCalendarConvert m_CalendarConvert;
  5686. SYSTEMTIME src = { 0 };
  5687. SYSTEMTIME dst = { 0 };
  5688. COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0);
  5689. COleDateTime m_timeGregorian;
  5690. m_timeLunar.GetAsSystemTime(src);
  5691. BOOL bEmbolism = 0;
  5692. if (m_CalendarConvert.Gregorian2Lunar(&src, &dst, &bEmbolism))
  5693. {
  5694. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst);
  5695. date2.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay());
  5696. if (m_timeGregorian.GetYear() == -1)date2 = "2000-13-32";
  5697. }
  5698. else
  5699. {
  5700. date2.Empty();
  5701. }
  5702. }
  5703. catch (...)
  5704. {
  5705. }
  5706. }
  5707. void CMainFrame::PrintDinDan5(CString m_id)
  5708. {
  5709. int printcot = 1;
  5710. for (int aa = 0; aa < printcot; aa++)
  5711. {
  5712. PrintPreview dlg;
  5713. CPrintRX m_Print;
  5714. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  5715. {
  5716. m_Print.InitToPrint(NULL, 1);
  5717. }
  5718. else
  5719. {
  5720. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  5721. if (name.IsEmpty())
  5722. m_Print.InitToPrint(NULL, 1);
  5723. else
  5724. {
  5725. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  5726. if (nret == -1 && aa == 0)
  5727. {
  5728. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  5729. }
  5730. }
  5731. }
  5732. {
  5733. m_Print.StartPrint();
  5734. m_Print.StartPage();
  5735. LoadRect load;
  5736. load.SetLiaPath("19.lia");
  5737. load.SetMargins(0, -20);
  5738. if (!load.Load())return;
  5739. int i;
  5740. //////////////////////////////////////////////////////////////
  5741. CStringArray txarray;
  5742. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  5743. g_sendhead.code[0] = 11;
  5744. g_sendhead.code[1] = 52;
  5745. g_sendhead.code[2] = 50;
  5746. g_sendhead.code[3] = 150;
  5747. g_sendhead.code[4] = 77;
  5748. g_sendhead.code[5] = 4;
  5749. g_sendhead.tabcount = 6;
  5750. g_sendhead.bsql = 0;
  5751. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5752. CArray<CStringArray, CStringArray>sparray;
  5753. CArray<CStringArray, CStringArray>clientarray;
  5754. CArray<CStringArray, CStringArray>phonearray;
  5755. CArray<CStringArray, CStringArray>fgarray;
  5756. CArray<CStringArray, CStringArray>danweiarray;
  5757. CArray<CStringArray, CStringArray>jdarray;
  5758. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5759. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5760. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5761. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5762. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5763. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5764. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
  5765. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5766. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5767. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5768. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5769. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5770. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5771. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5772. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5773. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5774. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5775. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  5776. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  5777. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  5778. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  5779. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  5780. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  5781. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  5782. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  5783. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  5784. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  5785. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  5786. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(36);
  5787. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  5788. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5789. CString m_txtype = g_List1array.ElementAt(0).ElementAt(52);
  5790. CString m_memberno = g_List1array.ElementAt(0).ElementAt(47);
  5791. CString str;
  5792. if (jdarray.GetSize())
  5793. {
  5794. if (m_bz.IsEmpty() == 0)
  5795. m_bz = "\r\n" + m_bz;
  5796. m_bz += "景点:";
  5797. }
  5798. for (i = 0; i < jdarray.GetSize(); i++)
  5799. {
  5800. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  5801. }
  5802. m_bz.TrimRight(";");
  5803. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  5804. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  5805. if (IsHasRights2new(31) == 0)
  5806. {
  5807. m_phone1 = "***";
  5808. m_phone2 = "***";
  5809. }
  5810. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5811. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5812. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  5813. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  5814. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  5815. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  5816. BOOL check1 = atoi(clientarray.ElementAt(0).ElementAt(15));
  5817. filter = "name='" + m_ren + "'";
  5818. g_sendhead.code[0] = 5;
  5819. g_sendhead.tabcount = 1;
  5820. g_sendhead.bsql = 0;
  5821. int g_nYearposTemp = g_nYearpos;
  5822. g_nYearpos = -1;
  5823. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5824. g_nYearpos = g_nYearposTemp;
  5825. if (g_bSendOK == 0)return;
  5826. DataToArray(&phonearray);
  5827. m_money1.Format("%f", atof(m_taoxijiage));
  5828. m_money2.Format("%f", atof(m_payed1));
  5829. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5830. ConvertToPrice(m_money1);
  5831. ConvertToPrice(m_money2);
  5832. ConvertToPrice(m_money3);
  5833. ////////////////////////////////////////////////////////////////
  5834. int rcpos = -1;
  5835. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  5836. //Image *pImg=NULL;
  5837. // ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  5838. // m_Print.DrawImage(pImg, StrRect);
  5839. // delete pImg;
  5840. m_Print.SetFontFace(20, 1, "宋体");
  5841. StrRect = load.m_rcarray.ElementAt(1);
  5842. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "定单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5843. m_Print.SetFontFace(12, 1, "宋体");
  5844. StrRect = load.m_rcarray.ElementAt(2);
  5845. m_Print.DrawText((LPTSTR)(LPCTSTR)("NO." + m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5846. StrRect = load.m_rcarray.ElementAt(3);
  5847. str.Format("%s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  5848. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5849. StrRect = load.m_rcarray.ElementAt(4);
  5850. m_Print.DrawText((LPTSTR)(LPCTSTR)("联系人:" + m_name1), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5851. CStringArray strarray;
  5852. strarray.Add("姓名");
  5853. strarray.Add("性别");
  5854. strarray.Add("年龄");
  5855. strarray.Add("出生年月");
  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. for (i = 6; i <= 17; i++)
  5865. {
  5866. StrRect = load.m_rcarray.ElementAt(i - 1);
  5867. m_Print.DrawRect2(StrRect, 1);
  5868. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 6), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5869. }
  5870. strarray.RemoveAll();
  5871. strarray.Add(m_name2);
  5872. strarray.Add(m_sex);
  5873. if (m_birthday.GetLength() != 10)
  5874. strarray.Add("");
  5875. else
  5876. {
  5877. int year = 0;
  5878. if (check1)
  5879. {
  5880. CString date2;
  5881. CovertDate2(g_date, date2);
  5882. year = atoi(date2.Left(4)) - atoi(m_birthday.Left(4));
  5883. if (date2.Right(5) >= m_birthday.Right(5))
  5884. year++;
  5885. }
  5886. else
  5887. {
  5888. year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  5889. if (g_date.Right(5) >= m_birthday.Right(5))
  5890. year++;
  5891. }
  5892. str.Format("%d", year);
  5893. strarray.Add(str);
  5894. }
  5895. strarray.Add(m_birthday);
  5896. strarray.Add(m_money1);
  5897. strarray.Add(m_money2);
  5898. strarray.Add(m_money3);
  5899. strarray.Add(m_txtype);
  5900. strarray.Add(m_memberno);
  5901. strarray.Add(m_ren);
  5902. strarray.Add(m_zs);
  5903. if (!m_phone1.IsEmpty())
  5904. strarray.Add(m_phone1);
  5905. else
  5906. strarray.Add(m_phone2);
  5907. for (i = 18; i <= 29; i++)
  5908. {
  5909. StrRect = load.m_rcarray.ElementAt(i - 1);
  5910. m_Print.DrawRect2(StrRect, 1);
  5911. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5912. }
  5913. strarray.RemoveAll();
  5914. strarray.Add("摄影师");
  5915. strarray.Add("拍照时间");
  5916. strarray.Add("选片人");
  5917. strarray.Add("选片时间");
  5918. strarray.Add("引导师");
  5919. strarray.Add("设计师");
  5920. strarray.Add("取件时间");
  5921. strarray.Add("顾客签字");
  5922. for (i = 34; i <= 41; i++)
  5923. {
  5924. StrRect = load.m_rcarray.ElementAt(i - 1);
  5925. m_Print.DrawRect2(StrRect, 1);
  5926. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 34), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5927. }
  5928. strarray.RemoveAll();
  5929. strarray.Add(m_waiter1);
  5930. strarray.Add(m_time2);
  5931. strarray.Add(m_waiter3);
  5932. strarray.Add(m_time4);
  5933. strarray.Add(m_waiter2);
  5934. strarray.Add(m_waiter4);
  5935. strarray.Add(m_time5);
  5936. strarray.Add("");
  5937. for (i = 42; i <= 49; i++)
  5938. {
  5939. StrRect = load.m_rcarray.ElementAt(i - 1);
  5940. m_Print.DrawRect2(StrRect, 1);
  5941. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5942. }
  5943. m_Print.SetFontFace(15, 1, "宋体");
  5944. StrRect = load.m_rcarray.ElementAt(29);
  5945. m_Print.DrawRect2(StrRect, 1);
  5946. StrRect.top += 45;
  5947. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5948. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5949. m_Print.DrawText((LPTSTR)(LPCTSTR)"内", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5950. m_Print.DrawText((LPTSTR)(LPCTSTR)"容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5951. StrRect = load.m_rcarray.ElementAt(30);
  5952. m_Print.DrawRect2(StrRect, 1);
  5953. StrRect.top += 45;
  5954. m_Print.DrawText((LPTSTR)(LPCTSTR)"友", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5955. m_Print.DrawText((LPTSTR)(LPCTSTR)"情", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5956. m_Print.DrawText((LPTSTR)(LPCTSTR)"提", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5957. m_Print.DrawText((LPTSTR)(LPCTSTR)"示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5958. m_Print.SetFontFace(10, 1, "宋体");
  5959. StrRect = load.m_rcarray.ElementAt(37); StrRect.top = StrRect.bottom + 2;
  5960. str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  5961. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  5962. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  5963. StrRect = load.m_rcarray.ElementAt(48); StrRect.top = StrRect.bottom + 2; StrRect.left -= 200;
  5964. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  5965. //开始画文字
  5966. StrRect = load.m_rcarray.ElementAt(31);
  5967. StrRect.left += 3;
  5968. StrRect.top += 3;
  5969. StrRect.right -= 2;
  5970. StrRect.bottom -= 2;
  5971. str = "";
  5972. for (i = 0; i < sparray.GetSize(); i++)
  5973. {
  5974. str += sparray.ElementAt(i).ElementAt(5);
  5975. str += " 数量:";
  5976. str += sparray.ElementAt(i).ElementAt(3);
  5977. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5978. str += "\r\n";
  5979. }
  5980. str.TrimRight("\r\n");
  5981. m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5982. m_bz.TrimLeft();
  5983. if (m_bz != "")
  5984. {
  5985. str += "\r\n"; str += "\r\n";
  5986. str += "备注:" + m_bz;
  5987. }
  5988. AutoDraw(m_Print, StrRect, str, 1.4);
  5989. StrRect = load.m_rcarray.ElementAt(32); m_Print.DrawRect2(StrRect, 1);
  5990. StrRect.left += 3;
  5991. StrRect.top += 3;
  5992. StrRect.right -= 2;
  5993. StrRect.bottom -= 2;
  5994. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5995. if (str.IsEmpty())
  5996. {
  5997. str = "\
  5998. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5999. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6000. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6001. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6002. 持良好的心境.\r\n\
  6003. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6004. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6005. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6006. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6007. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6008. 勿进影室, 以免影响拍摄.\r\n\
  6009. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6010. 师或店长沟通.\r\n\
  6011. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6012. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6013. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6014. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6015. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6016. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6017. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6018. 还.";
  6019. }
  6020. AutoDraw(m_Print, StrRect, str, 1.8);
  6021. }
  6022. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6023. dlg.m_pDC = m_Print.GetPDC();
  6024. dlg.m_mode = 1;
  6025. if (aa == 0)
  6026. {
  6027. if (dlg.DoModal() != IDOK)
  6028. return;
  6029. printcot = dlg.m_num;
  6030. }
  6031. //结束打印
  6032. m_Print.EndPage();
  6033. m_Print.EndPrint();
  6034. }
  6035. }
  6036. void CMainFrame::PrintDinDan4(CString m_id)
  6037. {
  6038. // TODO: Add your control notification handler code here
  6039. CPrintRX m_Print;
  6040. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6041. {
  6042. m_Print.InitToPrint(NULL, 1);
  6043. }
  6044. else
  6045. {
  6046. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  6047. if (name.IsEmpty())
  6048. m_Print.InitToPrint(NULL, 1);
  6049. else
  6050. {
  6051. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6052. if (nret == -1)
  6053. {
  6054. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6055. }
  6056. }
  6057. }
  6058. m_Print.StartPrint();
  6059. m_Print.StartPage();
  6060. LoadRect load;
  6061. load.SetLiaPath("6-2.lia");
  6062. load.SetMargins(0, 0);
  6063. if (!load.Load())return;
  6064. int i;
  6065. //////////////////////////////////////////////////////////////
  6066. CStringArray txarray;
  6067. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  6068. g_sendhead.code[0] = 11;
  6069. g_sendhead.code[1] = 52;
  6070. g_sendhead.code[2] = 50;
  6071. g_sendhead.code[3] = 150;
  6072. g_sendhead.code[4] = 77;
  6073. g_sendhead.code[5] = 4;
  6074. g_sendhead.tabcount = 6;
  6075. g_sendhead.bsql = 0;
  6076. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  6077. CArray<CStringArray, CStringArray>sparray;
  6078. CArray<CStringArray, CStringArray>clientarray;
  6079. CArray<CStringArray, CStringArray>phonearray;
  6080. CArray<CStringArray, CStringArray>fgarray;
  6081. CArray<CStringArray, CStringArray>danweiarray;
  6082. CArray<CStringArray, CStringArray>jdarray;
  6083. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  6084. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  6085. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  6086. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  6087. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  6088. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  6089. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  6090. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  6091. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  6092. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  6093. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  6094. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  6095. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  6096. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  6097. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  6098. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  6099. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  6100. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  6101. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  6102. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  6103. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  6104. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  6105. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  6106. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  6107. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  6108. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  6109. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  6110. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  6111. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  6112. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  6113. if (jdarray.GetSize())
  6114. {
  6115. if (m_bz.IsEmpty() == 0)
  6116. m_bz = "\r\n" + m_bz;
  6117. m_bz += "景点:";
  6118. }
  6119. for (i = 0; i < jdarray.GetSize(); i++)
  6120. {
  6121. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  6122. }
  6123. m_bz.TrimRight(";");
  6124. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  6125. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  6126. if (IsHasRights2new(31) == 0)
  6127. {
  6128. m_phone1 = "***";
  6129. m_phone2 = "***";
  6130. }
  6131. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  6132. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  6133. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  6134. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  6135. CString str;
  6136. filter = "name='" + m_ren + "'";
  6137. g_sendhead.code[0] = 5;
  6138. g_sendhead.tabcount = 1;
  6139. g_sendhead.bsql = 0;
  6140. int g_nYearposTemp = g_nYearpos;
  6141. g_nYearpos = -1;
  6142. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6143. g_nYearpos = g_nYearposTemp;
  6144. if (g_bSendOK == 0)return;
  6145. DataToArray(&phonearray);
  6146. m_money1.Format("%f", atof(m_taoxijiage));
  6147. m_money2.Format("%f", atof(m_payed1));
  6148. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  6149. ConvertToPrice(m_money1);
  6150. ConvertToPrice(m_money2);
  6151. ConvertToPrice(m_money3);
  6152. ////////////////////////////////////////////////////////////////
  6153. int rcpos = -1;
  6154. CRect StrRect = load.m_rcarray.ElementAt(0);
  6155. m_Print.SetFontFace(25, 1, "黑体");
  6156. m_Print.DrawText((LPTSTR)(LPCTSTR)"巴黎春天婚纱摄影预约单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6157. m_Print.SetFontFace(11, 1, "宋体");
  6158. StrRect = load.m_rcarray.ElementAt(1);
  6159. if (m_time1.GetLength() == 10)
  6160. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  6161. else
  6162. str = "开单日期:";
  6163. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6164. StrRect = load.m_rcarray.ElementAt(2);
  6165. m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + m_id), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6166. CStringArray strarray;
  6167. strarray.Add("先生姓名");
  6168. strarray.Add("女士姓名");
  6169. strarray.Add("服装套数");
  6170. strarray.Add("拍摄张数");
  6171. strarray.Add("拍摄日期");
  6172. strarray.Add("联系电话");
  6173. strarray.Add("联系电话");
  6174. strarray.Add("造型套数");
  6175. strarray.Add("入册张数");
  6176. strarray.Add("选片日期");
  6177. strarray.Add("QQ/邮箱");
  6178. strarray.Add("套系总额");
  6179. strarray.Add("定金");
  6180. strarray.Add("余款金额");
  6181. strarray.Add("取件日期");
  6182. strarray.Add(m_name1);
  6183. strarray.Add(m_name2);
  6184. strarray.Add(m_clothescount);
  6185. str.Format("%d", atoi(m_zs) * 3);
  6186. strarray.Add(str);
  6187. strarray.Add(m_time2);
  6188. strarray.Add(m_phone1);
  6189. strarray.Add(m_phone2);
  6190. strarray.Add(m_clothescount2);
  6191. strarray.Add(m_zs);
  6192. strarray.Add(m_time4);
  6193. strarray.Add(m_qq1);
  6194. strarray.Add(m_money1);
  6195. strarray.Add(m_money2);
  6196. strarray.Add(m_money3);
  6197. strarray.Add(m_time5);
  6198. for (i = 4; i <= 33; i++)
  6199. {
  6200. StrRect = load.m_rcarray.ElementAt(i - 1);
  6201. m_Print.DrawRect2(StrRect, 1);
  6202. if (strarray.GetSize() > (i - 4))
  6203. {
  6204. if (i <= 18)
  6205. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6206. else
  6207. {
  6208. StrRect.left += 4;
  6209. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6210. }
  6211. }
  6212. }
  6213. int dt = 413;
  6214. StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6215. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6216. StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6217. StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6218. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6219. StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6220. StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
  6221. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址:深圳市红岭中路中深国际大厦首层,二十二层", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6222. StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
  6223. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:0755-61308198 61308199 25860696 25860697", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6224. StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
  6225. m_Print.DrawText((LPTSTR)(LPCTSTR)"网址:www.paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6226. StrRect = load.m_rcarray.ElementAt(43); StrRect.top += dt; StrRect.bottom += dt;
  6227. m_Print.DrawText((LPTSTR)(LPCTSTR)"邮箱:blct@paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6228. //////////////////////////////
  6229. //开始画文字
  6230. StrRect = load.m_rcarray.ElementAt(7);
  6231. int hei = StrRect.Height();
  6232. StrRect.top += hei;
  6233. StrRect.bottom += hei;
  6234. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6235. StrRect.top += dt;
  6236. StrRect.bottom += dt;
  6237. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6238. StrRect = load.m_rcarray.ElementAt(17);
  6239. StrRect.top += hei;
  6240. StrRect.bottom += hei;
  6241. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6242. StrRect = load.m_rcarray.ElementAt(33);
  6243. StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
  6244. StrRect.top += hei;
  6245. StrRect.left += 3;
  6246. StrRect.top += 3;
  6247. StrRect.right -= 2;
  6248. StrRect.bottom -= 2;
  6249. str = "";
  6250. for (i = 0; i < sparray.GetSize(); i++)
  6251. {
  6252. str += sparray.ElementAt(i).ElementAt(5);
  6253. str += " 数量:";
  6254. str += sparray.ElementAt(i).ElementAt(3);
  6255. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  6256. str += "\r\n";
  6257. }
  6258. str.TrimRight("\r\n");
  6259. AutoDraw(m_Print, StrRect, str, 1.4);
  6260. StrRect = load.m_rcarray.ElementAt(33);
  6261. StrRect.top += dt;
  6262. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  6263. StrRect.top += hei;
  6264. StrRect.left += 3;
  6265. StrRect.top += 3;
  6266. StrRect.right -= 2;
  6267. StrRect.bottom -= 2;
  6268. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6269. StrRect = load.m_rcarray.ElementAt(34);
  6270. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  6271. StrRect.top += hei;
  6272. StrRect.left += 3;
  6273. StrRect.top += 3;
  6274. StrRect.right -= 2;
  6275. StrRect.bottom -= 2;
  6276. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  6277. if (str.IsEmpty())
  6278. {
  6279. str = "\
  6280. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6281. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6282. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6283. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6284. 持良好的心境.\r\n\
  6285. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6286. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6287. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6288. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6289. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6290. 勿进影室, 以免影响拍摄.\r\n\
  6291. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6292. 师或店长沟通.\r\n\
  6293. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6294. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6295. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6296. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6297. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6298. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6299. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6300. 还.";
  6301. }
  6302. AutoDraw(m_Print, StrRect, str, 1.8);
  6303. StrRect = load.m_rcarray.ElementAt(35);
  6304. StrRect.bottom += 100;
  6305. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  6306. 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∨";
  6307. AutoDraw(m_Print, StrRect, str, 1.4);
  6308. PrintPreview dlg;
  6309. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6310. dlg.m_pDC = m_Print.GetPDC();
  6311. if (dlg.DoModal() != IDOK)return;
  6312. //结束打印
  6313. m_Print.EndPage();
  6314. m_Print.EndPrint();
  6315. }
  6316. int CalHeight_01(CRect &rc, CStringArray *saContent, CPrintRX *Print, int FORMAT)
  6317. {
  6318. CSize size;
  6319. int nMaxheight = 0;
  6320. CString strTemp;
  6321. CString strContent;
  6322. int nSize = saContent->GetSize();
  6323. int nRow = 0; // 行数;
  6324. for (int i = 0; i < nSize; i++)
  6325. {
  6326. strTemp = "";
  6327. strContent = saContent->ElementAt(i);
  6328. while (FALSE == strContent.IsEmpty())
  6329. {
  6330. strContent = strContent.Mid(strTemp.GetLength());
  6331. if (strContent.IsEmpty())
  6332. break;
  6333. Print->GetStrSize((LPTSTR)(LPCTSTR)strContent, size);
  6334. if (size.cx <= rc.Width())
  6335. {
  6336. CRect rc2 = rc;
  6337. rc2.top += nRow*(size.cy + 1);
  6338. rc2.bottom = rc2.top + (size.cy + 1);
  6339. Print->DrawText((LPTSTR)(LPCTSTR)strContent, rc2, 0, 0, FORMAT | FORMAT_UP);
  6340. nMaxheight = max(nMaxheight, rc2.bottom);
  6341. nRow++;
  6342. break;
  6343. }
  6344. int right = 0;
  6345. while (size.cx > rc.Width())
  6346. {
  6347. right++;
  6348. strTemp = strContent.Left(strContent.GetLength() - (right));
  6349. if (GIsHalfHZ(strTemp))
  6350. {
  6351. right++;
  6352. strTemp.Delete(strTemp.GetLength() - 1);
  6353. }
  6354. Print->GetStrSize((LPTSTR)(LPCTSTR)strTemp, size);
  6355. }
  6356. CRect rc2 = rc;
  6357. rc2.top += nRow*(size.cy + 1);
  6358. rc2.bottom = rc2.top + (size.cy + 1);
  6359. Print->DrawText((LPTSTR)(LPCTSTR)strTemp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6360. nRow++;
  6361. nMaxheight = max(nMaxheight, rc2.bottom);
  6362. }
  6363. }
  6364. return (nMaxheight == 0) ? (rc.bottom + 1) : (nMaxheight + 1);
  6365. }
  6366. int CalHeight(CArray<CRect, CRect>*rcarray, CStringArray *strarray2, CPrintRX *Print, int FORMAT)
  6367. {
  6368. CSize size;
  6369. CString str, temp;
  6370. CRect rc;
  6371. int maxhei = 1;
  6372. int fonthei;
  6373. for (int i = 0; i < rcarray->GetSize(); i++)
  6374. {
  6375. rc = rcarray->ElementAt(i);
  6376. maxhei = max(maxhei, rc.bottom);
  6377. str = strarray2->ElementAt(i);
  6378. temp.Empty();
  6379. int hei = 0;
  6380. while (str.IsEmpty() == 0)
  6381. {
  6382. str = str.Right(str.GetLength() - temp.GetLength());
  6383. if (str.IsEmpty())break;
  6384. Print->GetStrSize((LPTSTR)(LPCTSTR)str, size);
  6385. fonthei = size.cy + 1;
  6386. if (size.cx <= rc.Width())
  6387. {
  6388. CRect rc2 = rc;
  6389. rc2.top += hei*fonthei;
  6390. rc2.bottom = rc2.top + fonthei;
  6391. Print->DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT | FORMAT_UP);
  6392. //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6393. maxhei = max(maxhei, rc2.bottom);
  6394. break;
  6395. }
  6396. int right = 0;
  6397. while (size.cx > rc.Width())
  6398. {
  6399. right++;
  6400. temp = str.Left(str.GetLength() - (right));
  6401. if (GIsHalfHZ(temp))
  6402. {
  6403. right++;
  6404. temp.Delete(temp.GetLength() - 1);
  6405. }
  6406. Print->GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  6407. }
  6408. CRect rc2 = rc;
  6409. rc2.top += hei*fonthei;
  6410. rc2.bottom = rc2.top + fonthei;
  6411. Print->DrawText((LPTSTR)(LPCTSTR)temp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6412. hei++;
  6413. maxhei = max(maxhei, rc2.bottom);
  6414. }
  6415. }
  6416. return maxhei + 1;
  6417. }
  6418. /* CPrintRX m_Print;
  6419. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6420. {
  6421. m_Print.InitToPrint(NULL, 1);
  6422. }
  6423. else
  6424. {
  6425. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  6426. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6427. if(nret==-1)
  6428. {
  6429. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6430. }
  6431. }
  6432. m_Print.StartPrint();
  6433. m_Print.StartPage();
  6434. LoadRect load;
  6435. load.SetLiaPath ("6.lia");
  6436. load.SetMargins(-14,35);
  6437. if(!load.Load ())return;
  6438. LoadRect load2;
  6439. load2.SetLiaPath ("7.lia");
  6440. load2.SetMargins(-14,216+35);
  6441. if(!load2.Load ())return;
  6442. LoadRect load3;
  6443. load3.SetLiaPath ("8.lia");
  6444. load3.SetMargins(-14,705+35);
  6445. if(!load3.Load ())return;
  6446. int i;
  6447. //////////////////////////////////////////////////////////////
  6448. CStringArray txarray;
  6449. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册';";
  6450. g_sendhead.code[0]=11;
  6451. g_sendhead.code[1]=52;
  6452. g_sendhead.code[2]=50;
  6453. g_sendhead.code[3]=77;
  6454. g_sendhead.tabcount=4;
  6455. g_sendhead.bsql=0;
  6456. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  6457. CArray<CStringArray, CStringArray>sparray;
  6458. CArray<CStringArray, CStringArray>clientarray;
  6459. CArray<CStringArray, CStringArray>phonearray;
  6460. CArray<CStringArray, CStringArray>fgarray;
  6461. DataToArray(&g_List1array, &clientarray, &sparray, &fgarray);
  6462. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  6463. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  6464. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  6465. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  6466. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  6467. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  6468. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  6469. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  6470. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  6471. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  6472. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  6473. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  6474. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  6475. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  6476. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  6477. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  6478. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  6479. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  6480. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  6481. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  6482. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  6483. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  6484. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  6485. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  6486. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  6487. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  6488. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  6489. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  6490. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6491. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  6492. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  6493. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  6494. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  6495. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  6496. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  6497. filter="name='"+m_ren+"'";
  6498. g_sendhead.code[0]=5;
  6499. g_sendhead.tabcount=1;
  6500. g_sendhead.bsql=0;
  6501. int g_nYearposTemp=g_nYearpos;
  6502. g_nYearpos=-1;
  6503. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6504. g_nYearpos=g_nYearposTemp;
  6505. if(g_bSendOK==0)return;
  6506. DataToArray(&phonearray);
  6507. m_money1.Format ("%f", atof(m_taoxijiage));
  6508. m_money2.Format ("%f", atof(m_payed1));
  6509. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  6510. ConvertToPrice(m_money1);
  6511. ConvertToPrice(m_money2);
  6512. ConvertToPrice(m_money3);
  6513. ////////////////////////////////////////////////////////////////
  6514. int rcpos=-1;
  6515. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6516. StrRect.top -=15;StrRect.bottom -=15;
  6517. Image *pImg=NULL;
  6518. #ifdef MNLS_VERSION
  6519. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  6520. #else
  6521. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  6522. #endif
  6523. m_Print.DrawImage(pImg, StrRect);
  6524. delete pImg;
  6525. m_Print.SetFontFace(11, 1, "宋体");
  6526. StrRect=load.m_rcarray .ElementAt (20);
  6527. StrRect.right=load.m_rcarray .ElementAt (23).right;
  6528. StrRect.top -=18;StrRect.bottom -=18;
  6529. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  6530. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6531. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  6532. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6533. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6534. StrRect.top -=15;StrRect.bottom -=15;
  6535. #ifdef MNLS_VERSION
  6536. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6537. #endif
  6538. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6539. StrRect.top -=15;StrRect.bottom -=15;
  6540. #ifdef MNLS_VERSION
  6541. m_Print.DrawRect(StrRect);
  6542. #endif
  6543. m_Print.SetFontFace(7, 1, "黑体");
  6544. m_Print.SetColor(0xffffff);
  6545. #ifdef MNLS_VERSION
  6546. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6547. #endif
  6548. m_Print.SetColor(0);
  6549. m_Print.SetFontFace(15, 1, "宋体");
  6550. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6551. StrRect.top -=15;StrRect.bottom -=15;
  6552. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6553. CStringArray strarray;
  6554. strarray.Add("NO: "+m_id);
  6555. CString date;
  6556. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  6557. strarray.Add(date);
  6558. strarray.Add("喜爱");
  6559. strarray.Add("格调");
  6560. if(fgarray.GetSize ()==12)
  6561. {
  6562. for(int i=0; i<12; i++)
  6563. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  6564. }
  6565. else
  6566. {
  6567. strarray.Add("复古典雅");
  6568. strarray.Add("温文尔雅");
  6569. strarray.Add("豪华艳丽");
  6570. strarray.Add("传统大方");
  6571. strarray.Add("新潮个性");
  6572. strarray.Add("浪漫奔放");
  6573. strarray.Add("简单素雅");
  6574. strarray.Add("活泼俏丽");
  6575. strarray.Add("妩媚温馨");
  6576. strarray.Add("温柔贤惠");
  6577. strarray.Add("成熟感性");
  6578. strarray.Add("清纯可爱");
  6579. }
  6580. strarray.Add("姓名");
  6581. strarray.Add("");
  6582. strarray.Add("电话");
  6583. strarray.Add("QQ/邮箱");
  6584. #ifdef CHILD_VERSION
  6585. strarray.Add("家长");
  6586. strarray.Add("宝宝");
  6587. #else
  6588. strarray.Add("先生");
  6589. strarray.Add("女士");
  6590. #endif
  6591. m_Print.SetFontFace(11, 1, "宋体");
  6592. for( i=0; i<strarray.GetSize (); i++)
  6593. {
  6594. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6595. if(i<2)
  6596. {
  6597. StrRect.top -=15;StrRect.bottom -=15;
  6598. }
  6599. if(i>15)
  6600. {
  6601. if(i==18)
  6602. StrRect.right-=80;
  6603. else if(i==19)
  6604. StrRect.left-=80;
  6605. m_Print.DrawRect2(StrRect, 1);
  6606. }
  6607. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6608. }
  6609. for( i=29; i<=40; i++)
  6610. {
  6611. if(m_style.GetLength ()<=(i-29))continue;
  6612. if(m_style.GetAt (i-29)!='1')continue;
  6613. StrRect=load.m_rcarray .ElementAt (i-1);
  6614. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6615. }
  6616. for( i=27; i<=48; i++)
  6617. {
  6618. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6619. if(i==45 || i==46)
  6620. StrRect.right-=80;
  6621. else if(i==47 || i==48)
  6622. StrRect.left-=80;
  6623. m_Print.DrawRect2(StrRect, 1);
  6624. }
  6625. /////////////////////////
  6626. strarray.RemoveAll ();
  6627. CString temp;
  6628. // temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  6629. strarray.Add (temp);
  6630. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  6631. strarray.Add (temp);
  6632. strarray.Add ("造型/");
  6633. strarray.Add ("服饰");
  6634. strarray.Add ("");
  6635. strarray.Add ("");
  6636. strarray.Add ("配");
  6637. strarray.Add ("置");
  6638. strarray.Add ("其");
  6639. strarray.Add ("它");
  6640. strarray.Add ("套系名称");
  6641. strarray.Add ("镜款");
  6642. strarray.Add ("套系总价");
  6643. strarray.Add ("拍摄张数");
  6644. strarray.Add ("选片日期");
  6645. strarray.Add ("定金");
  6646. strarray.Add ("入册张数");
  6647. strarray.Add ("");
  6648. strarray.Add ("欠款余额");
  6649. strarray.Add ("拍摄日期");
  6650. strarray.Add ("");
  6651. rcpos=-1;
  6652. for( i=0; i<strarray.GetSize (); i++)
  6653. {
  6654. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6655. if(i>9)
  6656. m_Print.DrawRect2(StrRect, 1);
  6657. if(i==1)
  6658. {
  6659. StrRect=load2.m_rcarray .ElementAt (21);StrRect.left +=4;
  6660. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6661. }
  6662. else if(i==6 || i==7)
  6663. {
  6664. StrRect.top -=25;
  6665. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6666. }
  6667. else
  6668. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6669. }
  6670. for( i=22; i<=41; i++)
  6671. {
  6672. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6673. if(rcpos==23 || rcpos==28)continue;
  6674. if(rcpos==24 || rcpos==29)
  6675. StrRect.top-=39;
  6676. m_Print.DrawRect2(StrRect, 1);
  6677. }
  6678. /////////////////////////////
  6679. strarray.RemoveAll ();
  6680. strarray.Add ("顾客签字:");
  6681. strarray.Add ("");
  6682. strarray.Add ("");
  6683. strarray.Add ("门市签字:");
  6684. strarray.Add ("");
  6685. strarray.Add ("");
  6686. rcpos=-1;
  6687. for( i=0; i<strarray.GetSize (); i++)
  6688. {
  6689. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6690. if(i==0 || i==3)
  6691. {
  6692. StrRect.bottom+=20;
  6693. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6694. }
  6695. }
  6696. for( i=7; i<=12; i++)
  6697. {
  6698. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6699. if(i==7 || i==10)
  6700. {
  6701. StrRect.bottom+=12;
  6702. m_Print.DrawRect2(StrRect, 2);
  6703. }
  6704. }
  6705. //////////////////////////////////////
  6706. //开始打数据
  6707. strarray.RemoveAll ();
  6708. strarray.Add (m_name1);
  6709. strarray.Add (m_name2);
  6710. strarray.Add ("");
  6711. strarray.Add ("");
  6712. strarray.Add (m_phone1);
  6713. #ifdef CHILD_VERSION
  6714. strarray.Add ("");
  6715. #else
  6716. strarray.Add (m_phone2);
  6717. #endif
  6718. strarray.Add (m_qq1);
  6719. strarray.Add (m_qq2);
  6720. for( i=41; i<=48; i++)
  6721. {
  6722. StrRect=load.m_rcarray .ElementAt (i-1);
  6723. StrRect.left +=4;
  6724. if(i==45 || i==46)
  6725. StrRect.right-=80;
  6726. else if(i==47 || i==48)
  6727. StrRect.left-=80;
  6728. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6729. }
  6730. ///////////////////////////////
  6731. strarray.RemoveAll ();
  6732. strarray.Add (m_money1);
  6733. str.Format("%d", atoi(m_zs)*2);
  6734. strarray.Add (str);
  6735. strarray.Add (m_time4);
  6736. strarray.Add (m_money2);
  6737. strarray.Add (m_zs);
  6738. strarray.Add ("");
  6739. strarray.Add (m_money3);
  6740. strarray.Add (m_time2);
  6741. strarray.Add ("");
  6742. for( i=32; i<=40; i++)
  6743. {
  6744. StrRect=load2.m_rcarray .ElementAt (i-1);
  6745. StrRect.left +=4;
  6746. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6747. }
  6748. ///////////////////////////////
  6749. strarray.RemoveAll ();
  6750. strarray.Add (m_name1);
  6751. strarray.Add (m_name2);
  6752. CString phone;
  6753. if(m_phone1.IsEmpty ()==0)
  6754. phone=m_phone1+",";
  6755. phone+=m_phone2;
  6756. phone.TrimRight (",");
  6757. strarray.Add (phone);
  6758. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  6759. strarray.Add (m_ren);
  6760. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  6761. for( i=7; i<=12; i++)
  6762. {
  6763. StrRect=load3.m_rcarray .ElementAt (i-1);
  6764. StrRect.left +=4;
  6765. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6766. }
  6767. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  6768. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6769. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  6770. str.Format("造型 %d 款,服装 %d 套", atoi(m_clothescount2), atoi(m_clothescount));
  6771. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6772. // StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  6773. // m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6774. //////////////////////////////
  6775. //开始画文字
  6776. StrRect=load2.m_rcarray .ElementAt (30);
  6777. StrRect.left +=3;
  6778. StrRect.top +=3;
  6779. StrRect.right -=2;
  6780. StrRect.bottom -=2;
  6781. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6782. StrRect=load2.m_rcarray .ElementAt (29); StrRect.top -=39;
  6783. StrRect.left +=3;
  6784. StrRect.top +=3;
  6785. StrRect.right -=2;
  6786. StrRect.bottom -=2;
  6787. str="";
  6788. for(i=0; i<sparray.GetSize (); i++)
  6789. {
  6790. str+=sparray.ElementAt (i).ElementAt (5);
  6791. str+=" 数量:";
  6792. str+=sparray.ElementAt (i).ElementAt (3);
  6793. str+="\r\n";
  6794. }
  6795. str.TrimRight ("\r\n");
  6796. AutoDraw(m_Print, StrRect, str, 1.4);
  6797. StrRect=load2.m_rcarray .ElementAt (40);
  6798. StrRect.top +=8;
  6799. m_Print.SetFontFace(12, 1, "黑体");
  6800. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客须知", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  6801. StrRect.left +=3;
  6802. StrRect.top +=30;
  6803. StrRect.right -=2;
  6804. StrRect.bottom -=2;
  6805. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6806. if(str.IsEmpty ())
  6807. {
  6808. str="\
  6809. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6810. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6811. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6812. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6813. 持良好的心境.\r\n\
  6814. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6815. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6816. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6817. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6818. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6819. 勿进影室, 以免影响拍摄.\r\n\
  6820. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6821. 师或店长沟通.\r\n\
  6822. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6823. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6824. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6825. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6826. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6827. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6828. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6829. 还.";
  6830. }
  6831. AutoDraw(m_Print, StrRect, str, 1.8);
  6832. PrintPreview dlg;
  6833. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6834. dlg.m_pDC =m_Print.GetPDC() ;
  6835. if(dlg.DoModal ()!=IDOK)return;
  6836. //结束打印
  6837. m_Print.EndPage();
  6838. m_Print.EndPrint();*/
  6839. /*
  6840. void CMainFrame::PrintReceipt(CStringArray *pArray)
  6841. {
  6842. g_sendhead.bsql=0;
  6843. g_sendhead.code[0]=24;
  6844. g_sendhead.tabcount=1;
  6845. int g_nYearposTemp=g_nYearpos;
  6846. g_nYearpos=-1;
  6847. g_pMainWnd->ProcessChatMessageRequest2(1);
  6848. g_nYearpos=g_nYearposTemp;
  6849. if(0==g_bSendOK)return;
  6850. DataToArray(&g_cominfoarray);
  6851. CString SerialNo;
  6852. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  6853. CPrintRX m_Print;
  6854. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6855. {
  6856. m_Print.InitToPrint(NULL, 1);
  6857. }
  6858. else
  6859. {
  6860. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  6861. if(name.IsEmpty ())
  6862. m_Print.InitToPrint(NULL, 1);
  6863. else
  6864. {
  6865. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6866. if(nret==-1)
  6867. {
  6868. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6869. }
  6870. }
  6871. }
  6872. m_Print.StartPrint();
  6873. m_Print.StartPage();
  6874. LoadRect load;
  6875. BOOL bSmall=0;
  6876. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  6877. {
  6878. bSmall=1;
  6879. load.SetLiaPath ("20.lia");
  6880. }
  6881. else
  6882. load.SetLiaPath ("10.lia");
  6883. if(bSmall)
  6884. load.SetMargins(0,0);
  6885. else
  6886. load.SetMargins(10,0);
  6887. if(!load.Load ())return;
  6888. int rcpos=-1;
  6889. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6890. if(bSmall)
  6891. {
  6892. m_Print.SetFontFace(18, 1, "黑体");
  6893. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6894. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6895. m_Print.SetFontFace(9, 1, "宋体");
  6896. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6897. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6898. m_Print.SetFontFace(6, 1, "宋体");
  6899. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6900. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6901. m_Print.SetFontFace(9, 1, "宋体");
  6902. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6903. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6904. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6905. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6906. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6907. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6908. int hei=StrRect.Height ();
  6909. StrRect.bottom=StrRect.top;
  6910. StrRect.top -=8;
  6911. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6912. m_Print.SetFontFace(11, 1, "宋体");
  6913. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6914. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6915. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6916. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6917. m_Print.SetFontFace(8, 1, "宋体");
  6918. for(int i=7; i<24; i++)
  6919. {
  6920. StrRect=load.m_rcarray .ElementAt (i);
  6921. m_Print.DrawRect2(StrRect, 1);
  6922. }
  6923. for( i=9; i<24; i++)
  6924. {
  6925. StrRect=load.m_rcarray .ElementAt (i);
  6926. StrRect.left +=2;
  6927. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6928. }
  6929. m_Print.SetFontFace(6, 1, "宋体");
  6930. for(i=24; i<26; i++)
  6931. {
  6932. StrRect=load.m_rcarray .ElementAt (i);
  6933. StrRect.left +=2;
  6934. if(i==24)
  6935. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6936. else
  6937. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6938. }
  6939. // StrRect=load.m_rcarray .ElementAt (27);
  6940. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6941. }
  6942. else//大单
  6943. {
  6944. m_Print.SetFontFace(20, 1, "黑体");
  6945. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6946. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6947. m_Print.SetFontFace(11, 1, "宋体");
  6948. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15;
  6949. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6950. int hei=StrRect.Height ();
  6951. StrRect.bottom=StrRect.top;
  6952. StrRect.top -=10;
  6953. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6954. m_Print.SetFontFace(8, 1, "宋体");
  6955. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6956. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6957. #ifdef LYFZ_VERSION
  6958. m_Print.SetFontFace(9, 1, "宋体");
  6959. #else
  6960. m_Print.SetFontFace(11, 1, "宋体");
  6961. #endif
  6962. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6963. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6964. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6965. #ifdef LYFZ_VERSION
  6966. StrRect.left +=30;
  6967. StrRect.right +=30;
  6968. #endif
  6969. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6970. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6971. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6972. m_Print.SetFontFace(13, 1, "宋体");
  6973. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6974. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6975. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6976. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6977. m_Print.SetFontFace(11, 1, "宋体");
  6978. for(int i=7; i<24; i++)
  6979. {
  6980. StrRect=load.m_rcarray .ElementAt (i);
  6981. m_Print.DrawRect2(StrRect, 1);
  6982. }
  6983. for( i=9; i<24; i++)
  6984. {
  6985. StrRect=load.m_rcarray .ElementAt (i);
  6986. StrRect.left +=2;
  6987. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6988. }
  6989. #ifdef LYFZ_VERSION
  6990. m_Print.SetFontFace(7, 1, "宋体");
  6991. for(i=24; i<25; i++)
  6992. {
  6993. StrRect=load.m_rcarray .ElementAt (i);
  6994. StrRect.left +=2;
  6995. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6996. }
  6997. #else
  6998. m_Print.SetFontFace(7, 1, "宋体");
  6999. for(i=24; i<27; i++)
  7000. {
  7001. StrRect=load.m_rcarray .ElementAt (i);
  7002. StrRect.left +=2;
  7003. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7004. }
  7005. #endif
  7006. StrRect=load.m_rcarray .ElementAt (24);
  7007. hei=StrRect.Height ();
  7008. StrRect.top +=hei;
  7009. StrRect.bottom +=hei;
  7010. StrRect.right +=100;
  7011. StrRect.left +=2;
  7012. StrRect=load.m_rcarray .ElementAt (27);
  7013. AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7014. }
  7015. PrintPreview dlg;
  7016. dlg.m_mode=3;
  7017. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7018. dlg.m_pDC =m_Print.GetPDC() ;
  7019. if(dlg.DoModal ()!=IDOK)return;
  7020. //结束打印
  7021. m_Print.EndPage();
  7022. m_Print.EndPrint();
  7023. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7024. CString sql;
  7025. sql.Format("update version set [serialno]='%s'", SerialNo);
  7026. g_sendhead.bsql=1;
  7027. g_nYearposTemp=g_nYearpos;
  7028. g_nYearpos=-1;
  7029. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7030. g_nYearpos=g_nYearposTemp;
  7031. }
  7032. */
  7033. void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7034. {
  7035. //AfxMessageBox("abce");
  7036. int printcot = 1;
  7037. for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
  7038. {
  7039. g_sendhead.bsql = 0;
  7040. g_sendhead.code[0] = 24;
  7041. g_sendhead.tabcount = 1;
  7042. int g_nYearposTemp = g_nYearpos;
  7043. g_nYearpos = -1;
  7044. g_pMainWnd->ProcessChatMessageRequest2(1);
  7045. g_nYearpos = g_nYearposTemp;
  7046. if (0 == g_bSendOK)return;
  7047. DataToArray(&g_cominfoarray);
  7048. CString SerialNo;
  7049. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7050. #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7051. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7052. CString sql;
  7053. sql.Format("update version set [serialno]='%s'", SerialNo);
  7054. g_sendhead.bsql=1;
  7055. g_nYearposTemp=g_nYearpos;
  7056. g_nYearpos=-1;
  7057. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7058. g_nYearpos=g_nYearposTemp;
  7059. #endif
  7060. // 1.创建打印对象
  7061. CPrintRX m_Print;
  7062. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7063. {
  7064. m_Print.InitToPrint(NULL, 1);
  7065. }
  7066. else
  7067. {
  7068. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7069. if (name.IsEmpty())
  7070. m_Print.InitToPrint(NULL, 1);
  7071. else
  7072. {
  7073. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7074. if (nret == -1 && aa == 0)
  7075. {
  7076. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7077. }
  7078. }
  7079. }
  7080. // 2.开始打印
  7081. m_Print.StartPrint();
  7082. m_Print.StartPage();
  7083. LoadRect load;
  7084. BOOL bSmall = 0;
  7085. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7086. {
  7087. bSmall = 1;
  7088. load.SetLiaPath("20.lia");
  7089. }
  7090. else
  7091. load.SetLiaPath("10.lia");
  7092. if (bSmall)
  7093. load.SetMargins(0, 0);
  7094. else
  7095. load.SetMargins(10, 0);
  7096. if (!load.Load())return;
  7097. int rcpos = -1;
  7098. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7099. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7100. {
  7101. Image *pImg = NULL;
  7102. g_nSendCode = 31;
  7103. int g_nYearposTemp = g_nYearpos;
  7104. g_nYearpos = -1;
  7105. g_pMainWnd->ProcessChatMessageRequest2(1);
  7106. g_nYearpos = g_nYearposTemp;
  7107. g_nSendCode = 0;
  7108. if (g_bSendOK == 0)return;
  7109. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7110. if (pImg)
  7111. {
  7112. StrRect.left = 65;
  7113. if (bSmall) StrRect.left = 55;
  7114. StrRect.top = 10;
  7115. StrRect.right = StrRect.left + 58;
  7116. StrRect.bottom = StrRect.top + 58;
  7117. // 3.打印2维码图像;
  7118. m_Print.DrawImage(pImg, StrRect);
  7119. delete pImg;
  7120. pImg = NULL;
  7121. }
  7122. }
  7123. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7124. if (bSmall)
  7125. {
  7126. m_Print.SetFontFace(18, 1, "黑体");
  7127. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7128. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7129. m_Print.SetFontFace(9, 1, "宋体");
  7130. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7131. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7132. m_Print.SetFontFace(6, 1, "宋体");
  7133. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7134. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7135. m_Print.SetFontFace(9, 1, "宋体");
  7136. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7137. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7138. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7139. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7140. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7141. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7142. int hei = StrRect.Height();
  7143. StrRect.bottom = StrRect.top;
  7144. StrRect.top -= 8;
  7145. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7146. m_Print.SetFontFace(11, 1, "宋体");
  7147. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7148. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7149. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7150. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7151. m_Print.SetFontFace(8, 1, "宋体");
  7152. for (int i = 7; i < 24; i++)
  7153. {
  7154. StrRect = load.m_rcarray.ElementAt(i);
  7155. m_Print.DrawRect2(StrRect, 1);
  7156. }
  7157. for (i = 9; i < 24; i++)
  7158. {
  7159. StrRect = load.m_rcarray.ElementAt(i);
  7160. StrRect.left += 2;
  7161. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7162. }
  7163. m_Print.SetFontFace(6, 1, "宋体");
  7164. for (i = 24; i < 26; i++)
  7165. {
  7166. StrRect = load.m_rcarray.ElementAt(i);
  7167. StrRect.left += 2;
  7168. if (i == 24)
  7169. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7170. else
  7171. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7172. }
  7173. // StrRect=load.m_rcarray .ElementAt (27);
  7174. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7175. }
  7176. else//大单
  7177. {
  7178. // 1.打印表头(蒙娜丽莎收款单)
  7179. m_Print.SetFontFace(20, 1, "黑体");
  7180. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7181. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7182. m_Print.SetFontFace(11, 1, "宋体");
  7183. // 2.打印订单号(NO.20140608-001)
  7184. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7185. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7186. // 3.打印SerialNo(SerialNo.01062)
  7187. int hei = StrRect.Height();
  7188. StrRect.bottom = StrRect.top;
  7189. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7190. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7191. // 4.打印影楼地址信息、电话;
  7192. m_Print.SetFontFace(8, 1, "宋体");
  7193. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7194. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7195. #ifdef LYFZ_VERSION
  7196. m_Print.SetFontFace(9, 1, "宋体");
  7197. #else
  7198. m_Print.SetFontFace(11, 1, "宋体");
  7199. #endif
  7200. // 5.打印客户姓名
  7201. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7202. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7203. // 6.打印客户联系电话
  7204. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7205. #ifdef LYFZ_VERSION
  7206. StrRect.left += 30;
  7207. StrRect.right += 30;
  7208. #endif
  7209. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7210. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7211. // 7.打印开单日期
  7212. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7213. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7214. // 8.打印列字段:收款项目
  7215. m_Print.SetFontFace(13, 1, "宋体");
  7216. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7217. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7218. //printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7219. // 9.打印列字段:金额
  7220. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7221. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7222. //printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7223. // 10.打印列字段:开单人
  7224. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7225. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7226. //printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7227. // 11.画表格-画3列;
  7228. m_Print.SetFontFace(11, 1, "宋体");
  7229. int i;
  7230. for (i = 7; i < 10; i++)
  7231. {
  7232. StrRect = load.m_rcarray.ElementAt(i);
  7233. m_Print.DrawRect2(StrRect, 1);
  7234. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7235. }
  7236. // 12.打印详细内容
  7237. int dty = 0;
  7238. int dtytemp = 0;
  7239. // for( i=10; i<14; i+=3)
  7240. for (i = 10; i<22; i += 3) // 循环4次,再画
  7241. {
  7242. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7243. CArray<CRect, CRect>rcarray;
  7244. CStringArray strarray2;
  7245. StrRect = load.m_rcarray.ElementAt(i);
  7246. StrRect.top += dty;
  7247. StrRect.bottom += dty;
  7248. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  7249. {
  7250. StrRect = load.m_rcarray.ElementAt(i - 1);
  7251. StrRect.top += dty;
  7252. StrRect.bottom += dty;
  7253. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  7254. break;
  7255. }
  7256. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7257. StrRect.left += 2;
  7258. StrRect.right -= 2;
  7259. StrRect.top += 4;
  7260. rcarray.Add(StrRect);
  7261. strarray2.Add(pArray->ElementAt(i));
  7262. // 指定格子宽度,计算字符串占几行(高度).
  7263. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7264. dtytemp = bottom - StrRect.bottom;
  7265. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7266. // 重新获取表格大小,并画出表格;
  7267. StrRect = load.m_rcarray.ElementAt(i);
  7268. StrRect.bottom += dtytemp;
  7269. StrRect.top += dty;
  7270. StrRect.bottom += dty;
  7271. m_Print.DrawRect2(StrRect, 1);
  7272. // 获取下一表格大小,并画出表格;
  7273. StrRect = load.m_rcarray.ElementAt(i + 1);
  7274. StrRect.top += dty;
  7275. StrRect.bottom += dty;
  7276. StrRect.bottom += dtytemp;
  7277. m_Print.DrawRect2(StrRect, 1);
  7278. StrRect.left += 2;
  7279. // 打印出金额字段内容
  7280. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7281. //printf("Jeff:%d:%s\n\n",i+1,pArray->ElementAt(i+1));//Jeff Printf;
  7282. StrRect = load.m_rcarray.ElementAt(i + 2);
  7283. StrRect.top += dty;
  7284. StrRect.bottom += dty;
  7285. StrRect.bottom += dtytemp;
  7286. m_Print.DrawRect2(StrRect, 1);
  7287. StrRect.left += 2;
  7288. // 打印开单人字段内容
  7289. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7290. //printf("Jeff:%d:%s\n\n",i+2,pArray->ElementAt(i+2));//Jeff Printf;
  7291. dty += dtytemp;
  7292. }
  7293. //.打印->付款情况 应付 实付 欠款.
  7294. i = 22;
  7295. StrRect = load.m_rcarray.ElementAt(i);
  7296. StrRect.top += dty;
  7297. StrRect.bottom += dty;
  7298. m_Print.DrawRect2(StrRect, 1);
  7299. StrRect.left += 2;
  7300. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7301. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7302. //.打印->合计人民币(大写):.......
  7303. i = 23;
  7304. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  7305. m_Print.DrawRect2(StrRect, 1);
  7306. StrRect.left += 2;
  7307. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7308. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7309. #ifdef LYFZ_VERSION
  7310. m_Print.SetFontFace(7, 1, "宋体");
  7311. for (i = 24; i < 25; i++)
  7312. {
  7313. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  7314. StrRect.left +=2;
  7315. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7316. }
  7317. #else
  7318. m_Print.SetFontFace(7, 1, "宋体");
  7319. for (i = 24; i < 27; i++)
  7320. {
  7321. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  7322. StrRect.left += 2;
  7323. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7324. }
  7325. #endif
  7326. StrRect = load.m_rcarray.ElementAt(24); StrRect.top += dty; StrRect.bottom += dty;
  7327. hei = StrRect.Height();
  7328. StrRect.top += hei;
  7329. StrRect.bottom += hei;
  7330. StrRect.right += 100;
  7331. StrRect.left += 2;
  7332. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  7333. AutoDraw(m_Print, StrRect, pArray->ElementAt(27), 1.0);
  7334. }
  7335. PrintPreview dlg;
  7336. dlg.m_mode = 3;
  7337. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  7338. dlg.m_pDC = m_Print.GetPDC();
  7339. if (aa == 0)
  7340. {
  7341. if (dlg.DoModal() != IDOK)
  7342. return;
  7343. printcot = dlg.m_num;
  7344. }
  7345. //结束打印
  7346. m_Print.EndPage();
  7347. m_Print.EndPrint();
  7348. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7349. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7350. CString sql;
  7351. sql.Format("update version set [serialno]='%s'", SerialNo);
  7352. g_sendhead.bsql = 1;
  7353. g_nYearposTemp = g_nYearpos;
  7354. g_nYearpos = -1;
  7355. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7356. g_nYearpos = g_nYearposTemp;
  7357. #endif
  7358. }
  7359. }
  7360. void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7361. {
  7362. //AfxMessageBox("abce");
  7363. int printcot = 1;
  7364. for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
  7365. {
  7366. g_sendhead.bsql = 0;
  7367. g_sendhead.code[0] = 24;
  7368. g_sendhead.tabcount = 1;
  7369. int g_nYearposTemp = g_nYearpos;
  7370. g_nYearpos = -1;
  7371. g_pMainWnd->ProcessChatMessageRequest2(1);
  7372. g_nYearpos = g_nYearposTemp;
  7373. if (0 == g_bSendOK)return;
  7374. DataToArray(&g_cominfoarray);
  7375. CString SerialNo;
  7376. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7377. #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7378. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7379. CString sql;
  7380. sql.Format("update version set [serialno]='%s'", SerialNo);
  7381. g_sendhead.bsql=1;
  7382. g_nYearposTemp=g_nYearpos;
  7383. g_nYearpos=-1;
  7384. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7385. g_nYearpos=g_nYearposTemp;
  7386. #endif
  7387. // 1.创建打印对象
  7388. CPrintRX m_Print;
  7389. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7390. {
  7391. m_Print.InitToPrint(NULL, 1);
  7392. }
  7393. else
  7394. {
  7395. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7396. if (name.IsEmpty())
  7397. m_Print.InitToPrint(NULL, 1);
  7398. else
  7399. {
  7400. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7401. if (nret == -1 && aa == 0)
  7402. {
  7403. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  7404. m_Print.InitToPrint(NULL, 1);
  7405. }
  7406. }
  7407. }
  7408. // 2.开始打印
  7409. m_Print.StartPrint();
  7410. m_Print.StartPage();
  7411. LoadRect load;
  7412. BOOL bSmall = 0;
  7413. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7414. {
  7415. bSmall = 1;
  7416. load.SetLiaPath("20.lia");
  7417. }
  7418. else
  7419. load.SetLiaPath("10.lia");
  7420. if (bSmall)
  7421. load.SetMargins(0, 0);
  7422. else
  7423. load.SetMargins(10, 0);
  7424. if (!load.Load())return;
  7425. int rcpos = -1;
  7426. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7427. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7428. {
  7429. Image *pImg = NULL;
  7430. g_nSendCode = 31;
  7431. int g_nYearposTemp = g_nYearpos;
  7432. g_nYearpos = -1;
  7433. g_pMainWnd->ProcessChatMessageRequest2(1);
  7434. g_nYearpos = g_nYearposTemp;
  7435. g_nSendCode = 0;
  7436. if (g_bSendOK == 0)return;
  7437. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7438. if (pImg)
  7439. {
  7440. StrRect.left = 65;
  7441. if (bSmall) StrRect.left = 55;
  7442. StrRect.top = 10;
  7443. StrRect.right = StrRect.left + 58;
  7444. StrRect.bottom = StrRect.top + 58;
  7445. // 3.打印2维码图像;
  7446. m_Print.DrawImage(pImg, StrRect);
  7447. delete pImg;
  7448. pImg = NULL;
  7449. }
  7450. }
  7451. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7452. if (bSmall)
  7453. {
  7454. m_Print.SetFontFace(18, 1, "黑体");
  7455. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7456. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7457. m_Print.SetFontFace(9, 1, "宋体");
  7458. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7459. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7460. m_Print.SetFontFace(6, 1, "宋体");
  7461. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7462. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7463. m_Print.SetFontFace(9, 1, "宋体");
  7464. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7465. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7466. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7467. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7468. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7469. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7470. int hei = StrRect.Height();
  7471. StrRect.bottom = StrRect.top;
  7472. StrRect.top -= 8;
  7473. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7474. m_Print.SetFontFace(11, 1, "宋体");
  7475. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7476. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7477. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7478. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7479. m_Print.SetFontFace(8, 1, "宋体");
  7480. for (int i = 7; i < 24; i++)
  7481. {
  7482. StrRect = load.m_rcarray.ElementAt(i);
  7483. m_Print.DrawRect2(StrRect, 1);
  7484. }
  7485. for (i = 9; i < 24; i++)
  7486. {
  7487. StrRect = load.m_rcarray.ElementAt(i);
  7488. StrRect.left += 2;
  7489. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7490. }
  7491. m_Print.SetFontFace(6, 1, "宋体");
  7492. for (i = 24; i < 26; i++)
  7493. {
  7494. StrRect = load.m_rcarray.ElementAt(i);
  7495. StrRect.left += 2;
  7496. if (i == 24)
  7497. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7498. else
  7499. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7500. }
  7501. // StrRect=load.m_rcarray .ElementAt (27);
  7502. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7503. }
  7504. else//大单
  7505. {
  7506. // 1.打印表头(蒙娜丽莎收款单)
  7507. m_Print.SetFontFace(20, 1, "黑体");
  7508. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7509. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7510. m_Print.SetFontFace(11, 1, "宋体");
  7511. // 2.打印订单号(NO.20140608-001)
  7512. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7513. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7514. // 3.打印SerialNo(SerialNo.01062)
  7515. int hei = StrRect.Height();
  7516. StrRect.bottom = StrRect.top;
  7517. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7518. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7519. // 4.打印影楼地址信息、电话;
  7520. m_Print.SetFontFace(8, 1, "宋体");
  7521. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7522. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7523. #ifdef LYFZ_VERSION
  7524. m_Print.SetFontFace(9, 1, "宋体");
  7525. #else
  7526. m_Print.SetFontFace(11, 1, "宋体");
  7527. #endif
  7528. // 5.打印客户姓名
  7529. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7530. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7531. // 6.打印客户联系电话
  7532. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7533. #ifdef LYFZ_VERSION
  7534. StrRect.left += 30;
  7535. StrRect.right += 30;
  7536. #endif
  7537. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7538. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7539. // 7.打印开单日期
  7540. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7541. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7542. #if 0 // Original Edition
  7543. // 8.打印列字段:收款项目
  7544. m_Print.SetFontFace(13, 1, "宋体");
  7545. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7546. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7547. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7548. // 9.打印列字段:金额
  7549. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7550. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7551. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7552. // 10.打印列字段:开单人
  7553. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7554. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7555. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7556. #else
  7557. // 8.打印列字段:收款项目
  7558. m_Print.SetFontFace(13, 1, "宋体");
  7559. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7560. StrRect = CRect(66, 85, 280, 105);
  7561. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7562. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7563. // 8.1 Jeff add:支付方式
  7564. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7565. StrRect = CRect(280, 85, 350, 105);
  7566. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7567. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7568. // 9.打印列字段:金额
  7569. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7570. StrRect = CRect(350, 85, 442, 105);
  7571. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7572. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7573. // 10.打印列字段:开单人
  7574. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7575. StrRect = CRect(442, 85, 535, 105);
  7576. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7577. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7578. //rcpos += 3;
  7579. #endif
  7580. // 11.画表格-画3列;old
  7581. // 11.draw 4 column
  7582. m_Print.SetFontFace(11, 1, "宋体");
  7583. int i;
  7584. //for( i=7; i<10; i++)
  7585. //{
  7586. // StrRect=load.m_rcarray.ElementAt(i);
  7587. // m_Print.DrawRect2(StrRect, 1);
  7588. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7589. //}
  7590. m_Print.DrawRect2(CRect(66, 85, 280, 105), 1);
  7591. m_Print.DrawRect2(CRect(280, 85, 350, 105), 1);
  7592. m_Print.DrawRect2(CRect(350, 85, 442, 105), 1);
  7593. m_Print.DrawRect2(CRect(442, 85, 535, 105), 1);
  7594. // 12.打印详细内容
  7595. int dty = 0;
  7596. int dtytemp = 0;
  7597. // for( i=10; i<14; i+=3)
  7598. //for( i=10; i<22; i+=3) // 循环4次,再画
  7599. int j = 0;
  7600. for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
  7601. {
  7602. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7603. CArray<CRect, CRect>rcarray;
  7604. CStringArray strarray2;
  7605. StrRect = load.m_rcarray.ElementAt(i);
  7606. StrRect.top += dty;
  7607. StrRect.bottom += dty;
  7608. StrRect.right -= 70; // Jeff add
  7609. //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;
  7610. /*
  7611. 4次的CRect
  7612. 66,105,350,125
  7613. 66,126,350,146
  7614. 66,147,350,167
  7615. 66,168,350,188
  7616. */
  7617. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  7618. {
  7619. StrRect = load.m_rcarray.ElementAt(i - 1);
  7620. StrRect.top += dty;
  7621. StrRect.bottom += dty;
  7622. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  7623. break;
  7624. }
  7625. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7626. StrRect.left += 2;
  7627. StrRect.right -= 2;
  7628. StrRect.top += 4;
  7629. rcarray.Add(StrRect);
  7630. //strarray2.Add(pArray->ElementAt(i+1));
  7631. strarray2.Add(pArray->ElementAt(j));
  7632. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7633. // 指定格子宽度,计算字符串占几行(高度).
  7634. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7635. dtytemp = bottom - StrRect.bottom;
  7636. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7637. // 重新获取表格大小,并画出表格;
  7638. /*
  7639. CRect(66,85,280,105),
  7640. CRect(280,85,350,105)
  7641. CRect(350,85,442,105)
  7642. CRect(442,85,535,105)
  7643. CRect(66,105,350,125),
  7644. CRect(66,126,350,146)
  7645. CRect(66,147,350,167)
  7646. CRect(66,168,350,188)
  7647. */
  7648. // 画收款项目框及打印内容;
  7649. StrRect = load.m_rcarray.ElementAt(i);
  7650. //StrRect=CRect(66,85,280,105);
  7651. StrRect.bottom += dtytemp;
  7652. StrRect.top += dty;
  7653. StrRect.bottom += dty;
  7654. //StrRect.left -= 70; // Jeff add
  7655. StrRect.right -= 70; // Jeff add
  7656. //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;
  7657. m_Print.DrawRect2(StrRect, 1);
  7658. // 画支付方式框及打印内容;
  7659. StrRect = load.m_rcarray.ElementAt(i);
  7660. //StrRect=CRect(280,85,350,105);
  7661. StrRect.bottom += dtytemp;
  7662. StrRect.top += dty;
  7663. StrRect.bottom += dty;
  7664. StrRect.left += StrRect.Width() - 70;
  7665. //StrRect.right += 70; // Jeff add
  7666. //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;
  7667. m_Print.DrawRect2(StrRect, 1);
  7668. StrRect.left += 2;
  7669. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7670. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7671. // 画金额框及打印内容;
  7672. StrRect = load.m_rcarray.ElementAt(i + 1);
  7673. //StrRect=CRect(350,85,442,105);
  7674. StrRect.top += dty;
  7675. StrRect.bottom += dty;
  7676. StrRect.bottom += dtytemp;
  7677. //StrRect.right -= 70; // Jeff add
  7678. //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;
  7679. m_Print.DrawRect2(StrRect, 1);
  7680. StrRect.left += 2;
  7681. // 打印出金额字段内容
  7682. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7683. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7684. // 画开单人框及打印内容;
  7685. StrRect = load.m_rcarray.ElementAt(i + 2);
  7686. //StrRect=CRect(442,85,535,105);
  7687. StrRect.top += dty;
  7688. StrRect.bottom += dty;
  7689. StrRect.bottom += dtytemp;
  7690. //StrRect.right -= 70; // Jeff add
  7691. //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;
  7692. m_Print.DrawRect2(StrRect, 1);
  7693. StrRect.left += 2;
  7694. // 打印开单人字段内容
  7695. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7696. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7697. dty += dtytemp;
  7698. }
  7699. //.打印->付款情况 应付 实付 欠款.
  7700. i = 22;
  7701. j = 27;
  7702. StrRect = load.m_rcarray.ElementAt(i);
  7703. StrRect.top += dty;
  7704. StrRect.bottom += dty;
  7705. m_Print.DrawRect2(StrRect, 1);
  7706. StrRect.left += 2;
  7707. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7708. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7709. //.打印->合计人民币(大写):.......
  7710. i = 23;
  7711. j = 28;
  7712. StrRect = load.m_rcarray.ElementAt(i);
  7713. StrRect.top += dty;
  7714. StrRect.bottom += dty;
  7715. m_Print.DrawRect2(StrRect, 1);
  7716. StrRect.left += 2;
  7717. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7718. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7719. // 打印总金额;
  7720. #ifdef LYFZ_VERSION
  7721. m_Print.SetFontFace(7, 1, "宋体");
  7722. for (i = 24; i < 25; i++)
  7723. {
  7724. StrRect = load.m_rcarray.ElementAt(i);
  7725. StrRect.top +=dty;
  7726. StrRect.bottom +=dty;
  7727. StrRect.left +=2;
  7728. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7729. }
  7730. #else
  7731. m_Print.SetFontFace(7, 1, "宋体");
  7732. for (i = 24, j = 29; i < 27; i++, j++)
  7733. {
  7734. StrRect = load.m_rcarray.ElementAt(i);
  7735. StrRect.top += dty;
  7736. StrRect.bottom += dty;
  7737. StrRect.left += 2;
  7738. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7739. }
  7740. #endif
  7741. StrRect = load.m_rcarray.ElementAt(24);
  7742. StrRect.top += dty;
  7743. StrRect.bottom += dty;
  7744. hei = StrRect.Height();
  7745. StrRect.top += hei;
  7746. StrRect.bottom += hei;
  7747. StrRect.right += 100;
  7748. StrRect.left += 2;
  7749. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  7750. AutoDraw(m_Print, StrRect, pArray->ElementAt(32), 1.0);
  7751. }
  7752. PrintPreview dlg;
  7753. dlg.m_mode = 3;
  7754. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  7755. dlg.m_pDC = m_Print.GetPDC();
  7756. if (aa == 0)
  7757. {
  7758. if (dlg.DoModal() != IDOK)
  7759. {
  7760. return;
  7761. }
  7762. printcot = dlg.m_num;
  7763. }
  7764. //结束打印
  7765. m_Print.EndPage();
  7766. m_Print.EndPrint();
  7767. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7768. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7769. CString sql;
  7770. sql.Format("update version set [serialno]='%s'", SerialNo);
  7771. g_sendhead.bsql = 1;
  7772. g_nYearposTemp = g_nYearpos;
  7773. g_nYearpos = -1;
  7774. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7775. g_nYearpos = g_nYearposTemp;
  7776. #endif
  7777. }
  7778. }
  7779. void CMainFrame::PrintReceipt_02(CStringArray *pArray, CPrintRX *pPrinter, const int &nCount, const BOOL bPrintImmediately) // 打印订单*预约收款、预约补款*
  7780. {
  7781. //AfxMessageBox("abce");
  7782. int printcot = 1;
  7783. // for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7784. // {
  7785. g_sendhead.bsql = 0;
  7786. g_sendhead.code[0] = 24;
  7787. g_sendhead.tabcount = 1;
  7788. int g_nYearposTemp = g_nYearpos;
  7789. g_nYearpos = -1;
  7790. g_pMainWnd->ProcessChatMessageRequest2(1);
  7791. g_nYearpos = g_nYearposTemp;
  7792. if (0 == g_bSendOK)return;
  7793. DataToArray(&g_cominfoarray);
  7794. CString SerialNo;
  7795. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7796. CPrintRX *tagPrinter = NULL;
  7797. if (pPrinter == NULL)
  7798. {
  7799. // 1.创建打印对象
  7800. tagPrinter = new CPrintRX;
  7801. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7802. {
  7803. tagPrinter->InitToPrint(NULL, 1);
  7804. }
  7805. else
  7806. {
  7807. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7808. if (name.IsEmpty())
  7809. {
  7810. tagPrinter->InitToPrint(NULL, 1);
  7811. }
  7812. else
  7813. {
  7814. int nret = tagPrinter->InitToPrint((char*)(LPCTSTR)name, 1);
  7815. ///if(nret==-1 && aa==0)
  7816. if (nret == -1)
  7817. {
  7818. if (bPrintImmediately == FALSE)
  7819. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  7820. tagPrinter->InitToPrint(NULL, 1);
  7821. }
  7822. }
  7823. }
  7824. // 2.开始打印
  7825. tagPrinter->StartPrint();
  7826. tagPrinter->StartPage();
  7827. }
  7828. else
  7829. {
  7830. //SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7831. tagPrinter = pPrinter;
  7832. }
  7833. LoadRect load;
  7834. BOOL bSmall = 0;
  7835. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7836. {
  7837. bSmall = 1;
  7838. load.SetLiaPath("20.lia");
  7839. }
  7840. else
  7841. load.SetLiaPath("10.lia");
  7842. if (bSmall)
  7843. load.SetMargins(0, 0);
  7844. else
  7845. load.SetMargins(10, 0);
  7846. if (!load.Load())return;
  7847. int rcpos = -1;
  7848. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7849. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7850. {
  7851. Image *pImg = NULL;
  7852. g_nSendCode = 31;
  7853. int g_nYearposTemp = g_nYearpos;
  7854. g_nYearpos = -1;
  7855. g_pMainWnd->ProcessChatMessageRequest2(1);
  7856. g_nYearpos = g_nYearposTemp;
  7857. g_nSendCode = 0;
  7858. if (g_bSendOK == 0)return;
  7859. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7860. if (pImg)
  7861. {
  7862. StrRect.left = 65;
  7863. if (bSmall) StrRect.left = 55;
  7864. StrRect.top = 10;
  7865. StrRect.right = StrRect.left + 58;
  7866. StrRect.bottom = StrRect.top + 58;
  7867. // 3.打印2维码图像;
  7868. tagPrinter->DrawImage(pImg, StrRect);
  7869. delete pImg;
  7870. pImg = NULL;
  7871. }
  7872. }
  7873. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7874. if (bSmall)
  7875. {
  7876. tagPrinter->SetFontFace(18, 1, "黑体");
  7877. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7878. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7879. tagPrinter->SetFontFace(9, 1, "宋体");
  7880. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7881. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7882. tagPrinter->SetFontFace(6, 1, "宋体");
  7883. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7884. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7885. tagPrinter->SetFontFace(9, 1, "宋体");
  7886. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7887. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7888. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7889. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7890. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7891. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7892. int hei = StrRect.Height();
  7893. StrRect.bottom = StrRect.top;
  7894. StrRect.top -= 8;
  7895. tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7896. tagPrinter->SetFontFace(11, 1, "宋体");
  7897. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7898. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7899. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7900. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7901. tagPrinter->SetFontFace(8, 1, "宋体");
  7902. for (int i = 7; i < 24; i++)
  7903. {
  7904. StrRect = load.m_rcarray.ElementAt(i);
  7905. tagPrinter->DrawRect2(StrRect, 1);
  7906. }
  7907. for (i = 9; i < 24; i++)
  7908. {
  7909. StrRect = load.m_rcarray.ElementAt(i);
  7910. StrRect.left += 2;
  7911. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7912. }
  7913. tagPrinter->SetFontFace(6, 1, "宋体");
  7914. for (i = 24; i < 26; i++)
  7915. {
  7916. StrRect = load.m_rcarray.ElementAt(i);
  7917. StrRect.left += 2;
  7918. if (i == 24)
  7919. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7920. else
  7921. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7922. }
  7923. // StrRect=load.m_rcarray .ElementAt (27);
  7924. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7925. }
  7926. else//大单
  7927. {
  7928. // 1.打印表头(蒙娜丽莎收款单)
  7929. tagPrinter->SetFontFace(20, 1, "黑体");
  7930. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7931. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7932. tagPrinter->SetFontFace(11, 1, "宋体");
  7933. // 2.打印订单号(NO.20140608-001)
  7934. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7935. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7936. // 3.打印SerialNo(SerialNo.01062)
  7937. int hei = StrRect.Height();
  7938. StrRect.bottom = StrRect.top;
  7939. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7940. tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7941. // 4.打印影楼地址信息、电话;
  7942. tagPrinter->SetFontFace(8, 1, "宋体");
  7943. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7944. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7945. #ifdef LYFZ_VERSION
  7946. tagPrinter->SetFontFace(9, 1, "宋体");
  7947. #else
  7948. tagPrinter->SetFontFace(11, 1, "宋体");
  7949. #endif
  7950. // 5.打印客户姓名
  7951. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7952. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7953. // 6.打印客户联系电话
  7954. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7955. #ifdef LYFZ_VERSION
  7956. StrRect.left += 30;
  7957. StrRect.right += 30;
  7958. #endif
  7959. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7960. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7961. // 7.打印开单日期
  7962. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7963. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7964. #if 0 // Original Edition
  7965. // 8.打印列字段:收款项目
  7966. tagPrinter->SetFontFace(13, 1, "宋体");
  7967. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7968. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7969. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7970. // 9.打印列字段:金额
  7971. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7972. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7973. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7974. // 10.打印列字段:开单人
  7975. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7976. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7977. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7978. #else
  7979. // 8.打印列字段:收款项目
  7980. tagPrinter->SetFontFace(13, 1, "宋体");
  7981. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7982. StrRect = CRect(66, 85, 280, 105);
  7983. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7984. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7985. // 8.1 Jeff add:支付方式
  7986. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7987. StrRect = CRect(280, 85, 350, 105);
  7988. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7989. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7990. // 9.打印列字段:金额
  7991. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7992. StrRect = CRect(350, 85, 442, 105);
  7993. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7994. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7995. // 10.打印列字段:开单人
  7996. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7997. StrRect = CRect(442, 85, 535, 105);
  7998. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7999. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  8000. //rcpos += 3;
  8001. #endif
  8002. // 11.画表格-画3列;old
  8003. // 11.draw 4 column
  8004. tagPrinter->SetFontFace(11, 1, "宋体");
  8005. int i;
  8006. //for( i=7; i<10; i++)
  8007. //{
  8008. // StrRect=load.m_rcarray.ElementAt(i);
  8009. // m_Print.DrawRect2(StrRect, 1);
  8010. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  8011. //}
  8012. tagPrinter->DrawRect2(CRect(66, 85, 280, 105), 1);
  8013. tagPrinter->DrawRect2(CRect(280, 85, 350, 105), 1);
  8014. tagPrinter->DrawRect2(CRect(350, 85, 442, 105), 1);
  8015. tagPrinter->DrawRect2(CRect(442, 85, 535, 105), 1);
  8016. // 12.打印详细内容
  8017. int dty = 0;
  8018. int dtytemp = 0;
  8019. // for( i=10; i<14; i+=3)
  8020. //for( i=10; i<22; i+=3) // 循环4次,再画
  8021. int j = 0;
  8022. for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
  8023. {
  8024. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  8025. CArray<CRect, CRect>rcarray;
  8026. CStringArray strarray2;
  8027. StrRect = load.m_rcarray.ElementAt(i);
  8028. StrRect.top += dty;
  8029. StrRect.bottom += dty;
  8030. StrRect.right -= 70; // Jeff add
  8031. //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;
  8032. /*
  8033. 4次的CRect
  8034. 66,105,350,125
  8035. 66,126,350,146
  8036. 66,147,350,167
  8037. 66,168,350,188
  8038. */
  8039. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  8040. {
  8041. StrRect = load.m_rcarray.ElementAt(i - 1);
  8042. StrRect.top += dty;
  8043. StrRect.bottom += dty;
  8044. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  8045. break;
  8046. }
  8047. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  8048. StrRect.left += 2;
  8049. StrRect.right -= 2;
  8050. StrRect.top += 4;
  8051. rcarray.Add(StrRect);
  8052. //strarray2.Add(pArray->ElementAt(i+1));
  8053. strarray2.Add(pArray->ElementAt(j));
  8054. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  8055. // 指定格子宽度,计算字符串占几行(高度).
  8056. int bottom = CalHeight(&rcarray, &strarray2, tagPrinter, FORMAT_LEFT);
  8057. dtytemp = bottom - StrRect.bottom;
  8058. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  8059. // 重新获取表格大小,并画出表格;
  8060. /*
  8061. CRect(66,85,280,105),
  8062. CRect(280,85,350,105)
  8063. CRect(350,85,442,105)
  8064. CRect(442,85,535,105)
  8065. CRect(66,105,350,125),
  8066. CRect(66,126,350,146)
  8067. CRect(66,147,350,167)
  8068. CRect(66,168,350,188)
  8069. */
  8070. // 画收款项目框及打印内容;
  8071. StrRect = load.m_rcarray.ElementAt(i);
  8072. //StrRect=CRect(66,85,280,105);
  8073. StrRect.bottom += dtytemp;
  8074. StrRect.top += dty;
  8075. StrRect.bottom += dty;
  8076. //StrRect.left -= 70; // Jeff add
  8077. StrRect.right -= 70; // Jeff add
  8078. //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;
  8079. tagPrinter->DrawRect2(StrRect, 1);
  8080. // 画支付方式框及打印内容;
  8081. StrRect = load.m_rcarray.ElementAt(i);
  8082. //StrRect=CRect(280,85,350,105);
  8083. StrRect.bottom += dtytemp;
  8084. StrRect.top += dty;
  8085. StrRect.bottom += dty;
  8086. StrRect.left += StrRect.Width() - 70;
  8087. //StrRect.right += 70; // Jeff add
  8088. //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;
  8089. tagPrinter->DrawRect2(StrRect, 1);
  8090. StrRect.left += 2;
  8091. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8092. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  8093. // 画金额框及打印内容;
  8094. StrRect = load.m_rcarray.ElementAt(i + 1);
  8095. //StrRect=CRect(350,85,442,105);
  8096. StrRect.top += dty;
  8097. StrRect.bottom += dty;
  8098. StrRect.bottom += dtytemp;
  8099. //StrRect.right -= 70; // Jeff add
  8100. //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;
  8101. tagPrinter->DrawRect2(StrRect, 1);
  8102. StrRect.left += 2;
  8103. // 打印出金额字段内容
  8104. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8105. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  8106. // 画开单人框及打印内容;
  8107. StrRect = load.m_rcarray.ElementAt(i + 2);
  8108. //StrRect=CRect(442,85,535,105);
  8109. StrRect.top += dty;
  8110. StrRect.bottom += dty;
  8111. StrRect.bottom += dtytemp;
  8112. //StrRect.right -= 70; // Jeff add
  8113. //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;
  8114. tagPrinter->DrawRect2(StrRect, 1);
  8115. StrRect.left += 2;
  8116. // 打印开单人字段内容
  8117. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8118. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  8119. dty += dtytemp;
  8120. }
  8121. //.打印->付款情况 应付 实付 欠款.
  8122. i = 22;
  8123. j = 27;
  8124. StrRect = load.m_rcarray.ElementAt(i);
  8125. StrRect.top += dty;
  8126. StrRect.bottom += dty;
  8127. tagPrinter->DrawRect2(StrRect, 1);
  8128. StrRect.left += 2;
  8129. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8130. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  8131. //.打印->合计人民币(大写):.......
  8132. i = 23;
  8133. j = 28;
  8134. StrRect = load.m_rcarray.ElementAt(i);
  8135. StrRect.top += dty;
  8136. StrRect.bottom += dty;
  8137. tagPrinter->DrawRect2(StrRect, 1);
  8138. StrRect.left += 2;
  8139. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8140. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  8141. // 打印总金额;
  8142. #ifdef LYFZ_VERSION
  8143. tagPrinter->SetFontFace(7, 1, "宋体");
  8144. for (i = 24; i < 25; i++)
  8145. {
  8146. StrRect = load.m_rcarray.ElementAt(i);
  8147. StrRect.top +=dty;
  8148. StrRect.bottom +=dty;
  8149. StrRect.left +=2;
  8150. tagPrinter->DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8151. }
  8152. #else
  8153. tagPrinter->SetFontFace(7, 1, "宋体");
  8154. for (i = 24, j = 29; i < 27; i++, j++)
  8155. {
  8156. StrRect = load.m_rcarray.ElementAt(i);
  8157. StrRect.top += dty;
  8158. StrRect.bottom += dty;
  8159. StrRect.left += 2;
  8160. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8161. }
  8162. #endif
  8163. StrRect = load.m_rcarray.ElementAt(24);
  8164. StrRect.top += dty;
  8165. StrRect.bottom += dty;
  8166. hei = StrRect.Height();
  8167. StrRect.top += hei;
  8168. StrRect.bottom += hei;
  8169. StrRect.right += 100;
  8170. StrRect.left += 2;
  8171. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  8172. AutoDraw(*tagPrinter, StrRect, pArray->ElementAt(32), 1.0);
  8173. }
  8174. if (bPrintImmediately == TRUE)
  8175. {
  8176. printcot = nCount;
  8177. ////结束打印
  8178. tagPrinter->EndPage();
  8179. tagPrinter->EndPrint();
  8180. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  8181. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  8182. CString sql;
  8183. sql.Format("update version set [serialno]='%s'", SerialNo);
  8184. g_sendhead.bsql = 1;
  8185. g_nYearposTemp = g_nYearpos;
  8186. g_nYearpos = -1;
  8187. g_pMainWnd->ProcessChatMessageRequest2(sql);
  8188. g_nYearpos = g_nYearposTemp;
  8189. #endif
  8190. }
  8191. else
  8192. {
  8193. PrintPreview dlg;
  8194. dlg.m_mode = 3;
  8195. tagPrinter->GetWidHei(dlg.m_w, dlg.m_h);
  8196. dlg.m_pDC = tagPrinter->GetPDC();
  8197. //if(aa==0)
  8198. //{
  8199. if (dlg.DoModal() != IDOK)
  8200. {
  8201. return;
  8202. }
  8203. else
  8204. {
  8205. printcot = dlg.m_num;
  8206. //m_Print.deletePrinter();
  8207. for (int i = 0; i < printcot; i++)
  8208. {
  8209. //tagPrinter->EndPage();
  8210. //tagPrinter->m_DC.AbortDoc(); // 结束清空由StartDoc写入的内容;2014-09-15;
  8211. //tagPrinter->m_DC.EndDoc();
  8212. //Sleep(10000);
  8213. //tagPrinter->StartPrint();
  8214. //tagPrinter->NewPage();
  8215. //PrintReceipt_02(pArray,/*tagPrinter*/NULL,printcot,TRUE);
  8216. PrintReceipt_02(pArray, tagPrinter, printcot, TRUE);
  8217. }
  8218. }
  8219. if (tagPrinter) delete tagPrinter;
  8220. //}
  8221. }
  8222. //}
  8223. }
  8224. void CMainFrame::PrintFlowChart(CString strOrderNumber) // 选片打单;
  8225. {
  8226. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
  8227. {
  8228. // Jeff 使用风格2打印;
  8229. PrintFlowChart3(strOrderNumber);
  8230. return;
  8231. }
  8232. #ifdef ZHIAI_VERSION
  8233. PrintFlowChart2(strOrderNumber);
  8234. return;
  8235. #endif
  8236. int printcot = 1;
  8237. for (int aa = 0; aa < printcot; aa++)
  8238. {
  8239. CPrintRX m_Print;
  8240. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8241. {
  8242. m_Print.InitToPrint(NULL, 1);
  8243. }
  8244. else
  8245. {
  8246. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  8247. if (name.IsEmpty())
  8248. m_Print.InitToPrint(NULL, 1);
  8249. else
  8250. {
  8251. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8252. if (nret == -1 && aa == 0)
  8253. {
  8254. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8255. }
  8256. }
  8257. }
  8258. m_Print.StartPrint();
  8259. m_Print.StartPage();
  8260. // CRect StrRect(0,0,560,818);
  8261. LoadRect load;
  8262. load.SetLiaPath("4.lia");
  8263. load.SetMargins(-14, -14);
  8264. if (!load.Load())return;
  8265. LoadRect load2;
  8266. load2.SetMargins(-14, 472 + 27 - 14);
  8267. load2.SetLiaPath("5.lia");
  8268. if (!load2.Load())return;
  8269. //////////////////////////////////////////////////////////////
  8270. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2'";
  8271. g_sendhead.code[0] = 54;
  8272. g_sendhead.code[1] = 223;
  8273. g_sendhead.tabcount = 2;
  8274. g_sendhead.bsql = 0;
  8275. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  8276. CArray<CStringArray, CStringArray>sparray;
  8277. DataToArray(&g_List1array, &sparray);
  8278. CString spno;
  8279. for (int i = 0; i < sparray.GetSize(); i++)
  8280. {
  8281. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8282. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  8283. if (sparray.ElementAt(i).ElementAt(5) == "入册" && sparray.ElementAt(i).ElementAt(5) == "入底" && sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8284. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8285. spno += sparray.ElementAt(i).ElementAt(5);
  8286. if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  8287. spno += "; ";
  8288. else
  8289. {
  8290. spno += ":";
  8291. spno += sparray.ElementAt(i).ElementAt(6);
  8292. spno += "; ";
  8293. }
  8294. }
  8295. spno += " 加挑:";
  8296. for (i = 0; i < sparray.GetSize(); i++)
  8297. {
  8298. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  8299. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  8300. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  8301. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8302. spno += sparray.ElementAt(i).ElementAt(5);
  8303. if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  8304. spno += "; ";
  8305. else
  8306. {
  8307. spno += ":";
  8308. spno += sparray.ElementAt(i).ElementAt(6);
  8309. spno += "; ";
  8310. }
  8311. }
  8312. if (spno.Right(6) == " 加挑:")
  8313. {
  8314. spno = spno.Left(spno.GetLength() - 6);
  8315. }
  8316. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  8317. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  8318. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  8319. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  8320. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  8321. if (m_urgent.IsEmpty())m_urgent = "否";
  8322. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  8323. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  8324. // CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  8325. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  8326. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  8327. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  8328. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  8329. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  8330. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  8331. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  8332. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  8333. CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(17) + g_List1array.ElementAt(0).ElementAt(29);
  8334. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  8335. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  8336. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  8337. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  8338. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  8339. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  8340. CString m_sum3;
  8341. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  8342. ::ConvertToPrice(m_sum3);
  8343. if (m_money3.IsEmpty())m_money3 = "0";
  8344. // m_money3=m_money3+"/"+m_sum3;
  8345. CString name;
  8346. if (!m_name1.IsEmpty())
  8347. name = m_name1 + ",";
  8348. name += m_name2;
  8349. name.TrimRight(",");
  8350. CString phone;
  8351. if (!m_phone1.IsEmpty())
  8352. phone = m_phone1 + ",";
  8353. phone += m_phone2; phone.TrimRight(",");
  8354. if (IsHasRights2new(31) == 0)
  8355. phone = "***";
  8356. CStringArray strarray;
  8357. strarray.Add(m_urgent);
  8358. strarray.Add(m_ren);
  8359. strarray.Add(m_waiter3);
  8360. strarray.Add(name);
  8361. strarray.Add(m_time2);
  8362. strarray.Add(m_time4);
  8363. strarray.Add(m_money3);
  8364. strarray.Add(m_sum3);
  8365. strarray.Add(m_takezs);
  8366. strarray.Add(m_taoxizs);
  8367. strarray.Add(m_choosezs);
  8368. strarray.Add(strOrderNumber);
  8369. strarray.Add(phone);
  8370. ////////////////////////////////////////////////////////////////
  8371. int rcpos = -1;
  8372. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8373. Image *pImg = NULL;
  8374. #ifdef MNLS_VERSION
  8375. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  8376. #else
  8377. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  8378. #endif
  8379. m_Print.DrawImage(pImg, StrRect);
  8380. delete pImg;
  8381. m_Print.SetFontFace(11, 1, "宋体");
  8382. StrRect = load2.m_rcarray.ElementAt(7);
  8383. StrRect.top = load2.m_rcarray.ElementAt(15).top - 15;
  8384. StrRect.bottom = load2.m_rcarray.ElementAt(15).bottom - 15;
  8385. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  8386. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8387. StrRect.top += 15;
  8388. StrRect.bottom += 15;
  8389. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  8390. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8391. m_Print.SetFontFace(15, 1, "宋体");
  8392. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8393. #ifdef MNLS_VERSION
  8394. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8395. #endif
  8396. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8397. #ifdef MNLS_VERSION
  8398. m_Print.DrawRect(StrRect);
  8399. #endif
  8400. m_Print.SetFontFace(7, 1, "黑体");
  8401. m_Print.SetColor(0xffffff);
  8402. #ifdef MNLS_VERSION
  8403. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8404. #endif
  8405. m_Print.SetColor(0);
  8406. m_Print.SetFontFace(25, 1, "黑体");
  8407. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8408. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8409. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8410. {
  8411. Image *pImg = NULL;
  8412. g_nSendCode = 31;
  8413. int g_nYearposTemp = g_nYearpos;
  8414. g_nYearpos = -1;
  8415. g_pMainWnd->ProcessChatMessageRequest2(1);
  8416. g_nYearpos = g_nYearposTemp;
  8417. g_nSendCode = 0;
  8418. if (g_bSendOK == 0)return;
  8419. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8420. if (pImg)
  8421. {
  8422. StrRect.left = 450;
  8423. StrRect.top = 22;
  8424. StrRect.right = StrRect.left + 60;
  8425. StrRect.bottom = StrRect.top + 60;
  8426. m_Print.DrawImage(pImg, StrRect);
  8427. delete pImg; pImg = NULL;
  8428. }
  8429. }
  8430. #ifdef CHILD_VERSION
  8431. CString title[13] = { "是否加急:", "接单门市:", \
  8432. "选样人员:", "客人姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
  8433. "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:"
  8434. };
  8435. #else
  8436. CString title[13] = { "是否加急:", "接单门市:", \
  8437. "选样人员:", "新郎新娘姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
  8438. "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:" };
  8439. #endif
  8440. m_Print.SetFontFace(12, 1, "宋体");
  8441. for (i = 0; i < 13; i++)
  8442. {
  8443. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8444. if (i < 3)
  8445. m_Print.DrawRect2(StrRect, 0);
  8446. else
  8447. m_Print.DrawRect2(StrRect, 1);
  8448. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8449. }
  8450. for (i = 18; i <= 37; i++)
  8451. {
  8452. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8453. if (i >= 19 && i <= 21)
  8454. m_Print.DrawRect2(StrRect, 2);
  8455. /* else if(i==26)
  8456. {
  8457. CRect rc=StrRect;
  8458. CRect rc2=rc;
  8459. rc.right -=rc2.Width ()/2;
  8460. m_Print.DrawRect2(rc, 1);
  8461. rc2.left +=rc.Width ();
  8462. m_Print.DrawRect2(rc2, 1);
  8463. }*/
  8464. else
  8465. m_Print.DrawRect2(StrRect, 1);
  8466. if (i == 18)
  8467. {
  8468. StrRect.left += 5;
  8469. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8470. }
  8471. }
  8472. //////////////////////////////////////
  8473. rcpos = -1;
  8474. for (i = 0; i < 8; i++)
  8475. {
  8476. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8477. m_Print.DrawRect2(StrRect, 1);
  8478. }
  8479. #ifdef CHILD_VERSION
  8480. CString title2[4] = { "引导师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
  8481. #else
  8482. CString title2[4] = { "化妆师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
  8483. #endif
  8484. for (i = 0; i < 4; i++)
  8485. {
  8486. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8487. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8488. }
  8489. for (i = 0; i < 4; i++)
  8490. {
  8491. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8492. m_Print.DrawRect2(StrRect, 2);
  8493. }
  8494. StrRect = load2.m_rcarray.ElementAt(11);
  8495. StrRect.top -= 15;
  8496. StrRect.bottom -= 15;
  8497. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客选片签名:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8498. StrRect = load2.m_rcarray.ElementAt(15);
  8499. StrRect.top -= 15;
  8500. StrRect.bottom -= 15;
  8501. m_Print.DrawRect2(StrRect, 2);
  8502. ///////////////////////////////////////////
  8503. for (i = 19; i <= 31; i++)
  8504. {
  8505. StrRect = load.m_rcarray.ElementAt(i - 1);
  8506. StrRect.left += 4;
  8507. if (i == 31)
  8508. {
  8509. if (m_phone1.IsEmpty() == 0 && m_phone2.IsEmpty() == 0)
  8510. {
  8511. StrRect.top += 2;
  8512. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  8513. StrRect.top += 8;
  8514. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8515. }
  8516. else
  8517. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8518. }
  8519. /* else if((i-19)==7)
  8520. {
  8521. CRect rc=StrRect;
  8522. CRect rc2=rc;
  8523. rc.right -=rc2.Width ()/2;
  8524. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8525. rc2.left +=rc.Width ()+3;
  8526. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8527. }*/
  8528. else
  8529. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8530. }
  8531. strarray.RemoveAll();
  8532. strarray.Add(m_waiter2);
  8533. strarray.Add(m_waiter1);
  8534. strarray.Add(m_waiter4);
  8535. for (i = 13; i <= 15; i++)
  8536. {
  8537. StrRect = load2.m_rcarray.ElementAt(i - 1);
  8538. StrRect.left += 4;
  8539. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8540. }
  8541. ///////////spno
  8542. CRect sprc[14];
  8543. for (i = 0; i < 14; i++)
  8544. {
  8545. if (i < 7)
  8546. {
  8547. if (i == 0)
  8548. {
  8549. StrRect = load.m_rcarray.ElementAt(17); StrRect.left += 94; StrRect.right -= 3;
  8550. }
  8551. else
  8552. {
  8553. StrRect = load.m_rcarray.ElementAt(30 + i); StrRect.left += 4; StrRect.right -= 3;
  8554. }
  8555. }
  8556. else
  8557. {
  8558. StrRect = load2.m_rcarray.ElementAt(i - 7); StrRect.left += 4; StrRect.right -= 3;
  8559. }
  8560. sprc[i] = StrRect;
  8561. }
  8562. CString temp, tempspno, tempbz;
  8563. CSize size;
  8564. BOOL bRun = 0;
  8565. int fontsize = 12;
  8566. ll: tempspno = spno;
  8567. tempbz = m_bz;
  8568. m_Print.SetFontFace(fontsize, 1, "宋体");
  8569. for (i = 0; i<14; i++)
  8570. {
  8571. if (!tempspno.IsEmpty())
  8572. {
  8573. temp = tempspno;
  8574. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8575. int right = 0;
  8576. CRect temprc = sprc[i];
  8577. while (size.cx>temprc.Width())
  8578. {
  8579. right++;
  8580. temp = tempspno.Left(tempspno.GetLength() - (right));
  8581. if (GIsHalfHZ(temp))
  8582. {
  8583. right++;
  8584. temp.Delete(temp.GetLength() - 1);
  8585. }
  8586. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8587. }
  8588. if (bRun)
  8589. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8590. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  8591. if (tempspno.IsEmpty())i++;
  8592. }
  8593. else if (!tempbz.IsEmpty())
  8594. {
  8595. temp = tempbz;
  8596. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8597. int right = 0;
  8598. CRect temprc = sprc[i];
  8599. while (size.cx > temprc.Width())
  8600. {
  8601. right++;
  8602. temp = tempbz.Left(tempbz.GetLength() - (right));
  8603. if (GIsHalfHZ(temp))
  8604. {
  8605. right++;
  8606. temp.Delete(temp.GetLength() - 1);
  8607. }
  8608. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8609. }
  8610. if (bRun)
  8611. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8612. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
  8613. }
  8614. }
  8615. if (tempspno.IsEmpty() == 0 || tempbz.IsEmpty() == 0)
  8616. {
  8617. fontsize--;
  8618. goto ll;
  8619. }
  8620. if (bRun == 0)
  8621. {
  8622. bRun = 1;
  8623. goto ll;
  8624. }
  8625. PrintPreview dlg;
  8626. dlg.m_mode = 2;
  8627. dlg.m_name = name;
  8628. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  8629. dlg.m_pDC = m_Print.GetPDC();
  8630. if (aa == 0)
  8631. {
  8632. if (dlg.DoModal() != IDOK)
  8633. return;
  8634. printcot = dlg.m_num;
  8635. }
  8636. //结束打印
  8637. m_Print.EndPage();
  8638. m_Print.EndPrint();
  8639. }
  8640. }
  8641. void CMainFrame::PrintFlowChart3LKAY(CString strOrderNumber)
  8642. {
  8643. int printcot = 1;
  8644. for (int aa = 0; aa < printcot; aa++)
  8645. {
  8646. CPrintRX m_Print;
  8647. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8648. {
  8649. m_Print.InitToPrint(NULL, 1);
  8650. }
  8651. else
  8652. {
  8653. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  8654. if (name.IsEmpty())
  8655. m_Print.InitToPrint(NULL, 1);
  8656. else
  8657. {
  8658. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8659. if (nret == -1 && aa == 0)
  8660. {
  8661. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8662. }
  8663. }
  8664. }
  8665. m_Print.StartPrint();
  8666. m_Print.StartPage();
  8667. LoadRect load;
  8668. load.SetLiaPath("18.lia");
  8669. load.SetMargins(10, 0);
  8670. if (!load.Load())return;
  8671. CString str;
  8672. int rcpos = -1;
  8673. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8674. m_Print.SetFontFace(25, 1, "宋体");
  8675. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8676. m_Print.SetFontFace(15, 1, "宋体");
  8677. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8678. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8679. m_Print.SetFontFace(9, 1, "宋体");
  8680. //////////////////////////////////////////////////////////////
  8681. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  8682. g_sendhead.code[0] = 54;
  8683. g_sendhead.code[1] = 223;
  8684. g_sendhead.code[2] = 52;
  8685. g_sendhead.tabcount = 3;
  8686. g_sendhead.bsql = 0;
  8687. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  8688. CArray<CStringArray, CStringArray>sparray;
  8689. CArray<CStringArray, CStringArray>clientarray;
  8690. DataToArray(&g_List1array, &sparray, &clientarray);
  8691. CString spno;
  8692. CStringArray sparray2;
  8693. for (int i = 0; i < sparray.GetSize(); i++)
  8694. {
  8695. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8696. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  8697. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8698. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8699. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8700. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  8701. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8702. sparray2.Add(sparray.ElementAt(i).ElementAt(9));
  8703. sparray2.Add(sparray.ElementAt(i).ElementAt(10));
  8704. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8705. }
  8706. for (i = 0; i < sparray.GetSize(); i++)
  8707. {
  8708. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  8709. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  8710. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  8711. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8712. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8713. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  8714. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8715. sparray2.Add(sparray.ElementAt(i).ElementAt(9));
  8716. sparray2.Add(sparray.ElementAt(i).ElementAt(10));
  8717. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8718. }
  8719. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  8720. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  8721. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  8722. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  8723. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  8724. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  8725. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  8726. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  8727. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  8728. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  8729. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  8730. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  8731. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  8732. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  8733. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  8734. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  8735. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  8736. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  8737. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  8738. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  8739. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  8740. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  8741. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  8742. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  8743. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  8744. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  8745. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  8746. CString m_sum3;
  8747. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  8748. ::ConvertToPrice(m_sum3);
  8749. if (m_money3.IsEmpty())m_money3 = "0";
  8750. int dty = 0;
  8751. CString name;
  8752. if (!m_name1.IsEmpty())
  8753. name = m_name1 + ",";
  8754. name += m_name2;
  8755. name.TrimRight(",");
  8756. CString phone;
  8757. if (!m_phone1.IsEmpty())
  8758. phone = m_phone1 + ",";
  8759. phone += m_phone2; phone.TrimRight(",");
  8760. if (IsHasRights2new(31) == 0)
  8761. phone = "***";
  8762. CStringArray strarray;
  8763. #ifdef CHILD_VERSION
  8764. if (m_birthday.IsEmpty())
  8765. strarray.Add("姓名/性别");
  8766. else
  8767. strarray.Add("姓名/性别/年龄");
  8768. #else
  8769. strarray.Add("客人姓名");
  8770. #endif
  8771. strarray.Add("电话");
  8772. strarray.Add("单号");
  8773. strarray.Add("套系");
  8774. strarray.Add("选样");
  8775. strarray.Add("余款/加挑");
  8776. strarray.Add("选片/日期");
  8777. #ifdef CHILD_VERSION
  8778. if (m_birthday.IsEmpty())
  8779. strarray.Add(name + "/" + m_sex);
  8780. else
  8781. {
  8782. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  8783. m_birthday.Format("%d", year + 1);
  8784. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  8785. }
  8786. #else
  8787. strarray.Add(name);
  8788. #endif
  8789. strarray.Add(phone);
  8790. strarray.Add(strOrderNumber);
  8791. strarray.Add(m_taoxiname);
  8792. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8793. strarray.Add(str);
  8794. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  8795. strarray.Add(str);
  8796. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  8797. for (i = 3; i <= 16; i++)
  8798. {
  8799. StrRect = load.m_rcarray.ElementAt(i - 1);
  8800. if (i < 10)
  8801. {
  8802. m_Print.DrawRect2(StrRect, 1);
  8803. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8804. }
  8805. }
  8806. StrRect = load.m_rcarray.ElementAt(29);
  8807. m_Print.DrawRect2(StrRect, 1);
  8808. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8809. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8810. {
  8811. Image *pImg = NULL;
  8812. g_nSendCode = 31;
  8813. int g_nYearposTemp = g_nYearpos;
  8814. g_nYearpos = -1;
  8815. g_pMainWnd->ProcessChatMessageRequest2(1);
  8816. g_nYearpos = g_nYearposTemp;
  8817. g_nSendCode = 0;
  8818. if (g_bSendOK == 0)return;
  8819. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8820. if (pImg)
  8821. {
  8822. StrRect.left = 485;
  8823. StrRect.top = 12;
  8824. StrRect.right = StrRect.left + 60;
  8825. StrRect.bottom = StrRect.top + 60;
  8826. m_Print.DrawImage(pImg, StrRect);
  8827. delete pImg; pImg = NULL;
  8828. }
  8829. }
  8830. CArray<CRect, CRect>rcarray;
  8831. CStringArray strarray2;
  8832. for (i = 10; i <= 16; i++)
  8833. {
  8834. StrRect = load.m_rcarray.ElementAt(i - 1);
  8835. StrRect.left += 2;
  8836. StrRect.right -= 2;
  8837. StrRect.top += 2;
  8838. rcarray.Add(StrRect);
  8839. strarray2.Add(strarray.ElementAt(7 + i - 10));
  8840. }
  8841. if (1)
  8842. {
  8843. StrRect = load.m_rcarray.ElementAt(30);
  8844. StrRect.left += 2;
  8845. StrRect.right -= 2;
  8846. StrRect.top += 2;
  8847. rcarray.Add(StrRect);
  8848. strarray2.Add(m_time6 + "/" + m_time5);
  8849. }
  8850. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8851. for (i = 10; i <= 16; i++)
  8852. {
  8853. StrRect = load.m_rcarray.ElementAt(i - 1);
  8854. if (i == 10)
  8855. {
  8856. dty += bottom - StrRect.bottom;
  8857. }
  8858. StrRect.bottom = bottom;
  8859. m_Print.DrawRect2(StrRect, 1);
  8860. }
  8861. if (1)
  8862. {
  8863. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  8864. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  8865. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  8866. }
  8867. m_Print.SetFontFace(15, 1, "宋体");
  8868. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  8869. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8870. m_Print.SetFontFace(9, 1, "宋体");
  8871. strarray.RemoveAll();
  8872. strarray.Add("产品名称");
  8873. strarray.Add("数量");
  8874. strarray.Add("P数");
  8875. strarray.Add("张数");
  8876. strarray.Add("照片编号");
  8877. CArray<CRect, CRect>rc2array;
  8878. int wid = 25;
  8879. for (i = 18; i <= 22; i++)
  8880. {
  8881. StrRect = load.m_rcarray.ElementAt(i - 1);
  8882. if (i == 19)
  8883. {
  8884. StrRect.right = StrRect.left + wid;
  8885. }
  8886. if (i == 20)
  8887. {
  8888. StrRect = load.m_rcarray.ElementAt(i - 2);
  8889. StrRect.left += wid; StrRect.right = StrRect.left;
  8890. StrRect.right += wid;
  8891. }
  8892. if (i == 21)
  8893. {
  8894. StrRect = load.m_rcarray.ElementAt(i - 3);
  8895. StrRect.left += wid * 2; StrRect.right = StrRect.left;
  8896. StrRect.right += wid;
  8897. wid = StrRect.right;
  8898. }
  8899. if (i == 22)
  8900. {
  8901. StrRect = load.m_rcarray.ElementAt(i - 3);
  8902. StrRect.left = wid;
  8903. }
  8904. StrRect.top += dty; StrRect.bottom += dty;
  8905. m_Print.DrawRect2(StrRect, 1);
  8906. StrRect.left += 2;
  8907. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8908. StrRect.left -= 2;
  8909. StrRect.top = StrRect.bottom;
  8910. StrRect.bottom += 18;
  8911. rc2array.Add(StrRect);
  8912. }
  8913. int curypos = 0;
  8914. for (i = 0; i < sparray2.GetSize(); i += 5)
  8915. {
  8916. rcarray.RemoveAll();
  8917. strarray2.RemoveAll();
  8918. for (int j = 0; j < 5; j++)
  8919. {
  8920. StrRect = rc2array.ElementAt(j);
  8921. StrRect.left += 2;
  8922. StrRect.right -= 2;
  8923. StrRect.top += 2;
  8924. rcarray.Add(StrRect);
  8925. strarray2.Add(sparray2.ElementAt(i + j));
  8926. }
  8927. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8928. rcarray.RemoveAll();
  8929. for (j = 0; j < 5; j++)
  8930. {
  8931. StrRect = rc2array.ElementAt(j);
  8932. if (j == 0)
  8933. {
  8934. dty += bottom - StrRect.bottom;
  8935. }
  8936. StrRect.bottom = bottom;
  8937. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  8938. StrRect.top = StrRect.bottom;
  8939. StrRect.bottom += 18;
  8940. rcarray.Add(StrRect);
  8941. }
  8942. rc2array.RemoveAll();
  8943. rc2array.Copy(rcarray);
  8944. }
  8945. m_Print.SetFontFace(15, 1, "宋体");
  8946. StrRect = load.m_rcarray.ElementAt(20);
  8947. dty = curypos - StrRect.bottom + 35;
  8948. StrRect.top += dty; StrRect.bottom += dty;
  8949. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8950. m_Print.SetFontFace(9, 1, "宋体");
  8951. rcarray.RemoveAll();
  8952. strarray2.RemoveAll();
  8953. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  8954. StrRect.left += 2;
  8955. StrRect.right -= 2;
  8956. StrRect.top += 2;
  8957. rcarray.Add(StrRect);
  8958. strarray2.Add(m_bz);
  8959. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8960. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  8961. dty += bottom - StrRect.bottom;
  8962. StrRect.bottom = bottom;
  8963. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  8964. m_Print.SetFontFace(10, 1, "宋体");
  8965. StrRect = load.m_rcarray.ElementAt(22);
  8966. dty = curypos - StrRect.bottom + 25;
  8967. StrRect.top += dty; StrRect.bottom += dty;
  8968. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  8969. if (m_edit9.IsEmpty())
  8970. {
  8971. m_edit9 = "\
  8972. 经确认后的照片均排入制作流程,\r\n\
  8973. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8974. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8975. }
  8976. CString info1, info2, info3;
  8977. int newlinepos = m_edit9.Find("\r\n");
  8978. if (newlinepos != -1)
  8979. {
  8980. info1 = m_edit9.Left(newlinepos);
  8981. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8982. }
  8983. newlinepos = m_edit9.Find("\r\n");
  8984. if (newlinepos != -1)
  8985. {
  8986. info2 = m_edit9.Left(newlinepos);
  8987. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8988. info3 = m_edit9;
  8989. }
  8990. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8991. StrRect = load.m_rcarray.ElementAt(23);
  8992. StrRect.top += dty; StrRect.bottom += dty;
  8993. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8994. StrRect = load.m_rcarray.ElementAt(24);
  8995. StrRect.top += dty; StrRect.bottom += dty;
  8996. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8997. StrRect.top += 15;
  8998. StrRect.bottom += 15;
  8999. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9000. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  9001. StrRect = load.m_rcarray.ElementAt(25);
  9002. StrRect.top += dty - dy;
  9003. StrRect.bottom += dty - dy;
  9004. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9005. StrRect = load.m_rcarray.ElementAt(26);
  9006. StrRect.top += dty - dy;
  9007. StrRect.bottom += dty - dy;
  9008. m_Print.DrawRect2(StrRect, 2);
  9009. StrRect = load.m_rcarray.ElementAt(25);
  9010. StrRect.top += dty + 15 - dy;
  9011. StrRect.bottom += dty + 15 - dy;
  9012. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9013. StrRect = load.m_rcarray.ElementAt(26);
  9014. StrRect.top += dty + 15 - dy;
  9015. StrRect.bottom += dty + 15 - dy;
  9016. m_Print.DrawRect2(StrRect, 2);
  9017. StrRect = load.m_rcarray.ElementAt(25);
  9018. StrRect.top += dty + 15 * 2 - dy;
  9019. StrRect.bottom += dty + 15 * 2 - dy;
  9020. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9021. StrRect = load.m_rcarray.ElementAt(26);
  9022. StrRect.top += dty + 15 * 2 - dy;
  9023. StrRect.bottom += dty + 15 * 2 - dy;
  9024. m_Print.DrawRect2(StrRect, 2);
  9025. PrintPreview dlg; dlg.m_mode = 2;
  9026. dlg.m_name = name;
  9027. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  9028. dlg.m_pDC = m_Print.GetPDC();
  9029. if (aa == 0)
  9030. {
  9031. if (dlg.DoModal() != IDOK)
  9032. return;
  9033. printcot = dlg.m_num;
  9034. }
  9035. //结束打印
  9036. m_Print.EndPage();
  9037. m_Print.EndPrint();
  9038. }
  9039. }
  9040. void CMainFrame::PrintFlowChart3(CString strOrderNumber) // 选片打单 风格2;
  9041. {
  9042. #ifdef LKAY_VERSION
  9043. PrintFlowChart3LKAY(strOrderNumber);
  9044. return;
  9045. #endif
  9046. int printcot = 1;
  9047. for (int aa = 0; aa < printcot; aa++)
  9048. {
  9049. BOOL bSecondPage = 0;
  9050. int nPrintedPos = 0;
  9051. for (int bb = 0; bb < 2; bb++)
  9052. {
  9053. if (bb && bSecondPage == 0)break;
  9054. CPrintRX m_Print;
  9055. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58))) // 58-[version].[setcheck1] ==1,使用默认打印机;
  9056. {
  9057. m_Print.InitToPrint(NULL, 1);
  9058. }
  9059. else // 否则使用指定的打印机;
  9060. {
  9061. CString name = g_cominfoarray.ElementAt(0).ElementAt(64); // 64-[version].[printer2] 制作单打印机;
  9062. if (name.IsEmpty())
  9063. m_Print.InitToPrint(NULL, 1);
  9064. else
  9065. {
  9066. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9067. if (nret == -1 && aa == 0)
  9068. {
  9069. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9070. }
  9071. }
  9072. }
  9073. m_Print.StartPrint();
  9074. m_Print.StartPage();
  9075. LoadRect load;
  9076. load.SetLiaPath("18.lia");
  9077. load.SetMargins(10, 0);
  9078. if (!load.Load())return;
  9079. CString str;
  9080. int rcpos = -1;
  9081. // ■■■■■■从18.lia获取到第一个区域大小 - 1.显示店名;
  9082. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  9083. if ((bb == 0 && bSecondPage == 0))
  9084. {
  9085. m_Print.SetFontFace(25, 1, "宋体");
  9086. // 10-[version].[info1] 店名;
  9087. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9088. m_Print.SetFontFace(15, 1, "宋体");
  9089. // ■■■■■■从18.lia获取第二个区域大小 - 2.显示"基本资料";
  9090. StrRect = load.m_rcarray.ElementAt(++rcpos);
  9091. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9092. m_Print.SetFontFace(9, 1, "宋体");
  9093. }
  9094. //////////////////////////////////////////////////////////////
  9095. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  9096. g_sendhead.code[0] = 54; // dindan;
  9097. g_sendhead.code[1] = 223; // dindanspview2; shangpin+dindansp;
  9098. g_sendhead.code[2] = 52; // client;
  9099. g_sendhead.tabcount = 3;
  9100. g_sendhead.bsql = 0;
  9101. g_pMainWnd->ProcessChatMessageRequest2(filter);
  9102. if (g_bSendOK == 0)return;
  9103. CArray<CStringArray, CStringArray>sparray;
  9104. CArray<CStringArray, CStringArray>clientarray;
  9105. DataToArray(&g_List1array, &sparray, &clientarray);
  9106. CString spno;
  9107. CStringArray sparray2;
  9108. for (int i = 0; i < sparray.GetSize(); i++)
  9109. {
  9110. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9111. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  9112. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  9113. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9114. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  9115. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9116. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  9117. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  9118. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  9119. }
  9120. for (i = 0; i < sparray.GetSize(); i++)
  9121. {
  9122. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  9123. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  9124. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  9125. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9126. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  9127. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9128. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  9129. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  9130. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  9131. }
  9132. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  9133. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  9134. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  9135. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  9136. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  9137. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  9138. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  9139. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  9140. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  9141. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  9142. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  9143. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  9144. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  9145. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  9146. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  9147. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  9148. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  9149. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  9150. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  9151. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  9152. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  9153. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  9154. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  9155. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  9156. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  9157. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  9158. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  9159. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  9160. CString m_sum3;
  9161. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  9162. ::ConvertToPrice(m_sum3);
  9163. if (m_money3.IsEmpty())m_money3 = "0";
  9164. int dty = 0;
  9165. CString name;
  9166. if (!m_name1.IsEmpty())
  9167. name = m_name1 + ",";
  9168. name += m_name2;
  9169. name.TrimRight(",");
  9170. CString phone;
  9171. if (!m_phone1.IsEmpty())
  9172. phone = m_phone1 + ",";
  9173. phone += m_phone2; phone.TrimRight(",");
  9174. if (IsHasRights2new(31) == 0)
  9175. phone = "***";
  9176. CStringArray strarray;
  9177. CArray<CRect, CRect>rcarray;
  9178. CStringArray strarray2; CArray<CRect, CRect>rc2array;
  9179. int bottom;
  9180. if ((bb == 0 && bSecondPage == 0))
  9181. {
  9182. #ifdef CHILD_VERSION
  9183. if (m_birthday.IsEmpty())
  9184. strarray.Add("姓名/性别");
  9185. else
  9186. strarray.Add("姓名/性别/年龄");
  9187. #else
  9188. strarray.Add("客人姓名"); // 第3.1区域 -3.显示客人姓名;
  9189. #endif
  9190. strarray.Add("电话");
  9191. strarray.Add("单号");
  9192. strarray.Add("套系");
  9193. strarray.Add("选样");
  9194. strarray.Add("余款/加挑");
  9195. strarray.Add("选片/日期");
  9196. #ifdef CHILD_VERSION
  9197. if (m_birthday.IsEmpty())
  9198. strarray.Add(name + "/" + m_sex);
  9199. else
  9200. {
  9201. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  9202. m_birthday.Format("%d", year + 1);
  9203. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  9204. }
  9205. #else
  9206. strarray.Add(name); // 第4.1区域 -3.显示客人姓名;
  9207. #endif
  9208. strarray.Add(phone);
  9209. strarray.Add(strOrderNumber);
  9210. strarray.Add(m_taoxiname);
  9211. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9212. strarray.Add(str);
  9213. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  9214. strarray.Add(str);
  9215. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  9216. for (i = 3; i <= 16; i++)
  9217. {
  9218. // ■■■■■■从18.lia中获取第3~16的区域大小;
  9219. StrRect = load.m_rcarray.ElementAt(i - 1);
  9220. if (i < 10)
  9221. {
  9222. m_Print.DrawRect2(StrRect, 1);
  9223. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9224. }
  9225. }
  9226. // ■■■■■■从18.lia中获取第30的区域大小;
  9227. StrRect = load.m_rcarray.ElementAt(29);
  9228. m_Print.DrawRect2(StrRect, 1);
  9229. BOOL bPrintDate = 1;
  9230. #ifdef DDF_VERSION
  9231. // bPrintDate=0;
  9232. #else
  9233. if (m_time5 == "" && m_time6 == "")
  9234. bPrintDate = 0;
  9235. #endif
  9236. if (bPrintDate)
  9237. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9238. else
  9239. {
  9240. #ifdef CHILD_VERSION
  9241. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9242. #else
  9243. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9244. #endif
  9245. }
  9246. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138))) // [version].[reverse3]
  9247. {
  9248. Image *pImg = NULL;
  9249. g_nSendCode = 31;
  9250. int g_nYearposTemp = g_nYearpos;
  9251. g_nYearpos = -1;
  9252. g_pMainWnd->ProcessChatMessageRequest2(1);
  9253. g_nYearpos = g_nYearposTemp;
  9254. g_nSendCode = 0;
  9255. if (g_bSendOK == 0)return;
  9256. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  9257. // Jeff二维码的区域不是从18.lia里获取的,是固定在右上角指定区域;
  9258. if (pImg)
  9259. {
  9260. StrRect.left = 485;
  9261. StrRect.top = 12;
  9262. StrRect.right = StrRect.left + 60;
  9263. StrRect.bottom = StrRect.top + 60;
  9264. m_Print.DrawImage(pImg, StrRect);
  9265. delete pImg; pImg = NULL;
  9266. }
  9267. }
  9268. // CArray<CRect,CRect>rcarray;
  9269. // CStringArray strarray2;
  9270. // ■■■■■■从18.lia中获取第10的区域大小;
  9271. for (i = 10; i <= 16; i++)
  9272. {
  9273. StrRect = load.m_rcarray.ElementAt(i - 1);
  9274. StrRect.left += 2;
  9275. StrRect.right -= 2;
  9276. StrRect.top += 2;
  9277. rcarray.Add(StrRect);
  9278. strarray2.Add(strarray.ElementAt(7 + i - 10));
  9279. }
  9280. if (1)
  9281. {
  9282. // ■■■■■■从18.lia中获取第31的区域大小;
  9283. StrRect = load.m_rcarray.ElementAt(30);
  9284. StrRect.left += 2;
  9285. StrRect.right -= 2;
  9286. StrRect.top += 2;
  9287. rcarray.Add(StrRect);
  9288. if (bPrintDate)
  9289. strarray2.Add(m_time6 + "/" + m_time5);
  9290. else
  9291. {
  9292. strarray2.Add(m_waiter1 + "/" + m_waiter2);
  9293. }
  9294. }
  9295. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9296. for (i = 10; i <= 16; i++)
  9297. {
  9298. StrRect = load.m_rcarray.ElementAt(i - 1);
  9299. if (i == 10)
  9300. {
  9301. dty += bottom - StrRect.bottom;
  9302. }
  9303. StrRect.bottom = bottom;
  9304. m_Print.DrawRect2(StrRect, 1);
  9305. }
  9306. if (1)
  9307. {
  9308. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  9309. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  9310. }
  9311. m_Print.SetFontFace(15, 1, "宋体");
  9312. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  9313. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9314. }
  9315. int curypos = 0;
  9316. int oldpos = 0;
  9317. if (bb == 1)
  9318. {
  9319. dty = -100;
  9320. oldpos = nPrintedPos;
  9321. if (oldpos == 0)oldpos = 10000;
  9322. }
  9323. m_Print.SetFontFace(9, 1, "宋体");
  9324. strarray.RemoveAll();
  9325. if ((oldpos != 10000 && oldpos < sparray2.GetSize()) || bb == 0)
  9326. {
  9327. strarray.Add("产品名称");
  9328. strarray.Add("数量");
  9329. strarray.Add("照片编号");
  9330. for (i = 18; i <= 20; i++)
  9331. {
  9332. StrRect = load.m_rcarray.ElementAt(i - 1);
  9333. StrRect.top += dty;
  9334. StrRect.bottom += dty;
  9335. m_Print.DrawRect2(StrRect, 1);
  9336. StrRect.left += 2;
  9337. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9338. StrRect.left -= 2;
  9339. StrRect.top = StrRect.bottom;
  9340. StrRect.bottom += 18;
  9341. rc2array.Add(StrRect);
  9342. }
  9343. }
  9344. for (i = oldpos; i < sparray2.GetSize(); i += 3)
  9345. {
  9346. rcarray.RemoveAll();
  9347. strarray2.RemoveAll();
  9348. for (int j = 0; j < 3; j++)
  9349. {
  9350. StrRect = rc2array.ElementAt(j);
  9351. StrRect.left += 2;
  9352. StrRect.right -= 2;
  9353. StrRect.top += 2;
  9354. rcarray.Add(StrRect);
  9355. #if JEFF_TEST_ON
  9356. if (2 == j)
  9357. {
  9358. CString strImg = sparray2.ElementAt(i + 2);
  9359. int nImgCount = strImg.Replace(",", ",");
  9360. if (nImgCount != 0)
  9361. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
  9362. else if (!strImg.IsEmpty())
  9363. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  9364. strarray2.Add(strImg);
  9365. }
  9366. else
  9367. strarray2.Add(sparray2.ElementAt(i + j));
  9368. #else
  9369. strarray2.Add(sparray2.ElementAt(i + j));
  9370. #endif
  9371. }
  9372. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9373. rcarray.RemoveAll();
  9374. for (j = 0; j < 3; j++)
  9375. {
  9376. StrRect = rc2array.ElementAt(j);
  9377. if (j == 0)
  9378. {
  9379. dty += bottom - StrRect.bottom;
  9380. }
  9381. StrRect.bottom = bottom;
  9382. m_Print.DrawRect2(StrRect, 1);
  9383. curypos = StrRect.bottom;
  9384. StrRect.top = StrRect.bottom;
  9385. StrRect.bottom += 18;
  9386. rcarray.Add(StrRect);
  9387. }
  9388. rc2array.RemoveAll();
  9389. rc2array.Copy(rcarray);
  9390. if (bottom > 750)
  9391. {
  9392. bSecondPage = 1;
  9393. nPrintedPos = i + 3;
  9394. break;
  9395. }
  9396. }
  9397. if ((bb == 0 && bSecondPage == 0) || (bb == 1 && bSecondPage == 1))
  9398. {
  9399. m_Print.SetFontFace(15, 1, "宋体");
  9400. StrRect = load.m_rcarray.ElementAt(20);
  9401. dty = curypos - StrRect.bottom + 35;
  9402. StrRect.top += dty;
  9403. StrRect.bottom += dty;
  9404. if (StrRect.bottom > 700 && bb == 0)
  9405. {
  9406. bSecondPage = 1;
  9407. }
  9408. else
  9409. {
  9410. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9411. m_Print.SetFontFace(9, 1, "宋体");
  9412. rcarray.RemoveAll();
  9413. strarray2.RemoveAll();
  9414. StrRect = load.m_rcarray.ElementAt(21);
  9415. StrRect.top += dty;
  9416. StrRect.bottom += dty;
  9417. StrRect.left += 2;
  9418. StrRect.right -= 2;
  9419. StrRect.top += 2;
  9420. rcarray.Add(StrRect);
  9421. #if JEFF_TEST_ON
  9422. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  9423. strarray2.RemoveAll();
  9424. CString strFind = "要求:";
  9425. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  9426. do
  9427. {
  9428. int nIndex = strbz3.Find(strFind, 1);
  9429. if (nIndex != -1)
  9430. {
  9431. CString strbz = strbz3.Left(nIndex);
  9432. strbz3 = strbz3.Mid(nIndex);
  9433. strarray2.Add(strbz);
  9434. }
  9435. else
  9436. {
  9437. strarray2.Add(strbz3);
  9438. strbz3 = "";
  9439. }
  9440. } while (strbz3.Find(strFind) != -1);
  9441. strarray2.Add(g_List1array.ElementAt(0).ElementAt(29));
  9442. strarray2.Add(g_List1array.ElementAt(0).ElementAt(23));
  9443. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  9444. #else
  9445. strarray2.Add(m_bz);
  9446. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9447. #endif
  9448. StrRect = load.m_rcarray.ElementAt(21);
  9449. StrRect.top += dty;
  9450. StrRect.bottom += dty;
  9451. dty += bottom - StrRect.bottom;
  9452. StrRect.bottom = bottom;
  9453. m_Print.DrawRect2(StrRect, 1);
  9454. curypos = StrRect.bottom;
  9455. m_Print.SetFontFace(10, 1, "宋体");
  9456. StrRect = load.m_rcarray.ElementAt(22);
  9457. dty = curypos - StrRect.bottom + 25;
  9458. StrRect.top += dty;
  9459. StrRect.bottom += dty;
  9460. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  9461. if (m_edit9.IsEmpty())
  9462. {
  9463. m_edit9 = "\
  9464. 经确认后的照片均排入制作流程,\r\n\
  9465. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9466. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9467. }
  9468. CString info1, info2, info3;
  9469. int newlinepos = m_edit9.Find("\r\n");
  9470. if (newlinepos != -1)
  9471. {
  9472. info1 = m_edit9.Left(newlinepos);
  9473. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9474. }
  9475. newlinepos = m_edit9.Find("\r\n");
  9476. if (newlinepos != -1)
  9477. {
  9478. info2 = m_edit9.Left(newlinepos);
  9479. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9480. info3 = m_edit9;
  9481. }
  9482. #ifdef QCH_VERSION
  9483. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9484. StrRect = load.m_rcarray.ElementAt(23);
  9485. StrRect.top += dty; StrRect.bottom += dty;
  9486. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9487. StrRect=load.m_rcarray .ElementAt (24);
  9488. StrRect.top +=dty;StrRect.bottom +=dty;
  9489. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9490. StrRect.top +=15;
  9491. StrRect.bottom +=15;
  9492. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9493. #else
  9494. if (1)
  9495. {
  9496. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9497. StrRect = load.m_rcarray.ElementAt(23);
  9498. StrRect.top += dty; StrRect.bottom += dty;
  9499. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9500. StrRect = load.m_rcarray.ElementAt(24);
  9501. StrRect.top += dty; StrRect.bottom += dty;
  9502. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9503. }
  9504. else
  9505. {
  9506. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9507. StrRect = load.m_rcarray.ElementAt(23);
  9508. StrRect.top += dty; StrRect.bottom += dty;
  9509. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9510. StrRect = load.m_rcarray.ElementAt(24);
  9511. StrRect.top += dty; StrRect.bottom += dty;
  9512. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9513. }
  9514. StrRect.top += 15;
  9515. StrRect.bottom += 15;
  9516. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9517. #endif
  9518. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  9519. StrRect = load.m_rcarray.ElementAt(25);
  9520. StrRect.top += dty - dy;
  9521. StrRect.bottom += dty - dy;
  9522. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9523. StrRect = load.m_rcarray.ElementAt(26);
  9524. StrRect.top += dty - dy;
  9525. StrRect.bottom += dty - dy;
  9526. m_Print.DrawRect2(StrRect, 2);
  9527. StrRect = load.m_rcarray.ElementAt(25);
  9528. StrRect.top += dty + 15 - dy;
  9529. StrRect.bottom += dty + 15 - dy;
  9530. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9531. StrRect = load.m_rcarray.ElementAt(26);
  9532. StrRect.top += dty + 15 - dy;
  9533. StrRect.bottom += dty + 15 - dy;
  9534. m_Print.DrawRect2(StrRect, 2);
  9535. StrRect = load.m_rcarray.ElementAt(25);
  9536. StrRect.top += dty + 15 * 2 - dy;
  9537. StrRect.bottom += dty + 15 * 2 - dy;
  9538. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9539. StrRect = load.m_rcarray.ElementAt(26);
  9540. StrRect.top += dty + 15 * 2 - dy;
  9541. StrRect.bottom += dty + 15 * 2 - dy;
  9542. m_Print.DrawRect2(StrRect, 2);
  9543. }
  9544. }
  9545. PrintPreview dlg; dlg.m_mode = 2;
  9546. dlg.m_name = name;
  9547. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  9548. dlg.m_pDC = m_Print.GetPDC();
  9549. if (aa == 0)
  9550. {
  9551. if (dlg.DoModal() != IDOK)
  9552. return;
  9553. printcot = dlg.m_num;
  9554. }
  9555. //结束打印
  9556. m_Print.EndPage();
  9557. m_Print.EndPrint();
  9558. }
  9559. }
  9560. }
  9561. /*
  9562. void CMainFrame::PrintFlowChart3(CString m_id)
  9563. {
  9564. #ifdef LKAY_VERSION
  9565. PrintFlowChart3LKAY(m_id);
  9566. return;
  9567. #endif
  9568. int printcot=1;
  9569. for(int aa=0; aa<printcot; aa++)
  9570. {
  9571. CPrintRX m_Print;
  9572. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9573. {
  9574. m_Print.InitToPrint(NULL, 1);
  9575. }
  9576. else
  9577. {
  9578. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  9579. if(name.IsEmpty ())
  9580. m_Print.InitToPrint(NULL, 1);
  9581. else
  9582. {
  9583. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9584. if(nret==-1 && aa==0)
  9585. {
  9586. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9587. }
  9588. }
  9589. }
  9590. m_Print.StartPrint();
  9591. m_Print.StartPage();
  9592. LoadRect load;
  9593. load.SetLiaPath ("18.lia");
  9594. load.SetMargins(10,0);
  9595. if(!load.Load ())return;
  9596. CString str;
  9597. int rcpos=-1;
  9598. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9599. m_Print.SetFontFace(25, 1, "宋体");
  9600. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9601. m_Print.SetFontFace(15, 1, "宋体");
  9602. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9603. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9604. m_Print.SetFontFace(9, 1, "宋体");
  9605. //////////////////////////////////////////////////////////////
  9606. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9607. g_sendhead.code[0]=54;
  9608. g_sendhead.code[1]=50;
  9609. g_sendhead.code[2]=52;
  9610. g_sendhead.tabcount=3;
  9611. g_sendhead.bsql=0;
  9612. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9613. CArray<CStringArray, CStringArray>sparray;
  9614. CArray<CStringArray, CStringArray>clientarray;
  9615. DataToArray(&g_List1array,&sparray,&clientarray);
  9616. CString spno;
  9617. CStringArray sparray2;
  9618. for(int i=0; i<sparray.GetSize (); i++)
  9619. {
  9620. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9621. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9622. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9623. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9624. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9625. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9626. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9627. }
  9628. for( i=0; i<sparray.GetSize (); i++)
  9629. {
  9630. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9631. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9632. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9633. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9634. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9635. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9636. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9637. }
  9638. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9639. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9640. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9641. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9642. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9643. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9644. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9645. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9646. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9647. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9648. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9649. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9650. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9651. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9652. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9653. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9654. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9655. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9656. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  9657. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  9658. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9659. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9660. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9661. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9662. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9663. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9664. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9665. CString m_sum3;
  9666. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9667. ::ConvertToPrice (m_sum3);
  9668. if(m_money3.IsEmpty ())m_money3="0";
  9669. int dty=0;
  9670. CString name;
  9671. if(!m_name1.IsEmpty ())
  9672. name=m_name1+",";
  9673. name+=m_name2;
  9674. name.TrimRight (",");
  9675. CString phone;
  9676. if(!m_phone1.IsEmpty ())
  9677. phone=m_phone1+",";
  9678. phone+=m_phone2;phone.TrimRight (",");
  9679. if(IsHasRights2new(31)==0)
  9680. phone="***";
  9681. CStringArray strarray;
  9682. #ifdef CHILD_VERSION
  9683. if(m_birthday.IsEmpty ())
  9684. strarray.Add ("姓名/性别");
  9685. else
  9686. strarray.Add ("姓名/性别/年龄");
  9687. #else
  9688. strarray.Add ("客人姓名");
  9689. #endif
  9690. strarray.Add ("电话");
  9691. strarray.Add ("单号");
  9692. strarray.Add ("套系");
  9693. strarray.Add ("选样");
  9694. strarray.Add ("余款/加挑");
  9695. strarray.Add ("选片/日期");
  9696. #ifdef CHILD_VERSION
  9697. if(m_birthday.IsEmpty ())
  9698. strarray.Add (name+"/"+m_sex);
  9699. else
  9700. {
  9701. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9702. m_birthday.Format ("%d", year+1);
  9703. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9704. }
  9705. #else
  9706. strarray.Add (name);
  9707. #endif
  9708. strarray.Add (phone);
  9709. strarray.Add (m_id);
  9710. strarray.Add (m_taoxiname);
  9711. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9712. strarray.Add (str);
  9713. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9714. strarray.Add (str);
  9715. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  9716. for( i=3; i<=16; i++)
  9717. {
  9718. StrRect=load.m_rcarray .ElementAt (i-1);
  9719. if(i<10)
  9720. {
  9721. m_Print.DrawRect2(StrRect, 1);
  9722. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9723. }
  9724. }
  9725. StrRect=load.m_rcarray .ElementAt (29);
  9726. m_Print.DrawRect2(StrRect, 1);
  9727. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9728. CArray<CRect,CRect>rcarray;
  9729. CStringArray strarray2;
  9730. for( i=10; i<=16; i++)
  9731. {
  9732. StrRect=load.m_rcarray .ElementAt (i-1);
  9733. StrRect.left +=2;
  9734. StrRect.right -=2;
  9735. StrRect.top +=2;
  9736. rcarray.Add (StrRect);
  9737. strarray2.Add (strarray.ElementAt (7+i-10));
  9738. }
  9739. if(1)
  9740. {
  9741. StrRect=load.m_rcarray .ElementAt (30);
  9742. StrRect.left +=2;
  9743. StrRect.right -=2;
  9744. StrRect.top +=2;
  9745. rcarray.Add (StrRect);
  9746. strarray2.Add (m_time6+"/"+m_time5);
  9747. }
  9748. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9749. for( i=10; i<=16; i++)
  9750. {
  9751. StrRect=load.m_rcarray .ElementAt (i-1);
  9752. if(i==10)
  9753. {
  9754. dty+=bottom-StrRect.bottom;
  9755. }
  9756. StrRect.bottom =bottom;
  9757. m_Print.DrawRect2(StrRect, 1);
  9758. }
  9759. if(1)
  9760. {
  9761. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9762. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9763. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  9764. }
  9765. m_Print.SetFontFace(15, 1, "宋体");
  9766. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9767. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9768. m_Print.SetFontFace(9, 1, "宋体");
  9769. strarray.RemoveAll ();
  9770. strarray.Add ("产品名称");
  9771. strarray.Add ("数量");
  9772. strarray.Add ("照片编号");
  9773. CArray<CRect,CRect>rc2array;
  9774. for( i=18; i<=20; i++)
  9775. {
  9776. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9777. m_Print.DrawRect2(StrRect, 1);
  9778. StrRect.left +=2;
  9779. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9780. StrRect.left -=2;
  9781. StrRect.top =StrRect.bottom ;
  9782. StrRect.bottom +=18;
  9783. rc2array.Add (StrRect);
  9784. }
  9785. int curypos=0;
  9786. for(i=0; i<sparray2.GetSize (); i+=3)
  9787. {
  9788. rcarray.RemoveAll ();
  9789. strarray2.RemoveAll ();
  9790. for(int j=0; j<3; j++)
  9791. {
  9792. StrRect=rc2array.ElementAt (j);
  9793. StrRect.left +=2;
  9794. StrRect.right -=2;
  9795. StrRect.top +=2;
  9796. rcarray.Add (StrRect);
  9797. strarray2.Add (sparray2.ElementAt (i+j));
  9798. }
  9799. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9800. rcarray.RemoveAll ();
  9801. for( j=0; j<3; j++)
  9802. {
  9803. StrRect=rc2array.ElementAt (j);
  9804. if(j==0)
  9805. {
  9806. dty+=bottom-StrRect.bottom;
  9807. }
  9808. StrRect.bottom =bottom;
  9809. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9810. StrRect.top =StrRect.bottom ;
  9811. StrRect.bottom +=18;
  9812. rcarray.Add (StrRect);
  9813. }
  9814. rc2array.RemoveAll ();
  9815. rc2array.Copy(rcarray);
  9816. }
  9817. m_Print.SetFontFace(15, 1, "宋体");
  9818. StrRect=load.m_rcarray .ElementAt (20);
  9819. dty=curypos-StrRect.bottom+35;
  9820. StrRect.top +=dty;StrRect.bottom +=dty;
  9821. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9822. m_Print.SetFontFace(9, 1, "宋体");
  9823. rcarray.RemoveAll ();
  9824. strarray2.RemoveAll ();
  9825. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9826. StrRect.left +=2;
  9827. StrRect.right -=2;
  9828. StrRect.top +=2;
  9829. rcarray.Add (StrRect);
  9830. strarray2.Add (m_bz);
  9831. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9832. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9833. dty+=bottom-StrRect.bottom;
  9834. StrRect.bottom =bottom;
  9835. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9836. m_Print.SetFontFace(10, 1, "宋体");
  9837. StrRect=load.m_rcarray .ElementAt (22);
  9838. dty=curypos-StrRect.bottom+25;
  9839. StrRect.top +=dty;StrRect.bottom +=dty;
  9840. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9841. if(m_edit9.IsEmpty())
  9842. {
  9843. m_edit9="\
  9844. 经确认后的照片均排入制作流程,\r\n\
  9845. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9846. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9847. }
  9848. CString info1,info2,info3;
  9849. int newlinepos=m_edit9.Find("\r\n");
  9850. if(newlinepos!=-1)
  9851. {
  9852. info1=m_edit9.Left(newlinepos);
  9853. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9854. }
  9855. newlinepos=m_edit9.Find("\r\n");
  9856. if(newlinepos!=-1)
  9857. {
  9858. info2=m_edit9.Left(newlinepos);
  9859. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9860. info3=m_edit9;
  9861. }
  9862. #ifdef QCH_VERSION
  9863. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9864. StrRect=load.m_rcarray .ElementAt (23);
  9865. StrRect.top +=dty;StrRect.bottom +=dty;
  9866. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9867. StrRect=load.m_rcarray .ElementAt (24);
  9868. StrRect.top +=dty;StrRect.bottom +=dty;
  9869. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9870. StrRect.top +=15;
  9871. StrRect.bottom +=15;
  9872. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9873. #else
  9874. if(1)
  9875. {
  9876. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9877. StrRect=load.m_rcarray .ElementAt (23);
  9878. StrRect.top +=dty;StrRect.bottom +=dty;
  9879. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9880. StrRect=load.m_rcarray .ElementAt (24);
  9881. StrRect.top +=dty;StrRect.bottom +=dty;
  9882. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9883. }
  9884. else
  9885. {
  9886. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9887. StrRect=load.m_rcarray .ElementAt (23);
  9888. StrRect.top +=dty;StrRect.bottom +=dty;
  9889. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9890. StrRect=load.m_rcarray .ElementAt (24);
  9891. StrRect.top +=dty;StrRect.bottom +=dty;
  9892. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9893. }
  9894. StrRect.top +=15;
  9895. StrRect.bottom +=15;
  9896. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9897. #endif
  9898. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  9899. StrRect=load.m_rcarray .ElementAt (25);
  9900. StrRect.top +=dty-dy;
  9901. StrRect.bottom +=dty-dy;
  9902. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9903. StrRect=load.m_rcarray .ElementAt (26);
  9904. StrRect.top +=dty-dy;
  9905. StrRect.bottom +=dty-dy;
  9906. m_Print.DrawRect2(StrRect, 2);
  9907. StrRect=load.m_rcarray .ElementAt (25);
  9908. StrRect.top +=dty+15-dy;
  9909. StrRect.bottom +=dty+15-dy;
  9910. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9911. StrRect=load.m_rcarray .ElementAt (26);
  9912. StrRect.top +=dty+15-dy;
  9913. StrRect.bottom +=dty+15-dy;
  9914. m_Print.DrawRect2(StrRect, 2);
  9915. StrRect=load.m_rcarray .ElementAt (25);
  9916. StrRect.top +=dty+15*2-dy;
  9917. StrRect.bottom +=dty+15*2-dy;
  9918. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9919. StrRect=load.m_rcarray .ElementAt (26);
  9920. StrRect.top +=dty+15*2-dy;
  9921. StrRect.bottom +=dty+15*2-dy;
  9922. m_Print.DrawRect2(StrRect, 2);
  9923. PrintPreview dlg;dlg.m_mode=2;
  9924. dlg.m_name =name;
  9925. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9926. dlg.m_pDC =m_Print.GetPDC() ;
  9927. if(aa==0)
  9928. {
  9929. if(dlg.DoModal ()!=IDOK)
  9930. return;
  9931. printcot=dlg.m_num;
  9932. }
  9933. //结束打印
  9934. m_Print.EndPage();
  9935. m_Print.EndPrint();
  9936. }
  9937. }
  9938. */
  9939. //void CMainFrame::PrintFlowChart4(CString m_id) // 选设计打单函数;
  9940. void CMainFrame::PrintFlowChart4(CString strOrderNumber) // 选设计打单函数,使用18.lia文件;
  9941. {
  9942. int printcot = 1;
  9943. for (int aa = 0; aa < printcot; aa++)
  9944. {
  9945. CPrintRX m_Print;
  9946. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9947. {
  9948. m_Print.InitToPrint(NULL, 1);
  9949. }
  9950. else
  9951. {
  9952. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  9953. if (name.IsEmpty())
  9954. m_Print.InitToPrint(NULL, 1);
  9955. else
  9956. {
  9957. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9958. if (nret == -1 && aa == 0)
  9959. {
  9960. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9961. }
  9962. }
  9963. }
  9964. m_Print.StartPrint();
  9965. m_Print.StartPage();
  9966. LoadRect load;
  9967. load.SetLiaPath("18.lia");
  9968. load.SetMargins(10, 0);
  9969. if (!load.Load())return;
  9970. CString str;
  9971. int rcpos = -1;
  9972. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  9973. m_Print.SetFontFace(25, 1, "宋体");
  9974. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9975. m_Print.SetFontFace(15, 1, "宋体");
  9976. StrRect = load.m_rcarray.ElementAt(++rcpos);
  9977. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9978. m_Print.SetFontFace(9, 1, "宋体");
  9979. //////////////////////////////////////////////////////////////
  9980. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  9981. g_sendhead.code[0] = 54;
  9982. g_sendhead.code[1] = 223;
  9983. g_sendhead.code[2] = 52;
  9984. g_sendhead.tabcount = 3;
  9985. g_sendhead.bsql = 0;
  9986. g_pMainWnd->ProcessChatMessageRequest2(filter);
  9987. if (g_bSendOK == 0)return;
  9988. CArray<CStringArray, CStringArray>sparray;
  9989. CArray<CStringArray, CStringArray>clientarray;
  9990. DataToArray(&g_List1array, &sparray, &clientarray);
  9991. CString spno;
  9992. CStringArray sparray2;
  9993. for (int i = 0; i < sparray.GetSize(); i++)
  9994. {
  9995. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  9996. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(8).IsEmpty())continue;
  9997. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9998. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9999. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  10000. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  10001. sparray2.Add(sparray.ElementAt(i).ElementAt(8));
  10002. }
  10003. for (i = 0; i < sparray.GetSize(); i++)
  10004. {
  10005. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  10006. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  10007. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  10008. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  10009. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  10010. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  10011. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  10012. sparray2.Add(sparray.ElementAt(i).ElementAt(8));
  10013. }
  10014. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  10015. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  10016. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  10017. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  10018. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  10019. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  10020. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  10021. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  10022. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  10023. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  10024. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  10025. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  10026. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  10027. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  10028. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  10029. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  10030. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  10031. CString m_bz = g_List1array.ElementAt(0).ElementAt(17);
  10032. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(25);
  10033. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  10034. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  10035. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  10036. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  10037. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  10038. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  10039. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  10040. CString m_waiter8 = g_List1array.ElementAt(0).ElementAt(27);
  10041. CString m_replace = g_List1array.ElementAt(0).ElementAt(28);
  10042. if (!m_replace.IsEmpty())
  10043. {
  10044. m_replace = "设计替换照片:" + m_replace;
  10045. m_replace.Replace("$", ";");
  10046. m_replace.TrimLeft(";");
  10047. m_bz += ";";
  10048. m_bz += m_replace;
  10049. }
  10050. CString m_sum3;
  10051. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  10052. ::ConvertToPrice(m_sum3);
  10053. if (m_money3.IsEmpty())m_money3 = "0";
  10054. int dty = 0;
  10055. CString name;
  10056. if (!m_name1.IsEmpty())
  10057. name = m_name1 + ",";
  10058. name += m_name2;
  10059. name.TrimRight(",");
  10060. CString phone;
  10061. if (!m_phone1.IsEmpty())
  10062. phone = m_phone1 + ",";
  10063. phone += m_phone2; phone.TrimRight(",");
  10064. if (IsHasRights2new(31) == 0)
  10065. phone = "***";
  10066. CStringArray strarray;
  10067. #ifdef CHILD_VERSION
  10068. if (m_birthday.IsEmpty())
  10069. strarray.Add("姓名/性别");
  10070. else
  10071. strarray.Add("姓名/性别/年龄");
  10072. #else
  10073. strarray.Add("客人姓名");
  10074. #endif
  10075. strarray.Add("电话");
  10076. strarray.Add("单号");
  10077. strarray.Add("套系");
  10078. strarray.Add("");
  10079. strarray.Add("余款/加挑");
  10080. strarray.Add("看设计/日期");
  10081. #ifdef CHILD_VERSION
  10082. if (m_birthday.IsEmpty())
  10083. strarray.Add(name + "/" + m_sex);
  10084. else
  10085. {
  10086. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  10087. m_birthday.Format("%d", year + 1);
  10088. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  10089. }
  10090. #else
  10091. strarray.Add(name);
  10092. #endif
  10093. strarray.Add(phone);
  10094. strarray.Add(strOrderNumber);
  10095. strarray.Add(m_taoxiname);
  10096. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  10097. strarray.Add("");
  10098. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  10099. strarray.Add(str);
  10100. strarray.Add(m_waiter8 + "/" + m_time6);
  10101. //////////////////////////////////////////////
  10102. if (1)
  10103. {
  10104. StrRect = load.m_rcarray.ElementAt(6);
  10105. int addwid = StrRect.Width() / 6;
  10106. for (i = 3; i <= 6; i++)
  10107. {
  10108. StrRect = load.m_rcarray.ElementAt(i - 1);
  10109. StrRect.left += (i - 3)*addwid;
  10110. StrRect.right += (i - 2)*addwid;
  10111. load.m_rcarray.SetAt(i - 1, StrRect);
  10112. }
  10113. StrRect.left = StrRect.right = -1;
  10114. load.m_rcarray.SetAt(6, StrRect);
  10115. for (i = 10; i <= 13; i++)
  10116. {
  10117. StrRect = load.m_rcarray.ElementAt(i - 1);
  10118. StrRect.left += (i - 10)*addwid;
  10119. StrRect.right += (i - 9)*addwid;
  10120. load.m_rcarray.SetAt(i - 1, StrRect);
  10121. }
  10122. StrRect.left = StrRect.right = -1;
  10123. load.m_rcarray.SetAt(13, StrRect);
  10124. StrRect = load.m_rcarray.ElementAt(7);
  10125. int rcwid = StrRect.Width();
  10126. StrRect.left = load.m_rcarray.ElementAt(5).right;
  10127. StrRect.right = StrRect.left + rcwid + addwid;
  10128. load.m_rcarray.SetAt(7, StrRect);
  10129. StrRect = load.m_rcarray.ElementAt(8);
  10130. StrRect.left = load.m_rcarray.ElementAt(7).right;
  10131. StrRect.right = load.m_rcarray.ElementAt(29).left;
  10132. load.m_rcarray.SetAt(8, StrRect);
  10133. StrRect = load.m_rcarray.ElementAt(14);
  10134. rcwid = StrRect.Width();
  10135. StrRect.left = load.m_rcarray.ElementAt(12).right;
  10136. StrRect.right = StrRect.left + rcwid + addwid;
  10137. load.m_rcarray.SetAt(14, StrRect);
  10138. StrRect = load.m_rcarray.ElementAt(15);
  10139. StrRect.left = load.m_rcarray.ElementAt(14).right;
  10140. StrRect.right = load.m_rcarray.ElementAt(29).left;
  10141. load.m_rcarray.SetAt(15, StrRect);
  10142. }
  10143. ////////////////////////////////////////////////
  10144. for (i = 3; i <= 16; i++)
  10145. {
  10146. StrRect = load.m_rcarray.ElementAt(i - 1);
  10147. if (i < 10)
  10148. {
  10149. m_Print.DrawRect2(StrRect, 1);
  10150. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10151. }
  10152. }
  10153. StrRect = load.m_rcarray.ElementAt(29);
  10154. m_Print.DrawRect2(StrRect, 1);
  10155. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10156. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  10157. {
  10158. Image *pImg = NULL;
  10159. g_nSendCode = 31;
  10160. int g_nYearposTemp = g_nYearpos;
  10161. g_nYearpos = -1;
  10162. g_pMainWnd->ProcessChatMessageRequest2(1);
  10163. g_nYearpos = g_nYearposTemp;
  10164. g_nSendCode = 0;
  10165. if (g_bSendOK == 0)return;
  10166. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  10167. if (pImg)
  10168. {
  10169. StrRect.left = 485;
  10170. StrRect.top = 12;
  10171. StrRect.right = StrRect.left + 60;
  10172. StrRect.bottom = StrRect.top + 60;
  10173. m_Print.DrawImage(pImg, StrRect);
  10174. delete pImg; pImg = NULL;
  10175. }
  10176. }
  10177. CArray<CRect, CRect>rcarray;
  10178. CStringArray strarray2;
  10179. for (i = 10; i <= 16; i++)
  10180. {
  10181. StrRect = load.m_rcarray.ElementAt(i - 1);
  10182. StrRect.left += 2;
  10183. StrRect.right -= 2;
  10184. StrRect.top += 2;
  10185. rcarray.Add(StrRect);
  10186. strarray2.Add(strarray.ElementAt(7 + i - 10));
  10187. }
  10188. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  10189. for (i = 10; i <= 16; i++)
  10190. {
  10191. StrRect = load.m_rcarray.ElementAt(i - 1);
  10192. if (i == 10)
  10193. {
  10194. dty += bottom - StrRect.bottom;
  10195. }
  10196. StrRect.bottom = bottom;
  10197. m_Print.DrawRect2(StrRect, 1);
  10198. }
  10199. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  10200. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  10201. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  10202. m_Print.SetFontFace(15, 1, "宋体");
  10203. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  10204. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10205. m_Print.SetFontFace(9, 1, "宋体");
  10206. strarray.RemoveAll();
  10207. strarray.Add("产品名称");
  10208. strarray.Add("数量");
  10209. strarray.Add("照片编号");
  10210. CArray<CRect, CRect>rc2array;
  10211. for (i = 18; i <= 20; i++)
  10212. {
  10213. StrRect = load.m_rcarray.ElementAt(i - 1); StrRect.top += dty; StrRect.bottom += dty;
  10214. m_Print.DrawRect2(StrRect, 1);
  10215. StrRect.left += 2;
  10216. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10217. StrRect.left -= 2;
  10218. StrRect.top = StrRect.bottom;
  10219. StrRect.bottom += 18;
  10220. rc2array.Add(StrRect);
  10221. }
  10222. int curypos = 0;
  10223. for (i = 0; i < sparray2.GetSize(); i += 3)
  10224. {
  10225. rcarray.RemoveAll();
  10226. strarray2.RemoveAll();
  10227. for (int j = 0; j < 3; j++)
  10228. {
  10229. StrRect = rc2array.ElementAt(j);
  10230. StrRect.left += 2;
  10231. StrRect.right -= 2;
  10232. StrRect.top += 2;
  10233. rcarray.Add(StrRect);
  10234. #if JEFF_TEST_ON
  10235. if (2 == j)
  10236. {
  10237. CString strImg = sparray2.ElementAt(i + 2);
  10238. int nImgCount = strImg.Replace(",", ",");
  10239. if (nImgCount != 0)
  10240. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
  10241. else if (!strImg.IsEmpty())
  10242. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  10243. strarray2.Add(strImg);
  10244. }
  10245. else
  10246. strarray2.Add(sparray2.ElementAt(i + j));
  10247. #else
  10248. strarray2.Add(sparray2.ElementAt(i + j));
  10249. #endif
  10250. }
  10251. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  10252. rcarray.RemoveAll();
  10253. for (j = 0; j < 3; j++)
  10254. {
  10255. StrRect = rc2array.ElementAt(j);
  10256. if (j == 0)
  10257. {
  10258. dty += bottom - StrRect.bottom;
  10259. }
  10260. StrRect.bottom = bottom;
  10261. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  10262. StrRect.top = StrRect.bottom;
  10263. StrRect.bottom += 18;
  10264. rcarray.Add(StrRect);
  10265. }
  10266. rc2array.RemoveAll();
  10267. rc2array.Copy(rcarray);
  10268. }
  10269. m_Print.SetFontFace(15, 1, "宋体");
  10270. StrRect = load.m_rcarray.ElementAt(20);
  10271. dty = curypos - StrRect.bottom + 35;
  10272. StrRect.top += dty; StrRect.bottom += dty;
  10273. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10274. m_Print.SetFontFace(9, 1, "宋体");
  10275. rcarray.RemoveAll();
  10276. strarray2.RemoveAll();
  10277. StrRect = load.m_rcarray.ElementAt(21);
  10278. StrRect.top += dty;
  10279. StrRect.bottom += dty;
  10280. StrRect.left += 2;
  10281. StrRect.right -= 2;
  10282. StrRect.top += 2;
  10283. rcarray.Add(StrRect);
  10284. #if JEFF_TEST_ON
  10285. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  10286. strarray2.RemoveAll();
  10287. CString strFind = "要求:";
  10288. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  10289. do
  10290. {
  10291. int nIndex = strbz3.Find(strFind, 1);
  10292. if (nIndex != -1)
  10293. {
  10294. CString strbz = strbz3.Left(nIndex);
  10295. strbz3 = strbz3.Mid(nIndex);
  10296. strarray2.Add(strbz);
  10297. }
  10298. else
  10299. {
  10300. strarray2.Add(strbz3);
  10301. strbz3 = "";
  10302. }
  10303. } while (strbz3.Find(strFind) != -1);
  10304. strarray2.Add(g_List1array.ElementAt(0).ElementAt(25));
  10305. if (!m_replace.IsEmpty())
  10306. {
  10307. m_replace = "设计替换照片:" + m_replace;
  10308. m_replace.Replace("$", ";");
  10309. m_replace.TrimLeft(";");
  10310. }
  10311. strarray2.Add(m_replace);
  10312. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  10313. #else
  10314. strarray2.Add(m_bz);
  10315. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  10316. #endif
  10317. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  10318. dty += bottom - StrRect.bottom;
  10319. StrRect.bottom = bottom;
  10320. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  10321. m_Print.SetFontFace(10, 1, "宋体");
  10322. StrRect = load.m_rcarray.ElementAt(22);
  10323. dty = curypos - StrRect.bottom + 25;
  10324. StrRect.top += dty; StrRect.bottom += dty;
  10325. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  10326. if (m_edit9.IsEmpty())
  10327. {
  10328. m_edit9 = "\
  10329. 经确认后的照片均排入制作流程,\r\n\
  10330. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  10331. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  10332. }
  10333. CString info1, info2, info3;
  10334. int newlinepos = m_edit9.Find("\r\n");
  10335. if (newlinepos != -1)
  10336. {
  10337. info1 = m_edit9.Left(newlinepos);
  10338. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  10339. }
  10340. newlinepos = m_edit9.Find("\r\n");
  10341. if (newlinepos != -1)
  10342. {
  10343. info2 = m_edit9.Left(newlinepos);
  10344. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  10345. info3 = m_edit9;
  10346. }
  10347. if (1)
  10348. {
  10349. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10350. StrRect = load.m_rcarray.ElementAt(23);
  10351. StrRect.top += dty; StrRect.bottom += dty;
  10352. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10353. StrRect = load.m_rcarray.ElementAt(24);
  10354. StrRect.top += dty; StrRect.bottom += dty;
  10355. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10356. }
  10357. else
  10358. {
  10359. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10360. StrRect = load.m_rcarray.ElementAt(23);
  10361. StrRect.top += dty; StrRect.bottom += dty;
  10362. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10363. StrRect = load.m_rcarray.ElementAt(24);
  10364. StrRect.top += dty; StrRect.bottom += dty;
  10365. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10366. }
  10367. StrRect = load.m_rcarray.ElementAt(25);
  10368. StrRect.top += dty; StrRect.bottom += dty;
  10369. m_Print.DrawText((LPTSTR)(LPCTSTR)"贵宾签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10370. StrRect = load.m_rcarray.ElementAt(26);
  10371. StrRect.top += dty; StrRect.bottom += dty;
  10372. m_Print.DrawRect2(StrRect, 2);
  10373. m_Print.SetFontFace(9, 1, "宋体");
  10374. StrRect = load.m_rcarray.ElementAt(27);
  10375. StrRect.top += dty; StrRect.bottom += dty;
  10376. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10377. StrRect = load.m_rcarray.ElementAt(28);
  10378. StrRect.top += dty; StrRect.bottom += dty;
  10379. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10380. PrintPreview dlg;//dlg.m_mode=2;
  10381. dlg.m_name = name;
  10382. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  10383. dlg.m_pDC = m_Print.GetPDC();
  10384. if (aa == 0)
  10385. {
  10386. if (dlg.DoModal() != IDOK)
  10387. return;
  10388. printcot = dlg.m_num;
  10389. }
  10390. //结束打印
  10391. m_Print.EndPage();
  10392. m_Print.EndPrint();
  10393. }
  10394. }
  10395. /*
  10396. void CMainFrame::PrintFlowChart(CString m_id)
  10397. {
  10398. CPrintRX m_Print;
  10399. m_Print.InitToPrint(NULL, 1);
  10400. m_Print.StartPrint();
  10401. m_Print.StartPage();
  10402. // CRect StrRect(0,0,560,818);
  10403. LoadRect load;
  10404. load.SetLiaPath ("4.lia");
  10405. load.SetMargins(-14,-14);
  10406. if(!load.Load ())return;
  10407. LoadRect load2;
  10408. load2.SetMargins(-14,472+27-14);
  10409. load2.SetLiaPath ("5.lia");
  10410. if(!load2.Load ())return;
  10411. //////////////////////////////////////////////////////////////
  10412. CString filter="id='"+m_id+"';id='"+m_id+"'";
  10413. g_sendhead.code[0]=54;
  10414. g_sendhead.code[1]=50;
  10415. g_sendhead.tabcount=2;
  10416. g_sendhead.bsql=0;
  10417. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  10418. CArray<CStringArray, CStringArray>sparray;
  10419. DataToArray(&g_List1array,&sparray);
  10420. CString spno;
  10421. for(int i=0; i<sparray.GetSize (); i++)
  10422. {
  10423. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册")continue;
  10424. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  10425. spno+=sparray.ElementAt (i).ElementAt (5);
  10426. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  10427. spno+=";";
  10428. else
  10429. {
  10430. spno+=":";
  10431. spno+=sparray.ElementAt (i).ElementAt (6);
  10432. spno+=";";
  10433. }
  10434. }
  10435. spno+=" 加挑:";
  10436. for( i=0; i<sparray.GetSize (); i++)
  10437. {
  10438. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  10439. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  10440. spno+=sparray.ElementAt (i).ElementAt (5);
  10441. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  10442. spno+=";";
  10443. else
  10444. {
  10445. spno+=":";
  10446. spno+=sparray.ElementAt (i).ElementAt (6);
  10447. spno+=";";
  10448. }
  10449. }
  10450. if(spno.Right (6)==" 加挑:")
  10451. {
  10452. spno=spno.Left (spno.GetLength ()-6);
  10453. }
  10454. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  10455. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  10456. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  10457. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  10458. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  10459. if(m_urgent.IsEmpty ())m_urgent="否";
  10460. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  10461. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  10462. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  10463. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  10464. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  10465. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  10466. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  10467. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  10468. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  10469. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  10470. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  10471. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17);
  10472. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  10473. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  10474. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  10475. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  10476. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  10477. CString m_sum3;
  10478. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  10479. ::ConvertToPrice (m_sum3);
  10480. if(m_money3.IsEmpty ())m_money3="0";
  10481. // m_money3=m_money3+"/"+m_sum3;
  10482. CString name;
  10483. if(!m_name1.IsEmpty ())
  10484. name=m_name1+",";
  10485. name+=m_name2;
  10486. name.TrimRight (",");
  10487. CString phone;
  10488. if(!m_phone1.IsEmpty ())
  10489. phone=m_phone1+",";
  10490. phone+=m_phone2;phone.TrimRight (",");
  10491. CStringArray strarray;
  10492. strarray.Add (m_urgent);
  10493. strarray.Add (m_ren);
  10494. strarray.Add (m_waiter3);
  10495. strarray.Add (name);
  10496. strarray.Add (m_time2);
  10497. strarray.Add (m_time4);
  10498. strarray.Add (m_time5);
  10499. strarray.Add (m_money3);
  10500. strarray.Add (m_takezs);
  10501. strarray.Add (m_taoxizs);
  10502. strarray.Add (m_choosezs);
  10503. strarray.Add (m_id);
  10504. strarray.Add (phone);
  10505. ////////////////////////////////////////////////////////////////
  10506. int rcpos=-1;
  10507. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  10508. Image *pImg=NULL;
  10509. #ifdef MNLS_VERSION
  10510. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  10511. #else
  10512. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  10513. #endif
  10514. m_Print.DrawImage(pImg, StrRect);
  10515. delete pImg;
  10516. m_Print.SetFontFace(15, 1, "宋体");
  10517. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10518. #ifdef MNLS_VERSION
  10519. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10520. #endif
  10521. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10522. #ifdef MNLS_VERSION
  10523. m_Print.DrawRect(StrRect);
  10524. #endif
  10525. m_Print.SetFontFace(7, 1, "黑体");
  10526. m_Print.SetColor(0xffffff);
  10527. #ifdef MNLS_VERSION
  10528. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10529. #endif
  10530. m_Print.SetColor(0);
  10531. m_Print.SetFontFace(25, 1, "黑体");
  10532. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10533. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10534. CString title[13]={"是否加急:","接单门市:","选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","取件日期:","加挑/余款:","拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  10535. m_Print.SetFontFace(12, 1, "宋体");
  10536. for( i=0; i<13; i++)
  10537. {
  10538. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10539. if(i<3)
  10540. m_Print.DrawRect2(StrRect, 0);
  10541. else
  10542. m_Print.DrawRect2(StrRect, 1);
  10543. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10544. }
  10545. for( i=18; i<=37; i++)
  10546. {
  10547. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10548. if(i>=19&&i<=21)
  10549. m_Print.DrawRect2(StrRect, 2);
  10550. else if(i==26)
  10551. {
  10552. CRect rc=StrRect;
  10553. CRect rc2=rc;
  10554. rc.right -=rc2.Width ()/2;
  10555. m_Print.DrawRect2(rc, 1);
  10556. rc2.left +=rc.Width ();
  10557. m_Print.DrawRect2(rc2, 1);
  10558. }
  10559. else
  10560. m_Print.DrawRect2(StrRect, 1);
  10561. if(i==18)
  10562. {
  10563. StrRect.left +=5;
  10564. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10565. }
  10566. }
  10567. //////////////////////////////////////
  10568. rcpos=-1;
  10569. for( i=0; i<8; i++)
  10570. {
  10571. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10572. m_Print.DrawRect2(StrRect, 1);
  10573. }
  10574. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客签名:"};
  10575. for( i=0; i<4; i++)
  10576. {
  10577. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10578. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10579. }
  10580. for( i=0; i<4; i++)
  10581. {
  10582. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10583. m_Print.DrawRect2(StrRect, 2);
  10584. }
  10585. ///////////////////////////////////////////
  10586. for( i=19; i<=31; i++)
  10587. {
  10588. StrRect=load.m_rcarray .ElementAt (i-1);
  10589. StrRect.left +=4;
  10590. if(i==31)
  10591. {
  10592. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  10593. {
  10594. StrRect.top +=2;
  10595. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  10596. StrRect.top +=8;
  10597. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10598. }
  10599. else
  10600. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10601. }
  10602. else if((i-19)==7)
  10603. {
  10604. CRect rc=StrRect;
  10605. CRect rc2=rc;
  10606. rc.right -=rc2.Width ()/2;
  10607. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10608. rc2.left +=rc.Width ()+3;
  10609. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10610. }
  10611. else
  10612. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10613. }
  10614. strarray.RemoveAll ();
  10615. strarray.Add (m_waiter2);
  10616. strarray.Add (m_waiter1);
  10617. strarray.Add (m_waiter4);
  10618. for( i=13; i<=15; i++)
  10619. {
  10620. StrRect=load2.m_rcarray .ElementAt (i-1);
  10621. StrRect.left +=4;
  10622. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10623. }
  10624. ///////////spno
  10625. CRect sprc[14];
  10626. for(i=0; i<14; i++)
  10627. {
  10628. if(i<7)
  10629. {
  10630. if(i==0)
  10631. {
  10632. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  10633. }
  10634. else
  10635. {
  10636. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  10637. }
  10638. }
  10639. else
  10640. {
  10641. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  10642. }
  10643. sprc[i]=StrRect;
  10644. // m_Print.DrawText((LPTSTR)(LPCTSTR)"xxx", sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10645. }
  10646. CString temp,tempspno,tempbz;
  10647. CSize size;
  10648. BOOL bRun=0;
  10649. int fontsize=12;
  10650. ll: tempspno=spno;
  10651. tempbz=m_bz;
  10652. m_Print.SetFontFace(fontsize, 1, "宋体");
  10653. for( i=0; i<14; i++)
  10654. {
  10655. if(!tempspno.IsEmpty ())
  10656. {
  10657. temp=tempspno;
  10658. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10659. int right=0;
  10660. CRect temprc=sprc[i];
  10661. while(size.cx>temprc.Width ())
  10662. {
  10663. right++;
  10664. temp=tempspno.Left (tempspno.GetLength ()-(right));
  10665. if(GIsHalfHZ(temp))
  10666. {
  10667. right++;
  10668. temp.Delete (temp.GetLength ()-1);
  10669. }
  10670. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10671. }
  10672. if(bRun)
  10673. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10674. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  10675. if(tempspno.IsEmpty ())i++;
  10676. }
  10677. else if(!tempbz.IsEmpty ())
  10678. {
  10679. temp=tempbz;
  10680. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10681. int right=0;
  10682. CRect temprc=sprc[i];
  10683. while(size.cx>temprc.Width ())
  10684. {
  10685. right++;
  10686. temp=tempbz.Left (tempbz.GetLength ()-(right));
  10687. if(GIsHalfHZ(temp))
  10688. {
  10689. right++;
  10690. temp.Delete (temp.GetLength ()-1);
  10691. }
  10692. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10693. }
  10694. if(bRun)
  10695. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10696. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  10697. }
  10698. }
  10699. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  10700. {
  10701. fontsize--;
  10702. goto ll;
  10703. }
  10704. if(bRun==0)
  10705. {
  10706. bRun=1;
  10707. goto ll;
  10708. }
  10709. PrintPreview dlg;
  10710. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  10711. dlg.m_pDC =m_Print.GetPDC() ;
  10712. if(dlg.DoModal ()!=IDOK)return;
  10713. //结束打印
  10714. m_Print.EndPage();
  10715. m_Print.EndPrint();
  10716. }
  10717. void CMainFrame::SetSelFolder(int pos)
  10718. {
  10719. m_wndToolBar2.SetSelFolder(pos);
  10720. }*/
  10721. void CMainFrame::ToPhotoPrint()
  10722. {
  10723. UINT nID = 1;
  10724. LPSTR pName;
  10725. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  10726. OPEN_MENU(PhotoPrintFrom);
  10727. }
  10728. void CMainFrame::GetOcx()
  10729. {
  10730. char path[MAX_PATH];
  10731. ::GetSystemDirectory(path, MAX_PATH);
  10732. CString syspath = path;
  10733. try
  10734. {
  10735. if (!::PathFileExists(syspath + "\\MSCHRT20.OCX"))
  10736. {
  10737. g_sendhead.bsql = 0;
  10738. g_sendhead.code[0] = 103;
  10739. g_sendhead.tabcount = 1;
  10740. g_pMainWnd->ProcessChatMessageRequest2(1); if (g_bSendOK == 0)return;
  10741. CFile fp;
  10742. if (fp.Open(syspath + "\\MSCHRT20.OCX", CFile::modeWrite | CFile::modeCreate))
  10743. {
  10744. fp.Write(g_pData, g_nLeng);
  10745. fp.Close();
  10746. ::Sleep(1000);
  10747. }
  10748. }
  10749. CString temp;
  10750. temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10751. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10752. }
  10753. catch (...)
  10754. {
  10755. }
  10756. try
  10757. {
  10758. CString temp;
  10759. temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10760. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10761. }
  10762. catch (...)
  10763. {
  10764. }
  10765. }
  10766. void CMainFrame::OnServer()
  10767. {
  10768. // TODO: Add your command handler code here
  10769. DBConfig dlg;
  10770. dlg.DoModal();
  10771. }
  10772. void CMainFrame::OnPath()
  10773. {
  10774. // TODO: Add your command handler code here
  10775. if (g_user.bLongin == 0)
  10776. {
  10777. if (g_bNoLoginLia)
  10778. {
  10779. Login dlg;
  10780. dlg.SetLiaPath("5.lia");
  10781. dlg.DoModal();
  10782. }
  10783. else
  10784. {
  10785. Login3 dlg;
  10786. dlg.SetLiaPath("5.lia");
  10787. dlg.DoModal();
  10788. }
  10789. if (g_user.bLongin == 0)return;
  10790. }
  10791. if (IsHasRightsnew(49) == 0)return;
  10792. SetPathDlg2 dlg;
  10793. dlg.DoModal();
  10794. }
  10795. void CMainFrame::OnShowhis()
  10796. {
  10797. // TODO: Add your command handler code here
  10798. if (g_user.bLongin == 0)
  10799. {
  10800. if (g_bNoLoginLia)
  10801. {
  10802. Login dlg;
  10803. dlg.SetLiaPath("5.lia");
  10804. dlg.DoModal();
  10805. }
  10806. else
  10807. {
  10808. Login3 dlg;
  10809. dlg.SetLiaPath("5.lia");
  10810. dlg.DoModal();
  10811. }
  10812. if (g_user.bLongin == 0)return;
  10813. }
  10814. if (IsHasRightsnew(52) == 0)return;
  10815. CMenu *pMenu = GetMenu();
  10816. CMenu* submenu = pMenu->GetSubMenu(2);
  10817. UINT status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
  10818. if (status&MF_CHECKED)
  10819. {
  10820. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_UNCHECKED);
  10821. g_bShowOK = 1;
  10822. }
  10823. else
  10824. {
  10825. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  10826. g_bShowOK = 0;
  10827. } m_Mdi.CloseAll();
  10828. }
  10829. void CMainFrame::AddHistoryMenu(CArray<CStringArray, CStringArray>*hisyeararray) // 添加历史数据库菜单;
  10830. {
  10831. #ifdef NEW_SKIN
  10832. CMenu* m_menuXP = GetMenu();
  10833. CMenu* submenu = m_menuXP->GetSubMenu(2);
  10834. // 删除原有菜单;
  10835. for (int i = 0; i < 100; i++)
  10836. {
  10837. submenu->DeleteMenu(1000 + i, MF_BYCOMMAND);
  10838. }
  10839. // 重创菜单,从资源ID1000开始;
  10840. for (i = 0; i < hisyeararray->GetSize(); i++)
  10841. {
  10842. submenu->AppendMenu(MF_STRING, 1000 + i, "查看历史数据:" + hisyeararray->ElementAt(i).ElementAt(0)); // 第一项菜单项;
  10843. }
  10844. g_nYearpos = -1;
  10845. #else
  10846. HMENU hMenu = ::GetMenu(m_hWnd);
  10847. m_menuXP.Attach(hMenu);
  10848. BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
  10849. for (int i = 0; i < 100; i++)
  10850. {
  10851. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10852. }
  10853. for( i=0; i<hisyeararray->GetSize (); i++)
  10854. {
  10855. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10856. }
  10857. m_menuXP.Detach ();
  10858. g_nYearpos = -1;
  10859. #endif
  10860. }
  10861. /************************************************************************/
  10862. /*
  10863. Jeff
  10864. 函数:AddBranchMenu()
  10865. 参数:CArray<CStringArray, CStringArray> *branchArray
  10866. 返回:void
  10867. 注意:
  10868. 调用关系:
  10869. */
  10870. /************************************************************************/
  10871. void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*branchArray)
  10872. {
  10873. //WriteClientLog("AddBranchMenu,添加集团版菜单");
  10874. #ifdef ENTERPRISE_VERSION
  10875. CMenu *m_menuXP = GetMenu();
  10876. CMenu* submenu = m_menuXP->GetSubMenu(0);
  10877. for (int i = 0; i < 100; i++)
  10878. {
  10879. submenu->DeleteMenu(2000 + i, MF_BYCOMMAND);
  10880. }
  10881. g_menubranchname.RemoveAll();
  10882. CString name;
  10883. int a = 0;
  10884. #if 0 // Jeff.add for test
  10885. CString strCount;
  10886. strCount.Format("历史数据库个数=%d", branchArray->GetSize());
  10887. WriteClientLog(strCount);
  10888. #endif
  10889. for (i = 0; i < branchArray->GetSize() - 1; i++)
  10890. {
  10891. //WriteClientLog("111");
  10892. //WriteClientLog(hisyeararray->ElementAt(i).ElementAt(0));
  10893. //WriteClientLog(name);
  10894. if (name == "")
  10895. {
  10896. name = branchArray->ElementAt(i).ElementAt(0);
  10897. #ifndef SQLSERVER_VERSION
  10898. submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
  10899. a++;
  10900. #endif
  10901. submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
  10902. a++;
  10903. g_menubranchname.Add(name);
  10904. continue;
  10905. }
  10906. else if (branchArray->ElementAt(i).ElementAt(0).Find(name) != -1 && ((branchArray->ElementAt(i).ElementAt(0).GetLength() - name.GetLength()) == 4))
  10907. {
  10908. continue;
  10909. }
  10910. name = branchArray->ElementAt(i).ElementAt(0);
  10911. #ifndef SQLSERVER_VERSION
  10912. submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
  10913. a++;
  10914. #endif
  10915. submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
  10916. g_menubranchname.Add(name);
  10917. a++;
  10918. //WriteClientLog("222");
  10919. }
  10920. if ((branchArray->GetSize() - 1) > 0)
  10921. {
  10922. if (branchArray->ElementAt(0).ElementAt(3) == "总店")
  10923. submenu->AppendMenu(MF_STRING, 2000 + a, "多店数据汇总");
  10924. }
  10925. #endif
  10926. }
  10927. // Jeff:如果选择了历史数据库,则开单的数据会录入到该历史数据库中,而非当前数据库;
  10928. // g_nYearpos==-1,表示当前主数据库,其他>=0的值表示历史数据库在g_historydb中的索引值;
  10929. void CMainFrame::OnHistory(UINT nID) // 选择历史数据库菜单响应;
  10930. {
  10931. CMenu* pMenu = GetMenu();
  10932. CMenu* submenu = pMenu->GetSubMenu(2);
  10933. UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
  10934. if (g_user.bLongin == 0)
  10935. {
  10936. if (g_bNoLoginLia)
  10937. {
  10938. Login dlg;
  10939. dlg.SetLiaPath("5.lia");
  10940. dlg.DoModal();
  10941. }
  10942. else
  10943. {
  10944. Login3 dlg;
  10945. dlg.SetLiaPath("5.lia");
  10946. dlg.DoModal();
  10947. }
  10948. if (g_user.bLongin == 0)return;
  10949. }
  10950. if (IsHasRightsnew(52) == 0)return;
  10951. m_Mdi.CloseAll();
  10952. for (int i = 0; i < 100; i++)
  10953. {
  10954. submenu->CheckMenuItem(1000 + i, MF_BYCOMMAND | MF_UNCHECKED);
  10955. }
  10956. if (status&MF_CHECKED)
  10957. {
  10958. g_nYearpos = -1;
  10959. status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
  10960. if (status&MF_CHECKED)
  10961. g_bShowOK = 0;
  10962. else
  10963. g_bShowOK = 1;
  10964. }
  10965. else
  10966. {
  10967. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10968. g_nYearpos = nID - 1000;
  10969. g_bShowOK = 1;
  10970. }
  10971. }
  10972. void CMainFrame::OnBranchData(UINT nID)
  10973. {
  10974. #ifdef ENTERPRISE_VERSION
  10975. #ifdef SQLSERVER_VERSION
  10976. OnBranchData2(nID);
  10977. return;
  10978. #endif
  10979. #endif
  10980. }
  10981. void CMainFrame::OnBranchData2(UINT nID)
  10982. {
  10983. #ifdef ENTERPRISE_VERSION
  10984. g_bAllBranch = 0;
  10985. m_Mdi.CloseAll();
  10986. OnDisconnect();
  10987. CMenu *pMenu = GetMenu();
  10988. CMenu* submenu = pMenu->GetSubMenu(0);
  10989. UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
  10990. for (int i = 0; i < 100; i++)
  10991. {
  10992. submenu->CheckMenuItem(2000 + i, MF_BYCOMMAND | MF_UNCHECKED);
  10993. }
  10994. if (status&MF_CHECKED)
  10995. {
  10996. g_branchname.Empty();
  10997. g_branchip.Empty();
  10998. g_bBranchModify = 0;
  10999. g_user.bLongin = 0;
  11000. if (g_bNoLoginLia)
  11001. {
  11002. Login dlg;
  11003. dlg.SetLiaPath("5.lia");
  11004. dlg.DoModal();
  11005. }
  11006. else
  11007. {
  11008. Login3 dlg;
  11009. dlg.SetLiaPath("5.lia");
  11010. dlg.DoModal();
  11011. }
  11012. g_pMainWnd2->RefreshOutlookBar();
  11013. g_pMainWnd2->DrawLogin();
  11014. g_path1 = g_path1bak;
  11015. g_path2 = g_path2bak;
  11016. g_path3 = g_path3bak;
  11017. g_path4 = g_path4bak;
  11018. g_path5 = g_path5bak;
  11019. g_path6 = g_path6bak;
  11020. g_path7 = g_path7bak;
  11021. g_pMainWnd2->EnableBtns(1);
  11022. }
  11023. else
  11024. {
  11025. BOOL bNeedCheckRights = 1;
  11026. if (g_user.bLongin && g_branchname == "")//无需登陆本店判断其访问分店权限
  11027. {
  11028. bNeedCheckRights = 0;
  11029. }
  11030. #ifndef SQLSERVER_VERSION
  11031. if ((g_menubranchname.GetSize() * 2) == nID - 2000)//多店数据汇总
  11032. #else
  11033. if ((g_menubranchname.GetSize()) == nID - 2000)//多店数据汇总
  11034. #endif
  11035. {
  11036. g_branchname.Empty();
  11037. g_branchip.Empty();
  11038. g_bBranchModify = 0;
  11039. if (bNeedCheckRights)
  11040. {
  11041. g_user.bLongin = 0;
  11042. if (g_user.bLongin == 0)
  11043. {
  11044. if (g_bNoLoginLia)
  11045. {
  11046. Login dlg;
  11047. dlg.SetLiaPath("5.lia");
  11048. dlg.DoModal();
  11049. }
  11050. else
  11051. {
  11052. Login3 dlg;
  11053. dlg.SetLiaPath("5.lia");
  11054. dlg.DoModal();
  11055. }
  11056. if (g_user.bLongin == 0)return;
  11057. }
  11058. }
  11059. if (IsHasRightsnew(28) == 0)
  11060. {
  11061. return;
  11062. }
  11063. g_bAllBranch = 1; g_pMainWnd2->ShowBar(0);
  11064. g_pMainWnd2->RefreshOutlookBar2();
  11065. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  11066. g_branchname.Empty();
  11067. g_branchip.Empty();
  11068. g_bBranchModify = 0;
  11069. g_pMainWnd2->DrawLogin();
  11070. g_pMainWnd2->EnableBtns(0);
  11071. g_path1 = g_path1bak;
  11072. g_path2 = g_path2bak;
  11073. g_path3 = g_path3bak;
  11074. g_path4 = g_path4bak;
  11075. g_path5 = g_path5bak;
  11076. g_path6 = g_path6bak;
  11077. g_path7 = g_path7bak;
  11078. }
  11079. else
  11080. {
  11081. if (bNeedCheckRights)
  11082. {
  11083. g_branchname.Empty();
  11084. g_branchip.Empty();
  11085. g_bBranchModify = 0;
  11086. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
  11087. g_user.bLongin = 0;
  11088. if (g_pMainWnd2)
  11089. {
  11090. g_pMainWnd2->DrawLogin();
  11091. g_pMainWnd2->ShowBar(0);
  11092. }
  11093. if (g_bNoLoginLia)
  11094. {
  11095. Login dlg;
  11096. dlg.SetLiaPath("5.lia");
  11097. dlg.DoModal();
  11098. }
  11099. else
  11100. {
  11101. Login3 dlg;
  11102. dlg.SetLiaPath("5.lia");
  11103. dlg.DoModal();
  11104. }
  11105. if (g_user.bLongin == 0)return;
  11106. }
  11107. if (IsHasRightsnew(28) == 0)
  11108. {
  11109. return;
  11110. }
  11111. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  11112. #ifndef SQLSERVER_VERSION
  11113. if (nID % 2 == 0)
  11114. g_branchname = g_menubranchname.ElementAt((nID - 2000) / 2);
  11115. else
  11116. g_branchname = g_menubranchname.ElementAt((nID - 2001) / 2);
  11117. #else
  11118. g_branchname = g_menubranchname.ElementAt(nID - 2000);
  11119. #endif
  11120. g_branchip.Empty();
  11121. CString domainname = "";
  11122. for (int i = 0; i < g_brancharray.GetSize(); i++)
  11123. {
  11124. if (g_branchname == g_brancharray.ElementAt(i).ElementAt(0))
  11125. {
  11126. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  11127. g_branchip2 = g_brancharray.ElementAt(i).ElementAt(4);
  11128. domainname = g_brancharray.ElementAt(i).ElementAt(2);
  11129. }
  11130. }
  11131. g_path1 = g_path1bak;
  11132. g_path2 = g_path2bak;
  11133. g_path3 = g_path3bak;
  11134. g_path4 = g_path4bak;
  11135. g_path5 = g_path5bak;
  11136. g_path6 = g_path6bak;
  11137. g_path7 = g_path7bak;
  11138. if (domainname.IsEmpty())
  11139. {
  11140. g_path1 = g_path2 = g_path3 = g_path4 = g_path5 = g_path6 = g_path7 = "xxx";
  11141. }
  11142. else
  11143. {
  11144. g_path1 += "\\" + domainname;
  11145. g_path2 += "\\" + domainname;
  11146. g_path3 += "\\" + domainname;
  11147. g_path4 += "\\" + domainname;
  11148. g_path5 += "\\" + domainname;
  11149. g_path6 += "\\" + domainname;
  11150. g_path7 += "\\" + domainname;
  11151. }
  11152. g_bBranchModify = 1;
  11153. /* CArray<CStringArray, CStringArray>yeararray;
  11154. for( i=0; i<g_brancharray.GetSize (); i++)
  11155. {
  11156. if(g_brancharray.ElementAt (i).ElementAt (0).Find (g_branchname)!=-1 && g_branchname!=g_brancharray.ElementAt (i).ElementAt (0))
  11157. {
  11158. int size=yeararray.GetSize ();
  11159. yeararray.SetSize(size+1,1);
  11160. CString str=g_brancharray.ElementAt (i).ElementAt (0);
  11161. str.Delete (0, g_branchname.GetLength ());
  11162. yeararray.ElementAt (size).Add (str);
  11163. }
  11164. }
  11165. AddHistoryMenu(&yeararray);*/
  11166. if (g_bBranchModify)OnDisconnect();
  11167. if (1)
  11168. {
  11169. g_user.bLongin = 0;
  11170. g_user.name.Empty();
  11171. g_user.rights.Empty();
  11172. g_user.account.Empty();
  11173. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  11174. g_pMainWnd2->RefreshOutlookBar();
  11175. m_Mdi.CloseAll();
  11176. if (g_pMainWnd2)
  11177. {
  11178. g_pMainWnd2->DrawLogin();
  11179. g_pMainWnd2->ShowBar(0);
  11180. }
  11181. if (g_bNoLoginLia)
  11182. {
  11183. Login dlg;
  11184. dlg.SetLiaPath("5.lia");
  11185. dlg.DoModal();
  11186. }
  11187. else
  11188. {
  11189. Login3 dlg;
  11190. dlg.SetLiaPath("5.lia");
  11191. dlg.DoModal();
  11192. }
  11193. if (g_user.bLongin == 0)return;
  11194. if (g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  11195. }
  11196. g_pMainWnd2->DrawLogin();
  11197. g_pMainWnd2->EnableBtns(1);
  11198. }
  11199. g_nYearpos = -1;
  11200. }
  11201. #endif
  11202. }
  11203. void CMainFrame::OnStaffAchievementShow() //Jeff:此机只用于员工看业绩;
  11204. {
  11205. // TODO: Add your command handler code here
  11206. if (g_user.bLongin == 0) // 是否登陆系统;
  11207. {
  11208. if (g_bNoLoginLia)
  11209. {
  11210. Login dlg;
  11211. dlg.SetLiaPath("5.lia");
  11212. dlg.DoModal();
  11213. }
  11214. else
  11215. {
  11216. Login3 dlg;
  11217. dlg.SetLiaPath("5.lia");
  11218. dlg.DoModal();
  11219. }
  11220. if (g_user.bLongin == 0)return;
  11221. }
  11222. if (IsHasRightsnew(49) == 0)return;// 是否有权限进行设置;
  11223. CString version = _T("Version 1.0");
  11224. CMenu *pMenu = GetMenu();
  11225. CMenu* submenu = pMenu->GetSubMenu(1);
  11226. UINT status = submenu->GetMenuState(IDM_StaffAchievementShow, MF_BYCOMMAND);
  11227. if (status&MF_CHECKED)
  11228. {
  11229. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_UNCHECKED);
  11230. AfxGetApp()->WriteProfileInt(version, "status2", 0);
  11231. g_bStaffAchievementShow = 0;
  11232. TCHAR szKey[MAX_PATH];
  11233. TCHAR szDir[MAX_PATH];
  11234. ::GetModuleFileName(NULL, szDir, MAX_PATH);
  11235. HKEY hKey = 0;
  11236. DWORD disp = 0;
  11237. lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  11238. int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
  11239. if (lResult == ERROR_SUCCESS)
  11240. {
  11241. RegDeleteValue(hKey, "YLGLMAINAUTORUN");
  11242. RegDeleteKey(hKey, "YLGLMAINAUTORUN");
  11243. RegCloseKey(hKey);
  11244. }
  11245. }
  11246. else
  11247. {
  11248. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  11249. AfxGetApp()->WriteProfileInt(version, "status2", 1);
  11250. g_bStaffAchievementShow = 1;
  11251. TCHAR szKey[MAX_PATH];
  11252. TCHAR szDir[MAX_PATH];
  11253. ::GetModuleFileName(NULL, szDir, MAX_PATH);
  11254. HKEY hKey = 0;
  11255. DWORD disp = 0;
  11256. lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  11257. int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
  11258. if (lResult == ERROR_SUCCESS)
  11259. {
  11260. lResult = RegSetValueEx(hKey, "YLGLMAINAUTORUN", 0, REG_SZ, (const unsigned char*)szDir, lstrlen(szDir));
  11261. RegCloseKey(hKey);
  11262. }
  11263. StaffAchievementSet dlg;
  11264. dlg.DoModal();
  11265. }
  11266. }
  11267. void CMainFrame::PrintDinDan2(CString m_id)
  11268. {
  11269. #ifdef MODERN_VERSION
  11270. SelContent seldlg;
  11271. if (seldlg.DoModal() != IDOK)return;
  11272. CPrintRX m_Print;
  11273. m_Print.InitToPrint(NULL, 1);
  11274. m_Print.StartPrint();
  11275. m_Print.StartPage();
  11276. // CRect StrRect(0,0,560,818);
  11277. LoadRect load;
  11278. LoadRect load2;
  11279. LoadRect load3;
  11280. load.SetLiaPath ("9.lia");
  11281. load.SetMargins(-14,0);
  11282. if(!load.Load ())return;
  11283. int i;
  11284. //////////////////////////////////////////////////////////////
  11285. CStringArray txarray;
  11286. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  11287. g_sendhead.code[0]=11;
  11288. g_sendhead.code[1]=52;
  11289. g_sendhead.code[2]=50;
  11290. g_sendhead.code[3]=38;
  11291. g_sendhead.code[4]=27;
  11292. g_sendhead.tabcount=5;
  11293. g_sendhead.bsql=0;
  11294. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11295. CArray<CStringArray, CStringArray>sparray;
  11296. CArray<CStringArray, CStringArray>clientarray;
  11297. CArray<CStringArray, CStringArray>phonearray;
  11298. CArray<CStringArray, CStringArray>bukuan2array;
  11299. CArray<CStringArray, CStringArray>bukuanarray;
  11300. DataToArray(&g_List1array, &clientarray, &sparray, &bukuan2array, &bukuanarray);
  11301. CTime tm=CTime::GetCurrentTime ();
  11302. CString str;
  11303. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11304. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11305. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11306. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11307. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11308. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  11309. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11310. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11311. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11312. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11313. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11314. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11315. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11316. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11317. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11318. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11319. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11320. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11321. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11322. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11323. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11324. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11325. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11326. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11327. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11328. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11329. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11330. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11331. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11332. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11333. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11334. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11335. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11336. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  11337. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  11338. filter="name='"+m_ren+"'";
  11339. g_sendhead.code[0]=5;
  11340. g_sendhead.tabcount=1;
  11341. g_sendhead.bsql=0;
  11342. int g_nYearposTemp=g_nYearpos;
  11343. g_nYearpos=-1;
  11344. g_pMainWnd->ProcessChatMessageRequest2(filter);
  11345. g_nYearpos=g_nYearposTemp;
  11346. if(g_bSendOK==0)return;
  11347. DataToArray(&phonearray);
  11348. m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
  11349. m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
  11350. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11351. ConvertToPrice(m_money1);
  11352. ConvertToPrice(m_money2);
  11353. ConvertToPrice(m_money3);
  11354. ////////////////////////////////////////////////////////////////
  11355. int rcpos=-1;
  11356. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11357. Image *pImg=NULL;
  11358. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo2.jpg");
  11359. if(seldlg.m_bFrame)
  11360. m_Print.DrawImage(pImg, StrRect);
  11361. delete pImg;
  11362. m_Print.SetFontFace(16, 1, "黑体");
  11363. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11364. if(seldlg.m_bFrame)
  11365. ///////////////////////////////不用改
  11366. m_Print.DrawText((LPTSTR)(LPCTSTR)"摩登新娘工作流程单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11367. m_Print.SetFontFace(10, 1, "宋体");
  11368. for( i=3; i<=6; i++)
  11369. {
  11370. StrRect=load.m_rcarray .ElementAt (i-1);
  11371. if(seldlg.m_bFrame)
  11372. m_Print.DrawRect2(StrRect, 1);
  11373. }
  11374. CStringArray strarray;
  11375. if(seldlg.m_bBooking==0)
  11376. {
  11377. m_name1.Empty ();
  11378. m_name2.Empty ();
  11379. m_phone1.Empty ();
  11380. m_phone2.Empty ();
  11381. m_addr1.Empty ();
  11382. m_addr2.Empty ();
  11383. m_taoxiname.Empty ();
  11384. m_taoxijiage.Empty ();
  11385. }
  11386. if(seldlg.m_bFrame )
  11387. {
  11388. strarray.Add("新郎:"+m_name1);
  11389. strarray.Add("H");
  11390. strarray.Add("O");
  11391. strarray.Add("手机:"+m_phone1);
  11392. strarray.Add("新娘:"+m_name2);
  11393. strarray.Add("H");
  11394. strarray.Add("O");
  11395. strarray.Add("手机:"+m_phone2);
  11396. }
  11397. else
  11398. {
  11399. strarray.Add(" "+m_name1);
  11400. strarray.Add("");
  11401. strarray.Add("");
  11402. strarray.Add(" "+m_phone1);
  11403. strarray.Add(" "+m_name2);
  11404. strarray.Add("");
  11405. strarray.Add("");
  11406. strarray.Add(" "+m_phone2);
  11407. }
  11408. for( i=7; i<=14; i++)
  11409. {
  11410. StrRect=load.m_rcarray .ElementAt (i-1);
  11411. StrRect.left +=2;
  11412. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11413. }
  11414. StrRect=load.m_rcarray .ElementAt (3);
  11415. StrRect.left +=2;
  11416. if(seldlg.m_bFrame)
  11417. str="地址:"+m_addr1;
  11418. else
  11419. str=" "+m_addr1;
  11420. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11421. StrRect=load.m_rcarray .ElementAt (5);
  11422. StrRect.left +=2;
  11423. if(seldlg.m_bFrame)
  11424. str="地址:"+m_addr2;
  11425. else
  11426. str=" "+m_addr2;
  11427. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11428. //////////////////////////////////////////////////////
  11429. StrRect=load.m_rcarray .ElementAt (14);
  11430. str="预\r\n约";
  11431. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11432. StrRect.top +=46;
  11433. StrRect.left +=2;
  11434. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11435. m_Print.SetFontFace(10, 1, "宋体");
  11436. StrRect=load.m_rcarray .ElementAt (15);
  11437. if(seldlg.m_bFrame)
  11438. str="套系名称:"+m_taoxiname;
  11439. else
  11440. str=" "+m_taoxiname;
  11441. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11442. StrRect.left +=4;
  11443. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11444. StrRect=load.m_rcarray .ElementAt (16);
  11445. if(seldlg.m_bFrame)
  11446. str="单价:"+m_taoxijiage;
  11447. else
  11448. str=" "+m_taoxijiage;
  11449. StrRect.left +=2;
  11450. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11451. StrRect=load.m_rcarray .ElementAt (21);
  11452. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11453. str="新人签名:";
  11454. StrRect.left +=2;
  11455. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11456. StrRect=load.m_rcarray .ElementAt (22);
  11457. if(seldlg.m_bBooking==0)
  11458. {
  11459. if(seldlg.m_bFrame)
  11460. str="未付款:";
  11461. else
  11462. str=" ";
  11463. }
  11464. else
  11465. {
  11466. if(seldlg.m_bFrame)
  11467. str="未付款:"+m_money3;
  11468. else
  11469. str=" "+m_money3;
  11470. }
  11471. StrRect.left +=2;
  11472. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11473. StrRect=load.m_rcarray .ElementAt (23);
  11474. str="结婚秘书:";
  11475. StrRect.left +=2;
  11476. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11477. StrRect=load.m_rcarray .ElementAt (24);
  11478. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11479. StrRect.left +=3;
  11480. StrRect.top +=3;
  11481. StrRect.right -=2;
  11482. StrRect.bottom -=2;
  11483. int realpos=0;str="";
  11484. for(i=0; i<sparray.GetSize (); i++)
  11485. {
  11486. if(atoi(sparray.ElementAt (i).ElementAt (4))!=1)continue;
  11487. str+=sparray.ElementAt (i).ElementAt (5);
  11488. str+=" 数量:";
  11489. str+=sparray.ElementAt (i).ElementAt (3);
  11490. if(realpos%2)
  11491. str+="\r\n";
  11492. else
  11493. str+=" ";
  11494. realpos++;
  11495. }
  11496. str.TrimRight ("\r\n");
  11497. str.TrimRight (" ");
  11498. if(seldlg.m_bBooking)AutoDraw(m_Print, StrRect, str, 1.4);
  11499. ///////////////////////////////////////////////////////////
  11500. StrRect=load.m_rcarray .ElementAt (14);
  11501. StrRect.top +=1*122;
  11502. StrRect.bottom +=1*122;
  11503. str="拍\r\n照";
  11504. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11505. StrRect.top +=46;
  11506. StrRect.left +=2;
  11507. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11508. m_Print.SetFontFace(10, 1, "宋体");
  11509. StrRect=load.m_rcarray .ElementAt (15);
  11510. StrRect.top +=1*122;
  11511. StrRect.bottom +=1*122;
  11512. str="拍照内容: 白 晚 特 便";
  11513. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11514. StrRect.left +=4;
  11515. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11516. StrRect=load.m_rcarray .ElementAt (21);
  11517. StrRect.top +=1*122;
  11518. StrRect.bottom +=1*122;
  11519. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11520. str=" 新人签名:";
  11521. StrRect.left +=2;
  11522. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11523. StrRect=load.m_rcarray .ElementAt (22);
  11524. StrRect.top +=1*122;
  11525. StrRect.bottom +=1*122;
  11526. if(seldlg.m_bTake)
  11527. {
  11528. if(seldlg.m_bFrame)
  11529. str="未付款:"+m_money3;
  11530. else
  11531. str=" "+m_money3;
  11532. }
  11533. else
  11534. {
  11535. if(seldlg.m_bFrame)
  11536. str="未付款:";
  11537. else
  11538. str=" ";
  11539. }
  11540. StrRect.left +=2;
  11541. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11542. StrRect=load.m_rcarray .ElementAt (23);
  11543. StrRect.top +=1*122;
  11544. StrRect.bottom +=1*122;
  11545. str="结婚秘书:";
  11546. StrRect.left +=2;
  11547. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11548. StrRect=load.m_rcarray .ElementAt (24);
  11549. StrRect.top +=1*122;
  11550. StrRect.bottom +=1*122;
  11551. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11552. StrRect.left +=3;
  11553. StrRect.top +=3;
  11554. StrRect.right -=2;
  11555. StrRect.bottom -=2;
  11556. if(seldlg.m_bTake)
  11557. {
  11558. str="";
  11559. for(i=0; i<bukuan2array.GetSize (); i++)
  11560. {
  11561. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=1)continue;
  11562. str+="加挑: ";
  11563. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11564. str+="\r\n";
  11565. }
  11566. str.TrimRight ("\r\n");
  11567. str.TrimRight (" ");
  11568. AutoDraw(m_Print, StrRect, str, 1.4);
  11569. }
  11570. ///////////////////////////////////////////////////////////
  11571. StrRect=load.m_rcarray .ElementAt (14);
  11572. StrRect.top +=2*122;
  11573. StrRect.bottom +=2*122;
  11574. str="选\r\n样";
  11575. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11576. StrRect.top +=46;
  11577. StrRect.left +=2;
  11578. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11579. m_Print.SetFontFace(10, 1, "宋体");
  11580. StrRect=load.m_rcarray .ElementAt (15);
  11581. StrRect.top +=2*122;
  11582. StrRect.bottom +=2*122;
  11583. str="选片内容:";
  11584. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11585. StrRect.left +=4;
  11586. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11587. StrRect=load.m_rcarray .ElementAt (21);
  11588. StrRect.top +=2*122;
  11589. StrRect.bottom +=2*122;
  11590. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11591. str=" 新人签名:";
  11592. StrRect.left +=2;
  11593. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11594. StrRect=load.m_rcarray .ElementAt (22);
  11595. StrRect.top +=2*122;
  11596. StrRect.bottom +=2*122;
  11597. if(seldlg.m_bChoose)
  11598. {
  11599. if(seldlg.m_bFrame)
  11600. str="未付款:"+m_money3;
  11601. else
  11602. str=" "+m_money3;
  11603. }
  11604. else
  11605. {
  11606. if(seldlg.m_bFrame)
  11607. str="未付款:";
  11608. else
  11609. str=" ";
  11610. }
  11611. StrRect.left +=2;
  11612. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11613. StrRect=load.m_rcarray .ElementAt (23);
  11614. StrRect.top +=2*122;
  11615. StrRect.bottom +=2*122;
  11616. str="结婚秘书:";
  11617. StrRect.left +=2;
  11618. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11619. StrRect=load.m_rcarray .ElementAt (24);
  11620. StrRect.top +=2*122;
  11621. StrRect.bottom +=2*122;
  11622. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11623. if(seldlg.m_bChoose)
  11624. {
  11625. StrRect.left +=3;
  11626. StrRect.top +=3;
  11627. StrRect.right -=2;
  11628. StrRect.bottom -=2;
  11629. str="";
  11630. for(i=0; i<bukuan2array.GetSize (); i++)
  11631. {
  11632. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=2)continue;
  11633. str+="加挑: ";
  11634. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11635. str+="\r\n";
  11636. }
  11637. str.TrimRight ("\r\n");
  11638. str.TrimRight (" ");
  11639. AutoDraw(m_Print, StrRect, str, 1.4);
  11640. }
  11641. ///////////////////////////////////////////////////////////
  11642. StrRect=load.m_rcarray .ElementAt (14);
  11643. StrRect.top +=3*122;
  11644. StrRect.bottom +=3*122;
  11645. str="结\r\n婚";
  11646. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11647. StrRect.top +=46;
  11648. StrRect.left +=2;
  11649. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11650. m_Print.SetFontFace(10, 1, "宋体");
  11651. StrRect=load.m_rcarray .ElementAt (15);
  11652. StrRect.top +=3*122;
  11653. StrRect.bottom +=3*122;
  11654. str="结婚内容: 区 白 晚 押金:";
  11655. if(seldlg.m_bFrame) m_Print.DrawRect2(StrRect, 1);
  11656. StrRect.left +=4;
  11657. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11658. StrRect=load.m_rcarray .ElementAt (21);
  11659. StrRect.top +=3*122;
  11660. StrRect.bottom +=3*122;
  11661. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11662. str=" 新人签名:";
  11663. StrRect.left +=2;
  11664. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11665. StrRect=load.m_rcarray .ElementAt (22);
  11666. StrRect.top +=3*122;
  11667. StrRect.bottom +=3*122;
  11668. if(seldlg.m_bBooking)
  11669. {
  11670. if(seldlg.m_bFrame)
  11671. str="未付款:"+m_money3;
  11672. else
  11673. str=" "+m_money3;
  11674. }
  11675. else
  11676. {
  11677. if(seldlg.m_bFrame)
  11678. str="未付款:";
  11679. else
  11680. str=" ";
  11681. }
  11682. StrRect.left +=2;
  11683. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11684. StrRect=load.m_rcarray .ElementAt (23);
  11685. StrRect.top +=3*122;
  11686. StrRect.bottom +=3*122;
  11687. str="结婚秘书:";
  11688. StrRect.left +=2;
  11689. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11690. StrRect=load.m_rcarray .ElementAt (24);
  11691. StrRect.top +=3*122;
  11692. StrRect.bottom +=3*122;
  11693. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11694. if(seldlg.m_bBooking)
  11695. {
  11696. StrRect.left +=3;
  11697. StrRect.top +=3;
  11698. StrRect.right -=2;
  11699. StrRect.bottom -=2;
  11700. realpos=0;str="";
  11701. for(i=0; i<sparray.GetSize (); i++)
  11702. {
  11703. if(atoi(sparray.ElementAt (i).ElementAt (4))!=2)continue;
  11704. str+=sparray.ElementAt (i).ElementAt (5);
  11705. str+=" 数量:";
  11706. str+=sparray.ElementAt (i).ElementAt (3);
  11707. if(realpos%2)
  11708. str+="\r\n";
  11709. else
  11710. str+=" ";
  11711. realpos++;
  11712. }
  11713. str.TrimRight ("\r\n");
  11714. str.TrimRight (" ");
  11715. AutoDraw(m_Print, StrRect, str, 1.4);
  11716. }
  11717. ///////////////////////////////////////
  11718. strarray.RemoveAll ();
  11719. if(seldlg.m_bFrame)
  11720. {
  11721. strarray.Add ("项目");
  11722. strarray.Add ("万");
  11723. strarray.Add ("千");
  11724. strarray.Add ("百");
  11725. strarray.Add ("十");
  11726. strarray.Add ("个");
  11727. strarray.Add ("收 银");
  11728. }
  11729. else
  11730. {
  11731. strarray.Add ("");
  11732. strarray.Add ("");
  11733. strarray.Add ("");
  11734. strarray.Add ("");
  11735. strarray.Add ("");
  11736. strarray.Add ("");
  11737. strarray.Add ("");
  11738. }
  11739. CStringArray strarray2;
  11740. float ftotal=0;
  11741. int realcount=0;
  11742. if(seldlg.m_bBooking)
  11743. {
  11744. for(i=0; i<bukuanarray.GetSize (); i++)
  11745. {
  11746. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=3 && atoi(bukuanarray.ElementAt (i).ElementAt (6))!=4)continue;
  11747. realcount++;
  11748. if(realcount>6)break;
  11749. str=bukuanarray.ElementAt (i).ElementAt (1);
  11750. ftotal+=atof(str);
  11751. strarray2.Add (GetW(str));
  11752. strarray2.Add (GetK(str));
  11753. strarray2.Add (GetB(str));
  11754. strarray2.Add (GetS(str));
  11755. strarray2.Add (GetG(str));
  11756. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11757. }
  11758. }
  11759. while(strarray2.GetSize ()<36)
  11760. strarray2.Add ("");
  11761. str.Format ("%f", ftotal);
  11762. strarray2.Add (GetW(str));
  11763. strarray2.Add (GetK(str));
  11764. strarray2.Add (GetB(str));
  11765. strarray2.Add (GetS(str));
  11766. strarray2.Add (GetG(str));
  11767. strarray2.Add ("");
  11768. //拍照
  11769. ftotal=0;
  11770. realcount=0;
  11771. if(seldlg.m_bTake)
  11772. {
  11773. for(i=0; i<bukuanarray.GetSize (); i++)
  11774. {
  11775. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=1)continue;
  11776. realcount++;
  11777. if(realcount>6)break;
  11778. str=bukuanarray.ElementAt (i).ElementAt (1);
  11779. ftotal+=atof(str);
  11780. strarray2.Add (GetW(str));
  11781. strarray2.Add (GetK(str));
  11782. strarray2.Add (GetB(str));
  11783. strarray2.Add (GetS(str));
  11784. strarray2.Add (GetG(str));
  11785. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11786. }
  11787. }
  11788. while(strarray2.GetSize ()<42+36)
  11789. strarray2.Add ("");
  11790. str.Format ("%f", ftotal);
  11791. strarray2.Add (GetW(str));
  11792. strarray2.Add (GetK(str));
  11793. strarray2.Add (GetB(str));
  11794. strarray2.Add (GetS(str));
  11795. strarray2.Add (GetG(str));
  11796. strarray2.Add ("");
  11797. //选片
  11798. ftotal=0;
  11799. realcount=0;
  11800. if(seldlg.m_bChoose)
  11801. {
  11802. for(i=0; i<bukuanarray.GetSize (); i++)
  11803. {
  11804. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=2)continue;
  11805. realcount++;
  11806. if(realcount>6)break;
  11807. str=bukuanarray.ElementAt (i).ElementAt (1);
  11808. ftotal+=atof(str);
  11809. strarray2.Add (GetW(str));
  11810. strarray2.Add (GetK(str));
  11811. strarray2.Add (GetB(str));
  11812. strarray2.Add (GetS(str));
  11813. strarray2.Add (GetG(str));
  11814. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11815. }
  11816. }
  11817. while(strarray2.GetSize ()<42*2+36)
  11818. strarray2.Add ("");
  11819. str.Format ("%f", ftotal);
  11820. strarray2.Add (GetW(str));
  11821. strarray2.Add (GetK(str));
  11822. strarray2.Add (GetB(str));
  11823. strarray2.Add (GetS(str));
  11824. strarray2.Add (GetG(str));
  11825. strarray2.Add ("");
  11826. /////////////////////////////
  11827. CRect temprc;
  11828. for(int n=0; n<4; n++)
  11829. {
  11830. StrRect=load.m_rcarray .ElementAt (17);
  11831. StrRect.top +=n*122;
  11832. StrRect.bottom +=n*122;
  11833. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11834. StrRect=load.m_rcarray .ElementAt (18);
  11835. if(n)
  11836. {
  11837. StrRect.left +=36;
  11838. StrRect.right +=36;
  11839. }
  11840. StrRect.top +=n*122;
  11841. StrRect.bottom +=n*122;
  11842. if(seldlg.m_bFrame)
  11843. str.Format("%d年", tm.GetYear ());
  11844. else
  11845. str.Format("%d ", tm.GetYear ());
  11846. 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))
  11847. {
  11848. if(seldlg.m_bFrame)
  11849. str=" 年";
  11850. else
  11851. str=" ";
  11852. }
  11853. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11854. StrRect=load.m_rcarray .ElementAt (19);
  11855. if(n)
  11856. {
  11857. StrRect.left +=38;
  11858. StrRect.right +=38;
  11859. }
  11860. StrRect.top +=n*122;
  11861. StrRect.bottom +=n*122;
  11862. if(seldlg.m_bFrame)
  11863. str.Format("%02d月", tm.GetMonth ());
  11864. else
  11865. str.Format("%02d ", tm.GetMonth ());
  11866. 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))
  11867. {
  11868. if(seldlg.m_bFrame)
  11869. str=" 月";
  11870. else
  11871. str=" ";
  11872. }
  11873. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11874. StrRect=load.m_rcarray .ElementAt (20);
  11875. if(n)
  11876. {
  11877. StrRect.left +=36;
  11878. StrRect.right +=36;
  11879. }
  11880. StrRect.top +=n*122;
  11881. StrRect.bottom +=n*122;
  11882. if(seldlg.m_bFrame)
  11883. str.Format("%02d日", tm.GetDay ());
  11884. else
  11885. str.Format("%02d ", tm.GetDay ());
  11886. 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))
  11887. {
  11888. if(seldlg.m_bFrame)
  11889. str=" 日";
  11890. else
  11891. str=" ";
  11892. }
  11893. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11894. for(i=26; i<=32; i++)
  11895. {
  11896. StrRect=load.m_rcarray .ElementAt (i-1);
  11897. StrRect.bottom -=14;
  11898. for(int j=0; j<8; j++)
  11899. {
  11900. StrRect.top=StrRect.bottom;
  11901. if(j>2)
  11902. {
  11903. StrRect.bottom =StrRect.top+14;
  11904. }
  11905. else
  11906. {
  11907. StrRect.bottom =StrRect.top+13;
  11908. }
  11909. temprc=StrRect;
  11910. StrRect.top +=n*122;
  11911. StrRect.bottom +=n*122;
  11912. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11913. if(i==26 && j==4 && seldlg.m_bFrame)
  11914. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11915. else if(i==26 && j==5 && seldlg.m_bFrame)
  11916. m_Print.DrawText((LPTSTR)(LPCTSTR)"付款", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11917. else if(i==26 && j==7 && seldlg.m_bFrame)
  11918. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11919. else if(j==0)
  11920. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-26), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11921. else if(j && i>26 && n<3)
  11922. {
  11923. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray2.ElementAt ((j-1)*6+(i-27)+n*42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11924. }
  11925. StrRect=temprc;
  11926. }
  11927. }
  11928. }
  11929. if(seldlg.m_bFrame)
  11930. {
  11931. StrRect=load.m_rcarray .ElementAt (32);
  11932. str="注\r\n意\r\n事\r\n项";
  11933. StrRect.top +=367;
  11934. StrRect.bottom +=367;
  11935. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11936. StrRect.top +=17;
  11937. StrRect.left +=2;
  11938. AutoDraw(m_Print, StrRect, str, 1.4);
  11939. StrRect=load.m_rcarray .ElementAt (33);
  11940. str="1: 本预约单自预定日期起一年内有效.定金在拍照套系金额中扣出.预定金一概不退\r\n\
  11941. 2: 多拍照片只供筛选.恕不奉送.版权所有.不得私自拷贝\r\n\
  11942. 3: 拍照款请于拍照时一次付清\r\n\
  11943. 4: 新娘装AM8:00前钟点费另计.婚纱礼服出租押金500-2000元\r\n\
  11944. 5: 本公司设有豪华VIP礼服区.及皇家御用礼服展区.但需另外加价.详情请咨本店人员\r\n\
  11945. 6: 安瓶, 美甲一次性化妆用具等均属增值服务部分,则需另外加价,详情咨询本店工作人员\r\n\
  11946. 7: 本电脑机械故障导致文件资料丢失.本公司只提供补拍服务\r\n\
  11947. 8: 每次前来请务必携带本单交给工作人员.本单是您在摩登新娘拍照的凭证.办理有关手续凭本单办理盖\r\n\
  11948. 章后方可生效";
  11949. StrRect.top +=367;
  11950. StrRect.bottom +=367;
  11951. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11952. StrRect.top +=4;
  11953. StrRect.left +=2;
  11954. AutoDraw(m_Print, StrRect, str, 1.0);
  11955. StrRect=load.m_rcarray .ElementAt (34);
  11956. 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)";
  11957. AutoDraw(m_Print, StrRect, str, 1.0);
  11958. m_Print.SetFontFace(13, 1, "宋体");
  11959. StrRect=load.m_rcarray .ElementAt (35);
  11960. str="地 址: 汉口 . 解放大道 . 头道街东部购物公园C栋二,三层";
  11961. StrRect.top +=367;
  11962. StrRect.bottom +=367;
  11963. StrRect.left +=2;
  11964. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11965. StrRect=load.m_rcarray .ElementAt (36);
  11966. str="喜讯热线: 027-81888799 81888599 81888699";
  11967. StrRect.top +=367;
  11968. StrRect.bottom +=367;
  11969. StrRect.left +=2;
  11970. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11971. }
  11972. PrintPreview dlg;
  11973. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11974. dlg.m_pDC =m_Print.GetPDC() ;
  11975. if(dlg.DoModal ()!=IDOK)return;
  11976. //结束打印
  11977. m_Print.EndPage();
  11978. m_Print.EndPrint();
  11979. #endif
  11980. }
  11981. extern CString GetHMoney(CString str);
  11982. void CMainFrame::PrintReceipt3(CString strOrderNumber, CStringArray *pArray, float money)
  11983. {
  11984. int printcot = 1;
  11985. for (int aa = 0; aa < printcot; aa++)
  11986. {
  11987. g_sendhead.bsql = 0;
  11988. g_sendhead.code[0] = 24;
  11989. g_sendhead.tabcount = 1;
  11990. int g_nYearposTemp = g_nYearpos;
  11991. g_nYearpos = -1;
  11992. g_pMainWnd->ProcessChatMessageRequest2(1);
  11993. g_nYearpos = g_nYearposTemp;
  11994. if (0 == g_bSendOK)return;
  11995. DataToArray(&g_cominfoarray);
  11996. CString SerialNo;
  11997. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  11998. CPrintRX m_Print;
  11999. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12000. {
  12001. m_Print.InitToPrint(NULL, 1);
  12002. }
  12003. else
  12004. {
  12005. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  12006. if (name.IsEmpty())
  12007. m_Print.InitToPrint(NULL, 1);
  12008. else
  12009. {
  12010. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12011. if (nret == -1 && aa == 0)
  12012. {
  12013. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12014. }
  12015. }
  12016. }
  12017. m_Print.StartPrint();
  12018. m_Print.StartPage();
  12019. LoadRect load;
  12020. load.SetLiaPath("15.lia");
  12021. load.SetMargins(0, 0);
  12022. if (!load.Load())return;
  12023. int i;
  12024. //////////////////////////////////////////////////////////////
  12025. CStringArray txarray;
  12026. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  12027. g_sendhead.code[0] = 11;
  12028. g_sendhead.code[1] = 52;
  12029. g_sendhead.tabcount = 2;
  12030. g_sendhead.bsql = 0;
  12031. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12032. CArray<CStringArray, CStringArray>sparray;
  12033. CArray<CStringArray, CStringArray>clientarray;
  12034. DataToArray(&g_List1array, &clientarray);
  12035. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12036. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12037. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12038. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12039. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12040. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  12041. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12042. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12043. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12044. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12045. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12046. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12047. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12048. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12049. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12050. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12051. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12052. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12053. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12054. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12055. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12056. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12057. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12058. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12059. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12060. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12061. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12062. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12063. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  12064. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12065. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12066. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  12067. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  12068. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  12069. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  12070. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  12071. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  12072. CString m_addr = m_addr1 + ";";
  12073. m_addr.TrimLeft(";");
  12074. m_addr += m_addr2;
  12075. CString m_qq = m_qq1 + ";";
  12076. m_qq.TrimLeft(";");
  12077. m_qq += m_qq2;
  12078. m_money1.Format("%f", atof(m_taoxijiage));
  12079. m_money2.Format("%f", atof(m_payed1));
  12080. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  12081. ConvertToPrice(m_money1);
  12082. ConvertToPrice(m_money2);
  12083. ConvertToPrice(m_money3);
  12084. ////////////////////////////////////////////////////////////////
  12085. int rcpos = -1;
  12086. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12087. m_Print.SetFontFace(17, 1, "宋体");
  12088. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12089. StrRect.top -= 0;
  12090. StrRect.bottom -= 10;
  12091. StrRect.left -= 140;
  12092. StrRect.right = StrRect.left + 48;
  12093. m_Print.SetFontFace(15, 1, "宋体");
  12094. m_Print.SetColor(0xffffff);
  12095. m_Print.DrawRect(StrRect, 0);
  12096. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12097. StrRect.left = StrRect.right;
  12098. StrRect.right = StrRect.left + 48;
  12099. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12100. m_Print.SetColor(0, RGB(255, 0, 0));
  12101. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12102. m_Print.SetColor(0);
  12103. m_Print.SetFontFace(12, 1, "宋体");
  12104. StrRect.left -= 48;
  12105. int hei = StrRect.Height();
  12106. StrRect.top = StrRect.bottom + 2;
  12107. StrRect.bottom += hei + 2;
  12108. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12109. StrRect.top = StrRect.bottom - 2;
  12110. StrRect.bottom += hei - 5;
  12111. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12112. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12113. m_Print.SetFontFace(12, 1, "宋体");
  12114. m_Print.DrawText((LPTSTR)(LPCTSTR)"收款单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12115. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12116. m_Print.SetFontFace(9, 1, "宋体");
  12117. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12118. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12119. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12120. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12121. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12122. m_Print.DrawRect2(StrRect, 2);
  12123. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12124. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12125. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12126. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12127. m_Print.DrawRect2(StrRect, 2);
  12128. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12129. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12130. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12131. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12132. m_Print.DrawRect2(StrRect, 2);
  12133. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12134. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12135. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12136. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12137. m_Print.DrawRect2(StrRect, 2);
  12138. ////////////
  12139. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12140. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12141. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12142. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12143. m_Print.DrawRect2(StrRect, 2);
  12144. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12145. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12146. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12147. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12148. m_Print.DrawRect2(StrRect, 2);
  12149. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12150. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12151. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12152. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12153. m_Print.DrawRect2(StrRect, 2);
  12154. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12155. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12156. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12157. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12158. m_Print.DrawRect2(StrRect, 2);
  12159. for (i = 19; i < 49; i++)
  12160. {
  12161. if (i >= 44)
  12162. {
  12163. StrRect = load.m_rcarray.ElementAt(i - 5);
  12164. int hei = StrRect.Height();
  12165. StrRect.top += hei;
  12166. StrRect.bottom += hei;
  12167. }
  12168. else
  12169. StrRect = load.m_rcarray.ElementAt(i);
  12170. m_Print.DrawRect2(StrRect, 1);
  12171. }
  12172. float fmoney = 0;
  12173. for (i = 19; i < 49; i++)
  12174. {
  12175. if (i >= 44)
  12176. {
  12177. StrRect = load.m_rcarray.ElementAt(i - 5);
  12178. int hei = StrRect.Height();
  12179. StrRect.top += hei;
  12180. StrRect.bottom += hei;
  12181. }
  12182. else
  12183. StrRect = load.m_rcarray.ElementAt(i);
  12184. StrRect.left += 2;
  12185. /* if((i-19)%5==2)
  12186. {
  12187. fmoney+=atof(pArray->ElementAt (i-19));
  12188. }*/
  12189. m_Print.DrawText((LPTSTR)(LPCTSTR)(pArray->ElementAt(i - 19)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12190. }
  12191. m_money2.Format("%f", money);
  12192. ConvertToPrice(m_money2);
  12193. StrRect = load.m_rcarray.ElementAt(44);
  12194. CString str;
  12195. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 实收¥: %s 元 收银员: %s", \
  12196. GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
  12197. m_money2, g_user.name);
  12198. m_Print.DrawRect2(StrRect, 1);
  12199. StrRect.left += 3;
  12200. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12201. StrRect = load.m_rcarray.ElementAt(46);
  12202. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12203. StrRect = load.m_rcarray.ElementAt(47);
  12204. m_Print.DrawRect2(StrRect, 2);
  12205. StrRect = load.m_rcarray.ElementAt(48);
  12206. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12207. StrRect = load.m_rcarray.ElementAt(45);
  12208. str = "\
  12209. 顾客须知\r\n\
  12210. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  12211. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  12212. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  12213. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  12214. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  12215. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  12216. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  12217. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12218. AutoDraw(m_Print, StrRect, str, 1.8);
  12219. PrintPreview dlg;
  12220. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12221. dlg.m_pDC = m_Print.GetPDC();
  12222. if (aa == 0)
  12223. {
  12224. if (dlg.DoModal() != IDOK)
  12225. return;
  12226. printcot = dlg.m_num;
  12227. }
  12228. //结束打印
  12229. m_Print.EndPage();
  12230. m_Print.EndPrint();
  12231. }
  12232. }
  12233. void CMainFrame::PrintReceipt2(CString strOrderNumber)
  12234. {
  12235. int printcot = 1;
  12236. for (int aa = 0; aa < printcot; aa++)
  12237. {
  12238. g_sendhead.bsql = 0;
  12239. g_sendhead.code[0] = 24;
  12240. g_sendhead.tabcount = 1;
  12241. int g_nYearposTemp = g_nYearpos;
  12242. g_nYearpos = -1;
  12243. g_pMainWnd->ProcessChatMessageRequest2(1);
  12244. g_nYearpos = g_nYearposTemp;
  12245. if (0 == g_bSendOK)return;
  12246. DataToArray(&g_cominfoarray);
  12247. CString SerialNo;
  12248. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  12249. CPrintRX m_Print;
  12250. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12251. {
  12252. m_Print.InitToPrint(NULL, 1);
  12253. }
  12254. else
  12255. {
  12256. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  12257. if (name.IsEmpty())
  12258. m_Print.InitToPrint(NULL, 1);
  12259. else
  12260. {
  12261. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12262. if (nret == -1 && aa == 0)
  12263. {
  12264. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12265. }
  12266. }
  12267. }
  12268. m_Print.StartPrint();
  12269. m_Print.StartPage();
  12270. LoadRect load;
  12271. load.SetLiaPath("14.lia");
  12272. load.SetMargins(0, 0);
  12273. if (!load.Load())return;
  12274. int i;
  12275. //////////////////////////////////////////////////////////////
  12276. CStringArray txarray;
  12277. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  12278. g_sendhead.code[0] = 11;
  12279. g_sendhead.code[1] = 52;
  12280. g_sendhead.code[2] = 93;
  12281. g_sendhead.tabcount = 3;
  12282. g_sendhead.bsql = 0;
  12283. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12284. CArray<CStringArray, CStringArray>sparray;
  12285. CArray<CStringArray, CStringArray>clientarray;
  12286. CArray<CStringArray, CStringArray>moneyarray;
  12287. DataToArray(&g_List1array, &clientarray, &moneyarray);
  12288. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12289. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12290. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12291. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12292. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12293. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  12294. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12295. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12296. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12297. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12298. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12299. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12300. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12301. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12302. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12303. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12304. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12305. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12306. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12307. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12308. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12309. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12310. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12311. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12312. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12313. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12314. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12315. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12316. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  12317. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12318. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12319. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  12320. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  12321. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  12322. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  12323. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  12324. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  12325. CString m_addr = m_addr1 + ";";
  12326. m_addr.TrimLeft(";");
  12327. m_addr += m_addr2;
  12328. CString m_qq = m_qq1 + ";";
  12329. m_qq.TrimLeft(";");
  12330. m_qq += m_qq2;
  12331. m_money1.Format("%f", atof(m_taoxijiage));
  12332. m_money2 = "0";
  12333. for (i = 0; i < moneyarray.GetSize(); i++)
  12334. {
  12335. if (moneyarray.ElementAt(i).ElementAt(5) == "预约收款")
  12336. m_money2 = moneyarray.ElementAt(i).ElementAt(1);
  12337. }
  12338. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  12339. ConvertToPrice(m_money1);
  12340. ConvertToPrice(m_money2);
  12341. ConvertToPrice(m_money3);
  12342. ////////////////////////////////////////////////////////////////
  12343. int rcpos = -1;
  12344. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12345. m_Print.SetFontFace(17, 1, "宋体");
  12346. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12347. StrRect.top -= 0;
  12348. StrRect.bottom -= 10;
  12349. StrRect.left -= 140;
  12350. StrRect.right = StrRect.left + 48;
  12351. m_Print.SetFontFace(15, 1, "宋体");
  12352. m_Print.SetColor(0xffffff);
  12353. m_Print.DrawRect(StrRect, 0);
  12354. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12355. StrRect.left = StrRect.right;
  12356. StrRect.right = StrRect.left + 48;
  12357. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12358. m_Print.SetColor(0, RGB(255, 0, 0));
  12359. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12360. m_Print.SetColor(0);
  12361. m_Print.SetFontFace(12, 1, "宋体");
  12362. StrRect.left -= 48;
  12363. int hei = StrRect.Height();
  12364. StrRect.top = StrRect.bottom + 2;
  12365. StrRect.bottom += hei + 2;
  12366. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12367. StrRect.top = StrRect.bottom - 2;
  12368. StrRect.bottom += hei - 5;
  12369. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12370. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12371. m_Print.SetFontFace(12, 1, "宋体");
  12372. m_Print.DrawText((LPTSTR)(LPCTSTR)"定金单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12373. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12374. m_Print.SetFontFace(9, 1, "宋体");
  12375. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12376. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12377. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12378. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12379. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12380. m_Print.DrawRect2(StrRect, 2);
  12381. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12382. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12383. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12384. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12385. m_Print.DrawRect2(StrRect, 2);
  12386. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12387. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12388. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12389. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12390. m_Print.DrawRect2(StrRect, 2);
  12391. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12392. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12393. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12394. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12395. m_Print.DrawRect2(StrRect, 2);
  12396. ////////////
  12397. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12398. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12399. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12400. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12401. m_Print.DrawRect2(StrRect, 2);
  12402. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12403. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12404. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12405. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12406. m_Print.DrawRect2(StrRect, 2);
  12407. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12408. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12409. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12410. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12411. m_Print.DrawRect2(StrRect, 2);
  12412. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12413. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12414. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12415. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12416. m_Print.DrawRect2(StrRect, 2);
  12417. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12418. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12419. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12420. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12421. m_Print.DrawRect2(StrRect, 2);
  12422. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12423. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12424. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12425. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12426. m_Print.DrawRect2(StrRect, 2);
  12427. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12428. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/MSN:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12429. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12430. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12431. m_Print.DrawRect2(StrRect, 2);
  12432. CStringArray strarray;
  12433. strarray.Add("套系名称");
  12434. strarray.Add("总 额");
  12435. strarray.Add("定 金");
  12436. strarray.Add("余 款");
  12437. strarray.Add("摄影日期");
  12438. strarray.Add(m_taoxiname);
  12439. strarray.Add(m_money1);
  12440. strarray.Add(m_money2);
  12441. strarray.Add(m_money3);
  12442. strarray.Add(m_time2);
  12443. for (i = 25; i < 37; i++)
  12444. {
  12445. StrRect = load.m_rcarray.ElementAt(i);
  12446. m_Print.DrawRect2(StrRect, 1);
  12447. }
  12448. for (i = 25; i < 35; i++)
  12449. {
  12450. StrRect = load.m_rcarray.ElementAt(i);
  12451. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 25), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12452. }
  12453. StrRect = load.m_rcarray.ElementAt(35);
  12454. StrRect.left += 5;
  12455. StrRect.top += 5;
  12456. m_Print.DrawText((LPTSTR)(LPCTSTR)" 备 注:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  12457. StrRect = load.m_rcarray.ElementAt(36);
  12458. CString str;
  12459. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 ¥: %s 元 收银员: %s", \
  12460. GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
  12461. m_money2, g_user.name);
  12462. StrRect.left += 3;
  12463. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12464. StrRect = load.m_rcarray.ElementAt(38);
  12465. m_Print.DrawText((LPTSTR)(LPCTSTR)"营业员:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12466. StrRect = load.m_rcarray.ElementAt(39);
  12467. m_Print.DrawText((LPTSTR)(LPCTSTR)m_ren, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12468. m_Print.DrawRect2(StrRect, 2);
  12469. StrRect = load.m_rcarray.ElementAt(40);
  12470. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12471. StrRect = load.m_rcarray.ElementAt(41);
  12472. m_Print.DrawRect2(StrRect, 2);
  12473. StrRect = load.m_rcarray.ElementAt(42);
  12474. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12475. StrRect = load.m_rcarray.ElementAt(37);
  12476. str = "\
  12477. 顾客须知\r\n\
  12478. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  12479. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  12480. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  12481. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  12482. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  12483. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  12484. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  12485. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12486. AutoDraw(m_Print, StrRect, str, 1.8);
  12487. PrintPreview dlg;
  12488. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12489. dlg.m_pDC = m_Print.GetPDC();
  12490. if (aa == 0)
  12491. {
  12492. if (dlg.DoModal() != IDOK)
  12493. return;
  12494. printcot = dlg.m_num;
  12495. }
  12496. //结束打印
  12497. m_Print.EndPage();
  12498. m_Print.EndPrint();
  12499. }
  12500. }
  12501. void CMainFrame::OnAutodelphoto()
  12502. {
  12503. // TODO: Add your command handler code here
  12504. if (g_user.bLongin == 0)
  12505. {
  12506. if (g_bNoLoginLia)
  12507. {
  12508. Login dlg;
  12509. dlg.SetLiaPath("5.lia");
  12510. dlg.DoModal();
  12511. }
  12512. else
  12513. {
  12514. Login3 dlg;
  12515. dlg.SetLiaPath("5.lia");
  12516. dlg.DoModal();
  12517. }
  12518. if (g_user.bLongin == 0)return;
  12519. }
  12520. if (IsHasRightsnew(49) == 0)return;
  12521. DelPhotoSet dlg;
  12522. dlg.DoModal();
  12523. }
  12524. void CMainFrame::Onphotomanage() // 客照管理中心;
  12525. {
  12526. if (g_user.bLongin == 0)
  12527. {
  12528. if (g_bNoLoginLia)
  12529. {
  12530. Login dlg;
  12531. dlg.SetLiaPath("5.lia");
  12532. dlg.DoModal();
  12533. }
  12534. else
  12535. {
  12536. Login3 dlg;
  12537. dlg.SetLiaPath("5.lia");
  12538. dlg.DoModal();
  12539. }
  12540. if (g_user.bLongin == 0)return;
  12541. }
  12542. if (IsHasRightsnew(49) == 0)return;
  12543. ShowPic3 dlg;
  12544. dlg.DoModal();
  12545. }
  12546. void CMainFrame::OnCompanyinfo()
  12547. {
  12548. // TODO: Add your command handler code here
  12549. if (g_user.bLongin == 0)
  12550. {
  12551. if (g_bNoLoginLia)
  12552. {
  12553. Login dlg;
  12554. dlg.SetLiaPath("5.lia");
  12555. dlg.DoModal();
  12556. }
  12557. else
  12558. {
  12559. Login3 dlg;
  12560. dlg.SetLiaPath("5.lia");
  12561. dlg.DoModal();
  12562. }
  12563. if (g_user.bLongin == 0)return;
  12564. }
  12565. if (IsHasRightsnew(49) == 0)return;
  12566. CompanyInfo dlg;
  12567. dlg.DoModal();
  12568. }
  12569. void CMainFrame::OnTaoxifg()
  12570. {
  12571. // TODO: Add your command handler code here
  12572. if (g_user.bLongin == 0)
  12573. {
  12574. if (g_bNoLoginLia)
  12575. {
  12576. Login dlg;
  12577. dlg.SetLiaPath("5.lia");
  12578. dlg.DoModal();
  12579. }
  12580. else
  12581. {
  12582. Login3 dlg;
  12583. dlg.SetLiaPath("5.lia");
  12584. dlg.DoModal();
  12585. }
  12586. if (g_user.bLongin == 0)return;
  12587. }
  12588. if (IsHasRightsnew(49) == 0)return;
  12589. TXFG dlg;
  12590. dlg.DoModal();
  12591. }
  12592. void CMainFrame::OnHelpfile()
  12593. {
  12594. // TODO: Add your command handler code here
  12595. // ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  12596. // if(::PathFileExists (g_mainpath+"\\zx.dll"))
  12597. // ShellExecute(NULL, _T("open"), _T("www.zcsmkj.com"), "", NULL, SW_SHOWNORMAL);
  12598. // else
  12599. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  12600. }
  12601. void CMainFrame::OnPhotobak()
  12602. {
  12603. // TODO: Add your command handler code here
  12604. if (g_user.bLongin == 0)
  12605. {
  12606. if (g_bNoLoginLia)
  12607. {
  12608. Login dlg;
  12609. dlg.SetLiaPath("5.lia");
  12610. dlg.DoModal();
  12611. }
  12612. else
  12613. {
  12614. Login3 dlg;
  12615. dlg.SetLiaPath("5.lia");
  12616. dlg.DoModal();
  12617. }
  12618. if (g_user.bLongin == 0)return;
  12619. }
  12620. if (IsHasRightsnew(49) == 0)return;
  12621. PhotoBak dlg;
  12622. dlg.DoModal();
  12623. }
  12624. //客户报表
  12625. void CMainFrame::OnClose2()
  12626. { // TODO: Add your message handler code here and/or call default
  12627. if (AfxMessageBox("是否退出系统?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
  12628. WriteLog("退出系统");//Jeff.add
  12629. g_bShowBar = 0;
  12630. if (m_Mdi.MainClose())
  12631. CMDIFrameWnd::OnClose();
  12632. }
  12633. //
  12634. void CMainFrame::ResetTimer()
  12635. {
  12636. }
  12637. void CMainFrame::LinkClick(CString str, int nParent)
  12638. {
  12639. g_pMainWnd2->m_bar.LinkClick(str);
  12640. }
  12641. void CMainFrame::PrintFlowChart2(CString m_id)
  12642. {
  12643. CPrintRX m_Print;
  12644. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12645. {
  12646. m_Print.InitToPrint(NULL, 1);
  12647. }
  12648. else
  12649. {
  12650. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  12651. if (name.IsEmpty())
  12652. m_Print.InitToPrint(NULL, 1);
  12653. else
  12654. {
  12655. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12656. if (nret == -1)
  12657. {
  12658. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12659. }
  12660. }
  12661. }
  12662. m_Print.StartPrint();
  12663. m_Print.StartPage();
  12664. LoadRect load;
  12665. load.SetLiaPath("16.lia");
  12666. load.SetMargins(0, 0);
  12667. if (!load.Load())return;
  12668. LoadRect load2;
  12669. load2.SetLiaPath("17.lia");
  12670. load2.SetMargins(0, 660);
  12671. if (!load2.Load())return;
  12672. int i;
  12673. //////////////////////////////////////////////////////////////
  12674. CStringArray txarray;
  12675. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and kind<>'2'";
  12676. g_sendhead.code[0] = 11;
  12677. g_sendhead.code[1] = 52;
  12678. g_sendhead.code[2] = 223;
  12679. g_sendhead.tabcount = 3;
  12680. g_sendhead.bsql = 0;
  12681. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12682. CArray<CStringArray, CStringArray>sparray;
  12683. CArray<CStringArray, CStringArray>clientarray;
  12684. DataToArray(&g_List1array, &clientarray, &sparray);
  12685. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12686. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12687. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12688. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12689. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12690. CString m_photocount = g_List1array.ElementAt(0).ElementAt(9);
  12691. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12692. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12693. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12694. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12695. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12696. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12697. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12698. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12699. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12700. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12701. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12702. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12703. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12704. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12705. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12706. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12707. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12708. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12709. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12710. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12711. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12712. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12713. CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(39) + g_List1array.ElementAt(0).ElementAt(75);
  12714. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12715. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12716. CString spno;
  12717. for (i = 0; i < sparray.GetSize(); i++)
  12718. {
  12719. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12720. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  12721. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  12722. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  12723. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  12724. spno += sparray.ElementAt(i).ElementAt(5);
  12725. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
  12726. spno += "; ";
  12727. else
  12728. {
  12729. spno += ":";
  12730. spno += sparray.ElementAt(i).ElementAt(6);
  12731. spno += "; ";
  12732. }
  12733. }
  12734. spno += " 加挑:";
  12735. for (i = 0; i < sparray.GetSize(); i++)
  12736. {
  12737. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  12738. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  12739. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  12740. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  12741. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  12742. spno += sparray.ElementAt(i).ElementAt(5);
  12743. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
  12744. spno += "; ";
  12745. else
  12746. {
  12747. spno += ":";
  12748. spno += sparray.ElementAt(i).ElementAt(6);
  12749. spno += "; ";
  12750. }
  12751. }
  12752. if (spno.Right(6) == " 加挑:")
  12753. {
  12754. spno = spno.Left(spno.GetLength() - 6);
  12755. }
  12756. ////////////////////////////////////////////////////////////////
  12757. int rcpos = -1;
  12758. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12759. m_Print.SetFontFace(17, 1, "宋体");
  12760. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12761. StrRect.top -= 0;
  12762. StrRect.bottom -= 10;
  12763. StrRect.left -= 140;
  12764. StrRect.right = StrRect.left + 48;
  12765. m_Print.SetFontFace(15, 1, "宋体");
  12766. m_Print.SetColor(0xffffff);
  12767. m_Print.DrawRect(StrRect, 0);
  12768. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12769. StrRect.left = StrRect.right;
  12770. StrRect.right = StrRect.left + 48;
  12771. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12772. m_Print.SetColor(0, RGB(255, 0, 0));
  12773. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12774. m_Print.SetColor(0);
  12775. m_Print.SetFontFace(12, 1, "宋体");
  12776. StrRect.left -= 48;
  12777. int hei = StrRect.Height();
  12778. StrRect.top = StrRect.bottom + 2;
  12779. StrRect.bottom += hei + 2;
  12780. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12781. StrRect.top = StrRect.bottom - 2;
  12782. StrRect.bottom += hei - 5;
  12783. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12784. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12785. m_Print.SetFontFace(12, 1, "宋体");
  12786. m_Print.DrawText((LPTSTR)(LPCTSTR)"加做取件单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12787. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12788. m_Print.SetFontFace(11, 1, "宋体");
  12789. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + m_id), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12790. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12791. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12792. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12793. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12794. m_Print.DrawRect2(StrRect, 2);
  12795. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12796. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12797. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12798. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12799. m_Print.DrawRect2(StrRect, 2);
  12800. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12801. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12802. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12803. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time4, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12804. m_Print.DrawRect2(StrRect, 2);
  12805. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12806. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12807. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12808. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12809. m_Print.DrawRect2(StrRect, 2);
  12810. ////////////
  12811. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12812. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12813. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12814. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12815. m_Print.DrawRect2(StrRect, 2);
  12816. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12817. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12818. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12819. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12820. m_Print.DrawRect2(StrRect, 2);
  12821. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12822. m_Print.DrawText((LPTSTR)(LPCTSTR)"赠送张数:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12823. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12824. m_Print.DrawText((LPTSTR)(LPCTSTR)m_photocount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12825. m_Print.DrawRect2(StrRect, 2);
  12826. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12827. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12828. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12829. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12830. m_Print.DrawRect2(StrRect, 2);
  12831. ////////////
  12832. ///////////spno
  12833. CRect sprc[22];
  12834. StrRect = load.m_rcarray.ElementAt(19);
  12835. StrRect.left += 4; StrRect.right -= 3;
  12836. hei = StrRect.Height();
  12837. for (i = 0; i < 22; i++)
  12838. {
  12839. sprc[i] = StrRect;
  12840. m_Print.DrawRect2(StrRect, 1);
  12841. if (i == 0)
  12842. {
  12843. StrRect.left += 5;
  12844. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12845. StrRect.left -= 5;
  12846. }
  12847. StrRect.top = StrRect.bottom;
  12848. StrRect.bottom = StrRect.top + hei;
  12849. sprc[i].left += 4; sprc[i].right -= 3;
  12850. }
  12851. StrRect.bottom = StrRect.top + 60;
  12852. m_Print.DrawRect2(StrRect, 1);
  12853. StrRect.left += 3; StrRect.top += 3;
  12854. StrRect.right -= 3; StrRect.bottom -= 3;
  12855. AutoDraw(m_Print, StrRect, m_bz, 1.8);
  12856. CString temp, tempspno, tempbz;
  12857. CSize size;
  12858. BOOL bRun = 0;
  12859. int fontsize = 12;
  12860. ll: tempspno = spno;
  12861. m_Print.SetFontFace(fontsize, 1, "宋体");
  12862. for (i = 1; i<22; i++)
  12863. {
  12864. if (!tempspno.IsEmpty())
  12865. {
  12866. temp = tempspno;
  12867. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12868. int right = 0;
  12869. CRect temprc = sprc[i];
  12870. while (size.cx>temprc.Width())
  12871. {
  12872. right++;
  12873. temp = tempspno.Left(tempspno.GetLength() - (right));
  12874. if (GIsHalfHZ(temp))
  12875. {
  12876. right++;
  12877. temp.Delete(temp.GetLength() - 1);
  12878. }
  12879. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12880. }
  12881. if (bRun)
  12882. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12883. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  12884. if (tempspno.IsEmpty())i++;
  12885. }
  12886. }
  12887. if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
  12888. {
  12889. fontsize--;
  12890. goto ll;
  12891. }
  12892. if (bRun == 0)
  12893. {
  12894. bRun = 1;
  12895. goto ll;
  12896. }
  12897. m_Print.SetFontFace(12, 1, "宋体");
  12898. StrRect = load2.m_rcarray.ElementAt(1);
  12899. m_Print.DrawText((LPTSTR)(LPCTSTR)"喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12900. StrRect = load2.m_rcarray.ElementAt(2);
  12901. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12902. StrRect = load2.m_rcarray.ElementAt(3);
  12903. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12904. StrRect = load2.m_rcarray.ElementAt(4);
  12905. m_Print.DrawRect2(StrRect, 2);
  12906. StrRect = load2.m_rcarray.ElementAt(0);
  12907. CString str = "\
  12908. 爱心提示:如对制作有任何要求请清楚列出,所有制作内容一经确认将按要求制作。\r\n\
  12909. 选样文件从拍摄日期计算将保留二个月;套相成品按取件日期保留三个月,逾期不做保留。\r\n\
  12910. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12911. AutoDraw(m_Print, StrRect, str, 1.8);
  12912. PrintPreview dlg; dlg.m_mode = 2;
  12913. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12914. dlg.m_pDC = m_Print.GetPDC();
  12915. if (dlg.DoModal() != IDOK)return;
  12916. //结束打印
  12917. m_Print.EndPage();
  12918. m_Print.EndPrint();
  12919. }
  12920. //分店
  12921. CString CMainFrame::GetDanWei(CString name, CArray<CStringArray, CStringArray>*array)
  12922. {
  12923. for (int i = 0; i < array->GetSize(); i++)
  12924. {
  12925. if (name == array->ElementAt(i).ElementAt(1))
  12926. return array->ElementAt(i).ElementAt(2);
  12927. }
  12928. return "";
  12929. }
  12930. //g_sendhead
  12931. int CMainFrame::GetPort()
  12932. {
  12933. static int aaa = -1;
  12934. if (aaa == -1)
  12935. {
  12936. aaa = CTime::GetCurrentTime().GetSecond() % 7;
  12937. }
  12938. aaa++;
  12939. if (aaa >= 7)aaa = 0;
  12940. return 8387 + aaa;
  12941. }
  12942. void CMainFrame::OnShowBakState()
  12943. {
  12944. // TODO: Add your command handler code here
  12945. g_sendhead.bsql = 0;
  12946. g_sendhead.code[0] = 171;
  12947. g_sendhead.tabcount = 1;
  12948. g_pMainWnd->ProcessChatMessageRequest2(1);
  12949. if (g_bSendOK == 0)
  12950. {
  12951. return;
  12952. }
  12953. CArray<CStringArray, CStringArray>g_bakstatearray;
  12954. DataToArray(&g_bakstatearray);
  12955. while (g_bakstatearray.GetSize() > 7)
  12956. {
  12957. g_bakstatearray.RemoveAt(0);
  12958. }
  12959. int photocount = 0;
  12960. int infocount = 0;
  12961. for (int i = 0; i < g_bakstatearray.GetSize(); i++)
  12962. {
  12963. if (g_bakstatearray.ElementAt(i).ElementAt(1) != "1")photocount++;
  12964. if (g_bakstatearray.ElementAt(i).ElementAt(2) != "1")infocount++;
  12965. }
  12966. ShowBakState dlg;
  12967. dlg.m_pArray = &g_bakstatearray;
  12968. dlg.DoModal();
  12969. }
  12970. void CMainFrame::PrintReceipt2(CStringArray *pArray)
  12971. {
  12972. int printcot = 1;
  12973. for (int aa = 0; aa < printcot; aa++)
  12974. {
  12975. g_sendhead.bsql = 0;
  12976. g_sendhead.code[0] = 24;
  12977. g_sendhead.tabcount = 1;
  12978. int g_nYearposTemp = g_nYearpos;
  12979. g_nYearpos = -1;
  12980. g_pMainWnd->ProcessChatMessageRequest2(1);
  12981. g_nYearpos = g_nYearposTemp;
  12982. if (0 == g_bSendOK)return;
  12983. DataToArray(&g_cominfoarray);
  12984. CString SerialNo;
  12985. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
  12986. CPrintRX m_Print;
  12987. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12988. {
  12989. m_Print.InitToPrint(NULL, 1);
  12990. }
  12991. else
  12992. {
  12993. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  12994. if (name.IsEmpty())
  12995. m_Print.InitToPrint(NULL, 1);
  12996. else
  12997. {
  12998. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12999. if (nret == -1 && aa == 0)
  13000. {
  13001. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13002. }
  13003. }
  13004. }
  13005. m_Print.StartPrint();
  13006. m_Print.StartPage();
  13007. LoadRect load;
  13008. BOOL bSmall = 0;
  13009. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  13010. {
  13011. bSmall = 1;
  13012. load.SetLiaPath("20.lia");
  13013. }
  13014. else
  13015. load.SetLiaPath("10.lia");
  13016. if (bSmall)
  13017. load.SetMargins(-10, 0);
  13018. else
  13019. load.SetMargins(10, 0);
  13020. if (!load.Load())return;
  13021. int rcpos = -1;
  13022. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13023. Image *pImg = NULL;
  13024. #ifdef MNLS_VERSION
  13025. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  13026. #else
  13027. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  13028. #endif
  13029. // m_Print.DrawImage(pImg, StrRect);
  13030. delete pImg;
  13031. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  13032. {
  13033. Image *pImg = NULL;
  13034. g_nSendCode = 31;
  13035. int g_nYearposTemp = g_nYearpos;
  13036. g_nYearpos = -1;
  13037. g_pMainWnd->ProcessChatMessageRequest2(1);
  13038. g_nYearpos = g_nYearposTemp;
  13039. g_nSendCode = 0;
  13040. if (g_bSendOK == 0)return;
  13041. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  13042. if (pImg)
  13043. {
  13044. StrRect.left = 65;
  13045. if (bSmall)StrRect.left = 55;
  13046. StrRect.top = 10;
  13047. StrRect.right = StrRect.left + 58;
  13048. StrRect.bottom = StrRect.top + 58;
  13049. m_Print.DrawImage(pImg, StrRect);
  13050. delete pImg; pImg = NULL;
  13051. }
  13052. }
  13053. if (bSmall)
  13054. {
  13055. m_Print.SetFontFace(18, 1, "黑体");
  13056. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13057. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13058. m_Print.SetFontFace(9, 1, "宋体");
  13059. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13060. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13061. m_Print.SetFontFace(6, 1, "宋体");
  13062. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13063. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13064. m_Print.SetFontFace(9, 1, "宋体");
  13065. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13066. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13067. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13068. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13069. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13070. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13071. int hei = StrRect.Height();
  13072. StrRect.bottom = StrRect.top;
  13073. StrRect.top -= 8;
  13074. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  13075. m_Print.SetFontFace(10, 1, "宋体");
  13076. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13077. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13078. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13079. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13080. m_Print.SetFontFace(9, 1, "宋体");
  13081. for (int i = 7; i < 24; i++)
  13082. {
  13083. StrRect = load.m_rcarray.ElementAt(i);
  13084. m_Print.DrawRect2(StrRect, 1);
  13085. }
  13086. for (i = 9; i < 24; i++)
  13087. {
  13088. StrRect = load.m_rcarray.ElementAt(i);
  13089. StrRect.left += 2;
  13090. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13091. }
  13092. m_Print.SetFontFace(6, 1, "宋体");
  13093. for (i = 24; i < 26; i++)
  13094. {
  13095. StrRect = load.m_rcarray.ElementAt(i);
  13096. StrRect.left += 2;
  13097. if (i == 24)
  13098. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13099. else
  13100. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13101. }
  13102. }
  13103. else//大单
  13104. {
  13105. m_Print.SetFontFace(20, 1, "黑体");
  13106. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13107. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13108. m_Print.SetFontFace(11, 1, "宋体");
  13109. // StrRect=load.m_rcarray .ElementAt (++rcpos);
  13110. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13111. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15;
  13112. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13113. int hei = StrRect.Height();
  13114. StrRect.bottom = StrRect.top;
  13115. StrRect.top -= 10;
  13116. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  13117. m_Print.SetFontFace(8, 1, "宋体");
  13118. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13119. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13120. m_Print.SetFontFace(11, 1, "宋体");
  13121. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13122. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13123. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13124. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13125. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13126. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13127. m_Print.SetFontFace(13, 1, "宋体");
  13128. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13129. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13130. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13131. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13132. m_Print.SetFontFace(11, 1, "宋体");
  13133. for (int i = 7; i < 24; i++)
  13134. {
  13135. StrRect = load.m_rcarray.ElementAt(i);
  13136. m_Print.DrawRect2(StrRect, 1);
  13137. }
  13138. for (i = 9; i < 24; i++)
  13139. {
  13140. StrRect = load.m_rcarray.ElementAt(i);
  13141. StrRect.left += 2;
  13142. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13143. }
  13144. m_Print.SetFontFace(8, 1, "宋体");
  13145. for (i = 24; i < 27; i++)
  13146. {
  13147. StrRect = load.m_rcarray.ElementAt(i);
  13148. StrRect.left += 2;
  13149. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13150. }
  13151. }
  13152. PrintPreview dlg;
  13153. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13154. dlg.m_pDC = m_Print.GetPDC();
  13155. if (aa == 0)
  13156. {
  13157. if (dlg.DoModal() != IDOK)
  13158. return;
  13159. printcot = dlg.m_num;
  13160. }
  13161. //结束打印
  13162. m_Print.EndPage();
  13163. m_Print.EndPrint();
  13164. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
  13165. CString sql;
  13166. sql.Format("update version set [serialno2]='%s'", SerialNo);
  13167. g_sendhead.bsql = 1;
  13168. g_nYearposTemp = g_nYearpos;
  13169. g_nYearpos = -1;
  13170. g_pMainWnd->ProcessChatMessageRequest2(sql);
  13171. g_nYearpos = g_nYearposTemp;
  13172. }
  13173. }
  13174. //出生年月
  13175. //第一联
  13176. void CMainFrame::OnLog()
  13177. {
  13178. // TODO: Add your command handler code here OnShowBakState
  13179. if (IsHasRightsnew(49) == 0)return;
  13180. ShowLOg dlg;
  13181. dlg.DoModal();
  13182. }
  13183. // www.lyfz.net 8888
  13184. void CMainFrame::PrintDinDan6(CString m_id)
  13185. {
  13186. // TODO: Add your control notification handler code here 预约订单
  13187. int printcot = 1;
  13188. for (int aa = 0; aa < printcot; aa++)
  13189. {
  13190. PrintPreview dlg;
  13191. CPrintRX m_Print;
  13192. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13193. {
  13194. m_Print.InitToPrint(NULL, 1);
  13195. }
  13196. else
  13197. {
  13198. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  13199. if (name.IsEmpty())
  13200. m_Print.InitToPrint(NULL, 1);
  13201. else
  13202. {
  13203. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13204. if (nret == -1 && aa == 0)
  13205. {
  13206. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13207. }
  13208. }
  13209. }
  13210. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
  13211. {
  13212. m_Print.StartPrint();
  13213. m_Print.StartPage();
  13214. LoadRect load;
  13215. load.SetLiaPath("6.lia");
  13216. load.SetMargins(-14, 15);
  13217. if (!load.Load())return;
  13218. LoadRect load2;
  13219. load2.SetLiaPath("7.lia");
  13220. load2.SetMargins(-14, 216 + 15);
  13221. if (!load2.Load())return;
  13222. LoadRect load3;
  13223. load3.SetLiaPath("8.lia");
  13224. load3.SetMargins(-14, 705 + 15);
  13225. if (!load3.Load())return;
  13226. int i;
  13227. //////////////////////////////////////////////////////////////
  13228. CStringArray txarray;
  13229. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  13230. g_sendhead.code[0] = 11;
  13231. g_sendhead.code[1] = 52;
  13232. g_sendhead.code[2] = 50;
  13233. g_sendhead.code[3] = 150;
  13234. g_sendhead.code[4] = 77;
  13235. g_sendhead.code[5] = 4;
  13236. g_sendhead.tabcount = 6;
  13237. g_sendhead.bsql = 0;
  13238. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  13239. CArray<CStringArray, CStringArray>sparray;
  13240. CArray<CStringArray, CStringArray>clientarray;
  13241. CArray<CStringArray, CStringArray>phonearray;
  13242. CArray<CStringArray, CStringArray>fgarray;
  13243. CArray<CStringArray, CStringArray>danweiarray;
  13244. CArray<CStringArray, CStringArray>jdarray;
  13245. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  13246. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  13247. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  13248. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  13249. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  13250. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  13251. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  13252. CString m_taoxiname;
  13253. if (m_zs.Find("\\") != -1)
  13254. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
  13255. else
  13256. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
  13257. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  13258. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  13259. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  13260. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  13261. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  13262. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  13263. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  13264. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  13265. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  13266. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  13267. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  13268. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  13269. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  13270. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  13271. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  13272. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  13273. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  13274. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  13275. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  13276. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  13277. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  13278. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  13279. if (jdarray.GetSize())
  13280. {
  13281. if (m_bz.IsEmpty() == 0)
  13282. m_bz = "\r\n" + m_bz;
  13283. m_bz += "景点:";
  13284. }
  13285. for (i = 0; i < jdarray.GetSize(); i++)
  13286. {
  13287. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  13288. }
  13289. m_bz.TrimRight(";");
  13290. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  13291. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  13292. if (IsHasRights2new(31) == 0)
  13293. {
  13294. m_phone1 = "***";
  13295. m_phone2 = "***";
  13296. }
  13297. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  13298. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  13299. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  13300. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  13301. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  13302. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  13303. filter = "name='" + m_ren + "'";
  13304. g_sendhead.code[0] = 5;
  13305. g_sendhead.tabcount = 1;
  13306. g_sendhead.bsql = 0;
  13307. int g_nYearposTemp = g_nYearpos;
  13308. g_nYearpos = -1;
  13309. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13310. g_nYearpos = g_nYearposTemp;
  13311. if (g_bSendOK == 0)return;
  13312. DataToArray(&phonearray);
  13313. m_money1.Format("%f", atof(m_taoxijiage));
  13314. m_money2.Format("%f", atof(m_payed1));
  13315. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  13316. ConvertToPrice(m_money1);
  13317. ConvertToPrice(m_money2);
  13318. ConvertToPrice(m_money3);
  13319. ////////////////////////////////////////////////////////////////
  13320. int rcpos = -1;
  13321. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13322. StrRect.top -= 15; StrRect.bottom -= 15;
  13323. Image *pImg = NULL;
  13324. #ifdef MNLS_VERSION
  13325. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  13326. #else
  13327. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  13328. #endif
  13329. m_Print.DrawImage(pImg, StrRect);
  13330. delete pImg;
  13331. m_Print.SetFontFace(11, 1, "宋体");
  13332. StrRect = load.m_rcarray.ElementAt(20);
  13333. StrRect.right = load.m_rcarray.ElementAt(23).right;
  13334. StrRect.top -= 18; StrRect.bottom -= 18;
  13335. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  13336. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13337. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  13338. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13339. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13340. StrRect.top -= 15; StrRect.bottom -= 15;
  13341. #ifdef MNLS_VERSION
  13342. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13343. #endif
  13344. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13345. StrRect.top -= 15; StrRect.bottom -= 15;
  13346. #ifdef MNLS_VERSION
  13347. m_Print.DrawRect(StrRect);
  13348. #endif
  13349. m_Print.SetFontFace(7, 1, "黑体");
  13350. m_Print.SetColor(0xffffff);
  13351. #ifdef MNLS_VERSION
  13352. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13353. #endif
  13354. m_Print.SetColor(0);
  13355. m_Print.SetFontFace(15, 1, "宋体");
  13356. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13357. StrRect.top -= 15; StrRect.bottom -= 15;
  13358. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同拍摄单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13359. CStringArray strarray;
  13360. strarray.Add("NO: " + m_id);
  13361. CString date;
  13362. date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  13363. strarray.Add(date);
  13364. strarray.Add("喜爱");
  13365. strarray.Add("格调");
  13366. if (fgarray.GetSize() == 12)
  13367. {
  13368. for (int i = 0; i < 12; i++)
  13369. strarray.Add(fgarray.ElementAt(i).ElementAt(0));
  13370. }
  13371. else
  13372. {
  13373. strarray.Add("复古典雅");
  13374. strarray.Add("温文尔雅");
  13375. strarray.Add("豪华艳丽");
  13376. strarray.Add("传统大方");
  13377. strarray.Add("新潮个性");
  13378. strarray.Add("浪漫奔放");
  13379. strarray.Add("简单素雅");
  13380. strarray.Add("活泼俏丽");
  13381. strarray.Add("妩媚温馨");
  13382. strarray.Add("温柔贤惠");
  13383. strarray.Add("成熟感性");
  13384. strarray.Add("清纯可爱");
  13385. }
  13386. strarray.Add("姓名");
  13387. // strarray.Add("职业");
  13388. strarray.Add("");
  13389. strarray.Add("地址");
  13390. strarray.Add("电话");
  13391. #ifdef CHILD_VERSION
  13392. strarray.Add("家长");
  13393. strarray.Add("宝宝");
  13394. #else
  13395. strarray.Add("先生");
  13396. strarray.Add("女士");
  13397. #endif
  13398. m_Print.SetFontFace(11, 1, "宋体");
  13399. for (i = 0; i < strarray.GetSize(); i++)
  13400. {
  13401. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13402. if (i < 2)
  13403. {
  13404. StrRect.top -= 15; StrRect.bottom -= 15;
  13405. }
  13406. if (i>15)
  13407. m_Print.DrawRect2(StrRect, 1);
  13408. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13409. }
  13410. for (i = 29; i <= 40; i++)
  13411. {
  13412. if (m_style.GetLength() <= (i - 29))continue;
  13413. if (m_style.GetAt(i - 29) != '1')continue;
  13414. StrRect = load.m_rcarray.ElementAt(i - 1);
  13415. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13416. }
  13417. for (i = 27; i <= 48; i++)
  13418. {
  13419. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13420. m_Print.DrawRect2(StrRect, 1);
  13421. }
  13422. #ifdef CHILD_VERSION
  13423. StrRect = load.m_rcarray.ElementAt(45);
  13424. StrRect.right = StrRect.left + 62;
  13425. m_Print.DrawRect2(StrRect, 1);
  13426. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13427. StrRect.left = StrRect.right;
  13428. StrRect.right = StrRect.left + 62;
  13429. m_Print.DrawRect2(StrRect, 1);
  13430. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13431. StrRect.left = StrRect.right;
  13432. StrRect.right = StrRect.left + 62;
  13433. m_Print.DrawRect2(StrRect, 1);
  13434. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13435. StrRect.left = StrRect.right;
  13436. StrRect.right = StrRect.left + 62;
  13437. m_Print.DrawRect2(StrRect, 1);
  13438. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13439. #endif
  13440. /////////////////////////
  13441. strarray.RemoveAll();
  13442. CString temp;
  13443. temp.Format("拍摄多款选 %d 款,其中影", atoi(m_outside) + atoi(m_outside2));
  13444. strarray.Add(temp);
  13445. temp.Format("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  13446. strarray.Add(temp);
  13447. strarray.Add("化妆");
  13448. strarray.Add("造型");
  13449. #ifdef CHILD_VERSION
  13450. strarray.Add("");
  13451. #else
  13452. strarray.Add("婚纱");
  13453. #endif
  13454. strarray.Add("服饰");
  13455. strarray.Add("配");
  13456. strarray.Add("置");
  13457. strarray.Add("其");
  13458. strarray.Add("它");
  13459. strarray.Add("套系名称");
  13460. strarray.Add("镜款");
  13461. strarray.Add("套系总价");
  13462. strarray.Add("主摄影师");
  13463. strarray.Add("拍摄日期");
  13464. strarray.Add("定金");
  13465. #ifdef CHILD_VERSION
  13466. strarray.Add("主引导师");
  13467. #else
  13468. strarray.Add("主化妆师");
  13469. #endif
  13470. strarray.Add("看样日期");
  13471. strarray.Add("补 余 款");
  13472. strarray.Add("总监");
  13473. strarray.Add("取件日期");
  13474. rcpos = -1;
  13475. for (i = 0; i < strarray.GetSize(); i++)
  13476. {
  13477. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  13478. if (i>9)
  13479. m_Print.DrawRect2(StrRect, 1);
  13480. #ifdef CHILD_VERSION
  13481. if (i == 5)
  13482. StrRect.top -= StrRect.Height();
  13483. #endif
  13484. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13485. }
  13486. for (i = 22; i <= 41; i++)
  13487. {
  13488. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  13489. m_Print.DrawRect2(StrRect, 1);
  13490. }
  13491. /////////////////////////////
  13492. strarray.RemoveAll();
  13493. #ifdef CHILD_VERSION
  13494. strarray.Add("顾客方 家长:");
  13495. strarray.Add("宝宝:");
  13496. #else
  13497. strarray.Add("顾客方 先生:");
  13498. strarray.Add("女士:");
  13499. #endif
  13500. strarray.Add("电话:");
  13501. strarray.Add("影楼方 店长:");
  13502. strarray.Add("接单人:");
  13503. strarray.Add("电话:");
  13504. rcpos = -1;
  13505. for (i = 0; i < strarray.GetSize(); i++)
  13506. {
  13507. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  13508. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13509. }
  13510. for (i = 7; i <= 12; i++)
  13511. {
  13512. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  13513. // if(i!=10)
  13514. m_Print.DrawRect2(StrRect, 2);
  13515. }
  13516. //////////////////////////////////////
  13517. //开始打数据
  13518. strarray.RemoveAll();
  13519. strarray.Add(m_name1);
  13520. strarray.Add(m_name2);
  13521. strarray.Add("");
  13522. strarray.Add("");
  13523. strarray.Add(m_addr1);
  13524. #ifdef CHILD_VERSION
  13525. strarray.Add("");
  13526. #else
  13527. strarray.Add(m_addr2);
  13528. #endif
  13529. strarray.Add(m_phone1);
  13530. strarray.Add(m_phone2);
  13531. for (i = 41; i <= 48; i++)
  13532. {
  13533. StrRect = load.m_rcarray.ElementAt(i - 1);
  13534. StrRect.left += 4;
  13535. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13536. }
  13537. ///////////////////////////////
  13538. strarray.RemoveAll();
  13539. strarray.Add(m_money1);
  13540. strarray.Add(m_waiter1);
  13541. strarray.Add(m_time2);
  13542. strarray.Add(m_money2);
  13543. strarray.Add(m_waiter2);
  13544. strarray.Add(m_time4);
  13545. strarray.Add(m_money3);
  13546. strarray.Add("");
  13547. strarray.Add(m_time5);
  13548. for (i = 32; i <= 40; i++)
  13549. {
  13550. StrRect = load2.m_rcarray.ElementAt(i - 1);
  13551. StrRect.left += 4;
  13552. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13553. }
  13554. ///////////////////////////////
  13555. strarray.RemoveAll();
  13556. strarray.Add("");//m_name1);
  13557. strarray.Add("");//m_name2);
  13558. CString phone;
  13559. if (m_phone1.IsEmpty() == 0)
  13560. phone = m_phone1 + ",";
  13561. phone += m_phone2;
  13562. phone.TrimRight(",");
  13563. strarray.Add("");//phone);
  13564. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
  13565. strarray.Add(m_ren);
  13566. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13567. for (i = 7; i <= 12; i++)
  13568. {
  13569. StrRect = load3.m_rcarray.ElementAt(i - 1);
  13570. StrRect.left += 4;
  13571. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13572. }
  13573. StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
  13574. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13575. StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
  13576. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13577. StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
  13578. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13579. //////////////////////////////
  13580. //开始画文字
  13581. StrRect = load2.m_rcarray.ElementAt(30);
  13582. StrRect.left += 3;
  13583. StrRect.top += 3;
  13584. StrRect.right -= 2;
  13585. StrRect.bottom -= 2;
  13586. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  13587. StrRect = load2.m_rcarray.ElementAt(29);
  13588. StrRect.left += 3;
  13589. StrRect.top += 3;
  13590. StrRect.right -= 2;
  13591. StrRect.bottom -= 2;
  13592. str = "";
  13593. for (i = 0; i < sparray.GetSize(); i++)
  13594. {
  13595. str += sparray.ElementAt(i).ElementAt(5);
  13596. str += " 数量:";
  13597. str += sparray.ElementAt(i).ElementAt(3);
  13598. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  13599. str += "\r\n";
  13600. }
  13601. str.TrimRight("\r\n");
  13602. AutoDraw(m_Print, StrRect, str, 1.4);
  13603. StrRect = load2.m_rcarray.ElementAt(40);
  13604. StrRect.top += 8;
  13605. m_Print.SetFontFace(12, 1, "黑体");
  13606. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  13607. StrRect.left += 3;
  13608. StrRect.top += 30;
  13609. StrRect.right -= 2;
  13610. StrRect.bottom -= 2;
  13611. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  13612. if (str.IsEmpty())
  13613. {
  13614. str = "\
  13615. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  13616. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  13617. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  13618. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  13619. 持良好的心境.\r\n\
  13620. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  13621. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  13622. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  13623. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  13624. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  13625. 勿进影室, 以免影响拍摄.\r\n\
  13626. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  13627. 师或店长沟通.\r\n\
  13628. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  13629. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  13630. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  13631. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  13632. 9. 本合同余额欠款须在拍照前付清.\r\n\
  13633. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  13634. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  13635. 还.";
  13636. }
  13637. AutoDraw(m_Print, StrRect, str, 1.8);
  13638. }
  13639. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13640. dlg.m_pDC = m_Print.GetPDC();
  13641. dlg.m_mode = 1;
  13642. if (aa == 0)
  13643. {
  13644. if (dlg.DoModal() != IDOK)
  13645. return;
  13646. printcot = dlg.m_num;
  13647. }
  13648. //结束打印
  13649. m_Print.EndPage();
  13650. m_Print.EndPrint();
  13651. }
  13652. }
  13653. void CMainFrame::InsideMsg()
  13654. {
  13655. ///内部消息
  13656. CString str;
  13657. g_sendhead.bsql = 0;
  13658. g_sendhead.code[0] = 126;
  13659. g_sendhead.tabcount = 1;
  13660. g_bNoConnDlg = 1;
  13661. g_pMainWnd->ProcessChatMessageRequest2(1); g_bNoConnDlg = 0;
  13662. if (g_bSendOK == 0)return;
  13663. CArray<CStringArray, CStringArray>m_List1array;
  13664. DataToArray(&g_List1array);//, &m_List1array);
  13665. m_List1array.SetSize(g_List1array.GetSize());
  13666. for (int i = 0; i < g_List1array.GetSize(); i++)
  13667. {
  13668. m_List1array.ElementAt(i).Copy(g_List1array.ElementAt(i));
  13669. }
  13670. str = "," + g_user.name + ",";
  13671. for (i = g_List1array.GetSize() - 1; i >= 0; i--)
  13672. {
  13673. CString receivers2 = g_List1array.ElementAt(i).ElementAt(4);
  13674. receivers2.TrimLeft(",");
  13675. receivers2.TrimRight(",");
  13676. receivers2 = "," + receivers2 + ",";
  13677. CString receivers = g_List1array.ElementAt(i).ElementAt(3);
  13678. receivers.TrimLeft(",");
  13679. receivers.TrimRight(",");
  13680. receivers = "," + receivers + ",";
  13681. if (receivers.Find(str) == -1)
  13682. g_List1array.RemoveAt(i);
  13683. else if (receivers2.Find(str) != -1)
  13684. g_List1array.RemoveAt(i);
  13685. }
  13686. if (g_List1array.GetSize())
  13687. {
  13688. ShowMsg dlg;
  13689. dlg.DoModal();
  13690. }
  13691. for (i = m_List1array.GetSize() - 1; i >= 0; i--)
  13692. {
  13693. CString receivers2 = m_List1array.ElementAt(i).ElementAt(4);
  13694. receivers2.TrimLeft(",");
  13695. receivers2.TrimRight(",");
  13696. receivers2 = "," + receivers2 + ",";
  13697. CString receivers = m_List1array.ElementAt(i).ElementAt(3);
  13698. if (receivers != "")
  13699. m_List1array.RemoveAt(i);
  13700. else if (receivers2.Find(str) != -1)
  13701. m_List1array.RemoveAt(i);
  13702. }
  13703. if (m_List1array.GetSize())
  13704. {
  13705. SendInsideMsg2 dlg;
  13706. dlg.m_bShow = 1;
  13707. dlg.m_pArray = &m_List1array;
  13708. dlg.DoModal();
  13709. }
  13710. }
  13711. //定金
  13712. /************************************************************************/
  13713. /*
  13714. 函数:PrintHireDress
  13715. 描述:打印礼服出租单;
  13716. 参数:
  13717. strOrderNumber 礼服订单号;
  13718. 注意:
  13719. */
  13720. /************************************************************************/
  13721. void CMainFrame::PrintHireDress(CString strOrderNumber) // 打印礼服出租单;
  13722. {
  13723. int printcot = 1;
  13724. for (int aa = 0; aa < printcot; aa++)
  13725. {
  13726. CPrintRX m_Print;
  13727. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13728. {
  13729. m_Print.InitToPrint(NULL, 1);
  13730. }
  13731. else
  13732. {
  13733. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13734. if (name.IsEmpty())
  13735. m_Print.InitToPrint(NULL, 1);
  13736. else
  13737. {
  13738. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13739. if (nret == -1 && aa == 0)
  13740. {
  13741. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13742. }
  13743. }
  13744. }
  13745. m_Print.StartPrint();
  13746. m_Print.StartPage();
  13747. LoadRect load;
  13748. load.SetLiaPath("21.lia");
  13749. load.SetMargins(0, 0);
  13750. if (!load.Load())
  13751. {
  13752. return;
  13753. }
  13754. int i;
  13755. //////////////////////////////////////////////////////////////
  13756. //CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  13757. CString strFilter;
  13758. strFilter.Format("id='%s';id='%s';id='%s'", strOrderNumber, strOrderNumber, strOrderNumber);
  13759. g_sendhead.bsql = 0;
  13760. g_sendhead.code[0] = 73;
  13761. g_sendhead.code[1] = 74;
  13762. g_sendhead.code[2] = 52;
  13763. g_sendhead.tabcount = 3;
  13764. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  13765. if (g_bSendOK == 0)
  13766. {
  13767. return;
  13768. }
  13769. CArray<CStringArray, CStringArray>dresshirearray;
  13770. CArray<CStringArray, CStringArray>dresshiredataarray;
  13771. CArray<CStringArray, CStringArray>clientarray;
  13772. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13773. if (dresshirearray.GetSize() == 0)
  13774. {
  13775. return;
  13776. }
  13777. CString m_remark = dresshirearray.ElementAt(0).ElementAt(10);
  13778. CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7);
  13779. CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8);
  13780. CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6);
  13781. if (clientarray.GetSize() == 0)
  13782. {
  13783. return;
  13784. }
  13785. //AfxMessageBox("打印礼服出租单-()");
  13786. CString m_name2 = clientarray.ElementAt(0).ElementAt(2);
  13787. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  13788. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  13789. CString m_time3 = clientarray.ElementAt(0).ElementAt(20);
  13790. //#if JEFF_TEST
  13791. // if ( dresshiredataarray.GetSize() == 0 )
  13792. // {
  13793. // AfxMessageBox("没衣服");
  13794. // }
  13795. //#endif
  13796. CString sItem;
  13797. for (i = 0; i < dresshiredataarray.GetSize(); i++)
  13798. {
  13799. sItem += "编号:";
  13800. sItem += dresshiredataarray.ElementAt(i).ElementAt(1);
  13801. sItem += " ";
  13802. sItem += " 名称:";
  13803. sItem += dresshiredataarray.ElementAt(i).ElementAt(2);
  13804. sItem += " 数量:";
  13805. sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n";
  13806. }
  13807. sItem += "金额:";
  13808. sItem += dresshirearray.ElementAt(0).ElementAt(1);
  13809. sItem += " ";
  13810. sItem += " 押金:";
  13811. sItem += dresshirearray.ElementAt(0).ElementAt(2) + "\r\n";
  13812. ////////////////////////////////////////////////////////////////
  13813. int rcpos = -1;
  13814. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13815. m_Print.SetFontFace(17, 1, "宋体");
  13816. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13817. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13818. m_Print.SetFontFace(10, 1, "宋体");
  13819. m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13820. CStringArray strarray;
  13821. strarray.Add("客户姓名");
  13822. strarray.Add("客户电话");
  13823. strarray.Add("预定日期");
  13824. strarray.Add("结婚日期");
  13825. strarray.Add("取件日期");
  13826. strarray.Add("归还日期");
  13827. strarray.Add("本店地址");
  13828. strarray.Add("电 话");
  13829. strarray.Add("客户地址");
  13830. strarray.Add("客户签名");
  13831. for (i = 2; i < 12; i++)
  13832. {
  13833. StrRect = load.m_rcarray.ElementAt(i);
  13834. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13835. }
  13836. strarray.RemoveAll();
  13837. strarray.Add(m_name2);
  13838. strarray.Add(m_phone2);
  13839. strarray.Add(m_inputdate);
  13840. strarray.Add(m_time3);
  13841. strarray.Add(m_date1);
  13842. strarray.Add(m_date2);
  13843. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
  13844. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13845. strarray.Add(m_addr2);
  13846. strarray.Add("");
  13847. for (i = 12; i < 22; i++)
  13848. {
  13849. StrRect = load.m_rcarray.ElementAt(i);
  13850. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13851. m_Print.DrawRect2(StrRect, 2);
  13852. }
  13853. for (i = 25; i < 30; i++)
  13854. {
  13855. StrRect = load.m_rcarray.ElementAt(i);
  13856. m_Print.DrawRect2(StrRect, 1);
  13857. }
  13858. StrRect = load.m_rcarray.ElementAt(22);
  13859. StrRect.top += 7;
  13860. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13861. StrRect = load.m_rcarray.ElementAt(23);
  13862. StrRect.top += 7;
  13863. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13864. StrRect = load.m_rcarray.ElementAt(24);
  13865. StrRect.top += 7;
  13866. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13867. StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
  13868. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13869. StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
  13870. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13871. StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
  13872. CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
  13873. if (str.IsEmpty())
  13874. {
  13875. str = "\
  13876. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13877. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13878. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13879. 4. 如有破损酌情赔偿.";
  13880. }
  13881. AutoDraw(m_Print, StrRect, str, 1.5);
  13882. PrintPreview dlg;
  13883. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13884. dlg.m_pDC = m_Print.GetPDC();
  13885. if (aa == 0)
  13886. {
  13887. if (dlg.DoModal() != IDOK)
  13888. return;
  13889. printcot = dlg.m_num;
  13890. }
  13891. //结束打印
  13892. m_Print.EndPage();
  13893. m_Print.EndPrint();
  13894. }
  13895. }
  13896. void CMainFrame::PrintHireDress_01(CString strOrderNumber) // 打印礼服出租单,无法改变结构,需要修改21.lia才能改变打印的布局;
  13897. {
  13898. int printcot = 1;
  13899. for (int aa = 0; aa < printcot; aa++)
  13900. {
  13901. CPrintRX m_Print;
  13902. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13903. {
  13904. m_Print.InitToPrint(NULL, 1);
  13905. }
  13906. else
  13907. {
  13908. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13909. if (name.IsEmpty())
  13910. m_Print.InitToPrint(NULL, 1);
  13911. else
  13912. {
  13913. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13914. if (nret == -1 && aa == 0)
  13915. {
  13916. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  13917. m_Print.InitToPrint(NULL, 1);
  13918. }
  13919. }
  13920. }
  13921. m_Print.StartPrint();
  13922. m_Print.StartPage();
  13923. LoadRect load;
  13924. load.SetLiaPath("21.lia");
  13925. load.SetMargins(0, 0);
  13926. if (!load.Load())return;
  13927. int i;
  13928. //////////////////////////////////////////////////////////////
  13929. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  13930. g_sendhead.bsql = 0;
  13931. g_sendhead.code[0] = 73; // dresshire表;
  13932. g_sendhead.code[1] = 74; // dresshiredata表;
  13933. g_sendhead.code[2] = 52; // client表;
  13934. g_sendhead.tabcount = 3;
  13935. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13936. if (g_bSendOK == 0)
  13937. {
  13938. return;
  13939. }
  13940. CArray<CStringArray, CStringArray>dresshirearray;
  13941. CArray<CStringArray, CStringArray>dresshiredataarray;
  13942. CArray<CStringArray, CStringArray>clientarray;
  13943. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13944. if (dresshirearray.GetSize() == 0)return;
  13945. // dresshire;
  13946. CString m_remark = dresshirearray.ElementAt(0).ElementAt(10); // 备注;
  13947. CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7); // 取衣日期;
  13948. CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8); // 还衣日期;
  13949. CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6); // 记录日期;
  13950. CString strPrice = dresshirearray.ElementAt(0).ElementAt(1); // 金额;
  13951. CString strDeposit = dresshirearray.ElementAt(0).ElementAt(2); // 押金;
  13952. // client表;
  13953. if (clientarray.GetSize() == 0)return;
  13954. CString m_name2 = clientarray.ElementAt(0).ElementAt(2); // 女宾姓名;
  13955. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4); // 女宾手机;
  13956. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8); // 女宾地址;
  13957. CString m_time3 = clientarray.ElementAt(0).ElementAt(20); // 婚期;
  13958. // dresshiredata表;
  13959. CString sItem;
  13960. for (i = 0; i < dresshiredataarray.GetSize(); i++)
  13961. {
  13962. sItem += dresshiredataarray.ElementAt(i).ElementAt(1); // 礼服编号;
  13963. sItem += " ";
  13964. sItem += dresshiredataarray.ElementAt(i).ElementAt(2); // 礼服名称;
  13965. sItem += " 数量:";
  13966. sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n"; // 礼服数量;
  13967. }
  13968. sItem += " 金额:";
  13969. sItem += dresshirearray.ElementAt(0).ElementAt(1); // 出租金额;
  13970. sItem += " 押金:";
  13971. sItem += dresshirearray.ElementAt(0).ElementAt(2) + "\r\n"; // 押金;
  13972. ////////////////////////////////////////////////////////////////
  13973. int rcpos = -1;
  13974. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13975. m_Print.SetFontFace(17, 1, "宋体");
  13976. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13977. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13978. m_Print.SetFontFace(10, 1, "宋体");
  13979. m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13980. CStringArray strarray;
  13981. strarray.Add("客户姓名"); // 1.
  13982. strarray.Add("客户电话");
  13983. strarray.Add("预定日期");
  13984. strarray.Add("结婚日期");
  13985. strarray.Add("取件日期"); // 5.
  13986. strarray.Add("归还日期");
  13987. strarray.Add("本店地址");
  13988. strarray.Add("电 话");
  13989. strarray.Add("客户地址");
  13990. strarray.Add("客户签名"); // 10.
  13991. //strarray.Add("金额");
  13992. //strarray.Add("押金");
  13993. for( i=2; i<12; i++)
  13994. //for (i = 2; i < 14; i++)
  13995. {
  13996. StrRect = load.m_rcarray.ElementAt(i);
  13997. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13998. }
  13999. strarray.RemoveAll();
  14000. strarray.Add(m_name2);
  14001. strarray.Add(m_phone2);
  14002. strarray.Add(m_inputdate);
  14003. strarray.Add(m_time3);
  14004. strarray.Add(m_date1);
  14005. strarray.Add(m_date2);
  14006. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
  14007. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  14008. strarray.Add(m_addr2);
  14009. strarray.Add("");
  14010. strarray.Add(strPrice); // 金额;
  14011. strarray.Add(strDeposit); // 押金;
  14012. for( i=12; i<22; i++)
  14013. //for (i = 14; i < 24; i++)
  14014. {
  14015. StrRect = load.m_rcarray.ElementAt(i);
  14016. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14017. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 14), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14018. m_Print.DrawRect2(StrRect, 2);
  14019. }
  14020. for (i = 25; i < 30; i++)
  14021. {
  14022. StrRect = load.m_rcarray.ElementAt(i);
  14023. m_Print.DrawRect2(StrRect, 1);
  14024. }
  14025. StrRect = load.m_rcarray.ElementAt(22);
  14026. StrRect.top += 7;
  14027. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14028. StrRect = load.m_rcarray.ElementAt(23);
  14029. StrRect.top += 7;
  14030. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14031. StrRect = load.m_rcarray.ElementAt(24);
  14032. StrRect.top += 7;
  14033. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14034. StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
  14035. AutoDraw(m_Print, StrRect, sItem, 1.5);
  14036. StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
  14037. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  14038. StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
  14039. CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
  14040. if (str.IsEmpty())
  14041. {
  14042. str = "\
  14043. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  14044. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  14045. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  14046. 4. 如有破损酌情赔偿.";
  14047. }
  14048. AutoDraw(m_Print, StrRect, str, 1.5);
  14049. PrintPreview dlg;
  14050. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14051. dlg.m_pDC = m_Print.GetPDC();
  14052. if (aa == 0)
  14053. {
  14054. if (dlg.DoModal() != IDOK)
  14055. return;
  14056. printcot = dlg.m_num;
  14057. }
  14058. //结束打印
  14059. m_Print.EndPage();
  14060. m_Print.EndPrint();
  14061. }
  14062. }
  14063. // ****************************************************************************
  14064. // Jeff:
  14065. // 函数:PrintHireDress2
  14066. // 无参;
  14067. // 调用者:DinDanFrom.cpp
  14068. // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
  14069. // 当订单数大于1000,设置连接公司服务器开关量为真;
  14070. // -----------------------------------------------------------------------------
  14071. // 修改:Jeff
  14072. // 时间:2014.10.18
  14073. // 内容:将 g_ncot 比较值改为100;
  14074. // ****************************************************************************
  14075. void CMainFrame::PrintHireDress2()
  14076. {
  14077. if (g_ncot > 100) g_bSendLYFZ = 1;
  14078. // g_pMainWnd->SetTimer (7, 3000, NULL);
  14079. }
  14080. void CMainFrame::PrintTakeForm2(CArray<CStringArray, CStringArray>*Listarray)
  14081. {
  14082. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "选片客人明细表";
  14083. int pages = Listarray->GetSize() / 46;
  14084. if (Listarray->GetSize() % 46)pages++;
  14085. for (int aa = 0; aa < pages; aa++)
  14086. {
  14087. PrintPreview dlg;
  14088. CPrintRX m_Print;
  14089. m_Print.InitToPrint(NULL, 1);
  14090. m_Print.StartPrint();
  14091. m_Print.StartPage();
  14092. CRect mainrc(0, 0, 560, 793);
  14093. float fscale;
  14094. {
  14095. int w, h;
  14096. m_Print.GetWidHei(w, h);
  14097. fscale = (float)w / (float)h;
  14098. }
  14099. mainrc.DeflateRect(25, 40, 10, 0);
  14100. CRect rc, rc2;
  14101. rc = mainrc;
  14102. rc.bottom = rc.top;
  14103. rc.top -= 20;
  14104. m_Print.SetFontFace(16, 1, "黑体");
  14105. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14106. m_Print.SetFontFace(9, 1, "宋体");
  14107. CString str;
  14108. int wid[5] = { 200, 110, 70, 85, 62 };
  14109. int hei = 16;
  14110. if (fscale > 0.71)hei = 15;
  14111. rc = mainrc;
  14112. rc.bottom = rc.top + hei;
  14113. for (int i = 0; i < 47; i++)
  14114. {
  14115. rc2.top = rc.top + i*hei;
  14116. rc2.bottom = rc.bottom + i*hei;
  14117. rc2.left = rc.left;
  14118. rc2.right = rc.left + wid[0];
  14119. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14120. for (int j = 0; j<5; j++)
  14121. {
  14122. m_Print.DrawRect2(rc2, 1);
  14123. if (Listarray->GetSize()>aa * 46 + i)
  14124. {
  14125. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14126. rc2.left += 3;
  14127. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14128. rc2.left -= 3;
  14129. }
  14130. rc2.left += wid[j];
  14131. rc2.right = rc2.left + wid[j + 1];
  14132. }
  14133. }
  14134. rc2.top += 2;
  14135. rc2.left += 2; rc2.right = mainrc.right + 4;
  14136. m_Print.SetFontFace(8, 1, "宋体");
  14137. str.Format(" 页:%d/%d", aa + 1, pages);
  14138. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14139. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14140. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14141. dlg.m_pDC = m_Print.GetPDC();
  14142. // dlg.m_mode=1;
  14143. if (aa == 0)
  14144. {
  14145. if (dlg.DoModal() != IDOK)
  14146. return;
  14147. }
  14148. //结束打印
  14149. m_Print.EndPage();
  14150. m_Print.EndPrint();
  14151. }
  14152. }
  14153. void CMainFrame::PrintTakeForm3(CArray<CStringArray, CStringArray>*Listarray)
  14154. {
  14155. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "看设计客人明细表";
  14156. int pages = Listarray->GetSize() / 46;
  14157. if (Listarray->GetSize() % 46)pages++;
  14158. for (int aa = 0; aa < pages; aa++)
  14159. {
  14160. PrintPreview dlg;
  14161. CPrintRX m_Print;
  14162. m_Print.InitToPrint(NULL, 1);
  14163. m_Print.StartPrint();
  14164. m_Print.StartPage();
  14165. CRect mainrc(0, 0, 560, 793);
  14166. float fscale;
  14167. {
  14168. int w, h;
  14169. m_Print.GetWidHei(w, h);
  14170. fscale = (float)w / (float)h;
  14171. }
  14172. mainrc.DeflateRect(25, 40, 10, 0);
  14173. CRect rc, rc2;
  14174. rc = mainrc;
  14175. rc.bottom = rc.top;
  14176. rc.top -= 20;
  14177. m_Print.SetFontFace(16, 1, "黑体");
  14178. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14179. m_Print.SetFontFace(9, 1, "宋体");
  14180. CString str;
  14181. int wid[5] = { 200, 110, 70, 85, 62 };
  14182. int hei = 16;
  14183. if (fscale > 0.71)hei = 15;
  14184. rc = mainrc;
  14185. rc.bottom = rc.top + hei;
  14186. for (int i = 0; i < 47; i++)
  14187. {
  14188. rc2.top = rc.top + i*hei;
  14189. rc2.bottom = rc.bottom + i*hei;
  14190. rc2.left = rc.left;
  14191. rc2.right = rc.left + wid[0];
  14192. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14193. for (int j = 0; j<5; j++)
  14194. {
  14195. m_Print.DrawRect2(rc2, 1);
  14196. if (Listarray->GetSize()>aa * 46 + i)
  14197. {
  14198. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14199. rc2.left += 3;
  14200. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14201. rc2.left -= 3;
  14202. }
  14203. rc2.left += wid[j];
  14204. rc2.right = rc2.left + wid[j + 1];
  14205. }
  14206. }
  14207. rc2.top += 2;
  14208. rc2.left += 2; rc2.right = mainrc.right + 4;
  14209. m_Print.SetFontFace(8, 1, "宋体");
  14210. str.Format(" 页:%d/%d", aa + 1, pages);
  14211. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14212. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14213. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14214. dlg.m_pDC = m_Print.GetPDC();
  14215. // dlg.m_mode=1;
  14216. if (aa == 0)
  14217. {
  14218. if (dlg.DoModal() != IDOK)
  14219. return;
  14220. }
  14221. //结束打印
  14222. m_Print.EndPage();
  14223. m_Print.EndPrint();
  14224. }
  14225. }
  14226. void CMainFrame::PrintTakeForm4(CArray<CStringArray, CStringArray>*Listarray)
  14227. {
  14228. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "取件客人明细表";
  14229. int pages = Listarray->GetSize() / 46;
  14230. if (Listarray->GetSize() % 46)pages++;
  14231. for (int aa = 0; aa < pages; aa++)
  14232. {
  14233. PrintPreview dlg;
  14234. CPrintRX m_Print;
  14235. m_Print.InitToPrint(NULL, 1);
  14236. m_Print.StartPrint();
  14237. m_Print.StartPage();
  14238. CRect mainrc(0, 0, 560, 793);
  14239. float fscale;
  14240. {
  14241. int w, h;
  14242. m_Print.GetWidHei(w, h);
  14243. fscale = (float)w / (float)h;
  14244. }
  14245. mainrc.DeflateRect(25, 40, 10, 0);
  14246. CRect rc, rc2;
  14247. rc = mainrc;
  14248. rc.bottom = rc.top;
  14249. rc.top -= 20;
  14250. m_Print.SetFontFace(16, 1, "黑体");
  14251. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14252. m_Print.SetFontFace(9, 1, "宋体");
  14253. CString str;
  14254. int wid[5] = { 200, 110, 70, 85, 62 };
  14255. int hei = 16;
  14256. if (fscale > 0.71)hei = 15;
  14257. rc = mainrc;
  14258. rc.bottom = rc.top + hei;
  14259. for (int i = 0; i < 47; i++)
  14260. {
  14261. rc2.top = rc.top + i*hei;
  14262. rc2.bottom = rc.bottom + i*hei;
  14263. rc2.left = rc.left;
  14264. rc2.right = rc.left + wid[0];
  14265. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14266. for (int j = 0; j<5; j++)
  14267. {
  14268. m_Print.DrawRect2(rc2, 1);
  14269. if (Listarray->GetSize()>aa * 46 + i)
  14270. {
  14271. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14272. rc2.left += 3;
  14273. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14274. rc2.left -= 3;
  14275. }
  14276. rc2.left += wid[j];
  14277. rc2.right = rc2.left + wid[j + 1];
  14278. }
  14279. }
  14280. rc2.top += 2;
  14281. rc2.left += 2; rc2.right = mainrc.right + 4;
  14282. m_Print.SetFontFace(8, 1, "宋体");
  14283. str.Format(" 页:%d/%d", aa + 1, pages);
  14284. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14285. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14286. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14287. dlg.m_pDC = m_Print.GetPDC();
  14288. // dlg.m_mode=1;
  14289. if (aa == 0)
  14290. {
  14291. if (dlg.DoModal() != IDOK)
  14292. return;
  14293. }
  14294. //结束打印
  14295. m_Print.EndPage();
  14296. m_Print.EndPrint();
  14297. }
  14298. }
  14299. void CMainFrame::PrintTakeForm5(CArray<CStringArray, CStringArray>*Listarray)
  14300. {
  14301. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "婚庆客人明细表";
  14302. int pages = Listarray->GetSize() / 46;
  14303. if (Listarray->GetSize() % 46)pages++;
  14304. for (int aa = 0; aa < pages; aa++)
  14305. {
  14306. PrintPreview dlg;
  14307. CPrintRX m_Print;
  14308. m_Print.InitToPrint(NULL, 1);
  14309. m_Print.StartPrint();
  14310. m_Print.StartPage();
  14311. CRect mainrc(0, 0, 560, 793);
  14312. float fscale;
  14313. {
  14314. int w, h;
  14315. m_Print.GetWidHei(w, h);
  14316. fscale = (float)w / (float)h;
  14317. }
  14318. mainrc.DeflateRect(25, 40, 10, 0);
  14319. CRect rc, rc2;
  14320. rc = mainrc;
  14321. rc.bottom = rc.top;
  14322. rc.top -= 20;
  14323. m_Print.SetFontFace(16, 1, "黑体");
  14324. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14325. m_Print.SetFontFace(8, 1, "宋体");
  14326. CString str;
  14327. int wid[7] = { 165, 90, 90, 45, 45, 60, 35 };
  14328. int hei = 16;
  14329. if (fscale > 0.71)hei = 15;
  14330. rc = mainrc;
  14331. rc.bottom = rc.top + hei;
  14332. for (int i = 0; i < 47; i++)
  14333. {
  14334. rc2.top = rc.top + i*hei;
  14335. rc2.bottom = rc.bottom + i*hei;
  14336. rc2.left = rc.left;
  14337. rc2.right = rc.left + wid[0];
  14338. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14339. for (int j = 0; j<7; j++)
  14340. {
  14341. m_Print.DrawRect2(rc2, 1);
  14342. if (Listarray->GetSize()>aa * 46 + i)
  14343. {
  14344. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14345. rc2.left += 3;
  14346. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14347. rc2.left -= 3;
  14348. }
  14349. rc2.left += wid[j];
  14350. rc2.right = rc2.left + wid[j + 1];
  14351. }
  14352. }
  14353. rc2.top += 2;
  14354. rc2.left += 2; rc2.right = mainrc.right + 4;
  14355. m_Print.SetFontFace(8, 1, "宋体");
  14356. str.Format(" 页:%d/%d", aa + 1, pages);
  14357. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14358. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14359. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14360. dlg.m_pDC = m_Print.GetPDC();
  14361. // dlg.m_mode=1;
  14362. if (aa == 0)
  14363. {
  14364. if (dlg.DoModal() != IDOK)
  14365. return;
  14366. }
  14367. //结束打印
  14368. m_Print.EndPage();
  14369. m_Print.EndPrint();
  14370. }
  14371. }
  14372. void CMainFrame::PrintTakeForm1(CArray<CStringArray, CStringArray>*Listarray)
  14373. {
  14374. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "拍照客人明细表";
  14375. int pages = Listarray->GetSize() / 46;
  14376. if (Listarray->GetSize() % 46)pages++;
  14377. for (int aa = 0; aa < pages; aa++)
  14378. {
  14379. PrintPreview dlg;
  14380. CPrintRX m_Print;
  14381. m_Print.InitToPrint(NULL, 1);
  14382. m_Print.StartPrint();
  14383. m_Print.StartPage();
  14384. CRect mainrc(0, 0, 560, 793);
  14385. float fscale;
  14386. {
  14387. int w, h;
  14388. m_Print.GetWidHei(w, h);
  14389. fscale = (float)w / (float)h;
  14390. }
  14391. mainrc.DeflateRect(25, 40, 10, 0);
  14392. CRect rc, rc2;
  14393. rc = mainrc;
  14394. rc.bottom = rc.top;
  14395. rc.top -= 20;
  14396. m_Print.SetFontFace(16, 1, "黑体");
  14397. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14398. m_Print.SetFontFace(8, 1, "宋体");
  14399. CString str;
  14400. int wid[7] = { 165, 60, 90, 60, 60, 60, 35 };
  14401. int hei = 16;
  14402. if (fscale > 0.71)hei = 15;
  14403. rc = mainrc;
  14404. rc.bottom = rc.top + hei;
  14405. for (int i = 0; i < 47; i++)
  14406. {
  14407. rc2.top = rc.top + i*hei;
  14408. rc2.bottom = rc.bottom + i*hei;
  14409. rc2.left = rc.left;
  14410. rc2.right = rc.left + wid[0];
  14411. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14412. for (int j = 0; j<7; j++)
  14413. {
  14414. m_Print.DrawRect2(rc2, 1);
  14415. if (Listarray->GetSize()>aa * 46 + i)
  14416. {
  14417. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14418. rc2.left += 3;
  14419. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14420. rc2.left -= 3;
  14421. }
  14422. rc2.left += wid[j];
  14423. rc2.right = rc2.left + wid[j + 1];
  14424. }
  14425. }
  14426. rc2.top += 2;
  14427. rc2.left += 2; rc2.right = mainrc.right + 4;
  14428. m_Print.SetFontFace(8, 1, "宋体");
  14429. str.Format(" 页:%d/%d", aa + 1, pages);
  14430. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14431. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14432. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14433. dlg.m_pDC = m_Print.GetPDC();
  14434. // dlg.m_mode=1;
  14435. if (aa == 0)
  14436. {
  14437. if (dlg.DoModal() != IDOK)
  14438. return;
  14439. }
  14440. //结束打印
  14441. m_Print.EndPage();
  14442. m_Print.EndPrint();
  14443. }
  14444. }
  14445. void CMainFrame::ShowMonthForm2()
  14446. {
  14447. }
  14448. // dlg;