MainFrm.cpp 462 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773
  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. OutputDebugString("MouseProc\n");
  174. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134)) > 0)
  175. {
  176. g_pMainWnd->KillTimer(5);
  177. OutputDebugString("5\n");
  178. g_pMainWnd->SetTimer(5, atoi(g_cominfoarray.ElementAt(0).ElementAt(134)) * 60 * 1000, NULL);
  179. }
  180. else
  181. OutputDebugString("-5\n");
  182. if (g_bSendLYFZ)
  183. {
  184. g_pMainWnd->KillTimer(7);
  185. OutputDebugString("7\n");
  186. g_pMainWnd->SetTimer(7, 5 * 60 * 1000, NULL);
  187. }
  188. else
  189. OutputDebugString("-7\n");
  190. }
  191. return CallNextHookEx(g_hmouse, nCode, wParam, lParam);
  192. }
  193. CRect g_rc; // 屏幕坐标值,区域是放置对话框。
  194. CMainFrame *g_pMainWnd = NULL;
  195. extern HWND g_hSendWnd;
  196. extern HWND g_hConnectWnd;
  197. //extern CString newGUID();
  198. /////////////////////////////////////////////////////////////////////////////
  199. // CMainFrame客人付款
  200. /////////////////////////////////////////////////////////////////////////////
  201. /////////////////////////////////////////////////////////////////////////////
  202. static void HandleClientNetEvent(IN SOCKET hSocket,
  203. IN ETransportEvent eEvent,
  204. IN void *pDataBuf,
  205. IN unsigned long nDataLen,
  206. IN int nError,
  207. IN void *pContext)
  208. {
  209. if (nError != TRANSPORT_OK)
  210. return;
  211. CMainFrame *pDlg = (CMainFrame *)pContext;
  212. if (NULL == pDlg)
  213. return;
  214. pDlg->ProcessNetEvent(eEvent, pDataBuf, nDataLen);
  215. }
  216. BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
  217. {
  218. CRect rtCtrl, rtWnd; // 子窗口,父窗口;
  219. if (hwnd)
  220. {
  221. ::GetWindowRect(hwnd, &rtCtrl); // 获取控件大小;
  222. ::GetWindowRect(GetParent(hwnd), &rtWnd); // 获取父窗口大小;
  223. // printf("Jeff:g_WidthScale=%d,g_HeightScale=%d,rtWnd.left=%d,rtWnd.top=%d\n\n",g_WidthScale,g_HeightScale,rtWnd.left,rtWnd.top);
  224. // 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);
  225. rtCtrl.OffsetRect(-rtWnd.left, -rtWnd.top);
  226. float temp;
  227. temp = (float)rtCtrl.left*g_WidthScale;
  228. rtCtrl.left = (int)temp + g_dx;
  229. temp = (float)rtCtrl.top*g_HeightScale;
  230. rtCtrl.top = (int)temp + g_dy;
  231. temp = (float)rtCtrl.right*g_WidthScale;
  232. rtCtrl.right = (int)temp + g_dx;
  233. temp = (float)rtCtrl.bottom*g_HeightScale;
  234. rtCtrl.bottom = (int)temp + g_dy;
  235. //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);
  236. ::MoveWindow(hwnd, rtCtrl.left, rtCtrl.top, rtCtrl.Width(), rtCtrl.Height(), TRUE);
  237. return TRUE;
  238. }
  239. else
  240. {
  241. return FALSE;
  242. }
  243. }
  244. IMPLEMENT_DYNCREATE(CMainFrame, CMDIFrameWnd)
  245. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  246. //{{AFX_MSG_MAP(CMainFrame)
  247. ON_WM_CREATE()
  248. ON_WM_DESTROY()
  249. ON_WM_CLOSE()
  250. ON_WM_TIMER()
  251. ON_COMMAND(IDM_choosephotoskin, Onchoosephotoskin)
  252. ON_COMMAND(IDM_PATH, OnPath)
  253. ON_COMMAND(IDM_SERVER, OnServer)
  254. ON_COMMAND(IDM_SHOWHIS, OnShowhis)
  255. ON_COMMAND(IDM_StaffAchievementShow, OnStaffAchievementShow)
  256. ON_COMMAND(IDM_AUTODELPHOTO, OnAutodelphoto)
  257. ON_COMMAND(IDM_PHOTOMANAGE, Onphotomanage)
  258. ON_COMMAND(IDM_COMPANYINFO, OnCompanyinfo)
  259. ON_COMMAND(IDM_HELPFILE, OnHelpfile)
  260. ON_COMMAND(IDM_PHOTOBAK, OnPhotobak)
  261. ON_COMMAND(IDM_TAOXIFG, OnTaoxifg)
  262. ON_COMMAND(IDM_ShowBakState, OnShowBakState)
  263. ON_WM_NCLBUTTONDBLCLK()
  264. ON_WM_NCHITTEST()
  265. ON_COMMAND(IDM_LOG, OnLog)
  266. //}}AFX_MSG_MAP
  267. ON_COMMAND_RANGE(0, 50000, OnCommandMenu)
  268. END_MESSAGE_MAP()
  269. static UINT indicators[] =
  270. {
  271. ID_SEPARATOR, // status line indicator
  272. ID_INDICATOR_CAPS,
  273. ID_INDICATOR_NUM,
  274. ID_INDICATOR_SCRL,
  275. };
  276. /////////////////////////////////////////////////////////////////////////////
  277. // CMainFrame construction/destruction
  278. UINT CMainFrame::OnNcHitTest(CPoint point)
  279. {
  280. if (CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
  281. return HTCLIENT;
  282. return CWnd::OnNcHitTest(point);
  283. }
  284. void CMainFrame::OnNcLButtonDblClk(UINT nFlags, CPoint point)
  285. {
  286. if (nFlags != HTCAPTION)
  287. CMDIFrameWnd::OnNcLButtonDblClk(nFlags, point);
  288. }
  289. CMainFrame::CMainFrame()
  290. {
  291. // TODO: add member initialization code here
  292. SetConnectionID(INVALID_SOCKET);
  293. m_pMainFrimDlg2 = NULL;
  294. CString version = _T("Version 1.0");
  295. m_bCheckF2F3 = AfxGetApp()->GetProfileInt(version, "f2f3", 0);
  296. if (0 == ::PathFileExists(g_mainpath + "\\skin\\5.lia"))
  297. {
  298. g_bNoLoginLia = 1;
  299. }
  300. }
  301. CMainFrame::~CMainFrame()
  302. {
  303. if (m_pMainFrimDlg2)
  304. {
  305. m_pMainFrimDlg2->DestroyWindow();
  306. delete m_pMainFrimDlg2;
  307. }
  308. }
  309. // void LoadImageFromFile(Bitmap **img, CString path)
  310. // {
  311. // try
  312. // {
  313. // if (!PathFileExists(path))return;
  314. // if (*img)delete *img;
  315. // *img = NULL;
  316. // BSTR bstr = path.AllocSysString();
  317. // *img = Bitmap::FromFile(bstr);
  318. // SysFreeString(bstr);
  319. // }
  320. // catch (...)
  321. // {
  322. // }
  323. // }
  324. void InTheMe(HWND m_hWnd)
  325. {
  326. BOOL bXpVisualStyle = FALSE;
  327. OSVERSIONINFO osvi;
  328. osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  329. ::GetVersionEx(&osvi);
  330. if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvi.dwMajorVersion >= 5) && (osvi.dwMinorVersion >= 1))
  331. {
  332. HMODULE hUxTheme = ::LoadLibrary(_T("UxTheme.dll"));
  333. POPENTHEMEDATA pOpenThemeData;
  334. PCLOSETHEMEDATA pCloseThemeData;
  335. if (hUxTheme != NULL)
  336. {
  337. pOpenThemeData = (POPENTHEMEDATA)::GetProcAddress(hUxTheme, "OpenThemeData");
  338. pCloseThemeData = (PCLOSETHEMEDATA)::GetProcAddress(hUxTheme, "CloseThemeData");
  339. HTHEME hButtonTheme = (*pOpenThemeData)(m_hWnd, L"BUTTON");
  340. if (hButtonTheme != NULL)
  341. bXpVisualStyle = TRUE;
  342. (*pCloseThemeData)(hButtonTheme);
  343. }
  344. ::FreeLibrary(hUxTheme);
  345. }
  346. if (bXpVisualStyle)
  347. AfxMessageBox(_T("正在使用视觉主题 "));
  348. else
  349. AfxMessageBox(_T("没有使用视觉主题 "));
  350. }
  351. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  352. {
  353. if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  354. {
  355. // Jeff.创建失败的可能性小,加日志输出;
  356. return -1;
  357. }
  358. if (g_server.Find(".ly.com") != -1)
  359. {
  360. g_ntimeout = 30000;
  361. }
  362. if (::PathFileExists(g_mainpath + "\\logo.ico"))
  363. {
  364. Bitmap *bmp = NULL;
  365. LoadImageFromFile(&bmp, g_mainpath + "\\logo.ico");
  366. // m_hIcon = AfxGetApp()->LoadIcon(g_mainpath+"\\logo.ico");
  367. bmp->GetHICON(&m_hIcon);
  368. delete bmp;
  369. SetIcon(m_hIcon, TRUE); // Set big icon
  370. SetIcon(m_hIcon, FALSE); // Set small icon
  371. }
  372. if (!m_wndClient.SubclassWindow(m_hWndMDIClient))
  373. {
  374. // Jeff.创建失败的可能性小,加日志输出;
  375. return -1;
  376. }
  377. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  378. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  379. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  380. {
  381. // Jeff.创建失败的可能性小,加日志输出;
  382. TRACE0("Failed to create toolbar\n");
  383. return -1; // fail to create
  384. }
  385. m_wndToolBar.LoadTrueColorToolBar(90, IDB_NORMAL, 0, IDB_DISABLE);
  386. // second toolbar must have different ID
  387. if (!m_wndToolBar2.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT | CBRS_NOALIGN,
  388. AFX_IDW_CONTROLBAR_FIRST + 32) ||
  389. !m_wndToolBar2.LoadToolBar(IDR_TOOLBAR1))
  390. {
  391. // Jeff.创建失败的可能性小,加日志输出;
  392. TRACE0("Failed to create toolbar\n");
  393. return -1; // fail to create
  394. }
  395. #ifndef NEW_SKIN
  396. if (!m_wndStatusBar.Create(this) ||
  397. !m_wndStatusBar.SetIndicators(indicators,
  398. sizeof(indicators)/sizeof(UINT)))
  399. {
  400. // Jeff.创建失败的可能性小,加日志输出;
  401. TRACE0("Failed to create status bar\n");
  402. return -1; // fail to create
  403. }
  404. m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_NORMAL,200);
  405. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  406. #endif
  407. // TODO: Delete these three lines if you don't want the toolbar to
  408. // be dockable
  409. NewMenu2();
  410. ::GetWindowRect(this->m_hWndMDIClient, g_rc);
  411. /* CString ss;
  412. ss.Format ("%d,%d,%d,%d", g_rc.left , g_rc.top , g_rc.right , g_rc.bottom );
  413. AfxMessageBox(ss);*/
  414. g_pMainWnd = this;
  415. m_wndToolBar2.Init();
  416. g_rc.top += 38;
  417. g_rc.left += 160;
  418. /* m_WidthScale = (float)g_rc.Width ()/722;
  419. m_HeightScale = (float)g_rc.Height ()/533;*/
  420. g_user.bLongin = 0;
  421. SetTimer(1, 100, NULL);
  422. return 0;
  423. }
  424. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  425. {
  426. if (!CMDIFrameWnd::PreCreateWindow(cs))
  427. return FALSE;
  428. // TODO: Modify the Window class or styles here by modifying
  429. // the CREATESTRUCT cs
  430. cs.style &= ~WS_MAXIMIZEBOX;
  431. cs.style &= ~WS_THICKFRAME;
  432. cs.lpszName = g_title + "影楼管理系统";
  433. cs.style &= ~FWS_ADDTOTITLE;
  434. RECT rect;
  435. HWND hWnd = ::FindWindow("Shell_TrayWnd", 0);
  436. ::GetWindowRect(hWnd, &rect);
  437. cs.x = 0;
  438. cs.y = 0;
  439. cs.cx = GetSystemMetrics(SM_CXSCREEN);
  440. cs.cy = GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top) + 3;
  441. return TRUE;
  442. }
  443. /////////////////////////////////////////////////////////////////////////////
  444. // CMainFrame diagnostics
  445. #ifdef _DEBUG
  446. void CMainFrame::AssertValid() const
  447. {
  448. CMDIFrameWnd::AssertValid();
  449. }
  450. void CMainFrame::Dump(CDumpContext& dc) const
  451. {
  452. CMDIFrameWnd::Dump(dc);
  453. }
  454. #endif //_DEBUG
  455. /////////////////////////////////////////////////////////////////////////////
  456. // CMainFrame message handlers
  457. void CMainFrame::OnDestroy()
  458. {
  459. //WriteLog("退出系统");//Jeff.add
  460. OnDisconnect();
  461. Transport_UnInit();
  462. m_Mdi.DeleteAll();
  463. if (g_hmouse)UnhookWindowsHookEx(g_hmouse);
  464. CMDIFrameWnd::OnDestroy();
  465. }
  466. void CMainFrame::OnClose()
  467. {
  468. g_bShowBar = 0;
  469. if (m_Mdi.MainClose())
  470. CMDIFrameWnd::OnClose();
  471. }//连接
  472. void CMainFrame::NewMenu2()
  473. {
  474. CMenu *pMemu = GetMenu();
  475. #ifdef BASIC_VERSION
  476. CMenu* submenu = pMemu->GetSubMenu(1);
  477. //submenu->RemoveMenu (IDM_StaffAchievementShow, MF_BYCOMMAND );//Jeff del 2014.06.16
  478. submenu->RemoveMenu (IDM_salaryset, MF_BYCOMMAND );
  479. #endif
  480. #if 0 // 此机用选片菜单项,去掉不用;
  481. {
  482. CString version = _T("Version 1.0");
  483. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  484. if(checked)
  485. {
  486. CMenu* submenu = pMemu->GetSubMenu(1);
  487. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  488. }
  489. }
  490. #endif
  491. #ifndef BASIC_VERSION
  492. {
  493. CString version = _T("Version 1.0");
  494. BOOL checked = AfxGetApp()->GetProfileInt(version, "status2", 0);
  495. if (checked)
  496. {
  497. #if 0 // Jeff:去掉菜单,此机用于员工业绩查看的菜单选项;
  498. CMenu* submenu = pMemu->GetSubMenu(1);
  499. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  500. #endif
  501. g_bStaffAchievementShow = 1;
  502. SetTimer(3, 100, NULL);
  503. }
  504. }
  505. #endif
  506. if (g_bShowOK == 0)
  507. {
  508. CMenu* submenu = pMemu->GetSubMenu(2);
  509. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  510. }
  511. }
  512. HMENU CMainFrame::NewMenu()
  513. {
  514. //设置菜单为XP风格 IDM_SHOWHIS
  515. BCMenu::SetMenuDrawMode(1);
  516. //若取消下面这句注释,则可看到菜单的图标栏和文字栏背景颜色为白色,
  517. //文字颜色为蓝色,选中项的前景色为紫红色
  518. //m_menuXP.SetMenuXPItemColor(0x00FFFFFF,0x00FFFFFF,0x00FF0000,0x00FF00FF);
  519. // 设置菜单中图标大小为32×32
  520. // m_menuXP.SetIconSize(32,32);
  521. // 加载菜单资源
  522. m_menuXP.LoadMenu(IDR_MAINFRAME);
  523. // 加载菜单对应的工具栏资源
  524. // m_menuXP.LoadToolbar(IDR_MAINFRAME);
  525. /*由于菜单左边栏中默认的图标大小为16×16,而与之对应的Toolbar中图标大小为32×32,
  526. 因此菜单中图标不能正确显示,只显示出工具栏中图标的左上角部分,所以修改菜单中各
  527. 项对应的图标为24b色位图资源IDB_***,或者在LoadMenu之前调用SetIconSize,设置菜单
  528. 中图标大小为32×32*/
  529. // m_menuXP.SetIconSize(24,24);
  530. // m_menuXP.ModifyODMenu(NULL,IDM_YWBU,IDB_YW); //
  531. /* m_menuXP.ModifyODMenu(NULL,ID_FILE_OPEN,IDB_BITMAP5);
  532. m_menuXP.ModifyODMenu(NULL,ID_FILE_SAVE,IDB_BITMAP7);
  533. m_menuXP.ModifyODMenu(NULL,ID_FILE_PRINT,IDB_BITMAP6);
  534. m_menuXP.ModifyODMenu(NULL,ID_APP_ABOUT,IDB_BITMAP3);
  535. m_menuXP.ModifyODMenu(NULL,ID_APP_EXIT,IDB_BITMAP2);*/
  536. // m_menuXP.EnableMenuItem (0, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  537. // m_menuXP.EnableMenuItem (2, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  538. // m_menuXP.EnableMenuItem (3, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  539. // m_menuXP.EnableMenuItem (4, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  540. // m_menuXP.EnableMenuItem (5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  541. // m_menuXP.EnableMenuItem (8, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  542. #if 0 // Jeff此机用选片菜单项不用;
  543. {
  544. CString version = _T("Version 1.0");
  545. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  546. if(checked)
  547. {
  548. CMenu* submenu = m_menuXP.GetSubMenu(1);
  549. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  550. }
  551. }
  552. #endif
  553. {
  554. CString version = _T("Version 1.0");
  555. BOOL checked = AfxGetApp()->GetProfileInt(version, "status2", 0);
  556. if (checked)
  557. {
  558. #if 0 // Jeff:去掉此机用于员工业绩查看的菜单选项;
  559. CMenu* submenu = m_menuXP.GetSubMenu(1);
  560. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  561. #endif
  562. g_bStaffAchievementShow = 1;
  563. SetTimer(3, 100, NULL);
  564. }
  565. }
  566. if (g_bShowOK == 0)
  567. {
  568. CMenu* submenu = m_menuXP.GetSubMenu(2);
  569. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  570. }
  571. return(m_menuXP.Detach());
  572. }
  573. ///////////////////////////////////////////////////////
  574. //减少代码
  575. #define OPEN_MENU(x) m_Mdi.Append(pName, RUNTIME_CLASS(x), IDR_MAINFRAME, this, nID)
  576. //响应菜单命令
  577. void CMainFrame::OnCommandMenu(UINT nID) // 所有菜单命令都在这里处理;
  578. {
  579. if (nID >= 2000 && nID <= 2100)
  580. {
  581. OnBranchData(nID);
  582. return;
  583. }
  584. if (g_user.bLongin == 0)
  585. {
  586. if (g_bNoLoginLia)
  587. {
  588. Login dlg;
  589. dlg.SetLiaPath("5.lia");
  590. dlg.DoModal();
  591. }
  592. else
  593. {
  594. Login3 dlg;
  595. dlg.SetLiaPath("5.lia");
  596. dlg.DoModal();
  597. }
  598. return;
  599. if (g_user.bLongin == 0)return;
  600. }
  601. else
  602. {
  603. InsideMsg();
  604. }
  605. ResetTimer();
  606. if (nID >= 1000 && nID <= 1100)
  607. {
  608. OnHistory(nID);
  609. return;
  610. }
  611. LPSTR pName;
  612. //打开窗口
  613. switch (nID)
  614. {
  615. case IDM_PayOutSet:
  616. {
  617. if (IsHasRights(16) == 0)return;
  618. PayOutSet dlg;
  619. dlg.DoModal();
  620. return;
  621. }
  622. case IDM_SPLB:
  623. {
  624. if (IsHasRightsnew(29) == 0)return;
  625. SPLBDlg dlg;
  626. dlg.DoModal();
  627. return;
  628. }
  629. case IDM_JD:
  630. {
  631. if (IsHasRightsnew(49) == 0)return;
  632. SPLBDlg dlg;
  633. dlg.m_mode = 1;
  634. dlg.DoModal();
  635. return;
  636. }
  637. case IDM_AREA:
  638. {
  639. if (IsHasRightsnew(47) == 0)return;
  640. AreaDlg dlg;
  641. dlg.DoModal();
  642. return;
  643. }
  644. case IDM_Psw:
  645. {
  646. Psw dlg;
  647. dlg.DoModal();
  648. return;
  649. }
  650. case IDM_Set:
  651. {
  652. if (IsHasRightsnew(49) == 0)return;
  653. /* if(g_bBranchModify)
  654. {
  655. AfxMessageBox("系统设置不支持远程访问,请直接访问该分店!", MB_ICONINFORMATION);
  656. return;
  657. }*/
  658. Set dlg;
  659. dlg.DoModal();
  660. //if(dlg.DoModal() != IDOK)
  661. //{
  662. //AfxMessageBox("789");
  663. //Set::SetCancle();
  664. //}
  665. return;
  666. }
  667. case IDM_HIDEWINDOW:
  668. {
  669. HideWindow dlg;
  670. dlg.DoModal();
  671. return;
  672. }
  673. case IDM_Logout:// Jeff.注销;
  674. {
  675. if(g_user.bLongin)
  676. WriteLog("退出系统");//Jeff.add;
  677. g_user.bLongin = 0;
  678. g_user.name.Empty();
  679. g_user.rights.Empty();
  680. g_user.account.Empty();
  681. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  682. g_pMainWnd2->RefreshOutlookBar();
  683. #ifndef NEW_SKIN
  684. m_wndStatusBar.SetPaneText(1, "未登录", TRUE);
  685. #endif
  686. m_Mdi.CloseAll();
  687. #ifdef ENTERPRISE_VERSION
  688. g_branchname.Empty();
  689. g_branchip.Empty();
  690. g_pMainWnd->OnDisconnect();
  691. g_bBranchModify = 0;
  692. #endif
  693. if (g_pMainWnd2)
  694. {
  695. g_pMainWnd2->DrawLogin();
  696. g_pMainWnd2->ShowBar(0);
  697. }
  698. g_hisyeararray.RemoveAll();
  699. g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
  700. g_brancharray.RemoveAll();
  701. g_pMainWnd->AddBranchMenu(&g_brancharray);
  702. if (g_bNoLoginLia)
  703. {
  704. Login dlg;
  705. dlg.SetLiaPath("5.lia");
  706. dlg.DoModal();
  707. }
  708. else
  709. {
  710. Login3 dlg;
  711. dlg.SetLiaPath("5.lia");
  712. dlg.DoModal();
  713. }
  714. if (g_user.bLongin == 0)
  715. if (g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  716. return;
  717. }
  718. case IDM_TODAY:
  719. pName = (LPSTR)(LPCSTR)"历史订单";
  720. // OPEN_MENU(SalarySet3);
  721. OPEN_MENU(DinDanHistroy);
  722. break;
  723. case IDM_TAKECONTROL:
  724. pName = (LPSTR)(LPCSTR)"摄控表";
  725. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))
  726. OPEN_MENU(TodayForm2);
  727. else
  728. OPEN_MENU(TodayForm);
  729. break;
  730. case IDM_CLIENTMONEY:
  731. pName = (LPSTR)(LPCSTR)"客人付款";
  732. OPEN_MENU(ClientMoney);
  733. break;
  734. case IDM_TAKEAWAYBOOK:
  735. pName = (LPSTR)(LPCSTR)"发片/取件";
  736. OPEN_MENU(outsourcing);
  737. break;
  738. case IDM_CODE:
  739. pName = (LPSTR)(LPCSTR)"商品报表";
  740. OPEN_MENU(SPForm);
  741. break;
  742. case IDM_Daily:
  743. // if(IsHasRightsnew(22)==0)return;
  744. // pName = (LPSTR)(LPCSTR)"日财务表";
  745. // OPEN_MENU(DailyForm);
  746. pName = (LPSTR)(LPCSTR)"沟通助手";
  747. OPEN_MENU(InsideMsg);
  748. break;
  749. case IDM_ProcessAlarm:
  750. pName = (LPSTR)(LPCSTR)"流程监控";
  751. OPEN_MENU(ProcessAlarm);
  752. break;
  753. case IDM_DINDAN:
  754. // if(IsHasRights(7)==0)return;
  755. pName = (LPSTR)(LPCSTR)"订单报表";
  756. OPEN_MENU(DinDanFrom);
  757. break;
  758. case IDM_CLIENT:
  759. //if(IsHasRights(8)==0)return;
  760. pName = (LPSTR)(LPCSTR)"客户报表";
  761. OPEN_MENU(CClientForm);
  762. break;
  763. case IDM_PayOutInput:
  764. if (IsHasRightsnew(20) == 0)return;
  765. pName = (LPSTR)(LPCSTR)"现金支出";
  766. OPEN_MENU(PayOutInput);
  767. break;
  768. case IDM_salaryset:
  769. if (IsHasRightsnew(25) == 0)return;
  770. pName = (LPSTR)(LPCSTR)"工资设置";
  771. OPEN_MENU(SalarySet);
  772. break;
  773. case IDM_mysalary:
  774. if (IsHasRights(16) == 0)return;
  775. pName = (LPSTR)(LPCSTR)"我的工资";
  776. OPEN_MENU(MySalary);
  777. break;
  778. case IDM_SP:
  779. // if(IsHasRightsnew(29)==0)return;
  780. pName = (LPSTR)(LPCSTR)"商品设置";
  781. OPEN_MENU(ShangPin);
  782. break;
  783. case IDM_WORKER:
  784. if (IsHasRightsnew(27) == 0)return;
  785. pName = (LPSTR)(LPCSTR)"员工设置";
  786. OPEN_MENU(Worker);
  787. break;
  788. case IDM_TAOXI:
  789. if (IsHasRightsnew(30) == 0)return;
  790. pName = (LPSTR)(LPCSTR)"套系设置";
  791. OPEN_MENU(TXDlg);
  792. break;
  793. case IDM_TAOXISP:
  794. if (IsHasRightsnew(30) == 0)return;
  795. pName = (LPSTR)(LPCSTR)"套系赠送商品设置";
  796. OPEN_MENU(TXSPDlg);
  797. break;
  798. case IDM_Provider:
  799. if (IsHasRightsnew(32) == 0)return;
  800. pName = (LPSTR)(LPCSTR)"供应商设置";
  801. OPEN_MENU(ProviderDlg);
  802. break;
  803. case IDM_BUMEN:
  804. {
  805. if (IsHasRightsnew(49) == 0)return;
  806. BuMenDlg dlg;
  807. dlg.DoModal();
  808. return;
  809. }
  810. case IDM_Account:
  811. if (IsHasRightsnew(49) == 0)return;
  812. pName = (LPSTR)(LPCSTR)"账号管理";
  813. OPEN_MENU(Account);
  814. break;
  815. case IDM_YLCD:
  816. {
  817. //AfxMessageBox("IDM_YLCD");
  818. ::CopyFile(_T(g_path7 + "\\接单系统\\Regsvr32.exe"), _T(g_mainpath + "\\Regsvr32.exe"), 0);
  819. ::CopyFile(_T(g_path7 + "\\接单系统\\Flash9f.ocx"), _T(g_mainpath + "\\Flash9f.ocx"), 0);
  820. CString temp;
  821. temp.Format("%s\\regsvr32.exe /s %s\\Flash9f.OCX", g_mainpath, g_mainpath);
  822. WinExec(temp, SW_HIDE);
  823. ::CopyFile(_T(g_path7 + "\\接单系统\\接单系统.exe"), _T(g_mainpath + "\\接单系统.exe"), 0);
  824. ::CopyFile(_T(g_path7 + "\\接单系统\\my32.dll"), _T(g_mainpath + "\\my32.dll"), 0);
  825. ::CopyFile(_T(g_path7 + "\\接单系统\\server.dat"), _T(g_mainpath + "\\server.dat"), 0);
  826. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\接单系统.exe"), g_server, NULL, SW_SHOWNORMAL);
  827. }
  828. break;
  829. case IDM_YLCDMANAGE:
  830. ::CopyFile(_T(g_path7 + "\\接单系统\\资源管理器.exe"), _T(g_mainpath + "\\资源管理器.exe"), 0);
  831. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\资源管理器.exe"), g_server, NULL, SW_SHOWNORMAL);
  832. break;
  833. }
  834. }
  835. //减少代码
  836. ///////////////////////////////////////////////////////////////////////////////
  837. void CMainFrame::OnDisconnect()
  838. {
  839. m_tClientTunnel.net_CloseSocket();
  840. SetConnectionID(INVALID_SOCKET);
  841. }
  842. void CMainFrame::ProcessLoginResponse(void *pLoginResult)
  843. {
  844. //printf("Jeff:ProcessLoginResponse\n\n");//Jeff Printf;
  845. if (NULL == pLoginResult) return;
  846. LOGIN_RESULT_STRU *ptLoginResult = (LOGIN_RESULT_STRU *)pLoginResult;
  847. DWORD dwConnectionID = ptLoginResult->tCommonMsg.dwConnectionID;
  848. SetConnectionID(dwConnectionID);
  849. BYTE byResult = ptLoginResult->byResult;
  850. if (LOGIN_RESULT_SUC == byResult)
  851. {
  852. //AfxMessageBox("登录成功"); // Jeff test;
  853. }
  854. else
  855. {
  856. OnDisconnect();
  857. }
  858. }
  859. //-------------------------------------------------------------------
  860. // Remark by Jeff: 2014.10.18
  861. // 函数:ProcessLoginRequest
  862. // 描述:登陆服务器;
  863. // 参数:
  864. // nSrvType:登陆服务器的协议类型;
  865. // 0000 0000: 表示登陆本地服务器;
  866. // 0000 0001: 表示登陆远程服务器(lijiafz.vicp.net等);
  867. //
  868. // 返回:登陆成功返回TRUE;
  869. //
  870. //-------------------------------------------------------------------
  871. BOOL CMainFrame::ProcessLoginRequest()
  872. {
  873. // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
  874. WORD wMessageId = 0;
  875. if (g_conntype == 0 && !g_bConnLYFZ)
  876. wMessageId = (MSG_LOGIN_REQ + 0X1FFF);
  877. else// if (g_bConnLYFZ )
  878. wMessageId = MSG_LOGIN_REQ;
  879. // 2.填充发送数据;
  880. TLOGIN_STRU tLogonInfo = { 0 };
  881. tLogonInfo.tCommonMsg.dwConnectionID = GetConnectionID();//此时m_dwConnectionID为INVALIDE_SOCKET;
  882. tLogonInfo.tCommonMsg.wMessageId = wMessageId;
  883. CString strUserName = newGUID();// 以随机数作为登陆时的用户名称;
  884. strUserName.TrimLeft();
  885. strUserName.TrimRight();
  886. strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
  887. DWORD dwDataLen = sizeof(TLOGIN_STRU);
  888. // 3.填充数据头;
  889. TMessageHeader tHeader = { 0 };
  890. tHeader.wMessageId = wMessageId;
  891. tHeader.dwDataLen = dwDataLen;
  892. // 4.发送数据;
  893. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)&tLogonInfo, dwDataLen);
  894. if (ulSendLen == SOCKET_ERROR)
  895. {
  896. return 0;
  897. }
  898. return 1;
  899. }
  900. DWORD CMainFrame::GetConnectionID()
  901. {
  902. return m_dwConnectionID;
  903. }
  904. void CMainFrame::SetConnectionID(DWORD dwConnection)
  905. {
  906. m_dwConnectionID = dwConnection;
  907. }
  908. //*********************************************//
  909. /*
  910. 函数:ProcessChatMessageRequest2
  911. 参数:BYTE code [IN]
  912. 返回:无
  913. 过程:OnConnect() -> ProcessChatMessageRequest()
  914. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  915. 2.SendDataDlg计时器里调用CConnectDlg对话框
  916. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  917. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  918. 5.关闭对话框和断开连接;
  919. */
  920. //*********************************************//
  921. void CMainFrame::ProcessChatMessageRequest2(BYTE code)
  922. {
  923. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  924. SendDataDlg dlg;
  925. dlg.m_bycode = code;
  926. dlg.DoModal();
  927. }
  928. //*********************************************//
  929. /*
  930. 函数:ProcessChatMessageRequest2
  931. 参数:CString sql [IN]
  932. 返回:无
  933. 过程:OnConnect() -> ProcessChatMessageRequest()
  934. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  935. 2.SendDataDlg计时器里调用CConnectDlg对话框
  936. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  937. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  938. 5.关闭对话框和断开连接;
  939. */
  940. //*********************************************//
  941. void CMainFrame::ProcessChatMessageRequest2(CString sql)
  942. {
  943. if ((sql.Find("insert") != -1 || sql.Find("update") != -1 || sql.Find("delete") != -1) && g_branchname != "" && g_bBranchModify == 0)
  944. {
  945. AfxMessageBox("当前为分店数据查看状态,不能更改分店数据!", MB_ICONSTOP);
  946. g_bSendOK = 0;
  947. return;
  948. }
  949. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  950. SendDataDlg dlg;
  951. dlg.m_strSQL = sql;
  952. dlg.DoModal();
  953. }
  954. //*********************************************//
  955. /*
  956. 函数:ProcessChatMessageRequest2
  957. 参数:BYTE *pData [IN], int length [IN]
  958. 返回:无
  959. 过程:OnConnect() -> ProcessChatMessageRequest()
  960. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  961. 2.SendDataDlg计时器里调用CConnectDlg对话框
  962. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  963. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  964. 5.关闭对话框和断开连接;
  965. */
  966. //*********************************************//
  967. void CMainFrame::ProcessChatMessageRequest2(BYTE *pData, int length)
  968. {
  969. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  970. SendDataDlg dlg;
  971. dlg.m_pData = pData;
  972. dlg.m_nlength = length;
  973. dlg.DoModal();
  974. }
  975. /************************************************************************/
  976. /*
  977. 函数:ProcessChatMessageRequest
  978. 描述:对服务发送数据;
  979. 参数:void *szDataBuf[IN], int nDataLen[IN]
  980. 返回:发送成功与否;
  981. */
  982. /************************************************************************/
  983. BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)
  984. {
  985. // 1.获取当前与服务器连接的id;
  986. DWORD dwFromUserID = GetConnectionID();
  987. // 2.设置通信类型为MSG_CHATMESSAGE_REQ;
  988. WORD wMessageId = 0;
  989. if (g_conntype == 0 && !g_bConnLYFZ)
  990. wMessageId = (MSG_CHATMESSAGE_REQ + 0X3FFF);
  991. else
  992. wMessageId = MSG_CHATMESSAGE_REQ;
  993. // 3.计算出欲发送的数据的长度 dwDataLen;
  994. DWORD dwDataLen = sizeof(TCHAT_MESSAGE_STRU) + nDataLen;
  995. BYTE *pSendData = new BYTE[dwDataLen];
  996. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU*)pSendData;
  997. memset(pChatMessage, 0x00, dwDataLen);
  998. // 3.1.g_nYearpos==-1,表示连接是当前主数据库,其他值表示历史数据库;
  999. if (g_nYearpos == -1)
  1000. g_sendhead.length[99] = g_nYearpos;
  1001. else
  1002. g_sendhead.length[99] = g_nYearpos * 32142953 + 10966236;
  1003. g_sendhead.length[98] = 987123768;
  1004. memcpy(pSendData, &g_sendhead, sizeof(g_sendhead));
  1005. #ifdef ENTERPRISE_VERSION
  1006. if (g_bBranchModify == 0)
  1007. strcpy(pChatMessage->szFromUserName, g_branchname);
  1008. #endif
  1009. // 4.填充发送的数据结构;
  1010. pChatMessage->tCommonMsg.dwConnectionID = GetConnectionID();
  1011. pChatMessage->tCommonMsg.wMessageId = wMessageId;
  1012. pChatMessage->dwFromUserID = dwFromUserID;
  1013. pChatMessage->dwToUserID = g_nSendCode;//▲▲g_nSendCode在服务端同为dwToUserID;
  1014. pChatMessage->wMessageLen = nDataLen;
  1015. memcpy(pChatMessage->byFileContent, szDataBuf, nDataLen);
  1016. // 5.填充数据头;
  1017. TMessageHeader tHeader = { 0 };
  1018. tHeader.wMessageId = wMessageId;
  1019. tHeader.dwDataLen = dwDataLen;
  1020. // 6.发送数据;
  1021. BOOL bRet = 0;
  1022. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)pChatMessage, dwDataLen);
  1023. if (ulSendLen != SOCKET_ERROR)
  1024. {
  1025. bRet = 1;
  1026. }
  1027. // 7.发送完毕,释放内存;
  1028. delete[] pSendData;
  1029. return bRet;
  1030. }
  1031. /************************************************************************/
  1032. /*
  1033. 函数:ProcessChatMessageResponse
  1034. 描述:接收服务返回的数据;
  1035. 参数:void *pResponse[IN]
  1036. 返回:无;
  1037. 调用关系:
  1038. 1.由 void CMainFrame::ProcessNetEvent(...)调用
  1039. */
  1040. /************************************************************************/
  1041. void CMainFrame::ProcessChatMessageResponse(void *pResponse)
  1042. {
  1043. //printf("Jeff:ProcessChatMessageResponse**************\n\n");//Jeff Printf;
  1044. // 1.数据空,直接返回;
  1045. if (NULL == pResponse)
  1046. return;
  1047. // 2.数据解析过程;
  1048. //printf("Jeff:ProcessChatMessageResponse**************\数据解析过程\n\n");//Jeff Printf;
  1049. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pResponse;
  1050. int nMessageLen = pChatMessage->wMessageLen;
  1051. int nMessageLen2 = pChatMessage->dwToUserID; // 在服务器中被处理了,一般使dwToUserID=wMessageLen;
  1052. // Jeff.dwFromUserID==8888表示的内容是更新客户端skin界面数据,只有两处dwToUserID==211和dwToUserID==21;
  1053. // Jeff.其余的大多数都是 dwFromUserID = wMessageLen = dwToUserID 三者相等;
  1054. if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID != 8888)
  1055. {
  1056. // 2.1.清除全局变量g_pData数据,用于保存接收的实际数据;
  1057. if (g_pData)
  1058. delete[]g_pData;
  1059. g_pData = NULL;
  1060. g_pData = new BYTE[nMessageLen];
  1061. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1062. memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
  1063. g_nLeng = nMessageLen;
  1064. if (nMessageLen <= sizeof(DWORD))
  1065. {
  1066. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1067. }
  1068. KillTimer(2);
  1069. if (g_hSendWnd)
  1070. {
  1071. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);//关闭发送对话框;
  1072. }
  1073. }
  1074. else if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID == 8888)
  1075. {
  1076. if (g_pData2)
  1077. delete[]g_pData2;
  1078. g_pData2 = NULL;
  1079. g_pData2 = new BYTE[nMessageLen2];
  1080. memcpy(g_pData2, pChatMessage->byFileContent, nMessageLen2);
  1081. g_nLeng2 = nMessageLen2;
  1082. KillTimer(2);
  1083. if (g_hSendWnd)
  1084. {
  1085. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1086. }
  1087. }
  1088. else // 登陆返回;
  1089. {
  1090. if (g_bConnLYFZ)
  1091. {
  1092. if (g_pData)
  1093. delete[]g_pData;
  1094. g_pData = NULL;
  1095. g_pData = new BYTE[nMessageLen];
  1096. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1097. memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
  1098. g_nLeng = nMessageLen;
  1099. if (nMessageLen <= sizeof(DWORD))
  1100. {
  1101. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1102. }
  1103. KillTimer(2);
  1104. if (g_hSendWnd)
  1105. {
  1106. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1107. }
  1108. return;
  1109. }
  1110. if (g_conntype) // Jeff.g_conntype == 1,表示连接公司服务器的返回,用于集团版解析*.ly.com的IP地址;
  1111. {
  1112. // KillTimer(2);
  1113. char *szChatMessage = new char[nMessageLen + 1];
  1114. memset(szChatMessage, 0x00, nMessageLen + 1);
  1115. memcpy(szChatMessage, pChatMessage->byFileContent, nMessageLen);
  1116. g_server = szChatMessage;
  1117. delete[]szChatMessage;
  1118. CStdioFile fp;
  1119. CString path = g_mainpath + "\\ip.txt";
  1120. ::DeleteFile(path); // 删除ip.txt;
  1121. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1122. fp.WriteString(g_server);
  1123. fp.Close();
  1124. g_conntype = 0;
  1125. // g_serverip=g_server;
  1126. return;
  1127. }
  1128. if (g_pData2 == NULL)
  1129. {
  1130. g_pData2 = new BYTE[nMessageLen2];
  1131. g_nLeng2 = 0;
  1132. }
  1133. memcpy(g_pData2 + g_nLeng2, pChatMessage->byFileContent, nMessageLen);
  1134. g_nLeng2 += nMessageLen;
  1135. if (g_nLeng2 == nMessageLen2)//已收完
  1136. {
  1137. KillTimer(2);
  1138. if (g_hSendWnd)
  1139. {
  1140. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1141. }
  1142. }
  1143. else
  1144. {
  1145. KillTimer(2);
  1146. SetTimer(2, g_ntimeout, NULL);
  1147. }
  1148. }
  1149. }
  1150. BOOL CMainFrame::OnConnectBranch()
  1151. {
  1152. if (g_branchip == "")
  1153. {
  1154. return 0;
  1155. }
  1156. g_conntype = 0;
  1157. CString strServerAddress = g_branchip;
  1158. char *szServerAddress = strServerAddress.GetBuffer(0);
  1159. strServerAddress.ReleaseBuffer();
  1160. /*for Client, IP and Port can be 0,
  1161. and for Server, IP is LocalIP, and Port is Listening Port*/
  1162. int nResult = m_tClientTunnel.net_OpenSocket(
  1163. Transport_Client,
  1164. 0,
  1165. HandleClientNetEvent,
  1166. this);
  1167. if (TRANSPORT_OK != nResult)
  1168. {
  1169. // AfxMessageBox("网络初始化失败!");
  1170. return 0;
  1171. }
  1172. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1173. WORD wPort = SERVER_PORT;
  1174. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1175. if (TRANSPORT_OK != nResult)
  1176. {
  1177. m_tClientTunnel.net_CloseSocket();
  1178. return OnConnectBranch2();
  1179. return 0;
  1180. }
  1181. return ProcessLoginRequest();
  1182. }
  1183. BOOL CMainFrame::OnConnectBranch2()
  1184. {
  1185. if (g_branchip2 == "")
  1186. {
  1187. return 0;
  1188. }
  1189. g_conntype = 0;
  1190. CString strServerAddress = g_branchip2;
  1191. char *szServerAddress = strServerAddress.GetBuffer(0);
  1192. strServerAddress.ReleaseBuffer();
  1193. /*for Client, IP and Port can be 0,
  1194. and for Server, IP is LocalIP, and Port is Listening Port*/
  1195. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1196. 0,
  1197. HandleClientNetEvent,
  1198. this);
  1199. if (TRANSPORT_OK != nResult)
  1200. {
  1201. // AfxMessageBox("网络初始化失败!");
  1202. return 0;
  1203. }
  1204. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1205. WORD wPort = SERVER_PORT;
  1206. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1207. if (TRANSPORT_OK != nResult)
  1208. {
  1209. m_tClientTunnel.net_CloseSocket();
  1210. return 0;
  1211. }
  1212. return ProcessLoginRequest();
  1213. }
  1214. BOOL CMainFrame::OnConnectIP()
  1215. {
  1216. CString strServerAddress = g_server;
  1217. char *szServerAddress = strServerAddress.GetBuffer(0);
  1218. strServerAddress.ReleaseBuffer();
  1219. /*for Client, IP and Port can be 0,
  1220. and for Server, IP is LocalIP, and Port is Listening Port*/
  1221. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1222. 0,
  1223. HandleClientNetEvent,
  1224. this);
  1225. if (TRANSPORT_OK != nResult)
  1226. {
  1227. // AfxMessageBox("网络初始化失败!");
  1228. return 0;
  1229. }
  1230. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1231. WORD wPort = SERVER_PORT;
  1232. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1233. if (TRANSPORT_OK != nResult)
  1234. {
  1235. m_tClientTunnel.net_CloseSocket();
  1236. return 0;
  1237. }
  1238. return ProcessLoginRequest();
  1239. }
  1240. //ip.txt
  1241. BOOL CMainFrame::OnConnectLYFZ()
  1242. {
  1243. CString strBranchIP = "lijiafz.vicp.net";
  1244. MyGetIPByName2(strBranchIP);
  1245. if (strBranchIP == "")
  1246. {
  1247. return 0;
  1248. }
  1249. g_conntype = 0; // Jeff.Delete at 2014.10.18
  1250. //g_conntype = 1;
  1251. CString strServerAddress = strBranchIP;
  1252. char *szServerAddress = strServerAddress.GetBuffer(0);
  1253. strServerAddress.ReleaseBuffer();
  1254. /*for Client, IP and Port can be 0,
  1255. and for Server, IP is LocalIP, and Port is Listening Port*/
  1256. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1257. 0,
  1258. HandleClientNetEvent,
  1259. this);
  1260. if (TRANSPORT_OK != nResult)
  1261. {
  1262. return 0;
  1263. }
  1264. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1265. WORD wPort = GetPort();
  1266. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1267. if (TRANSPORT_OK != nResult)
  1268. {
  1269. m_tClientTunnel.net_CloseSocket();
  1270. return 0;
  1271. }
  1272. return ProcessLoginRequest();
  1273. }
  1274. BOOL CMainFrame::OnConnect()
  1275. {
  1276. // 1.Jeff 断开(如果有在在未关的连接)之前的连接;
  1277. OnDisconnect();
  1278. // 2.根据需要连接指定的服务器;
  1279. if (g_bBranchModify)
  1280. {
  1281. // Jeff.g_bBranchModify在g_bGenBranchData=1时,在welcome::OnTimer里被设置为1;
  1282. return OnConnectBranch();// 连接集团版分店;
  1283. }
  1284. if (g_bConnLYFZ)
  1285. {
  1286. return OnConnectLYFZ();// 连接公司服务端程序;
  1287. }
  1288. g_conntype = 0;
  1289. CString strServerAddress = g_server;
  1290. // 3.如果dbconfig.dat里保存的是*.ly.com的信息,就要读取ip.txt里的IP地址;
  1291. if (g_serverbak.Find(".ly.com") != -1)
  1292. {
  1293. strServerAddress = g_serverbak;
  1294. CStdioFile fp;
  1295. CString path = g_mainpath + "\\ip.txt";
  1296. if (::PathFileExists(path))
  1297. {
  1298. fp.Open(path, CFile::modeRead);
  1299. fp.ReadString(g_server);
  1300. fp.Close();
  1301. if (OnConnectIP())
  1302. {
  1303. // g_serverip=g_server;
  1304. return 1;
  1305. }
  1306. g_server = strServerAddress;
  1307. OnDisconnect();//MessageBox("ip失败");
  1308. }
  1309. g_conntype = 1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1310. strServerAddress = "lijiafz.vicp.net";
  1311. MyGetIPByName2(strServerAddress);
  1312. if (strServerAddress.IsEmpty())
  1313. {
  1314. return 0;//OnConnect2();
  1315. }
  1316. }
  1317. else if (g_ntimeout == 29000)//非远程 30000
  1318. {
  1319. strServerAddress = g_serverarray.ElementAt(g_conpos);
  1320. }
  1321. // 4.如果没有IP.txt或dbconfig.dat里的不是ly.com信息,而是一般的计算机名称;
  1322. char *szServerAddress = strServerAddress.GetBuffer(0);
  1323. strServerAddress.ReleaseBuffer();
  1324. // AfxMessageBox("连接:"+strServerAddress);
  1325. /*for Client, IP and Port can be 0,
  1326. and for Server, IP is LocalIP, and Port is Listening Port*/
  1327. // 5.创建通信对象连接;
  1328. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1329. 0,
  1330. HandleClientNetEvent,
  1331. this);
  1332. if (TRANSPORT_OK != nResult)
  1333. {
  1334. return 0;
  1335. }
  1336. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1337. WORD wPort = SERVER_PORT;
  1338. if (g_conntype) wPort = GetPort();
  1339. // 6.连接公司服务器或影楼服务器;
  1340. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1341. if (TRANSPORT_OK != nResult)
  1342. {
  1343. m_tClientTunnel.net_CloseSocket();
  1344. if (g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1345. {
  1346. return 0;//OnConnect2();
  1347. }
  1348. if (g_serverarray.GetSize() > 1)
  1349. {
  1350. if (g_conpos < (g_serverarray.GetSize() - 1))
  1351. {
  1352. g_conpos++;
  1353. return OnConnect();
  1354. }
  1355. else
  1356. {
  1357. g_conpos = 0;
  1358. return 0;
  1359. }
  1360. }
  1361. return 0;
  1362. }
  1363. return ProcessLoginRequest();
  1364. }
  1365. BOOL CMainFrame::OnConnect2()
  1366. {
  1367. g_conntype = 2;
  1368. CString server = "http://www.lyfz.net/download/ip.txt";
  1369. char buf[MAX_PATH];
  1370. ::GetTempPath(sizeof(buf), buf);
  1371. CString m_strTempDir = buf;
  1372. DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1373. INTERNET_PORT m_dwPort;
  1374. DWORD dwType;
  1375. CInternetSession m_cis;
  1376. CHttpConnection *m_pHttp;
  1377. CString m_strServer;
  1378. CString m_strIniPath;
  1379. AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
  1380. if (dwType != AFX_INET_SERVICE_HTTP)
  1381. {
  1382. return 0;//OnConnect3();
  1383. }
  1384. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
  1385. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1386. try
  1387. {
  1388. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1389. }
  1390. catch (CInternetException* pEx)
  1391. {
  1392. return 0;//OnConnect3();
  1393. }
  1394. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1395. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1396. try
  1397. {
  1398. pFile->SendRequest();
  1399. }
  1400. catch (CInternetException* pEx)
  1401. {
  1402. pFile->Close();
  1403. return 0;//OnConnect3();
  1404. }
  1405. if (pFile)
  1406. {
  1407. CStdioFile csf;
  1408. csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
  1409. char buf[2048];
  1410. int n;
  1411. while ((n = pFile->Read(buf, 2048)) > 0)
  1412. csf.Write(buf, n);
  1413. csf.Close();
  1414. pFile->Close();
  1415. }
  1416. CString strServerAddress;
  1417. CStdioFile fp;
  1418. fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
  1419. fp.ReadString(strServerAddress);
  1420. fp.Close();
  1421. char *szServerAddress = strServerAddress.GetBuffer(0);
  1422. strServerAddress.ReleaseBuffer();
  1423. /*for Client, IP and Port can be 0,
  1424. and for Server, IP is LocalIP, and Port is Listening Port*/
  1425. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1426. 0,
  1427. HandleClientNetEvent,
  1428. this);
  1429. if (TRANSPORT_OK != nResult)
  1430. {
  1431. return 0;
  1432. }
  1433. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1434. WORD wPort = SERVER_PORT;
  1435. if (g_conntype)wPort = GetPort();
  1436. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1437. if (TRANSPORT_OK != nResult)
  1438. {
  1439. m_tClientTunnel.net_CloseSocket();
  1440. return 0;//OnConnect3();
  1441. }
  1442. return ProcessLoginRequest();
  1443. }
  1444. BOOL CMainFrame::OnConnect3()
  1445. {
  1446. g_conntype = 3;
  1447. CString server = "http://photo.bjlyfz.com/download/ip.txt";
  1448. char buf[MAX_PATH];
  1449. ::GetTempPath(sizeof(buf), buf);
  1450. CString m_strTempDir = buf;
  1451. DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1452. INTERNET_PORT m_dwPort;
  1453. DWORD dwType;
  1454. CInternetSession m_cis;
  1455. CHttpConnection *m_pHttp;
  1456. CString m_strServer;
  1457. CString m_strIniPath;
  1458. AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
  1459. if (dwType != AFX_INET_SERVICE_HTTP)
  1460. {
  1461. return FALSE;
  1462. }
  1463. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
  1464. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1465. try
  1466. {
  1467. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1468. }
  1469. catch (CInternetException* pEx)
  1470. {
  1471. return false;
  1472. }
  1473. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1474. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1475. try
  1476. {
  1477. pFile->SendRequest();
  1478. }
  1479. catch (CInternetException* pEx)
  1480. {
  1481. pFile->Close();
  1482. return false;
  1483. }
  1484. if (pFile)
  1485. {
  1486. CStdioFile csf;
  1487. csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
  1488. char buf[2048];
  1489. int n;
  1490. while ((n = pFile->Read(buf, 2048)) > 0)
  1491. csf.Write(buf, n);
  1492. csf.Close();
  1493. pFile->Close();
  1494. }
  1495. CString strServerAddress;
  1496. CStdioFile fp;
  1497. fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
  1498. fp.ReadString(strServerAddress);
  1499. fp.Close();
  1500. char *szServerAddress = strServerAddress.GetBuffer(0);
  1501. strServerAddress.ReleaseBuffer();
  1502. /*for Client, IP and Port can be 0,
  1503. and for Server, IP is LocalIP, and Port is Listening Port*/
  1504. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1505. 0,
  1506. HandleClientNetEvent,
  1507. this);
  1508. if (TRANSPORT_OK != nResult)
  1509. {
  1510. return 0;
  1511. }
  1512. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1513. WORD wPort = SERVER_PORT;
  1514. if (g_conntype)wPort = GetPort();
  1515. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1516. if (TRANSPORT_OK != nResult)
  1517. {
  1518. m_tClientTunnel.net_CloseSocket();
  1519. return 0;
  1520. }
  1521. return ProcessLoginRequest();
  1522. }
  1523. void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
  1524. {
  1525. //printf("Jeff:ProcessNetEvent\n\n");//Jeff Printf;
  1526. if (Transport_ReadEv == nEventType)
  1527. {
  1528. if (NULL == pRecvMsg) return;
  1529. TMessageHeader* pHeader = (TMessageHeader *)pRecvMsg;
  1530. char *pDataBuf = (char *)pRecvMsg + MESSAGE_HEADER_LEN;
  1531. WORD dwMessageID = pHeader->wMessageId;
  1532. switch (dwMessageID)
  1533. {
  1534. case MSG_LOGIN_RESP:
  1535. case (MSG_LOGIN_RESP + 0X2FFF) :
  1536. {
  1537. LOGIN_RESULT_STRU tLoginResult = { 0 };
  1538. memcpy(&tLoginResult, pDataBuf, sizeof(LOGIN_RESULT_STRU));
  1539. ProcessLoginResponse(&tLoginResult);
  1540. break;
  1541. }
  1542. case MSG_USERINFO_RESP:
  1543. {
  1544. break;
  1545. }
  1546. case MSG_LOGOUT_RESP:
  1547. {
  1548. break;
  1549. }
  1550. case MSG_CHATMESSAGE_RESP:
  1551. case (MSG_CHATMESSAGE_RESP + 0X4FFF) :
  1552. {
  1553. //AfxMessageBox("登陆成功");
  1554. //printf("Jeff:MSG_CHATMESSAGE_RESP\n\n");//Jeff Printf;
  1555. static int i = 0;
  1556. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pDataBuf;
  1557. ProcessChatMessageResponse((void *)pChatMessage);
  1558. break;
  1559. }
  1560. default:
  1561. {
  1562. break;
  1563. }
  1564. }
  1565. }
  1566. else if (Transport_CloseEv == nEventType)
  1567. {
  1568. OnDisconnect();
  1569. }
  1570. }
  1571. //extern BOOL g_bNeedCoon;
  1572. extern BOOL EncryptFile2(BYTE *buffer, DWORD leng, PCHAR szPassword);
  1573. void CMainFrame::OnTimer(UINT nIDEvent)
  1574. {
  1575. // TODO: Add your message handler code here and/or call default
  1576. if (1 == nIDEvent)
  1577. {
  1578. KillTimer(nIDEvent);
  1579. CString version = _T("Version 1.0");
  1580. BOOL checked = AfxGetApp()->GetProfileInt(version, "status", 0);//status:此机用选片菜单项
  1581. // checked==1:此机用选片菜单项
  1582. // g_bStaffAchievementShow==1:此机用于员工业绩查看
  1583. if (checked && g_bStaffAchievementShow == 0) // .此机用选片菜单项;
  1584. {
  1585. KillTimer(3);
  1586. #ifdef NEW_SKIN
  1587. Welcome weldlg;
  1588. weldlg.DoModal();
  1589. #endif
  1590. ChoosePhotoSkin dlg;
  1591. dlg.SetLiaPath("1.lia");
  1592. if (dlg.DoModal() != IDOK)
  1593. {
  1594. PostMessage(WM_QUIT);
  1595. return;
  1596. }
  1597. if (dlg.m_exitcode == 3)
  1598. {
  1599. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  1600. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  1601. }
  1602. else
  1603. {
  1604. ShowWindow(SW_SHOW);
  1605. #ifdef NEW_SKIN
  1606. if (m_pMainFrimDlg2 == NULL)
  1607. {
  1608. m_pMainFrimDlg2 = new MainFrimDlg2;
  1609. m_pMainFrimDlg2->SetLiaPath("10.lia");
  1610. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  1611. }
  1612. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1613. #endif
  1614. }
  1615. }
  1616. else if (g_bStaffAchievementShow == 0) // .非选片、非查看员工业绩;
  1617. {
  1618. #ifdef NEW_SKIN
  1619. g_bNoConnDlg = 1;
  1620. Welcome weldlg;
  1621. weldlg.DoModal();
  1622. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1623. ShowWindow(SW_SHOW);
  1624. g_bNoConnDlg = 0;
  1625. if (g_bNoLoginLia) // Jeff.OnCreate里判断skin文件有5.lia, g_bNoLoginLia = 0, 无 g_bNoLoginLia = 1;
  1626. {
  1627. Login dlg;
  1628. dlg.SetLiaPath("5.lia");
  1629. dlg.DoModal();
  1630. }
  1631. else
  1632. {
  1633. Login3 dlg;
  1634. dlg.SetLiaPath("5.lia"); // Login3的父类为MyDlg,在BOOL MyDlg::OnInitDialog()里调用了纯虚函数Init();
  1635. dlg.DoModal();
  1636. }
  1637. if (g_user.bLongin && g_pMainWnd2)
  1638. {
  1639. g_pMainWnd2->ShowBar(1);
  1640. InsideMsg();
  1641. }
  1642. #else
  1643. ShowWindow(SW_SHOW);
  1644. if (g_bNoLoginLia)
  1645. {
  1646. Login dlg;
  1647. dlg.SetLiaPath ("5.lia");
  1648. dlg.DoModal();
  1649. }
  1650. else
  1651. {
  1652. Login3 dlg;
  1653. dlg.SetLiaPath ("5.lia");
  1654. dlg.DoModal();
  1655. }
  1656. #endif
  1657. }
  1658. if (g_hmouse == NULL)
  1659. {
  1660. g_hmouse = SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId());
  1661. }
  1662. }
  1663. else if (2 == nIDEvent) //29秒后,若连接和发送未完成,将关闭连接和发送框;
  1664. {
  1665. KillTimer(2);
  1666. if (g_hConnectWnd)
  1667. ::SendMessage(g_hConnectWnd, WM_CLOSE, 0, 0);
  1668. if (g_hSendWnd)
  1669. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1670. if (g_bStaffAchievementShow == 0 && g_bConnLYFZ == 0)
  1671. {
  1672. if (g_bGenBranchData == 0)
  1673. {
  1674. if (g_branchip != "")
  1675. AfxMessageBox("连接分店:" + g_branchname + "失败!", MB_ICONINFORMATION);
  1676. else
  1677. AfxMessageBox("连接服务器失败!", MB_ICONINFORMATION);
  1678. }
  1679. OnDisconnect();
  1680. }
  1681. g_bSendOK = 0;
  1682. g_bNeedCoon = 1;
  1683. }
  1684. else if (3 == nIDEvent)
  1685. {
  1686. KillTimer(3);
  1687. #ifdef NEW_SKIN
  1688. Welcome weldlg;
  1689. weldlg.DoModal();
  1690. #endif
  1691. ShowWindow(SW_SHOW);
  1692. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1693. g_sendhead.bsql = 0;
  1694. g_sendhead.code[0] = 24;
  1695. g_sendhead.code[1] = 1;
  1696. g_sendhead.tabcount = 2;
  1697. g_pMainWnd->ProcessChatMessageRequest2(1);
  1698. if (g_bSendOK == 0)
  1699. {
  1700. return;
  1701. }
  1702. CArray<CStringArray, CStringArray>patharray;
  1703. CArray<CStringArray, CStringArray>userarray;
  1704. DataToArray(&g_cominfoarray, &g_hisyeararray);
  1705. g_userarray.SetSize(userarray.GetSize(), 1);
  1706. int count = 0;
  1707. for (int ii = 0; ii < userarray.GetSize(); ii++)
  1708. {
  1709. if (userarray.ElementAt(ii).ElementAt(10) == "在职")
  1710. g_userarray.ElementAt(count++).Copy(userarray.ElementAt(ii));
  1711. }
  1712. g_userarray.SetSize(count, 1);
  1713. StaffAchievementShowAll dlg;
  1714. g_pMainWnd->GetOcx();
  1715. dlg.DoModal();
  1716. }
  1717. else if (5 == nIDEvent)
  1718. {
  1719. if (g_bInSkin)
  1720. {
  1721. OutputDebugString("使用皮肤\n");
  1722. return;
  1723. }
  1724. if (g_nAutoShowStaffAchievement == 1){
  1725. OutputDebugString("用于选片\n");
  1726. return;
  1727. }
  1728. if (g_bAllBranch){
  1729. OutputDebugString("多店汇总当中\n");
  1730. return;
  1731. }
  1732. if (g_user.bLongin)
  1733. {
  1734. // m_Mdi.CloseAll();
  1735. g_pMainWnd->OnCommandMenu(IDM_Logout);
  1736. }
  1737. /* g_nAutoShowStaffAchievement=1;
  1738. KillTimer(5);
  1739. StaffAchievementShowAll dlg;
  1740. g_pMainWnd->GetOcx();
  1741. dlg.DoModal ();*/
  1742. }
  1743. else if (6 == nIDEvent)
  1744. {
  1745. static BOOL bDouble = 0;
  1746. bDouble = !bDouble;
  1747. if (bDouble)
  1748. g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
  1749. else
  1750. g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
  1751. }
  1752. else if (7 == nIDEvent)
  1753. {
  1754. // Jeff,当g_bSendLYFZ==TRUE时;
  1755. // 向lijiafz.vicp.net发送影楼信息,防止有盗版用户;
  1756. KillTimer(7);
  1757. if (g_bInSkin)return;
  1758. if (g_nAutoShowStaffAchievement == 1)return;
  1759. if (g_bAllBranch)return;
  1760. CString str = g_sInfo;
  1761. g_bConnLYFZ = 1; // Jeff指示连接的服务器为lijiafz.vicp.net
  1762. // 断开当前连接;
  1763. OnDisconnect();
  1764. BYTE *pData = new BYTE[str.GetLength()];
  1765. memcpy(pData, str.GetBuffer(0), str.GetLength());
  1766. str.ReleaseBuffer();
  1767. EncryptFile2(pData, str.GetLength(), "888666333");
  1768. g_nSendCode = 16;
  1769. g_pMainWnd->ProcessChatMessageRequest2(pData, str.GetLength());
  1770. g_nSendCode = 0;
  1771. delete[]pData;
  1772. OnDisconnect();
  1773. g_bSendLYFZ = 0;
  1774. g_bConnLYFZ = 0;
  1775. if (g_bSendOK)
  1776. {
  1777. char *pStr = new char[g_nLeng + 1];
  1778. memset(pStr, 0, g_nLeng + 1);
  1779. memcpy(pStr, g_pData, g_nLeng);
  1780. CString str = pStr;
  1781. delete[]pStr;
  1782. if (str == "g_bInSkin")
  1783. {
  1784. g_sendhead.bsql = 1;
  1785. g_pMainWnd->ProcessChatMessageRequest2("update version set [setcheck1]='ok'");
  1786. }
  1787. }
  1788. }
  1789. }
  1790. void CMainFrame::OnOutbarNotify(CString strMsg)
  1791. {
  1792. if (g_user.bLongin == 0)
  1793. {
  1794. if (g_bNoLoginLia)
  1795. {
  1796. Login dlg;
  1797. dlg.SetLiaPath("5.lia");
  1798. dlg.DoModal();
  1799. }
  1800. else
  1801. {
  1802. Login3 dlg;
  1803. dlg.SetLiaPath("5.lia");
  1804. dlg.DoModal();
  1805. }
  1806. return;
  1807. if (g_user.bLongin == 0)return;
  1808. }
  1809. else
  1810. {
  1811. InsideMsg();
  1812. }
  1813. ResetTimer();
  1814. if (strMsg == "开单")
  1815. {
  1816. if (IsHasRights(0) == 0)return;
  1817. /* UINT nID=0;
  1818. LPSTR pName ;
  1819. pName = (LPSTR)(LPCSTR)"开单";
  1820. OPEN_MENU(Booking);*/
  1821. Booking2 dlg;
  1822. dlg.DoModal();
  1823. return;
  1824. }
  1825. else if (strMsg == "拍照")
  1826. {
  1827. if (IsHasRights(1) == 0)return;
  1828. UINT nID = 1;
  1829. LPSTR pName;
  1830. pName = (LPSTR)(LPCSTR)"拍照";
  1831. OPEN_MENU(TakeFrom);
  1832. return;
  1833. }
  1834. else if (strMsg == "修片")
  1835. {
  1836. if (IsHasRights(1) == 0)return;
  1837. UINT nID = 1;
  1838. LPSTR pName;
  1839. pName = (LPSTR)(LPCSTR)"修片";
  1840. OPEN_MENU(BeautifySkinFrom);
  1841. return;
  1842. }
  1843. else if (strMsg == "选片")
  1844. {
  1845. if (IsHasRights(2) == 0)return;
  1846. UINT nID = 1;
  1847. LPSTR pName;
  1848. pName = (LPSTR)(LPCSTR)"选片";
  1849. OPEN_MENU(ChoosePhotoForm);
  1850. return;
  1851. }
  1852. else if (strMsg == "精修")
  1853. {
  1854. if (IsHasRights(2) == 0)return;
  1855. UINT nID = 1;
  1856. LPSTR pName;
  1857. pName = (LPSTR)(LPCSTR)"精修";
  1858. OPEN_MENU(BeautifySkinFrom2);
  1859. return;
  1860. }
  1861. else if (strMsg == "设计")
  1862. {
  1863. if (IsHasRights(2) == 0)return;
  1864. UINT nID = 1;
  1865. LPSTR pName;
  1866. pName = (LPSTR)(LPCSTR)"设计";
  1867. OPEN_MENU(DesignFrom);
  1868. return;
  1869. }
  1870. else if (strMsg == "数码安排")
  1871. {
  1872. UINT nID = 1;
  1873. LPSTR pName;
  1874. pName = (LPSTR)(LPCSTR)"数码安排";
  1875. OPEN_MENU(DigitalWork);
  1876. return;
  1877. }
  1878. else if (strMsg == "刻盘")
  1879. {
  1880. UINT nID = 1;
  1881. LPSTR pName;
  1882. pName = (LPSTR)(LPCSTR)"刻盘";
  1883. OPEN_MENU(BurnCD);
  1884. return;
  1885. }
  1886. else if (strMsg == "相片冲印")
  1887. {
  1888. UINT nID = 1;
  1889. LPSTR pName;
  1890. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  1891. OPEN_MENU(PhotoPrintFrom);
  1892. return;
  1893. }
  1894. else if (strMsg == "发片/取件")
  1895. {
  1896. if (IsHasRights(3) == 0)return;
  1897. UINT nID = 1;
  1898. LPSTR pName;
  1899. pName = (LPSTR)(LPCSTR)"发片/取件";
  1900. OPEN_MENU(outsourcing);
  1901. return;
  1902. }
  1903. else if (strMsg == "满意度")
  1904. {
  1905. UINT nID = 1;
  1906. LPSTR pName;
  1907. pName = (LPSTR)(LPCSTR)"满意度";
  1908. OPEN_MENU(Satisfaction);
  1909. return;
  1910. }
  1911. else if (strMsg == "满意度图表")
  1912. {
  1913. UINT nID = 1;
  1914. LPSTR pName;
  1915. pName = (LPSTR)(LPCSTR)"满意度图表";
  1916. OPEN_MENU(SatisfactionForm);
  1917. return;
  1918. }
  1919. #if JEFF_DELETE_ON // 2014.11.14-PM 16:20
  1920. else if (strMsg == "回复统计")
  1921. {
  1922. UINT nID = 1;
  1923. LPSTR pName;
  1924. pName = (LPSTR)(LPCSTR)"回复统计";
  1925. OPEN_MENU(MsgReg2);
  1926. return;
  1927. }
  1928. #endif
  1929. /* else if(strMsg=="取件")
  1930. {
  1931. if(IsHasRights(3)==0)return;
  1932. UINT nID=1;
  1933. LPSTR pName ;
  1934. pName = (LPSTR)(LPCSTR)"取件";
  1935. OPEN_MENU(TakeAwayFrom);
  1936. return;
  1937. }*/
  1938. else if (strMsg == "其它收入")
  1939. {
  1940. if (IsHasRightsnew(16) == 0)return;
  1941. // if(IsHasRightsnew(48)==0)return;
  1942. UINT nID = 1;
  1943. LPSTR pName;
  1944. pName = (LPSTR)(LPCSTR)"其它收入";
  1945. OPEN_MENU(IncomeInput);
  1946. return;
  1947. }
  1948. else if (strMsg == "其它二销")
  1949. {
  1950. if (IsHasRightsnew(16) == 0)return;
  1951. UINT nID = 1;
  1952. LPSTR pName;
  1953. pName = (LPSTR)(LPCSTR)"其它二销";
  1954. OPEN_MENU(IncomeInput2);
  1955. return;
  1956. }
  1957. else if (strMsg == "员工奖罚")
  1958. {
  1959. if (IsHasRightsnew(16) == 0)return;
  1960. UINT nID = 1;
  1961. LPSTR pName;
  1962. pName = (LPSTR)(LPCSTR)"员工奖罚";
  1963. OPEN_MENU(IncomeInput3);
  1964. return;
  1965. }
  1966. else if (strMsg == "员工奖惩")
  1967. {
  1968. if (IsHasRightsnew(16) == 0)return;
  1969. UINT nID = 1;
  1970. LPSTR pName;
  1971. pName = (LPSTR)(LPCSTR)"员工奖惩";
  1972. OPEN_MENU(IncomeInput4);
  1973. return;
  1974. }
  1975. else if (strMsg == "订单收款")
  1976. {
  1977. if (IsHasRights(17) == 0)return;
  1978. UINT nID = 1;
  1979. LPSTR pName;
  1980. pName = (LPSTR)(LPCSTR)"订单收款";
  1981. OPEN_MENU(FinanceForm);
  1982. return;
  1983. }
  1984. else if (strMsg == "日财务表")
  1985. {
  1986. if (IsHasRightsnew(22) == 0)return;
  1987. UINT nID = 2;
  1988. LPSTR pName;
  1989. pName = (LPSTR)(LPCSTR)"日财务表";
  1990. OPEN_MENU(DailyForm);
  1991. return;
  1992. }
  1993. else if (strMsg == "提成比例")
  1994. {
  1995. #ifndef ENTERPRISE_VERSION
  1996. #ifndef CHILD_VERSION
  1997. #ifdef BASIC_VERSION
  1998. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  1999. {
  2000. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2001. exit(0);return;
  2002. }
  2003. #else
  2004. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2005. {
  2006. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2007. exit(0);return;
  2008. }
  2009. #endif
  2010. #else
  2011. #ifdef BASIC_VERSION
  2012. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2013. {
  2014. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2015. exit(0);return;
  2016. }
  2017. #else
  2018. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2019. {
  2020. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2021. exit(0); return;
  2022. }
  2023. #endif
  2024. #endif
  2025. #else
  2026. #ifndef CHILD_VERSION
  2027. #ifdef BASIC_VERSION
  2028. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2029. {
  2030. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2031. exit(0); return;
  2032. }
  2033. #else
  2034. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2035. {
  2036. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2037. exit(0); return;
  2038. }
  2039. #endif
  2040. #else
  2041. #ifdef BASIC_VERSION
  2042. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2043. {
  2044. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2045. exit(0);return;
  2046. }
  2047. #else
  2048. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2049. {
  2050. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2051. exit(0); return;
  2052. }
  2053. #endif
  2054. #endif
  2055. #endif
  2056. UINT nID = 2;
  2057. LPSTR pName;
  2058. pName = (LPSTR)(LPCSTR)"提成比例";
  2059. OPEN_MENU(SalarySet2);
  2060. return;
  2061. }
  2062. //else if(strMsg=="员工工作")
  2063. else if (strMsg == "计件提成")
  2064. {
  2065. UINT nID = 2;
  2066. LPSTR pName;
  2067. //pName = (LPSTR)(LPCSTR)"员工工作";
  2068. pName = (LPSTR)(LPCSTR)"计件提成";
  2069. OPEN_MENU(SalarySet3);
  2070. return;
  2071. }
  2072. else if (strMsg == "工资管理")
  2073. {
  2074. #ifndef ENTERPRISE_VERSION
  2075. #ifndef CHILD_VERSION
  2076. #ifdef BASIC_VERSION
  2077. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2078. {
  2079. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2080. exit(0);return;
  2081. }
  2082. #else
  2083. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2084. {
  2085. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2086. exit(0);return;
  2087. }
  2088. #endif
  2089. #else
  2090. #ifdef BASIC_VERSION
  2091. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2092. {
  2093. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2094. exit(0);return;
  2095. }
  2096. #else
  2097. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2098. {
  2099. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2100. exit(0); return;
  2101. }
  2102. #endif
  2103. #endif
  2104. #else
  2105. #ifndef CHILD_VERSION
  2106. #ifdef BASIC_VERSION
  2107. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2108. {
  2109. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2110. exit(0); return;
  2111. }
  2112. #else
  2113. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2114. {
  2115. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2116. exit(0); return;
  2117. }
  2118. #endif
  2119. #else
  2120. #ifdef BASIC_VERSION
  2121. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2122. {
  2123. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2124. exit(0);return;
  2125. }
  2126. #else
  2127. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2128. {
  2129. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2130. exit(0); return;
  2131. }
  2132. #endif
  2133. #endif
  2134. #endif
  2135. UINT nID = 2;
  2136. LPSTR pName;
  2137. pName = (LPSTR)(LPCSTR)"工资管理";
  2138. OPEN_MENU(MySalary);
  2139. return;
  2140. }
  2141. else if (strMsg == "客人付款")
  2142. {
  2143. UINT nID = 2;
  2144. LPSTR pName;
  2145. pName = (LPSTR)(LPCSTR)"客人付款";
  2146. OPEN_MENU(ClientMoney);
  2147. return;
  2148. }
  2149. else if (strMsg == "工资报表")
  2150. {
  2151. #ifndef ENTERPRISE_VERSION
  2152. #ifndef CHILD_VERSION
  2153. #ifdef BASIC_VERSION
  2154. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2155. {
  2156. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2157. exit(0);return;
  2158. }
  2159. #else
  2160. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2161. {
  2162. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2163. exit(0);return;
  2164. }
  2165. #endif
  2166. #else
  2167. #ifdef BASIC_VERSION
  2168. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2169. {
  2170. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2171. exit(0);return;
  2172. }
  2173. #else
  2174. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2175. {
  2176. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2177. exit(0); return;
  2178. }
  2179. #endif
  2180. #endif
  2181. #else
  2182. #ifndef CHILD_VERSION
  2183. #ifdef BASIC_VERSION
  2184. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2185. {
  2186. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2187. exit(0); return;
  2188. }
  2189. #else
  2190. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2191. {
  2192. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2193. exit(0); return;
  2194. }
  2195. #endif
  2196. #else
  2197. #ifdef BASIC_VERSION
  2198. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2199. {
  2200. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2201. exit(0);return;
  2202. }
  2203. #else
  2204. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2205. {
  2206. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2207. exit(0); return;
  2208. }
  2209. #endif
  2210. #endif
  2211. #endif
  2212. if (IsHasRightsnew(25) == 0)return;
  2213. UINT nID = 2;
  2214. LPSTR pName;
  2215. pName = (LPSTR)(LPCSTR)"工资报表";
  2216. g_ncount = 100;
  2217. OPEN_MENU(MySalary);
  2218. return;
  2219. }
  2220. else if (strMsg == "员工业绩")
  2221. {
  2222. #ifndef ENTERPRISE_VERSION
  2223. #ifndef CHILD_VERSION
  2224. #ifdef BASIC_VERSION
  2225. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2226. {
  2227. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2228. exit(0);return;
  2229. }
  2230. #else
  2231. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2232. {
  2233. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2234. exit(0);return;
  2235. }
  2236. #endif
  2237. #else
  2238. #ifdef BASIC_VERSION
  2239. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2240. {
  2241. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2242. exit(0);return;
  2243. }
  2244. #else
  2245. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2246. {
  2247. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2248. exit(0); return;
  2249. }
  2250. #endif
  2251. #endif
  2252. #else
  2253. #ifndef CHILD_VERSION
  2254. #ifdef BASIC_VERSION
  2255. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2256. {
  2257. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2258. exit(0); return;
  2259. }
  2260. #else
  2261. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2262. {
  2263. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2264. exit(0); return;
  2265. }
  2266. #endif
  2267. #else
  2268. #ifdef BASIC_VERSION
  2269. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2270. {
  2271. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2272. exit(0);return;
  2273. }
  2274. #else
  2275. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2276. {
  2277. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2278. exit(0); return;
  2279. }
  2280. #endif
  2281. #endif
  2282. #endif
  2283. if (IsHasRightsnew(33) == 0)return;
  2284. UINT nID = 2;
  2285. LPSTR pName;
  2286. pName = (LPSTR)(LPCSTR)"员工业绩";
  2287. OPEN_MENU(StaffAchievement);
  2288. return;
  2289. }
  2290. else if (strMsg == "订单客户")
  2291. {
  2292. UINT nID = 2;
  2293. LPSTR pName;
  2294. pName = (LPSTR)(LPCSTR)"订单客户";
  2295. g_dx += 10000;
  2296. OPEN_MENU(CClientForm);
  2297. if (g_dx >= 10000)g_dx -= 10000;
  2298. return;
  2299. }
  2300. else if (strMsg == "服务记录")
  2301. {
  2302. UINT nID = 2;
  2303. LPSTR pName;
  2304. pName = (LPSTR)(LPCSTR)"服务记录";
  2305. OPEN_MENU(CClientForm2);
  2306. return;
  2307. }
  2308. else if (strMsg == "服务统计")
  2309. {
  2310. UINT nID = 2;
  2311. LPSTR pName;
  2312. pName = (LPSTR)(LPCSTR)"服务统计";
  2313. OPEN_MENU(CClientForm3);
  2314. return;
  2315. }
  2316. else if (strMsg == "意向客户")
  2317. {
  2318. UINT nID = 2;
  2319. LPSTR pName;
  2320. pName = (LPSTR)(LPCSTR)"意向客户";
  2321. #ifdef LYFZ_VERSION
  2322. OPEN_MENU(Client2FormLYFZ);
  2323. #else
  2324. OPEN_MENU(Client2Form);
  2325. #endif
  2326. return;
  2327. }
  2328. else if (strMsg == "老客户")
  2329. {
  2330. UINT nID = 2;
  2331. LPSTR pName;
  2332. pName = (LPSTR)(LPCSTR)"老客户";
  2333. OPEN_MENU(OldClient);
  2334. return;
  2335. }
  2336. else if (strMsg == "客户来电")
  2337. {
  2338. UINT nID = 2;
  2339. LPSTR pName;
  2340. pName = (LPSTR)(LPCSTR)"客户来电";
  2341. OPEN_MENU(PhoneRecord);
  2342. return;
  2343. }
  2344. else if (strMsg == "拨出电话")
  2345. {
  2346. UINT nID = 2;
  2347. LPSTR pName;
  2348. pName = (LPSTR)(LPCSTR)"拨出电话";
  2349. OPEN_MENU(PhoneRecordOut);
  2350. return;
  2351. }
  2352. else if (strMsg == "未接来电")
  2353. {
  2354. UINT nID = 2;
  2355. LPSTR pName;
  2356. pName = (LPSTR)(LPCSTR)"未接来电";
  2357. OPEN_MENU(MissCall);
  2358. return;
  2359. }
  2360. else if (strMsg == "客户流失")
  2361. {
  2362. UINT nID = 2;
  2363. LPSTR pName;
  2364. pName = (LPSTR)(LPCSTR)"客户流失";
  2365. OPEN_MENU(ClientReasonChart);
  2366. return;
  2367. }
  2368. else if (strMsg == "客户来源")
  2369. {
  2370. UINT nID = 2;
  2371. LPSTR pName;
  2372. pName = (LPSTR)(LPCSTR)"客户来源";
  2373. OPEN_MENU(ClientFromChart);
  2374. return;
  2375. }
  2376. else if (strMsg == "月财务表")
  2377. {
  2378. if (IsHasRightsnew(23) == 0)return;
  2379. UINT nID = 2;
  2380. LPSTR pName;
  2381. pName = (LPSTR)(LPCSTR)"月财务表";
  2382. OPEN_MENU(MonthForm);
  2383. return;
  2384. }
  2385. else if (strMsg == "支出报表")
  2386. {
  2387. if (IsHasRightsnew(23) == 0)return;
  2388. UINT nID = 2;
  2389. LPSTR pName;
  2390. pName = (LPSTR)(LPCSTR)"支出报表";
  2391. OPEN_MENU(MonthForm2);
  2392. return;
  2393. }
  2394. else if (strMsg == "年财务表")
  2395. {
  2396. if (IsHasRightsnew(24) == 0)return;
  2397. UINT nID = 2;
  2398. LPSTR pName;
  2399. pName = (LPSTR)(LPCSTR)"年财务表";
  2400. OPEN_MENU(YearForm);
  2401. return;
  2402. }
  2403. else if (strMsg == "年财务图表")
  2404. {
  2405. if (IsHasRightsnew(24) == 0)return;
  2406. GetOcx();
  2407. UINT nID = 2;
  2408. LPSTR pName;
  2409. pName = (LPSTR)(LPCSTR)"年财务图表";
  2410. OPEN_MENU(YearForm2);
  2411. return;
  2412. }
  2413. else if (strMsg == "订单图表")
  2414. {
  2415. GetOcx();
  2416. UINT nID = 2;
  2417. LPSTR pName;
  2418. pName = (LPSTR)(LPCSTR)"订单图表";
  2419. OPEN_MENU(DinDanForm);
  2420. return;
  2421. }
  2422. #ifdef ENTERPRISE_VERSION
  2423. else if (strMsg == "订单报表")
  2424. {
  2425. GetOcx();
  2426. UINT nID = 2;
  2427. LPSTR pName;
  2428. pName = (LPSTR)(LPCSTR)"订单报表2";
  2429. OPEN_MENU(DinDanFromBranch);
  2430. return;
  2431. }
  2432. else if (strMsg == "财务图表")
  2433. {
  2434. GetOcx();
  2435. UINT nID = 2;
  2436. LPSTR pName;
  2437. pName = (LPSTR)(LPCSTR)"财务图表";
  2438. OPEN_MENU(YearFormBranch);
  2439. return;
  2440. }
  2441. else if (strMsg == "订单图表")
  2442. {
  2443. GetOcx();
  2444. UINT nID = 2;
  2445. LPSTR pName;
  2446. pName = (LPSTR)(LPCSTR)"订单图表";
  2447. OPEN_MENU(YearFormBranch2);
  2448. return;
  2449. }
  2450. else if (strMsg == "摄控安排")
  2451. {
  2452. UINT nID = 2;
  2453. LPSTR pName;
  2454. pName = (LPSTR)(LPCSTR)"摄控安排";
  2455. g_bookingtype = 0;
  2456. OPEN_MENU(TodayForm);
  2457. return;
  2458. }
  2459. else if (strMsg == "选片预约")
  2460. {
  2461. UINT nID = 2;
  2462. LPSTR pName;
  2463. pName = (LPSTR)(LPCSTR)"选片预约";
  2464. g_bookingtype = 1;
  2465. OPEN_MENU(TodayForm);
  2466. return;
  2467. }
  2468. else if (strMsg == "看样预约")
  2469. {
  2470. UINT nID = 2;
  2471. LPSTR pName;
  2472. pName = (LPSTR)(LPCSTR)"看样预约";
  2473. g_bookingtype = 2;
  2474. OPEN_MENU(TodayForm);
  2475. return;
  2476. }
  2477. else if (strMsg == "取件预约")
  2478. {
  2479. UINT nID = 2;
  2480. LPSTR pName;
  2481. pName = (LPSTR)(LPCSTR)"取件预约";
  2482. g_bookingtype = 3;
  2483. OPEN_MENU(TodayForm);
  2484. return;
  2485. }
  2486. else if (strMsg == "婚庆安排")
  2487. {
  2488. UINT nID = 2;
  2489. LPSTR pName;
  2490. pName = (LPSTR)(LPCSTR)"婚庆安排";
  2491. g_bookingtype = 4;
  2492. OPEN_MENU(TodayForm);
  2493. return;
  2494. }
  2495. #endif
  2496. else if (strMsg == "员工资料")
  2497. {
  2498. UINT nID = 2;
  2499. LPSTR pName;
  2500. pName = (LPSTR)(LPCSTR)"员工资料";
  2501. if (g_bAllBranch)
  2502. OPEN_MENU(EmployeeForm2);
  2503. else
  2504. OPEN_MENU(EmployeeForm);
  2505. return;
  2506. }
  2507. else if (strMsg == "客户区域")
  2508. {
  2509. // if(IsHasRightsnew(48)==0)return;
  2510. GetOcx();
  2511. UINT nID = 2;
  2512. LPSTR pName;
  2513. pName = (LPSTR)(LPCSTR)"客户区域";
  2514. OPEN_MENU(AreaClient);
  2515. return;
  2516. }
  2517. else if (strMsg == "客户报表")
  2518. {
  2519. UINT nID = 3;
  2520. LPSTR pName;
  2521. pName = (LPSTR)(LPCSTR)"客户报表";
  2522. OPEN_MENU(CClientForm);
  2523. return;
  2524. }
  2525. else if (strMsg == "每日签到")
  2526. {
  2527. UINT nID = 3;
  2528. LPSTR pName;
  2529. pName = (LPSTR)(LPCSTR)"每日签到";
  2530. OPEN_MENU(WorkerReport);
  2531. return;
  2532. }
  2533. else if (strMsg == "服务费")
  2534. {
  2535. UINT nID = 3;
  2536. LPSTR pName;
  2537. pName = (LPSTR)(LPCSTR)"服务费";
  2538. OPEN_MENU(annualfee);
  2539. return;
  2540. }
  2541. else if (strMsg == "现金支出")
  2542. {
  2543. if (IsHasRightsnew(16) == 0)return;
  2544. UINT nID = 3;
  2545. LPSTR pName;
  2546. pName = (LPSTR)(LPCSTR)"现金支出";
  2547. OPEN_MENU(PayOutInput);
  2548. return;
  2549. }
  2550. else if (strMsg == "短信群发")
  2551. {
  2552. UINT nID = 3;
  2553. LPSTR pName;
  2554. pName = (LPSTR)(LPCSTR)"短信群发";
  2555. OPEN_MENU(SendMsg);
  2556. return;
  2557. }
  2558. else if (strMsg == "短信发送")
  2559. {
  2560. UINT nID = 3;
  2561. LPSTR pName;
  2562. pName = (LPSTR)(LPCSTR)"客户报表";
  2563. OPEN_MENU(CClientForm);
  2564. return;
  2565. }
  2566. else if (strMsg == "流程短信")
  2567. {
  2568. UINT nID = 3;
  2569. LPSTR pName;
  2570. pName = (LPSTR)(LPCSTR)"流程短信";
  2571. OPEN_MENU(WorkMsg);
  2572. return;
  2573. }
  2574. else if (strMsg == "员工短信")
  2575. {
  2576. UINT nID = 3;
  2577. LPSTR pName;
  2578. pName = (LPSTR)(LPCSTR)"员工短信";
  2579. OPEN_MENU(EmployeeMsg);
  2580. return;
  2581. }
  2582. else if (strMsg == "发送记录")
  2583. {
  2584. UINT nID = 3;
  2585. LPSTR pName;
  2586. pName = (LPSTR)(LPCSTR)"发送记录";
  2587. OPEN_MENU(MsgReg);
  2588. return;
  2589. }
  2590. else if (strMsg == "短信设置")
  2591. {
  2592. if (IsHasRightsnew(49) == 0)return;
  2593. MsgSet dlg;
  2594. dlg.DoModal();
  2595. return;
  2596. }
  2597. else if (strMsg == "金卡会员")
  2598. {
  2599. #ifndef ENTERPRISE_VERSION
  2600. #ifndef CHILD_VERSION
  2601. #ifdef BASIC_VERSION
  2602. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2603. {
  2604. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2605. exit(0);return;
  2606. }
  2607. #else
  2608. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2609. {
  2610. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2611. exit(0);return;
  2612. }
  2613. #endif
  2614. #else
  2615. #ifdef BASIC_VERSION
  2616. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2617. {
  2618. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2619. exit(0);return;
  2620. }
  2621. #else
  2622. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2623. {
  2624. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2625. exit(0); return;
  2626. }
  2627. #endif
  2628. #endif
  2629. #else
  2630. #ifndef CHILD_VERSION
  2631. #ifdef BASIC_VERSION
  2632. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2633. {
  2634. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2635. exit(0); return;
  2636. }
  2637. #else
  2638. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2639. {
  2640. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2641. exit(0); return;
  2642. }
  2643. #endif
  2644. #else
  2645. #ifdef BASIC_VERSION
  2646. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2647. {
  2648. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2649. exit(0);return;
  2650. }
  2651. #else
  2652. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2653. {
  2654. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2655. exit(0); return;
  2656. }
  2657. #endif
  2658. #endif
  2659. #endif
  2660. UINT nID = 3;
  2661. LPSTR pName;
  2662. pName = (LPSTR)(LPCSTR)"金卡会员";
  2663. OPEN_MENU(ShowMember);
  2664. return;
  2665. }
  2666. else if (strMsg == "现金子卡")
  2667. {
  2668. UINT nID = 3;
  2669. LPSTR pName;
  2670. pName = (LPSTR)(LPCSTR)"现金子卡";
  2671. OPEN_MENU(ShowMember2);
  2672. return;
  2673. }
  2674. else if (strMsg == "蓝钻会员")
  2675. {
  2676. #ifndef ENTERPRISE_VERSION
  2677. #ifndef CHILD_VERSION
  2678. #ifdef BASIC_VERSION
  2679. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2680. {
  2681. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2682. exit(0);return;
  2683. }
  2684. #else
  2685. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2686. {
  2687. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2688. exit(0);return;
  2689. }
  2690. #endif
  2691. #else
  2692. #ifdef BASIC_VERSION
  2693. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2694. {
  2695. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2696. exit(0);return;
  2697. }
  2698. #else
  2699. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2700. {
  2701. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2702. exit(0); return;
  2703. }
  2704. #endif
  2705. #endif
  2706. #else
  2707. #ifndef CHILD_VERSION
  2708. #ifdef BASIC_VERSION
  2709. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2710. {
  2711. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2712. exit(0); return;
  2713. }
  2714. #else
  2715. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2716. {
  2717. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2718. exit(0); return;
  2719. }
  2720. #endif
  2721. #else
  2722. #ifdef BASIC_VERSION
  2723. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2724. {
  2725. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2726. exit(0);return;
  2727. }
  2728. #else
  2729. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2730. {
  2731. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2732. exit(0); return;
  2733. }
  2734. #endif
  2735. #endif
  2736. #endif
  2737. UINT nID = 3;
  2738. LPSTR pName;
  2739. pName = (LPSTR)(LPCSTR)"蓝钻会员";
  2740. OPEN_MENU(ShowMemberBlue);
  2741. return;
  2742. }
  2743. else if (strMsg == "转介绍积分")
  2744. {
  2745. #ifndef ENTERPRISE_VERSION
  2746. #ifndef CHILD_VERSION
  2747. #ifdef BASIC_VERSION
  2748. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2749. {
  2750. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2751. exit(0);return;
  2752. }
  2753. #else
  2754. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2755. {
  2756. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2757. exit(0);return;
  2758. }
  2759. #endif
  2760. #else
  2761. #ifdef BASIC_VERSION
  2762. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2763. {
  2764. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2765. exit(0);return;
  2766. }
  2767. #else
  2768. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2769. {
  2770. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2771. exit(0); return;
  2772. }
  2773. #endif
  2774. #endif
  2775. #else
  2776. #ifndef CHILD_VERSION
  2777. #ifdef BASIC_VERSION
  2778. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2779. {
  2780. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2781. exit(0); return;
  2782. }
  2783. #else
  2784. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2785. {
  2786. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2787. exit(0); return;
  2788. }
  2789. #endif
  2790. #else
  2791. #ifdef BASIC_VERSION
  2792. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2793. {
  2794. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2795. exit(0);return;
  2796. }
  2797. #else
  2798. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2799. {
  2800. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2801. exit(0); return;
  2802. }
  2803. #endif
  2804. #endif
  2805. #endif
  2806. UINT nID = 3;
  2807. LPSTR pName;
  2808. pName = (LPSTR)(LPCSTR)"转介绍积分";
  2809. OPEN_MENU(Card2Reg);
  2810. return;
  2811. }
  2812. /* else if(strMsg=="转介绍图表")
  2813. {
  2814. #ifndef ENTERPRISE_VERSION
  2815. #ifndef CHILD_VERSION
  2816. #ifdef BASIC_VERSION
  2817. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2818. {
  2819. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2820. exit(0);return;
  2821. }
  2822. #else
  2823. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2824. {
  2825. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2826. exit(0);return;
  2827. }
  2828. #endif
  2829. #else
  2830. #ifdef BASIC_VERSION
  2831. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2832. {
  2833. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2834. exit(0);return;
  2835. }
  2836. #else
  2837. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2838. {
  2839. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2840. exit(0);return;
  2841. }
  2842. #endif
  2843. #endif
  2844. #else
  2845. #ifndef CHILD_VERSION
  2846. #ifdef BASIC_VERSION
  2847. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2848. {
  2849. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2850. exit(0);return;
  2851. }
  2852. #else
  2853. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2854. {
  2855. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2856. exit(0);return;
  2857. }
  2858. #endif
  2859. #else
  2860. #ifdef BASIC_VERSION
  2861. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2862. {
  2863. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2864. exit(0);return;
  2865. }
  2866. #else
  2867. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2868. {
  2869. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2870. exit(0);return;
  2871. }
  2872. #endif
  2873. #endif
  2874. #endif
  2875. UINT nID=3;
  2876. LPSTR pName ;
  2877. pName = (LPSTR)(LPCSTR)"转介绍图表";
  2878. OPEN_MENU(Card2RegChart);
  2879. return;
  2880. }*/
  2881. else if (strMsg == "金卡图表")
  2882. {
  2883. UINT nID = 3;
  2884. LPSTR pName;
  2885. pName = (LPSTR)(LPCSTR)"金卡图表";
  2886. OPEN_MENU(MemberChart);
  2887. return;
  2888. }
  2889. else if (strMsg == "积分短信")
  2890. {
  2891. UINT nID = 3;
  2892. LPSTR pName;
  2893. pName = (LPSTR)(LPCSTR)"积分短信";
  2894. OPEN_MENU(ShowMemberMsg);
  2895. return;
  2896. }
  2897. else if (strMsg == "转介绍返现")
  2898. {
  2899. #ifndef ENTERPRISE_VERSION
  2900. #ifndef CHILD_VERSION
  2901. #ifdef BASIC_VERSION
  2902. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2903. {
  2904. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2905. exit(0);return;
  2906. }
  2907. #else
  2908. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2909. {
  2910. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2911. exit(0);return;
  2912. }
  2913. #endif
  2914. #else
  2915. #ifdef BASIC_VERSION
  2916. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2917. {
  2918. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2919. exit(0);return;
  2920. }
  2921. #else
  2922. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2923. {
  2924. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2925. exit(0); return;
  2926. }
  2927. #endif
  2928. #endif
  2929. #else
  2930. #ifndef CHILD_VERSION
  2931. #ifdef BASIC_VERSION
  2932. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2933. {
  2934. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2935. exit(0); return;
  2936. }
  2937. #else
  2938. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2939. {
  2940. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2941. exit(0); return;
  2942. }
  2943. #endif
  2944. #else
  2945. #ifdef BASIC_VERSION
  2946. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2947. {
  2948. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2949. exit(0);return;
  2950. }
  2951. #else
  2952. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2953. {
  2954. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2955. exit(0); return;
  2956. }
  2957. #endif
  2958. #endif
  2959. #endif
  2960. UINT nID = 3;
  2961. LPSTR pName;
  2962. pName = (LPSTR)(LPCSTR)"转介绍返现";
  2963. OPEN_MENU(Card2RegBlue);
  2964. return;
  2965. }
  2966. else if (strMsg == "转介绍图表")
  2967. {
  2968. #ifndef ENTERPRISE_VERSION
  2969. #ifndef CHILD_VERSION
  2970. #ifdef BASIC_VERSION
  2971. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2972. {
  2973. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2974. exit(0);return;
  2975. }
  2976. #else
  2977. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2978. {
  2979. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2980. exit(0);return;
  2981. }
  2982. #endif
  2983. #else
  2984. #ifdef BASIC_VERSION
  2985. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2986. {
  2987. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2988. exit(0);return;
  2989. }
  2990. #else
  2991. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2992. {
  2993. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2994. exit(0); return;
  2995. }
  2996. #endif
  2997. #endif
  2998. #else
  2999. #ifndef CHILD_VERSION
  3000. #ifdef BASIC_VERSION
  3001. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3002. {
  3003. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3004. exit(0); return;
  3005. }
  3006. #else
  3007. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3008. {
  3009. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3010. exit(0); return;
  3011. }
  3012. #endif
  3013. #else
  3014. #ifdef BASIC_VERSION
  3015. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3016. {
  3017. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3018. exit(0);return;
  3019. }
  3020. #else
  3021. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3022. {
  3023. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3024. exit(0); return;
  3025. }
  3026. #endif
  3027. #endif
  3028. #endif
  3029. UINT nID = 3;
  3030. LPSTR pName;
  3031. pName = (LPSTR)(LPCSTR)"转介绍图表";
  3032. OPEN_MENU(Card2RegChartBlue);
  3033. return;
  3034. }
  3035. else if (strMsg == "积分设置")
  3036. {
  3037. if (IsHasRightsnew(49) == 0)return;
  3038. MemberSet dlg;
  3039. dlg.DoModal();
  3040. return;
  3041. }
  3042. else if (strMsg == "礼服录入")
  3043. {
  3044. if (IsHasRightsnew(39) == 0)return;
  3045. UINT nID = 3;
  3046. LPSTR pName;
  3047. pName = (LPSTR)(LPCSTR)"礼服录入";
  3048. OPEN_MENU(DressManage);
  3049. return;
  3050. }
  3051. else if (strMsg == "礼服查看")
  3052. {
  3053. #ifndef ENTERPRISE_VERSION
  3054. #ifndef CHILD_VERSION
  3055. #ifdef BASIC_VERSION
  3056. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3057. {
  3058. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3059. exit(0);return;
  3060. }
  3061. #else
  3062. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3063. {
  3064. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3065. exit(0);return;
  3066. }
  3067. #endif
  3068. #else
  3069. #ifdef BASIC_VERSION
  3070. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3071. {
  3072. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3073. exit(0);return;
  3074. }
  3075. #else
  3076. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3077. {
  3078. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3079. exit(0); return;
  3080. }
  3081. #endif
  3082. #endif
  3083. #else
  3084. #ifndef CHILD_VERSION
  3085. #ifdef BASIC_VERSION
  3086. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3087. {
  3088. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3089. exit(0); return;
  3090. }
  3091. #else
  3092. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3093. {
  3094. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3095. exit(0); return;
  3096. }
  3097. #endif
  3098. #else
  3099. #ifdef BASIC_VERSION
  3100. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3101. {
  3102. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3103. exit(0);return;
  3104. }
  3105. #else
  3106. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3107. {
  3108. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3109. exit(0); return;
  3110. }
  3111. #endif
  3112. #endif
  3113. #endif
  3114. if (IsHasRightsnew(40) == 0)return;
  3115. UINT nID = 3;
  3116. LPSTR pName;
  3117. pName = (LPSTR)(LPCSTR)"礼服查看";
  3118. OPEN_MENU(ShowDress);
  3119. return;
  3120. }
  3121. else if (strMsg == "撞期预警")
  3122. {
  3123. UINT nID = 3;
  3124. LPSTR pName;
  3125. pName = (LPSTR)(LPCSTR)"撞期预警";
  3126. OPEN_MENU(DressEarlyWarning);
  3127. return;
  3128. }
  3129. else if (strMsg == "礼服出租")
  3130. {
  3131. UINT nID = 3;
  3132. LPSTR pName;
  3133. pName = (LPSTR)(LPCSTR)"礼服出租";
  3134. OPEN_MENU(ShowHireReg);
  3135. return;
  3136. }
  3137. else if (strMsg == "礼服图片")
  3138. {
  3139. ShowPic dlg;
  3140. dlg.m_mode = 4;
  3141. dlg.m_path = g_path5 + "\\";
  3142. dlg.DoModal();
  3143. return;
  3144. }
  3145. else if (strMsg == "商品类别设置")
  3146. {
  3147. if (IsHasRightsnew(29) == 0)return;
  3148. SPLBDlg dlg;
  3149. dlg.DoModal();
  3150. return;
  3151. }
  3152. else if (strMsg == "商品名称设置")
  3153. {
  3154. if (IsHasRightsnew(29) == 0)return;
  3155. UINT nID = 3;
  3156. LPSTR pName;
  3157. pName = (LPSTR)(LPCSTR)"商品设置";
  3158. OPEN_MENU(ShangPin);
  3159. return;
  3160. }
  3161. else if (strMsg == "固定资产管理")
  3162. {
  3163. UINT nID = 3;
  3164. LPSTR pName;
  3165. pName = (LPSTR)(LPCSTR)"固定资产管理";
  3166. OPEN_MENU(FixedAssets);
  3167. return;
  3168. }
  3169. else if (strMsg == "入库单")
  3170. {
  3171. if (IsHasRightsnew(44) == 0)return;
  3172. InputGoods dlg;
  3173. dlg.DoModal();
  3174. return;
  3175. }
  3176. else if (strMsg == "出库单")
  3177. {
  3178. #ifndef ENTERPRISE_VERSION
  3179. #ifndef CHILD_VERSION
  3180. #ifdef BASIC_VERSION
  3181. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3182. {
  3183. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3184. exit(0);return;
  3185. }
  3186. #else
  3187. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3188. {
  3189. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3190. exit(0);return;
  3191. }
  3192. #endif
  3193. #else
  3194. #ifdef BASIC_VERSION
  3195. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3196. {
  3197. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3198. exit(0);return;
  3199. }
  3200. #else
  3201. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3202. {
  3203. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3204. exit(0); return;
  3205. }
  3206. #endif
  3207. #endif
  3208. #else
  3209. #ifndef CHILD_VERSION
  3210. #ifdef BASIC_VERSION
  3211. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3212. {
  3213. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3214. exit(0); return;
  3215. }
  3216. #else
  3217. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3218. {
  3219. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3220. exit(0); return;
  3221. }
  3222. #endif
  3223. #else
  3224. #ifdef BASIC_VERSION
  3225. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3226. {
  3227. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3228. exit(0);return;
  3229. }
  3230. #else
  3231. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3232. {
  3233. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3234. exit(0); return;
  3235. }
  3236. #endif
  3237. #endif
  3238. #endif
  3239. if (IsHasRightsnew(45) == 0)return;
  3240. InputGoods dlg;
  3241. dlg.m_mode = 1;
  3242. dlg.DoModal();
  3243. return;
  3244. }
  3245. else if (strMsg == "库存查询")
  3246. {
  3247. #ifndef ENTERPRISE_VERSION
  3248. #ifndef CHILD_VERSION
  3249. #ifdef BASIC_VERSION
  3250. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3251. {
  3252. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3253. exit(0);return;
  3254. }
  3255. #else
  3256. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3257. {
  3258. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3259. exit(0);return;
  3260. }
  3261. #endif
  3262. #else
  3263. #ifdef BASIC_VERSION
  3264. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3265. {
  3266. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3267. exit(0);return;
  3268. }
  3269. #else
  3270. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3271. {
  3272. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3273. exit(0); return;
  3274. }
  3275. #endif
  3276. #endif
  3277. #else
  3278. #ifndef CHILD_VERSION
  3279. #ifdef BASIC_VERSION
  3280. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3281. {
  3282. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3283. exit(0); return;
  3284. }
  3285. #else
  3286. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3287. {
  3288. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3289. exit(0); return;
  3290. }
  3291. #endif
  3292. #else
  3293. #ifdef BASIC_VERSION
  3294. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3295. {
  3296. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3297. exit(0);return;
  3298. }
  3299. #else
  3300. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3301. {
  3302. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3303. exit(0); return;
  3304. }
  3305. #endif
  3306. #endif
  3307. #endif
  3308. UINT nID = 3;
  3309. LPSTR pName;
  3310. pName = (LPSTR)(LPCSTR)"库存查询";
  3311. OPEN_MENU(ShowGoods);
  3312. return;
  3313. }
  3314. else if (strMsg == "商品图表")
  3315. {
  3316. UINT nID = 3;
  3317. LPSTR pName;
  3318. pName = (LPSTR)(LPCSTR)"商品图表";
  3319. OPEN_MENU(StoreInfoChart);
  3320. return;
  3321. }
  3322. else if (strMsg == "成本核算")
  3323. {
  3324. UINT nID = 3;
  3325. LPSTR pName;
  3326. pName = (LPSTR)(LPCSTR)"成本核算";
  3327. OPEN_MENU(CostCal);
  3328. return;
  3329. }
  3330. else if (strMsg == "考勤记录")
  3331. {
  3332. UINT nID = 3;
  3333. LPSTR pName;
  3334. pName = (LPSTR)(LPCSTR)"考勤记录";
  3335. OPEN_MENU(LoginReg);
  3336. return;
  3337. }
  3338. else if (strMsg == "月统计")
  3339. {
  3340. UINT nID = 3;
  3341. LPSTR pName;
  3342. pName = (LPSTR)(LPCSTR)"月统计";
  3343. OPEN_MENU(LoginReg2);
  3344. return;
  3345. }
  3346. else if (strMsg == "时间设置")
  3347. {
  3348. if (IsHasRightsnew(21) == 0)return;
  3349. SetLoginTime dlg;
  3350. dlg.DoModal();
  3351. return;
  3352. }
  3353. else if (strMsg == "排班设置")
  3354. {
  3355. if (IsHasRightsnew(21) == 0)return;
  3356. SetLoginBan dlg;
  3357. dlg.DoModal();
  3358. return;
  3359. }
  3360. else if (strMsg == "意向查询")
  3361. {
  3362. UINT nID = 3;
  3363. LPSTR pName;
  3364. pName = (LPSTR)(LPCSTR)"意向查询";
  3365. OPEN_MENU(HospitalClient);
  3366. return;
  3367. }
  3368. else if (strMsg == "今日提醒")
  3369. {
  3370. UINT nID = 3;
  3371. LPSTR pName;
  3372. pName = (LPSTR)(LPCSTR)"今日提醒";
  3373. OPEN_MENU(HospitalClientAlarm);
  3374. return;
  3375. }
  3376. else if (strMsg == "跟踪短信")
  3377. {
  3378. UINT nID = 3;
  3379. LPSTR pName;
  3380. pName = (LPSTR)(LPCSTR)"跟踪短信";
  3381. OPEN_MENU(HospitalClientMsg);
  3382. return;
  3383. }
  3384. else if (strMsg == "意向单录入")
  3385. {
  3386. AddHospitalClient dlg;
  3387. dlg.DoModal();
  3388. return;
  3389. }
  3390. else if (strMsg == "资料设置")
  3391. {
  3392. HospitalInfoSet dlg;
  3393. dlg.DoModal();
  3394. return;
  3395. }
  3396. AfxMessageBox(strMsg + ",开发中...");
  3397. }
  3398. // Jeff.当版本号不一致时,调用AutoUpdate.exe来升级YLGL.exe
  3399. void CMainFrame::AutoUpdate()
  3400. {
  3401. if (g_bBranchModify)
  3402. {
  3403. AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
  3404. return;
  3405. }
  3406. else if (g_branchname != "")
  3407. {
  3408. AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
  3409. return;
  3410. }
  3411. g_ntimeout = 30000;
  3412. if (!::PathFileExists(g_mainpath + "\\AutoUpdate.exe"))
  3413. {
  3414. g_sendhead.bsql = 0;
  3415. g_sendhead.code[0] = 99;
  3416. g_sendhead.tabcount = 1;
  3417. g_pMainWnd->ProcessChatMessageRequest2(99);
  3418. if (g_bSendOK == 0)
  3419. goto failed;
  3420. CFile fp;
  3421. fp.Open(g_mainpath + "\\AutoUpdate.exe", CFile::modeWrite | CFile::modeCreate);
  3422. fp.Write(g_pData, g_nLeng);
  3423. fp.Close();
  3424. }
  3425. {
  3426. ::DeleteFile(g_mainpath + "\\YLGL2.exe"); // 删除ylgl.exe;
  3427. g_sendhead.bsql = 0;
  3428. g_sendhead.code[0] = 98;
  3429. g_sendhead.tabcount = 1;
  3430. g_pMainWnd->ProcessChatMessageRequest2(99); if (g_bSendOK == 0)goto failed;
  3431. CFile fp;
  3432. fp.Open(g_mainpath + "\\YLGL2.exe", CFile::modeWrite | CFile::modeCreate);
  3433. fp.Write(g_pData, g_nLeng);
  3434. fp.Close();
  3435. }
  3436. AfxMessageBox("自动升级成功!", MB_ICONINFORMATION);
  3437. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\AutoUpdate.exe"), "12345", NULL, SW_SHOWNORMAL);
  3438. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3439. exit(0);
  3440. return;
  3441. failed:
  3442. AfxMessageBox("自动升级失败!", MB_ICONINFORMATION);
  3443. if (g_ntimeout == 30000)//非远程
  3444. {
  3445. AfxMessageBox("提醒:升级过程中需要传输较多的数据,如果网速慢可能导致远程升级失败!\r\n\
  3446. 可拷贝店内客户端用QQ传过来覆盖除dbconfig.dat的文件即可。", MB_ICONINFORMATION);
  3447. }
  3448. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3449. }
  3450. void CMainFrame::Onchoosephotoskin() //Jeff:此机用于选片菜单项;不在使用2014.06.16
  3451. {
  3452. if (g_user.bLongin == 0)
  3453. {
  3454. if (g_bNoLoginLia)
  3455. {
  3456. Login dlg;
  3457. dlg.SetLiaPath("5.lia");
  3458. dlg.DoModal();
  3459. }
  3460. else
  3461. {
  3462. Login3 dlg;
  3463. dlg.SetLiaPath("5.lia");
  3464. dlg.DoModal();
  3465. }
  3466. if (g_user.bLongin == 0)return;
  3467. }
  3468. // TODO: Add your command handler code here
  3469. CString version = _T("Version 1.0");
  3470. CMenu *pMenu = GetMenu();
  3471. CMenu* submenu = pMenu->GetSubMenu(1);
  3472. UINT status = submenu->GetMenuState(IDM_choosephotoskin, MF_BYCOMMAND);
  3473. if (status&MF_CHECKED)
  3474. {
  3475. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_UNCHECKED);
  3476. AfxGetApp()->WriteProfileInt(version, "status", 0);
  3477. }
  3478. else
  3479. {
  3480. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  3481. AfxGetApp()->WriteProfileInt(version, "status", 1);
  3482. }
  3483. }
  3484. /*BOOL g_bInSkin = 0;*/
  3485. BOOL CMainFrame::IsCtrlDown()
  3486. {
  3487. short state = GetKeyState(VK_LCONTROL);
  3488. BYTE sta = (BYTE)(state >> 8);
  3489. state = GetKeyState(VK_RCONTROL);
  3490. BYTE sta2 = (BYTE)(state >> 8);
  3491. if (sta || sta2)
  3492. return 1;
  3493. else
  3494. return 0;
  3495. }//IsShiftDown
  3496. BOOL CMainFrame::IsShiftDown()
  3497. {
  3498. short state = GetKeyState(VK_LSHIFT);
  3499. BYTE sta = (BYTE)(state >> 8);
  3500. state = GetKeyState(VK_RSHIFT);
  3501. BYTE sta2 = (BYTE)(state >> 8);
  3502. if (sta || sta2)
  3503. return 1;
  3504. else
  3505. return 0;
  3506. }
  3507. BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
  3508. {
  3509. // TODO: Add your specialized code here and/or call the base class IDM_Logout
  3510. if (pMsg->message == WM_KEYDOWN)
  3511. {
  3512. switch (pMsg->wParam)
  3513. {
  3514. case VK_F12:
  3515. g_pMainWnd->OnCommandMenu(IDM_Logout);
  3516. return 1;
  3517. case VK_F1:
  3518. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  3519. return 1;
  3520. case VK_F2: // 此机用于选片和选设计;
  3521. {
  3522. if (g_pMainWnd->m_bCheckF2F3 && (IsShiftDown() == 0 || IsCtrlDown() == 0))return 1;
  3523. m_Mdi.MainClose();
  3524. if (g_user.bLongin)
  3525. {
  3526. SearchClient dlg;
  3527. dlg.SetLiaPath("2.lia");
  3528. if (dlg.DoModal() != IDOK)
  3529. {
  3530. if (dlg.m_bLogout)
  3531. {
  3532. g_user.bLongin = 0;
  3533. g_user.name.Empty();
  3534. g_user.rights.Empty();
  3535. g_user.account.Empty();
  3536. goto ll;
  3537. }
  3538. PostMessage(WM_QUIT);
  3539. return 1;
  3540. }
  3541. if (dlg.m_exitcode == 3)
  3542. {
  3543. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3544. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3545. }
  3546. else
  3547. {
  3548. ShowWindow(SW_SHOW);
  3549. #ifdef NEW_SKIN
  3550. if (m_pMainFrimDlg2 == NULL)
  3551. {
  3552. m_pMainFrimDlg2 = new MainFrimDlg2;
  3553. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3554. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3555. }
  3556. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3557. g_bInSkin = 0;
  3558. #endif
  3559. }
  3560. }
  3561. else
  3562. {
  3563. ll:
  3564. ChoosePhotoSkin dlg;
  3565. dlg.SetLiaPath("1.lia");
  3566. if (dlg.DoModal() != IDOK)
  3567. {
  3568. PostMessage(WM_QUIT);
  3569. return 1;
  3570. }
  3571. if (dlg.m_exitcode == 3)
  3572. {
  3573. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3574. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3575. }
  3576. else
  3577. {
  3578. ShowWindow(SW_SHOW);
  3579. #ifdef NEW_SKIN
  3580. if (m_pMainFrimDlg2 == NULL)
  3581. {
  3582. m_pMainFrimDlg2 = new MainFrimDlg2;
  3583. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3584. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3585. }
  3586. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3587. g_bInSkin = 0;
  3588. #endif
  3589. }
  3590. }
  3591. }
  3592. return 1;
  3593. case VK_F3: // 此机用于选片和选设计;
  3594. {
  3595. if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
  3596. m_Mdi.MainClose();
  3597. if (g_user.bLongin)
  3598. {
  3599. SearchClient dlg;
  3600. dlg.m_mode = 1;
  3601. dlg.SetLiaPath("2.lia");
  3602. if (dlg.DoModal() != IDOK)
  3603. {
  3604. if (dlg.m_bLogout)
  3605. {
  3606. g_user.bLongin = 0;
  3607. g_user.name.Empty();
  3608. g_user.rights.Empty();
  3609. g_user.account.Empty();
  3610. goto mm;
  3611. }
  3612. PostMessage(WM_QUIT);
  3613. return 1;
  3614. }
  3615. if (dlg.m_exitcode == 2)
  3616. {
  3617. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3618. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3619. }
  3620. else
  3621. {
  3622. ShowWindow(SW_SHOW);
  3623. #ifdef NEW_SKIN
  3624. if (m_pMainFrimDlg2 == NULL)
  3625. {
  3626. m_pMainFrimDlg2 = new MainFrimDlg2;
  3627. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3628. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3629. }
  3630. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3631. g_bInSkin = 0;
  3632. #endif
  3633. }
  3634. }
  3635. else
  3636. {
  3637. mm:
  3638. ChoosePhotoSkin dlg;
  3639. dlg.m_mode = 1;
  3640. dlg.SetLiaPath("1.lia");
  3641. if (dlg.DoModal() != IDOK)
  3642. {
  3643. PostMessage(WM_QUIT);
  3644. return 1;
  3645. }
  3646. if (dlg.m_exitcode == 2)
  3647. {
  3648. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3649. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3650. }
  3651. else
  3652. {
  3653. ShowWindow(SW_SHOW);
  3654. #ifdef NEW_SKIN
  3655. if (m_pMainFrimDlg2 == NULL)
  3656. {
  3657. m_pMainFrimDlg2 = new MainFrimDlg2;
  3658. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3659. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3660. }
  3661. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3662. g_bInSkin = 0;
  3663. #endif
  3664. }
  3665. }
  3666. }
  3667. return 1;
  3668. //#if 0 // 2015-05-30 禁用F11功能;
  3669. // case VK_F11:
  3670. // if (g_bInSkin)return 1;
  3671. // if (g_user.bLongin)
  3672. // {
  3673. // SqlDlg dlg;
  3674. // dlg.DoModal();
  3675. // }
  3676. // break;
  3677. //#endif
  3678. #ifdef LYFZ_VERSION
  3679. case VK_F4:
  3680. if (g_user.bLongin)
  3681. {
  3682. g_sendhead.bsql=0;
  3683. g_sendhead.code[0]=199;
  3684. g_sendhead.tabcount=1;
  3685. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return 0;
  3686. DataToArray(&g_List1array);
  3687. CStdioFile fp;
  3688. CString path=g_mainpath+"\\NullBalance.txt";
  3689. ::DeleteFile (path); // 删除NullBalance.txt;
  3690. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  3691. CString str;
  3692. for(int i=0; i<g_List1array.GetSize (); i++)
  3693. {
  3694. for(int j=0; j<g_List1array.ElementAt (0).GetSize (); j++)
  3695. {
  3696. str=g_List1array.ElementAt (0).ElementAt (j)+"\n";
  3697. str.TrimLeft ();
  3698. fp.WriteString (str);
  3699. }
  3700. }
  3701. fp.Close ();
  3702. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  3703. }
  3704. break;
  3705. #endif
  3706. }
  3707. }
  3708. return CMDIFrameWnd::PreTranslateMessage(pMsg);
  3709. }
  3710. void CMainFrame::GetSkin()
  3711. {
  3712. return;
  3713. #ifdef MNLS_VERSION
  3714. if (::PathFileExists(g_mainpath + "\\skin\\4.lia"))
  3715. {
  3716. CFile fp;
  3717. fp.Open(g_mainpath + "\\skin\\4.lia", CFile::modeRead);
  3718. DWORD leng=fp.GetLength ();
  3719. fp.Close ();
  3720. if(leng!=194987)
  3721. ::DeleteFile (g_mainpath+"\\skin\\4.lia"); // 删除4.lia
  3722. }
  3723. if(!::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3724. {
  3725. ::CreateDirectory (g_mainpath+"\\skin", NULL);
  3726. g_sendhead.bsql=0;
  3727. g_sendhead.code[0]=100;
  3728. g_sendhead.tabcount=1;
  3729. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  3730. CFile fp;
  3731. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeWrite|CFile::modeCreate);
  3732. fp.Write (g_pData, g_nLeng);
  3733. fp.Close ();
  3734. }
  3735. #endif
  3736. }
  3737. void AutoDraw(CPrintRX &m_Print, CRect &StrRect, CString &str, float fscale)
  3738. {
  3739. CString tempbz, temp;
  3740. BOOL bRun = 0;
  3741. CSize size;
  3742. int fontsize = 12;
  3743. int i = 0;
  3744. ll: tempbz = str;
  3745. i = 0;
  3746. m_Print.SetFontFace(fontsize, 1, "宋体");
  3747. while (1)
  3748. {
  3749. if (!tempbz.IsEmpty())
  3750. {
  3751. temp = tempbz;
  3752. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3753. int right = 0;
  3754. CRect temprc = StrRect;
  3755. temprc.top += i*(fontsize*fscale); i++;
  3756. temprc.bottom = temprc.top + fontsize;
  3757. if (temprc.bottom > StrRect.bottom)break;
  3758. while (size.cx > temprc.Width())
  3759. {
  3760. right++;
  3761. temp = tempbz.Left(tempbz.GetLength() - (right));
  3762. if (GIsHalfHZ(temp))
  3763. {
  3764. right++;
  3765. temp.Delete(temp.GetLength() - 1);
  3766. }
  3767. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3768. }
  3769. if (temp.Find("\r\n") != -1)
  3770. {
  3771. temp = temp.Left(temp.Find("\r\n"));//i++;
  3772. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength() - 2);
  3773. }
  3774. else
  3775. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
  3776. if (bRun)
  3777. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, temprc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3778. }
  3779. else
  3780. break;
  3781. }
  3782. if (tempbz.IsEmpty() == 0)
  3783. {
  3784. fontsize--;
  3785. goto ll;
  3786. }
  3787. if (bRun == 0)
  3788. {
  3789. bRun = 1;
  3790. goto ll;
  3791. }
  3792. }
  3793. void CMainFrame::PrintDinDan3(CString strOrderNumber)
  3794. {
  3795. // TODO: Add your control notification handler code here
  3796. CPrintRX m_Print;
  3797. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  3798. {
  3799. m_Print.InitToPrint(NULL, 1);
  3800. }
  3801. else
  3802. {
  3803. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  3804. if (name.IsEmpty())
  3805. m_Print.InitToPrint(NULL, 1);
  3806. else
  3807. {
  3808. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  3809. if (nret == -1)
  3810. {
  3811. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  3812. }
  3813. }
  3814. }
  3815. m_Print.StartPrint();
  3816. m_Print.StartPage();
  3817. LoadRect load;
  3818. load.SetLiaPath("11.lia");
  3819. load.SetMargins(0, 0);
  3820. if (!load.Load())return;
  3821. LoadRect load2;
  3822. load2.SetLiaPath("12.lia");
  3823. load2.SetMargins(0, 0);
  3824. if (!load2.Load())return;
  3825. LoadRect load3;
  3826. load3.SetLiaPath("13.lia");
  3827. load3.SetMargins(-6, 520);
  3828. if (!load3.Load())return;
  3829. int i;
  3830. //////////////////////////////////////////////////////////////
  3831. CStringArray txarray;
  3832. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "'";
  3833. g_sendhead.code[0] = 11;
  3834. g_sendhead.code[1] = 52;
  3835. g_sendhead.code[2] = 50;
  3836. g_sendhead.code[3] = 150;
  3837. g_sendhead.tabcount = 4;
  3838. g_sendhead.bsql = 0;
  3839. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  3840. CArray<CStringArray, CStringArray>sparray;
  3841. CArray<CStringArray, CStringArray>clientarray;
  3842. CArray<CStringArray, CStringArray>jdarray;
  3843. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray);
  3844. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  3845. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  3846. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  3847. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  3848. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  3849. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
  3850. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  3851. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  3852. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  3853. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  3854. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  3855. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  3856. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  3857. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  3858. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  3859. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  3860. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  3861. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  3862. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  3863. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  3864. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  3865. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  3866. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  3867. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  3868. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  3869. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  3870. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  3871. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  3872. CString m_bz = "其它要求: " + g_List1array.ElementAt(0).ElementAt(38);
  3873. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  3874. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  3875. if (IsHasRights2new(31) == 0)
  3876. {
  3877. m_phone1 = "***";
  3878. m_phone2 = "***";
  3879. }
  3880. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  3881. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  3882. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  3883. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  3884. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  3885. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  3886. CString m_addr = m_addr1 + ";";
  3887. m_addr.TrimLeft(";");
  3888. m_addr += m_addr2;
  3889. CString m_qq = m_qq1 + ";";
  3890. m_qq.TrimLeft(";");
  3891. m_qq += m_qq2;
  3892. CString m_jd;
  3893. for (i = 0; i < jdarray.GetSize(); i++)
  3894. {
  3895. m_jd += jdarray.ElementAt(i).ElementAt(1);
  3896. m_jd += ";";
  3897. }
  3898. m_jd.TrimRight(";");
  3899. m_money1.Format("%f", atof(m_taoxijiage));
  3900. m_money2.Format("%f", atof(m_payed1));
  3901. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  3902. ConvertToPrice(m_money1);
  3903. ConvertToPrice(m_money2);
  3904. ConvertToPrice(m_money3);
  3905. ////////////////////////////////////////////////////////////////
  3906. int rcpos = -1;
  3907. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  3908. m_Print.SetFontFace(17, 1, "宋体");
  3909. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3910. StrRect.top -= 0;
  3911. StrRect.bottom -= 10;
  3912. StrRect.left -= 140;
  3913. StrRect.right = StrRect.left + 48;
  3914. m_Print.SetFontFace(15, 1, "宋体");
  3915. m_Print.SetColor(0xffffff);
  3916. m_Print.DrawRect(StrRect, 0);
  3917. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3918. StrRect.left = StrRect.right;
  3919. StrRect.right = StrRect.left + 48;
  3920. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  3921. m_Print.SetColor(0, RGB(255, 0, 0));
  3922. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3923. m_Print.SetColor(0);
  3924. m_Print.SetFontFace(12, 1, "宋体");
  3925. StrRect.left -= 48;
  3926. int hei = StrRect.Height();
  3927. StrRect.top = StrRect.bottom + 2;
  3928. StrRect.bottom += hei + 2;
  3929. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3930. StrRect.top = StrRect.bottom - 2;
  3931. StrRect.bottom += hei - 5;
  3932. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  3933. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3934. m_Print.SetFontFace(12, 1, "宋体");
  3935. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3936. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3937. m_Print.SetFontFace(11, 1, "宋体");
  3938. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3939. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3940. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3941. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3942. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3943. m_Print.DrawRect2(StrRect, 2);
  3944. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3945. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3946. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3947. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3948. m_Print.DrawRect2(StrRect, 2);
  3949. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3950. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3951. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3952. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3953. m_Print.DrawRect2(StrRect, 2);
  3954. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3955. m_Print.DrawText((LPTSTR)(LPCTSTR)"约单时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3956. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3957. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3958. m_Print.DrawRect2(StrRect, 2);
  3959. ////////////
  3960. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3961. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3962. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3963. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3964. m_Print.DrawRect2(StrRect, 2);
  3965. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3966. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3967. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3968. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3969. m_Print.DrawRect2(StrRect, 2);
  3970. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3971. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3972. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3973. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3974. m_Print.DrawRect2(StrRect, 2);
  3975. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3976. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3977. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3978. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3979. m_Print.DrawRect2(StrRect, 2);
  3980. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3981. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3982. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3983. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3984. m_Print.DrawRect2(StrRect, 2);
  3985. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3986. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/邮箱:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3987. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3988. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3989. m_Print.DrawRect2(StrRect, 2);
  3990. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3991. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系金额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3992. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3993. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3994. m_Print.DrawRect2(StrRect, 2);
  3995. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3996. m_Print.DrawText((LPTSTR)(LPCTSTR)"定金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3997. StrRect = load.m_rcarray.ElementAt(++rcpos);
  3998. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3999. m_Print.DrawRect2(StrRect, 2);
  4000. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4001. m_Print.DrawText((LPTSTR)(LPCTSTR)"余额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4002. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4003. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4004. m_Print.DrawRect2(StrRect, 2);
  4005. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4006. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4007. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4008. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4009. m_Print.DrawRect2(StrRect, 2);
  4010. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4011. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍摄景点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4012. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4013. m_Print.DrawText((LPTSTR)(LPCTSTR)m_jd, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4014. m_Print.DrawRect2(StrRect, 2);
  4015. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4016. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容提供: 男士服装:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4017. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4018. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4019. m_Print.DrawRect2(StrRect, 2);
  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)m_clothescount2, StrRect, 0, 0, FORMAT_HCENTER | 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)"套系内提供拍摄区服装/头饰造型", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4031. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4032. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4033. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4034. m_Print.DrawText((LPTSTR)(LPCTSTR)" ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4035. m_Print.DrawRect2(StrRect, 2);
  4036. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4037. m_Print.DrawText((LPTSTR)(LPCTSTR)"专业数码拍摄:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4038. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4039. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside2, 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. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4044. m_Print.DrawText((LPTSTR)(LPCTSTR)"(JPG格式数据)", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4045. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4046. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内赠送:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4047. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4048. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_List1array.ElementAt(0).ElementAt(9)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4049. m_Print.DrawRect2(StrRect, 2);
  4050. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4051. m_Print.DrawText((LPTSTR)(LPCTSTR)"张设计排版精修入册", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4052. //////////////////////load2
  4053. rcpos = -1;
  4054. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4055. m_Print.DrawText((LPTSTR)(LPCTSTR)"原始数据套系内张数JPG格式光盘壹只", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4056. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4057. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4058. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4059. // m_Print.DrawText((LPTSTR)(LPCTSTR)"", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4060. // AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4061. m_Print.DrawRect2(StrRect, 2);
  4062. m_Print.SetFontFace(11, 1, "宋体");
  4063. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4064. m_Print.DrawText((LPTSTR)(LPCTSTR)"客人产品:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4065. int rowcount = sparray.GetSize() / 8;
  4066. int needaddrow = 0;
  4067. while (sparray.GetSize() > rowcount * 8 + needaddrow)
  4068. needaddrow++;
  4069. int pos = 0;
  4070. CString str = "";
  4071. int addcount = 0;
  4072. if (needaddrow > 0)
  4073. addcount = 1;
  4074. else
  4075. addcount = 0;
  4076. needaddrow--;
  4077. str.Empty();
  4078. for (i = 0; i < rowcount + addcount; i++)
  4079. {
  4080. str += sparray.ElementAt(pos).ElementAt(5);
  4081. str += " 数量:";
  4082. str += sparray.ElementAt(pos).ElementAt(3);
  4083. str += ";";
  4084. pos++;
  4085. }
  4086. StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
  4087. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4088. m_Print.DrawRect2(StrRect, 2);
  4089. StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
  4090. if (needaddrow > 0)
  4091. addcount = 1;
  4092. else
  4093. addcount = 0;
  4094. needaddrow--;
  4095. str.Empty();
  4096. for (i = 0; i < rowcount + addcount; i++)
  4097. {
  4098. str += sparray.ElementAt(pos).ElementAt(5);
  4099. str += " 数量:";
  4100. str += sparray.ElementAt(pos).ElementAt(3);
  4101. str += ";";
  4102. pos++;
  4103. }
  4104. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4105. m_Print.DrawRect2(StrRect, 2);
  4106. StrRect = load2.m_rcarray.ElementAt(++rcpos);//7
  4107. if (needaddrow > 0)
  4108. addcount = 1;
  4109. else
  4110. addcount = 0;
  4111. needaddrow--;
  4112. str.Empty();
  4113. for (i = 0; i < rowcount + addcount; i++)
  4114. {
  4115. str += sparray.ElementAt(pos).ElementAt(5);
  4116. str += " 数量:";
  4117. str += sparray.ElementAt(pos).ElementAt(3);
  4118. str += ";";
  4119. pos++;
  4120. }
  4121. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4122. m_Print.DrawRect2(StrRect, 2);
  4123. StrRect = load2.m_rcarray.ElementAt(++rcpos);//8
  4124. if (needaddrow > 0)
  4125. addcount = 1;
  4126. else
  4127. addcount = 0;
  4128. needaddrow--;
  4129. str.Empty();
  4130. for (i = 0; i < rowcount + addcount; i++)
  4131. {
  4132. str += sparray.ElementAt(pos).ElementAt(5);
  4133. str += " 数量:";
  4134. str += sparray.ElementAt(pos).ElementAt(3);
  4135. str += ";";
  4136. pos++;
  4137. }
  4138. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4139. m_Print.DrawRect2(StrRect, 2);
  4140. StrRect = load2.m_rcarray.ElementAt(++rcpos);//9
  4141. if (needaddrow > 0)
  4142. addcount = 1;
  4143. else
  4144. addcount = 0;
  4145. needaddrow--;
  4146. str.Empty();
  4147. for (i = 0; i < rowcount + addcount; i++)
  4148. {
  4149. str += sparray.ElementAt(pos).ElementAt(5);
  4150. str += " 数量:";
  4151. str += sparray.ElementAt(pos).ElementAt(3);
  4152. str += ";";
  4153. pos++;
  4154. }
  4155. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4156. m_Print.DrawRect2(StrRect, 2);
  4157. StrRect = load2.m_rcarray.ElementAt(++rcpos);//10
  4158. if (needaddrow > 0)
  4159. addcount = 1;
  4160. else
  4161. addcount = 0;
  4162. needaddrow--;
  4163. str.Empty();
  4164. for (i = 0; i < rowcount + addcount; i++)
  4165. {
  4166. str += sparray.ElementAt(pos).ElementAt(5);
  4167. str += " 数量:";
  4168. str += sparray.ElementAt(pos).ElementAt(3);
  4169. str += ";";
  4170. pos++;
  4171. }
  4172. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4173. m_Print.DrawRect2(StrRect, 2);
  4174. StrRect = load2.m_rcarray.ElementAt(++rcpos);//11
  4175. if (needaddrow > 0)
  4176. addcount = 1;
  4177. else
  4178. addcount = 0;
  4179. needaddrow--;
  4180. str.Empty();
  4181. for (i = 0; i < rowcount + addcount; i++)
  4182. {
  4183. str += sparray.ElementAt(pos).ElementAt(5);
  4184. str += " 数量:";
  4185. str += sparray.ElementAt(pos).ElementAt(3);
  4186. str += ";";
  4187. pos++;
  4188. }
  4189. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4190. m_Print.DrawRect2(StrRect, 2);
  4191. StrRect = load2.m_rcarray.ElementAt(++rcpos);//12
  4192. if (needaddrow > 0)
  4193. addcount = 1;
  4194. else
  4195. addcount = 0;
  4196. needaddrow--;
  4197. str.Empty();
  4198. for (i = 0; i < rowcount + addcount; i++)
  4199. {
  4200. str += sparray.ElementAt(pos).ElementAt(5);
  4201. str += " 数量:";
  4202. str += sparray.ElementAt(pos).ElementAt(3);
  4203. str += ";";
  4204. pos++;
  4205. }
  4206. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4207. m_Print.DrawRect2(StrRect, 2);
  4208. /* StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4209. if(needaddrow>0)
  4210. addcount=1;
  4211. else
  4212. addcount=0;
  4213. needaddrow--;
  4214. str.Empty ();
  4215. for( i=0; i<rowcount+addcount; i++)
  4216. {
  4217. str+=sparray.ElementAt (pos).ElementAt (5);
  4218. str+=" 数量:";
  4219. str+=sparray.ElementAt (pos).ElementAt (3);
  4220. str+=";";
  4221. pos++;
  4222. }
  4223. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4224. m_Print.DrawRect2(StrRect, 2);
  4225. StrRect=load2.m_rcarray .ElementAt (++rcpos);//14
  4226. if(needaddrow>0)
  4227. addcount=1;
  4228. else
  4229. addcount=0;
  4230. needaddrow--;
  4231. str.Empty ();
  4232. for( i=0; i<rowcount+addcount; i++)
  4233. {
  4234. str+=sparray.ElementAt (pos).ElementAt (5);
  4235. str+=" 数量:";
  4236. str+=sparray.ElementAt (pos).ElementAt (3);
  4237. str+=";";
  4238. pos++;
  4239. }
  4240. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4241. m_Print.DrawRect2(StrRect, 2);*/
  4242. CRect sprc[2];
  4243. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4244. // AutoDraw(m_Print, StrRect, m_bz.Left (leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4245. m_Print.DrawRect2(StrRect, 2);
  4246. sprc[0] = StrRect;
  4247. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4248. // AutoDraw(m_Print, StrRect, m_bz.Right (leng-leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4249. m_Print.DrawRect2(StrRect, 2);
  4250. sprc[1] = StrRect;
  4251. //AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4252. {
  4253. CString temp, tempspno, tempbz;
  4254. CSize size;
  4255. BOOL bRun = 0;
  4256. int fontsize = 12;
  4257. ll: tempspno = m_bz;
  4258. m_Print.SetFontFace(fontsize, 1, "宋体");
  4259. for (i = 0; i<2; i++)
  4260. {
  4261. if (!tempspno.IsEmpty())
  4262. {
  4263. temp = tempspno;
  4264. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4265. int right = 0;
  4266. CRect temprc = sprc[i];
  4267. while (size.cx>temprc.Width())
  4268. {
  4269. right++;
  4270. temp = tempspno.Left(tempspno.GetLength() - (right));
  4271. if (GIsHalfHZ(temp))
  4272. {
  4273. right++;
  4274. temp.Delete(temp.GetLength() - 1);
  4275. }
  4276. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4277. }
  4278. if (bRun)
  4279. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4280. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  4281. if (tempspno.IsEmpty())i++;
  4282. }
  4283. }
  4284. if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
  4285. {
  4286. fontsize--;
  4287. goto ll;
  4288. }
  4289. if (bRun == 0)
  4290. {
  4291. bRun = 1;
  4292. goto ll;
  4293. }
  4294. }
  4295. m_Print.SetFontFace(11, 1, "宋体");
  4296. //////////////////////load3
  4297. rcpos = -1;
  4298. for (i = 0; i < 24; i++)
  4299. {
  4300. StrRect = load3.m_rcarray.ElementAt(i);
  4301. m_Print.DrawRect2(StrRect, 1);
  4302. }
  4303. CStringArray strarray;
  4304. strarray.Add("营业员");
  4305. strarray.Add("前台接待");
  4306. strarray.Add("化妆师");
  4307. strarray.Add("礼服师");
  4308. strarray.Add("摄影师");
  4309. strarray.Add("摄影助理");
  4310. strarray.Add("美工师");
  4311. strarray.Add("设计师");
  4312. for (i = 0; i < 8; i++)
  4313. {
  4314. StrRect = load3.m_rcarray.ElementAt(i);
  4315. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4316. }
  4317. strarray.RemoveAll();
  4318. strarray.Add(m_ren);
  4319. strarray.Add(g_List1array.ElementAt(0).ElementAt(49));
  4320. strarray.Add(m_waiter2);
  4321. strarray.Add(g_List1array.ElementAt(0).ElementAt(51));
  4322. strarray.Add(m_waiter1);
  4323. strarray.Add(g_List1array.ElementAt(0).ElementAt(50));
  4324. strarray.Add("");
  4325. strarray.Add(m_waiter4);
  4326. for (i = 8; i < 16; i++)
  4327. {
  4328. StrRect = load3.m_rcarray.ElementAt(i);
  4329. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 8), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4330. }
  4331. StrRect = load3.m_rcarray.ElementAt(27);
  4332. m_Print.DrawText((LPTSTR)(LPCTSTR)"客户电话: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4333. StrRect = load3.m_rcarray.ElementAt(28);
  4334. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4335. m_Print.SetFontFace(13, 1, "宋体");
  4336. StrRect = load3.m_rcarray.ElementAt(25);
  4337. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4338. StrRect = load3.m_rcarray.ElementAt(26);
  4339. m_Print.DrawRect2(StrRect, 2);
  4340. StrRect = load3.m_rcarray.ElementAt(24);
  4341. str = "\
  4342. 顾客须知\r\n\
  4343. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  4344. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  4345. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  4346. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  4347. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  4348. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  4349. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  4350. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  4351. AutoDraw(m_Print, StrRect, str, 1.8);
  4352. PrintPreview dlg;
  4353. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4354. dlg.m_pDC = m_Print.GetPDC();
  4355. if (dlg.DoModal() != IDOK)return;
  4356. //结束打印
  4357. m_Print.EndPage();
  4358. m_Print.EndPrint();
  4359. }
  4360. void CMainFrame::PrintDailyForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4361. {
  4362. // TODO: Add your control notification handler code here
  4363. int pages = Listarray->GetSize() / 46;
  4364. if (Listarray->GetSize() % 46)pages++;
  4365. for (int aa = 0; aa < pages; aa++)
  4366. {
  4367. PrintPreview dlg;
  4368. CPrintRX m_Print;
  4369. m_Print.InitToPrint(NULL, 1);
  4370. m_Print.StartPrint();
  4371. m_Print.StartPage();
  4372. CRect mainrc(0, 0, 560, 793);
  4373. float fscale;
  4374. {
  4375. int w, h;
  4376. m_Print.GetWidHei(w, h);
  4377. fscale = (float)w / (float)h;
  4378. }
  4379. mainrc.DeflateRect(25, 40, 10, 0);
  4380. CRect rc, rc2;
  4381. rc = mainrc;
  4382. rc.bottom = rc.top;
  4383. rc.top -= 20;
  4384. m_Print.SetFontFace(16, 1, "黑体");
  4385. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4386. m_Print.SetFontFace(9, 1, "宋体");
  4387. CString str;
  4388. int wid[4] = { 320, 60, 60, 90 };
  4389. int hei = 16;
  4390. if (fscale > 0.71)hei = 15;
  4391. rc = mainrc;
  4392. rc.bottom = rc.top + hei;
  4393. for (int i = 0; i < 47; i++)
  4394. {
  4395. rc2.top = rc.top + i*hei;
  4396. rc2.bottom = rc.bottom + i*hei;
  4397. rc2.left = rc.left;
  4398. rc2.right = rc.left + wid[0];
  4399. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  4400. for (int j = 0; j<4; j++)
  4401. {
  4402. m_Print.DrawRect2(rc2, 1);
  4403. if (Listarray->GetSize()>aa * 46 + i)
  4404. {
  4405. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  4406. rc2.left += 3;
  4407. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4408. rc2.left -= 3;
  4409. }
  4410. rc2.left += wid[j];
  4411. rc2.right = rc2.left + wid[j + 1];
  4412. }
  4413. }
  4414. rc2.top += 2;
  4415. rc2.left += 2; rc2.right = mainrc.right + 4;
  4416. m_Print.SetFontFace(8, 1, "宋体");
  4417. int infopos = info.Find("***");
  4418. if (infopos != -1)
  4419. {
  4420. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Left(infopos), rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4421. CRect rc3 = rc2;
  4422. rc3.top = rc2.bottom - 4;
  4423. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Right(info.GetLength() - infopos - 3), rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4424. }
  4425. else
  4426. m_Print.DrawText((LPTSTR)(LPCTSTR)info, rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4427. str.Format(" 页:%d/%d", aa + 1, pages);
  4428. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4429. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  4430. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4431. dlg.m_pDC = m_Print.GetPDC();
  4432. // dlg.m_mode=1;
  4433. if (aa == 0)
  4434. {
  4435. if (dlg.DoModal() != IDOK)
  4436. return;
  4437. }
  4438. //结束打印
  4439. m_Print.EndPage();
  4440. m_Print.EndPrint();
  4441. }
  4442. }
  4443. void CMainFrame::PrintLoginForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4444. {
  4445. // TODO: Add your control notification handler code here
  4446. int sinlecount = 33 * 6;
  4447. int pages = Listarray->GetSize() / sinlecount;
  4448. if (Listarray->GetSize() % sinlecount)pages++;
  4449. for (int aa = 0; aa < pages; aa++)
  4450. {
  4451. PrintPreview dlg;
  4452. CPrintRX m_Print;
  4453. m_Print.InitToPrint(NULL, 1);
  4454. m_Print.StartPrint();
  4455. m_Print.StartPage();
  4456. CRect mainrc(0, 0, 560, 793);
  4457. float fscale;
  4458. {
  4459. int w, h;
  4460. m_Print.GetWidHei(w, h);
  4461. fscale = (float)w / (float)h;
  4462. }
  4463. mainrc.DeflateRect(25, 40, 10, 0);
  4464. CString str;
  4465. CRect rc, rc2;
  4466. rc = mainrc;
  4467. rc.bottom = rc.top;
  4468. rc.top -= 20;
  4469. rc.left -= 20;
  4470. m_Print.SetFontFace(12, 1, "黑体");
  4471. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4472. m_Print.SetFontFace(6, 1, "宋体");
  4473. str.Format(" 页:%d/%d", aa + 1, pages);
  4474. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4475. rc.right = mainrc.right + 20;
  4476. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4477. int wid[2] = { 50, 110 };
  4478. int hei = 11;
  4479. rc = mainrc;
  4480. rc.bottom = rc.top + hei;
  4481. rc.top += 10;
  4482. rc.bottom += 10;
  4483. int dtx = rc.Width() / 3 + 18;
  4484. int dty = 380;
  4485. for (int j = 0; j < 6; j++)
  4486. {
  4487. if (Listarray->GetSize() < aa*sinlecount + 33 * (j + 1))continue;
  4488. for (int i = 0; i < 33; i++)
  4489. {
  4490. rc2.top = rc.top + i*hei;
  4491. rc2.bottom = rc.bottom + i*hei;
  4492. rc2.left = rc.left;
  4493. rc2.right = rc.left + wid[0];
  4494. if (i == 0)
  4495. {
  4496. // rc2.left +=wid[1];
  4497. rc2.right += wid[1];
  4498. }
  4499. if (j == 1 || j == 4)
  4500. {
  4501. rc2.left += dtx;
  4502. rc2.right += dtx;
  4503. }
  4504. if (j == 2 || j == 5)
  4505. {
  4506. rc2.left += dtx * 2;
  4507. rc2.right += dtx * 2;
  4508. }
  4509. if (j == 3 || j == 4 || j == 5)
  4510. {
  4511. rc2.top += dty;
  4512. rc2.bottom += dty;
  4513. }
  4514. m_Print.DrawRect2(rc2, 1);
  4515. if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
  4516. {
  4517. str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(0);
  4518. rc2.left += 3;
  4519. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4520. rc2.left -= 3;
  4521. }
  4522. if (i == 0)continue;
  4523. rc2.left = rc2.right;
  4524. rc2.right += wid[1];
  4525. m_Print.DrawRect2(rc2, 1);
  4526. if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
  4527. {
  4528. if (Listarray->ElementAt(aa*sinlecount + 33 * j + i).GetSize() > 1)
  4529. {
  4530. str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(1);
  4531. rc2.left += 3;
  4532. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4533. rc2.left -= 3;
  4534. }
  4535. }
  4536. /* if(Listarray->GetSize ()>aa*46+i)
  4537. {
  4538. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4539. rc2.left +=3;
  4540. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4541. rc2.left -=3;
  4542. }
  4543. rc2.left +=wid[j];
  4544. rc2.right =rc2.left+wid[j+1];*/
  4545. }
  4546. }
  4547. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4548. dlg.m_pDC = m_Print.GetPDC();
  4549. if (aa == 0)
  4550. {
  4551. if (dlg.DoModal() != IDOK)
  4552. return;
  4553. }
  4554. //结束打印
  4555. m_Print.EndPage();
  4556. m_Print.EndPrint();
  4557. }
  4558. }
  4559. void CMainFrame::PrintTakeForm(CArray<CStringArray, CStringArray>*Listarray)
  4560. {
  4561. CString title;
  4562. CString info;
  4563. // TODO: Add your control notification handler code here
  4564. int sinlecount = 4;
  4565. int pages = Listarray->GetSize() / sinlecount;
  4566. if (Listarray->GetSize() % sinlecount)pages++;
  4567. for (int aa = 0; aa < pages; aa++)
  4568. {
  4569. PrintPreview dlg;
  4570. CPrintRX m_Print;
  4571. m_Print.InitToPrint(NULL, 1);
  4572. m_Print.StartPrint();
  4573. m_Print.StartPage();
  4574. CRect mainrc(0, 0, 560, 793);
  4575. float fscale;
  4576. {
  4577. int w, h;
  4578. m_Print.GetWidHei(w, h);
  4579. fscale = (float)w / (float)h;
  4580. }
  4581. mainrc.DeflateRect(25, 40, 10, 0);
  4582. CString str;
  4583. CRect rc, rc2;
  4584. rc = mainrc;
  4585. rc.bottom = rc.top;
  4586. rc.top -= 20;
  4587. rc.left -= 20;
  4588. m_Print.SetFontFace(6, 1, "宋体");
  4589. str.Format(" 页:%d/%d", aa + 1, pages);
  4590. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4591. rc.right = mainrc.right + 10;
  4592. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4593. m_Print.SetFontFace(12, 1, "宋体");
  4594. int wid[2] = { 70, 190 };
  4595. int hei = 22;
  4596. rc = mainrc;
  4597. rc.bottom = rc.top + hei;
  4598. rc.top += 10;
  4599. rc.bottom += 10;
  4600. int dtx = rc.Width() / 2 + 18;
  4601. int dty = 380;
  4602. int arraysize = Listarray->ElementAt(0).GetSize();
  4603. for (int j = 0; j < 4; j++)
  4604. {
  4605. if (Listarray->GetSize() <= aa*sinlecount + j)continue;
  4606. for (int i = 0; i < arraysize; i++)
  4607. {
  4608. rc2.top = rc.top + i / 2 * hei;
  4609. rc2.bottom = rc.bottom + i / 2 * hei;
  4610. rc2.left = rc.left;
  4611. rc2.right = rc.left + wid[0];
  4612. if (i % 2)
  4613. {
  4614. rc2.left = rc2.right;
  4615. rc2.right += wid[1];
  4616. }
  4617. if (j == 1 || j == 3)
  4618. {
  4619. rc2.left += dtx;
  4620. rc2.right += dtx;
  4621. }
  4622. if (j == 2 || j == 3)
  4623. {
  4624. rc2.top += dty;
  4625. rc2.bottom += dty;
  4626. }
  4627. if (i == arraysize - 1 || i == arraysize - 2)
  4628. {
  4629. rc2.bottom += hei * 2;
  4630. }
  4631. m_Print.DrawRect2(rc2, 1);
  4632. {
  4633. str = Listarray->ElementAt(aa*sinlecount + j).ElementAt(i);
  4634. if (i == arraysize - 1)
  4635. {
  4636. CRect rc3 = rc2;
  4637. rc3.left += 3;
  4638. rc3.top += 3;
  4639. AutoDraw(m_Print, rc3, str, 1.4);
  4640. }
  4641. else if (i == arraysize - 2)
  4642. {
  4643. CRect rc3 = rc2;
  4644. rc3.left += 3;
  4645. rc3.top += 3;
  4646. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4647. }
  4648. else
  4649. {
  4650. rc2.left += 3;
  4651. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4652. rc2.left -= 3;
  4653. }
  4654. }
  4655. }
  4656. }
  4657. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4658. dlg.m_pDC = m_Print.GetPDC();
  4659. if (aa == 0)
  4660. {
  4661. if (dlg.DoModal() != IDOK)
  4662. return;
  4663. }
  4664. //结束打印
  4665. m_Print.EndPage();
  4666. m_Print.EndPrint();
  4667. }
  4668. }
  4669. void CMainFrame::PrintThumbNail(CStringArray *array, CString client, BOOL bDir, CString m_size)
  4670. {
  4671. // TODO: Add your control notification handler code here
  4672. CStringArray titlearray;
  4673. CStringArray namearray;
  4674. CStringArray noarray;
  4675. CArray<CRect, CRect>rcarray;
  4676. CArray<CRect, CRect>widtharray;
  4677. if (m_size != "")
  4678. {
  4679. int pos = m_size.Find(";");
  4680. while (pos != -1)
  4681. {
  4682. CString size = m_size.Left(pos);
  4683. int pos2 = size.Find(":");
  4684. if (pos2 != -1)
  4685. {
  4686. CString str;
  4687. CRect rc;
  4688. str = size.Left(pos2);
  4689. noarray.Add(str);
  4690. str = size.Right(size.GetLength() - pos2 - 1);
  4691. pos2 = str.Find(",");
  4692. namearray.Add(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4693. pos2 = str.Find(",");
  4694. rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4695. pos2 = str.Find(",");
  4696. rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4697. widtharray.Add(rc);
  4698. pos2 = str.Find(",");
  4699. rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4700. pos2 = str.Find(",");
  4701. rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4702. pos2 = str.Find(",");
  4703. rc.right = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4704. rc.bottom = atoi(str);
  4705. rcarray.Add(rc);
  4706. }
  4707. m_size = m_size.Right(m_size.GetLength() - pos - 1);
  4708. pos = m_size.Find(";");
  4709. }
  4710. }
  4711. PrintPreview dlg;
  4712. CPrintRX m_Print;
  4713. m_Print.InitToPrint(NULL, 1);
  4714. m_Print.StartPrint();
  4715. m_Print.StartPage();
  4716. CRect mainrc(0, 0, 560, 793);
  4717. mainrc.DeflateRect(25, 50, 10, 0);
  4718. m_Print.SetFontFace(10, 1, "宋体");
  4719. CRect rc, rc2;
  4720. rc = mainrc;
  4721. rc.bottom = rc.top;
  4722. rc.top -= 20;
  4723. m_Print.DrawText((LPTSTR)(LPCTSTR)client, rc, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4724. rc.bottom -= 5;
  4725. m_Print.DrawRect2(rc, 2);
  4726. if (array->GetSize() > 130)m_Print.SetFontFace(8, 1, "宋体");
  4727. if (bDir)m_Print.SetFontFace(6, 1, "宋体");
  4728. ////////////////////////////////////////////////////////////////
  4729. int imgcount = array->GetSize();
  4730. int dtx = 5;
  4731. int dty = 15;
  4732. int cx, cy;
  4733. int countx = 5;
  4734. int county = 1;
  4735. while (1)
  4736. {
  4737. if (countx*county >= imgcount)
  4738. {
  4739. cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
  4740. cy = cx * 4 / 3;
  4741. break;
  4742. }
  4743. else
  4744. {
  4745. cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
  4746. cy = cx * 4 / 3;
  4747. if (cy*(county + 1) + dty*county < mainrc.Height())//Y方向可以增加一个
  4748. {
  4749. county++;
  4750. }
  4751. else//Y方向不能加,X方向加
  4752. {
  4753. countx++;
  4754. county = 1;
  4755. }
  4756. }
  4757. }
  4758. int imgpos = 0;
  4759. CString stemp;
  4760. CPen pen(PS_SOLID, 1, RGB(255, 0, 0));
  4761. CPen *oldpen = m_Print.m_DC.SelectObject(&pen);
  4762. CPen *oldpen2 = m_Print.m_memdc.SelectObject(&pen);
  4763. for (int i = 0; i < county; i++)
  4764. {
  4765. for (int j = 0; j < countx; j++)
  4766. {
  4767. rc = mainrc;
  4768. rc.top += i*(cy + dty);
  4769. rc.left += j*(cx + dtx);
  4770. rc.right = rc.left + cx;
  4771. rc.bottom = rc.top + cy;
  4772. Image *pImg = NULL;
  4773. if (imgpos >= array->GetSize())break;
  4774. CString str = array->ElementAt(imgpos);
  4775. CString spath = str.Left(str.ReverseFind('\\') + 1);
  4776. spath += "m";
  4777. spath += str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4778. if (PathFileExists(spath))
  4779. ::LoadImageFromBuf(&pImg, spath);
  4780. else
  4781. {
  4782. ::LoadImageFromBuf(&pImg, str);
  4783. if (pImg == NULL)continue;
  4784. int orientation = GetOrientation(pImg);
  4785. if (orientation == 8)
  4786. pImg->RotateFlip(Rotate270FlipNone);
  4787. else if (orientation == 6)
  4788. pImg->RotateFlip(Rotate90FlipNone);
  4789. }
  4790. if (pImg == NULL)continue;
  4791. rc2 = rc;
  4792. RectFitDes(pImg->GetWidth(), pImg->GetHeight(), rc);
  4793. imgpos++;
  4794. m_Print.DrawImage(pImg, rc);
  4795. int imgwidth = pImg->GetWidth();
  4796. delete pImg;
  4797. rc2.top = rc2.bottom + 3;
  4798. rc2.bottom += 10;
  4799. if (bDir == 0)
  4800. str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4801. else
  4802. {
  4803. stemp = str.Left(str.ReverseFind('\\'));
  4804. str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4805. if (stemp.ReverseFind('\\') != -1)
  4806. {
  4807. stemp = stemp.Right(stemp.GetLength() - stemp.ReverseFind('\\') - 1);
  4808. str = stemp + "\\" + str;
  4809. }
  4810. }
  4811. if (str.Find(".") != -1)
  4812. str = str.Left(str.Find("."));
  4813. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  4814. if (noarray.GetSize())
  4815. {
  4816. rc2 = rc;
  4817. for (int aa = 0; aa < noarray.GetSize(); aa++)
  4818. {
  4819. float scale = (float)rc2.Width() / (float)imgwidth;
  4820. if (noarray.ElementAt(aa) == str)
  4821. {
  4822. int nIndex = aa;
  4823. CRect rc = rcarray.ElementAt(nIndex);
  4824. int wid = widtharray.ElementAt(nIndex).left;
  4825. int hei = widtharray.ElementAt(nIndex).top;
  4826. scale *= (float)imgwidth / (float)wid;
  4827. rc.left *= scale;
  4828. rc.right *= scale;
  4829. rc.top *= scale;
  4830. rc.bottom *= scale;
  4831. rc.left += rc2.left;
  4832. rc.right += rc2.left;
  4833. rc.top += rc2.top;
  4834. rc.bottom += rc2.top;
  4835. if (rc.left < rc2.left)rc.left = rc2.left;
  4836. if (rc.right > rc2.right)rc.right = rc2.right;
  4837. if (rc.top < rc2.top)rc.top = rc2.top;
  4838. if (rc.bottom > rc2.bottom)rc.bottom = rc2.bottom;
  4839. m_Print.DrawRect2(rc, 1);
  4840. }
  4841. }
  4842. }
  4843. }
  4844. }
  4845. m_Print.m_DC.SelectObject(oldpen);
  4846. m_Print.m_memdc.SelectObject(oldpen2);
  4847. /* CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  4848. StrRect.top -=15;StrRect.bottom -=15;
  4849. Image *pImg=NULL;
  4850. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  4851. m_Print.DrawImage(pImg, StrRect);
  4852. delete pImg;
  4853. m_Print.SetFontFace(10, 1, "宋体");
  4854. StrRect=load.m_rcarray .ElementAt (20);
  4855. StrRect.right=load.m_rcarray .ElementAt (23).right;
  4856. StrRect.top -=18;StrRect.bottom -=18;
  4857. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  4858. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4859. */
  4860. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4861. dlg.m_pDC = m_Print.GetPDC();
  4862. if (dlg.DoModal() != IDOK)
  4863. return;
  4864. //结束打印
  4865. m_Print.EndPage();
  4866. m_Print.EndPrint();
  4867. }
  4868. // remark by Jeff
  4869. // 函数:PrintDinDan
  4870. // 参数:
  4871. // strOrderNumber:订单单号;(Order number)
  4872. // 返回:void
  4873. // 注意:#
  4874. void CMainFrame::PrintDinDan(CString strOrderNumber)//打印订单报表;
  4875. {
  4876. int printcot = 1;
  4877. for (int aa = 0; aa < printcot; aa++)
  4878. {
  4879. PrintPreview dlg;
  4880. CPrintRX m_Print;
  4881. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  4882. {
  4883. m_Print.InitToPrint(NULL, 1);
  4884. }
  4885. else
  4886. {
  4887. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  4888. if (name.IsEmpty())
  4889. m_Print.InitToPrint(NULL, 1);
  4890. else
  4891. {
  4892. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  4893. if (nret == -1 && aa == 0)
  4894. {
  4895. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  4896. }
  4897. }
  4898. }
  4899. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 0)
  4900. {
  4901. #ifdef ZHIAI_VERSION
  4902. PrintDinDan3(strOrderNumber);
  4903. return;
  4904. #endif
  4905. #ifdef SZBLCT_VERSION
  4906. PrintDinDan4(strOrderNumber);
  4907. return;
  4908. #endif
  4909. m_Print.StartPrint();
  4910. m_Print.StartPage();
  4911. LoadRect load;
  4912. load.SetLiaPath("6.lia");
  4913. load.SetMargins(-14, 15);
  4914. if (!load.Load())return;
  4915. LoadRect load2;
  4916. load2.SetLiaPath("7.lia");
  4917. load2.SetMargins(-14, 216 + 15);
  4918. if (!load2.Load())return;
  4919. LoadRect load3;
  4920. load3.SetLiaPath("8.lia");
  4921. load3.SetMargins(-14, 705 + 15);
  4922. if (!load3.Load())return;
  4923. int i;
  4924. //////////////////////////////////////////////////////////////
  4925. CStringArray txarray;
  4926. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
  4927. g_sendhead.code[0] = 11;
  4928. g_sendhead.code[1] = 52;
  4929. g_sendhead.code[2] = 50;
  4930. g_sendhead.code[3] = 150;
  4931. g_sendhead.code[4] = 77;
  4932. g_sendhead.code[5] = 4;
  4933. g_sendhead.tabcount = 6;
  4934. g_sendhead.bsql = 0;
  4935. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  4936. CArray<CStringArray, CStringArray>sparray;
  4937. CArray<CStringArray, CStringArray>clientarray;
  4938. CArray<CStringArray, CStringArray>phonearray;
  4939. CArray<CStringArray, CStringArray>fgarray;
  4940. CArray<CStringArray, CStringArray>danweiarray;
  4941. CArray<CStringArray, CStringArray>jdarray;
  4942. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  4943. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  4944. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  4945. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  4946. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  4947. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  4948. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  4949. CString m_taoxiname;
  4950. if (m_zs.Find("\\") != -1)
  4951. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
  4952. else
  4953. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
  4954. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  4955. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  4956. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  4957. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  4958. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  4959. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  4960. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  4961. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  4962. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  4963. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  4964. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  4965. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  4966. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  4967. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  4968. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  4969. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  4970. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  4971. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  4972. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  4973. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  4974. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  4975. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  4976. if (jdarray.GetSize())
  4977. {
  4978. if (m_bz.IsEmpty() == 0)
  4979. m_bz = "\r\n" + m_bz;
  4980. m_bz += "景点:";
  4981. }
  4982. #ifdef DDF_VERSION
  4983. m_bz += "219店:219路馨园小区对面\r\n";
  4984. m_bz += "金色店:万科金色家园小区东门南走20米荣光社区一楼\r\n";
  4985. m_bz += "万泰店:万泰锦绣华城小区正门\r\n";
  4986. #else
  4987. for (i = 0; i < jdarray.GetSize(); i++)
  4988. {
  4989. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  4990. }
  4991. m_bz.TrimRight(";");
  4992. #endif
  4993. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  4994. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  4995. if (IsHasRights2new(31) == 0)
  4996. {
  4997. m_phone1 = "***";
  4998. m_phone2 = "***";
  4999. }
  5000. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5001. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5002. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  5003. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  5004. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  5005. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  5006. filter = "name='" + m_ren + "'";
  5007. g_sendhead.code[0] = 5;
  5008. g_sendhead.tabcount = 1;
  5009. g_sendhead.bsql = 0;
  5010. int g_nYearposTemp = g_nYearpos;
  5011. g_nYearpos = -1;
  5012. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5013. g_nYearpos = g_nYearposTemp;
  5014. if (g_bSendOK == 0)return;
  5015. DataToArray(&phonearray);
  5016. m_money1.Format("%f", atof(m_taoxijiage));
  5017. m_money2.Format("%f", atof(m_payed1));
  5018. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5019. ConvertToPrice(m_money1);
  5020. ConvertToPrice(m_money2);
  5021. ConvertToPrice(m_money3);
  5022. ////////////////////////////////////////////////////////////////
  5023. int rcpos = -1;
  5024. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  5025. StrRect.top -= 15; StrRect.bottom -= 15;
  5026. Image *pImg = NULL;
  5027. #ifdef MNLS_VERSION
  5028. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  5029. #else
  5030. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  5031. #endif
  5032. m_Print.DrawImage(pImg, StrRect);
  5033. delete pImg;
  5034. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5035. {
  5036. Image *pImg = NULL;
  5037. g_nSendCode = 31;
  5038. int g_nYearposTemp = g_nYearpos;
  5039. g_nYearpos = -1;
  5040. g_pMainWnd->ProcessChatMessageRequest2(1);
  5041. g_nYearpos = g_nYearposTemp;
  5042. g_nSendCode = 0;
  5043. if (g_bSendOK == 0)return;
  5044. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  5045. if (pImg)
  5046. {
  5047. StrRect.left = 30;
  5048. StrRect.top = 12;
  5049. StrRect.right = StrRect.left + 60;
  5050. StrRect.bottom = StrRect.top + 60;
  5051. m_Print.DrawImage(pImg, StrRect);
  5052. delete pImg; pImg = NULL;
  5053. }
  5054. }
  5055. m_Print.SetFontFace(11, 1, "宋体");
  5056. StrRect = load.m_rcarray.ElementAt(20);
  5057. StrRect.right = load.m_rcarray.ElementAt(23).right;
  5058. StrRect.top -= 18; StrRect.bottom -= 18;
  5059. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  5060. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5061. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  5062. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5063. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5064. StrRect.top -= 15; StrRect.bottom -= 15;
  5065. #ifdef MNLS_VERSION
  5066. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5067. #endif
  5068. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5069. StrRect.top -= 15; StrRect.bottom -= 15;
  5070. #ifdef MNLS_VERSION
  5071. m_Print.DrawRect(StrRect);
  5072. #endif
  5073. m_Print.SetFontFace(7, 1, "黑体");
  5074. m_Print.SetColor(0xffffff);
  5075. #ifdef MNLS_VERSION
  5076. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5077. #endif
  5078. m_Print.SetColor(0);
  5079. m_Print.SetFontFace(15, 1, "宋体");
  5080. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5081. StrRect.top -= 15; StrRect.bottom -= 15;
  5082. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5083. CStringArray strarray;
  5084. strarray.Add("NO: " + strOrderNumber);
  5085. CString date;
  5086. date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  5087. strarray.Add(date);
  5088. strarray.Add("喜爱");
  5089. strarray.Add("格调");
  5090. if (fgarray.GetSize() == 12)
  5091. {
  5092. for (int i = 0; i < 12; i++)
  5093. strarray.Add(fgarray.ElementAt(i).ElementAt(0));
  5094. }
  5095. else
  5096. {
  5097. strarray.Add("复古典雅");
  5098. strarray.Add("温文尔雅");
  5099. strarray.Add("豪华艳丽");
  5100. strarray.Add("传统大方");
  5101. strarray.Add("新潮个性");
  5102. strarray.Add("浪漫奔放");
  5103. strarray.Add("简单素雅");
  5104. strarray.Add("活泼俏丽");
  5105. strarray.Add("妩媚温馨");
  5106. strarray.Add("温柔贤惠");
  5107. strarray.Add("成熟感性");
  5108. strarray.Add("清纯可爱");
  5109. }
  5110. strarray.Add("姓名");
  5111. // strarray.Add("职业");
  5112. strarray.Add("");
  5113. strarray.Add("地址");
  5114. strarray.Add("电话");
  5115. #ifdef CHILD_VERSION
  5116. strarray.Add("家长");
  5117. strarray.Add("宝宝");
  5118. #else
  5119. strarray.Add("先生");
  5120. strarray.Add("女士");
  5121. #endif
  5122. m_Print.SetFontFace(11, 1, "宋体");
  5123. for (i = 0; i < strarray.GetSize(); i++)
  5124. {
  5125. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5126. if (i < 2)
  5127. {
  5128. StrRect.top -= 15; StrRect.bottom -= 15;
  5129. }
  5130. if (i>15)
  5131. m_Print.DrawRect2(StrRect, 1);
  5132. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5133. }
  5134. for (i = 29; i <= 40; i++)
  5135. {
  5136. if (m_style.GetLength() <= (i - 29))continue;
  5137. if (m_style.GetAt(i - 29) != '1')continue;
  5138. StrRect = load.m_rcarray.ElementAt(i - 1);
  5139. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5140. }
  5141. for (i = 27; i <= 48; i++)
  5142. {
  5143. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5144. m_Print.DrawRect2(StrRect, 1);
  5145. }
  5146. #ifdef CHILD_VERSION
  5147. StrRect = load.m_rcarray.ElementAt(45);
  5148. StrRect.right = StrRect.left + 62;
  5149. m_Print.DrawRect2(StrRect, 1);
  5150. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5151. StrRect.left = StrRect.right;
  5152. StrRect.right = StrRect.left + 62;
  5153. m_Print.DrawRect2(StrRect, 1);
  5154. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5155. StrRect.left = StrRect.right;
  5156. StrRect.right = StrRect.left + 62;
  5157. m_Print.DrawRect2(StrRect, 1);
  5158. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5159. StrRect.left = StrRect.right;
  5160. StrRect.right = StrRect.left + 62;
  5161. m_Print.DrawRect2(StrRect, 1);
  5162. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5163. #endif
  5164. /////////////////////////
  5165. strarray.RemoveAll();
  5166. CString temp;
  5167. temp.Format("拍摄多款选 %d 款,其中影", atoi(m_outside) + atoi(m_outside2));
  5168. strarray.Add(temp);
  5169. temp.Format("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  5170. strarray.Add(temp);
  5171. strarray.Add("化妆");
  5172. strarray.Add("造型");
  5173. #ifdef CHILD_VERSION
  5174. strarray.Add("");
  5175. #else
  5176. strarray.Add("婚纱");
  5177. #endif
  5178. strarray.Add("服饰");
  5179. strarray.Add("配");
  5180. strarray.Add("置");
  5181. strarray.Add("其");
  5182. strarray.Add("它");
  5183. strarray.Add("套系名称");
  5184. strarray.Add("镜款");
  5185. strarray.Add("套系总价");
  5186. strarray.Add("主摄影师");
  5187. strarray.Add("拍摄日期");
  5188. strarray.Add("定金");
  5189. #ifdef CHILD_VERSION
  5190. strarray.Add("主引导师");
  5191. #else
  5192. strarray.Add("主化妆师");
  5193. #endif
  5194. strarray.Add("看样日期");
  5195. strarray.Add("欠款余额");
  5196. strarray.Add("总监");
  5197. strarray.Add("取件日期");
  5198. rcpos = -1;
  5199. for (i = 0; i < strarray.GetSize(); i++)
  5200. {
  5201. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  5202. if (i>9)
  5203. m_Print.DrawRect2(StrRect, 1);
  5204. #ifdef CHILD_VERSION
  5205. if (i == 5)
  5206. StrRect.top -= StrRect.Height();
  5207. #endif
  5208. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5209. }
  5210. for (i = 22; i <= 41; i++)
  5211. {
  5212. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  5213. m_Print.DrawRect2(StrRect, 1);
  5214. }
  5215. /////////////////////////////
  5216. strarray.RemoveAll();
  5217. #ifdef CHILD_VERSION
  5218. strarray.Add("顾客方 家长:");
  5219. strarray.Add("宝宝:");
  5220. #else
  5221. strarray.Add("顾客方 先生:");
  5222. strarray.Add("女士:");
  5223. #endif
  5224. strarray.Add("电话:");
  5225. strarray.Add("影楼方 店长:");
  5226. strarray.Add("接单人:");
  5227. strarray.Add("电话:");
  5228. rcpos = -1;
  5229. for (i = 0; i < strarray.GetSize(); i++)
  5230. {
  5231. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  5232. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5233. }
  5234. for (i = 7; i <= 12; i++)
  5235. {
  5236. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  5237. // if(i!=10)
  5238. m_Print.DrawRect2(StrRect, 2);
  5239. }
  5240. //////////////////////////////////////
  5241. //开始打数据
  5242. strarray.RemoveAll();
  5243. strarray.Add(m_name1);
  5244. strarray.Add(m_name2);
  5245. /// strarray.Add (m_occupation1);
  5246. // strarray.Add (m_occupation2);
  5247. strarray.Add("");
  5248. strarray.Add("");
  5249. strarray.Add(m_addr1);
  5250. #ifdef CHILD_VERSION
  5251. strarray.Add("");
  5252. #else
  5253. strarray.Add(m_addr2);
  5254. #endif
  5255. strarray.Add(m_phone1);
  5256. strarray.Add(m_phone2);
  5257. for (i = 41; i <= 48; i++)
  5258. {
  5259. StrRect = load.m_rcarray.ElementAt(i - 1);
  5260. StrRect.left += 4;
  5261. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5262. }
  5263. ///////////////////////////////
  5264. strarray.RemoveAll();
  5265. strarray.Add(m_money1);
  5266. strarray.Add(m_waiter1);
  5267. strarray.Add(m_time2);
  5268. strarray.Add(m_money2);
  5269. strarray.Add(m_waiter2);
  5270. strarray.Add(m_time4);
  5271. strarray.Add(m_money3);
  5272. strarray.Add("");
  5273. strarray.Add(m_time5);
  5274. for (i = 32; i <= 40; i++)
  5275. {
  5276. StrRect = load2.m_rcarray.ElementAt(i - 1);
  5277. StrRect.left += 4;
  5278. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5279. }
  5280. ///////////////////////////////
  5281. strarray.RemoveAll();
  5282. strarray.Add(m_name1);
  5283. strarray.Add(m_name2);
  5284. CString phone;
  5285. if (m_phone1.IsEmpty() == 0)
  5286. phone = m_phone1 + ",";
  5287. phone += m_phone2;
  5288. phone.TrimRight(",");
  5289. strarray.Add(phone);
  5290. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
  5291. strarray.Add(m_ren);
  5292. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  5293. for (i = 7; i <= 12; i++)
  5294. {
  5295. StrRect = load3.m_rcarray.ElementAt(i - 1);
  5296. StrRect.left += 4;
  5297. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5298. }
  5299. StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
  5300. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5301. StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
  5302. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5303. StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
  5304. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5305. //////////////////////////////
  5306. //开始画文字
  5307. StrRect = load2.m_rcarray.ElementAt(30);
  5308. StrRect.left += 3;
  5309. StrRect.top += 3;
  5310. StrRect.right -= 2;
  5311. StrRect.bottom -= 2;
  5312. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5313. StrRect = load2.m_rcarray.ElementAt(29);
  5314. StrRect.left += 3;
  5315. StrRect.top += 3;
  5316. StrRect.right -= 2;
  5317. StrRect.bottom -= 2;
  5318. str = "";
  5319. for (i = 0; i < sparray.GetSize(); i++)
  5320. {
  5321. str += sparray.ElementAt(i).ElementAt(5);
  5322. str += " 数量:";
  5323. str += sparray.ElementAt(i).ElementAt(3);
  5324. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5325. str += "\r\n";
  5326. }
  5327. str.TrimRight("\r\n");
  5328. AutoDraw(m_Print, StrRect, str, 1.4);
  5329. StrRect = load2.m_rcarray.ElementAt(40);
  5330. StrRect.top += 8;
  5331. m_Print.SetFontFace(12, 1, "黑体");
  5332. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5333. StrRect.left += 3;
  5334. StrRect.top += 30;
  5335. StrRect.right -= 2;
  5336. StrRect.bottom -= 2;
  5337. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5338. if (str.IsEmpty())
  5339. {
  5340. str = "\
  5341. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5342. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5343. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5344. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5345. 持良好的心境.\r\n\
  5346. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5347. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5348. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5349. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5350. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5351. 勿进影室, 以免影响拍摄.\r\n\
  5352. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5353. 师或店长沟通.\r\n\
  5354. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5355. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5356. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5357. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5358. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5359. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5360. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5361. 还.";
  5362. }
  5363. AutoDraw(m_Print, StrRect, str, 1.8);
  5364. }
  5365. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 1)
  5366. {//AfxMessageBox("yyy");
  5367. m_Print.StartPrint();
  5368. m_Print.StartPage();
  5369. LoadRect load;
  5370. load.SetLiaPath("6-2.lia");
  5371. load.SetMargins(0, 0);
  5372. if (!load.Load())return;
  5373. int i;
  5374. //////////////////////////////////////////////////////////////
  5375. CStringArray txarray;
  5376. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
  5377. g_sendhead.code[0] = 11;
  5378. g_sendhead.code[1] = 52;
  5379. g_sendhead.code[2] = 50;
  5380. g_sendhead.code[3] = 150;
  5381. g_sendhead.code[4] = 77;
  5382. g_sendhead.code[5] = 4;
  5383. g_sendhead.tabcount = 6;
  5384. g_sendhead.bsql = 0;
  5385. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5386. CArray<CStringArray, CStringArray>sparray;
  5387. CArray<CStringArray, CStringArray>clientarray;
  5388. CArray<CStringArray, CStringArray>phonearray;
  5389. CArray<CStringArray, CStringArray>fgarray;
  5390. CArray<CStringArray, CStringArray>danweiarray;
  5391. CArray<CStringArray, CStringArray>jdarray;
  5392. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5393. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5394. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5395. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5396. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5397. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5398. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  5399. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5400. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5401. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5402. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5403. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5404. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5405. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5406. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5407. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5408. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5409. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  5410. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  5411. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  5412. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  5413. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  5414. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  5415. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  5416. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  5417. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  5418. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  5419. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  5420. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  5421. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5422. if (jdarray.GetSize())
  5423. {
  5424. if (m_bz.IsEmpty() == 0)
  5425. m_bz = "\r\n" + m_bz;
  5426. m_bz += "景点:";
  5427. }
  5428. for (i = 0; i < jdarray.GetSize(); i++)
  5429. {
  5430. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  5431. }
  5432. m_bz.TrimRight(";");
  5433. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  5434. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  5435. if (IsHasRights2new(31) == 0)
  5436. {
  5437. m_phone1 = "***";
  5438. m_phone2 = "***";
  5439. }
  5440. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5441. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5442. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  5443. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  5444. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  5445. CString str;
  5446. filter = "name='" + m_ren + "'";
  5447. g_sendhead.code[0] = 5;
  5448. g_sendhead.tabcount = 1;
  5449. g_sendhead.bsql = 0;
  5450. int g_nYearposTemp = g_nYearpos;
  5451. g_nYearpos = -1;
  5452. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5453. g_nYearpos = g_nYearposTemp;
  5454. if (g_bSendOK == 0)return;
  5455. DataToArray(&phonearray);
  5456. m_money1.Format("%f", atof(m_taoxijiage));
  5457. m_money2.Format("%f", atof(m_payed1));
  5458. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5459. ConvertToPrice(m_money1);
  5460. ConvertToPrice(m_money2);
  5461. ConvertToPrice(m_money3);
  5462. ////////////////////////////////////////////////////////////////
  5463. int rcpos = -1;
  5464. CRect StrRect = load.m_rcarray.ElementAt(0);
  5465. m_Print.SetFontFace(25, 1, "黑体");
  5466. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "预约单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5467. m_Print.SetFontFace(11, 1, "宋体");
  5468. StrRect = load.m_rcarray.ElementAt(1);
  5469. if (m_time1.GetLength() == 10)
  5470. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  5471. else
  5472. str = "开单日期:";
  5473. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5474. StrRect = load.m_rcarray.ElementAt(2);
  5475. m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + strOrderNumber), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5476. CStringArray strarray;
  5477. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5478. {
  5479. Image *pImg = NULL;
  5480. g_nSendCode = 31;
  5481. int g_nYearposTemp = g_nYearpos;
  5482. g_nYearpos = -1;
  5483. g_pMainWnd->ProcessChatMessageRequest2(1);
  5484. g_nYearpos = g_nYearposTemp;
  5485. g_nSendCode = 0;
  5486. if (g_bSendOK == 0)return;
  5487. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  5488. if (pImg)
  5489. {
  5490. StrRect.left = 47;
  5491. StrRect.top = 12;
  5492. StrRect.right = StrRect.left + 60;
  5493. StrRect.bottom = StrRect.top + 60;
  5494. m_Print.DrawImage(pImg, StrRect);
  5495. delete pImg; pImg = NULL;
  5496. }
  5497. }
  5498. #ifdef CHILD_VERSION
  5499. strarray.Add("家长姓名");
  5500. strarray.Add("宝宝姓名");
  5501. #else
  5502. strarray.Add("先生姓名");
  5503. strarray.Add("女士姓名");
  5504. #endif
  5505. strarray.Add("服装套数");
  5506. // strarray.Add ("拍摄张数");
  5507. #ifdef CHILD_VERSION
  5508. strarray.Add("出生日期");
  5509. #else
  5510. strarray.Add("结婚日期");
  5511. #endif
  5512. strarray.Add("拍摄日期");
  5513. strarray.Add("联系电话");
  5514. strarray.Add("联系电话");
  5515. strarray.Add("造型套数");
  5516. if (m_zs.Find("\\") != -1)
  5517. strarray.Add("入底\\入册");
  5518. else
  5519. strarray.Add("入底张数");
  5520. strarray.Add("选片日期");
  5521. strarray.Add("QQ/邮箱");
  5522. strarray.Add("套系总额");
  5523. strarray.Add("定金");
  5524. strarray.Add("余款金额");
  5525. strarray.Add("取件日期");
  5526. strarray.Add(m_name1);
  5527. strarray.Add(m_name2);
  5528. strarray.Add(m_clothescount);
  5529. // str.Format("%d", atoi(m_zs)*3);
  5530. // strarray.Add (str);
  5531. #ifdef CHILD_VERSION
  5532. strarray.Add(m_birthday1);
  5533. #else
  5534. strarray.Add(m_time3);
  5535. #endif
  5536. strarray.Add(m_time2);
  5537. strarray.Add(m_phone1);
  5538. strarray.Add(m_phone2);
  5539. strarray.Add(m_clothescount2);
  5540. strarray.Add(m_zs);
  5541. strarray.Add(m_time4);
  5542. strarray.Add(m_qq1);
  5543. strarray.Add(m_money1);
  5544. strarray.Add(m_money2);
  5545. strarray.Add(m_money3);
  5546. strarray.Add(m_time5);
  5547. for (i = 4; i <= 33; i++)
  5548. {
  5549. StrRect = load.m_rcarray.ElementAt(i - 1);
  5550. m_Print.DrawRect2(StrRect, 1);
  5551. if (strarray.GetSize() > (i - 4))
  5552. {
  5553. if (i <= 18)
  5554. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5555. else
  5556. {
  5557. StrRect.left += 4;
  5558. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5559. }
  5560. }
  5561. }
  5562. int dt = 413;
  5563. StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5564. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5565. StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5566. StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5567. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5568. StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5569. StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
  5570. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5571. StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
  5572. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5573. StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
  5574. m_Print.DrawText((LPTSTR)(LPCTSTR)("网址:" + g_cominfoarray.ElementAt(0).ElementAt(13)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5575. //////////////////////////////
  5576. //开始画文字
  5577. StrRect = load.m_rcarray.ElementAt(7);
  5578. int hei = StrRect.Height();
  5579. StrRect.top += hei;
  5580. StrRect.bottom += hei;
  5581. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5582. StrRect.top += dt;
  5583. StrRect.bottom += dt;
  5584. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5585. StrRect = load.m_rcarray.ElementAt(17);
  5586. StrRect.top += hei;
  5587. StrRect.bottom += hei;
  5588. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5589. StrRect = load.m_rcarray.ElementAt(33);
  5590. StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
  5591. StrRect.top += hei;
  5592. StrRect.left += 3;
  5593. StrRect.top += 3;
  5594. StrRect.right -= 2;
  5595. StrRect.bottom -= 2;
  5596. str = "";
  5597. for (i = 0; i < sparray.GetSize(); i++)
  5598. {
  5599. str += sparray.ElementAt(i).ElementAt(5);
  5600. str += " 数量:";
  5601. str += sparray.ElementAt(i).ElementAt(3);
  5602. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5603. str += "\r\n";
  5604. }
  5605. str.TrimRight("\r\n");
  5606. AutoDraw(m_Print, StrRect, str, 1.4);
  5607. StrRect = load.m_rcarray.ElementAt(33);
  5608. StrRect.top += dt;
  5609. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  5610. StrRect.top += hei;
  5611. StrRect.left += 3;
  5612. StrRect.top += 3;
  5613. StrRect.right -= 2;
  5614. StrRect.bottom -= 2;
  5615. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5616. StrRect = load.m_rcarray.ElementAt(34);
  5617. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  5618. StrRect.top += hei;
  5619. StrRect.left += 3;
  5620. StrRect.top += 3;
  5621. StrRect.right -= 2;
  5622. StrRect.bottom -= 2;
  5623. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5624. if (str.IsEmpty())
  5625. {
  5626. str = "\
  5627. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5628. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5629. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5630. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5631. 持良好的心境.\r\n\
  5632. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5633. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5634. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5635. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5636. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5637. 勿进影室, 以免影响拍摄.\r\n\
  5638. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5639. 师或店长沟通.\r\n\
  5640. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5641. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5642. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5643. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5644. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5645. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5646. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5647. 还.";
  5648. }
  5649. AutoDraw(m_Print, StrRect, str, 1.8);
  5650. StrRect = load.m_rcarray.ElementAt(35);
  5651. StrRect.bottom += 100;
  5652. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  5653. 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∨";
  5654. // AutoDraw(m_Print, StrRect, str, 1.4);
  5655. }
  5656. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 2)
  5657. {
  5658. PrintDinDan5(strOrderNumber);
  5659. return;
  5660. }
  5661. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
  5662. {
  5663. PrintDinDan6(strOrderNumber);
  5664. return;
  5665. }
  5666. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  5667. dlg.m_pDC = m_Print.GetPDC();
  5668. dlg.m_mode = 1;
  5669. if (aa == 0)
  5670. {
  5671. if (dlg.DoModal() != IDOK)
  5672. return;
  5673. printcot = dlg.m_num;
  5674. }
  5675. //结束打印
  5676. m_Print.EndPage();
  5677. m_Print.EndPrint();
  5678. }
  5679. }
  5680. void CovertDate2(CString date, CString &date2)
  5681. {
  5682. try
  5683. {
  5684. if (date == "2013-04-09")
  5685. {
  5686. date2 = "2013-02-29";
  5687. return;
  5688. }
  5689. ///////////////////////////////////
  5690. date2 = date;
  5691. GongToLong(date2);
  5692. ////////////////////////////////////
  5693. return;
  5694. CCalendarConvert m_CalendarConvert;
  5695. SYSTEMTIME src = { 0 };
  5696. SYSTEMTIME dst = { 0 };
  5697. COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0);
  5698. COleDateTime m_timeGregorian;
  5699. m_timeLunar.GetAsSystemTime(src);
  5700. BOOL bEmbolism = 0;
  5701. if (m_CalendarConvert.Gregorian2Lunar(&src, &dst, &bEmbolism))
  5702. {
  5703. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst);
  5704. date2.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay());
  5705. if (m_timeGregorian.GetYear() == -1)date2 = "2000-13-32";
  5706. }
  5707. else
  5708. {
  5709. date2.Empty();
  5710. }
  5711. }
  5712. catch (...)
  5713. {
  5714. }
  5715. }
  5716. void CMainFrame::PrintDinDan5(CString m_id)
  5717. {
  5718. int printcot = 1;
  5719. for (int aa = 0; aa < printcot; aa++)
  5720. {
  5721. PrintPreview dlg;
  5722. CPrintRX m_Print;
  5723. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  5724. {
  5725. m_Print.InitToPrint(NULL, 1);
  5726. }
  5727. else
  5728. {
  5729. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  5730. if (name.IsEmpty())
  5731. m_Print.InitToPrint(NULL, 1);
  5732. else
  5733. {
  5734. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  5735. if (nret == -1 && aa == 0)
  5736. {
  5737. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  5738. }
  5739. }
  5740. }
  5741. {
  5742. m_Print.StartPrint();
  5743. m_Print.StartPage();
  5744. LoadRect load;
  5745. load.SetLiaPath("19.lia");
  5746. load.SetMargins(0, -20);
  5747. if (!load.Load())return;
  5748. int i;
  5749. //////////////////////////////////////////////////////////////
  5750. CStringArray txarray;
  5751. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  5752. g_sendhead.code[0] = 11;
  5753. g_sendhead.code[1] = 52;
  5754. g_sendhead.code[2] = 50;
  5755. g_sendhead.code[3] = 150;
  5756. g_sendhead.code[4] = 77;
  5757. g_sendhead.code[5] = 4;
  5758. g_sendhead.tabcount = 6;
  5759. g_sendhead.bsql = 0;
  5760. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5761. CArray<CStringArray, CStringArray>sparray;
  5762. CArray<CStringArray, CStringArray>clientarray;
  5763. CArray<CStringArray, CStringArray>phonearray;
  5764. CArray<CStringArray, CStringArray>fgarray;
  5765. CArray<CStringArray, CStringArray>danweiarray;
  5766. CArray<CStringArray, CStringArray>jdarray;
  5767. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5768. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5769. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5770. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5771. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5772. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5773. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
  5774. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5775. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5776. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5777. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5778. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5779. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5780. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5781. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5782. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5783. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5784. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  5785. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  5786. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  5787. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  5788. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  5789. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  5790. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  5791. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  5792. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  5793. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  5794. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  5795. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(36);
  5796. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  5797. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5798. CString m_txtype = g_List1array.ElementAt(0).ElementAt(52);
  5799. CString m_memberno = g_List1array.ElementAt(0).ElementAt(47);
  5800. CString str;
  5801. if (jdarray.GetSize())
  5802. {
  5803. if (m_bz.IsEmpty() == 0)
  5804. m_bz = "\r\n" + m_bz;
  5805. m_bz += "景点:";
  5806. }
  5807. for (i = 0; i < jdarray.GetSize(); i++)
  5808. {
  5809. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  5810. }
  5811. m_bz.TrimRight(";");
  5812. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  5813. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  5814. if (IsHasRights2new(31) == 0)
  5815. {
  5816. m_phone1 = "***";
  5817. m_phone2 = "***";
  5818. }
  5819. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5820. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5821. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  5822. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  5823. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  5824. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  5825. BOOL check1 = atoi(clientarray.ElementAt(0).ElementAt(15));
  5826. filter = "name='" + m_ren + "'";
  5827. g_sendhead.code[0] = 5;
  5828. g_sendhead.tabcount = 1;
  5829. g_sendhead.bsql = 0;
  5830. int g_nYearposTemp = g_nYearpos;
  5831. g_nYearpos = -1;
  5832. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5833. g_nYearpos = g_nYearposTemp;
  5834. if (g_bSendOK == 0)return;
  5835. DataToArray(&phonearray);
  5836. m_money1.Format("%f", atof(m_taoxijiage));
  5837. m_money2.Format("%f", atof(m_payed1));
  5838. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5839. ConvertToPrice(m_money1);
  5840. ConvertToPrice(m_money2);
  5841. ConvertToPrice(m_money3);
  5842. ////////////////////////////////////////////////////////////////
  5843. int rcpos = -1;
  5844. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  5845. //Image *pImg=NULL;
  5846. // ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  5847. // m_Print.DrawImage(pImg, StrRect);
  5848. // delete pImg;
  5849. m_Print.SetFontFace(20, 1, "宋体");
  5850. StrRect = load.m_rcarray.ElementAt(1);
  5851. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "定单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5852. m_Print.SetFontFace(12, 1, "宋体");
  5853. StrRect = load.m_rcarray.ElementAt(2);
  5854. m_Print.DrawText((LPTSTR)(LPCTSTR)("NO." + m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5855. StrRect = load.m_rcarray.ElementAt(3);
  5856. str.Format("%s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  5857. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5858. StrRect = load.m_rcarray.ElementAt(4);
  5859. m_Print.DrawText((LPTSTR)(LPCTSTR)("联系人:" + m_name1), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5860. CStringArray strarray;
  5861. strarray.Add("姓名");
  5862. strarray.Add("性别");
  5863. strarray.Add("年龄");
  5864. strarray.Add("出生年月");
  5865. strarray.Add("套系价格");
  5866. strarray.Add("定金");
  5867. strarray.Add("欠款");
  5868. strarray.Add("拍摄类型");
  5869. strarray.Add("会员卡号");
  5870. strarray.Add("定单人");
  5871. strarray.Add("入底\\入册");
  5872. strarray.Add("联系电话");
  5873. for (i = 6; i <= 17; i++)
  5874. {
  5875. StrRect = load.m_rcarray.ElementAt(i - 1);
  5876. m_Print.DrawRect2(StrRect, 1);
  5877. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 6), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5878. }
  5879. strarray.RemoveAll();
  5880. strarray.Add(m_name2);
  5881. strarray.Add(m_sex);
  5882. if (m_birthday.GetLength() != 10)
  5883. strarray.Add("");
  5884. else
  5885. {
  5886. int year = 0;
  5887. if (check1)
  5888. {
  5889. CString date2;
  5890. CovertDate2(g_date, date2);
  5891. year = atoi(date2.Left(4)) - atoi(m_birthday.Left(4));
  5892. if (date2.Right(5) >= m_birthday.Right(5))
  5893. year++;
  5894. }
  5895. else
  5896. {
  5897. year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  5898. if (g_date.Right(5) >= m_birthday.Right(5))
  5899. year++;
  5900. }
  5901. str.Format("%d", year);
  5902. strarray.Add(str);
  5903. }
  5904. strarray.Add(m_birthday);
  5905. strarray.Add(m_money1);
  5906. strarray.Add(m_money2);
  5907. strarray.Add(m_money3);
  5908. strarray.Add(m_txtype);
  5909. strarray.Add(m_memberno);
  5910. strarray.Add(m_ren);
  5911. strarray.Add(m_zs);
  5912. if (!m_phone1.IsEmpty())
  5913. strarray.Add(m_phone1);
  5914. else
  5915. strarray.Add(m_phone2);
  5916. for (i = 18; i <= 29; i++)
  5917. {
  5918. StrRect = load.m_rcarray.ElementAt(i - 1);
  5919. m_Print.DrawRect2(StrRect, 1);
  5920. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5921. }
  5922. strarray.RemoveAll();
  5923. strarray.Add("摄影师");
  5924. strarray.Add("拍照时间");
  5925. strarray.Add("选片人");
  5926. strarray.Add("选片时间");
  5927. strarray.Add("引导师");
  5928. strarray.Add("设计师");
  5929. strarray.Add("取件时间");
  5930. strarray.Add("顾客签字");
  5931. for (i = 34; i <= 41; i++)
  5932. {
  5933. StrRect = load.m_rcarray.ElementAt(i - 1);
  5934. m_Print.DrawRect2(StrRect, 1);
  5935. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 34), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5936. }
  5937. strarray.RemoveAll();
  5938. strarray.Add(m_waiter1);
  5939. strarray.Add(m_time2);
  5940. strarray.Add(m_waiter3);
  5941. strarray.Add(m_time4);
  5942. strarray.Add(m_waiter2);
  5943. strarray.Add(m_waiter4);
  5944. strarray.Add(m_time5);
  5945. strarray.Add("");
  5946. for (i = 42; i <= 49; i++)
  5947. {
  5948. StrRect = load.m_rcarray.ElementAt(i - 1);
  5949. m_Print.DrawRect2(StrRect, 1);
  5950. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5951. }
  5952. m_Print.SetFontFace(15, 1, "宋体");
  5953. StrRect = load.m_rcarray.ElementAt(29);
  5954. m_Print.DrawRect2(StrRect, 1);
  5955. StrRect.top += 45;
  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); StrRect.top += 20;
  5958. m_Print.DrawText((LPTSTR)(LPCTSTR)"内", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5959. m_Print.DrawText((LPTSTR)(LPCTSTR)"容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5960. StrRect = load.m_rcarray.ElementAt(30);
  5961. m_Print.DrawRect2(StrRect, 1);
  5962. StrRect.top += 45;
  5963. m_Print.DrawText((LPTSTR)(LPCTSTR)"友", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5964. m_Print.DrawText((LPTSTR)(LPCTSTR)"情", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5965. m_Print.DrawText((LPTSTR)(LPCTSTR)"提", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  5966. m_Print.DrawText((LPTSTR)(LPCTSTR)"示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5967. m_Print.SetFontFace(10, 1, "宋体");
  5968. StrRect = load.m_rcarray.ElementAt(37); StrRect.top = StrRect.bottom + 2;
  5969. str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  5970. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  5971. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  5972. StrRect = load.m_rcarray.ElementAt(48); StrRect.top = StrRect.bottom + 2; StrRect.left -= 200;
  5973. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  5974. //开始画文字
  5975. StrRect = load.m_rcarray.ElementAt(31);
  5976. StrRect.left += 3;
  5977. StrRect.top += 3;
  5978. StrRect.right -= 2;
  5979. StrRect.bottom -= 2;
  5980. str = "";
  5981. for (i = 0; i < sparray.GetSize(); i++)
  5982. {
  5983. str += sparray.ElementAt(i).ElementAt(5);
  5984. str += " 数量:";
  5985. str += sparray.ElementAt(i).ElementAt(3);
  5986. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5987. str += "\r\n";
  5988. }
  5989. str.TrimRight("\r\n");
  5990. m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5991. m_bz.TrimLeft();
  5992. if (m_bz != "")
  5993. {
  5994. str += "\r\n"; str += "\r\n";
  5995. str += "备注:" + m_bz;
  5996. }
  5997. AutoDraw(m_Print, StrRect, str, 1.4);
  5998. StrRect = load.m_rcarray.ElementAt(32); m_Print.DrawRect2(StrRect, 1);
  5999. StrRect.left += 3;
  6000. StrRect.top += 3;
  6001. StrRect.right -= 2;
  6002. StrRect.bottom -= 2;
  6003. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  6004. if (str.IsEmpty())
  6005. {
  6006. str = "\
  6007. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6008. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6009. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6010. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6011. 持良好的心境.\r\n\
  6012. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6013. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6014. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6015. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6016. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6017. 勿进影室, 以免影响拍摄.\r\n\
  6018. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6019. 师或店长沟通.\r\n\
  6020. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6021. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6022. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6023. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6024. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6025. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6026. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6027. 还.";
  6028. }
  6029. AutoDraw(m_Print, StrRect, str, 1.8);
  6030. }
  6031. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6032. dlg.m_pDC = m_Print.GetPDC();
  6033. dlg.m_mode = 1;
  6034. if (aa == 0)
  6035. {
  6036. if (dlg.DoModal() != IDOK)
  6037. return;
  6038. printcot = dlg.m_num;
  6039. }
  6040. //结束打印
  6041. m_Print.EndPage();
  6042. m_Print.EndPrint();
  6043. }
  6044. }
  6045. void CMainFrame::PrintDinDan4(CString m_id)
  6046. {
  6047. // TODO: Add your control notification handler code here
  6048. CPrintRX m_Print;
  6049. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6050. {
  6051. m_Print.InitToPrint(NULL, 1);
  6052. }
  6053. else
  6054. {
  6055. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  6056. if (name.IsEmpty())
  6057. m_Print.InitToPrint(NULL, 1);
  6058. else
  6059. {
  6060. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6061. if (nret == -1)
  6062. {
  6063. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6064. }
  6065. }
  6066. }
  6067. m_Print.StartPrint();
  6068. m_Print.StartPage();
  6069. LoadRect load;
  6070. load.SetLiaPath("6-2.lia");
  6071. load.SetMargins(0, 0);
  6072. if (!load.Load())return;
  6073. int i;
  6074. //////////////////////////////////////////////////////////////
  6075. CStringArray txarray;
  6076. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  6077. g_sendhead.code[0] = 11;
  6078. g_sendhead.code[1] = 52;
  6079. g_sendhead.code[2] = 50;
  6080. g_sendhead.code[3] = 150;
  6081. g_sendhead.code[4] = 77;
  6082. g_sendhead.code[5] = 4;
  6083. g_sendhead.tabcount = 6;
  6084. g_sendhead.bsql = 0;
  6085. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  6086. CArray<CStringArray, CStringArray>sparray;
  6087. CArray<CStringArray, CStringArray>clientarray;
  6088. CArray<CStringArray, CStringArray>phonearray;
  6089. CArray<CStringArray, CStringArray>fgarray;
  6090. CArray<CStringArray, CStringArray>danweiarray;
  6091. CArray<CStringArray, CStringArray>jdarray;
  6092. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  6093. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  6094. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  6095. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  6096. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  6097. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  6098. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  6099. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  6100. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  6101. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  6102. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  6103. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  6104. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  6105. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  6106. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  6107. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  6108. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  6109. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  6110. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  6111. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  6112. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  6113. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  6114. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  6115. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  6116. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  6117. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  6118. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  6119. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  6120. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  6121. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  6122. if (jdarray.GetSize())
  6123. {
  6124. if (m_bz.IsEmpty() == 0)
  6125. m_bz = "\r\n" + m_bz;
  6126. m_bz += "景点:";
  6127. }
  6128. for (i = 0; i < jdarray.GetSize(); i++)
  6129. {
  6130. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  6131. }
  6132. m_bz.TrimRight(";");
  6133. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  6134. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  6135. if (IsHasRights2new(31) == 0)
  6136. {
  6137. m_phone1 = "***";
  6138. m_phone2 = "***";
  6139. }
  6140. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  6141. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  6142. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  6143. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  6144. CString str;
  6145. filter = "name='" + m_ren + "'";
  6146. g_sendhead.code[0] = 5;
  6147. g_sendhead.tabcount = 1;
  6148. g_sendhead.bsql = 0;
  6149. int g_nYearposTemp = g_nYearpos;
  6150. g_nYearpos = -1;
  6151. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6152. g_nYearpos = g_nYearposTemp;
  6153. if (g_bSendOK == 0)return;
  6154. DataToArray(&phonearray);
  6155. m_money1.Format("%f", atof(m_taoxijiage));
  6156. m_money2.Format("%f", atof(m_payed1));
  6157. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  6158. ConvertToPrice(m_money1);
  6159. ConvertToPrice(m_money2);
  6160. ConvertToPrice(m_money3);
  6161. ////////////////////////////////////////////////////////////////
  6162. int rcpos = -1;
  6163. CRect StrRect = load.m_rcarray.ElementAt(0);
  6164. m_Print.SetFontFace(25, 1, "黑体");
  6165. m_Print.DrawText((LPTSTR)(LPCTSTR)"巴黎春天婚纱摄影预约单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6166. m_Print.SetFontFace(11, 1, "宋体");
  6167. StrRect = load.m_rcarray.ElementAt(1);
  6168. if (m_time1.GetLength() == 10)
  6169. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  6170. else
  6171. str = "开单日期:";
  6172. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6173. StrRect = load.m_rcarray.ElementAt(2);
  6174. m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + m_id), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6175. CStringArray strarray;
  6176. strarray.Add("先生姓名");
  6177. strarray.Add("女士姓名");
  6178. strarray.Add("服装套数");
  6179. strarray.Add("拍摄张数");
  6180. strarray.Add("拍摄日期");
  6181. strarray.Add("联系电话");
  6182. strarray.Add("联系电话");
  6183. strarray.Add("造型套数");
  6184. strarray.Add("入册张数");
  6185. strarray.Add("选片日期");
  6186. strarray.Add("QQ/邮箱");
  6187. strarray.Add("套系总额");
  6188. strarray.Add("定金");
  6189. strarray.Add("余款金额");
  6190. strarray.Add("取件日期");
  6191. strarray.Add(m_name1);
  6192. strarray.Add(m_name2);
  6193. strarray.Add(m_clothescount);
  6194. str.Format("%d", atoi(m_zs) * 3);
  6195. strarray.Add(str);
  6196. strarray.Add(m_time2);
  6197. strarray.Add(m_phone1);
  6198. strarray.Add(m_phone2);
  6199. strarray.Add(m_clothescount2);
  6200. strarray.Add(m_zs);
  6201. strarray.Add(m_time4);
  6202. strarray.Add(m_qq1);
  6203. strarray.Add(m_money1);
  6204. strarray.Add(m_money2);
  6205. strarray.Add(m_money3);
  6206. strarray.Add(m_time5);
  6207. for (i = 4; i <= 33; i++)
  6208. {
  6209. StrRect = load.m_rcarray.ElementAt(i - 1);
  6210. m_Print.DrawRect2(StrRect, 1);
  6211. if (strarray.GetSize() > (i - 4))
  6212. {
  6213. if (i <= 18)
  6214. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6215. else
  6216. {
  6217. StrRect.left += 4;
  6218. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6219. }
  6220. }
  6221. }
  6222. int dt = 413;
  6223. StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6224. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6225. StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6226. StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6227. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6228. StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6229. StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
  6230. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址:深圳市红岭中路中深国际大厦首层,二十二层", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6231. StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
  6232. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:0755-61308198 61308199 25860696 25860697", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6233. StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
  6234. m_Print.DrawText((LPTSTR)(LPCTSTR)"网址:www.paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6235. StrRect = load.m_rcarray.ElementAt(43); StrRect.top += dt; StrRect.bottom += dt;
  6236. m_Print.DrawText((LPTSTR)(LPCTSTR)"邮箱:blct@paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6237. //////////////////////////////
  6238. //开始画文字
  6239. StrRect = load.m_rcarray.ElementAt(7);
  6240. int hei = StrRect.Height();
  6241. StrRect.top += hei;
  6242. StrRect.bottom += hei;
  6243. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6244. StrRect.top += dt;
  6245. StrRect.bottom += dt;
  6246. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6247. StrRect = load.m_rcarray.ElementAt(17);
  6248. StrRect.top += hei;
  6249. StrRect.bottom += hei;
  6250. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6251. StrRect = load.m_rcarray.ElementAt(33);
  6252. StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
  6253. StrRect.top += hei;
  6254. StrRect.left += 3;
  6255. StrRect.top += 3;
  6256. StrRect.right -= 2;
  6257. StrRect.bottom -= 2;
  6258. str = "";
  6259. for (i = 0; i < sparray.GetSize(); i++)
  6260. {
  6261. str += sparray.ElementAt(i).ElementAt(5);
  6262. str += " 数量:";
  6263. str += sparray.ElementAt(i).ElementAt(3);
  6264. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  6265. str += "\r\n";
  6266. }
  6267. str.TrimRight("\r\n");
  6268. AutoDraw(m_Print, StrRect, str, 1.4);
  6269. StrRect = load.m_rcarray.ElementAt(33);
  6270. StrRect.top += dt;
  6271. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  6272. StrRect.top += hei;
  6273. StrRect.left += 3;
  6274. StrRect.top += 3;
  6275. StrRect.right -= 2;
  6276. StrRect.bottom -= 2;
  6277. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6278. StrRect = load.m_rcarray.ElementAt(34);
  6279. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  6280. StrRect.top += hei;
  6281. StrRect.left += 3;
  6282. StrRect.top += 3;
  6283. StrRect.right -= 2;
  6284. StrRect.bottom -= 2;
  6285. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  6286. if (str.IsEmpty())
  6287. {
  6288. str = "\
  6289. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6290. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6291. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6292. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6293. 持良好的心境.\r\n\
  6294. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6295. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6296. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6297. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6298. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6299. 勿进影室, 以免影响拍摄.\r\n\
  6300. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6301. 师或店长沟通.\r\n\
  6302. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6303. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6304. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6305. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6306. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6307. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6308. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6309. 还.";
  6310. }
  6311. AutoDraw(m_Print, StrRect, str, 1.8);
  6312. StrRect = load.m_rcarray.ElementAt(35);
  6313. StrRect.bottom += 100;
  6314. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  6315. 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∨";
  6316. AutoDraw(m_Print, StrRect, str, 1.4);
  6317. PrintPreview dlg;
  6318. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6319. dlg.m_pDC = m_Print.GetPDC();
  6320. if (dlg.DoModal() != IDOK)return;
  6321. //结束打印
  6322. m_Print.EndPage();
  6323. m_Print.EndPrint();
  6324. }
  6325. int CalHeight_01(CRect &rc, CStringArray *saContent, CPrintRX *Print, int FORMAT)
  6326. {
  6327. CSize size;
  6328. int nMaxheight = 0;
  6329. CString strTemp;
  6330. CString strContent;
  6331. int nSize = saContent->GetSize();
  6332. int nRow = 0; // 行数;
  6333. for (int i = 0; i < nSize; i++)
  6334. {
  6335. strTemp = "";
  6336. strContent = saContent->ElementAt(i);
  6337. while (FALSE == strContent.IsEmpty())
  6338. {
  6339. strContent = strContent.Mid(strTemp.GetLength());
  6340. if (strContent.IsEmpty())
  6341. break;
  6342. Print->GetStrSize((LPTSTR)(LPCTSTR)strContent, size);
  6343. if (size.cx <= rc.Width())
  6344. {
  6345. CRect rc2 = rc;
  6346. rc2.top += nRow*(size.cy + 1);
  6347. rc2.bottom = rc2.top + (size.cy + 1);
  6348. Print->DrawText((LPTSTR)(LPCTSTR)strContent, rc2, 0, 0, FORMAT | FORMAT_UP);
  6349. nMaxheight = max(nMaxheight, rc2.bottom);
  6350. nRow++;
  6351. break;
  6352. }
  6353. int right = 0;
  6354. while (size.cx > rc.Width())
  6355. {
  6356. right++;
  6357. strTemp = strContent.Left(strContent.GetLength() - (right));
  6358. if (GIsHalfHZ(strTemp))
  6359. {
  6360. right++;
  6361. strTemp.Delete(strTemp.GetLength() - 1);
  6362. }
  6363. Print->GetStrSize((LPTSTR)(LPCTSTR)strTemp, size);
  6364. }
  6365. CRect rc2 = rc;
  6366. rc2.top += nRow*(size.cy + 1);
  6367. rc2.bottom = rc2.top + (size.cy + 1);
  6368. Print->DrawText((LPTSTR)(LPCTSTR)strTemp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6369. nRow++;
  6370. nMaxheight = max(nMaxheight, rc2.bottom);
  6371. }
  6372. }
  6373. return (nMaxheight == 0) ? (rc.bottom + 1) : (nMaxheight + 1);
  6374. }
  6375. int CalHeight(CArray<CRect, CRect>*rcarray, CStringArray *strarray2, CPrintRX *Print, int FORMAT)
  6376. {
  6377. CSize size;
  6378. CString str, temp;
  6379. CRect rc;
  6380. int maxhei = 1;
  6381. int fonthei;
  6382. for (int i = 0; i < rcarray->GetSize(); i++)
  6383. {
  6384. rc = rcarray->ElementAt(i);
  6385. maxhei = max(maxhei, rc.bottom);
  6386. str = strarray2->ElementAt(i);
  6387. temp.Empty();
  6388. int hei = 0;
  6389. while (str.IsEmpty() == 0)
  6390. {
  6391. str = str.Right(str.GetLength() - temp.GetLength());
  6392. if (str.IsEmpty())break;
  6393. Print->GetStrSize((LPTSTR)(LPCTSTR)str, size);
  6394. fonthei = size.cy + 1;
  6395. if (size.cx <= rc.Width())
  6396. {
  6397. CRect rc2 = rc;
  6398. rc2.top += hei*fonthei;
  6399. rc2.bottom = rc2.top + fonthei;
  6400. Print->DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT | FORMAT_UP);
  6401. //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6402. maxhei = max(maxhei, rc2.bottom);
  6403. break;
  6404. }
  6405. int right = 0;
  6406. while (size.cx > rc.Width())
  6407. {
  6408. right++;
  6409. temp = str.Left(str.GetLength() - (right));
  6410. if (GIsHalfHZ(temp))
  6411. {
  6412. right++;
  6413. temp.Delete(temp.GetLength() - 1);
  6414. }
  6415. Print->GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  6416. }
  6417. CRect rc2 = rc;
  6418. rc2.top += hei*fonthei;
  6419. rc2.bottom = rc2.top + fonthei;
  6420. Print->DrawText((LPTSTR)(LPCTSTR)temp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6421. hei++;
  6422. maxhei = max(maxhei, rc2.bottom);
  6423. }
  6424. }
  6425. return maxhei + 1;
  6426. }
  6427. /* CPrintRX m_Print;
  6428. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6429. {
  6430. m_Print.InitToPrint(NULL, 1);
  6431. }
  6432. else
  6433. {
  6434. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  6435. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6436. if(nret==-1)
  6437. {
  6438. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6439. }
  6440. }
  6441. m_Print.StartPrint();
  6442. m_Print.StartPage();
  6443. LoadRect load;
  6444. load.SetLiaPath ("6.lia");
  6445. load.SetMargins(-14,35);
  6446. if(!load.Load ())return;
  6447. LoadRect load2;
  6448. load2.SetLiaPath ("7.lia");
  6449. load2.SetMargins(-14,216+35);
  6450. if(!load2.Load ())return;
  6451. LoadRect load3;
  6452. load3.SetLiaPath ("8.lia");
  6453. load3.SetMargins(-14,705+35);
  6454. if(!load3.Load ())return;
  6455. int i;
  6456. //////////////////////////////////////////////////////////////
  6457. CStringArray txarray;
  6458. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册';";
  6459. g_sendhead.code[0]=11;
  6460. g_sendhead.code[1]=52;
  6461. g_sendhead.code[2]=50;
  6462. g_sendhead.code[3]=77;
  6463. g_sendhead.tabcount=4;
  6464. g_sendhead.bsql=0;
  6465. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  6466. CArray<CStringArray, CStringArray>sparray;
  6467. CArray<CStringArray, CStringArray>clientarray;
  6468. CArray<CStringArray, CStringArray>phonearray;
  6469. CArray<CStringArray, CStringArray>fgarray;
  6470. DataToArray(&g_List1array, &clientarray, &sparray, &fgarray);
  6471. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  6472. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  6473. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  6474. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  6475. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  6476. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  6477. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  6478. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  6479. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  6480. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  6481. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  6482. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  6483. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  6484. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  6485. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  6486. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  6487. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  6488. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  6489. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  6490. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  6491. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  6492. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  6493. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  6494. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  6495. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  6496. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  6497. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  6498. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  6499. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6500. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  6501. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  6502. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  6503. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  6504. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  6505. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  6506. filter="name='"+m_ren+"'";
  6507. g_sendhead.code[0]=5;
  6508. g_sendhead.tabcount=1;
  6509. g_sendhead.bsql=0;
  6510. int g_nYearposTemp=g_nYearpos;
  6511. g_nYearpos=-1;
  6512. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6513. g_nYearpos=g_nYearposTemp;
  6514. if(g_bSendOK==0)return;
  6515. DataToArray(&phonearray);
  6516. m_money1.Format ("%f", atof(m_taoxijiage));
  6517. m_money2.Format ("%f", atof(m_payed1));
  6518. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  6519. ConvertToPrice(m_money1);
  6520. ConvertToPrice(m_money2);
  6521. ConvertToPrice(m_money3);
  6522. ////////////////////////////////////////////////////////////////
  6523. int rcpos=-1;
  6524. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6525. StrRect.top -=15;StrRect.bottom -=15;
  6526. Image *pImg=NULL;
  6527. #ifdef MNLS_VERSION
  6528. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  6529. #else
  6530. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  6531. #endif
  6532. m_Print.DrawImage(pImg, StrRect);
  6533. delete pImg;
  6534. m_Print.SetFontFace(11, 1, "宋体");
  6535. StrRect=load.m_rcarray .ElementAt (20);
  6536. StrRect.right=load.m_rcarray .ElementAt (23).right;
  6537. StrRect.top -=18;StrRect.bottom -=18;
  6538. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  6539. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6540. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  6541. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6542. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6543. StrRect.top -=15;StrRect.bottom -=15;
  6544. #ifdef MNLS_VERSION
  6545. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6546. #endif
  6547. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6548. StrRect.top -=15;StrRect.bottom -=15;
  6549. #ifdef MNLS_VERSION
  6550. m_Print.DrawRect(StrRect);
  6551. #endif
  6552. m_Print.SetFontFace(7, 1, "黑体");
  6553. m_Print.SetColor(0xffffff);
  6554. #ifdef MNLS_VERSION
  6555. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6556. #endif
  6557. m_Print.SetColor(0);
  6558. m_Print.SetFontFace(15, 1, "宋体");
  6559. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6560. StrRect.top -=15;StrRect.bottom -=15;
  6561. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6562. CStringArray strarray;
  6563. strarray.Add("NO: "+m_id);
  6564. CString date;
  6565. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  6566. strarray.Add(date);
  6567. strarray.Add("喜爱");
  6568. strarray.Add("格调");
  6569. if(fgarray.GetSize ()==12)
  6570. {
  6571. for(int i=0; i<12; i++)
  6572. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  6573. }
  6574. else
  6575. {
  6576. strarray.Add("复古典雅");
  6577. strarray.Add("温文尔雅");
  6578. strarray.Add("豪华艳丽");
  6579. strarray.Add("传统大方");
  6580. strarray.Add("新潮个性");
  6581. strarray.Add("浪漫奔放");
  6582. strarray.Add("简单素雅");
  6583. strarray.Add("活泼俏丽");
  6584. strarray.Add("妩媚温馨");
  6585. strarray.Add("温柔贤惠");
  6586. strarray.Add("成熟感性");
  6587. strarray.Add("清纯可爱");
  6588. }
  6589. strarray.Add("姓名");
  6590. strarray.Add("");
  6591. strarray.Add("电话");
  6592. strarray.Add("QQ/邮箱");
  6593. #ifdef CHILD_VERSION
  6594. strarray.Add("家长");
  6595. strarray.Add("宝宝");
  6596. #else
  6597. strarray.Add("先生");
  6598. strarray.Add("女士");
  6599. #endif
  6600. m_Print.SetFontFace(11, 1, "宋体");
  6601. for( i=0; i<strarray.GetSize (); i++)
  6602. {
  6603. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6604. if(i<2)
  6605. {
  6606. StrRect.top -=15;StrRect.bottom -=15;
  6607. }
  6608. if(i>15)
  6609. {
  6610. if(i==18)
  6611. StrRect.right-=80;
  6612. else if(i==19)
  6613. StrRect.left-=80;
  6614. m_Print.DrawRect2(StrRect, 1);
  6615. }
  6616. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6617. }
  6618. for( i=29; i<=40; i++)
  6619. {
  6620. if(m_style.GetLength ()<=(i-29))continue;
  6621. if(m_style.GetAt (i-29)!='1')continue;
  6622. StrRect=load.m_rcarray .ElementAt (i-1);
  6623. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6624. }
  6625. for( i=27; i<=48; i++)
  6626. {
  6627. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6628. if(i==45 || i==46)
  6629. StrRect.right-=80;
  6630. else if(i==47 || i==48)
  6631. StrRect.left-=80;
  6632. m_Print.DrawRect2(StrRect, 1);
  6633. }
  6634. /////////////////////////
  6635. strarray.RemoveAll ();
  6636. CString temp;
  6637. // temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  6638. strarray.Add (temp);
  6639. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  6640. strarray.Add (temp);
  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. strarray.Add ("套系总价");
  6652. strarray.Add ("拍摄张数");
  6653. strarray.Add ("选片日期");
  6654. strarray.Add ("定金");
  6655. strarray.Add ("入册张数");
  6656. strarray.Add ("");
  6657. strarray.Add ("欠款余额");
  6658. strarray.Add ("拍摄日期");
  6659. strarray.Add ("");
  6660. rcpos=-1;
  6661. for( i=0; i<strarray.GetSize (); i++)
  6662. {
  6663. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6664. if(i>9)
  6665. m_Print.DrawRect2(StrRect, 1);
  6666. if(i==1)
  6667. {
  6668. StrRect=load2.m_rcarray .ElementAt (21);StrRect.left +=4;
  6669. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6670. }
  6671. else if(i==6 || i==7)
  6672. {
  6673. StrRect.top -=25;
  6674. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6675. }
  6676. else
  6677. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6678. }
  6679. for( i=22; i<=41; i++)
  6680. {
  6681. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6682. if(rcpos==23 || rcpos==28)continue;
  6683. if(rcpos==24 || rcpos==29)
  6684. StrRect.top-=39;
  6685. m_Print.DrawRect2(StrRect, 1);
  6686. }
  6687. /////////////////////////////
  6688. strarray.RemoveAll ();
  6689. strarray.Add ("顾客签字:");
  6690. strarray.Add ("");
  6691. strarray.Add ("");
  6692. strarray.Add ("门市签字:");
  6693. strarray.Add ("");
  6694. strarray.Add ("");
  6695. rcpos=-1;
  6696. for( i=0; i<strarray.GetSize (); i++)
  6697. {
  6698. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6699. if(i==0 || i==3)
  6700. {
  6701. StrRect.bottom+=20;
  6702. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6703. }
  6704. }
  6705. for( i=7; i<=12; i++)
  6706. {
  6707. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6708. if(i==7 || i==10)
  6709. {
  6710. StrRect.bottom+=12;
  6711. m_Print.DrawRect2(StrRect, 2);
  6712. }
  6713. }
  6714. //////////////////////////////////////
  6715. //开始打数据
  6716. strarray.RemoveAll ();
  6717. strarray.Add (m_name1);
  6718. strarray.Add (m_name2);
  6719. strarray.Add ("");
  6720. strarray.Add ("");
  6721. strarray.Add (m_phone1);
  6722. #ifdef CHILD_VERSION
  6723. strarray.Add ("");
  6724. #else
  6725. strarray.Add (m_phone2);
  6726. #endif
  6727. strarray.Add (m_qq1);
  6728. strarray.Add (m_qq2);
  6729. for( i=41; i<=48; i++)
  6730. {
  6731. StrRect=load.m_rcarray .ElementAt (i-1);
  6732. StrRect.left +=4;
  6733. if(i==45 || i==46)
  6734. StrRect.right-=80;
  6735. else if(i==47 || i==48)
  6736. StrRect.left-=80;
  6737. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6738. }
  6739. ///////////////////////////////
  6740. strarray.RemoveAll ();
  6741. strarray.Add (m_money1);
  6742. str.Format("%d", atoi(m_zs)*2);
  6743. strarray.Add (str);
  6744. strarray.Add (m_time4);
  6745. strarray.Add (m_money2);
  6746. strarray.Add (m_zs);
  6747. strarray.Add ("");
  6748. strarray.Add (m_money3);
  6749. strarray.Add (m_time2);
  6750. strarray.Add ("");
  6751. for( i=32; i<=40; i++)
  6752. {
  6753. StrRect=load2.m_rcarray .ElementAt (i-1);
  6754. StrRect.left +=4;
  6755. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6756. }
  6757. ///////////////////////////////
  6758. strarray.RemoveAll ();
  6759. strarray.Add (m_name1);
  6760. strarray.Add (m_name2);
  6761. CString phone;
  6762. if(m_phone1.IsEmpty ()==0)
  6763. phone=m_phone1+",";
  6764. phone+=m_phone2;
  6765. phone.TrimRight (",");
  6766. strarray.Add (phone);
  6767. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  6768. strarray.Add (m_ren);
  6769. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  6770. for( i=7; i<=12; i++)
  6771. {
  6772. StrRect=load3.m_rcarray .ElementAt (i-1);
  6773. StrRect.left +=4;
  6774. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6775. }
  6776. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  6777. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6778. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  6779. str.Format("造型 %d 款,服装 %d 套", atoi(m_clothescount2), atoi(m_clothescount));
  6780. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6781. // StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  6782. // m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6783. //////////////////////////////
  6784. //开始画文字
  6785. StrRect=load2.m_rcarray .ElementAt (30);
  6786. StrRect.left +=3;
  6787. StrRect.top +=3;
  6788. StrRect.right -=2;
  6789. StrRect.bottom -=2;
  6790. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6791. StrRect=load2.m_rcarray .ElementAt (29); StrRect.top -=39;
  6792. StrRect.left +=3;
  6793. StrRect.top +=3;
  6794. StrRect.right -=2;
  6795. StrRect.bottom -=2;
  6796. str="";
  6797. for(i=0; i<sparray.GetSize (); i++)
  6798. {
  6799. str+=sparray.ElementAt (i).ElementAt (5);
  6800. str+=" 数量:";
  6801. str+=sparray.ElementAt (i).ElementAt (3);
  6802. str+="\r\n";
  6803. }
  6804. str.TrimRight ("\r\n");
  6805. AutoDraw(m_Print, StrRect, str, 1.4);
  6806. StrRect=load2.m_rcarray .ElementAt (40);
  6807. StrRect.top +=8;
  6808. m_Print.SetFontFace(12, 1, "黑体");
  6809. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客须知", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  6810. StrRect.left +=3;
  6811. StrRect.top +=30;
  6812. StrRect.right -=2;
  6813. StrRect.bottom -=2;
  6814. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6815. if(str.IsEmpty ())
  6816. {
  6817. str="\
  6818. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6819. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6820. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6821. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6822. 持良好的心境.\r\n\
  6823. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6824. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6825. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6826. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6827. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6828. 勿进影室, 以免影响拍摄.\r\n\
  6829. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6830. 师或店长沟通.\r\n\
  6831. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6832. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6833. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6834. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6835. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6836. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6837. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6838. 还.";
  6839. }
  6840. AutoDraw(m_Print, StrRect, str, 1.8);
  6841. PrintPreview dlg;
  6842. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6843. dlg.m_pDC =m_Print.GetPDC() ;
  6844. if(dlg.DoModal ()!=IDOK)return;
  6845. //结束打印
  6846. m_Print.EndPage();
  6847. m_Print.EndPrint();*/
  6848. /*
  6849. void CMainFrame::PrintReceipt(CStringArray *pArray)
  6850. {
  6851. g_sendhead.bsql=0;
  6852. g_sendhead.code[0]=24;
  6853. g_sendhead.tabcount=1;
  6854. int g_nYearposTemp=g_nYearpos;
  6855. g_nYearpos=-1;
  6856. g_pMainWnd->ProcessChatMessageRequest2(1);
  6857. g_nYearpos=g_nYearposTemp;
  6858. if(0==g_bSendOK)return;
  6859. DataToArray(&g_cominfoarray);
  6860. CString SerialNo;
  6861. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  6862. CPrintRX m_Print;
  6863. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6864. {
  6865. m_Print.InitToPrint(NULL, 1);
  6866. }
  6867. else
  6868. {
  6869. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  6870. if(name.IsEmpty ())
  6871. m_Print.InitToPrint(NULL, 1);
  6872. else
  6873. {
  6874. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6875. if(nret==-1)
  6876. {
  6877. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6878. }
  6879. }
  6880. }
  6881. m_Print.StartPrint();
  6882. m_Print.StartPage();
  6883. LoadRect load;
  6884. BOOL bSmall=0;
  6885. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  6886. {
  6887. bSmall=1;
  6888. load.SetLiaPath ("20.lia");
  6889. }
  6890. else
  6891. load.SetLiaPath ("10.lia");
  6892. if(bSmall)
  6893. load.SetMargins(0,0);
  6894. else
  6895. load.SetMargins(10,0);
  6896. if(!load.Load ())return;
  6897. int rcpos=-1;
  6898. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6899. if(bSmall)
  6900. {
  6901. m_Print.SetFontFace(18, 1, "黑体");
  6902. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6903. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6904. m_Print.SetFontFace(9, 1, "宋体");
  6905. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6906. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6907. m_Print.SetFontFace(6, 1, "宋体");
  6908. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6909. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6910. m_Print.SetFontFace(9, 1, "宋体");
  6911. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6912. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  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_RIGHT | FORMAT_VCENTER);
  6917. int hei=StrRect.Height ();
  6918. StrRect.bottom=StrRect.top;
  6919. StrRect.top -=8;
  6920. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6921. m_Print.SetFontFace(11, 1, "宋体");
  6922. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6923. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6924. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6925. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6926. m_Print.SetFontFace(8, 1, "宋体");
  6927. for(int i=7; i<24; i++)
  6928. {
  6929. StrRect=load.m_rcarray .ElementAt (i);
  6930. m_Print.DrawRect2(StrRect, 1);
  6931. }
  6932. for( i=9; i<24; i++)
  6933. {
  6934. StrRect=load.m_rcarray .ElementAt (i);
  6935. StrRect.left +=2;
  6936. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6937. }
  6938. m_Print.SetFontFace(6, 1, "宋体");
  6939. for(i=24; i<26; i++)
  6940. {
  6941. StrRect=load.m_rcarray .ElementAt (i);
  6942. StrRect.left +=2;
  6943. if(i==24)
  6944. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6945. else
  6946. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6947. }
  6948. // StrRect=load.m_rcarray .ElementAt (27);
  6949. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6950. }
  6951. else//大单
  6952. {
  6953. m_Print.SetFontFace(20, 1, "黑体");
  6954. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6955. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6956. m_Print.SetFontFace(11, 1, "宋体");
  6957. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15;
  6958. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6959. int hei=StrRect.Height ();
  6960. StrRect.bottom=StrRect.top;
  6961. StrRect.top -=10;
  6962. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6963. m_Print.SetFontFace(8, 1, "宋体");
  6964. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6965. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6966. #ifdef LYFZ_VERSION
  6967. m_Print.SetFontFace(9, 1, "宋体");
  6968. #else
  6969. m_Print.SetFontFace(11, 1, "宋体");
  6970. #endif
  6971. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6972. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6973. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6974. #ifdef LYFZ_VERSION
  6975. StrRect.left +=30;
  6976. StrRect.right +=30;
  6977. #endif
  6978. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6979. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6980. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6981. m_Print.SetFontFace(13, 1, "宋体");
  6982. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6983. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6984. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6985. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6986. m_Print.SetFontFace(11, 1, "宋体");
  6987. for(int i=7; i<24; i++)
  6988. {
  6989. StrRect=load.m_rcarray .ElementAt (i);
  6990. m_Print.DrawRect2(StrRect, 1);
  6991. }
  6992. for( i=9; i<24; i++)
  6993. {
  6994. StrRect=load.m_rcarray .ElementAt (i);
  6995. StrRect.left +=2;
  6996. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6997. }
  6998. #ifdef LYFZ_VERSION
  6999. m_Print.SetFontFace(7, 1, "宋体");
  7000. for(i=24; i<25; i++)
  7001. {
  7002. StrRect=load.m_rcarray .ElementAt (i);
  7003. StrRect.left +=2;
  7004. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7005. }
  7006. #else
  7007. m_Print.SetFontFace(7, 1, "宋体");
  7008. for(i=24; i<27; i++)
  7009. {
  7010. StrRect=load.m_rcarray .ElementAt (i);
  7011. StrRect.left +=2;
  7012. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7013. }
  7014. #endif
  7015. StrRect=load.m_rcarray .ElementAt (24);
  7016. hei=StrRect.Height ();
  7017. StrRect.top +=hei;
  7018. StrRect.bottom +=hei;
  7019. StrRect.right +=100;
  7020. StrRect.left +=2;
  7021. StrRect=load.m_rcarray .ElementAt (27);
  7022. AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7023. }
  7024. PrintPreview dlg;
  7025. dlg.m_mode=3;
  7026. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7027. dlg.m_pDC =m_Print.GetPDC() ;
  7028. if(dlg.DoModal ()!=IDOK)return;
  7029. //结束打印
  7030. m_Print.EndPage();
  7031. m_Print.EndPrint();
  7032. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7033. CString sql;
  7034. sql.Format("update version set [serialno]='%s'", SerialNo);
  7035. g_sendhead.bsql=1;
  7036. g_nYearposTemp=g_nYearpos;
  7037. g_nYearpos=-1;
  7038. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7039. g_nYearpos=g_nYearposTemp;
  7040. }
  7041. */
  7042. void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7043. {
  7044. //AfxMessageBox("abce");
  7045. int printcot = 1;
  7046. for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
  7047. {
  7048. g_sendhead.bsql = 0;
  7049. g_sendhead.code[0] = 24;
  7050. g_sendhead.tabcount = 1;
  7051. int g_nYearposTemp = g_nYearpos;
  7052. g_nYearpos = -1;
  7053. g_pMainWnd->ProcessChatMessageRequest2(1);
  7054. g_nYearpos = g_nYearposTemp;
  7055. if (0 == g_bSendOK)return;
  7056. DataToArray(&g_cominfoarray);
  7057. CString SerialNo;
  7058. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7059. #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7060. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7061. CString sql;
  7062. sql.Format("update version set [serialno]='%s'", SerialNo);
  7063. g_sendhead.bsql=1;
  7064. g_nYearposTemp=g_nYearpos;
  7065. g_nYearpos=-1;
  7066. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7067. g_nYearpos=g_nYearposTemp;
  7068. #endif
  7069. // 1.创建打印对象
  7070. CPrintRX m_Print;
  7071. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7072. {
  7073. m_Print.InitToPrint(NULL, 1);
  7074. }
  7075. else
  7076. {
  7077. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7078. if (name.IsEmpty())
  7079. m_Print.InitToPrint(NULL, 1);
  7080. else
  7081. {
  7082. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7083. if (nret == -1 && aa == 0)
  7084. {
  7085. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7086. }
  7087. }
  7088. }
  7089. // 2.开始打印
  7090. m_Print.StartPrint();
  7091. m_Print.StartPage();
  7092. LoadRect load;
  7093. BOOL bSmall = 0;
  7094. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7095. {
  7096. bSmall = 1;
  7097. load.SetLiaPath("20.lia");
  7098. }
  7099. else
  7100. load.SetLiaPath("10.lia");
  7101. if (bSmall)
  7102. load.SetMargins(0, 0);
  7103. else
  7104. load.SetMargins(10, 0);
  7105. if (!load.Load())return;
  7106. int rcpos = -1;
  7107. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7108. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7109. {
  7110. Image *pImg = NULL;
  7111. g_nSendCode = 31;
  7112. int g_nYearposTemp = g_nYearpos;
  7113. g_nYearpos = -1;
  7114. g_pMainWnd->ProcessChatMessageRequest2(1);
  7115. g_nYearpos = g_nYearposTemp;
  7116. g_nSendCode = 0;
  7117. if (g_bSendOK == 0)return;
  7118. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7119. if (pImg)
  7120. {
  7121. StrRect.left = 65;
  7122. if (bSmall) StrRect.left = 55;
  7123. StrRect.top = 10;
  7124. StrRect.right = StrRect.left + 58;
  7125. StrRect.bottom = StrRect.top + 58;
  7126. // 3.打印2维码图像;
  7127. m_Print.DrawImage(pImg, StrRect);
  7128. delete pImg;
  7129. pImg = NULL;
  7130. }
  7131. }
  7132. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7133. if (bSmall)
  7134. {
  7135. m_Print.SetFontFace(18, 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_HCENTER | FORMAT_VCENTER);
  7138. m_Print.SetFontFace(9, 1, "宋体");
  7139. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7140. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7141. m_Print.SetFontFace(6, 1, "宋体");
  7142. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7143. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7144. m_Print.SetFontFace(9, 1, "宋体");
  7145. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7146. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7147. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7148. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7149. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7150. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7151. int hei = StrRect.Height();
  7152. StrRect.bottom = StrRect.top;
  7153. StrRect.top -= 8;
  7154. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7155. m_Print.SetFontFace(11, 1, "宋体");
  7156. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7157. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7158. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7159. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7160. m_Print.SetFontFace(8, 1, "宋体");
  7161. for (int i = 7; i < 24; i++)
  7162. {
  7163. StrRect = load.m_rcarray.ElementAt(i);
  7164. m_Print.DrawRect2(StrRect, 1);
  7165. }
  7166. for (i = 9; i < 24; i++)
  7167. {
  7168. StrRect = load.m_rcarray.ElementAt(i);
  7169. StrRect.left += 2;
  7170. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7171. }
  7172. m_Print.SetFontFace(6, 1, "宋体");
  7173. for (i = 24; i < 26; i++)
  7174. {
  7175. StrRect = load.m_rcarray.ElementAt(i);
  7176. StrRect.left += 2;
  7177. if (i == 24)
  7178. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7179. else
  7180. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7181. }
  7182. // StrRect=load.m_rcarray .ElementAt (27);
  7183. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7184. }
  7185. else//大单
  7186. {
  7187. // 1.打印表头(蒙娜丽莎收款单)
  7188. m_Print.SetFontFace(20, 1, "黑体");
  7189. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7190. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7191. m_Print.SetFontFace(11, 1, "宋体");
  7192. // 2.打印订单号(NO.20140608-001)
  7193. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //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_RIGHT | FORMAT_VCENTER);
  7195. // 3.打印SerialNo(SerialNo.01062)
  7196. int hei = StrRect.Height();
  7197. StrRect.bottom = StrRect.top;
  7198. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7199. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7200. // 4.打印影楼地址信息、电话;
  7201. m_Print.SetFontFace(8, 1, "宋体");
  7202. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7203. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7204. #ifdef LYFZ_VERSION
  7205. m_Print.SetFontFace(9, 1, "宋体");
  7206. #else
  7207. m_Print.SetFontFace(11, 1, "宋体");
  7208. #endif
  7209. // 5.打印客户姓名
  7210. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7211. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7212. // 6.打印客户联系电话
  7213. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7214. #ifdef LYFZ_VERSION
  7215. StrRect.left += 30;
  7216. StrRect.right += 30;
  7217. #endif
  7218. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7219. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7220. // 7.打印开单日期
  7221. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7222. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7223. // 8.打印列字段:收款项目
  7224. m_Print.SetFontFace(13, 1, "宋体");
  7225. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7226. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7227. //printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7228. // 9.打印列字段:金额
  7229. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7230. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7231. //printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7232. // 10.打印列字段:开单人
  7233. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7234. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7235. //printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7236. // 11.画表格-画3列;
  7237. m_Print.SetFontFace(11, 1, "宋体");
  7238. int i;
  7239. for (i = 7; i < 10; i++)
  7240. {
  7241. StrRect = load.m_rcarray.ElementAt(i);
  7242. m_Print.DrawRect2(StrRect, 1);
  7243. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7244. }
  7245. // 12.打印详细内容
  7246. int dty = 0;
  7247. int dtytemp = 0;
  7248. // for( i=10; i<14; i+=3)
  7249. for (i = 10; i<22; i += 3) // 循环4次,再画
  7250. {
  7251. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7252. CArray<CRect, CRect>rcarray;
  7253. CStringArray strarray2;
  7254. StrRect = load.m_rcarray.ElementAt(i);
  7255. StrRect.top += dty;
  7256. StrRect.bottom += dty;
  7257. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  7258. {
  7259. StrRect = load.m_rcarray.ElementAt(i - 1);
  7260. StrRect.top += dty;
  7261. StrRect.bottom += dty;
  7262. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  7263. break;
  7264. }
  7265. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7266. StrRect.left += 2;
  7267. StrRect.right -= 2;
  7268. StrRect.top += 4;
  7269. rcarray.Add(StrRect);
  7270. strarray2.Add(pArray->ElementAt(i));
  7271. // 指定格子宽度,计算字符串占几行(高度).
  7272. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7273. dtytemp = bottom - StrRect.bottom;
  7274. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7275. // 重新获取表格大小,并画出表格;
  7276. StrRect = load.m_rcarray.ElementAt(i);
  7277. StrRect.bottom += dtytemp;
  7278. StrRect.top += dty;
  7279. StrRect.bottom += dty;
  7280. m_Print.DrawRect2(StrRect, 1);
  7281. // 获取下一表格大小,并画出表格;
  7282. StrRect = load.m_rcarray.ElementAt(i + 1);
  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 + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7290. //printf("Jeff:%d:%s\n\n",i+1,pArray->ElementAt(i+1));//Jeff Printf;
  7291. StrRect = load.m_rcarray.ElementAt(i + 2);
  7292. StrRect.top += dty;
  7293. StrRect.bottom += dty;
  7294. StrRect.bottom += dtytemp;
  7295. m_Print.DrawRect2(StrRect, 1);
  7296. StrRect.left += 2;
  7297. // 打印开单人字段内容
  7298. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7299. //printf("Jeff:%d:%s\n\n",i+2,pArray->ElementAt(i+2));//Jeff Printf;
  7300. dty += dtytemp;
  7301. }
  7302. //.打印->付款情况 应付 实付 欠款.
  7303. i = 22;
  7304. StrRect = load.m_rcarray.ElementAt(i);
  7305. StrRect.top += dty;
  7306. StrRect.bottom += dty;
  7307. m_Print.DrawRect2(StrRect, 1);
  7308. StrRect.left += 2;
  7309. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7310. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7311. //.打印->合计人民币(大写):.......
  7312. i = 23;
  7313. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  7314. m_Print.DrawRect2(StrRect, 1);
  7315. StrRect.left += 2;
  7316. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7317. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7318. #ifdef LYFZ_VERSION
  7319. m_Print.SetFontFace(7, 1, "宋体");
  7320. for (i = 24; i < 25; i++)
  7321. {
  7322. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  7323. StrRect.left +=2;
  7324. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7325. }
  7326. #else
  7327. m_Print.SetFontFace(7, 1, "宋体");
  7328. for (i = 24; i < 27; i++)
  7329. {
  7330. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  7331. StrRect.left += 2;
  7332. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7333. }
  7334. #endif
  7335. StrRect = load.m_rcarray.ElementAt(24); StrRect.top += dty; StrRect.bottom += dty;
  7336. hei = StrRect.Height();
  7337. StrRect.top += hei;
  7338. StrRect.bottom += hei;
  7339. StrRect.right += 100;
  7340. StrRect.left += 2;
  7341. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  7342. AutoDraw(m_Print, StrRect, pArray->ElementAt(27), 1.0);
  7343. }
  7344. PrintPreview dlg;
  7345. dlg.m_mode = 3;
  7346. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  7347. dlg.m_pDC = m_Print.GetPDC();
  7348. if (aa == 0)
  7349. {
  7350. if (dlg.DoModal() != IDOK)
  7351. return;
  7352. printcot = dlg.m_num;
  7353. }
  7354. //结束打印
  7355. m_Print.EndPage();
  7356. m_Print.EndPrint();
  7357. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7358. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7359. CString sql;
  7360. sql.Format("update version set [serialno]='%s'", SerialNo);
  7361. g_sendhead.bsql = 1;
  7362. g_nYearposTemp = g_nYearpos;
  7363. g_nYearpos = -1;
  7364. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7365. g_nYearpos = g_nYearposTemp;
  7366. #endif
  7367. }
  7368. }
  7369. void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7370. {
  7371. //AfxMessageBox("abce");
  7372. int printcot = 1;
  7373. for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
  7374. {
  7375. g_sendhead.bsql = 0;
  7376. g_sendhead.code[0] = 24;
  7377. g_sendhead.tabcount = 1;
  7378. int g_nYearposTemp = g_nYearpos;
  7379. g_nYearpos = -1;
  7380. g_pMainWnd->ProcessChatMessageRequest2(1);
  7381. g_nYearpos = g_nYearposTemp;
  7382. if (0 == g_bSendOK)return;
  7383. DataToArray(&g_cominfoarray);
  7384. CString SerialNo;
  7385. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7386. #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7387. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7388. CString sql;
  7389. sql.Format("update version set [serialno]='%s'", SerialNo);
  7390. g_sendhead.bsql=1;
  7391. g_nYearposTemp=g_nYearpos;
  7392. g_nYearpos=-1;
  7393. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7394. g_nYearpos=g_nYearposTemp;
  7395. #endif
  7396. // 1.创建打印对象
  7397. CPrintRX m_Print;
  7398. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7399. {
  7400. m_Print.InitToPrint(NULL, 1);
  7401. }
  7402. else
  7403. {
  7404. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7405. if (name.IsEmpty())
  7406. m_Print.InitToPrint(NULL, 1);
  7407. else
  7408. {
  7409. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7410. if (nret == -1 && aa == 0)
  7411. {
  7412. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  7413. m_Print.InitToPrint(NULL, 1);
  7414. }
  7415. }
  7416. }
  7417. // 2.开始打印
  7418. m_Print.StartPrint();
  7419. m_Print.StartPage();
  7420. LoadRect load;
  7421. BOOL bSmall = 0;
  7422. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7423. {
  7424. bSmall = 1;
  7425. load.SetLiaPath("20.lia");
  7426. }
  7427. else
  7428. load.SetLiaPath("10.lia");
  7429. if (bSmall)
  7430. load.SetMargins(0, 0);
  7431. else
  7432. load.SetMargins(10, 0);
  7433. if (!load.Load())return;
  7434. int rcpos = -1;
  7435. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7436. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7437. {
  7438. Image *pImg = NULL;
  7439. g_nSendCode = 31;
  7440. int g_nYearposTemp = g_nYearpos;
  7441. g_nYearpos = -1;
  7442. g_pMainWnd->ProcessChatMessageRequest2(1);
  7443. g_nYearpos = g_nYearposTemp;
  7444. g_nSendCode = 0;
  7445. if (g_bSendOK == 0)return;
  7446. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7447. if (pImg)
  7448. {
  7449. StrRect.left = 65;
  7450. if (bSmall) StrRect.left = 55;
  7451. StrRect.top = 10;
  7452. StrRect.right = StrRect.left + 58;
  7453. StrRect.bottom = StrRect.top + 58;
  7454. // 3.打印2维码图像;
  7455. m_Print.DrawImage(pImg, StrRect);
  7456. delete pImg;
  7457. pImg = NULL;
  7458. }
  7459. }
  7460. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7461. if (bSmall)
  7462. {
  7463. m_Print.SetFontFace(18, 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_HCENTER | FORMAT_VCENTER);
  7466. m_Print.SetFontFace(9, 1, "宋体");
  7467. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7468. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7469. m_Print.SetFontFace(6, 1, "宋体");
  7470. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7471. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7472. m_Print.SetFontFace(9, 1, "宋体");
  7473. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7474. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7475. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7476. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7477. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7478. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7479. int hei = StrRect.Height();
  7480. StrRect.bottom = StrRect.top;
  7481. StrRect.top -= 8;
  7482. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7483. m_Print.SetFontFace(11, 1, "宋体");
  7484. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7485. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7486. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7487. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7488. m_Print.SetFontFace(8, 1, "宋体");
  7489. for (int i = 7; i < 24; i++)
  7490. {
  7491. StrRect = load.m_rcarray.ElementAt(i);
  7492. m_Print.DrawRect2(StrRect, 1);
  7493. }
  7494. for (i = 9; i < 24; i++)
  7495. {
  7496. StrRect = load.m_rcarray.ElementAt(i);
  7497. StrRect.left += 2;
  7498. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7499. }
  7500. m_Print.SetFontFace(6, 1, "宋体");
  7501. for (i = 24; i < 26; i++)
  7502. {
  7503. StrRect = load.m_rcarray.ElementAt(i);
  7504. StrRect.left += 2;
  7505. if (i == 24)
  7506. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7507. else
  7508. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7509. }
  7510. // StrRect=load.m_rcarray .ElementAt (27);
  7511. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7512. }
  7513. else//大单
  7514. {
  7515. // 1.打印表头(蒙娜丽莎收款单)
  7516. m_Print.SetFontFace(20, 1, "黑体");
  7517. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7518. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7519. m_Print.SetFontFace(11, 1, "宋体");
  7520. // 2.打印订单号(NO.20140608-001)
  7521. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //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_RIGHT | FORMAT_VCENTER);
  7523. // 3.打印SerialNo(SerialNo.01062)
  7524. int hei = StrRect.Height();
  7525. StrRect.bottom = StrRect.top;
  7526. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7527. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7528. // 4.打印影楼地址信息、电话;
  7529. m_Print.SetFontFace(8, 1, "宋体");
  7530. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7531. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7532. #ifdef LYFZ_VERSION
  7533. m_Print.SetFontFace(9, 1, "宋体");
  7534. #else
  7535. m_Print.SetFontFace(11, 1, "宋体");
  7536. #endif
  7537. // 5.打印客户姓名
  7538. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7539. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7540. // 6.打印客户联系电话
  7541. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7542. #ifdef LYFZ_VERSION
  7543. StrRect.left += 30;
  7544. StrRect.right += 30;
  7545. #endif
  7546. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7547. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7548. // 7.打印开单日期
  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_RIGHT | FORMAT_VCENTER);
  7551. #if 0 // Original Edition
  7552. // 8.打印列字段:收款项目
  7553. m_Print.SetFontFace(13, 1, "宋体");
  7554. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7555. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7556. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7557. // 9.打印列字段:金额
  7558. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7559. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7560. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7561. // 10.打印列字段:开单人
  7562. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7563. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7564. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7565. #else
  7566. // 8.打印列字段:收款项目
  7567. m_Print.SetFontFace(13, 1, "宋体");
  7568. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7569. StrRect = CRect(66, 85, 280, 105);
  7570. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7571. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7572. // 8.1 Jeff add:支付方式
  7573. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7574. StrRect = CRect(280, 85, 350, 105);
  7575. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7576. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7577. // 9.打印列字段:金额
  7578. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7579. StrRect = CRect(350, 85, 442, 105);
  7580. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7581. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7582. // 10.打印列字段:开单人
  7583. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7584. StrRect = CRect(442, 85, 535, 105);
  7585. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7586. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7587. //rcpos += 3;
  7588. #endif
  7589. // 11.画表格-画3列;old
  7590. // 11.draw 4 column
  7591. m_Print.SetFontFace(11, 1, "宋体");
  7592. int i;
  7593. //for( i=7; i<10; i++)
  7594. //{
  7595. // StrRect=load.m_rcarray.ElementAt(i);
  7596. // m_Print.DrawRect2(StrRect, 1);
  7597. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7598. //}
  7599. m_Print.DrawRect2(CRect(66, 85, 280, 105), 1);
  7600. m_Print.DrawRect2(CRect(280, 85, 350, 105), 1);
  7601. m_Print.DrawRect2(CRect(350, 85, 442, 105), 1);
  7602. m_Print.DrawRect2(CRect(442, 85, 535, 105), 1);
  7603. // 12.打印详细内容
  7604. int dty = 0;
  7605. int dtytemp = 0;
  7606. // for( i=10; i<14; i+=3)
  7607. //for( i=10; i<22; i+=3) // 循环4次,再画
  7608. int j = 0;
  7609. for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
  7610. {
  7611. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7612. CArray<CRect, CRect>rcarray;
  7613. CStringArray strarray2;
  7614. StrRect = load.m_rcarray.ElementAt(i);
  7615. StrRect.top += dty;
  7616. StrRect.bottom += dty;
  7617. StrRect.right -= 70; // Jeff add
  7618. //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;
  7619. /*
  7620. 4次的CRect
  7621. 66,105,350,125
  7622. 66,126,350,146
  7623. 66,147,350,167
  7624. 66,168,350,188
  7625. */
  7626. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  7627. {
  7628. StrRect = load.m_rcarray.ElementAt(i - 1);
  7629. StrRect.top += dty;
  7630. StrRect.bottom += dty;
  7631. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  7632. break;
  7633. }
  7634. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7635. StrRect.left += 2;
  7636. StrRect.right -= 2;
  7637. StrRect.top += 4;
  7638. rcarray.Add(StrRect);
  7639. //strarray2.Add(pArray->ElementAt(i+1));
  7640. strarray2.Add(pArray->ElementAt(j));
  7641. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7642. // 指定格子宽度,计算字符串占几行(高度).
  7643. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7644. dtytemp = bottom - StrRect.bottom;
  7645. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7646. // 重新获取表格大小,并画出表格;
  7647. /*
  7648. CRect(66,85,280,105),
  7649. CRect(280,85,350,105)
  7650. CRect(350,85,442,105)
  7651. CRect(442,85,535,105)
  7652. CRect(66,105,350,125),
  7653. CRect(66,126,350,146)
  7654. CRect(66,147,350,167)
  7655. CRect(66,168,350,188)
  7656. */
  7657. // 画收款项目框及打印内容;
  7658. StrRect = load.m_rcarray.ElementAt(i);
  7659. //StrRect=CRect(66,85,280,105);
  7660. StrRect.bottom += dtytemp;
  7661. StrRect.top += dty;
  7662. StrRect.bottom += dty;
  7663. //StrRect.left -= 70; // Jeff add
  7664. StrRect.right -= 70; // Jeff add
  7665. //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;
  7666. m_Print.DrawRect2(StrRect, 1);
  7667. // 画支付方式框及打印内容;
  7668. StrRect = load.m_rcarray.ElementAt(i);
  7669. //StrRect=CRect(280,85,350,105);
  7670. StrRect.bottom += dtytemp;
  7671. StrRect.top += dty;
  7672. StrRect.bottom += dty;
  7673. StrRect.left += StrRect.Width() - 70;
  7674. //StrRect.right += 70; // Jeff add
  7675. //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;
  7676. m_Print.DrawRect2(StrRect, 1);
  7677. StrRect.left += 2;
  7678. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7679. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7680. // 画金额框及打印内容;
  7681. StrRect = load.m_rcarray.ElementAt(i + 1);
  7682. //StrRect=CRect(350,85,442,105);
  7683. StrRect.top += dty;
  7684. StrRect.bottom += dty;
  7685. StrRect.bottom += dtytemp;
  7686. //StrRect.right -= 70; // Jeff add
  7687. //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;
  7688. m_Print.DrawRect2(StrRect, 1);
  7689. StrRect.left += 2;
  7690. // 打印出金额字段内容
  7691. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7692. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7693. // 画开单人框及打印内容;
  7694. StrRect = load.m_rcarray.ElementAt(i + 2);
  7695. //StrRect=CRect(442,85,535,105);
  7696. StrRect.top += dty;
  7697. StrRect.bottom += dty;
  7698. StrRect.bottom += dtytemp;
  7699. //StrRect.right -= 70; // Jeff add
  7700. //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;
  7701. m_Print.DrawRect2(StrRect, 1);
  7702. StrRect.left += 2;
  7703. // 打印开单人字段内容
  7704. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7705. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7706. dty += dtytemp;
  7707. }
  7708. //.打印->付款情况 应付 实付 欠款.
  7709. i = 22;
  7710. j = 27;
  7711. StrRect = load.m_rcarray.ElementAt(i);
  7712. StrRect.top += dty;
  7713. StrRect.bottom += dty;
  7714. m_Print.DrawRect2(StrRect, 1);
  7715. StrRect.left += 2;
  7716. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7717. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7718. //.打印->合计人民币(大写):.......
  7719. i = 23;
  7720. j = 28;
  7721. StrRect = load.m_rcarray.ElementAt(i);
  7722. StrRect.top += dty;
  7723. StrRect.bottom += dty;
  7724. m_Print.DrawRect2(StrRect, 1);
  7725. StrRect.left += 2;
  7726. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7727. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7728. // 打印总金额;
  7729. #ifdef LYFZ_VERSION
  7730. m_Print.SetFontFace(7, 1, "宋体");
  7731. for (i = 24; i < 25; i++)
  7732. {
  7733. StrRect = load.m_rcarray.ElementAt(i);
  7734. StrRect.top +=dty;
  7735. StrRect.bottom +=dty;
  7736. StrRect.left +=2;
  7737. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7738. }
  7739. #else
  7740. m_Print.SetFontFace(7, 1, "宋体");
  7741. for (i = 24, j = 29; i < 27; i++, j++)
  7742. {
  7743. StrRect = load.m_rcarray.ElementAt(i);
  7744. StrRect.top += dty;
  7745. StrRect.bottom += dty;
  7746. StrRect.left += 2;
  7747. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7748. }
  7749. #endif
  7750. StrRect = load.m_rcarray.ElementAt(24);
  7751. StrRect.top += dty;
  7752. StrRect.bottom += dty;
  7753. hei = StrRect.Height();
  7754. StrRect.top += hei;
  7755. StrRect.bottom += hei;
  7756. StrRect.right += 100;
  7757. StrRect.left += 2;
  7758. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  7759. AutoDraw(m_Print, StrRect, pArray->ElementAt(32), 1.0);
  7760. }
  7761. PrintPreview dlg;
  7762. dlg.m_mode = 3;
  7763. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  7764. dlg.m_pDC = m_Print.GetPDC();
  7765. if (aa == 0)
  7766. {
  7767. if (dlg.DoModal() != IDOK)
  7768. {
  7769. return;
  7770. }
  7771. printcot = dlg.m_num;
  7772. }
  7773. //结束打印
  7774. m_Print.EndPage();
  7775. m_Print.EndPrint();
  7776. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7777. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7778. CString sql;
  7779. sql.Format("update version set [serialno]='%s'", SerialNo);
  7780. g_sendhead.bsql = 1;
  7781. g_nYearposTemp = g_nYearpos;
  7782. g_nYearpos = -1;
  7783. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7784. g_nYearpos = g_nYearposTemp;
  7785. #endif
  7786. }
  7787. }
  7788. void CMainFrame::PrintReceipt_02(CStringArray *pArray, CPrintRX *pPrinter, const int &nCount, const BOOL bPrintImmediately) // 打印订单*预约收款、预约补款*
  7789. {
  7790. //AfxMessageBox("abce");
  7791. int printcot = 1;
  7792. // for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7793. // {
  7794. g_sendhead.bsql = 0;
  7795. g_sendhead.code[0] = 24;
  7796. g_sendhead.tabcount = 1;
  7797. int g_nYearposTemp = g_nYearpos;
  7798. g_nYearpos = -1;
  7799. g_pMainWnd->ProcessChatMessageRequest2(1);
  7800. g_nYearpos = g_nYearposTemp;
  7801. if (0 == g_bSendOK)return;
  7802. DataToArray(&g_cominfoarray);
  7803. CString SerialNo;
  7804. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7805. CPrintRX *tagPrinter = NULL;
  7806. if (pPrinter == NULL)
  7807. {
  7808. // 1.创建打印对象
  7809. tagPrinter = new CPrintRX;
  7810. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7811. {
  7812. tagPrinter->InitToPrint(NULL, 1);
  7813. }
  7814. else
  7815. {
  7816. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7817. if (name.IsEmpty())
  7818. {
  7819. tagPrinter->InitToPrint(NULL, 1);
  7820. }
  7821. else
  7822. {
  7823. int nret = tagPrinter->InitToPrint((char*)(LPCTSTR)name, 1);
  7824. ///if(nret==-1 && aa==0)
  7825. if (nret == -1)
  7826. {
  7827. if (bPrintImmediately == FALSE)
  7828. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  7829. tagPrinter->InitToPrint(NULL, 1);
  7830. }
  7831. }
  7832. }
  7833. // 2.开始打印
  7834. tagPrinter->StartPrint();
  7835. tagPrinter->StartPage();
  7836. }
  7837. else
  7838. {
  7839. //SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7840. tagPrinter = pPrinter;
  7841. }
  7842. LoadRect load;
  7843. BOOL bSmall = 0;
  7844. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7845. {
  7846. bSmall = 1;
  7847. load.SetLiaPath("20.lia");
  7848. }
  7849. else
  7850. load.SetLiaPath("10.lia");
  7851. if (bSmall)
  7852. load.SetMargins(0, 0);
  7853. else
  7854. load.SetMargins(10, 0);
  7855. if (!load.Load())return;
  7856. int rcpos = -1;
  7857. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7858. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7859. {
  7860. Image *pImg = NULL;
  7861. g_nSendCode = 31;
  7862. int g_nYearposTemp = g_nYearpos;
  7863. g_nYearpos = -1;
  7864. g_pMainWnd->ProcessChatMessageRequest2(1);
  7865. g_nYearpos = g_nYearposTemp;
  7866. g_nSendCode = 0;
  7867. if (g_bSendOK == 0)return;
  7868. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7869. if (pImg)
  7870. {
  7871. StrRect.left = 65;
  7872. if (bSmall) StrRect.left = 55;
  7873. StrRect.top = 10;
  7874. StrRect.right = StrRect.left + 58;
  7875. StrRect.bottom = StrRect.top + 58;
  7876. // 3.打印2维码图像;
  7877. tagPrinter->DrawImage(pImg, StrRect);
  7878. delete pImg;
  7879. pImg = NULL;
  7880. }
  7881. }
  7882. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7883. if (bSmall)
  7884. {
  7885. tagPrinter->SetFontFace(18, 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_HCENTER | FORMAT_VCENTER);
  7888. tagPrinter->SetFontFace(9, 1, "宋体");
  7889. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7890. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7891. tagPrinter->SetFontFace(6, 1, "宋体");
  7892. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7893. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7894. tagPrinter->SetFontFace(9, 1, "宋体");
  7895. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7896. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7897. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7898. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7899. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7900. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7901. int hei = StrRect.Height();
  7902. StrRect.bottom = StrRect.top;
  7903. StrRect.top -= 8;
  7904. tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7905. tagPrinter->SetFontFace(11, 1, "宋体");
  7906. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7907. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7908. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7909. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7910. tagPrinter->SetFontFace(8, 1, "宋体");
  7911. for (int i = 7; i < 24; i++)
  7912. {
  7913. StrRect = load.m_rcarray.ElementAt(i);
  7914. tagPrinter->DrawRect2(StrRect, 1);
  7915. }
  7916. for (i = 9; i < 24; i++)
  7917. {
  7918. StrRect = load.m_rcarray.ElementAt(i);
  7919. StrRect.left += 2;
  7920. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7921. }
  7922. tagPrinter->SetFontFace(6, 1, "宋体");
  7923. for (i = 24; i < 26; i++)
  7924. {
  7925. StrRect = load.m_rcarray.ElementAt(i);
  7926. StrRect.left += 2;
  7927. if (i == 24)
  7928. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7929. else
  7930. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7931. }
  7932. // StrRect=load.m_rcarray .ElementAt (27);
  7933. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7934. }
  7935. else//大单
  7936. {
  7937. // 1.打印表头(蒙娜丽莎收款单)
  7938. tagPrinter->SetFontFace(20, 1, "黑体");
  7939. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7940. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7941. tagPrinter->SetFontFace(11, 1, "宋体");
  7942. // 2.打印订单号(NO.20140608-001)
  7943. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7944. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7945. // 3.打印SerialNo(SerialNo.01062)
  7946. int hei = StrRect.Height();
  7947. StrRect.bottom = StrRect.top;
  7948. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7949. tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7950. // 4.打印影楼地址信息、电话;
  7951. tagPrinter->SetFontFace(8, 1, "宋体");
  7952. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7953. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7954. #ifdef LYFZ_VERSION
  7955. tagPrinter->SetFontFace(9, 1, "宋体");
  7956. #else
  7957. tagPrinter->SetFontFace(11, 1, "宋体");
  7958. #endif
  7959. // 5.打印客户姓名
  7960. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7961. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7962. // 6.打印客户联系电话
  7963. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7964. #ifdef LYFZ_VERSION
  7965. StrRect.left += 30;
  7966. StrRect.right += 30;
  7967. #endif
  7968. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7969. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7970. // 7.打印开单日期
  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_RIGHT | FORMAT_VCENTER);
  7973. #if 0 // Original Edition
  7974. // 8.打印列字段:收款项目
  7975. tagPrinter->SetFontFace(13, 1, "宋体");
  7976. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7977. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7978. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7979. // 9.打印列字段:金额
  7980. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7981. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7982. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7983. // 10.打印列字段:开单人
  7984. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7985. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7986. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7987. #else
  7988. // 8.打印列字段:收款项目
  7989. tagPrinter->SetFontFace(13, 1, "宋体");
  7990. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7991. StrRect = CRect(66, 85, 280, 105);
  7992. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7993. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7994. // 8.1 Jeff add:支付方式
  7995. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7996. StrRect = CRect(280, 85, 350, 105);
  7997. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7998. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7999. // 9.打印列字段:金额
  8000. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  8001. StrRect = CRect(350, 85, 442, 105);
  8002. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8003. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  8004. // 10.打印列字段:开单人
  8005. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  8006. StrRect = CRect(442, 85, 535, 105);
  8007. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8008. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  8009. //rcpos += 3;
  8010. #endif
  8011. // 11.画表格-画3列;old
  8012. // 11.draw 4 column
  8013. tagPrinter->SetFontFace(11, 1, "宋体");
  8014. int i;
  8015. //for( i=7; i<10; i++)
  8016. //{
  8017. // StrRect=load.m_rcarray.ElementAt(i);
  8018. // m_Print.DrawRect2(StrRect, 1);
  8019. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  8020. //}
  8021. tagPrinter->DrawRect2(CRect(66, 85, 280, 105), 1);
  8022. tagPrinter->DrawRect2(CRect(280, 85, 350, 105), 1);
  8023. tagPrinter->DrawRect2(CRect(350, 85, 442, 105), 1);
  8024. tagPrinter->DrawRect2(CRect(442, 85, 535, 105), 1);
  8025. // 12.打印详细内容
  8026. int dty = 0;
  8027. int dtytemp = 0;
  8028. // for( i=10; i<14; i+=3)
  8029. //for( i=10; i<22; i+=3) // 循环4次,再画
  8030. int j = 0;
  8031. for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
  8032. {
  8033. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  8034. CArray<CRect, CRect>rcarray;
  8035. CStringArray strarray2;
  8036. StrRect = load.m_rcarray.ElementAt(i);
  8037. StrRect.top += dty;
  8038. StrRect.bottom += dty;
  8039. StrRect.right -= 70; // Jeff add
  8040. //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;
  8041. /*
  8042. 4次的CRect
  8043. 66,105,350,125
  8044. 66,126,350,146
  8045. 66,147,350,167
  8046. 66,168,350,188
  8047. */
  8048. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  8049. {
  8050. StrRect = load.m_rcarray.ElementAt(i - 1);
  8051. StrRect.top += dty;
  8052. StrRect.bottom += dty;
  8053. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  8054. break;
  8055. }
  8056. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  8057. StrRect.left += 2;
  8058. StrRect.right -= 2;
  8059. StrRect.top += 4;
  8060. rcarray.Add(StrRect);
  8061. //strarray2.Add(pArray->ElementAt(i+1));
  8062. strarray2.Add(pArray->ElementAt(j));
  8063. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  8064. // 指定格子宽度,计算字符串占几行(高度).
  8065. int bottom = CalHeight(&rcarray, &strarray2, tagPrinter, FORMAT_LEFT);
  8066. dtytemp = bottom - StrRect.bottom;
  8067. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  8068. // 重新获取表格大小,并画出表格;
  8069. /*
  8070. CRect(66,85,280,105),
  8071. CRect(280,85,350,105)
  8072. CRect(350,85,442,105)
  8073. CRect(442,85,535,105)
  8074. CRect(66,105,350,125),
  8075. CRect(66,126,350,146)
  8076. CRect(66,147,350,167)
  8077. CRect(66,168,350,188)
  8078. */
  8079. // 画收款项目框及打印内容;
  8080. StrRect = load.m_rcarray.ElementAt(i);
  8081. //StrRect=CRect(66,85,280,105);
  8082. StrRect.bottom += dtytemp;
  8083. StrRect.top += dty;
  8084. StrRect.bottom += dty;
  8085. //StrRect.left -= 70; // Jeff add
  8086. StrRect.right -= 70; // Jeff add
  8087. //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;
  8088. tagPrinter->DrawRect2(StrRect, 1);
  8089. // 画支付方式框及打印内容;
  8090. StrRect = load.m_rcarray.ElementAt(i);
  8091. //StrRect=CRect(280,85,350,105);
  8092. StrRect.bottom += dtytemp;
  8093. StrRect.top += dty;
  8094. StrRect.bottom += dty;
  8095. StrRect.left += StrRect.Width() - 70;
  8096. //StrRect.right += 70; // Jeff add
  8097. //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;
  8098. tagPrinter->DrawRect2(StrRect, 1);
  8099. StrRect.left += 2;
  8100. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8101. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  8102. // 画金额框及打印内容;
  8103. StrRect = load.m_rcarray.ElementAt(i + 1);
  8104. //StrRect=CRect(350,85,442,105);
  8105. StrRect.top += dty;
  8106. StrRect.bottom += dty;
  8107. StrRect.bottom += dtytemp;
  8108. //StrRect.right -= 70; // Jeff add
  8109. //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;
  8110. tagPrinter->DrawRect2(StrRect, 1);
  8111. StrRect.left += 2;
  8112. // 打印出金额字段内容
  8113. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8114. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  8115. // 画开单人框及打印内容;
  8116. StrRect = load.m_rcarray.ElementAt(i + 2);
  8117. //StrRect=CRect(442,85,535,105);
  8118. StrRect.top += dty;
  8119. StrRect.bottom += dty;
  8120. StrRect.bottom += dtytemp;
  8121. //StrRect.right -= 70; // Jeff add
  8122. //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;
  8123. tagPrinter->DrawRect2(StrRect, 1);
  8124. StrRect.left += 2;
  8125. // 打印开单人字段内容
  8126. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8127. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  8128. dty += dtytemp;
  8129. }
  8130. //.打印->付款情况 应付 实付 欠款.
  8131. i = 22;
  8132. j = 27;
  8133. StrRect = load.m_rcarray.ElementAt(i);
  8134. StrRect.top += dty;
  8135. StrRect.bottom += dty;
  8136. tagPrinter->DrawRect2(StrRect, 1);
  8137. StrRect.left += 2;
  8138. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8139. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  8140. //.打印->合计人民币(大写):.......
  8141. i = 23;
  8142. j = 28;
  8143. StrRect = load.m_rcarray.ElementAt(i);
  8144. StrRect.top += dty;
  8145. StrRect.bottom += dty;
  8146. tagPrinter->DrawRect2(StrRect, 1);
  8147. StrRect.left += 2;
  8148. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8149. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  8150. // 打印总金额;
  8151. #ifdef LYFZ_VERSION
  8152. tagPrinter->SetFontFace(7, 1, "宋体");
  8153. for (i = 24; i < 25; i++)
  8154. {
  8155. StrRect = load.m_rcarray.ElementAt(i);
  8156. StrRect.top +=dty;
  8157. StrRect.bottom +=dty;
  8158. StrRect.left +=2;
  8159. tagPrinter->DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8160. }
  8161. #else
  8162. tagPrinter->SetFontFace(7, 1, "宋体");
  8163. for (i = 24, j = 29; i < 27; i++, j++)
  8164. {
  8165. StrRect = load.m_rcarray.ElementAt(i);
  8166. StrRect.top += dty;
  8167. StrRect.bottom += dty;
  8168. StrRect.left += 2;
  8169. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8170. }
  8171. #endif
  8172. StrRect = load.m_rcarray.ElementAt(24);
  8173. StrRect.top += dty;
  8174. StrRect.bottom += dty;
  8175. hei = StrRect.Height();
  8176. StrRect.top += hei;
  8177. StrRect.bottom += hei;
  8178. StrRect.right += 100;
  8179. StrRect.left += 2;
  8180. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  8181. AutoDraw(*tagPrinter, StrRect, pArray->ElementAt(32), 1.0);
  8182. }
  8183. if (bPrintImmediately == TRUE)
  8184. {
  8185. printcot = nCount;
  8186. ////结束打印
  8187. tagPrinter->EndPage();
  8188. tagPrinter->EndPrint();
  8189. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  8190. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  8191. CString sql;
  8192. sql.Format("update version set [serialno]='%s'", SerialNo);
  8193. g_sendhead.bsql = 1;
  8194. g_nYearposTemp = g_nYearpos;
  8195. g_nYearpos = -1;
  8196. g_pMainWnd->ProcessChatMessageRequest2(sql);
  8197. g_nYearpos = g_nYearposTemp;
  8198. #endif
  8199. }
  8200. else
  8201. {
  8202. PrintPreview dlg;
  8203. dlg.m_mode = 3;
  8204. tagPrinter->GetWidHei(dlg.m_w, dlg.m_h);
  8205. dlg.m_pDC = tagPrinter->GetPDC();
  8206. //if(aa==0)
  8207. //{
  8208. if (dlg.DoModal() != IDOK)
  8209. {
  8210. return;
  8211. }
  8212. else
  8213. {
  8214. printcot = dlg.m_num;
  8215. //m_Print.deletePrinter();
  8216. for (int i = 0; i < printcot; i++)
  8217. {
  8218. //tagPrinter->EndPage();
  8219. //tagPrinter->m_DC.AbortDoc(); // 结束清空由StartDoc写入的内容;2014-09-15;
  8220. //tagPrinter->m_DC.EndDoc();
  8221. //Sleep(10000);
  8222. //tagPrinter->StartPrint();
  8223. //tagPrinter->NewPage();
  8224. //PrintReceipt_02(pArray,/*tagPrinter*/NULL,printcot,TRUE);
  8225. PrintReceipt_02(pArray, tagPrinter, printcot, TRUE);
  8226. }
  8227. }
  8228. if (tagPrinter) delete tagPrinter;
  8229. //}
  8230. }
  8231. //}
  8232. }
  8233. void CMainFrame::PrintFlowChart(CString strOrderNumber) // 选片打单;
  8234. {
  8235. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
  8236. {
  8237. // Jeff 使用风格2打印;
  8238. PrintFlowChart3(strOrderNumber);
  8239. return;
  8240. }
  8241. #ifdef ZHIAI_VERSION
  8242. PrintFlowChart2(strOrderNumber);
  8243. return;
  8244. #endif
  8245. int printcot = 1;
  8246. for (int aa = 0; aa < printcot; aa++)
  8247. {
  8248. CPrintRX m_Print;
  8249. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8250. {
  8251. m_Print.InitToPrint(NULL, 1);
  8252. }
  8253. else
  8254. {
  8255. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  8256. if (name.IsEmpty())
  8257. m_Print.InitToPrint(NULL, 1);
  8258. else
  8259. {
  8260. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8261. if (nret == -1 && aa == 0)
  8262. {
  8263. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8264. }
  8265. }
  8266. }
  8267. m_Print.StartPrint();
  8268. m_Print.StartPage();
  8269. // CRect StrRect(0,0,560,818);
  8270. LoadRect load;
  8271. load.SetLiaPath("4.lia");
  8272. load.SetMargins(-14, -14);
  8273. if (!load.Load())return;
  8274. LoadRect load2;
  8275. load2.SetMargins(-14, 472 + 27 - 14);
  8276. load2.SetLiaPath("5.lia");
  8277. if (!load2.Load())return;
  8278. //////////////////////////////////////////////////////////////
  8279. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2'";
  8280. g_sendhead.code[0] = 54;
  8281. g_sendhead.code[1] = 223;
  8282. g_sendhead.tabcount = 2;
  8283. g_sendhead.bsql = 0;
  8284. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  8285. CArray<CStringArray, CStringArray>sparray;
  8286. DataToArray(&g_List1array, &sparray);
  8287. CString spno;
  8288. for (int i = 0; i < sparray.GetSize(); i++)
  8289. {
  8290. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8291. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  8292. if (sparray.ElementAt(i).ElementAt(5) == "入册" && sparray.ElementAt(i).ElementAt(5) == "入底" && sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8293. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8294. spno += sparray.ElementAt(i).ElementAt(5);
  8295. if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  8296. spno += "; ";
  8297. else
  8298. {
  8299. spno += ":";
  8300. spno += sparray.ElementAt(i).ElementAt(6);
  8301. spno += "; ";
  8302. }
  8303. }
  8304. spno += " 加挑:";
  8305. for (i = 0; i < sparray.GetSize(); i++)
  8306. {
  8307. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  8308. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  8309. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  8310. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8311. spno += sparray.ElementAt(i).ElementAt(5);
  8312. if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  8313. spno += "; ";
  8314. else
  8315. {
  8316. spno += ":";
  8317. spno += sparray.ElementAt(i).ElementAt(6);
  8318. spno += "; ";
  8319. }
  8320. }
  8321. if (spno.Right(6) == " 加挑:")
  8322. {
  8323. spno = spno.Left(spno.GetLength() - 6);
  8324. }
  8325. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  8326. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  8327. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  8328. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  8329. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  8330. if (m_urgent.IsEmpty())m_urgent = "否";
  8331. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  8332. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  8333. // CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  8334. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  8335. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  8336. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  8337. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  8338. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  8339. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  8340. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  8341. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  8342. CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(17) + g_List1array.ElementAt(0).ElementAt(29);
  8343. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  8344. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  8345. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  8346. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  8347. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  8348. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  8349. CString m_sum3;
  8350. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  8351. ::ConvertToPrice(m_sum3);
  8352. if (m_money3.IsEmpty())m_money3 = "0";
  8353. // m_money3=m_money3+"/"+m_sum3;
  8354. CString name;
  8355. if (!m_name1.IsEmpty())
  8356. name = m_name1 + ",";
  8357. name += m_name2;
  8358. name.TrimRight(",");
  8359. CString phone;
  8360. if (!m_phone1.IsEmpty())
  8361. phone = m_phone1 + ",";
  8362. phone += m_phone2; phone.TrimRight(",");
  8363. if (IsHasRights2new(31) == 0)
  8364. phone = "***";
  8365. CStringArray strarray;
  8366. strarray.Add(m_urgent);
  8367. strarray.Add(m_ren);
  8368. strarray.Add(m_waiter3);
  8369. strarray.Add(name);
  8370. strarray.Add(m_time2);
  8371. strarray.Add(m_time4);
  8372. strarray.Add(m_money3);
  8373. strarray.Add(m_sum3);
  8374. strarray.Add(m_takezs);
  8375. strarray.Add(m_taoxizs);
  8376. strarray.Add(m_choosezs);
  8377. strarray.Add(strOrderNumber);
  8378. strarray.Add(phone);
  8379. ////////////////////////////////////////////////////////////////
  8380. int rcpos = -1;
  8381. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8382. Image *pImg = NULL;
  8383. #ifdef MNLS_VERSION
  8384. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  8385. #else
  8386. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  8387. #endif
  8388. m_Print.DrawImage(pImg, StrRect);
  8389. delete pImg;
  8390. m_Print.SetFontFace(11, 1, "宋体");
  8391. StrRect = load2.m_rcarray.ElementAt(7);
  8392. StrRect.top = load2.m_rcarray.ElementAt(15).top - 15;
  8393. StrRect.bottom = load2.m_rcarray.ElementAt(15).bottom - 15;
  8394. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  8395. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8396. StrRect.top += 15;
  8397. StrRect.bottom += 15;
  8398. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  8399. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8400. m_Print.SetFontFace(15, 1, "宋体");
  8401. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8402. #ifdef MNLS_VERSION
  8403. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8404. #endif
  8405. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8406. #ifdef MNLS_VERSION
  8407. m_Print.DrawRect(StrRect);
  8408. #endif
  8409. m_Print.SetFontFace(7, 1, "黑体");
  8410. m_Print.SetColor(0xffffff);
  8411. #ifdef MNLS_VERSION
  8412. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8413. #endif
  8414. m_Print.SetColor(0);
  8415. m_Print.SetFontFace(25, 1, "黑体");
  8416. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8417. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8418. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8419. {
  8420. Image *pImg = NULL;
  8421. g_nSendCode = 31;
  8422. int g_nYearposTemp = g_nYearpos;
  8423. g_nYearpos = -1;
  8424. g_pMainWnd->ProcessChatMessageRequest2(1);
  8425. g_nYearpos = g_nYearposTemp;
  8426. g_nSendCode = 0;
  8427. if (g_bSendOK == 0)return;
  8428. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8429. if (pImg)
  8430. {
  8431. StrRect.left = 450;
  8432. StrRect.top = 22;
  8433. StrRect.right = StrRect.left + 60;
  8434. StrRect.bottom = StrRect.top + 60;
  8435. m_Print.DrawImage(pImg, StrRect);
  8436. delete pImg; pImg = NULL;
  8437. }
  8438. }
  8439. #ifdef CHILD_VERSION
  8440. CString title[13] = { "是否加急:", "接单门市:", \
  8441. "选样人员:", "客人姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
  8442. "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:"
  8443. };
  8444. #else
  8445. CString title[13] = { "是否加急:", "接单门市:", \
  8446. "选样人员:", "新郎新娘姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
  8447. "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:" };
  8448. #endif
  8449. m_Print.SetFontFace(12, 1, "宋体");
  8450. for (i = 0; i < 13; i++)
  8451. {
  8452. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8453. if (i < 3)
  8454. m_Print.DrawRect2(StrRect, 0);
  8455. else
  8456. m_Print.DrawRect2(StrRect, 1);
  8457. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8458. }
  8459. for (i = 18; i <= 37; i++)
  8460. {
  8461. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8462. if (i >= 19 && i <= 21)
  8463. m_Print.DrawRect2(StrRect, 2);
  8464. /* else if(i==26)
  8465. {
  8466. CRect rc=StrRect;
  8467. CRect rc2=rc;
  8468. rc.right -=rc2.Width ()/2;
  8469. m_Print.DrawRect2(rc, 1);
  8470. rc2.left +=rc.Width ();
  8471. m_Print.DrawRect2(rc2, 1);
  8472. }*/
  8473. else
  8474. m_Print.DrawRect2(StrRect, 1);
  8475. if (i == 18)
  8476. {
  8477. StrRect.left += 5;
  8478. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8479. }
  8480. }
  8481. //////////////////////////////////////
  8482. rcpos = -1;
  8483. for (i = 0; i < 8; i++)
  8484. {
  8485. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8486. m_Print.DrawRect2(StrRect, 1);
  8487. }
  8488. #ifdef CHILD_VERSION
  8489. CString title2[4] = { "引导师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
  8490. #else
  8491. CString title2[4] = { "化妆师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
  8492. #endif
  8493. for (i = 0; i < 4; i++)
  8494. {
  8495. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8496. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8497. }
  8498. for (i = 0; i < 4; i++)
  8499. {
  8500. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8501. m_Print.DrawRect2(StrRect, 2);
  8502. }
  8503. StrRect = load2.m_rcarray.ElementAt(11);
  8504. StrRect.top -= 15;
  8505. StrRect.bottom -= 15;
  8506. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客选片签名:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8507. StrRect = load2.m_rcarray.ElementAt(15);
  8508. StrRect.top -= 15;
  8509. StrRect.bottom -= 15;
  8510. m_Print.DrawRect2(StrRect, 2);
  8511. ///////////////////////////////////////////
  8512. for (i = 19; i <= 31; i++)
  8513. {
  8514. StrRect = load.m_rcarray.ElementAt(i - 1);
  8515. StrRect.left += 4;
  8516. if (i == 31)
  8517. {
  8518. if (m_phone1.IsEmpty() == 0 && m_phone2.IsEmpty() == 0)
  8519. {
  8520. StrRect.top += 2;
  8521. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  8522. StrRect.top += 8;
  8523. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8524. }
  8525. else
  8526. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8527. }
  8528. /* else if((i-19)==7)
  8529. {
  8530. CRect rc=StrRect;
  8531. CRect rc2=rc;
  8532. rc.right -=rc2.Width ()/2;
  8533. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8534. rc2.left +=rc.Width ()+3;
  8535. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8536. }*/
  8537. else
  8538. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8539. }
  8540. strarray.RemoveAll();
  8541. strarray.Add(m_waiter2);
  8542. strarray.Add(m_waiter1);
  8543. strarray.Add(m_waiter4);
  8544. for (i = 13; i <= 15; i++)
  8545. {
  8546. StrRect = load2.m_rcarray.ElementAt(i - 1);
  8547. StrRect.left += 4;
  8548. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8549. }
  8550. ///////////spno
  8551. CRect sprc[14];
  8552. for (i = 0; i < 14; i++)
  8553. {
  8554. if (i < 7)
  8555. {
  8556. if (i == 0)
  8557. {
  8558. StrRect = load.m_rcarray.ElementAt(17); StrRect.left += 94; StrRect.right -= 3;
  8559. }
  8560. else
  8561. {
  8562. StrRect = load.m_rcarray.ElementAt(30 + i); StrRect.left += 4; StrRect.right -= 3;
  8563. }
  8564. }
  8565. else
  8566. {
  8567. StrRect = load2.m_rcarray.ElementAt(i - 7); StrRect.left += 4; StrRect.right -= 3;
  8568. }
  8569. sprc[i] = StrRect;
  8570. }
  8571. CString temp, tempspno, tempbz;
  8572. CSize size;
  8573. BOOL bRun = 0;
  8574. int fontsize = 12;
  8575. ll: tempspno = spno;
  8576. tempbz = m_bz;
  8577. m_Print.SetFontFace(fontsize, 1, "宋体");
  8578. for (i = 0; i<14; i++)
  8579. {
  8580. if (!tempspno.IsEmpty())
  8581. {
  8582. temp = tempspno;
  8583. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8584. int right = 0;
  8585. CRect temprc = sprc[i];
  8586. while (size.cx>temprc.Width())
  8587. {
  8588. right++;
  8589. temp = tempspno.Left(tempspno.GetLength() - (right));
  8590. if (GIsHalfHZ(temp))
  8591. {
  8592. right++;
  8593. temp.Delete(temp.GetLength() - 1);
  8594. }
  8595. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8596. }
  8597. if (bRun)
  8598. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8599. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  8600. if (tempspno.IsEmpty())i++;
  8601. }
  8602. else if (!tempbz.IsEmpty())
  8603. {
  8604. temp = tempbz;
  8605. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8606. int right = 0;
  8607. CRect temprc = sprc[i];
  8608. while (size.cx > temprc.Width())
  8609. {
  8610. right++;
  8611. temp = tempbz.Left(tempbz.GetLength() - (right));
  8612. if (GIsHalfHZ(temp))
  8613. {
  8614. right++;
  8615. temp.Delete(temp.GetLength() - 1);
  8616. }
  8617. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8618. }
  8619. if (bRun)
  8620. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8621. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
  8622. }
  8623. }
  8624. if (tempspno.IsEmpty() == 0 || tempbz.IsEmpty() == 0)
  8625. {
  8626. fontsize--;
  8627. goto ll;
  8628. }
  8629. if (bRun == 0)
  8630. {
  8631. bRun = 1;
  8632. goto ll;
  8633. }
  8634. PrintPreview dlg;
  8635. dlg.m_mode = 2;
  8636. dlg.m_name = name;
  8637. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  8638. dlg.m_pDC = m_Print.GetPDC();
  8639. if (aa == 0)
  8640. {
  8641. if (dlg.DoModal() != IDOK)
  8642. return;
  8643. printcot = dlg.m_num;
  8644. }
  8645. //结束打印
  8646. m_Print.EndPage();
  8647. m_Print.EndPrint();
  8648. }
  8649. }
  8650. void CMainFrame::PrintFlowChart3LKAY(CString strOrderNumber)
  8651. {
  8652. int printcot = 1;
  8653. for (int aa = 0; aa < printcot; aa++)
  8654. {
  8655. CPrintRX m_Print;
  8656. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8657. {
  8658. m_Print.InitToPrint(NULL, 1);
  8659. }
  8660. else
  8661. {
  8662. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  8663. if (name.IsEmpty())
  8664. m_Print.InitToPrint(NULL, 1);
  8665. else
  8666. {
  8667. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8668. if (nret == -1 && aa == 0)
  8669. {
  8670. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8671. }
  8672. }
  8673. }
  8674. m_Print.StartPrint();
  8675. m_Print.StartPage();
  8676. LoadRect load;
  8677. load.SetLiaPath("18.lia");
  8678. load.SetMargins(10, 0);
  8679. if (!load.Load())return;
  8680. CString str;
  8681. int rcpos = -1;
  8682. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8683. m_Print.SetFontFace(25, 1, "宋体");
  8684. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8685. m_Print.SetFontFace(15, 1, "宋体");
  8686. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8687. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8688. m_Print.SetFontFace(9, 1, "宋体");
  8689. //////////////////////////////////////////////////////////////
  8690. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  8691. g_sendhead.code[0] = 54;
  8692. g_sendhead.code[1] = 223;
  8693. g_sendhead.code[2] = 52;
  8694. g_sendhead.tabcount = 3;
  8695. g_sendhead.bsql = 0;
  8696. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  8697. CArray<CStringArray, CStringArray>sparray;
  8698. CArray<CStringArray, CStringArray>clientarray;
  8699. DataToArray(&g_List1array, &sparray, &clientarray);
  8700. CString spno;
  8701. CStringArray sparray2;
  8702. for (int i = 0; i < sparray.GetSize(); i++)
  8703. {
  8704. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8705. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  8706. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8707. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8708. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8709. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  8710. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8711. sparray2.Add(sparray.ElementAt(i).ElementAt(9));
  8712. sparray2.Add(sparray.ElementAt(i).ElementAt(10));
  8713. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8714. }
  8715. for (i = 0; i < sparray.GetSize(); i++)
  8716. {
  8717. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  8718. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  8719. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  8720. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8721. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8722. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  8723. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8724. sparray2.Add(sparray.ElementAt(i).ElementAt(9));
  8725. sparray2.Add(sparray.ElementAt(i).ElementAt(10));
  8726. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8727. }
  8728. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  8729. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  8730. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  8731. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  8732. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  8733. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  8734. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  8735. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  8736. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  8737. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  8738. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  8739. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  8740. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  8741. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  8742. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  8743. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  8744. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  8745. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  8746. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  8747. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  8748. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  8749. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  8750. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  8751. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  8752. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  8753. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  8754. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  8755. CString m_sum3;
  8756. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  8757. ::ConvertToPrice(m_sum3);
  8758. if (m_money3.IsEmpty())m_money3 = "0";
  8759. int dty = 0;
  8760. CString name;
  8761. if (!m_name1.IsEmpty())
  8762. name = m_name1 + ",";
  8763. name += m_name2;
  8764. name.TrimRight(",");
  8765. CString phone;
  8766. if (!m_phone1.IsEmpty())
  8767. phone = m_phone1 + ",";
  8768. phone += m_phone2; phone.TrimRight(",");
  8769. if (IsHasRights2new(31) == 0)
  8770. phone = "***";
  8771. CStringArray strarray;
  8772. #ifdef CHILD_VERSION
  8773. if (m_birthday.IsEmpty())
  8774. strarray.Add("姓名/性别");
  8775. else
  8776. strarray.Add("姓名/性别/年龄");
  8777. #else
  8778. strarray.Add("客人姓名");
  8779. #endif
  8780. strarray.Add("电话");
  8781. strarray.Add("单号");
  8782. strarray.Add("套系");
  8783. strarray.Add("选样");
  8784. strarray.Add("余款/加挑");
  8785. strarray.Add("选片/日期");
  8786. #ifdef CHILD_VERSION
  8787. if (m_birthday.IsEmpty())
  8788. strarray.Add(name + "/" + m_sex);
  8789. else
  8790. {
  8791. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  8792. m_birthday.Format("%d", year + 1);
  8793. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  8794. }
  8795. #else
  8796. strarray.Add(name);
  8797. #endif
  8798. strarray.Add(phone);
  8799. strarray.Add(strOrderNumber);
  8800. strarray.Add(m_taoxiname);
  8801. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8802. strarray.Add(str);
  8803. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  8804. strarray.Add(str);
  8805. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  8806. for (i = 3; i <= 16; i++)
  8807. {
  8808. StrRect = load.m_rcarray.ElementAt(i - 1);
  8809. if (i < 10)
  8810. {
  8811. m_Print.DrawRect2(StrRect, 1);
  8812. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8813. }
  8814. }
  8815. StrRect = load.m_rcarray.ElementAt(29);
  8816. m_Print.DrawRect2(StrRect, 1);
  8817. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8818. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8819. {
  8820. Image *pImg = NULL;
  8821. g_nSendCode = 31;
  8822. int g_nYearposTemp = g_nYearpos;
  8823. g_nYearpos = -1;
  8824. g_pMainWnd->ProcessChatMessageRequest2(1);
  8825. g_nYearpos = g_nYearposTemp;
  8826. g_nSendCode = 0;
  8827. if (g_bSendOK == 0)return;
  8828. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8829. if (pImg)
  8830. {
  8831. StrRect.left = 485;
  8832. StrRect.top = 12;
  8833. StrRect.right = StrRect.left + 60;
  8834. StrRect.bottom = StrRect.top + 60;
  8835. m_Print.DrawImage(pImg, StrRect);
  8836. delete pImg; pImg = NULL;
  8837. }
  8838. }
  8839. CArray<CRect, CRect>rcarray;
  8840. CStringArray strarray2;
  8841. for (i = 10; i <= 16; i++)
  8842. {
  8843. StrRect = load.m_rcarray.ElementAt(i - 1);
  8844. StrRect.left += 2;
  8845. StrRect.right -= 2;
  8846. StrRect.top += 2;
  8847. rcarray.Add(StrRect);
  8848. strarray2.Add(strarray.ElementAt(7 + i - 10));
  8849. }
  8850. if (1)
  8851. {
  8852. StrRect = load.m_rcarray.ElementAt(30);
  8853. StrRect.left += 2;
  8854. StrRect.right -= 2;
  8855. StrRect.top += 2;
  8856. rcarray.Add(StrRect);
  8857. strarray2.Add(m_time6 + "/" + m_time5);
  8858. }
  8859. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8860. for (i = 10; i <= 16; i++)
  8861. {
  8862. StrRect = load.m_rcarray.ElementAt(i - 1);
  8863. if (i == 10)
  8864. {
  8865. dty += bottom - StrRect.bottom;
  8866. }
  8867. StrRect.bottom = bottom;
  8868. m_Print.DrawRect2(StrRect, 1);
  8869. }
  8870. if (1)
  8871. {
  8872. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  8873. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  8874. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  8875. }
  8876. m_Print.SetFontFace(15, 1, "宋体");
  8877. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  8878. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8879. m_Print.SetFontFace(9, 1, "宋体");
  8880. strarray.RemoveAll();
  8881. strarray.Add("产品名称");
  8882. strarray.Add("数量");
  8883. strarray.Add("P数");
  8884. strarray.Add("张数");
  8885. strarray.Add("照片编号");
  8886. CArray<CRect, CRect>rc2array;
  8887. int wid = 25;
  8888. for (i = 18; i <= 22; i++)
  8889. {
  8890. StrRect = load.m_rcarray.ElementAt(i - 1);
  8891. if (i == 19)
  8892. {
  8893. StrRect.right = StrRect.left + wid;
  8894. }
  8895. if (i == 20)
  8896. {
  8897. StrRect = load.m_rcarray.ElementAt(i - 2);
  8898. StrRect.left += wid; StrRect.right = StrRect.left;
  8899. StrRect.right += wid;
  8900. }
  8901. if (i == 21)
  8902. {
  8903. StrRect = load.m_rcarray.ElementAt(i - 3);
  8904. StrRect.left += wid * 2; StrRect.right = StrRect.left;
  8905. StrRect.right += wid;
  8906. wid = StrRect.right;
  8907. }
  8908. if (i == 22)
  8909. {
  8910. StrRect = load.m_rcarray.ElementAt(i - 3);
  8911. StrRect.left = wid;
  8912. }
  8913. StrRect.top += dty; StrRect.bottom += dty;
  8914. m_Print.DrawRect2(StrRect, 1);
  8915. StrRect.left += 2;
  8916. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8917. StrRect.left -= 2;
  8918. StrRect.top = StrRect.bottom;
  8919. StrRect.bottom += 18;
  8920. rc2array.Add(StrRect);
  8921. }
  8922. int curypos = 0;
  8923. for (i = 0; i < sparray2.GetSize(); i += 5)
  8924. {
  8925. rcarray.RemoveAll();
  8926. strarray2.RemoveAll();
  8927. for (int j = 0; j < 5; j++)
  8928. {
  8929. StrRect = rc2array.ElementAt(j);
  8930. StrRect.left += 2;
  8931. StrRect.right -= 2;
  8932. StrRect.top += 2;
  8933. rcarray.Add(StrRect);
  8934. strarray2.Add(sparray2.ElementAt(i + j));
  8935. }
  8936. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8937. rcarray.RemoveAll();
  8938. for (j = 0; j < 5; j++)
  8939. {
  8940. StrRect = rc2array.ElementAt(j);
  8941. if (j == 0)
  8942. {
  8943. dty += bottom - StrRect.bottom;
  8944. }
  8945. StrRect.bottom = bottom;
  8946. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  8947. StrRect.top = StrRect.bottom;
  8948. StrRect.bottom += 18;
  8949. rcarray.Add(StrRect);
  8950. }
  8951. rc2array.RemoveAll();
  8952. rc2array.Copy(rcarray);
  8953. }
  8954. m_Print.SetFontFace(15, 1, "宋体");
  8955. StrRect = load.m_rcarray.ElementAt(20);
  8956. dty = curypos - StrRect.bottom + 35;
  8957. StrRect.top += dty; StrRect.bottom += dty;
  8958. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8959. m_Print.SetFontFace(9, 1, "宋体");
  8960. rcarray.RemoveAll();
  8961. strarray2.RemoveAll();
  8962. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  8963. StrRect.left += 2;
  8964. StrRect.right -= 2;
  8965. StrRect.top += 2;
  8966. rcarray.Add(StrRect);
  8967. strarray2.Add(m_bz);
  8968. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8969. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  8970. dty += bottom - StrRect.bottom;
  8971. StrRect.bottom = bottom;
  8972. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  8973. m_Print.SetFontFace(10, 1, "宋体");
  8974. StrRect = load.m_rcarray.ElementAt(22);
  8975. dty = curypos - StrRect.bottom + 25;
  8976. StrRect.top += dty; StrRect.bottom += dty;
  8977. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  8978. if (m_edit9.IsEmpty())
  8979. {
  8980. m_edit9 = "\
  8981. 经确认后的照片均排入制作流程,\r\n\
  8982. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8983. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8984. }
  8985. CString info1, info2, info3;
  8986. int newlinepos = m_edit9.Find("\r\n");
  8987. if (newlinepos != -1)
  8988. {
  8989. info1 = m_edit9.Left(newlinepos);
  8990. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8991. }
  8992. newlinepos = m_edit9.Find("\r\n");
  8993. if (newlinepos != -1)
  8994. {
  8995. info2 = m_edit9.Left(newlinepos);
  8996. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8997. info3 = m_edit9;
  8998. }
  8999. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9000. StrRect = load.m_rcarray.ElementAt(23);
  9001. StrRect.top += dty; StrRect.bottom += dty;
  9002. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9003. StrRect = load.m_rcarray.ElementAt(24);
  9004. StrRect.top += dty; StrRect.bottom += dty;
  9005. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9006. StrRect.top += 15;
  9007. StrRect.bottom += 15;
  9008. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9009. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  9010. StrRect = load.m_rcarray.ElementAt(25);
  9011. StrRect.top += dty - dy;
  9012. StrRect.bottom += dty - dy;
  9013. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9014. StrRect = load.m_rcarray.ElementAt(26);
  9015. StrRect.top += dty - dy;
  9016. StrRect.bottom += dty - dy;
  9017. m_Print.DrawRect2(StrRect, 2);
  9018. StrRect = load.m_rcarray.ElementAt(25);
  9019. StrRect.top += dty + 15 - dy;
  9020. StrRect.bottom += dty + 15 - dy;
  9021. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9022. StrRect = load.m_rcarray.ElementAt(26);
  9023. StrRect.top += dty + 15 - dy;
  9024. StrRect.bottom += dty + 15 - dy;
  9025. m_Print.DrawRect2(StrRect, 2);
  9026. StrRect = load.m_rcarray.ElementAt(25);
  9027. StrRect.top += dty + 15 * 2 - dy;
  9028. StrRect.bottom += dty + 15 * 2 - dy;
  9029. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9030. StrRect = load.m_rcarray.ElementAt(26);
  9031. StrRect.top += dty + 15 * 2 - dy;
  9032. StrRect.bottom += dty + 15 * 2 - dy;
  9033. m_Print.DrawRect2(StrRect, 2);
  9034. PrintPreview dlg; dlg.m_mode = 2;
  9035. dlg.m_name = name;
  9036. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  9037. dlg.m_pDC = m_Print.GetPDC();
  9038. if (aa == 0)
  9039. {
  9040. if (dlg.DoModal() != IDOK)
  9041. return;
  9042. printcot = dlg.m_num;
  9043. }
  9044. //结束打印
  9045. m_Print.EndPage();
  9046. m_Print.EndPrint();
  9047. }
  9048. }
  9049. void CMainFrame::PrintFlowChart3(CString strOrderNumber) // 选片打单 风格2;
  9050. {
  9051. #ifdef LKAY_VERSION
  9052. PrintFlowChart3LKAY(strOrderNumber);
  9053. return;
  9054. #endif
  9055. int printcot = 1;
  9056. for (int aa = 0; aa < printcot; aa++)
  9057. {
  9058. BOOL bSecondPage = 0;
  9059. int nPrintedPos = 0;
  9060. for (int bb = 0; bb < 2; bb++)
  9061. {
  9062. if (bb && bSecondPage == 0)break;
  9063. CPrintRX m_Print;
  9064. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58))) // 58-[version].[setcheck1] ==1,使用默认打印机;
  9065. {
  9066. m_Print.InitToPrint(NULL, 1);
  9067. }
  9068. else // 否则使用指定的打印机;
  9069. {
  9070. CString name = g_cominfoarray.ElementAt(0).ElementAt(64); // 64-[version].[printer2] 制作单打印机;
  9071. if (name.IsEmpty())
  9072. m_Print.InitToPrint(NULL, 1);
  9073. else
  9074. {
  9075. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9076. if (nret == -1 && aa == 0)
  9077. {
  9078. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9079. }
  9080. }
  9081. }
  9082. m_Print.StartPrint();
  9083. m_Print.StartPage();
  9084. LoadRect load;
  9085. load.SetLiaPath("18.lia");
  9086. load.SetMargins(10, 0);
  9087. if (!load.Load())return;
  9088. CString str;
  9089. int rcpos = -1;
  9090. // ■■■■■■从18.lia获取到第一个区域大小 - 1.显示店名;
  9091. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  9092. if ((bb == 0 && bSecondPage == 0))
  9093. {
  9094. m_Print.SetFontFace(25, 1, "宋体");
  9095. // 10-[version].[info1] 店名;
  9096. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9097. m_Print.SetFontFace(15, 1, "宋体");
  9098. // ■■■■■■从18.lia获取第二个区域大小 - 2.显示"基本资料";
  9099. StrRect = load.m_rcarray.ElementAt(++rcpos);
  9100. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9101. m_Print.SetFontFace(9, 1, "宋体");
  9102. }
  9103. //////////////////////////////////////////////////////////////
  9104. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  9105. g_sendhead.code[0] = 54; // dindan;
  9106. g_sendhead.code[1] = 223; // dindanspview2; shangpin+dindansp;
  9107. g_sendhead.code[2] = 52; // client;
  9108. g_sendhead.tabcount = 3;
  9109. g_sendhead.bsql = 0;
  9110. g_pMainWnd->ProcessChatMessageRequest2(filter);
  9111. if (g_bSendOK == 0)return;
  9112. CArray<CStringArray, CStringArray>sparray;
  9113. CArray<CStringArray, CStringArray>clientarray;
  9114. DataToArray(&g_List1array, &sparray, &clientarray);
  9115. CString spno;
  9116. CStringArray sparray2;
  9117. for (int i = 0; i < sparray.GetSize(); i++)
  9118. {
  9119. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9120. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  9121. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  9122. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9123. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  9124. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9125. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  9126. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  9127. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  9128. }
  9129. for (i = 0; i < sparray.GetSize(); i++)
  9130. {
  9131. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  9132. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  9133. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  9134. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9135. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  9136. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9137. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  9138. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  9139. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  9140. }
  9141. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  9142. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  9143. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  9144. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  9145. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  9146. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  9147. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  9148. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  9149. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  9150. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  9151. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  9152. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  9153. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  9154. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  9155. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  9156. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  9157. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  9158. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  9159. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  9160. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  9161. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  9162. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  9163. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  9164. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  9165. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  9166. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  9167. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  9168. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  9169. CString m_sum3;
  9170. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  9171. ::ConvertToPrice(m_sum3);
  9172. if (m_money3.IsEmpty())m_money3 = "0";
  9173. int dty = 0;
  9174. CString name;
  9175. if (!m_name1.IsEmpty())
  9176. name = m_name1 + ",";
  9177. name += m_name2;
  9178. name.TrimRight(",");
  9179. CString phone;
  9180. if (!m_phone1.IsEmpty())
  9181. phone = m_phone1 + ",";
  9182. phone += m_phone2; phone.TrimRight(",");
  9183. if (IsHasRights2new(31) == 0)
  9184. phone = "***";
  9185. CStringArray strarray;
  9186. CArray<CRect, CRect>rcarray;
  9187. CStringArray strarray2; CArray<CRect, CRect>rc2array;
  9188. int bottom;
  9189. if ((bb == 0 && bSecondPage == 0))
  9190. {
  9191. #ifdef CHILD_VERSION
  9192. if (m_birthday.IsEmpty())
  9193. strarray.Add("姓名/性别");
  9194. else
  9195. strarray.Add("姓名/性别/年龄");
  9196. #else
  9197. strarray.Add("客人姓名"); // 第3.1区域 -3.显示客人姓名;
  9198. #endif
  9199. strarray.Add("电话");
  9200. strarray.Add("单号");
  9201. strarray.Add("套系");
  9202. strarray.Add("选样");
  9203. strarray.Add("余款/加挑");
  9204. strarray.Add("选片/日期");
  9205. #ifdef CHILD_VERSION
  9206. if (m_birthday.IsEmpty())
  9207. strarray.Add(name + "/" + m_sex);
  9208. else
  9209. {
  9210. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  9211. m_birthday.Format("%d", year + 1);
  9212. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  9213. }
  9214. #else
  9215. strarray.Add(name); // 第4.1区域 -3.显示客人姓名;
  9216. #endif
  9217. strarray.Add(phone);
  9218. strarray.Add(strOrderNumber);
  9219. strarray.Add(m_taoxiname);
  9220. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9221. strarray.Add(str);
  9222. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  9223. strarray.Add(str);
  9224. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  9225. for (i = 3; i <= 16; i++)
  9226. {
  9227. // ■■■■■■从18.lia中获取第3~16的区域大小;
  9228. StrRect = load.m_rcarray.ElementAt(i - 1);
  9229. if (i < 10)
  9230. {
  9231. m_Print.DrawRect2(StrRect, 1);
  9232. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9233. }
  9234. }
  9235. // ■■■■■■从18.lia中获取第30的区域大小;
  9236. StrRect = load.m_rcarray.ElementAt(29);
  9237. m_Print.DrawRect2(StrRect, 1);
  9238. BOOL bPrintDate = 1;
  9239. #ifdef DDF_VERSION
  9240. // bPrintDate=0;
  9241. #else
  9242. if (m_time5 == "" && m_time6 == "")
  9243. bPrintDate = 0;
  9244. #endif
  9245. if (bPrintDate)
  9246. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9247. else
  9248. {
  9249. #ifdef CHILD_VERSION
  9250. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9251. #else
  9252. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9253. #endif
  9254. }
  9255. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138))) // [version].[reverse3]
  9256. {
  9257. Image *pImg = NULL;
  9258. g_nSendCode = 31;
  9259. int g_nYearposTemp = g_nYearpos;
  9260. g_nYearpos = -1;
  9261. g_pMainWnd->ProcessChatMessageRequest2(1);
  9262. g_nYearpos = g_nYearposTemp;
  9263. g_nSendCode = 0;
  9264. if (g_bSendOK == 0)return;
  9265. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  9266. // Jeff二维码的区域不是从18.lia里获取的,是固定在右上角指定区域;
  9267. if (pImg)
  9268. {
  9269. StrRect.left = 485;
  9270. StrRect.top = 12;
  9271. StrRect.right = StrRect.left + 60;
  9272. StrRect.bottom = StrRect.top + 60;
  9273. m_Print.DrawImage(pImg, StrRect);
  9274. delete pImg; pImg = NULL;
  9275. }
  9276. }
  9277. // CArray<CRect,CRect>rcarray;
  9278. // CStringArray strarray2;
  9279. // ■■■■■■从18.lia中获取第10的区域大小;
  9280. for (i = 10; i <= 16; i++)
  9281. {
  9282. StrRect = load.m_rcarray.ElementAt(i - 1);
  9283. StrRect.left += 2;
  9284. StrRect.right -= 2;
  9285. StrRect.top += 2;
  9286. rcarray.Add(StrRect);
  9287. strarray2.Add(strarray.ElementAt(7 + i - 10));
  9288. }
  9289. if (1)
  9290. {
  9291. // ■■■■■■从18.lia中获取第31的区域大小;
  9292. StrRect = load.m_rcarray.ElementAt(30);
  9293. StrRect.left += 2;
  9294. StrRect.right -= 2;
  9295. StrRect.top += 2;
  9296. rcarray.Add(StrRect);
  9297. if (bPrintDate)
  9298. strarray2.Add(m_time6 + "/" + m_time5);
  9299. else
  9300. {
  9301. strarray2.Add(m_waiter1 + "/" + m_waiter2);
  9302. }
  9303. }
  9304. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9305. for (i = 10; i <= 16; i++)
  9306. {
  9307. StrRect = load.m_rcarray.ElementAt(i - 1);
  9308. if (i == 10)
  9309. {
  9310. dty += bottom - StrRect.bottom;
  9311. }
  9312. StrRect.bottom = bottom;
  9313. m_Print.DrawRect2(StrRect, 1);
  9314. }
  9315. if (1)
  9316. {
  9317. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  9318. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  9319. }
  9320. m_Print.SetFontFace(15, 1, "宋体");
  9321. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  9322. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9323. }
  9324. int curypos = 0;
  9325. int oldpos = 0;
  9326. if (bb == 1)
  9327. {
  9328. dty = -100;
  9329. oldpos = nPrintedPos;
  9330. if (oldpos == 0)oldpos = 10000;
  9331. }
  9332. m_Print.SetFontFace(9, 1, "宋体");
  9333. strarray.RemoveAll();
  9334. if ((oldpos != 10000 && oldpos < sparray2.GetSize()) || bb == 0)
  9335. {
  9336. strarray.Add("产品名称");
  9337. strarray.Add("数量");
  9338. strarray.Add("照片编号");
  9339. for (i = 18; i <= 20; i++)
  9340. {
  9341. StrRect = load.m_rcarray.ElementAt(i - 1);
  9342. StrRect.top += dty;
  9343. StrRect.bottom += dty;
  9344. m_Print.DrawRect2(StrRect, 1);
  9345. StrRect.left += 2;
  9346. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9347. StrRect.left -= 2;
  9348. StrRect.top = StrRect.bottom;
  9349. StrRect.bottom += 18;
  9350. rc2array.Add(StrRect);
  9351. }
  9352. }
  9353. for (i = oldpos; i < sparray2.GetSize(); i += 3)
  9354. {
  9355. rcarray.RemoveAll();
  9356. strarray2.RemoveAll();
  9357. for (int j = 0; j < 3; j++)
  9358. {
  9359. StrRect = rc2array.ElementAt(j);
  9360. StrRect.left += 2;
  9361. StrRect.right -= 2;
  9362. StrRect.top += 2;
  9363. rcarray.Add(StrRect);
  9364. #if JEFF_TEST_ON
  9365. if (2 == j)
  9366. {
  9367. CString strImg = sparray2.ElementAt(i + 2);
  9368. int nImgCount = strImg.Replace(",", ",");
  9369. if (nImgCount != 0)
  9370. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
  9371. else if (!strImg.IsEmpty())
  9372. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  9373. strarray2.Add(strImg);
  9374. }
  9375. else
  9376. strarray2.Add(sparray2.ElementAt(i + j));
  9377. #else
  9378. strarray2.Add(sparray2.ElementAt(i + j));
  9379. #endif
  9380. }
  9381. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9382. rcarray.RemoveAll();
  9383. for (j = 0; j < 3; j++)
  9384. {
  9385. StrRect = rc2array.ElementAt(j);
  9386. if (j == 0)
  9387. {
  9388. dty += bottom - StrRect.bottom;
  9389. }
  9390. StrRect.bottom = bottom;
  9391. m_Print.DrawRect2(StrRect, 1);
  9392. curypos = StrRect.bottom;
  9393. StrRect.top = StrRect.bottom;
  9394. StrRect.bottom += 18;
  9395. rcarray.Add(StrRect);
  9396. }
  9397. rc2array.RemoveAll();
  9398. rc2array.Copy(rcarray);
  9399. if (bottom > 750)
  9400. {
  9401. bSecondPage = 1;
  9402. nPrintedPos = i + 3;
  9403. break;
  9404. }
  9405. }
  9406. if ((bb == 0 && bSecondPage == 0) || (bb == 1 && bSecondPage == 1))
  9407. {
  9408. m_Print.SetFontFace(15, 1, "宋体");
  9409. StrRect = load.m_rcarray.ElementAt(20);
  9410. dty = curypos - StrRect.bottom + 35;
  9411. StrRect.top += dty;
  9412. StrRect.bottom += dty;
  9413. if (StrRect.bottom > 700 && bb == 0)
  9414. {
  9415. bSecondPage = 1;
  9416. }
  9417. else
  9418. {
  9419. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9420. m_Print.SetFontFace(9, 1, "宋体");
  9421. rcarray.RemoveAll();
  9422. strarray2.RemoveAll();
  9423. StrRect = load.m_rcarray.ElementAt(21);
  9424. StrRect.top += dty;
  9425. StrRect.bottom += dty;
  9426. StrRect.left += 2;
  9427. StrRect.right -= 2;
  9428. StrRect.top += 2;
  9429. rcarray.Add(StrRect);
  9430. #if JEFF_TEST_ON
  9431. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  9432. strarray2.RemoveAll();
  9433. CString strFind = "要求:";
  9434. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  9435. do
  9436. {
  9437. int nIndex = strbz3.Find(strFind, 1);
  9438. if (nIndex != -1)
  9439. {
  9440. CString strbz = strbz3.Left(nIndex);
  9441. strbz3 = strbz3.Mid(nIndex);
  9442. strarray2.Add(strbz);
  9443. }
  9444. else
  9445. {
  9446. strarray2.Add(strbz3);
  9447. strbz3 = "";
  9448. }
  9449. } while (strbz3.Find(strFind) != -1);
  9450. strarray2.Add(g_List1array.ElementAt(0).ElementAt(29));
  9451. strarray2.Add(g_List1array.ElementAt(0).ElementAt(23));
  9452. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  9453. #else
  9454. strarray2.Add(m_bz);
  9455. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9456. #endif
  9457. StrRect = load.m_rcarray.ElementAt(21);
  9458. StrRect.top += dty;
  9459. StrRect.bottom += dty;
  9460. dty += bottom - StrRect.bottom;
  9461. StrRect.bottom = bottom;
  9462. m_Print.DrawRect2(StrRect, 1);
  9463. curypos = StrRect.bottom;
  9464. m_Print.SetFontFace(10, 1, "宋体");
  9465. StrRect = load.m_rcarray.ElementAt(22);
  9466. dty = curypos - StrRect.bottom + 25;
  9467. StrRect.top += dty;
  9468. StrRect.bottom += dty;
  9469. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  9470. if (m_edit9.IsEmpty())
  9471. {
  9472. m_edit9 = "\
  9473. 经确认后的照片均排入制作流程,\r\n\
  9474. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9475. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9476. }
  9477. CString info1, info2, info3;
  9478. int newlinepos = m_edit9.Find("\r\n");
  9479. if (newlinepos != -1)
  9480. {
  9481. info1 = m_edit9.Left(newlinepos);
  9482. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9483. }
  9484. newlinepos = m_edit9.Find("\r\n");
  9485. if (newlinepos != -1)
  9486. {
  9487. info2 = m_edit9.Left(newlinepos);
  9488. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9489. info3 = m_edit9;
  9490. }
  9491. #ifdef QCH_VERSION
  9492. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9493. StrRect = load.m_rcarray.ElementAt(23);
  9494. StrRect.top += dty; StrRect.bottom += dty;
  9495. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9496. StrRect=load.m_rcarray .ElementAt (24);
  9497. StrRect.top +=dty;StrRect.bottom +=dty;
  9498. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9499. StrRect.top +=15;
  9500. StrRect.bottom +=15;
  9501. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9502. #else
  9503. if (1)
  9504. {
  9505. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9506. StrRect = load.m_rcarray.ElementAt(23);
  9507. StrRect.top += dty; StrRect.bottom += dty;
  9508. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9509. StrRect = load.m_rcarray.ElementAt(24);
  9510. StrRect.top += dty; StrRect.bottom += dty;
  9511. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9512. }
  9513. else
  9514. {
  9515. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9516. StrRect = load.m_rcarray.ElementAt(23);
  9517. StrRect.top += dty; StrRect.bottom += dty;
  9518. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9519. StrRect = load.m_rcarray.ElementAt(24);
  9520. StrRect.top += dty; StrRect.bottom += dty;
  9521. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9522. }
  9523. StrRect.top += 15;
  9524. StrRect.bottom += 15;
  9525. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9526. #endif
  9527. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  9528. StrRect = load.m_rcarray.ElementAt(25);
  9529. StrRect.top += dty - dy;
  9530. StrRect.bottom += dty - dy;
  9531. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9532. StrRect = load.m_rcarray.ElementAt(26);
  9533. StrRect.top += dty - dy;
  9534. StrRect.bottom += dty - dy;
  9535. m_Print.DrawRect2(StrRect, 2);
  9536. StrRect = load.m_rcarray.ElementAt(25);
  9537. StrRect.top += dty + 15 - dy;
  9538. StrRect.bottom += dty + 15 - dy;
  9539. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9540. StrRect = load.m_rcarray.ElementAt(26);
  9541. StrRect.top += dty + 15 - dy;
  9542. StrRect.bottom += dty + 15 - dy;
  9543. m_Print.DrawRect2(StrRect, 2);
  9544. StrRect = load.m_rcarray.ElementAt(25);
  9545. StrRect.top += dty + 15 * 2 - dy;
  9546. StrRect.bottom += dty + 15 * 2 - dy;
  9547. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9548. StrRect = load.m_rcarray.ElementAt(26);
  9549. StrRect.top += dty + 15 * 2 - dy;
  9550. StrRect.bottom += dty + 15 * 2 - dy;
  9551. m_Print.DrawRect2(StrRect, 2);
  9552. }
  9553. }
  9554. PrintPreview dlg; dlg.m_mode = 2;
  9555. dlg.m_name = name;
  9556. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  9557. dlg.m_pDC = m_Print.GetPDC();
  9558. if (aa == 0)
  9559. {
  9560. if (dlg.DoModal() != IDOK)
  9561. return;
  9562. printcot = dlg.m_num;
  9563. }
  9564. //结束打印
  9565. m_Print.EndPage();
  9566. m_Print.EndPrint();
  9567. }
  9568. }
  9569. }
  9570. /*
  9571. void CMainFrame::PrintFlowChart3(CString m_id)
  9572. {
  9573. #ifdef LKAY_VERSION
  9574. PrintFlowChart3LKAY(m_id);
  9575. return;
  9576. #endif
  9577. int printcot=1;
  9578. for(int aa=0; aa<printcot; aa++)
  9579. {
  9580. CPrintRX m_Print;
  9581. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9582. {
  9583. m_Print.InitToPrint(NULL, 1);
  9584. }
  9585. else
  9586. {
  9587. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  9588. if(name.IsEmpty ())
  9589. m_Print.InitToPrint(NULL, 1);
  9590. else
  9591. {
  9592. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9593. if(nret==-1 && aa==0)
  9594. {
  9595. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9596. }
  9597. }
  9598. }
  9599. m_Print.StartPrint();
  9600. m_Print.StartPage();
  9601. LoadRect load;
  9602. load.SetLiaPath ("18.lia");
  9603. load.SetMargins(10,0);
  9604. if(!load.Load ())return;
  9605. CString str;
  9606. int rcpos=-1;
  9607. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9608. m_Print.SetFontFace(25, 1, "宋体");
  9609. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9610. m_Print.SetFontFace(15, 1, "宋体");
  9611. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9612. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9613. m_Print.SetFontFace(9, 1, "宋体");
  9614. //////////////////////////////////////////////////////////////
  9615. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9616. g_sendhead.code[0]=54;
  9617. g_sendhead.code[1]=50;
  9618. g_sendhead.code[2]=52;
  9619. g_sendhead.tabcount=3;
  9620. g_sendhead.bsql=0;
  9621. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9622. CArray<CStringArray, CStringArray>sparray;
  9623. CArray<CStringArray, CStringArray>clientarray;
  9624. DataToArray(&g_List1array,&sparray,&clientarray);
  9625. CString spno;
  9626. CStringArray sparray2;
  9627. for(int i=0; i<sparray.GetSize (); i++)
  9628. {
  9629. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9630. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9631. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9632. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9633. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9634. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9635. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9636. }
  9637. for( i=0; i<sparray.GetSize (); i++)
  9638. {
  9639. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9640. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9641. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9642. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9643. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9644. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9645. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9646. }
  9647. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9648. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9649. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9650. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9651. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9652. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9653. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9654. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9655. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9656. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9657. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9658. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9659. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9660. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9661. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9662. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9663. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9664. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9665. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  9666. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  9667. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9668. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9669. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9670. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9671. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9672. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9673. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9674. CString m_sum3;
  9675. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9676. ::ConvertToPrice (m_sum3);
  9677. if(m_money3.IsEmpty ())m_money3="0";
  9678. int dty=0;
  9679. CString name;
  9680. if(!m_name1.IsEmpty ())
  9681. name=m_name1+",";
  9682. name+=m_name2;
  9683. name.TrimRight (",");
  9684. CString phone;
  9685. if(!m_phone1.IsEmpty ())
  9686. phone=m_phone1+",";
  9687. phone+=m_phone2;phone.TrimRight (",");
  9688. if(IsHasRights2new(31)==0)
  9689. phone="***";
  9690. CStringArray strarray;
  9691. #ifdef CHILD_VERSION
  9692. if(m_birthday.IsEmpty ())
  9693. strarray.Add ("姓名/性别");
  9694. else
  9695. strarray.Add ("姓名/性别/年龄");
  9696. #else
  9697. strarray.Add ("客人姓名");
  9698. #endif
  9699. strarray.Add ("电话");
  9700. strarray.Add ("单号");
  9701. strarray.Add ("套系");
  9702. strarray.Add ("选样");
  9703. strarray.Add ("余款/加挑");
  9704. strarray.Add ("选片/日期");
  9705. #ifdef CHILD_VERSION
  9706. if(m_birthday.IsEmpty ())
  9707. strarray.Add (name+"/"+m_sex);
  9708. else
  9709. {
  9710. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9711. m_birthday.Format ("%d", year+1);
  9712. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9713. }
  9714. #else
  9715. strarray.Add (name);
  9716. #endif
  9717. strarray.Add (phone);
  9718. strarray.Add (m_id);
  9719. strarray.Add (m_taoxiname);
  9720. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9721. strarray.Add (str);
  9722. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9723. strarray.Add (str);
  9724. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  9725. for( i=3; i<=16; i++)
  9726. {
  9727. StrRect=load.m_rcarray .ElementAt (i-1);
  9728. if(i<10)
  9729. {
  9730. m_Print.DrawRect2(StrRect, 1);
  9731. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9732. }
  9733. }
  9734. StrRect=load.m_rcarray .ElementAt (29);
  9735. m_Print.DrawRect2(StrRect, 1);
  9736. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9737. CArray<CRect,CRect>rcarray;
  9738. CStringArray strarray2;
  9739. for( i=10; i<=16; i++)
  9740. {
  9741. StrRect=load.m_rcarray .ElementAt (i-1);
  9742. StrRect.left +=2;
  9743. StrRect.right -=2;
  9744. StrRect.top +=2;
  9745. rcarray.Add (StrRect);
  9746. strarray2.Add (strarray.ElementAt (7+i-10));
  9747. }
  9748. if(1)
  9749. {
  9750. StrRect=load.m_rcarray .ElementAt (30);
  9751. StrRect.left +=2;
  9752. StrRect.right -=2;
  9753. StrRect.top +=2;
  9754. rcarray.Add (StrRect);
  9755. strarray2.Add (m_time6+"/"+m_time5);
  9756. }
  9757. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9758. for( i=10; i<=16; i++)
  9759. {
  9760. StrRect=load.m_rcarray .ElementAt (i-1);
  9761. if(i==10)
  9762. {
  9763. dty+=bottom-StrRect.bottom;
  9764. }
  9765. StrRect.bottom =bottom;
  9766. m_Print.DrawRect2(StrRect, 1);
  9767. }
  9768. if(1)
  9769. {
  9770. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9771. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9772. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  9773. }
  9774. m_Print.SetFontFace(15, 1, "宋体");
  9775. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9776. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9777. m_Print.SetFontFace(9, 1, "宋体");
  9778. strarray.RemoveAll ();
  9779. strarray.Add ("产品名称");
  9780. strarray.Add ("数量");
  9781. strarray.Add ("照片编号");
  9782. CArray<CRect,CRect>rc2array;
  9783. for( i=18; i<=20; i++)
  9784. {
  9785. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9786. m_Print.DrawRect2(StrRect, 1);
  9787. StrRect.left +=2;
  9788. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9789. StrRect.left -=2;
  9790. StrRect.top =StrRect.bottom ;
  9791. StrRect.bottom +=18;
  9792. rc2array.Add (StrRect);
  9793. }
  9794. int curypos=0;
  9795. for(i=0; i<sparray2.GetSize (); i+=3)
  9796. {
  9797. rcarray.RemoveAll ();
  9798. strarray2.RemoveAll ();
  9799. for(int j=0; j<3; j++)
  9800. {
  9801. StrRect=rc2array.ElementAt (j);
  9802. StrRect.left +=2;
  9803. StrRect.right -=2;
  9804. StrRect.top +=2;
  9805. rcarray.Add (StrRect);
  9806. strarray2.Add (sparray2.ElementAt (i+j));
  9807. }
  9808. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9809. rcarray.RemoveAll ();
  9810. for( j=0; j<3; j++)
  9811. {
  9812. StrRect=rc2array.ElementAt (j);
  9813. if(j==0)
  9814. {
  9815. dty+=bottom-StrRect.bottom;
  9816. }
  9817. StrRect.bottom =bottom;
  9818. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9819. StrRect.top =StrRect.bottom ;
  9820. StrRect.bottom +=18;
  9821. rcarray.Add (StrRect);
  9822. }
  9823. rc2array.RemoveAll ();
  9824. rc2array.Copy(rcarray);
  9825. }
  9826. m_Print.SetFontFace(15, 1, "宋体");
  9827. StrRect=load.m_rcarray .ElementAt (20);
  9828. dty=curypos-StrRect.bottom+35;
  9829. StrRect.top +=dty;StrRect.bottom +=dty;
  9830. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9831. m_Print.SetFontFace(9, 1, "宋体");
  9832. rcarray.RemoveAll ();
  9833. strarray2.RemoveAll ();
  9834. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9835. StrRect.left +=2;
  9836. StrRect.right -=2;
  9837. StrRect.top +=2;
  9838. rcarray.Add (StrRect);
  9839. strarray2.Add (m_bz);
  9840. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9841. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9842. dty+=bottom-StrRect.bottom;
  9843. StrRect.bottom =bottom;
  9844. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9845. m_Print.SetFontFace(10, 1, "宋体");
  9846. StrRect=load.m_rcarray .ElementAt (22);
  9847. dty=curypos-StrRect.bottom+25;
  9848. StrRect.top +=dty;StrRect.bottom +=dty;
  9849. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9850. if(m_edit9.IsEmpty())
  9851. {
  9852. m_edit9="\
  9853. 经确认后的照片均排入制作流程,\r\n\
  9854. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9855. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9856. }
  9857. CString info1,info2,info3;
  9858. int newlinepos=m_edit9.Find("\r\n");
  9859. if(newlinepos!=-1)
  9860. {
  9861. info1=m_edit9.Left(newlinepos);
  9862. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9863. }
  9864. newlinepos=m_edit9.Find("\r\n");
  9865. if(newlinepos!=-1)
  9866. {
  9867. info2=m_edit9.Left(newlinepos);
  9868. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9869. info3=m_edit9;
  9870. }
  9871. #ifdef QCH_VERSION
  9872. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9873. StrRect=load.m_rcarray .ElementAt (23);
  9874. StrRect.top +=dty;StrRect.bottom +=dty;
  9875. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9876. StrRect=load.m_rcarray .ElementAt (24);
  9877. StrRect.top +=dty;StrRect.bottom +=dty;
  9878. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9879. StrRect.top +=15;
  9880. StrRect.bottom +=15;
  9881. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9882. #else
  9883. if(1)
  9884. {
  9885. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9886. StrRect=load.m_rcarray .ElementAt (23);
  9887. StrRect.top +=dty;StrRect.bottom +=dty;
  9888. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9889. StrRect=load.m_rcarray .ElementAt (24);
  9890. StrRect.top +=dty;StrRect.bottom +=dty;
  9891. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9892. }
  9893. else
  9894. {
  9895. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9896. StrRect=load.m_rcarray .ElementAt (23);
  9897. StrRect.top +=dty;StrRect.bottom +=dty;
  9898. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9899. StrRect=load.m_rcarray .ElementAt (24);
  9900. StrRect.top +=dty;StrRect.bottom +=dty;
  9901. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9902. }
  9903. StrRect.top +=15;
  9904. StrRect.bottom +=15;
  9905. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9906. #endif
  9907. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  9908. StrRect=load.m_rcarray .ElementAt (25);
  9909. StrRect.top +=dty-dy;
  9910. StrRect.bottom +=dty-dy;
  9911. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9912. StrRect=load.m_rcarray .ElementAt (26);
  9913. StrRect.top +=dty-dy;
  9914. StrRect.bottom +=dty-dy;
  9915. m_Print.DrawRect2(StrRect, 2);
  9916. StrRect=load.m_rcarray .ElementAt (25);
  9917. StrRect.top +=dty+15-dy;
  9918. StrRect.bottom +=dty+15-dy;
  9919. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9920. StrRect=load.m_rcarray .ElementAt (26);
  9921. StrRect.top +=dty+15-dy;
  9922. StrRect.bottom +=dty+15-dy;
  9923. m_Print.DrawRect2(StrRect, 2);
  9924. StrRect=load.m_rcarray .ElementAt (25);
  9925. StrRect.top +=dty+15*2-dy;
  9926. StrRect.bottom +=dty+15*2-dy;
  9927. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9928. StrRect=load.m_rcarray .ElementAt (26);
  9929. StrRect.top +=dty+15*2-dy;
  9930. StrRect.bottom +=dty+15*2-dy;
  9931. m_Print.DrawRect2(StrRect, 2);
  9932. PrintPreview dlg;dlg.m_mode=2;
  9933. dlg.m_name =name;
  9934. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9935. dlg.m_pDC =m_Print.GetPDC() ;
  9936. if(aa==0)
  9937. {
  9938. if(dlg.DoModal ()!=IDOK)
  9939. return;
  9940. printcot=dlg.m_num;
  9941. }
  9942. //结束打印
  9943. m_Print.EndPage();
  9944. m_Print.EndPrint();
  9945. }
  9946. }
  9947. */
  9948. //void CMainFrame::PrintFlowChart4(CString m_id) // 选设计打单函数;
  9949. void CMainFrame::PrintFlowChart4(CString strOrderNumber) // 选设计打单函数,使用18.lia文件;
  9950. {
  9951. int printcot = 1;
  9952. for (int aa = 0; aa < printcot; aa++)
  9953. {
  9954. CPrintRX m_Print;
  9955. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9956. {
  9957. m_Print.InitToPrint(NULL, 1);
  9958. }
  9959. else
  9960. {
  9961. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  9962. if (name.IsEmpty())
  9963. m_Print.InitToPrint(NULL, 1);
  9964. else
  9965. {
  9966. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9967. if (nret == -1 && aa == 0)
  9968. {
  9969. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9970. }
  9971. }
  9972. }
  9973. m_Print.StartPrint();
  9974. m_Print.StartPage();
  9975. LoadRect load;
  9976. load.SetLiaPath("18.lia");
  9977. load.SetMargins(10, 0);
  9978. if (!load.Load())return;
  9979. CString str;
  9980. int rcpos = -1;
  9981. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  9982. m_Print.SetFontFace(25, 1, "宋体");
  9983. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9984. m_Print.SetFontFace(15, 1, "宋体");
  9985. StrRect = load.m_rcarray.ElementAt(++rcpos);
  9986. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9987. m_Print.SetFontFace(9, 1, "宋体");
  9988. //////////////////////////////////////////////////////////////
  9989. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  9990. g_sendhead.code[0] = 54;
  9991. g_sendhead.code[1] = 223;
  9992. g_sendhead.code[2] = 52;
  9993. g_sendhead.tabcount = 3;
  9994. g_sendhead.bsql = 0;
  9995. g_pMainWnd->ProcessChatMessageRequest2(filter);
  9996. if (g_bSendOK == 0)return;
  9997. CArray<CStringArray, CStringArray>sparray;
  9998. CArray<CStringArray, CStringArray>clientarray;
  9999. DataToArray(&g_List1array, &sparray, &clientarray);
  10000. CString spno;
  10001. CStringArray sparray2;
  10002. for (int i = 0; i < sparray.GetSize(); i++)
  10003. {
  10004. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  10005. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(8).IsEmpty())continue;
  10006. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  10007. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  10008. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  10009. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  10010. sparray2.Add(sparray.ElementAt(i).ElementAt(8));
  10011. }
  10012. for (i = 0; i < sparray.GetSize(); i++)
  10013. {
  10014. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  10015. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  10016. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  10017. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  10018. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  10019. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  10020. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  10021. sparray2.Add(sparray.ElementAt(i).ElementAt(8));
  10022. }
  10023. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  10024. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  10025. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  10026. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  10027. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  10028. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  10029. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  10030. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  10031. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  10032. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  10033. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  10034. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  10035. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  10036. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  10037. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  10038. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  10039. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  10040. CString m_bz = g_List1array.ElementAt(0).ElementAt(17);
  10041. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(25);
  10042. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  10043. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  10044. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  10045. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  10046. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  10047. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  10048. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  10049. CString m_waiter8 = g_List1array.ElementAt(0).ElementAt(27);
  10050. CString m_replace = g_List1array.ElementAt(0).ElementAt(28);
  10051. if (!m_replace.IsEmpty())
  10052. {
  10053. m_replace = "设计替换照片:" + m_replace;
  10054. m_replace.Replace("$", ";");
  10055. m_replace.TrimLeft(";");
  10056. m_bz += ";";
  10057. m_bz += m_replace;
  10058. }
  10059. CString m_sum3;
  10060. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  10061. ::ConvertToPrice(m_sum3);
  10062. if (m_money3.IsEmpty())m_money3 = "0";
  10063. int dty = 0;
  10064. CString name;
  10065. if (!m_name1.IsEmpty())
  10066. name = m_name1 + ",";
  10067. name += m_name2;
  10068. name.TrimRight(",");
  10069. CString phone;
  10070. if (!m_phone1.IsEmpty())
  10071. phone = m_phone1 + ",";
  10072. phone += m_phone2; phone.TrimRight(",");
  10073. if (IsHasRights2new(31) == 0)
  10074. phone = "***";
  10075. CStringArray strarray;
  10076. #ifdef CHILD_VERSION
  10077. if (m_birthday.IsEmpty())
  10078. strarray.Add("姓名/性别");
  10079. else
  10080. strarray.Add("姓名/性别/年龄");
  10081. #else
  10082. strarray.Add("客人姓名");
  10083. #endif
  10084. strarray.Add("电话");
  10085. strarray.Add("单号");
  10086. strarray.Add("套系");
  10087. strarray.Add("");
  10088. strarray.Add("余款/加挑");
  10089. strarray.Add("看设计/日期");
  10090. #ifdef CHILD_VERSION
  10091. if (m_birthday.IsEmpty())
  10092. strarray.Add(name + "/" + m_sex);
  10093. else
  10094. {
  10095. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  10096. m_birthday.Format("%d", year + 1);
  10097. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  10098. }
  10099. #else
  10100. strarray.Add(name);
  10101. #endif
  10102. strarray.Add(phone);
  10103. strarray.Add(strOrderNumber);
  10104. strarray.Add(m_taoxiname);
  10105. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  10106. strarray.Add("");
  10107. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  10108. strarray.Add(str);
  10109. strarray.Add(m_waiter8 + "/" + m_time6);
  10110. //////////////////////////////////////////////
  10111. if (1)
  10112. {
  10113. StrRect = load.m_rcarray.ElementAt(6);
  10114. int addwid = StrRect.Width() / 6;
  10115. for (i = 3; i <= 6; i++)
  10116. {
  10117. StrRect = load.m_rcarray.ElementAt(i - 1);
  10118. StrRect.left += (i - 3)*addwid;
  10119. StrRect.right += (i - 2)*addwid;
  10120. load.m_rcarray.SetAt(i - 1, StrRect);
  10121. }
  10122. StrRect.left = StrRect.right = -1;
  10123. load.m_rcarray.SetAt(6, StrRect);
  10124. for (i = 10; i <= 13; i++)
  10125. {
  10126. StrRect = load.m_rcarray.ElementAt(i - 1);
  10127. StrRect.left += (i - 10)*addwid;
  10128. StrRect.right += (i - 9)*addwid;
  10129. load.m_rcarray.SetAt(i - 1, StrRect);
  10130. }
  10131. StrRect.left = StrRect.right = -1;
  10132. load.m_rcarray.SetAt(13, StrRect);
  10133. StrRect = load.m_rcarray.ElementAt(7);
  10134. int rcwid = StrRect.Width();
  10135. StrRect.left = load.m_rcarray.ElementAt(5).right;
  10136. StrRect.right = StrRect.left + rcwid + addwid;
  10137. load.m_rcarray.SetAt(7, StrRect);
  10138. StrRect = load.m_rcarray.ElementAt(8);
  10139. StrRect.left = load.m_rcarray.ElementAt(7).right;
  10140. StrRect.right = load.m_rcarray.ElementAt(29).left;
  10141. load.m_rcarray.SetAt(8, StrRect);
  10142. StrRect = load.m_rcarray.ElementAt(14);
  10143. rcwid = StrRect.Width();
  10144. StrRect.left = load.m_rcarray.ElementAt(12).right;
  10145. StrRect.right = StrRect.left + rcwid + addwid;
  10146. load.m_rcarray.SetAt(14, StrRect);
  10147. StrRect = load.m_rcarray.ElementAt(15);
  10148. StrRect.left = load.m_rcarray.ElementAt(14).right;
  10149. StrRect.right = load.m_rcarray.ElementAt(29).left;
  10150. load.m_rcarray.SetAt(15, StrRect);
  10151. }
  10152. ////////////////////////////////////////////////
  10153. for (i = 3; i <= 16; i++)
  10154. {
  10155. StrRect = load.m_rcarray.ElementAt(i - 1);
  10156. if (i < 10)
  10157. {
  10158. m_Print.DrawRect2(StrRect, 1);
  10159. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10160. }
  10161. }
  10162. StrRect = load.m_rcarray.ElementAt(29);
  10163. m_Print.DrawRect2(StrRect, 1);
  10164. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10165. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  10166. {
  10167. Image *pImg = NULL;
  10168. g_nSendCode = 31;
  10169. int g_nYearposTemp = g_nYearpos;
  10170. g_nYearpos = -1;
  10171. g_pMainWnd->ProcessChatMessageRequest2(1);
  10172. g_nYearpos = g_nYearposTemp;
  10173. g_nSendCode = 0;
  10174. if (g_bSendOK == 0)return;
  10175. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  10176. if (pImg)
  10177. {
  10178. StrRect.left = 485;
  10179. StrRect.top = 12;
  10180. StrRect.right = StrRect.left + 60;
  10181. StrRect.bottom = StrRect.top + 60;
  10182. m_Print.DrawImage(pImg, StrRect);
  10183. delete pImg; pImg = NULL;
  10184. }
  10185. }
  10186. CArray<CRect, CRect>rcarray;
  10187. CStringArray strarray2;
  10188. for (i = 10; i <= 16; i++)
  10189. {
  10190. StrRect = load.m_rcarray.ElementAt(i - 1);
  10191. StrRect.left += 2;
  10192. StrRect.right -= 2;
  10193. StrRect.top += 2;
  10194. rcarray.Add(StrRect);
  10195. strarray2.Add(strarray.ElementAt(7 + i - 10));
  10196. }
  10197. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  10198. for (i = 10; i <= 16; i++)
  10199. {
  10200. StrRect = load.m_rcarray.ElementAt(i - 1);
  10201. if (i == 10)
  10202. {
  10203. dty += bottom - StrRect.bottom;
  10204. }
  10205. StrRect.bottom = bottom;
  10206. m_Print.DrawRect2(StrRect, 1);
  10207. }
  10208. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  10209. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  10210. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  10211. m_Print.SetFontFace(15, 1, "宋体");
  10212. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  10213. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10214. m_Print.SetFontFace(9, 1, "宋体");
  10215. strarray.RemoveAll();
  10216. strarray.Add("产品名称");
  10217. strarray.Add("数量");
  10218. strarray.Add("照片编号");
  10219. CArray<CRect, CRect>rc2array;
  10220. for (i = 18; i <= 20; i++)
  10221. {
  10222. StrRect = load.m_rcarray.ElementAt(i - 1); StrRect.top += dty; StrRect.bottom += dty;
  10223. m_Print.DrawRect2(StrRect, 1);
  10224. StrRect.left += 2;
  10225. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10226. StrRect.left -= 2;
  10227. StrRect.top = StrRect.bottom;
  10228. StrRect.bottom += 18;
  10229. rc2array.Add(StrRect);
  10230. }
  10231. int curypos = 0;
  10232. for (i = 0; i < sparray2.GetSize(); i += 3)
  10233. {
  10234. rcarray.RemoveAll();
  10235. strarray2.RemoveAll();
  10236. for (int j = 0; j < 3; j++)
  10237. {
  10238. StrRect = rc2array.ElementAt(j);
  10239. StrRect.left += 2;
  10240. StrRect.right -= 2;
  10241. StrRect.top += 2;
  10242. rcarray.Add(StrRect);
  10243. #if JEFF_TEST_ON
  10244. if (2 == j)
  10245. {
  10246. CString strImg = sparray2.ElementAt(i + 2);
  10247. int nImgCount = strImg.Replace(",", ",");
  10248. if (nImgCount != 0)
  10249. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
  10250. else if (!strImg.IsEmpty())
  10251. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  10252. strarray2.Add(strImg);
  10253. }
  10254. else
  10255. strarray2.Add(sparray2.ElementAt(i + j));
  10256. #else
  10257. strarray2.Add(sparray2.ElementAt(i + j));
  10258. #endif
  10259. }
  10260. int bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  10261. rcarray.RemoveAll();
  10262. for (j = 0; j < 3; j++)
  10263. {
  10264. StrRect = rc2array.ElementAt(j);
  10265. if (j == 0)
  10266. {
  10267. dty += bottom - StrRect.bottom;
  10268. }
  10269. StrRect.bottom = bottom;
  10270. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  10271. StrRect.top = StrRect.bottom;
  10272. StrRect.bottom += 18;
  10273. rcarray.Add(StrRect);
  10274. }
  10275. rc2array.RemoveAll();
  10276. rc2array.Copy(rcarray);
  10277. }
  10278. m_Print.SetFontFace(15, 1, "宋体");
  10279. StrRect = load.m_rcarray.ElementAt(20);
  10280. dty = curypos - StrRect.bottom + 35;
  10281. StrRect.top += dty; StrRect.bottom += dty;
  10282. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10283. m_Print.SetFontFace(9, 1, "宋体");
  10284. rcarray.RemoveAll();
  10285. strarray2.RemoveAll();
  10286. StrRect = load.m_rcarray.ElementAt(21);
  10287. StrRect.top += dty;
  10288. StrRect.bottom += dty;
  10289. StrRect.left += 2;
  10290. StrRect.right -= 2;
  10291. StrRect.top += 2;
  10292. rcarray.Add(StrRect);
  10293. #if JEFF_TEST_ON
  10294. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  10295. strarray2.RemoveAll();
  10296. CString strFind = "要求:";
  10297. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  10298. do
  10299. {
  10300. int nIndex = strbz3.Find(strFind, 1);
  10301. if (nIndex != -1)
  10302. {
  10303. CString strbz = strbz3.Left(nIndex);
  10304. strbz3 = strbz3.Mid(nIndex);
  10305. strarray2.Add(strbz);
  10306. }
  10307. else
  10308. {
  10309. strarray2.Add(strbz3);
  10310. strbz3 = "";
  10311. }
  10312. } while (strbz3.Find(strFind) != -1);
  10313. strarray2.Add(g_List1array.ElementAt(0).ElementAt(25));
  10314. if (!m_replace.IsEmpty())
  10315. {
  10316. m_replace = "设计替换照片:" + m_replace;
  10317. m_replace.Replace("$", ";");
  10318. m_replace.TrimLeft(";");
  10319. }
  10320. strarray2.Add(m_replace);
  10321. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  10322. #else
  10323. strarray2.Add(m_bz);
  10324. bottom = CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  10325. #endif
  10326. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  10327. dty += bottom - StrRect.bottom;
  10328. StrRect.bottom = bottom;
  10329. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  10330. m_Print.SetFontFace(10, 1, "宋体");
  10331. StrRect = load.m_rcarray.ElementAt(22);
  10332. dty = curypos - StrRect.bottom + 25;
  10333. StrRect.top += dty; StrRect.bottom += dty;
  10334. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  10335. if (m_edit9.IsEmpty())
  10336. {
  10337. m_edit9 = "\
  10338. 经确认后的照片均排入制作流程,\r\n\
  10339. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  10340. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  10341. }
  10342. CString info1, info2, info3;
  10343. int newlinepos = m_edit9.Find("\r\n");
  10344. if (newlinepos != -1)
  10345. {
  10346. info1 = m_edit9.Left(newlinepos);
  10347. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  10348. }
  10349. newlinepos = m_edit9.Find("\r\n");
  10350. if (newlinepos != -1)
  10351. {
  10352. info2 = m_edit9.Left(newlinepos);
  10353. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  10354. info3 = m_edit9;
  10355. }
  10356. if (1)
  10357. {
  10358. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10359. StrRect = load.m_rcarray.ElementAt(23);
  10360. StrRect.top += dty; StrRect.bottom += dty;
  10361. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10362. StrRect = load.m_rcarray.ElementAt(24);
  10363. StrRect.top += dty; StrRect.bottom += dty;
  10364. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10365. }
  10366. else
  10367. {
  10368. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10369. StrRect = load.m_rcarray.ElementAt(23);
  10370. StrRect.top += dty; StrRect.bottom += dty;
  10371. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10372. StrRect = load.m_rcarray.ElementAt(24);
  10373. StrRect.top += dty; StrRect.bottom += dty;
  10374. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10375. }
  10376. StrRect = load.m_rcarray.ElementAt(25);
  10377. StrRect.top += dty; StrRect.bottom += dty;
  10378. m_Print.DrawText((LPTSTR)(LPCTSTR)"贵宾签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10379. StrRect = load.m_rcarray.ElementAt(26);
  10380. StrRect.top += dty; StrRect.bottom += dty;
  10381. m_Print.DrawRect2(StrRect, 2);
  10382. m_Print.SetFontFace(9, 1, "宋体");
  10383. StrRect = load.m_rcarray.ElementAt(27);
  10384. StrRect.top += dty; StrRect.bottom += dty;
  10385. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10386. StrRect = load.m_rcarray.ElementAt(28);
  10387. StrRect.top += dty; StrRect.bottom += dty;
  10388. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10389. PrintPreview dlg;//dlg.m_mode=2;
  10390. dlg.m_name = name;
  10391. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  10392. dlg.m_pDC = m_Print.GetPDC();
  10393. if (aa == 0)
  10394. {
  10395. if (dlg.DoModal() != IDOK)
  10396. return;
  10397. printcot = dlg.m_num;
  10398. }
  10399. //结束打印
  10400. m_Print.EndPage();
  10401. m_Print.EndPrint();
  10402. }
  10403. }
  10404. /*
  10405. void CMainFrame::PrintFlowChart(CString m_id)
  10406. {
  10407. CPrintRX m_Print;
  10408. m_Print.InitToPrint(NULL, 1);
  10409. m_Print.StartPrint();
  10410. m_Print.StartPage();
  10411. // CRect StrRect(0,0,560,818);
  10412. LoadRect load;
  10413. load.SetLiaPath ("4.lia");
  10414. load.SetMargins(-14,-14);
  10415. if(!load.Load ())return;
  10416. LoadRect load2;
  10417. load2.SetMargins(-14,472+27-14);
  10418. load2.SetLiaPath ("5.lia");
  10419. if(!load2.Load ())return;
  10420. //////////////////////////////////////////////////////////////
  10421. CString filter="id='"+m_id+"';id='"+m_id+"'";
  10422. g_sendhead.code[0]=54;
  10423. g_sendhead.code[1]=50;
  10424. g_sendhead.tabcount=2;
  10425. g_sendhead.bsql=0;
  10426. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  10427. CArray<CStringArray, CStringArray>sparray;
  10428. DataToArray(&g_List1array,&sparray);
  10429. CString spno;
  10430. for(int i=0; i<sparray.GetSize (); i++)
  10431. {
  10432. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册")continue;
  10433. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  10434. spno+=sparray.ElementAt (i).ElementAt (5);
  10435. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  10436. spno+=";";
  10437. else
  10438. {
  10439. spno+=":";
  10440. spno+=sparray.ElementAt (i).ElementAt (6);
  10441. spno+=";";
  10442. }
  10443. }
  10444. spno+=" 加挑:";
  10445. for( i=0; i<sparray.GetSize (); i++)
  10446. {
  10447. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  10448. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  10449. spno+=sparray.ElementAt (i).ElementAt (5);
  10450. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  10451. spno+=";";
  10452. else
  10453. {
  10454. spno+=":";
  10455. spno+=sparray.ElementAt (i).ElementAt (6);
  10456. spno+=";";
  10457. }
  10458. }
  10459. if(spno.Right (6)==" 加挑:")
  10460. {
  10461. spno=spno.Left (spno.GetLength ()-6);
  10462. }
  10463. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  10464. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  10465. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  10466. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  10467. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  10468. if(m_urgent.IsEmpty ())m_urgent="否";
  10469. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  10470. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  10471. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  10472. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  10473. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  10474. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  10475. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  10476. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  10477. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  10478. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  10479. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  10480. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17);
  10481. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  10482. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  10483. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  10484. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  10485. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  10486. CString m_sum3;
  10487. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  10488. ::ConvertToPrice (m_sum3);
  10489. if(m_money3.IsEmpty ())m_money3="0";
  10490. // m_money3=m_money3+"/"+m_sum3;
  10491. CString name;
  10492. if(!m_name1.IsEmpty ())
  10493. name=m_name1+",";
  10494. name+=m_name2;
  10495. name.TrimRight (",");
  10496. CString phone;
  10497. if(!m_phone1.IsEmpty ())
  10498. phone=m_phone1+",";
  10499. phone+=m_phone2;phone.TrimRight (",");
  10500. CStringArray strarray;
  10501. strarray.Add (m_urgent);
  10502. strarray.Add (m_ren);
  10503. strarray.Add (m_waiter3);
  10504. strarray.Add (name);
  10505. strarray.Add (m_time2);
  10506. strarray.Add (m_time4);
  10507. strarray.Add (m_time5);
  10508. strarray.Add (m_money3);
  10509. strarray.Add (m_takezs);
  10510. strarray.Add (m_taoxizs);
  10511. strarray.Add (m_choosezs);
  10512. strarray.Add (m_id);
  10513. strarray.Add (phone);
  10514. ////////////////////////////////////////////////////////////////
  10515. int rcpos=-1;
  10516. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  10517. Image *pImg=NULL;
  10518. #ifdef MNLS_VERSION
  10519. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  10520. #else
  10521. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  10522. #endif
  10523. m_Print.DrawImage(pImg, StrRect);
  10524. delete pImg;
  10525. m_Print.SetFontFace(15, 1, "宋体");
  10526. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10527. #ifdef MNLS_VERSION
  10528. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10529. #endif
  10530. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10531. #ifdef MNLS_VERSION
  10532. m_Print.DrawRect(StrRect);
  10533. #endif
  10534. m_Print.SetFontFace(7, 1, "黑体");
  10535. m_Print.SetColor(0xffffff);
  10536. #ifdef MNLS_VERSION
  10537. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10538. #endif
  10539. m_Print.SetColor(0);
  10540. m_Print.SetFontFace(25, 1, "黑体");
  10541. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10542. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10543. CString title[13]={"是否加急:","接单门市:","选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","取件日期:","加挑/余款:","拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  10544. m_Print.SetFontFace(12, 1, "宋体");
  10545. for( i=0; i<13; i++)
  10546. {
  10547. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10548. if(i<3)
  10549. m_Print.DrawRect2(StrRect, 0);
  10550. else
  10551. m_Print.DrawRect2(StrRect, 1);
  10552. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10553. }
  10554. for( i=18; i<=37; i++)
  10555. {
  10556. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10557. if(i>=19&&i<=21)
  10558. m_Print.DrawRect2(StrRect, 2);
  10559. else if(i==26)
  10560. {
  10561. CRect rc=StrRect;
  10562. CRect rc2=rc;
  10563. rc.right -=rc2.Width ()/2;
  10564. m_Print.DrawRect2(rc, 1);
  10565. rc2.left +=rc.Width ();
  10566. m_Print.DrawRect2(rc2, 1);
  10567. }
  10568. else
  10569. m_Print.DrawRect2(StrRect, 1);
  10570. if(i==18)
  10571. {
  10572. StrRect.left +=5;
  10573. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10574. }
  10575. }
  10576. //////////////////////////////////////
  10577. rcpos=-1;
  10578. for( i=0; i<8; i++)
  10579. {
  10580. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10581. m_Print.DrawRect2(StrRect, 1);
  10582. }
  10583. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客签名:"};
  10584. for( i=0; i<4; i++)
  10585. {
  10586. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10587. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10588. }
  10589. for( i=0; i<4; i++)
  10590. {
  10591. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10592. m_Print.DrawRect2(StrRect, 2);
  10593. }
  10594. ///////////////////////////////////////////
  10595. for( i=19; i<=31; i++)
  10596. {
  10597. StrRect=load.m_rcarray .ElementAt (i-1);
  10598. StrRect.left +=4;
  10599. if(i==31)
  10600. {
  10601. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  10602. {
  10603. StrRect.top +=2;
  10604. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  10605. StrRect.top +=8;
  10606. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10607. }
  10608. else
  10609. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10610. }
  10611. else if((i-19)==7)
  10612. {
  10613. CRect rc=StrRect;
  10614. CRect rc2=rc;
  10615. rc.right -=rc2.Width ()/2;
  10616. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10617. rc2.left +=rc.Width ()+3;
  10618. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10619. }
  10620. else
  10621. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10622. }
  10623. strarray.RemoveAll ();
  10624. strarray.Add (m_waiter2);
  10625. strarray.Add (m_waiter1);
  10626. strarray.Add (m_waiter4);
  10627. for( i=13; i<=15; i++)
  10628. {
  10629. StrRect=load2.m_rcarray .ElementAt (i-1);
  10630. StrRect.left +=4;
  10631. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10632. }
  10633. ///////////spno
  10634. CRect sprc[14];
  10635. for(i=0; i<14; i++)
  10636. {
  10637. if(i<7)
  10638. {
  10639. if(i==0)
  10640. {
  10641. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  10642. }
  10643. else
  10644. {
  10645. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  10646. }
  10647. }
  10648. else
  10649. {
  10650. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  10651. }
  10652. sprc[i]=StrRect;
  10653. // m_Print.DrawText((LPTSTR)(LPCTSTR)"xxx", sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10654. }
  10655. CString temp,tempspno,tempbz;
  10656. CSize size;
  10657. BOOL bRun=0;
  10658. int fontsize=12;
  10659. ll: tempspno=spno;
  10660. tempbz=m_bz;
  10661. m_Print.SetFontFace(fontsize, 1, "宋体");
  10662. for( i=0; i<14; i++)
  10663. {
  10664. if(!tempspno.IsEmpty ())
  10665. {
  10666. temp=tempspno;
  10667. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10668. int right=0;
  10669. CRect temprc=sprc[i];
  10670. while(size.cx>temprc.Width ())
  10671. {
  10672. right++;
  10673. temp=tempspno.Left (tempspno.GetLength ()-(right));
  10674. if(GIsHalfHZ(temp))
  10675. {
  10676. right++;
  10677. temp.Delete (temp.GetLength ()-1);
  10678. }
  10679. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10680. }
  10681. if(bRun)
  10682. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10683. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  10684. if(tempspno.IsEmpty ())i++;
  10685. }
  10686. else if(!tempbz.IsEmpty ())
  10687. {
  10688. temp=tempbz;
  10689. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10690. int right=0;
  10691. CRect temprc=sprc[i];
  10692. while(size.cx>temprc.Width ())
  10693. {
  10694. right++;
  10695. temp=tempbz.Left (tempbz.GetLength ()-(right));
  10696. if(GIsHalfHZ(temp))
  10697. {
  10698. right++;
  10699. temp.Delete (temp.GetLength ()-1);
  10700. }
  10701. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10702. }
  10703. if(bRun)
  10704. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10705. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  10706. }
  10707. }
  10708. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  10709. {
  10710. fontsize--;
  10711. goto ll;
  10712. }
  10713. if(bRun==0)
  10714. {
  10715. bRun=1;
  10716. goto ll;
  10717. }
  10718. PrintPreview dlg;
  10719. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  10720. dlg.m_pDC =m_Print.GetPDC() ;
  10721. if(dlg.DoModal ()!=IDOK)return;
  10722. //结束打印
  10723. m_Print.EndPage();
  10724. m_Print.EndPrint();
  10725. }
  10726. void CMainFrame::SetSelFolder(int pos)
  10727. {
  10728. m_wndToolBar2.SetSelFolder(pos);
  10729. }*/
  10730. void CMainFrame::ToPhotoPrint()
  10731. {
  10732. UINT nID = 1;
  10733. LPSTR pName;
  10734. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  10735. OPEN_MENU(PhotoPrintFrom);
  10736. }
  10737. void CMainFrame::GetOcx()
  10738. {
  10739. char path[MAX_PATH];
  10740. ::GetSystemDirectory(path, MAX_PATH);
  10741. CString syspath = path;
  10742. try
  10743. {
  10744. if (!::PathFileExists(syspath + "\\MSCHRT20.OCX"))
  10745. {
  10746. g_sendhead.bsql = 0;
  10747. g_sendhead.code[0] = 103;
  10748. g_sendhead.tabcount = 1;
  10749. g_pMainWnd->ProcessChatMessageRequest2(1); if (g_bSendOK == 0)return;
  10750. CFile fp;
  10751. if (fp.Open(syspath + "\\MSCHRT20.OCX", CFile::modeWrite | CFile::modeCreate))
  10752. {
  10753. fp.Write(g_pData, g_nLeng);
  10754. fp.Close();
  10755. ::Sleep(1000);
  10756. }
  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. try
  10766. {
  10767. CString temp;
  10768. temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10769. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10770. }
  10771. catch (...)
  10772. {
  10773. }
  10774. }
  10775. void CMainFrame::OnServer()
  10776. {
  10777. // TODO: Add your command handler code here
  10778. DBConfig dlg;
  10779. dlg.DoModal();
  10780. }
  10781. void CMainFrame::OnPath()
  10782. {
  10783. // TODO: Add your command handler code here
  10784. if (g_user.bLongin == 0)
  10785. {
  10786. if (g_bNoLoginLia)
  10787. {
  10788. Login dlg;
  10789. dlg.SetLiaPath("5.lia");
  10790. dlg.DoModal();
  10791. }
  10792. else
  10793. {
  10794. Login3 dlg;
  10795. dlg.SetLiaPath("5.lia");
  10796. dlg.DoModal();
  10797. }
  10798. if (g_user.bLongin == 0)return;
  10799. }
  10800. if (IsHasRightsnew(49) == 0)return;
  10801. SetPathDlg2 dlg;
  10802. dlg.DoModal();
  10803. }
  10804. void CMainFrame::OnShowhis()
  10805. {
  10806. // TODO: Add your command handler code here
  10807. if (g_user.bLongin == 0)
  10808. {
  10809. if (g_bNoLoginLia)
  10810. {
  10811. Login dlg;
  10812. dlg.SetLiaPath("5.lia");
  10813. dlg.DoModal();
  10814. }
  10815. else
  10816. {
  10817. Login3 dlg;
  10818. dlg.SetLiaPath("5.lia");
  10819. dlg.DoModal();
  10820. }
  10821. if (g_user.bLongin == 0)return;
  10822. }
  10823. if (IsHasRightsnew(52) == 0)return;
  10824. CMenu *pMenu = GetMenu();
  10825. CMenu* submenu = pMenu->GetSubMenu(2);
  10826. UINT status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
  10827. if (status&MF_CHECKED)
  10828. {
  10829. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_UNCHECKED);
  10830. g_bShowOK = 1;
  10831. }
  10832. else
  10833. {
  10834. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  10835. g_bShowOK = 0;
  10836. } m_Mdi.CloseAll();
  10837. }
  10838. void CMainFrame::AddHistoryMenu(CArray<CStringArray, CStringArray>*hisyeararray) // 添加历史数据库菜单;
  10839. {
  10840. #ifdef NEW_SKIN
  10841. CMenu* m_menuXP = GetMenu();
  10842. CMenu* submenu = m_menuXP->GetSubMenu(2);
  10843. // 删除原有菜单;
  10844. for (int i = 0; i < 100; i++)
  10845. {
  10846. submenu->DeleteMenu(1000 + i, MF_BYCOMMAND);
  10847. }
  10848. // 重创菜单,从资源ID1000开始;
  10849. for (i = 0; i < hisyeararray->GetSize(); i++)
  10850. {
  10851. submenu->AppendMenu(MF_STRING, 1000 + i, "查看历史数据:" + hisyeararray->ElementAt(i).ElementAt(0)); // 第一项菜单项;
  10852. }
  10853. g_nYearpos = -1;
  10854. #else
  10855. HMENU hMenu = ::GetMenu(m_hWnd);
  10856. m_menuXP.Attach(hMenu);
  10857. BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
  10858. for (int i = 0; i < 100; i++)
  10859. {
  10860. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10861. }
  10862. for( i=0; i<hisyeararray->GetSize (); i++)
  10863. {
  10864. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10865. }
  10866. m_menuXP.Detach ();
  10867. g_nYearpos = -1;
  10868. #endif
  10869. }
  10870. /************************************************************************/
  10871. /*
  10872. Jeff
  10873. 函数:AddBranchMenu()
  10874. 参数:CArray<CStringArray, CStringArray> *branchArray
  10875. 返回:void
  10876. 注意:
  10877. 调用关系:
  10878. */
  10879. /************************************************************************/
  10880. void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*branchArray)
  10881. {
  10882. //WriteClientLog("AddBranchMenu,添加集团版菜单");
  10883. #ifdef ENTERPRISE_VERSION
  10884. CMenu *m_menuXP = GetMenu();
  10885. CMenu* submenu = m_menuXP->GetSubMenu(0);
  10886. for (int i = 0; i < 100; i++)
  10887. {
  10888. submenu->DeleteMenu(2000 + i, MF_BYCOMMAND);
  10889. }
  10890. g_menubranchname.RemoveAll();
  10891. CString name;
  10892. int a = 0;
  10893. #if 0 // Jeff.add for test
  10894. CString strCount;
  10895. strCount.Format("历史数据库个数=%d", branchArray->GetSize());
  10896. WriteClientLog(strCount);
  10897. #endif
  10898. for (i = 0; i < branchArray->GetSize() - 1; i++)
  10899. {
  10900. //WriteClientLog("111");
  10901. //WriteClientLog(hisyeararray->ElementAt(i).ElementAt(0));
  10902. //WriteClientLog(name);
  10903. if (name == "")
  10904. {
  10905. name = branchArray->ElementAt(i).ElementAt(0);
  10906. #ifndef SQLSERVER_VERSION
  10907. submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
  10908. a++;
  10909. #endif
  10910. submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
  10911. a++;
  10912. g_menubranchname.Add(name);
  10913. continue;
  10914. }
  10915. else if (branchArray->ElementAt(i).ElementAt(0).Find(name) != -1 && ((branchArray->ElementAt(i).ElementAt(0).GetLength() - name.GetLength()) == 4))
  10916. {
  10917. continue;
  10918. }
  10919. name = branchArray->ElementAt(i).ElementAt(0);
  10920. #ifndef SQLSERVER_VERSION
  10921. submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
  10922. a++;
  10923. #endif
  10924. submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
  10925. g_menubranchname.Add(name);
  10926. a++;
  10927. //WriteClientLog("222");
  10928. }
  10929. if ((branchArray->GetSize() - 1) > 0)
  10930. {
  10931. if (branchArray->ElementAt(0).ElementAt(3) == "总店")
  10932. submenu->AppendMenu(MF_STRING, 2000 + a, "多店数据汇总");
  10933. }
  10934. #endif
  10935. }
  10936. // Jeff:如果选择了历史数据库,则开单的数据会录入到该历史数据库中,而非当前数据库;
  10937. // g_nYearpos==-1,表示当前主数据库,其他>=0的值表示历史数据库在g_historydb中的索引值;
  10938. void CMainFrame::OnHistory(UINT nID) // 选择历史数据库菜单响应;
  10939. {
  10940. CMenu* pMenu = GetMenu();
  10941. CMenu* submenu = pMenu->GetSubMenu(2);
  10942. UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
  10943. if (g_user.bLongin == 0)
  10944. {
  10945. if (g_bNoLoginLia)
  10946. {
  10947. Login dlg;
  10948. dlg.SetLiaPath("5.lia");
  10949. dlg.DoModal();
  10950. }
  10951. else
  10952. {
  10953. Login3 dlg;
  10954. dlg.SetLiaPath("5.lia");
  10955. dlg.DoModal();
  10956. }
  10957. if (g_user.bLongin == 0)return;
  10958. }
  10959. if (IsHasRightsnew(52) == 0)return;
  10960. m_Mdi.CloseAll();
  10961. for (int i = 0; i < 100; i++)
  10962. {
  10963. submenu->CheckMenuItem(1000 + i, MF_BYCOMMAND | MF_UNCHECKED);
  10964. }
  10965. if (status&MF_CHECKED)
  10966. {
  10967. g_nYearpos = -1;
  10968. status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
  10969. if (status&MF_CHECKED)
  10970. g_bShowOK = 0;
  10971. else
  10972. g_bShowOK = 1;
  10973. }
  10974. else
  10975. {
  10976. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10977. g_nYearpos = nID - 1000;
  10978. g_bShowOK = 1;
  10979. }
  10980. }
  10981. void CMainFrame::OnBranchData(UINT nID)
  10982. {
  10983. #ifdef ENTERPRISE_VERSION
  10984. #ifdef SQLSERVER_VERSION
  10985. OnBranchData2(nID);
  10986. return;
  10987. #endif
  10988. #endif
  10989. }
  10990. void CMainFrame::OnBranchData2(UINT nID)
  10991. {
  10992. #ifdef ENTERPRISE_VERSION
  10993. g_bAllBranch = 0;
  10994. m_Mdi.CloseAll();
  10995. OnDisconnect();
  10996. CMenu *pMenu = GetMenu();
  10997. CMenu* submenu = pMenu->GetSubMenu(0);
  10998. UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
  10999. for (int i = 0; i < 100; i++)
  11000. {
  11001. submenu->CheckMenuItem(2000 + i, MF_BYCOMMAND | MF_UNCHECKED);
  11002. }
  11003. if (status&MF_CHECKED)
  11004. {
  11005. g_branchname.Empty();
  11006. g_branchip.Empty();
  11007. g_bBranchModify = 0;
  11008. g_user.bLongin = 0;
  11009. if (g_bNoLoginLia)
  11010. {
  11011. Login dlg;
  11012. dlg.SetLiaPath("5.lia");
  11013. dlg.DoModal();
  11014. }
  11015. else
  11016. {
  11017. Login3 dlg;
  11018. dlg.SetLiaPath("5.lia");
  11019. dlg.DoModal();
  11020. }
  11021. g_pMainWnd2->RefreshOutlookBar();
  11022. g_pMainWnd2->DrawLogin();
  11023. g_path1 = g_path1bak;
  11024. g_path2 = g_path2bak;
  11025. g_path3 = g_path3bak;
  11026. g_path4 = g_path4bak;
  11027. g_path5 = g_path5bak;
  11028. g_path6 = g_path6bak;
  11029. g_path7 = g_path7bak;
  11030. g_pMainWnd2->EnableBtns(1);
  11031. }
  11032. else
  11033. {
  11034. BOOL bNeedCheckRights = 1;
  11035. if (g_user.bLongin && g_branchname == "")//无需登陆本店判断其访问分店权限
  11036. {
  11037. bNeedCheckRights = 0;
  11038. }
  11039. #ifndef SQLSERVER_VERSION
  11040. if ((g_menubranchname.GetSize() * 2) == nID - 2000)//多店数据汇总
  11041. #else
  11042. if ((g_menubranchname.GetSize()) == nID - 2000)//多店数据汇总
  11043. #endif
  11044. {
  11045. g_branchname.Empty();
  11046. g_branchip.Empty();
  11047. g_bBranchModify = 0;
  11048. if (bNeedCheckRights)
  11049. {
  11050. g_user.bLongin = 0;
  11051. if (g_user.bLongin == 0)
  11052. {
  11053. if (g_bNoLoginLia)
  11054. {
  11055. Login dlg;
  11056. dlg.SetLiaPath("5.lia");
  11057. dlg.DoModal();
  11058. }
  11059. else
  11060. {
  11061. Login3 dlg;
  11062. dlg.SetLiaPath("5.lia");
  11063. dlg.DoModal();
  11064. }
  11065. if (g_user.bLongin == 0)return;
  11066. }
  11067. }
  11068. if (IsHasRightsnew(28) == 0)
  11069. {
  11070. return;
  11071. }
  11072. g_bAllBranch = 1; g_pMainWnd2->ShowBar(0);
  11073. g_pMainWnd2->RefreshOutlookBar2();
  11074. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  11075. g_branchname.Empty();
  11076. g_branchip.Empty();
  11077. g_bBranchModify = 0;
  11078. g_pMainWnd2->DrawLogin();
  11079. g_pMainWnd2->EnableBtns(0);
  11080. g_path1 = g_path1bak;
  11081. g_path2 = g_path2bak;
  11082. g_path3 = g_path3bak;
  11083. g_path4 = g_path4bak;
  11084. g_path5 = g_path5bak;
  11085. g_path6 = g_path6bak;
  11086. g_path7 = g_path7bak;
  11087. }
  11088. else
  11089. {
  11090. if (bNeedCheckRights)
  11091. {
  11092. g_branchname.Empty();
  11093. g_branchip.Empty();
  11094. g_bBranchModify = 0;
  11095. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
  11096. g_user.bLongin = 0;
  11097. if (g_pMainWnd2)
  11098. {
  11099. g_pMainWnd2->DrawLogin();
  11100. g_pMainWnd2->ShowBar(0);
  11101. }
  11102. if (g_bNoLoginLia)
  11103. {
  11104. Login dlg;
  11105. dlg.SetLiaPath("5.lia");
  11106. dlg.DoModal();
  11107. }
  11108. else
  11109. {
  11110. Login3 dlg;
  11111. dlg.SetLiaPath("5.lia");
  11112. dlg.DoModal();
  11113. }
  11114. if (g_user.bLongin == 0)return;
  11115. }
  11116. if (IsHasRightsnew(28) == 0)
  11117. {
  11118. return;
  11119. }
  11120. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  11121. #ifndef SQLSERVER_VERSION
  11122. if (nID % 2 == 0)
  11123. g_branchname = g_menubranchname.ElementAt((nID - 2000) / 2);
  11124. else
  11125. g_branchname = g_menubranchname.ElementAt((nID - 2001) / 2);
  11126. #else
  11127. g_branchname = g_menubranchname.ElementAt(nID - 2000);
  11128. #endif
  11129. g_branchip.Empty();
  11130. CString domainname = "";
  11131. for (int i = 0; i < g_brancharray.GetSize(); i++)
  11132. {
  11133. if (g_branchname == g_brancharray.ElementAt(i).ElementAt(0))
  11134. {
  11135. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  11136. g_branchip2 = g_brancharray.ElementAt(i).ElementAt(4);
  11137. domainname = g_brancharray.ElementAt(i).ElementAt(2);
  11138. }
  11139. }
  11140. g_path1 = g_path1bak;
  11141. g_path2 = g_path2bak;
  11142. g_path3 = g_path3bak;
  11143. g_path4 = g_path4bak;
  11144. g_path5 = g_path5bak;
  11145. g_path6 = g_path6bak;
  11146. g_path7 = g_path7bak;
  11147. if (domainname.IsEmpty())
  11148. {
  11149. g_path1 = g_path2 = g_path3 = g_path4 = g_path5 = g_path6 = g_path7 = "xxx";
  11150. }
  11151. else
  11152. {
  11153. g_path1 += "\\" + domainname;
  11154. g_path2 += "\\" + domainname;
  11155. g_path3 += "\\" + domainname;
  11156. g_path4 += "\\" + domainname;
  11157. g_path5 += "\\" + domainname;
  11158. g_path6 += "\\" + domainname;
  11159. g_path7 += "\\" + domainname;
  11160. }
  11161. g_bBranchModify = 1;
  11162. /* CArray<CStringArray, CStringArray>yeararray;
  11163. for( i=0; i<g_brancharray.GetSize (); i++)
  11164. {
  11165. if(g_brancharray.ElementAt (i).ElementAt (0).Find (g_branchname)!=-1 && g_branchname!=g_brancharray.ElementAt (i).ElementAt (0))
  11166. {
  11167. int size=yeararray.GetSize ();
  11168. yeararray.SetSize(size+1,1);
  11169. CString str=g_brancharray.ElementAt (i).ElementAt (0);
  11170. str.Delete (0, g_branchname.GetLength ());
  11171. yeararray.ElementAt (size).Add (str);
  11172. }
  11173. }
  11174. AddHistoryMenu(&yeararray);*/
  11175. if (g_bBranchModify)OnDisconnect();
  11176. if (1)
  11177. {
  11178. g_user.bLongin = 0;
  11179. g_user.name.Empty();
  11180. g_user.rights.Empty();
  11181. g_user.account.Empty();
  11182. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  11183. g_pMainWnd2->RefreshOutlookBar();
  11184. m_Mdi.CloseAll();
  11185. if (g_pMainWnd2)
  11186. {
  11187. g_pMainWnd2->DrawLogin();
  11188. g_pMainWnd2->ShowBar(0);
  11189. }
  11190. if (g_bNoLoginLia)
  11191. {
  11192. Login dlg;
  11193. dlg.SetLiaPath("5.lia");
  11194. dlg.DoModal();
  11195. }
  11196. else
  11197. {
  11198. Login3 dlg;
  11199. dlg.SetLiaPath("5.lia");
  11200. dlg.DoModal();
  11201. }
  11202. if (g_user.bLongin == 0)return;
  11203. if (g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  11204. }
  11205. g_pMainWnd2->DrawLogin();
  11206. g_pMainWnd2->EnableBtns(1);
  11207. }
  11208. g_nYearpos = -1;
  11209. }
  11210. #endif
  11211. }
  11212. void CMainFrame::OnStaffAchievementShow() //Jeff:此机只用于员工看业绩;
  11213. {
  11214. // TODO: Add your command handler code here
  11215. if (g_user.bLongin == 0) // 是否登陆系统;
  11216. {
  11217. if (g_bNoLoginLia)
  11218. {
  11219. Login dlg;
  11220. dlg.SetLiaPath("5.lia");
  11221. dlg.DoModal();
  11222. }
  11223. else
  11224. {
  11225. Login3 dlg;
  11226. dlg.SetLiaPath("5.lia");
  11227. dlg.DoModal();
  11228. }
  11229. if (g_user.bLongin == 0)return;
  11230. }
  11231. if (IsHasRightsnew(49) == 0)return;// 是否有权限进行设置;
  11232. CString version = _T("Version 1.0");
  11233. CMenu *pMenu = GetMenu();
  11234. CMenu* submenu = pMenu->GetSubMenu(1);
  11235. UINT status = submenu->GetMenuState(IDM_StaffAchievementShow, MF_BYCOMMAND);
  11236. if (status&MF_CHECKED)
  11237. {
  11238. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_UNCHECKED);
  11239. AfxGetApp()->WriteProfileInt(version, "status2", 0);
  11240. g_bStaffAchievementShow = 0;
  11241. TCHAR szKey[MAX_PATH];
  11242. TCHAR szDir[MAX_PATH];
  11243. ::GetModuleFileName(NULL, szDir, MAX_PATH);
  11244. HKEY hKey = 0;
  11245. DWORD disp = 0;
  11246. lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  11247. int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
  11248. if (lResult == ERROR_SUCCESS)
  11249. {
  11250. RegDeleteValue(hKey, "YLGLMAINAUTORUN");
  11251. RegDeleteKey(hKey, "YLGLMAINAUTORUN");
  11252. RegCloseKey(hKey);
  11253. }
  11254. }
  11255. else
  11256. {
  11257. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  11258. AfxGetApp()->WriteProfileInt(version, "status2", 1);
  11259. g_bStaffAchievementShow = 1;
  11260. TCHAR szKey[MAX_PATH];
  11261. TCHAR szDir[MAX_PATH];
  11262. ::GetModuleFileName(NULL, szDir, MAX_PATH);
  11263. HKEY hKey = 0;
  11264. DWORD disp = 0;
  11265. lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  11266. int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
  11267. if (lResult == ERROR_SUCCESS)
  11268. {
  11269. lResult = RegSetValueEx(hKey, "YLGLMAINAUTORUN", 0, REG_SZ, (const unsigned char*)szDir, lstrlen(szDir));
  11270. RegCloseKey(hKey);
  11271. }
  11272. StaffAchievementSet dlg;
  11273. dlg.DoModal();
  11274. }
  11275. }
  11276. void CMainFrame::PrintDinDan2(CString m_id)
  11277. {
  11278. #ifdef MODERN_VERSION
  11279. SelContent seldlg;
  11280. if (seldlg.DoModal() != IDOK)return;
  11281. CPrintRX m_Print;
  11282. m_Print.InitToPrint(NULL, 1);
  11283. m_Print.StartPrint();
  11284. m_Print.StartPage();
  11285. // CRect StrRect(0,0,560,818);
  11286. LoadRect load;
  11287. LoadRect load2;
  11288. LoadRect load3;
  11289. load.SetLiaPath ("9.lia");
  11290. load.SetMargins(-14,0);
  11291. if(!load.Load ())return;
  11292. int i;
  11293. //////////////////////////////////////////////////////////////
  11294. CStringArray txarray;
  11295. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  11296. g_sendhead.code[0]=11;
  11297. g_sendhead.code[1]=52;
  11298. g_sendhead.code[2]=50;
  11299. g_sendhead.code[3]=38;
  11300. g_sendhead.code[4]=27;
  11301. g_sendhead.tabcount=5;
  11302. g_sendhead.bsql=0;
  11303. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11304. CArray<CStringArray, CStringArray>sparray;
  11305. CArray<CStringArray, CStringArray>clientarray;
  11306. CArray<CStringArray, CStringArray>phonearray;
  11307. CArray<CStringArray, CStringArray>bukuan2array;
  11308. CArray<CStringArray, CStringArray>bukuanarray;
  11309. DataToArray(&g_List1array, &clientarray, &sparray, &bukuan2array, &bukuanarray);
  11310. CTime tm=CTime::GetCurrentTime ();
  11311. CString str;
  11312. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11313. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11314. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11315. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11316. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11317. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  11318. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11319. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11320. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11321. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11322. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11323. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11324. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11325. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11326. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11327. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11328. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11329. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11330. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11331. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11332. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11333. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11334. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11335. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11336. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11337. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11338. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11339. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11340. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11341. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11342. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11343. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11344. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11345. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  11346. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  11347. filter="name='"+m_ren+"'";
  11348. g_sendhead.code[0]=5;
  11349. g_sendhead.tabcount=1;
  11350. g_sendhead.bsql=0;
  11351. int g_nYearposTemp=g_nYearpos;
  11352. g_nYearpos=-1;
  11353. g_pMainWnd->ProcessChatMessageRequest2(filter);
  11354. g_nYearpos=g_nYearposTemp;
  11355. if(g_bSendOK==0)return;
  11356. DataToArray(&phonearray);
  11357. m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
  11358. m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
  11359. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11360. ConvertToPrice(m_money1);
  11361. ConvertToPrice(m_money2);
  11362. ConvertToPrice(m_money3);
  11363. ////////////////////////////////////////////////////////////////
  11364. int rcpos=-1;
  11365. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11366. Image *pImg=NULL;
  11367. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo2.jpg");
  11368. if(seldlg.m_bFrame)
  11369. m_Print.DrawImage(pImg, StrRect);
  11370. delete pImg;
  11371. m_Print.SetFontFace(16, 1, "黑体");
  11372. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11373. if(seldlg.m_bFrame)
  11374. ///////////////////////////////不用改
  11375. m_Print.DrawText((LPTSTR)(LPCTSTR)"摩登新娘工作流程单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11376. m_Print.SetFontFace(10, 1, "宋体");
  11377. for( i=3; i<=6; i++)
  11378. {
  11379. StrRect=load.m_rcarray .ElementAt (i-1);
  11380. if(seldlg.m_bFrame)
  11381. m_Print.DrawRect2(StrRect, 1);
  11382. }
  11383. CStringArray strarray;
  11384. if(seldlg.m_bBooking==0)
  11385. {
  11386. m_name1.Empty ();
  11387. m_name2.Empty ();
  11388. m_phone1.Empty ();
  11389. m_phone2.Empty ();
  11390. m_addr1.Empty ();
  11391. m_addr2.Empty ();
  11392. m_taoxiname.Empty ();
  11393. m_taoxijiage.Empty ();
  11394. }
  11395. if(seldlg.m_bFrame )
  11396. {
  11397. strarray.Add("新郎:"+m_name1);
  11398. strarray.Add("H");
  11399. strarray.Add("O");
  11400. strarray.Add("手机:"+m_phone1);
  11401. strarray.Add("新娘:"+m_name2);
  11402. strarray.Add("H");
  11403. strarray.Add("O");
  11404. strarray.Add("手机:"+m_phone2);
  11405. }
  11406. else
  11407. {
  11408. strarray.Add(" "+m_name1);
  11409. strarray.Add("");
  11410. strarray.Add("");
  11411. strarray.Add(" "+m_phone1);
  11412. strarray.Add(" "+m_name2);
  11413. strarray.Add("");
  11414. strarray.Add("");
  11415. strarray.Add(" "+m_phone2);
  11416. }
  11417. for( i=7; i<=14; i++)
  11418. {
  11419. StrRect=load.m_rcarray .ElementAt (i-1);
  11420. StrRect.left +=2;
  11421. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11422. }
  11423. StrRect=load.m_rcarray .ElementAt (3);
  11424. StrRect.left +=2;
  11425. if(seldlg.m_bFrame)
  11426. str="地址:"+m_addr1;
  11427. else
  11428. str=" "+m_addr1;
  11429. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11430. StrRect=load.m_rcarray .ElementAt (5);
  11431. StrRect.left +=2;
  11432. if(seldlg.m_bFrame)
  11433. str="地址:"+m_addr2;
  11434. else
  11435. str=" "+m_addr2;
  11436. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11437. //////////////////////////////////////////////////////
  11438. StrRect=load.m_rcarray .ElementAt (14);
  11439. str="预\r\n约";
  11440. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11441. StrRect.top +=46;
  11442. StrRect.left +=2;
  11443. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11444. m_Print.SetFontFace(10, 1, "宋体");
  11445. StrRect=load.m_rcarray .ElementAt (15);
  11446. if(seldlg.m_bFrame)
  11447. str="套系名称:"+m_taoxiname;
  11448. else
  11449. str=" "+m_taoxiname;
  11450. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11451. StrRect.left +=4;
  11452. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11453. StrRect=load.m_rcarray .ElementAt (16);
  11454. if(seldlg.m_bFrame)
  11455. str="单价:"+m_taoxijiage;
  11456. else
  11457. str=" "+m_taoxijiage;
  11458. StrRect.left +=2;
  11459. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11460. StrRect=load.m_rcarray .ElementAt (21);
  11461. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11462. str="新人签名:";
  11463. StrRect.left +=2;
  11464. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11465. StrRect=load.m_rcarray .ElementAt (22);
  11466. if(seldlg.m_bBooking==0)
  11467. {
  11468. if(seldlg.m_bFrame)
  11469. str="未付款:";
  11470. else
  11471. str=" ";
  11472. }
  11473. else
  11474. {
  11475. if(seldlg.m_bFrame)
  11476. str="未付款:"+m_money3;
  11477. else
  11478. str=" "+m_money3;
  11479. }
  11480. StrRect.left +=2;
  11481. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11482. StrRect=load.m_rcarray .ElementAt (23);
  11483. str="结婚秘书:";
  11484. StrRect.left +=2;
  11485. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11486. StrRect=load.m_rcarray .ElementAt (24);
  11487. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11488. StrRect.left +=3;
  11489. StrRect.top +=3;
  11490. StrRect.right -=2;
  11491. StrRect.bottom -=2;
  11492. int realpos=0;str="";
  11493. for(i=0; i<sparray.GetSize (); i++)
  11494. {
  11495. if(atoi(sparray.ElementAt (i).ElementAt (4))!=1)continue;
  11496. str+=sparray.ElementAt (i).ElementAt (5);
  11497. str+=" 数量:";
  11498. str+=sparray.ElementAt (i).ElementAt (3);
  11499. if(realpos%2)
  11500. str+="\r\n";
  11501. else
  11502. str+=" ";
  11503. realpos++;
  11504. }
  11505. str.TrimRight ("\r\n");
  11506. str.TrimRight (" ");
  11507. if(seldlg.m_bBooking)AutoDraw(m_Print, StrRect, str, 1.4);
  11508. ///////////////////////////////////////////////////////////
  11509. StrRect=load.m_rcarray .ElementAt (14);
  11510. StrRect.top +=1*122;
  11511. StrRect.bottom +=1*122;
  11512. str="拍\r\n照";
  11513. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11514. StrRect.top +=46;
  11515. StrRect.left +=2;
  11516. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11517. m_Print.SetFontFace(10, 1, "宋体");
  11518. StrRect=load.m_rcarray .ElementAt (15);
  11519. StrRect.top +=1*122;
  11520. StrRect.bottom +=1*122;
  11521. str="拍照内容: 白 晚 特 便";
  11522. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11523. StrRect.left +=4;
  11524. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11525. StrRect=load.m_rcarray .ElementAt (21);
  11526. StrRect.top +=1*122;
  11527. StrRect.bottom +=1*122;
  11528. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11529. str=" 新人签名:";
  11530. StrRect.left +=2;
  11531. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11532. StrRect=load.m_rcarray .ElementAt (22);
  11533. StrRect.top +=1*122;
  11534. StrRect.bottom +=1*122;
  11535. if(seldlg.m_bTake)
  11536. {
  11537. if(seldlg.m_bFrame)
  11538. str="未付款:"+m_money3;
  11539. else
  11540. str=" "+m_money3;
  11541. }
  11542. else
  11543. {
  11544. if(seldlg.m_bFrame)
  11545. str="未付款:";
  11546. else
  11547. str=" ";
  11548. }
  11549. StrRect.left +=2;
  11550. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11551. StrRect=load.m_rcarray .ElementAt (23);
  11552. StrRect.top +=1*122;
  11553. StrRect.bottom +=1*122;
  11554. str="结婚秘书:";
  11555. StrRect.left +=2;
  11556. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11557. StrRect=load.m_rcarray .ElementAt (24);
  11558. StrRect.top +=1*122;
  11559. StrRect.bottom +=1*122;
  11560. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11561. StrRect.left +=3;
  11562. StrRect.top +=3;
  11563. StrRect.right -=2;
  11564. StrRect.bottom -=2;
  11565. if(seldlg.m_bTake)
  11566. {
  11567. str="";
  11568. for(i=0; i<bukuan2array.GetSize (); i++)
  11569. {
  11570. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=1)continue;
  11571. str+="加挑: ";
  11572. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11573. str+="\r\n";
  11574. }
  11575. str.TrimRight ("\r\n");
  11576. str.TrimRight (" ");
  11577. AutoDraw(m_Print, StrRect, str, 1.4);
  11578. }
  11579. ///////////////////////////////////////////////////////////
  11580. StrRect=load.m_rcarray .ElementAt (14);
  11581. StrRect.top +=2*122;
  11582. StrRect.bottom +=2*122;
  11583. str="选\r\n样";
  11584. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11585. StrRect.top +=46;
  11586. StrRect.left +=2;
  11587. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11588. m_Print.SetFontFace(10, 1, "宋体");
  11589. StrRect=load.m_rcarray .ElementAt (15);
  11590. StrRect.top +=2*122;
  11591. StrRect.bottom +=2*122;
  11592. str="选片内容:";
  11593. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11594. StrRect.left +=4;
  11595. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11596. StrRect=load.m_rcarray .ElementAt (21);
  11597. StrRect.top +=2*122;
  11598. StrRect.bottom +=2*122;
  11599. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11600. str=" 新人签名:";
  11601. StrRect.left +=2;
  11602. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11603. StrRect=load.m_rcarray .ElementAt (22);
  11604. StrRect.top +=2*122;
  11605. StrRect.bottom +=2*122;
  11606. if(seldlg.m_bChoose)
  11607. {
  11608. if(seldlg.m_bFrame)
  11609. str="未付款:"+m_money3;
  11610. else
  11611. str=" "+m_money3;
  11612. }
  11613. else
  11614. {
  11615. if(seldlg.m_bFrame)
  11616. str="未付款:";
  11617. else
  11618. str=" ";
  11619. }
  11620. StrRect.left +=2;
  11621. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11622. StrRect=load.m_rcarray .ElementAt (23);
  11623. StrRect.top +=2*122;
  11624. StrRect.bottom +=2*122;
  11625. str="结婚秘书:";
  11626. StrRect.left +=2;
  11627. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11628. StrRect=load.m_rcarray .ElementAt (24);
  11629. StrRect.top +=2*122;
  11630. StrRect.bottom +=2*122;
  11631. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11632. if(seldlg.m_bChoose)
  11633. {
  11634. StrRect.left +=3;
  11635. StrRect.top +=3;
  11636. StrRect.right -=2;
  11637. StrRect.bottom -=2;
  11638. str="";
  11639. for(i=0; i<bukuan2array.GetSize (); i++)
  11640. {
  11641. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=2)continue;
  11642. str+="加挑: ";
  11643. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11644. str+="\r\n";
  11645. }
  11646. str.TrimRight ("\r\n");
  11647. str.TrimRight (" ");
  11648. AutoDraw(m_Print, StrRect, str, 1.4);
  11649. }
  11650. ///////////////////////////////////////////////////////////
  11651. StrRect=load.m_rcarray .ElementAt (14);
  11652. StrRect.top +=3*122;
  11653. StrRect.bottom +=3*122;
  11654. str="结\r\n婚";
  11655. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11656. StrRect.top +=46;
  11657. StrRect.left +=2;
  11658. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11659. m_Print.SetFontFace(10, 1, "宋体");
  11660. StrRect=load.m_rcarray .ElementAt (15);
  11661. StrRect.top +=3*122;
  11662. StrRect.bottom +=3*122;
  11663. str="结婚内容: 区 白 晚 押金:";
  11664. if(seldlg.m_bFrame) m_Print.DrawRect2(StrRect, 1);
  11665. StrRect.left +=4;
  11666. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11667. StrRect=load.m_rcarray .ElementAt (21);
  11668. StrRect.top +=3*122;
  11669. StrRect.bottom +=3*122;
  11670. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11671. str=" 新人签名:";
  11672. StrRect.left +=2;
  11673. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11674. StrRect=load.m_rcarray .ElementAt (22);
  11675. StrRect.top +=3*122;
  11676. StrRect.bottom +=3*122;
  11677. if(seldlg.m_bBooking)
  11678. {
  11679. if(seldlg.m_bFrame)
  11680. str="未付款:"+m_money3;
  11681. else
  11682. str=" "+m_money3;
  11683. }
  11684. else
  11685. {
  11686. if(seldlg.m_bFrame)
  11687. str="未付款:";
  11688. else
  11689. str=" ";
  11690. }
  11691. StrRect.left +=2;
  11692. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11693. StrRect=load.m_rcarray .ElementAt (23);
  11694. StrRect.top +=3*122;
  11695. StrRect.bottom +=3*122;
  11696. str="结婚秘书:";
  11697. StrRect.left +=2;
  11698. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11699. StrRect=load.m_rcarray .ElementAt (24);
  11700. StrRect.top +=3*122;
  11701. StrRect.bottom +=3*122;
  11702. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11703. if(seldlg.m_bBooking)
  11704. {
  11705. StrRect.left +=3;
  11706. StrRect.top +=3;
  11707. StrRect.right -=2;
  11708. StrRect.bottom -=2;
  11709. realpos=0;str="";
  11710. for(i=0; i<sparray.GetSize (); i++)
  11711. {
  11712. if(atoi(sparray.ElementAt (i).ElementAt (4))!=2)continue;
  11713. str+=sparray.ElementAt (i).ElementAt (5);
  11714. str+=" 数量:";
  11715. str+=sparray.ElementAt (i).ElementAt (3);
  11716. if(realpos%2)
  11717. str+="\r\n";
  11718. else
  11719. str+=" ";
  11720. realpos++;
  11721. }
  11722. str.TrimRight ("\r\n");
  11723. str.TrimRight (" ");
  11724. AutoDraw(m_Print, StrRect, str, 1.4);
  11725. }
  11726. ///////////////////////////////////////
  11727. strarray.RemoveAll ();
  11728. if(seldlg.m_bFrame)
  11729. {
  11730. strarray.Add ("项目");
  11731. strarray.Add ("万");
  11732. strarray.Add ("千");
  11733. strarray.Add ("百");
  11734. strarray.Add ("十");
  11735. strarray.Add ("个");
  11736. strarray.Add ("收 银");
  11737. }
  11738. else
  11739. {
  11740. strarray.Add ("");
  11741. strarray.Add ("");
  11742. strarray.Add ("");
  11743. strarray.Add ("");
  11744. strarray.Add ("");
  11745. strarray.Add ("");
  11746. strarray.Add ("");
  11747. }
  11748. CStringArray strarray2;
  11749. float ftotal=0;
  11750. int realcount=0;
  11751. if(seldlg.m_bBooking)
  11752. {
  11753. for(i=0; i<bukuanarray.GetSize (); i++)
  11754. {
  11755. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=3 && atoi(bukuanarray.ElementAt (i).ElementAt (6))!=4)continue;
  11756. realcount++;
  11757. if(realcount>6)break;
  11758. str=bukuanarray.ElementAt (i).ElementAt (1);
  11759. ftotal+=atof(str);
  11760. strarray2.Add (GetW(str));
  11761. strarray2.Add (GetK(str));
  11762. strarray2.Add (GetB(str));
  11763. strarray2.Add (GetS(str));
  11764. strarray2.Add (GetG(str));
  11765. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11766. }
  11767. }
  11768. while(strarray2.GetSize ()<36)
  11769. strarray2.Add ("");
  11770. str.Format ("%f", ftotal);
  11771. strarray2.Add (GetW(str));
  11772. strarray2.Add (GetK(str));
  11773. strarray2.Add (GetB(str));
  11774. strarray2.Add (GetS(str));
  11775. strarray2.Add (GetG(str));
  11776. strarray2.Add ("");
  11777. //拍照
  11778. ftotal=0;
  11779. realcount=0;
  11780. if(seldlg.m_bTake)
  11781. {
  11782. for(i=0; i<bukuanarray.GetSize (); i++)
  11783. {
  11784. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=1)continue;
  11785. realcount++;
  11786. if(realcount>6)break;
  11787. str=bukuanarray.ElementAt (i).ElementAt (1);
  11788. ftotal+=atof(str);
  11789. strarray2.Add (GetW(str));
  11790. strarray2.Add (GetK(str));
  11791. strarray2.Add (GetB(str));
  11792. strarray2.Add (GetS(str));
  11793. strarray2.Add (GetG(str));
  11794. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11795. }
  11796. }
  11797. while(strarray2.GetSize ()<42+36)
  11798. strarray2.Add ("");
  11799. str.Format ("%f", ftotal);
  11800. strarray2.Add (GetW(str));
  11801. strarray2.Add (GetK(str));
  11802. strarray2.Add (GetB(str));
  11803. strarray2.Add (GetS(str));
  11804. strarray2.Add (GetG(str));
  11805. strarray2.Add ("");
  11806. //选片
  11807. ftotal=0;
  11808. realcount=0;
  11809. if(seldlg.m_bChoose)
  11810. {
  11811. for(i=0; i<bukuanarray.GetSize (); i++)
  11812. {
  11813. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=2)continue;
  11814. realcount++;
  11815. if(realcount>6)break;
  11816. str=bukuanarray.ElementAt (i).ElementAt (1);
  11817. ftotal+=atof(str);
  11818. strarray2.Add (GetW(str));
  11819. strarray2.Add (GetK(str));
  11820. strarray2.Add (GetB(str));
  11821. strarray2.Add (GetS(str));
  11822. strarray2.Add (GetG(str));
  11823. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11824. }
  11825. }
  11826. while(strarray2.GetSize ()<42*2+36)
  11827. strarray2.Add ("");
  11828. str.Format ("%f", ftotal);
  11829. strarray2.Add (GetW(str));
  11830. strarray2.Add (GetK(str));
  11831. strarray2.Add (GetB(str));
  11832. strarray2.Add (GetS(str));
  11833. strarray2.Add (GetG(str));
  11834. strarray2.Add ("");
  11835. /////////////////////////////
  11836. CRect temprc;
  11837. for(int n=0; n<4; n++)
  11838. {
  11839. StrRect=load.m_rcarray .ElementAt (17);
  11840. StrRect.top +=n*122;
  11841. StrRect.bottom +=n*122;
  11842. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11843. StrRect=load.m_rcarray .ElementAt (18);
  11844. if(n)
  11845. {
  11846. StrRect.left +=36;
  11847. StrRect.right +=36;
  11848. }
  11849. StrRect.top +=n*122;
  11850. StrRect.bottom +=n*122;
  11851. if(seldlg.m_bFrame)
  11852. str.Format("%d年", tm.GetYear ());
  11853. else
  11854. str.Format("%d ", tm.GetYear ());
  11855. 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))
  11856. {
  11857. if(seldlg.m_bFrame)
  11858. str=" 年";
  11859. else
  11860. str=" ";
  11861. }
  11862. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11863. StrRect=load.m_rcarray .ElementAt (19);
  11864. if(n)
  11865. {
  11866. StrRect.left +=38;
  11867. StrRect.right +=38;
  11868. }
  11869. StrRect.top +=n*122;
  11870. StrRect.bottom +=n*122;
  11871. if(seldlg.m_bFrame)
  11872. str.Format("%02d月", tm.GetMonth ());
  11873. else
  11874. str.Format("%02d ", tm.GetMonth ());
  11875. 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))
  11876. {
  11877. if(seldlg.m_bFrame)
  11878. str=" 月";
  11879. else
  11880. str=" ";
  11881. }
  11882. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11883. StrRect=load.m_rcarray .ElementAt (20);
  11884. if(n)
  11885. {
  11886. StrRect.left +=36;
  11887. StrRect.right +=36;
  11888. }
  11889. StrRect.top +=n*122;
  11890. StrRect.bottom +=n*122;
  11891. if(seldlg.m_bFrame)
  11892. str.Format("%02d日", tm.GetDay ());
  11893. else
  11894. str.Format("%02d ", tm.GetDay ());
  11895. 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))
  11896. {
  11897. if(seldlg.m_bFrame)
  11898. str=" 日";
  11899. else
  11900. str=" ";
  11901. }
  11902. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11903. for(i=26; i<=32; i++)
  11904. {
  11905. StrRect=load.m_rcarray .ElementAt (i-1);
  11906. StrRect.bottom -=14;
  11907. for(int j=0; j<8; j++)
  11908. {
  11909. StrRect.top=StrRect.bottom;
  11910. if(j>2)
  11911. {
  11912. StrRect.bottom =StrRect.top+14;
  11913. }
  11914. else
  11915. {
  11916. StrRect.bottom =StrRect.top+13;
  11917. }
  11918. temprc=StrRect;
  11919. StrRect.top +=n*122;
  11920. StrRect.bottom +=n*122;
  11921. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11922. if(i==26 && j==4 && seldlg.m_bFrame)
  11923. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11924. else if(i==26 && j==5 && seldlg.m_bFrame)
  11925. m_Print.DrawText((LPTSTR)(LPCTSTR)"付款", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11926. else if(i==26 && j==7 && seldlg.m_bFrame)
  11927. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11928. else if(j==0)
  11929. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-26), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11930. else if(j && i>26 && n<3)
  11931. {
  11932. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray2.ElementAt ((j-1)*6+(i-27)+n*42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11933. }
  11934. StrRect=temprc;
  11935. }
  11936. }
  11937. }
  11938. if(seldlg.m_bFrame)
  11939. {
  11940. StrRect=load.m_rcarray .ElementAt (32);
  11941. str="注\r\n意\r\n事\r\n项";
  11942. StrRect.top +=367;
  11943. StrRect.bottom +=367;
  11944. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11945. StrRect.top +=17;
  11946. StrRect.left +=2;
  11947. AutoDraw(m_Print, StrRect, str, 1.4);
  11948. StrRect=load.m_rcarray .ElementAt (33);
  11949. str="1: 本预约单自预定日期起一年内有效.定金在拍照套系金额中扣出.预定金一概不退\r\n\
  11950. 2: 多拍照片只供筛选.恕不奉送.版权所有.不得私自拷贝\r\n\
  11951. 3: 拍照款请于拍照时一次付清\r\n\
  11952. 4: 新娘装AM8:00前钟点费另计.婚纱礼服出租押金500-2000元\r\n\
  11953. 5: 本公司设有豪华VIP礼服区.及皇家御用礼服展区.但需另外加价.详情请咨本店人员\r\n\
  11954. 6: 安瓶, 美甲一次性化妆用具等均属增值服务部分,则需另外加价,详情咨询本店工作人员\r\n\
  11955. 7: 本电脑机械故障导致文件资料丢失.本公司只提供补拍服务\r\n\
  11956. 8: 每次前来请务必携带本单交给工作人员.本单是您在摩登新娘拍照的凭证.办理有关手续凭本单办理盖\r\n\
  11957. 章后方可生效";
  11958. StrRect.top +=367;
  11959. StrRect.bottom +=367;
  11960. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11961. StrRect.top +=4;
  11962. StrRect.left +=2;
  11963. AutoDraw(m_Print, StrRect, str, 1.0);
  11964. StrRect=load.m_rcarray .ElementAt (34);
  11965. 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)";
  11966. AutoDraw(m_Print, StrRect, str, 1.0);
  11967. m_Print.SetFontFace(13, 1, "宋体");
  11968. StrRect=load.m_rcarray .ElementAt (35);
  11969. str="地 址: 汉口 . 解放大道 . 头道街东部购物公园C栋二,三层";
  11970. StrRect.top +=367;
  11971. StrRect.bottom +=367;
  11972. StrRect.left +=2;
  11973. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11974. StrRect=load.m_rcarray .ElementAt (36);
  11975. str="喜讯热线: 027-81888799 81888599 81888699";
  11976. StrRect.top +=367;
  11977. StrRect.bottom +=367;
  11978. StrRect.left +=2;
  11979. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11980. }
  11981. PrintPreview dlg;
  11982. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11983. dlg.m_pDC =m_Print.GetPDC() ;
  11984. if(dlg.DoModal ()!=IDOK)return;
  11985. //结束打印
  11986. m_Print.EndPage();
  11987. m_Print.EndPrint();
  11988. #endif
  11989. }
  11990. extern CString GetHMoney(CString str);
  11991. void CMainFrame::PrintReceipt3(CString strOrderNumber, CStringArray *pArray, float money)
  11992. {
  11993. int printcot = 1;
  11994. for (int aa = 0; aa < printcot; aa++)
  11995. {
  11996. g_sendhead.bsql = 0;
  11997. g_sendhead.code[0] = 24;
  11998. g_sendhead.tabcount = 1;
  11999. int g_nYearposTemp = g_nYearpos;
  12000. g_nYearpos = -1;
  12001. g_pMainWnd->ProcessChatMessageRequest2(1);
  12002. g_nYearpos = g_nYearposTemp;
  12003. if (0 == g_bSendOK)return;
  12004. DataToArray(&g_cominfoarray);
  12005. CString SerialNo;
  12006. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  12007. CPrintRX m_Print;
  12008. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12009. {
  12010. m_Print.InitToPrint(NULL, 1);
  12011. }
  12012. else
  12013. {
  12014. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  12015. if (name.IsEmpty())
  12016. m_Print.InitToPrint(NULL, 1);
  12017. else
  12018. {
  12019. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12020. if (nret == -1 && aa == 0)
  12021. {
  12022. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12023. }
  12024. }
  12025. }
  12026. m_Print.StartPrint();
  12027. m_Print.StartPage();
  12028. LoadRect load;
  12029. load.SetLiaPath("15.lia");
  12030. load.SetMargins(0, 0);
  12031. if (!load.Load())return;
  12032. int i;
  12033. //////////////////////////////////////////////////////////////
  12034. CStringArray txarray;
  12035. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  12036. g_sendhead.code[0] = 11;
  12037. g_sendhead.code[1] = 52;
  12038. g_sendhead.tabcount = 2;
  12039. g_sendhead.bsql = 0;
  12040. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12041. CArray<CStringArray, CStringArray>sparray;
  12042. CArray<CStringArray, CStringArray>clientarray;
  12043. DataToArray(&g_List1array, &clientarray);
  12044. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12045. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12046. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12047. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12048. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12049. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  12050. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12051. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12052. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12053. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12054. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12055. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12056. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12057. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12058. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12059. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12060. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12061. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12062. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12063. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12064. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12065. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12066. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12067. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12068. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12069. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12070. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12071. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12072. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  12073. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12074. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12075. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  12076. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  12077. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  12078. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  12079. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  12080. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  12081. CString m_addr = m_addr1 + ";";
  12082. m_addr.TrimLeft(";");
  12083. m_addr += m_addr2;
  12084. CString m_qq = m_qq1 + ";";
  12085. m_qq.TrimLeft(";");
  12086. m_qq += m_qq2;
  12087. m_money1.Format("%f", atof(m_taoxijiage));
  12088. m_money2.Format("%f", atof(m_payed1));
  12089. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  12090. ConvertToPrice(m_money1);
  12091. ConvertToPrice(m_money2);
  12092. ConvertToPrice(m_money3);
  12093. ////////////////////////////////////////////////////////////////
  12094. int rcpos = -1;
  12095. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12096. m_Print.SetFontFace(17, 1, "宋体");
  12097. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12098. StrRect.top -= 0;
  12099. StrRect.bottom -= 10;
  12100. StrRect.left -= 140;
  12101. StrRect.right = StrRect.left + 48;
  12102. m_Print.SetFontFace(15, 1, "宋体");
  12103. m_Print.SetColor(0xffffff);
  12104. m_Print.DrawRect(StrRect, 0);
  12105. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12106. StrRect.left = StrRect.right;
  12107. StrRect.right = StrRect.left + 48;
  12108. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12109. m_Print.SetColor(0, RGB(255, 0, 0));
  12110. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12111. m_Print.SetColor(0);
  12112. m_Print.SetFontFace(12, 1, "宋体");
  12113. StrRect.left -= 48;
  12114. int hei = StrRect.Height();
  12115. StrRect.top = StrRect.bottom + 2;
  12116. StrRect.bottom += hei + 2;
  12117. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12118. StrRect.top = StrRect.bottom - 2;
  12119. StrRect.bottom += hei - 5;
  12120. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12121. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12122. m_Print.SetFontFace(12, 1, "宋体");
  12123. m_Print.DrawText((LPTSTR)(LPCTSTR)"收款单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12124. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12125. m_Print.SetFontFace(9, 1, "宋体");
  12126. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12127. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12128. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12129. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12130. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12131. m_Print.DrawRect2(StrRect, 2);
  12132. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12133. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12134. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12135. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12136. m_Print.DrawRect2(StrRect, 2);
  12137. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12138. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12139. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12140. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12141. m_Print.DrawRect2(StrRect, 2);
  12142. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12143. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12144. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12145. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12146. m_Print.DrawRect2(StrRect, 2);
  12147. ////////////
  12148. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12149. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12150. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12151. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12152. m_Print.DrawRect2(StrRect, 2);
  12153. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12154. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12155. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12156. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12157. m_Print.DrawRect2(StrRect, 2);
  12158. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12159. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12160. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12161. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12162. m_Print.DrawRect2(StrRect, 2);
  12163. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12164. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12165. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12166. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12167. m_Print.DrawRect2(StrRect, 2);
  12168. for (i = 19; i < 49; i++)
  12169. {
  12170. if (i >= 44)
  12171. {
  12172. StrRect = load.m_rcarray.ElementAt(i - 5);
  12173. int hei = StrRect.Height();
  12174. StrRect.top += hei;
  12175. StrRect.bottom += hei;
  12176. }
  12177. else
  12178. StrRect = load.m_rcarray.ElementAt(i);
  12179. m_Print.DrawRect2(StrRect, 1);
  12180. }
  12181. float fmoney = 0;
  12182. for (i = 19; i < 49; i++)
  12183. {
  12184. if (i >= 44)
  12185. {
  12186. StrRect = load.m_rcarray.ElementAt(i - 5);
  12187. int hei = StrRect.Height();
  12188. StrRect.top += hei;
  12189. StrRect.bottom += hei;
  12190. }
  12191. else
  12192. StrRect = load.m_rcarray.ElementAt(i);
  12193. StrRect.left += 2;
  12194. /* if((i-19)%5==2)
  12195. {
  12196. fmoney+=atof(pArray->ElementAt (i-19));
  12197. }*/
  12198. m_Print.DrawText((LPTSTR)(LPCTSTR)(pArray->ElementAt(i - 19)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12199. }
  12200. m_money2.Format("%f", money);
  12201. ConvertToPrice(m_money2);
  12202. StrRect = load.m_rcarray.ElementAt(44);
  12203. CString str;
  12204. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 实收¥: %s 元 收银员: %s", \
  12205. GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
  12206. m_money2, g_user.name);
  12207. m_Print.DrawRect2(StrRect, 1);
  12208. StrRect.left += 3;
  12209. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12210. StrRect = load.m_rcarray.ElementAt(46);
  12211. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12212. StrRect = load.m_rcarray.ElementAt(47);
  12213. m_Print.DrawRect2(StrRect, 2);
  12214. StrRect = load.m_rcarray.ElementAt(48);
  12215. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12216. StrRect = load.m_rcarray.ElementAt(45);
  12217. str = "\
  12218. 顾客须知\r\n\
  12219. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  12220. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  12221. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  12222. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  12223. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  12224. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  12225. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  12226. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12227. AutoDraw(m_Print, StrRect, str, 1.8);
  12228. PrintPreview dlg;
  12229. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12230. dlg.m_pDC = m_Print.GetPDC();
  12231. if (aa == 0)
  12232. {
  12233. if (dlg.DoModal() != IDOK)
  12234. return;
  12235. printcot = dlg.m_num;
  12236. }
  12237. //结束打印
  12238. m_Print.EndPage();
  12239. m_Print.EndPrint();
  12240. }
  12241. }
  12242. void CMainFrame::PrintReceipt2(CString strOrderNumber)
  12243. {
  12244. int printcot = 1;
  12245. for (int aa = 0; aa < printcot; aa++)
  12246. {
  12247. g_sendhead.bsql = 0;
  12248. g_sendhead.code[0] = 24;
  12249. g_sendhead.tabcount = 1;
  12250. int g_nYearposTemp = g_nYearpos;
  12251. g_nYearpos = -1;
  12252. g_pMainWnd->ProcessChatMessageRequest2(1);
  12253. g_nYearpos = g_nYearposTemp;
  12254. if (0 == g_bSendOK)return;
  12255. DataToArray(&g_cominfoarray);
  12256. CString SerialNo;
  12257. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  12258. CPrintRX m_Print;
  12259. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12260. {
  12261. m_Print.InitToPrint(NULL, 1);
  12262. }
  12263. else
  12264. {
  12265. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  12266. if (name.IsEmpty())
  12267. m_Print.InitToPrint(NULL, 1);
  12268. else
  12269. {
  12270. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12271. if (nret == -1 && aa == 0)
  12272. {
  12273. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12274. }
  12275. }
  12276. }
  12277. m_Print.StartPrint();
  12278. m_Print.StartPage();
  12279. LoadRect load;
  12280. load.SetLiaPath("14.lia");
  12281. load.SetMargins(0, 0);
  12282. if (!load.Load())return;
  12283. int i;
  12284. //////////////////////////////////////////////////////////////
  12285. CStringArray txarray;
  12286. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  12287. g_sendhead.code[0] = 11;
  12288. g_sendhead.code[1] = 52;
  12289. g_sendhead.code[2] = 93;
  12290. g_sendhead.tabcount = 3;
  12291. g_sendhead.bsql = 0;
  12292. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12293. CArray<CStringArray, CStringArray>sparray;
  12294. CArray<CStringArray, CStringArray>clientarray;
  12295. CArray<CStringArray, CStringArray>moneyarray;
  12296. DataToArray(&g_List1array, &clientarray, &moneyarray);
  12297. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12298. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12299. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12300. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12301. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12302. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  12303. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12304. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12305. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12306. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12307. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12308. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12309. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12310. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12311. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12312. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12313. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12314. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12315. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12316. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12317. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12318. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12319. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12320. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12321. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12322. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12323. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12324. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12325. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  12326. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12327. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12328. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  12329. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  12330. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  12331. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  12332. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  12333. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  12334. CString m_addr = m_addr1 + ";";
  12335. m_addr.TrimLeft(";");
  12336. m_addr += m_addr2;
  12337. CString m_qq = m_qq1 + ";";
  12338. m_qq.TrimLeft(";");
  12339. m_qq += m_qq2;
  12340. m_money1.Format("%f", atof(m_taoxijiage));
  12341. m_money2 = "0";
  12342. for (i = 0; i < moneyarray.GetSize(); i++)
  12343. {
  12344. if (moneyarray.ElementAt(i).ElementAt(5) == "预约收款")
  12345. m_money2 = moneyarray.ElementAt(i).ElementAt(1);
  12346. }
  12347. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  12348. ConvertToPrice(m_money1);
  12349. ConvertToPrice(m_money2);
  12350. ConvertToPrice(m_money3);
  12351. ////////////////////////////////////////////////////////////////
  12352. int rcpos = -1;
  12353. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12354. m_Print.SetFontFace(17, 1, "宋体");
  12355. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12356. StrRect.top -= 0;
  12357. StrRect.bottom -= 10;
  12358. StrRect.left -= 140;
  12359. StrRect.right = StrRect.left + 48;
  12360. m_Print.SetFontFace(15, 1, "宋体");
  12361. m_Print.SetColor(0xffffff);
  12362. m_Print.DrawRect(StrRect, 0);
  12363. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12364. StrRect.left = StrRect.right;
  12365. StrRect.right = StrRect.left + 48;
  12366. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12367. m_Print.SetColor(0, RGB(255, 0, 0));
  12368. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12369. m_Print.SetColor(0);
  12370. m_Print.SetFontFace(12, 1, "宋体");
  12371. StrRect.left -= 48;
  12372. int hei = StrRect.Height();
  12373. StrRect.top = StrRect.bottom + 2;
  12374. StrRect.bottom += hei + 2;
  12375. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12376. StrRect.top = StrRect.bottom - 2;
  12377. StrRect.bottom += hei - 5;
  12378. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12379. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12380. m_Print.SetFontFace(12, 1, "宋体");
  12381. m_Print.DrawText((LPTSTR)(LPCTSTR)"定金单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12382. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12383. m_Print.SetFontFace(9, 1, "宋体");
  12384. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12385. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12386. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12387. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12388. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12389. m_Print.DrawRect2(StrRect, 2);
  12390. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12391. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12392. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12393. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12394. m_Print.DrawRect2(StrRect, 2);
  12395. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12396. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12397. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12398. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12399. m_Print.DrawRect2(StrRect, 2);
  12400. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12401. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12402. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12403. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12404. m_Print.DrawRect2(StrRect, 2);
  12405. ////////////
  12406. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12407. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12408. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12409. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12410. m_Print.DrawRect2(StrRect, 2);
  12411. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12412. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12413. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12414. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12415. m_Print.DrawRect2(StrRect, 2);
  12416. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12417. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12418. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12419. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12420. m_Print.DrawRect2(StrRect, 2);
  12421. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12422. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12423. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12424. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12425. m_Print.DrawRect2(StrRect, 2);
  12426. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12427. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12428. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12429. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12430. m_Print.DrawRect2(StrRect, 2);
  12431. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12432. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12433. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12434. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12435. m_Print.DrawRect2(StrRect, 2);
  12436. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12437. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/MSN:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12438. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12439. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12440. m_Print.DrawRect2(StrRect, 2);
  12441. CStringArray strarray;
  12442. strarray.Add("套系名称");
  12443. strarray.Add("总 额");
  12444. strarray.Add("定 金");
  12445. strarray.Add("余 款");
  12446. strarray.Add("摄影日期");
  12447. strarray.Add(m_taoxiname);
  12448. strarray.Add(m_money1);
  12449. strarray.Add(m_money2);
  12450. strarray.Add(m_money3);
  12451. strarray.Add(m_time2);
  12452. for (i = 25; i < 37; i++)
  12453. {
  12454. StrRect = load.m_rcarray.ElementAt(i);
  12455. m_Print.DrawRect2(StrRect, 1);
  12456. }
  12457. for (i = 25; i < 35; i++)
  12458. {
  12459. StrRect = load.m_rcarray.ElementAt(i);
  12460. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 25), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12461. }
  12462. StrRect = load.m_rcarray.ElementAt(35);
  12463. StrRect.left += 5;
  12464. StrRect.top += 5;
  12465. m_Print.DrawText((LPTSTR)(LPCTSTR)" 备 注:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  12466. StrRect = load.m_rcarray.ElementAt(36);
  12467. CString str;
  12468. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 ¥: %s 元 收银员: %s", \
  12469. GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
  12470. m_money2, g_user.name);
  12471. StrRect.left += 3;
  12472. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12473. StrRect = load.m_rcarray.ElementAt(38);
  12474. m_Print.DrawText((LPTSTR)(LPCTSTR)"营业员:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12475. StrRect = load.m_rcarray.ElementAt(39);
  12476. m_Print.DrawText((LPTSTR)(LPCTSTR)m_ren, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12477. m_Print.DrawRect2(StrRect, 2);
  12478. StrRect = load.m_rcarray.ElementAt(40);
  12479. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12480. StrRect = load.m_rcarray.ElementAt(41);
  12481. m_Print.DrawRect2(StrRect, 2);
  12482. StrRect = load.m_rcarray.ElementAt(42);
  12483. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12484. StrRect = load.m_rcarray.ElementAt(37);
  12485. str = "\
  12486. 顾客须知\r\n\
  12487. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  12488. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  12489. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  12490. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  12491. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  12492. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  12493. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  12494. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12495. AutoDraw(m_Print, StrRect, str, 1.8);
  12496. PrintPreview dlg;
  12497. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12498. dlg.m_pDC = m_Print.GetPDC();
  12499. if (aa == 0)
  12500. {
  12501. if (dlg.DoModal() != IDOK)
  12502. return;
  12503. printcot = dlg.m_num;
  12504. }
  12505. //结束打印
  12506. m_Print.EndPage();
  12507. m_Print.EndPrint();
  12508. }
  12509. }
  12510. void CMainFrame::OnAutodelphoto()
  12511. {
  12512. // TODO: Add your command handler code here
  12513. if (g_user.bLongin == 0)
  12514. {
  12515. if (g_bNoLoginLia)
  12516. {
  12517. Login dlg;
  12518. dlg.SetLiaPath("5.lia");
  12519. dlg.DoModal();
  12520. }
  12521. else
  12522. {
  12523. Login3 dlg;
  12524. dlg.SetLiaPath("5.lia");
  12525. dlg.DoModal();
  12526. }
  12527. if (g_user.bLongin == 0)return;
  12528. }
  12529. if (IsHasRightsnew(49) == 0)return;
  12530. DelPhotoSet dlg;
  12531. dlg.DoModal();
  12532. }
  12533. void CMainFrame::Onphotomanage() // 客照管理中心;
  12534. {
  12535. if (g_user.bLongin == 0)
  12536. {
  12537. if (g_bNoLoginLia)
  12538. {
  12539. Login dlg;
  12540. dlg.SetLiaPath("5.lia");
  12541. dlg.DoModal();
  12542. }
  12543. else
  12544. {
  12545. Login3 dlg;
  12546. dlg.SetLiaPath("5.lia");
  12547. dlg.DoModal();
  12548. }
  12549. if (g_user.bLongin == 0)return;
  12550. }
  12551. if (IsHasRightsnew(49) == 0)return;
  12552. ShowPic3 dlg;
  12553. dlg.DoModal();
  12554. }
  12555. void CMainFrame::OnCompanyinfo()
  12556. {
  12557. // TODO: Add your command handler code here
  12558. if (g_user.bLongin == 0)
  12559. {
  12560. if (g_bNoLoginLia)
  12561. {
  12562. Login dlg;
  12563. dlg.SetLiaPath("5.lia");
  12564. dlg.DoModal();
  12565. }
  12566. else
  12567. {
  12568. Login3 dlg;
  12569. dlg.SetLiaPath("5.lia");
  12570. dlg.DoModal();
  12571. }
  12572. if (g_user.bLongin == 0)return;
  12573. }
  12574. if (IsHasRightsnew(49) == 0)return;
  12575. CompanyInfo dlg;
  12576. dlg.DoModal();
  12577. }
  12578. void CMainFrame::OnTaoxifg()
  12579. {
  12580. // TODO: Add your command handler code here
  12581. if (g_user.bLongin == 0)
  12582. {
  12583. if (g_bNoLoginLia)
  12584. {
  12585. Login dlg;
  12586. dlg.SetLiaPath("5.lia");
  12587. dlg.DoModal();
  12588. }
  12589. else
  12590. {
  12591. Login3 dlg;
  12592. dlg.SetLiaPath("5.lia");
  12593. dlg.DoModal();
  12594. }
  12595. if (g_user.bLongin == 0)return;
  12596. }
  12597. if (IsHasRightsnew(49) == 0)return;
  12598. TXFG dlg;
  12599. dlg.DoModal();
  12600. }
  12601. void CMainFrame::OnHelpfile()
  12602. {
  12603. // TODO: Add your command handler code here
  12604. // ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  12605. // if(::PathFileExists (g_mainpath+"\\zx.dll"))
  12606. // ShellExecute(NULL, _T("open"), _T("www.zcsmkj.com"), "", NULL, SW_SHOWNORMAL);
  12607. // else
  12608. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  12609. }
  12610. void CMainFrame::OnPhotobak()
  12611. {
  12612. // TODO: Add your command handler code here
  12613. if (g_user.bLongin == 0)
  12614. {
  12615. if (g_bNoLoginLia)
  12616. {
  12617. Login dlg;
  12618. dlg.SetLiaPath("5.lia");
  12619. dlg.DoModal();
  12620. }
  12621. else
  12622. {
  12623. Login3 dlg;
  12624. dlg.SetLiaPath("5.lia");
  12625. dlg.DoModal();
  12626. }
  12627. if (g_user.bLongin == 0)return;
  12628. }
  12629. if (IsHasRightsnew(49) == 0)return;
  12630. PhotoBak dlg;
  12631. dlg.DoModal();
  12632. }
  12633. //客户报表
  12634. void CMainFrame::OnClose2()
  12635. { // TODO: Add your message handler code here and/or call default
  12636. if (AfxMessageBox("是否退出系统?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
  12637. if(g_user.bLongin)
  12638. WriteLog("退出系统");//Jeff.add;
  12639. g_bShowBar = 0;
  12640. if (m_Mdi.MainClose())
  12641. CMDIFrameWnd::OnClose();
  12642. }
  12643. //
  12644. void CMainFrame::ResetTimer()
  12645. {
  12646. }
  12647. void CMainFrame::LinkClick(CString str, int nParent)
  12648. {
  12649. g_pMainWnd2->m_bar.LinkClick(str);
  12650. }
  12651. void CMainFrame::PrintFlowChart2(CString m_id)
  12652. {
  12653. CPrintRX m_Print;
  12654. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12655. {
  12656. m_Print.InitToPrint(NULL, 1);
  12657. }
  12658. else
  12659. {
  12660. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  12661. if (name.IsEmpty())
  12662. m_Print.InitToPrint(NULL, 1);
  12663. else
  12664. {
  12665. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12666. if (nret == -1)
  12667. {
  12668. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12669. }
  12670. }
  12671. }
  12672. m_Print.StartPrint();
  12673. m_Print.StartPage();
  12674. LoadRect load;
  12675. load.SetLiaPath("16.lia");
  12676. load.SetMargins(0, 0);
  12677. if (!load.Load())return;
  12678. LoadRect load2;
  12679. load2.SetLiaPath("17.lia");
  12680. load2.SetMargins(0, 660);
  12681. if (!load2.Load())return;
  12682. int i;
  12683. //////////////////////////////////////////////////////////////
  12684. CStringArray txarray;
  12685. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and kind<>'2'";
  12686. g_sendhead.code[0] = 11;
  12687. g_sendhead.code[1] = 52;
  12688. g_sendhead.code[2] = 223;
  12689. g_sendhead.tabcount = 3;
  12690. g_sendhead.bsql = 0;
  12691. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12692. CArray<CStringArray, CStringArray>sparray;
  12693. CArray<CStringArray, CStringArray>clientarray;
  12694. DataToArray(&g_List1array, &clientarray, &sparray);
  12695. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12696. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12697. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12698. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12699. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12700. CString m_photocount = g_List1array.ElementAt(0).ElementAt(9);
  12701. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12702. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12703. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12704. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12705. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12706. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12707. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12708. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12709. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12710. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12711. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12712. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12713. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12714. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12715. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12716. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12717. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12718. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12719. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12720. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12721. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12722. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12723. CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(39) + g_List1array.ElementAt(0).ElementAt(75);
  12724. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12725. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12726. CString spno;
  12727. for (i = 0; i < sparray.GetSize(); i++)
  12728. {
  12729. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12730. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  12731. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  12732. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  12733. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  12734. spno += sparray.ElementAt(i).ElementAt(5);
  12735. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
  12736. spno += "; ";
  12737. else
  12738. {
  12739. spno += ":";
  12740. spno += sparray.ElementAt(i).ElementAt(6);
  12741. spno += "; ";
  12742. }
  12743. }
  12744. spno += " 加挑:";
  12745. for (i = 0; i < sparray.GetSize(); i++)
  12746. {
  12747. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  12748. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  12749. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  12750. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  12751. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  12752. spno += sparray.ElementAt(i).ElementAt(5);
  12753. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
  12754. spno += "; ";
  12755. else
  12756. {
  12757. spno += ":";
  12758. spno += sparray.ElementAt(i).ElementAt(6);
  12759. spno += "; ";
  12760. }
  12761. }
  12762. if (spno.Right(6) == " 加挑:")
  12763. {
  12764. spno = spno.Left(spno.GetLength() - 6);
  12765. }
  12766. ////////////////////////////////////////////////////////////////
  12767. int rcpos = -1;
  12768. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12769. m_Print.SetFontFace(17, 1, "宋体");
  12770. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12771. StrRect.top -= 0;
  12772. StrRect.bottom -= 10;
  12773. StrRect.left -= 140;
  12774. StrRect.right = StrRect.left + 48;
  12775. m_Print.SetFontFace(15, 1, "宋体");
  12776. m_Print.SetColor(0xffffff);
  12777. m_Print.DrawRect(StrRect, 0);
  12778. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12779. StrRect.left = StrRect.right;
  12780. StrRect.right = StrRect.left + 48;
  12781. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12782. m_Print.SetColor(0, RGB(255, 0, 0));
  12783. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12784. m_Print.SetColor(0);
  12785. m_Print.SetFontFace(12, 1, "宋体");
  12786. StrRect.left -= 48;
  12787. int hei = StrRect.Height();
  12788. StrRect.top = StrRect.bottom + 2;
  12789. StrRect.bottom += hei + 2;
  12790. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12791. StrRect.top = StrRect.bottom - 2;
  12792. StrRect.bottom += hei - 5;
  12793. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12794. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12795. m_Print.SetFontFace(12, 1, "宋体");
  12796. m_Print.DrawText((LPTSTR)(LPCTSTR)"加做取件单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12797. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12798. m_Print.SetFontFace(11, 1, "宋体");
  12799. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + m_id), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  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_name1, 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_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12809. m_Print.DrawRect2(StrRect, 2);
  12810. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12811. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12812. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12813. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time4, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12814. m_Print.DrawRect2(StrRect, 2);
  12815. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12816. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12817. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12818. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12819. m_Print.DrawRect2(StrRect, 2);
  12820. ////////////
  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_name2, 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_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12830. m_Print.DrawRect2(StrRect, 2);
  12831. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12832. m_Print.DrawText((LPTSTR)(LPCTSTR)"赠送张数:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12833. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12834. m_Print.DrawText((LPTSTR)(LPCTSTR)m_photocount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12835. m_Print.DrawRect2(StrRect, 2);
  12836. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12837. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12838. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12839. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12840. m_Print.DrawRect2(StrRect, 2);
  12841. ////////////
  12842. ///////////spno
  12843. CRect sprc[22];
  12844. StrRect = load.m_rcarray.ElementAt(19);
  12845. StrRect.left += 4; StrRect.right -= 3;
  12846. hei = StrRect.Height();
  12847. for (i = 0; i < 22; i++)
  12848. {
  12849. sprc[i] = StrRect;
  12850. m_Print.DrawRect2(StrRect, 1);
  12851. if (i == 0)
  12852. {
  12853. StrRect.left += 5;
  12854. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12855. StrRect.left -= 5;
  12856. }
  12857. StrRect.top = StrRect.bottom;
  12858. StrRect.bottom = StrRect.top + hei;
  12859. sprc[i].left += 4; sprc[i].right -= 3;
  12860. }
  12861. StrRect.bottom = StrRect.top + 60;
  12862. m_Print.DrawRect2(StrRect, 1);
  12863. StrRect.left += 3; StrRect.top += 3;
  12864. StrRect.right -= 3; StrRect.bottom -= 3;
  12865. AutoDraw(m_Print, StrRect, m_bz, 1.8);
  12866. CString temp, tempspno, tempbz;
  12867. CSize size;
  12868. BOOL bRun = 0;
  12869. int fontsize = 12;
  12870. ll: tempspno = spno;
  12871. m_Print.SetFontFace(fontsize, 1, "宋体");
  12872. for (i = 1; i<22; i++)
  12873. {
  12874. if (!tempspno.IsEmpty())
  12875. {
  12876. temp = tempspno;
  12877. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12878. int right = 0;
  12879. CRect temprc = sprc[i];
  12880. while (size.cx>temprc.Width())
  12881. {
  12882. right++;
  12883. temp = tempspno.Left(tempspno.GetLength() - (right));
  12884. if (GIsHalfHZ(temp))
  12885. {
  12886. right++;
  12887. temp.Delete(temp.GetLength() - 1);
  12888. }
  12889. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12890. }
  12891. if (bRun)
  12892. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12893. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  12894. if (tempspno.IsEmpty())i++;
  12895. }
  12896. }
  12897. if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
  12898. {
  12899. fontsize--;
  12900. goto ll;
  12901. }
  12902. if (bRun == 0)
  12903. {
  12904. bRun = 1;
  12905. goto ll;
  12906. }
  12907. m_Print.SetFontFace(12, 1, "宋体");
  12908. StrRect = load2.m_rcarray.ElementAt(1);
  12909. m_Print.DrawText((LPTSTR)(LPCTSTR)"喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12910. StrRect = load2.m_rcarray.ElementAt(2);
  12911. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12912. StrRect = load2.m_rcarray.ElementAt(3);
  12913. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12914. StrRect = load2.m_rcarray.ElementAt(4);
  12915. m_Print.DrawRect2(StrRect, 2);
  12916. StrRect = load2.m_rcarray.ElementAt(0);
  12917. CString str = "\
  12918. 爱心提示:如对制作有任何要求请清楚列出,所有制作内容一经确认将按要求制作。\r\n\
  12919. 选样文件从拍摄日期计算将保留二个月;套相成品按取件日期保留三个月,逾期不做保留。\r\n\
  12920. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12921. AutoDraw(m_Print, StrRect, str, 1.8);
  12922. PrintPreview dlg; dlg.m_mode = 2;
  12923. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12924. dlg.m_pDC = m_Print.GetPDC();
  12925. if (dlg.DoModal() != IDOK)return;
  12926. //结束打印
  12927. m_Print.EndPage();
  12928. m_Print.EndPrint();
  12929. }
  12930. //分店
  12931. CString CMainFrame::GetDanWei(CString name, CArray<CStringArray, CStringArray>*array)
  12932. {
  12933. for (int i = 0; i < array->GetSize(); i++)
  12934. {
  12935. if (name == array->ElementAt(i).ElementAt(1))
  12936. return array->ElementAt(i).ElementAt(2);
  12937. }
  12938. return "";
  12939. }
  12940. //g_sendhead
  12941. int CMainFrame::GetPort()
  12942. {
  12943. static int aaa = -1;
  12944. if (aaa == -1)
  12945. {
  12946. aaa = CTime::GetCurrentTime().GetSecond() % 7;
  12947. }
  12948. aaa++;
  12949. if (aaa >= 7)aaa = 0;
  12950. return 8387 + aaa;
  12951. }
  12952. void CMainFrame::OnShowBakState()
  12953. {
  12954. // TODO: Add your command handler code here
  12955. g_sendhead.bsql = 0;
  12956. g_sendhead.code[0] = 171;
  12957. g_sendhead.tabcount = 1;
  12958. g_pMainWnd->ProcessChatMessageRequest2(1);
  12959. if (g_bSendOK == 0)
  12960. {
  12961. return;
  12962. }
  12963. CArray<CStringArray, CStringArray>g_bakstatearray;
  12964. DataToArray(&g_bakstatearray);
  12965. while (g_bakstatearray.GetSize() > 7)
  12966. {
  12967. g_bakstatearray.RemoveAt(0);
  12968. }
  12969. int photocount = 0;
  12970. int infocount = 0;
  12971. for (int i = 0; i < g_bakstatearray.GetSize(); i++)
  12972. {
  12973. if (g_bakstatearray.ElementAt(i).ElementAt(1) != "1")photocount++;
  12974. if (g_bakstatearray.ElementAt(i).ElementAt(2) != "1")infocount++;
  12975. }
  12976. ShowBakState dlg;
  12977. dlg.m_pArray = &g_bakstatearray;
  12978. dlg.DoModal();
  12979. }
  12980. void CMainFrame::PrintReceipt2(CStringArray *pArray)
  12981. {
  12982. int printcot = 1;
  12983. for (int aa = 0; aa < printcot; aa++)
  12984. {
  12985. g_sendhead.bsql = 0;
  12986. g_sendhead.code[0] = 24;
  12987. g_sendhead.tabcount = 1;
  12988. int g_nYearposTemp = g_nYearpos;
  12989. g_nYearpos = -1;
  12990. g_pMainWnd->ProcessChatMessageRequest2(1);
  12991. g_nYearpos = g_nYearposTemp;
  12992. if (0 == g_bSendOK)return;
  12993. DataToArray(&g_cominfoarray);
  12994. CString SerialNo;
  12995. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
  12996. CPrintRX m_Print;
  12997. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12998. {
  12999. m_Print.InitToPrint(NULL, 1);
  13000. }
  13001. else
  13002. {
  13003. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13004. if (name.IsEmpty())
  13005. m_Print.InitToPrint(NULL, 1);
  13006. else
  13007. {
  13008. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13009. if (nret == -1 && aa == 0)
  13010. {
  13011. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13012. }
  13013. }
  13014. }
  13015. m_Print.StartPrint();
  13016. m_Print.StartPage();
  13017. LoadRect load;
  13018. BOOL bSmall = 0;
  13019. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  13020. {
  13021. bSmall = 1;
  13022. load.SetLiaPath("20.lia");
  13023. }
  13024. else
  13025. load.SetLiaPath("10.lia");
  13026. if (bSmall)
  13027. load.SetMargins(-10, 0);
  13028. else
  13029. load.SetMargins(10, 0);
  13030. if (!load.Load())return;
  13031. int rcpos = -1;
  13032. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13033. Image *pImg = NULL;
  13034. #ifdef MNLS_VERSION
  13035. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  13036. #else
  13037. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  13038. #endif
  13039. // m_Print.DrawImage(pImg, StrRect);
  13040. delete pImg;
  13041. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  13042. {
  13043. Image *pImg = NULL;
  13044. g_nSendCode = 31;
  13045. int g_nYearposTemp = g_nYearpos;
  13046. g_nYearpos = -1;
  13047. g_pMainWnd->ProcessChatMessageRequest2(1);
  13048. g_nYearpos = g_nYearposTemp;
  13049. g_nSendCode = 0;
  13050. if (g_bSendOK == 0)return;
  13051. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  13052. if (pImg)
  13053. {
  13054. StrRect.left = 65;
  13055. if (bSmall)StrRect.left = 55;
  13056. StrRect.top = 10;
  13057. StrRect.right = StrRect.left + 58;
  13058. StrRect.bottom = StrRect.top + 58;
  13059. m_Print.DrawImage(pImg, StrRect);
  13060. delete pImg; pImg = NULL;
  13061. }
  13062. }
  13063. if (bSmall)
  13064. {
  13065. m_Print.SetFontFace(18, 1, "黑体");
  13066. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13067. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13068. m_Print.SetFontFace(9, 1, "宋体");
  13069. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13070. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13071. m_Print.SetFontFace(6, 1, "宋体");
  13072. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13073. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13074. m_Print.SetFontFace(9, 1, "宋体");
  13075. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13076. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13077. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13078. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13079. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13080. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13081. int hei = StrRect.Height();
  13082. StrRect.bottom = StrRect.top;
  13083. StrRect.top -= 8;
  13084. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  13085. m_Print.SetFontFace(10, 1, "宋体");
  13086. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13087. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13088. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13089. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13090. m_Print.SetFontFace(9, 1, "宋体");
  13091. for (int i = 7; i < 24; i++)
  13092. {
  13093. StrRect = load.m_rcarray.ElementAt(i);
  13094. m_Print.DrawRect2(StrRect, 1);
  13095. }
  13096. for (i = 9; i < 24; i++)
  13097. {
  13098. StrRect = load.m_rcarray.ElementAt(i);
  13099. StrRect.left += 2;
  13100. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13101. }
  13102. m_Print.SetFontFace(6, 1, "宋体");
  13103. for (i = 24; i < 26; i++)
  13104. {
  13105. StrRect = load.m_rcarray.ElementAt(i);
  13106. StrRect.left += 2;
  13107. if (i == 24)
  13108. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13109. else
  13110. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13111. }
  13112. }
  13113. else//大单
  13114. {
  13115. m_Print.SetFontFace(20, 1, "黑体");
  13116. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13117. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13118. m_Print.SetFontFace(11, 1, "宋体");
  13119. // StrRect=load.m_rcarray .ElementAt (++rcpos);
  13120. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13121. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15;
  13122. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13123. int hei = StrRect.Height();
  13124. StrRect.bottom = StrRect.top;
  13125. StrRect.top -= 10;
  13126. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  13127. m_Print.SetFontFace(8, 1, "宋体");
  13128. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13129. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13130. m_Print.SetFontFace(11, 1, "宋体");
  13131. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13132. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13133. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13134. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13135. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13136. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13137. m_Print.SetFontFace(13, 1, "宋体");
  13138. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13139. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13140. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13141. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13142. m_Print.SetFontFace(11, 1, "宋体");
  13143. for (int i = 7; i < 24; i++)
  13144. {
  13145. StrRect = load.m_rcarray.ElementAt(i);
  13146. m_Print.DrawRect2(StrRect, 1);
  13147. }
  13148. for (i = 9; i < 24; i++)
  13149. {
  13150. StrRect = load.m_rcarray.ElementAt(i);
  13151. StrRect.left += 2;
  13152. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13153. }
  13154. m_Print.SetFontFace(8, 1, "宋体");
  13155. for (i = 24; i < 27; i++)
  13156. {
  13157. StrRect = load.m_rcarray.ElementAt(i);
  13158. StrRect.left += 2;
  13159. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13160. }
  13161. }
  13162. PrintPreview dlg;
  13163. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13164. dlg.m_pDC = m_Print.GetPDC();
  13165. if (aa == 0)
  13166. {
  13167. if (dlg.DoModal() != IDOK)
  13168. return;
  13169. printcot = dlg.m_num;
  13170. }
  13171. //结束打印
  13172. m_Print.EndPage();
  13173. m_Print.EndPrint();
  13174. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
  13175. CString sql;
  13176. sql.Format("update version set [serialno2]='%s'", SerialNo);
  13177. g_sendhead.bsql = 1;
  13178. g_nYearposTemp = g_nYearpos;
  13179. g_nYearpos = -1;
  13180. g_pMainWnd->ProcessChatMessageRequest2(sql);
  13181. g_nYearpos = g_nYearposTemp;
  13182. }
  13183. }
  13184. //出生年月
  13185. //第一联
  13186. void CMainFrame::OnLog()
  13187. {
  13188. // TODO: Add your command handler code here OnShowBakState
  13189. if (IsHasRightsnew(49) == 0)return;
  13190. ShowLOg dlg;
  13191. dlg.DoModal();
  13192. }
  13193. // www.lyfz.net 8888
  13194. void CMainFrame::PrintDinDan6(CString m_id)
  13195. {
  13196. // TODO: Add your control notification handler code here 预约订单
  13197. int printcot = 1;
  13198. for (int aa = 0; aa < printcot; aa++)
  13199. {
  13200. PrintPreview dlg;
  13201. CPrintRX m_Print;
  13202. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13203. {
  13204. m_Print.InitToPrint(NULL, 1);
  13205. }
  13206. else
  13207. {
  13208. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  13209. if (name.IsEmpty())
  13210. m_Print.InitToPrint(NULL, 1);
  13211. else
  13212. {
  13213. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13214. if (nret == -1 && aa == 0)
  13215. {
  13216. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13217. }
  13218. }
  13219. }
  13220. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
  13221. {
  13222. m_Print.StartPrint();
  13223. m_Print.StartPage();
  13224. LoadRect load;
  13225. load.SetLiaPath("6.lia");
  13226. load.SetMargins(-14, 15);
  13227. if (!load.Load())return;
  13228. LoadRect load2;
  13229. load2.SetLiaPath("7.lia");
  13230. load2.SetMargins(-14, 216 + 15);
  13231. if (!load2.Load())return;
  13232. LoadRect load3;
  13233. load3.SetLiaPath("8.lia");
  13234. load3.SetMargins(-14, 705 + 15);
  13235. if (!load3.Load())return;
  13236. int i;
  13237. //////////////////////////////////////////////////////////////
  13238. CStringArray txarray;
  13239. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  13240. g_sendhead.code[0] = 11;
  13241. g_sendhead.code[1] = 52;
  13242. g_sendhead.code[2] = 50;
  13243. g_sendhead.code[3] = 150;
  13244. g_sendhead.code[4] = 77;
  13245. g_sendhead.code[5] = 4;
  13246. g_sendhead.tabcount = 6;
  13247. g_sendhead.bsql = 0;
  13248. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  13249. CArray<CStringArray, CStringArray>sparray;
  13250. CArray<CStringArray, CStringArray>clientarray;
  13251. CArray<CStringArray, CStringArray>phonearray;
  13252. CArray<CStringArray, CStringArray>fgarray;
  13253. CArray<CStringArray, CStringArray>danweiarray;
  13254. CArray<CStringArray, CStringArray>jdarray;
  13255. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  13256. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  13257. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  13258. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  13259. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  13260. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  13261. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  13262. CString m_taoxiname;
  13263. if (m_zs.Find("\\") != -1)
  13264. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
  13265. else
  13266. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
  13267. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  13268. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  13269. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  13270. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  13271. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  13272. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  13273. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  13274. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  13275. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  13276. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  13277. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  13278. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  13279. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  13280. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  13281. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  13282. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  13283. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  13284. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  13285. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  13286. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  13287. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  13288. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  13289. if (jdarray.GetSize())
  13290. {
  13291. if (m_bz.IsEmpty() == 0)
  13292. m_bz = "\r\n" + m_bz;
  13293. m_bz += "景点:";
  13294. }
  13295. for (i = 0; i < jdarray.GetSize(); i++)
  13296. {
  13297. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  13298. }
  13299. m_bz.TrimRight(";");
  13300. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  13301. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  13302. if (IsHasRights2new(31) == 0)
  13303. {
  13304. m_phone1 = "***";
  13305. m_phone2 = "***";
  13306. }
  13307. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  13308. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  13309. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  13310. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  13311. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  13312. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  13313. filter = "name='" + m_ren + "'";
  13314. g_sendhead.code[0] = 5;
  13315. g_sendhead.tabcount = 1;
  13316. g_sendhead.bsql = 0;
  13317. int g_nYearposTemp = g_nYearpos;
  13318. g_nYearpos = -1;
  13319. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13320. g_nYearpos = g_nYearposTemp;
  13321. if (g_bSendOK == 0)return;
  13322. DataToArray(&phonearray);
  13323. m_money1.Format("%f", atof(m_taoxijiage));
  13324. m_money2.Format("%f", atof(m_payed1));
  13325. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  13326. ConvertToPrice(m_money1);
  13327. ConvertToPrice(m_money2);
  13328. ConvertToPrice(m_money3);
  13329. ////////////////////////////////////////////////////////////////
  13330. int rcpos = -1;
  13331. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13332. StrRect.top -= 15; StrRect.bottom -= 15;
  13333. Image *pImg = NULL;
  13334. #ifdef MNLS_VERSION
  13335. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  13336. #else
  13337. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  13338. #endif
  13339. m_Print.DrawImage(pImg, StrRect);
  13340. delete pImg;
  13341. m_Print.SetFontFace(11, 1, "宋体");
  13342. StrRect = load.m_rcarray.ElementAt(20);
  13343. StrRect.right = load.m_rcarray.ElementAt(23).right;
  13344. StrRect.top -= 18; StrRect.bottom -= 18;
  13345. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  13346. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13347. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  13348. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13349. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13350. StrRect.top -= 15; StrRect.bottom -= 15;
  13351. #ifdef MNLS_VERSION
  13352. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13353. #endif
  13354. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13355. StrRect.top -= 15; StrRect.bottom -= 15;
  13356. #ifdef MNLS_VERSION
  13357. m_Print.DrawRect(StrRect);
  13358. #endif
  13359. m_Print.SetFontFace(7, 1, "黑体");
  13360. m_Print.SetColor(0xffffff);
  13361. #ifdef MNLS_VERSION
  13362. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13363. #endif
  13364. m_Print.SetColor(0);
  13365. m_Print.SetFontFace(15, 1, "宋体");
  13366. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13367. StrRect.top -= 15; StrRect.bottom -= 15;
  13368. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同拍摄单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13369. CStringArray strarray;
  13370. strarray.Add("NO: " + m_id);
  13371. CString date;
  13372. date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  13373. strarray.Add(date);
  13374. strarray.Add("喜爱");
  13375. strarray.Add("格调");
  13376. if (fgarray.GetSize() == 12)
  13377. {
  13378. for (int i = 0; i < 12; i++)
  13379. strarray.Add(fgarray.ElementAt(i).ElementAt(0));
  13380. }
  13381. else
  13382. {
  13383. strarray.Add("复古典雅");
  13384. strarray.Add("温文尔雅");
  13385. strarray.Add("豪华艳丽");
  13386. strarray.Add("传统大方");
  13387. strarray.Add("新潮个性");
  13388. strarray.Add("浪漫奔放");
  13389. strarray.Add("简单素雅");
  13390. strarray.Add("活泼俏丽");
  13391. strarray.Add("妩媚温馨");
  13392. strarray.Add("温柔贤惠");
  13393. strarray.Add("成熟感性");
  13394. strarray.Add("清纯可爱");
  13395. }
  13396. strarray.Add("姓名");
  13397. // strarray.Add("职业");
  13398. strarray.Add("");
  13399. strarray.Add("地址");
  13400. strarray.Add("电话");
  13401. #ifdef CHILD_VERSION
  13402. strarray.Add("家长");
  13403. strarray.Add("宝宝");
  13404. #else
  13405. strarray.Add("先生");
  13406. strarray.Add("女士");
  13407. #endif
  13408. m_Print.SetFontFace(11, 1, "宋体");
  13409. for (i = 0; i < strarray.GetSize(); i++)
  13410. {
  13411. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13412. if (i < 2)
  13413. {
  13414. StrRect.top -= 15; StrRect.bottom -= 15;
  13415. }
  13416. if (i>15)
  13417. m_Print.DrawRect2(StrRect, 1);
  13418. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13419. }
  13420. for (i = 29; i <= 40; i++)
  13421. {
  13422. if (m_style.GetLength() <= (i - 29))continue;
  13423. if (m_style.GetAt(i - 29) != '1')continue;
  13424. StrRect = load.m_rcarray.ElementAt(i - 1);
  13425. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13426. }
  13427. for (i = 27; i <= 48; i++)
  13428. {
  13429. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13430. m_Print.DrawRect2(StrRect, 1);
  13431. }
  13432. #ifdef CHILD_VERSION
  13433. StrRect = load.m_rcarray.ElementAt(45);
  13434. StrRect.right = StrRect.left + 62;
  13435. m_Print.DrawRect2(StrRect, 1);
  13436. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13437. StrRect.left = StrRect.right;
  13438. StrRect.right = StrRect.left + 62;
  13439. m_Print.DrawRect2(StrRect, 1);
  13440. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13441. StrRect.left = StrRect.right;
  13442. StrRect.right = StrRect.left + 62;
  13443. m_Print.DrawRect2(StrRect, 1);
  13444. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13445. StrRect.left = StrRect.right;
  13446. StrRect.right = StrRect.left + 62;
  13447. m_Print.DrawRect2(StrRect, 1);
  13448. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13449. #endif
  13450. /////////////////////////
  13451. strarray.RemoveAll();
  13452. CString temp;
  13453. temp.Format("拍摄多款选 %d 款,其中影", atoi(m_outside) + atoi(m_outside2));
  13454. strarray.Add(temp);
  13455. temp.Format("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  13456. strarray.Add(temp);
  13457. strarray.Add("化妆");
  13458. strarray.Add("造型");
  13459. #ifdef CHILD_VERSION
  13460. strarray.Add("");
  13461. #else
  13462. strarray.Add("婚纱");
  13463. #endif
  13464. strarray.Add("服饰");
  13465. strarray.Add("配");
  13466. strarray.Add("置");
  13467. strarray.Add("其");
  13468. strarray.Add("它");
  13469. strarray.Add("套系名称");
  13470. strarray.Add("镜款");
  13471. strarray.Add("套系总价");
  13472. strarray.Add("主摄影师");
  13473. strarray.Add("拍摄日期");
  13474. strarray.Add("定金");
  13475. #ifdef CHILD_VERSION
  13476. strarray.Add("主引导师");
  13477. #else
  13478. strarray.Add("主化妆师");
  13479. #endif
  13480. strarray.Add("看样日期");
  13481. strarray.Add("补 余 款");
  13482. strarray.Add("总监");
  13483. strarray.Add("取件日期");
  13484. rcpos = -1;
  13485. for (i = 0; i < strarray.GetSize(); i++)
  13486. {
  13487. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  13488. if (i>9)
  13489. m_Print.DrawRect2(StrRect, 1);
  13490. #ifdef CHILD_VERSION
  13491. if (i == 5)
  13492. StrRect.top -= StrRect.Height();
  13493. #endif
  13494. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13495. }
  13496. for (i = 22; i <= 41; i++)
  13497. {
  13498. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  13499. m_Print.DrawRect2(StrRect, 1);
  13500. }
  13501. /////////////////////////////
  13502. strarray.RemoveAll();
  13503. #ifdef CHILD_VERSION
  13504. strarray.Add("顾客方 家长:");
  13505. strarray.Add("宝宝:");
  13506. #else
  13507. strarray.Add("顾客方 先生:");
  13508. strarray.Add("女士:");
  13509. #endif
  13510. strarray.Add("电话:");
  13511. strarray.Add("影楼方 店长:");
  13512. strarray.Add("接单人:");
  13513. strarray.Add("电话:");
  13514. rcpos = -1;
  13515. for (i = 0; i < strarray.GetSize(); i++)
  13516. {
  13517. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  13518. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13519. }
  13520. for (i = 7; i <= 12; i++)
  13521. {
  13522. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  13523. // if(i!=10)
  13524. m_Print.DrawRect2(StrRect, 2);
  13525. }
  13526. //////////////////////////////////////
  13527. //开始打数据
  13528. strarray.RemoveAll();
  13529. strarray.Add(m_name1);
  13530. strarray.Add(m_name2);
  13531. strarray.Add("");
  13532. strarray.Add("");
  13533. strarray.Add(m_addr1);
  13534. #ifdef CHILD_VERSION
  13535. strarray.Add("");
  13536. #else
  13537. strarray.Add(m_addr2);
  13538. #endif
  13539. strarray.Add(m_phone1);
  13540. strarray.Add(m_phone2);
  13541. for (i = 41; i <= 48; i++)
  13542. {
  13543. StrRect = load.m_rcarray.ElementAt(i - 1);
  13544. StrRect.left += 4;
  13545. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13546. }
  13547. ///////////////////////////////
  13548. strarray.RemoveAll();
  13549. strarray.Add(m_money1);
  13550. strarray.Add(m_waiter1);
  13551. strarray.Add(m_time2);
  13552. strarray.Add(m_money2);
  13553. strarray.Add(m_waiter2);
  13554. strarray.Add(m_time4);
  13555. strarray.Add(m_money3);
  13556. strarray.Add("");
  13557. strarray.Add(m_time5);
  13558. for (i = 32; i <= 40; i++)
  13559. {
  13560. StrRect = load2.m_rcarray.ElementAt(i - 1);
  13561. StrRect.left += 4;
  13562. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13563. }
  13564. ///////////////////////////////
  13565. strarray.RemoveAll();
  13566. strarray.Add("");//m_name1);
  13567. strarray.Add("");//m_name2);
  13568. CString phone;
  13569. if (m_phone1.IsEmpty() == 0)
  13570. phone = m_phone1 + ",";
  13571. phone += m_phone2;
  13572. phone.TrimRight(",");
  13573. strarray.Add("");//phone);
  13574. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
  13575. strarray.Add(m_ren);
  13576. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13577. for (i = 7; i <= 12; i++)
  13578. {
  13579. StrRect = load3.m_rcarray.ElementAt(i - 1);
  13580. StrRect.left += 4;
  13581. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13582. }
  13583. StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
  13584. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13585. StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
  13586. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13587. StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
  13588. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13589. //////////////////////////////
  13590. //开始画文字
  13591. StrRect = load2.m_rcarray.ElementAt(30);
  13592. StrRect.left += 3;
  13593. StrRect.top += 3;
  13594. StrRect.right -= 2;
  13595. StrRect.bottom -= 2;
  13596. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  13597. StrRect = load2.m_rcarray.ElementAt(29);
  13598. StrRect.left += 3;
  13599. StrRect.top += 3;
  13600. StrRect.right -= 2;
  13601. StrRect.bottom -= 2;
  13602. str = "";
  13603. for (i = 0; i < sparray.GetSize(); i++)
  13604. {
  13605. str += sparray.ElementAt(i).ElementAt(5);
  13606. str += " 数量:";
  13607. str += sparray.ElementAt(i).ElementAt(3);
  13608. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  13609. str += "\r\n";
  13610. }
  13611. str.TrimRight("\r\n");
  13612. AutoDraw(m_Print, StrRect, str, 1.4);
  13613. StrRect = load2.m_rcarray.ElementAt(40);
  13614. StrRect.top += 8;
  13615. m_Print.SetFontFace(12, 1, "黑体");
  13616. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  13617. StrRect.left += 3;
  13618. StrRect.top += 30;
  13619. StrRect.right -= 2;
  13620. StrRect.bottom -= 2;
  13621. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  13622. if (str.IsEmpty())
  13623. {
  13624. str = "\
  13625. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  13626. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  13627. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  13628. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  13629. 持良好的心境.\r\n\
  13630. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  13631. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  13632. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  13633. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  13634. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  13635. 勿进影室, 以免影响拍摄.\r\n\
  13636. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  13637. 师或店长沟通.\r\n\
  13638. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  13639. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  13640. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  13641. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  13642. 9. 本合同余额欠款须在拍照前付清.\r\n\
  13643. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  13644. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  13645. 还.";
  13646. }
  13647. AutoDraw(m_Print, StrRect, str, 1.8);
  13648. }
  13649. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13650. dlg.m_pDC = m_Print.GetPDC();
  13651. dlg.m_mode = 1;
  13652. if (aa == 0)
  13653. {
  13654. if (dlg.DoModal() != IDOK)
  13655. return;
  13656. printcot = dlg.m_num;
  13657. }
  13658. //结束打印
  13659. m_Print.EndPage();
  13660. m_Print.EndPrint();
  13661. }
  13662. }
  13663. void CMainFrame::InsideMsg()
  13664. {
  13665. ///内部消息
  13666. CString str;
  13667. g_sendhead.bsql = 0;
  13668. g_sendhead.code[0] = 126;
  13669. g_sendhead.tabcount = 1;
  13670. g_bNoConnDlg = 1;
  13671. g_pMainWnd->ProcessChatMessageRequest2(1); g_bNoConnDlg = 0;
  13672. if (g_bSendOK == 0)return;
  13673. CArray<CStringArray, CStringArray>m_List1array;
  13674. DataToArray(&g_List1array);//, &m_List1array);
  13675. m_List1array.SetSize(g_List1array.GetSize());
  13676. for (int i = 0; i < g_List1array.GetSize(); i++)
  13677. {
  13678. m_List1array.ElementAt(i).Copy(g_List1array.ElementAt(i));
  13679. }
  13680. str = "," + g_user.name + ",";
  13681. for (i = g_List1array.GetSize() - 1; i >= 0; i--)
  13682. {
  13683. CString receivers2 = g_List1array.ElementAt(i).ElementAt(4);
  13684. receivers2.TrimLeft(",");
  13685. receivers2.TrimRight(",");
  13686. receivers2 = "," + receivers2 + ",";
  13687. CString receivers = g_List1array.ElementAt(i).ElementAt(3);
  13688. receivers.TrimLeft(",");
  13689. receivers.TrimRight(",");
  13690. receivers = "," + receivers + ",";
  13691. if (receivers.Find(str) == -1)
  13692. g_List1array.RemoveAt(i);
  13693. else if (receivers2.Find(str) != -1)
  13694. g_List1array.RemoveAt(i);
  13695. }
  13696. if (g_List1array.GetSize())
  13697. {
  13698. ShowMsg dlg;
  13699. dlg.DoModal();
  13700. }
  13701. for (i = m_List1array.GetSize() - 1; i >= 0; i--)
  13702. {
  13703. CString receivers2 = m_List1array.ElementAt(i).ElementAt(4);
  13704. receivers2.TrimLeft(",");
  13705. receivers2.TrimRight(",");
  13706. receivers2 = "," + receivers2 + ",";
  13707. CString receivers = m_List1array.ElementAt(i).ElementAt(3);
  13708. if (receivers != "")
  13709. m_List1array.RemoveAt(i);
  13710. else if (receivers2.Find(str) != -1)
  13711. m_List1array.RemoveAt(i);
  13712. }
  13713. if (m_List1array.GetSize())
  13714. {
  13715. SendInsideMsg2 dlg;
  13716. dlg.m_bShow = 1;
  13717. dlg.m_pArray = &m_List1array;
  13718. dlg.DoModal();
  13719. }
  13720. }
  13721. //定金
  13722. /************************************************************************/
  13723. /*
  13724. 函数:PrintHireDress
  13725. 描述:打印礼服出租单;
  13726. 参数:
  13727. strOrderNumber 礼服订单号;
  13728. 注意:
  13729. */
  13730. /************************************************************************/
  13731. void CMainFrame::PrintHireDress(CString strOrderNumber) // 打印礼服出租单;
  13732. {
  13733. int printcot = 1;
  13734. for (int aa = 0; aa < printcot; aa++)
  13735. {
  13736. CPrintRX m_Print;
  13737. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13738. {
  13739. m_Print.InitToPrint(NULL, 1);
  13740. }
  13741. else
  13742. {
  13743. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13744. if (name.IsEmpty())
  13745. m_Print.InitToPrint(NULL, 1);
  13746. else
  13747. {
  13748. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13749. if (nret == -1 && aa == 0)
  13750. {
  13751. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13752. }
  13753. }
  13754. }
  13755. m_Print.StartPrint();
  13756. m_Print.StartPage();
  13757. LoadRect load;
  13758. load.SetLiaPath("21.lia");
  13759. load.SetMargins(0, 0);
  13760. if (!load.Load())
  13761. {
  13762. return;
  13763. }
  13764. int i;
  13765. //////////////////////////////////////////////////////////////
  13766. //CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  13767. CString strFilter;
  13768. strFilter.Format("id='%s';id='%s';id='%s'", strOrderNumber, strOrderNumber, strOrderNumber);
  13769. g_sendhead.bsql = 0;
  13770. g_sendhead.code[0] = 73;
  13771. g_sendhead.code[1] = 74;
  13772. g_sendhead.code[2] = 52;
  13773. g_sendhead.tabcount = 3;
  13774. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  13775. if (g_bSendOK == 0)
  13776. {
  13777. return;
  13778. }
  13779. CArray<CStringArray, CStringArray>dresshirearray;
  13780. CArray<CStringArray, CStringArray>dresshiredataarray;
  13781. CArray<CStringArray, CStringArray>clientarray;
  13782. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13783. if (dresshirearray.GetSize() == 0)
  13784. {
  13785. return;
  13786. }
  13787. CString m_remark = dresshirearray.ElementAt(0).ElementAt(10);
  13788. CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7);
  13789. CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8);
  13790. CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6);
  13791. if (clientarray.GetSize() == 0)
  13792. {
  13793. return;
  13794. }
  13795. //AfxMessageBox("打印礼服出租单-()");
  13796. CString m_name2 = clientarray.ElementAt(0).ElementAt(2);
  13797. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  13798. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  13799. CString m_time3 = clientarray.ElementAt(0).ElementAt(20);
  13800. //#if JEFF_TEST
  13801. // if ( dresshiredataarray.GetSize() == 0 )
  13802. // {
  13803. // AfxMessageBox("没衣服");
  13804. // }
  13805. //#endif
  13806. CString sItem;
  13807. for (i = 0; i < dresshiredataarray.GetSize(); i++)
  13808. {
  13809. sItem += "编号:";
  13810. sItem += dresshiredataarray.ElementAt(i).ElementAt(1);
  13811. sItem += " ";
  13812. sItem += " 名称:";
  13813. sItem += dresshiredataarray.ElementAt(i).ElementAt(2);
  13814. sItem += " 数量:";
  13815. sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n";
  13816. }
  13817. sItem += "金额:";
  13818. sItem += dresshirearray.ElementAt(0).ElementAt(1);
  13819. sItem += " ";
  13820. sItem += " 押金:";
  13821. sItem += dresshirearray.ElementAt(0).ElementAt(2) + "\r\n";
  13822. ////////////////////////////////////////////////////////////////
  13823. int rcpos = -1;
  13824. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13825. m_Print.SetFontFace(17, 1, "宋体");
  13826. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13827. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13828. m_Print.SetFontFace(10, 1, "宋体");
  13829. m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13830. CStringArray strarray;
  13831. strarray.Add("客户姓名");
  13832. strarray.Add("客户电话");
  13833. strarray.Add("预定日期");
  13834. strarray.Add("结婚日期");
  13835. strarray.Add("取件日期");
  13836. strarray.Add("归还日期");
  13837. strarray.Add("本店地址");
  13838. strarray.Add("电 话");
  13839. strarray.Add("客户地址");
  13840. strarray.Add("客户签名");
  13841. for (i = 2; i < 12; i++)
  13842. {
  13843. StrRect = load.m_rcarray.ElementAt(i);
  13844. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13845. }
  13846. strarray.RemoveAll();
  13847. strarray.Add(m_name2);
  13848. strarray.Add(m_phone2);
  13849. strarray.Add(m_inputdate);
  13850. strarray.Add(m_time3);
  13851. strarray.Add(m_date1);
  13852. strarray.Add(m_date2);
  13853. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
  13854. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13855. strarray.Add(m_addr2);
  13856. strarray.Add("");
  13857. for (i = 12; i < 22; i++)
  13858. {
  13859. StrRect = load.m_rcarray.ElementAt(i);
  13860. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13861. m_Print.DrawRect2(StrRect, 2);
  13862. }
  13863. for (i = 25; i < 30; i++)
  13864. {
  13865. StrRect = load.m_rcarray.ElementAt(i);
  13866. m_Print.DrawRect2(StrRect, 1);
  13867. }
  13868. StrRect = load.m_rcarray.ElementAt(22);
  13869. StrRect.top += 7;
  13870. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13871. StrRect = load.m_rcarray.ElementAt(23);
  13872. StrRect.top += 7;
  13873. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13874. StrRect = load.m_rcarray.ElementAt(24);
  13875. StrRect.top += 7;
  13876. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13877. StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
  13878. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13879. StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
  13880. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13881. StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
  13882. CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
  13883. if (str.IsEmpty())
  13884. {
  13885. str = "\
  13886. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13887. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13888. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13889. 4. 如有破损酌情赔偿.";
  13890. }
  13891. AutoDraw(m_Print, StrRect, str, 1.5);
  13892. PrintPreview dlg;
  13893. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13894. dlg.m_pDC = m_Print.GetPDC();
  13895. if (aa == 0)
  13896. {
  13897. if (dlg.DoModal() != IDOK)
  13898. return;
  13899. printcot = dlg.m_num;
  13900. }
  13901. //结束打印
  13902. m_Print.EndPage();
  13903. m_Print.EndPrint();
  13904. }
  13905. }
  13906. void CMainFrame::PrintHireDress_01(CString strOrderNumber) // 打印礼服出租单,无法改变结构,需要修改21.lia才能改变打印的布局;
  13907. {
  13908. int printcot = 1;
  13909. for (int aa = 0; aa < printcot; aa++)
  13910. {
  13911. CPrintRX m_Print;
  13912. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13913. {
  13914. m_Print.InitToPrint(NULL, 1);
  13915. }
  13916. else
  13917. {
  13918. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13919. if (name.IsEmpty())
  13920. m_Print.InitToPrint(NULL, 1);
  13921. else
  13922. {
  13923. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13924. if (nret == -1 && aa == 0)
  13925. {
  13926. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  13927. m_Print.InitToPrint(NULL, 1);
  13928. }
  13929. }
  13930. }
  13931. m_Print.StartPrint();
  13932. m_Print.StartPage();
  13933. LoadRect load;
  13934. load.SetLiaPath("21.lia");
  13935. load.SetMargins(0, 0);
  13936. if (!load.Load())return;
  13937. int i;
  13938. //////////////////////////////////////////////////////////////
  13939. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  13940. g_sendhead.bsql = 0;
  13941. g_sendhead.code[0] = 73; // dresshire表;
  13942. g_sendhead.code[1] = 74; // dresshiredata表;
  13943. g_sendhead.code[2] = 52; // client表;
  13944. g_sendhead.tabcount = 3;
  13945. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13946. if (g_bSendOK == 0)
  13947. {
  13948. return;
  13949. }
  13950. CArray<CStringArray, CStringArray>dresshirearray;
  13951. CArray<CStringArray, CStringArray>dresshiredataarray;
  13952. CArray<CStringArray, CStringArray>clientarray;
  13953. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13954. if (dresshirearray.GetSize() == 0)return;
  13955. // dresshire;
  13956. CString m_remark = dresshirearray.ElementAt(0).ElementAt(10); // 备注;
  13957. CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7); // 取衣日期;
  13958. CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8); // 还衣日期;
  13959. CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6); // 记录日期;
  13960. CString strPrice = dresshirearray.ElementAt(0).ElementAt(1); // 金额;
  13961. CString strDeposit = dresshirearray.ElementAt(0).ElementAt(2); // 押金;
  13962. // client表;
  13963. if (clientarray.GetSize() == 0)return;
  13964. CString m_name2 = clientarray.ElementAt(0).ElementAt(2); // 女宾姓名;
  13965. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4); // 女宾手机;
  13966. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8); // 女宾地址;
  13967. CString m_time3 = clientarray.ElementAt(0).ElementAt(20); // 婚期;
  13968. // dresshiredata表;
  13969. CString sItem;
  13970. for (i = 0; i < dresshiredataarray.GetSize(); i++)
  13971. {
  13972. sItem += dresshiredataarray.ElementAt(i).ElementAt(1); // 礼服编号;
  13973. sItem += " ";
  13974. sItem += dresshiredataarray.ElementAt(i).ElementAt(2); // 礼服名称;
  13975. sItem += " 数量:";
  13976. sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n"; // 礼服数量;
  13977. }
  13978. sItem += " 金额:";
  13979. sItem += dresshirearray.ElementAt(0).ElementAt(1); // 出租金额;
  13980. sItem += " 押金:";
  13981. sItem += dresshirearray.ElementAt(0).ElementAt(2) + "\r\n"; // 押金;
  13982. ////////////////////////////////////////////////////////////////
  13983. int rcpos = -1;
  13984. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13985. m_Print.SetFontFace(17, 1, "宋体");
  13986. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13987. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13988. m_Print.SetFontFace(10, 1, "宋体");
  13989. m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13990. CStringArray strarray;
  13991. strarray.Add("客户姓名"); // 1.
  13992. strarray.Add("客户电话");
  13993. strarray.Add("预定日期");
  13994. strarray.Add("结婚日期");
  13995. strarray.Add("取件日期"); // 5.
  13996. strarray.Add("归还日期");
  13997. strarray.Add("本店地址");
  13998. strarray.Add("电 话");
  13999. strarray.Add("客户地址");
  14000. strarray.Add("客户签名"); // 10.
  14001. //strarray.Add("金额");
  14002. //strarray.Add("押金");
  14003. for( i=2; i<12; i++)
  14004. //for (i = 2; i < 14; i++)
  14005. {
  14006. StrRect = load.m_rcarray.ElementAt(i);
  14007. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14008. }
  14009. strarray.RemoveAll();
  14010. strarray.Add(m_name2);
  14011. strarray.Add(m_phone2);
  14012. strarray.Add(m_inputdate);
  14013. strarray.Add(m_time3);
  14014. strarray.Add(m_date1);
  14015. strarray.Add(m_date2);
  14016. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
  14017. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  14018. strarray.Add(m_addr2);
  14019. strarray.Add("");
  14020. strarray.Add(strPrice); // 金额;
  14021. strarray.Add(strDeposit); // 押金;
  14022. for( i=12; i<22; i++)
  14023. //for (i = 14; i < 24; i++)
  14024. {
  14025. StrRect = load.m_rcarray.ElementAt(i);
  14026. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14027. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 14), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14028. m_Print.DrawRect2(StrRect, 2);
  14029. }
  14030. for (i = 25; i < 30; i++)
  14031. {
  14032. StrRect = load.m_rcarray.ElementAt(i);
  14033. m_Print.DrawRect2(StrRect, 1);
  14034. }
  14035. StrRect = load.m_rcarray.ElementAt(22);
  14036. StrRect.top += 7;
  14037. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14038. StrRect = load.m_rcarray.ElementAt(23);
  14039. StrRect.top += 7;
  14040. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14041. StrRect = load.m_rcarray.ElementAt(24);
  14042. StrRect.top += 7;
  14043. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14044. StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
  14045. AutoDraw(m_Print, StrRect, sItem, 1.5);
  14046. StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
  14047. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  14048. StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
  14049. CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
  14050. if (str.IsEmpty())
  14051. {
  14052. str = "\
  14053. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  14054. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  14055. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  14056. 4. 如有破损酌情赔偿.";
  14057. }
  14058. AutoDraw(m_Print, StrRect, str, 1.5);
  14059. PrintPreview dlg;
  14060. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14061. dlg.m_pDC = m_Print.GetPDC();
  14062. if (aa == 0)
  14063. {
  14064. if (dlg.DoModal() != IDOK)
  14065. return;
  14066. printcot = dlg.m_num;
  14067. }
  14068. //结束打印
  14069. m_Print.EndPage();
  14070. m_Print.EndPrint();
  14071. }
  14072. }
  14073. // ****************************************************************************
  14074. // Jeff:
  14075. // 函数:PrintHireDress2
  14076. // 无参;
  14077. // 调用者:DinDanFrom.cpp
  14078. // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
  14079. // 当订单数大于1000,设置连接公司服务器开关量为真;
  14080. // -----------------------------------------------------------------------------
  14081. // 修改:Jeff
  14082. // 时间:2014.10.18
  14083. // 内容:将 g_ncot 比较值改为100;
  14084. // ****************************************************************************
  14085. void CMainFrame::PrintHireDress2()
  14086. {
  14087. if (g_ncot > 100) g_bSendLYFZ = 1;
  14088. // g_pMainWnd->SetTimer (7, 3000, NULL);
  14089. }
  14090. void CMainFrame::PrintTakeForm2(CArray<CStringArray, CStringArray>*Listarray)
  14091. {
  14092. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "选片客人明细表";
  14093. int pages = Listarray->GetSize() / 46;
  14094. if (Listarray->GetSize() % 46)pages++;
  14095. for (int aa = 0; aa < pages; aa++)
  14096. {
  14097. PrintPreview dlg;
  14098. CPrintRX m_Print;
  14099. m_Print.InitToPrint(NULL, 1);
  14100. m_Print.StartPrint();
  14101. m_Print.StartPage();
  14102. CRect mainrc(0, 0, 560, 793);
  14103. float fscale;
  14104. {
  14105. int w, h;
  14106. m_Print.GetWidHei(w, h);
  14107. fscale = (float)w / (float)h;
  14108. }
  14109. mainrc.DeflateRect(25, 40, 10, 0);
  14110. CRect rc, rc2;
  14111. rc = mainrc;
  14112. rc.bottom = rc.top;
  14113. rc.top -= 20;
  14114. m_Print.SetFontFace(16, 1, "黑体");
  14115. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14116. m_Print.SetFontFace(9, 1, "宋体");
  14117. CString str;
  14118. int wid[5] = { 200, 110, 70, 85, 62 };
  14119. int hei = 16;
  14120. if (fscale > 0.71)hei = 15;
  14121. rc = mainrc;
  14122. rc.bottom = rc.top + hei;
  14123. for (int i = 0; i < 47; i++)
  14124. {
  14125. rc2.top = rc.top + i*hei;
  14126. rc2.bottom = rc.bottom + i*hei;
  14127. rc2.left = rc.left;
  14128. rc2.right = rc.left + wid[0];
  14129. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14130. for (int j = 0; j<5; j++)
  14131. {
  14132. m_Print.DrawRect2(rc2, 1);
  14133. if (Listarray->GetSize()>aa * 46 + i)
  14134. {
  14135. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14136. rc2.left += 3;
  14137. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14138. rc2.left -= 3;
  14139. }
  14140. rc2.left += wid[j];
  14141. rc2.right = rc2.left + wid[j + 1];
  14142. }
  14143. }
  14144. rc2.top += 2;
  14145. rc2.left += 2; rc2.right = mainrc.right + 4;
  14146. m_Print.SetFontFace(8, 1, "宋体");
  14147. str.Format(" 页:%d/%d", aa + 1, pages);
  14148. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14149. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14150. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14151. dlg.m_pDC = m_Print.GetPDC();
  14152. // dlg.m_mode=1;
  14153. if (aa == 0)
  14154. {
  14155. if (dlg.DoModal() != IDOK)
  14156. return;
  14157. }
  14158. //结束打印
  14159. m_Print.EndPage();
  14160. m_Print.EndPrint();
  14161. }
  14162. }
  14163. void CMainFrame::PrintTakeForm3(CArray<CStringArray, CStringArray>*Listarray)
  14164. {
  14165. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "看设计客人明细表";
  14166. int pages = Listarray->GetSize() / 46;
  14167. if (Listarray->GetSize() % 46)pages++;
  14168. for (int aa = 0; aa < pages; aa++)
  14169. {
  14170. PrintPreview dlg;
  14171. CPrintRX m_Print;
  14172. m_Print.InitToPrint(NULL, 1);
  14173. m_Print.StartPrint();
  14174. m_Print.StartPage();
  14175. CRect mainrc(0, 0, 560, 793);
  14176. float fscale;
  14177. {
  14178. int w, h;
  14179. m_Print.GetWidHei(w, h);
  14180. fscale = (float)w / (float)h;
  14181. }
  14182. mainrc.DeflateRect(25, 40, 10, 0);
  14183. CRect rc, rc2;
  14184. rc = mainrc;
  14185. rc.bottom = rc.top;
  14186. rc.top -= 20;
  14187. m_Print.SetFontFace(16, 1, "黑体");
  14188. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14189. m_Print.SetFontFace(9, 1, "宋体");
  14190. CString str;
  14191. int wid[5] = { 200, 110, 70, 85, 62 };
  14192. int hei = 16;
  14193. if (fscale > 0.71)hei = 15;
  14194. rc = mainrc;
  14195. rc.bottom = rc.top + hei;
  14196. for (int i = 0; i < 47; i++)
  14197. {
  14198. rc2.top = rc.top + i*hei;
  14199. rc2.bottom = rc.bottom + i*hei;
  14200. rc2.left = rc.left;
  14201. rc2.right = rc.left + wid[0];
  14202. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14203. for (int j = 0; j<5; j++)
  14204. {
  14205. m_Print.DrawRect2(rc2, 1);
  14206. if (Listarray->GetSize()>aa * 46 + i)
  14207. {
  14208. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14209. rc2.left += 3;
  14210. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14211. rc2.left -= 3;
  14212. }
  14213. rc2.left += wid[j];
  14214. rc2.right = rc2.left + wid[j + 1];
  14215. }
  14216. }
  14217. rc2.top += 2;
  14218. rc2.left += 2; rc2.right = mainrc.right + 4;
  14219. m_Print.SetFontFace(8, 1, "宋体");
  14220. str.Format(" 页:%d/%d", aa + 1, pages);
  14221. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14222. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14223. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14224. dlg.m_pDC = m_Print.GetPDC();
  14225. // dlg.m_mode=1;
  14226. if (aa == 0)
  14227. {
  14228. if (dlg.DoModal() != IDOK)
  14229. return;
  14230. }
  14231. //结束打印
  14232. m_Print.EndPage();
  14233. m_Print.EndPrint();
  14234. }
  14235. }
  14236. void CMainFrame::PrintTakeForm4(CArray<CStringArray, CStringArray>*Listarray)
  14237. {
  14238. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "取件客人明细表";
  14239. int pages = Listarray->GetSize() / 46;
  14240. if (Listarray->GetSize() % 46)pages++;
  14241. for (int aa = 0; aa < pages; aa++)
  14242. {
  14243. PrintPreview dlg;
  14244. CPrintRX m_Print;
  14245. m_Print.InitToPrint(NULL, 1);
  14246. m_Print.StartPrint();
  14247. m_Print.StartPage();
  14248. CRect mainrc(0, 0, 560, 793);
  14249. float fscale;
  14250. {
  14251. int w, h;
  14252. m_Print.GetWidHei(w, h);
  14253. fscale = (float)w / (float)h;
  14254. }
  14255. mainrc.DeflateRect(25, 40, 10, 0);
  14256. CRect rc, rc2;
  14257. rc = mainrc;
  14258. rc.bottom = rc.top;
  14259. rc.top -= 20;
  14260. m_Print.SetFontFace(16, 1, "黑体");
  14261. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14262. m_Print.SetFontFace(9, 1, "宋体");
  14263. CString str;
  14264. int wid[5] = { 200, 110, 70, 85, 62 };
  14265. int hei = 16;
  14266. if (fscale > 0.71)hei = 15;
  14267. rc = mainrc;
  14268. rc.bottom = rc.top + hei;
  14269. for (int i = 0; i < 47; i++)
  14270. {
  14271. rc2.top = rc.top + i*hei;
  14272. rc2.bottom = rc.bottom + i*hei;
  14273. rc2.left = rc.left;
  14274. rc2.right = rc.left + wid[0];
  14275. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14276. for (int j = 0; j<5; j++)
  14277. {
  14278. m_Print.DrawRect2(rc2, 1);
  14279. if (Listarray->GetSize()>aa * 46 + i)
  14280. {
  14281. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14282. rc2.left += 3;
  14283. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14284. rc2.left -= 3;
  14285. }
  14286. rc2.left += wid[j];
  14287. rc2.right = rc2.left + wid[j + 1];
  14288. }
  14289. }
  14290. rc2.top += 2;
  14291. rc2.left += 2; rc2.right = mainrc.right + 4;
  14292. m_Print.SetFontFace(8, 1, "宋体");
  14293. str.Format(" 页:%d/%d", aa + 1, pages);
  14294. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14295. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14296. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14297. dlg.m_pDC = m_Print.GetPDC();
  14298. // dlg.m_mode=1;
  14299. if (aa == 0)
  14300. {
  14301. if (dlg.DoModal() != IDOK)
  14302. return;
  14303. }
  14304. //结束打印
  14305. m_Print.EndPage();
  14306. m_Print.EndPrint();
  14307. }
  14308. }
  14309. void CMainFrame::PrintTakeForm5(CArray<CStringArray, CStringArray>*Listarray)
  14310. {
  14311. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "婚庆客人明细表";
  14312. int pages = Listarray->GetSize() / 46;
  14313. if (Listarray->GetSize() % 46)pages++;
  14314. for (int aa = 0; aa < pages; aa++)
  14315. {
  14316. PrintPreview dlg;
  14317. CPrintRX m_Print;
  14318. m_Print.InitToPrint(NULL, 1);
  14319. m_Print.StartPrint();
  14320. m_Print.StartPage();
  14321. CRect mainrc(0, 0, 560, 793);
  14322. float fscale;
  14323. {
  14324. int w, h;
  14325. m_Print.GetWidHei(w, h);
  14326. fscale = (float)w / (float)h;
  14327. }
  14328. mainrc.DeflateRect(25, 40, 10, 0);
  14329. CRect rc, rc2;
  14330. rc = mainrc;
  14331. rc.bottom = rc.top;
  14332. rc.top -= 20;
  14333. m_Print.SetFontFace(16, 1, "黑体");
  14334. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14335. m_Print.SetFontFace(8, 1, "宋体");
  14336. CString str;
  14337. int wid[7] = { 165, 90, 90, 45, 45, 60, 35 };
  14338. int hei = 16;
  14339. if (fscale > 0.71)hei = 15;
  14340. rc = mainrc;
  14341. rc.bottom = rc.top + hei;
  14342. for (int i = 0; i < 47; i++)
  14343. {
  14344. rc2.top = rc.top + i*hei;
  14345. rc2.bottom = rc.bottom + i*hei;
  14346. rc2.left = rc.left;
  14347. rc2.right = rc.left + wid[0];
  14348. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14349. for (int j = 0; j<7; j++)
  14350. {
  14351. m_Print.DrawRect2(rc2, 1);
  14352. if (Listarray->GetSize()>aa * 46 + i)
  14353. {
  14354. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14355. rc2.left += 3;
  14356. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14357. rc2.left -= 3;
  14358. }
  14359. rc2.left += wid[j];
  14360. rc2.right = rc2.left + wid[j + 1];
  14361. }
  14362. }
  14363. rc2.top += 2;
  14364. rc2.left += 2; rc2.right = mainrc.right + 4;
  14365. m_Print.SetFontFace(8, 1, "宋体");
  14366. str.Format(" 页:%d/%d", aa + 1, pages);
  14367. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14368. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14369. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14370. dlg.m_pDC = m_Print.GetPDC();
  14371. // dlg.m_mode=1;
  14372. if (aa == 0)
  14373. {
  14374. if (dlg.DoModal() != IDOK)
  14375. return;
  14376. }
  14377. //结束打印
  14378. m_Print.EndPage();
  14379. m_Print.EndPrint();
  14380. }
  14381. }
  14382. void CMainFrame::PrintTakeForm1(CArray<CStringArray, CStringArray>*Listarray)
  14383. {
  14384. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "拍照客人明细表";
  14385. int pages = Listarray->GetSize() / 46;
  14386. if (Listarray->GetSize() % 46)pages++;
  14387. for (int aa = 0; aa < pages; aa++)
  14388. {
  14389. PrintPreview dlg;
  14390. CPrintRX m_Print;
  14391. m_Print.InitToPrint(NULL, 1);
  14392. m_Print.StartPrint();
  14393. m_Print.StartPage();
  14394. CRect mainrc(0, 0, 560, 793);
  14395. float fscale;
  14396. {
  14397. int w, h;
  14398. m_Print.GetWidHei(w, h);
  14399. fscale = (float)w / (float)h;
  14400. }
  14401. mainrc.DeflateRect(25, 40, 10, 0);
  14402. CRect rc, rc2;
  14403. rc = mainrc;
  14404. rc.bottom = rc.top;
  14405. rc.top -= 20;
  14406. m_Print.SetFontFace(16, 1, "黑体");
  14407. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14408. m_Print.SetFontFace(8, 1, "宋体");
  14409. CString str;
  14410. int wid[7] = { 165, 60, 90, 60, 60, 60, 35 };
  14411. int hei = 16;
  14412. if (fscale > 0.71)hei = 15;
  14413. rc = mainrc;
  14414. rc.bottom = rc.top + hei;
  14415. for (int i = 0; i < 47; i++)
  14416. {
  14417. rc2.top = rc.top + i*hei;
  14418. rc2.bottom = rc.bottom + i*hei;
  14419. rc2.left = rc.left;
  14420. rc2.right = rc.left + wid[0];
  14421. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14422. for (int j = 0; j<7; j++)
  14423. {
  14424. m_Print.DrawRect2(rc2, 1);
  14425. if (Listarray->GetSize()>aa * 46 + i)
  14426. {
  14427. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14428. rc2.left += 3;
  14429. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14430. rc2.left -= 3;
  14431. }
  14432. rc2.left += wid[j];
  14433. rc2.right = rc2.left + wid[j + 1];
  14434. }
  14435. }
  14436. rc2.top += 2;
  14437. rc2.left += 2; rc2.right = mainrc.right + 4;
  14438. m_Print.SetFontFace(8, 1, "宋体");
  14439. str.Format(" 页:%d/%d", aa + 1, pages);
  14440. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14441. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14442. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14443. dlg.m_pDC = m_Print.GetPDC();
  14444. // dlg.m_mode=1;
  14445. if (aa == 0)
  14446. {
  14447. if (dlg.DoModal() != IDOK)
  14448. return;
  14449. }
  14450. //结束打印
  14451. m_Print.EndPage();
  14452. m_Print.EndPrint();
  14453. }
  14454. }
  14455. void CMainFrame::ShowMonthForm2()
  14456. {
  14457. }
  14458. // dlg;