MainFrm.cpp 455 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541
  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 "DailyForm.h"
  29. #include "MonthForm.h"
  30. #include "ProcessAlarm.h"
  31. #include "MonthForm2.h"
  32. #include "YearForm.h"
  33. #include "ClientForm.h"
  34. #include "ClientForm2.h"
  35. #include "ClientForm3.h"
  36. #include "DinDanFrom.h"
  37. #include "Satisfaction.h"
  38. //#include "SatisfactionForm.h"
  39. #include "SatisfactionReportForm.h"
  40. #include "TodayForm.h"
  41. #include "TodayForm2.h"
  42. #include "SendInsideMsg2.h"
  43. #include "StoreInfoChart.h"
  44. #include "FixedAssets.h"
  45. #include "SPForm.h"
  46. #include "ShowMsg.h"
  47. #include "Account.h"
  48. #include "Login.h"
  49. #include "Login3.h"
  50. #include "Psw.h"
  51. #include "AreaDlg.h"
  52. #include "TakeFrom.h"
  53. #include "ChoosePhotoForm.h"
  54. #include "BeautifySkinFrom.h"
  55. #include "DesignFrom.h"
  56. #include "outsourcing.h"
  57. #include "ChoosePhotoSkin.h"
  58. #include "SalarySet.h"
  59. #include "SalarySet2.h"
  60. #include "MySalary.h"
  61. #include "PrintRX.h"
  62. #include "LoadRect.h"
  63. #include "PrintPreview.h"
  64. #include "SearchClient.h"
  65. #include "BeautifySkinFrom2.h"
  66. #include "FinanceForm.h"
  67. #include "PhotoPrintFrom.h"
  68. //#include "SqlDlg.h"
  69. #include "YearForm2.h"
  70. #include "AreaClient.h"
  71. #include "DBConfig.h"
  72. #include "SetPathDlg2.h"
  73. #include "StaffAchievement.h"
  74. #include "BurnCD.h"
  75. #include "StaffAchievementSet.h"
  76. #include "StaffAchievementShowAll.h"
  77. #include "SelContent.h"
  78. #include "ClientMoney.h"
  79. #include "DelPhotoSet.h"
  80. #include "ompanyInfo.h"
  81. #include "ClientForm.h"
  82. #include "PhotoBak.h"
  83. #include "MsgReg.h"
  84. #include "SendMsg.h"
  85. #include "MsgSet.h"
  86. #include "ShowMember.h"
  87. #include "ShowMember2.h"
  88. #include "MemberSet.h"
  89. #include "DressManage.h"
  90. #include "ShowDress.h"
  91. #include "ShowPic.h"
  92. #include "ShowHireReg.h"
  93. #include "InputGoods.h"
  94. #include "ShowGoods.h"
  95. #include "CostCal.h"
  96. #include "Welcome.h"
  97. #include "EmployeeMsg.h"
  98. #include "TXFG.h"
  99. #include "EmployeeForm.h"
  100. #include "EmployeeForm2.h"
  101. #include "Client2Form.h"
  102. #include "Client2FormLYFZ.h"
  103. #include "OldClient.h"
  104. #include "ClientReasonChart.h"
  105. #include "ClientFromChart.h"
  106. #include "WorkMsg.h"
  107. #include "SetLoginTime.h"
  108. #include "SetLoginBan.h"
  109. #include "LoginReg.h"
  110. #include "LoginReg2.h"
  111. #include "PhoneRecord.h"
  112. #include "PhoneRecordOut.h"
  113. #include "MissCall.h"
  114. #include "InsideMsg.h"
  115. #include "Card2Reg.h"
  116. #include "Card2RegChart.h"
  117. #include "ShowMemberBlue.h"
  118. #include "Card2RegBlue.h"
  119. #include "Card2RegChartBlue.h"
  120. #include "DigitalWork.h"
  121. #include "HideWindow.h"
  122. #include "SalarySet3.h"
  123. #include "YearFormBranch.h"
  124. #include "YearFormBranch2.h"
  125. #include "Set.h"
  126. #include "DinDanFromBranch.h"
  127. #include "MemberChart.h"
  128. #include "ShowMemberMsg.h"
  129. #include "ShowBakState.h"
  130. #include "DinDanForm.h"
  131. #include "CalendarConvert.h"
  132. #include "ShowLOg.h"
  133. #include "HospitalClient.h"
  134. #include "HospitalClientAlarm.h"
  135. #include "HospitalInfoSet.h"
  136. #include "AddHospitalClient.h"
  137. #include "HospitalClientMsg.h"
  138. #ifndef VC60
  139. #include "msgId_def.h"
  140. #include "struct_def.h"
  141. #endif //#ifndef VC60
  142. #ifdef _DEBUG
  143. #define new DEBUG_NEW
  144. #undef THIS_FILE
  145. static char THIS_FILE[] = __FILE__;
  146. #endif
  147. #ifndef WINVER
  148. #define WINVER 0x0400
  149. #endif
  150. #ifndef _WIN32_WINNT
  151. #define _WIN32_WINNT 0x0400
  152. #endif
  153. #ifndef _WIN32_WINDOWS
  154. #define _WIN32_WINDOWS 0x0410
  155. #endif
  156. #ifndef _WIN32_IE
  157. #define _WIN32_IE 0x0400
  158. #endif
  159. #include "uxtheme.h "
  160. typedef HTHEME(__stdcall * POPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
  161. typedef HRESULT(__stdcall * PCLOSETHEMEDATA)(HTHEME hTheme);
  162. HHOOK g_hmouse = NULL; //g_sendhead zx.dll
  163. //extern void WriteTextLog(CString str); // Jeff写客户端日志;
  164. // Jeff.remark;
  165. // 函数:MouseProc
  166. // 参数:
  167. // nCode hook code
  168. // wParam message identifier
  169. // lParam mouse coordinates
  170. // 返回:
  171. //
  172. LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
  173. {
  174. if (g_pMainWnd)
  175. {
  176. if(g_cominfoarray.GetSize() > 0)
  177. {
  178. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134)) > 0)
  179. {
  180. g_pMainWnd->KillTimer(5);
  181. g_pMainWnd->SetTimer(5, atoi(g_cominfoarray.ElementAt(0).ElementAt(134)) * 60 * 1000, NULL);
  182. }
  183. }
  184. if (g_bSendLYFZ)
  185. {
  186. g_pMainWnd->KillTimer(7);
  187. g_pMainWnd->SetTimer(7, 5 * 60 * 1000, NULL);
  188. }
  189. }
  190. return CallNextHookEx(g_hmouse, nCode, wParam, lParam);
  191. }
  192. CRect g_rc; // 屏幕坐标值,区域是放置对话框。
  193. CMainFrame *g_pMainWnd = NULL;
  194. extern HWND g_hSendWnd;
  195. extern HWND g_hConnectWnd;
  196. //extern CString newGUID();
  197. #ifdef USE_KERNEL_DLL
  198. /************************************************************************/
  199. /*
  200. 函数:kernelCallback
  201. 描述:kernel.dll的回调函数;
  202. 参数:
  203. lpStrBranchId: 域名;
  204. lpStrOrder: 订单号;
  205. dwImgType: 相片类型;
  206. dwImgNum: 重命名使用,返回的相片编号;
  207. lpStrImg: IncrementalBack表使用的content字段内容,指定备份文件名的相片;
  208. lpStrImgExt: IncrementalBack表使用的backupExt字段内容,指定要备份的扩展名相片;
  209. 返回:void
  210. */
  211. /************************************************************************/
  212. #include "ImportPhoto.h"
  213. // 导入原片、初修、精修、设计结束后的回调函数(三合一);
  214. void CALLBACK ImgImportMergeCallback(IN LPCTSTR lpStrBranchId, IN LPCTSTR lpStrOrderNum, IN CONST INT& dwImgType, IN CONST DWORD& dwImgNum, IN LPCTSTR lpStrImgs, IN LPCTSTR lpStrImgExt)
  215. {
  216. AfxSetResourceHandle(g_Instance);
  217. // 1.判断参数有效性;
  218. if (lpStrBranchId == NULL || !strstr(lpStrBranchId, _T(".ly.com")) || lpStrOrderNum == NULL || _tcscmp(lpStrOrderNum, _T("")) == 0)
  219. {
  220. OutputDebugString(_T("回调函数参数(域名、订单号)无效\n"));
  221. return;
  222. }
  223. // 2.是否需要备份分店相片;
  224. BOOL bIsNeedBranchImg = FALSE;
  225. switch (dwImgType)
  226. {
  227. case 1://是否备份分店原片;
  228. bIsNeedBranchImg = g_ThisShopVersion.bUpLoadCheck1;
  229. break;
  230. case 2://是否备份分店修片;
  231. bIsNeedBranchImg = g_ThisShopVersion.bUpLoadCheck2;
  232. break;
  233. case 3://是否备份分店精修;
  234. bIsNeedBranchImg = g_ThisShopVersion.bUpLoadCheck3;
  235. break;
  236. case 4://是否备份分店设计;
  237. bIsNeedBranchImg = g_ThisShopVersion.bUpLoadCheck4;
  238. break;
  239. default:
  240. OutputDebugString(_T("未知相片类型!\n"));
  241. break;
  242. }
  243. // 3.同时更新IncrementalBack表;
  244. CString strSQLInsert = _T("");
  245. strSQLInsert.Format(INSERT_INCREMENT, 0, lpStrBranchId, CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S"), lpStrOrderNum, dwImgType, lpStrImgs, g_user.account, g_user.name);
  246. // 4.连接服务器,更新dindan和IncrementalBackup;
  247. g_sendhead.bsql = 1;
  248. if (g_bAllBranch)
  249. {// 多店汇总时;
  250. g_branchip = GetBranchIPbyId(lpStrBranchId);
  251. g_pMainWnd->OnDisconnect();
  252. g_branchname = GetBranchNamebyId(lpStrBranchId);
  253. g_bBranchModify = 1;
  254. if (dwImgType == OImgtype)
  255. {// 如果导入的是原片;
  256. CString strSQL = _T("");
  257. strSQL.Format(_T("update dindan set curno = '%d' where id = '%s' ***%s"), dwImgNum, lpStrOrderNum, strSQLInsert);
  258. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  259. }
  260. else
  261. {//导入的不是原片;
  262. g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
  263. }
  264. // 如果连接服务器失败,要记录下来;
  265. // if () .........
  266. g_pMainWnd->OnDisconnect();
  267. g_bBranchModify = 0;
  268. g_branchip = g_branchname = _T("");
  269. if (g_domain.CompareNoCase(lpStrBranchId) != 0 && bIsNeedBranchImg)
  270. {// 如果不是本店,且本店设置中需要备份分店相片,需要向本店添加导入相片记录;
  271. g_sendhead.bsql = 1;
  272. g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
  273. g_pMainWnd->OnDisconnect();
  274. g_bBranchModify = 0;
  275. }
  276. }
  277. else
  278. {// 连接本店或分店时;
  279. if (dwImgType == OImgtype)
  280. {// 如果导入的是原片;
  281. CString strSQL = _T("");
  282. strSQL.Format(_T("update dindan set curno = '%d' where id = '%s' ***%s"), dwImgNum, lpStrOrderNum, strSQLInsert);
  283. g_pMainWnd->ProcessChatMessageRequest2(strSQL);
  284. }
  285. else
  286. {//导入的不是原片;
  287. g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
  288. }
  289. if (g_domain.CompareNoCase(lpStrBranchId) != 0 && bIsNeedBranchImg)
  290. {// 如果不是本店,且本店设置中需要备份分店相片,需要向本店添加导入相片记录;
  291. #if 1
  292. ::SendMessage(g_pMainWnd->m_hWnd, MSG_KERNEL_SENDMSG, (WPARAM)lpStrBranchId, (LPARAM)&strSQLInsert);
  293. #else // 可能是VC6.0与VC9.0间DLL调用产生的问题,下面代码执行时会出错;
  294. // 如果连接的是分店,断开分店,回连本店;
  295. g_bBranchModify = FALSE;
  296. g_pMainWnd->OnDisconnect();
  297. g_branchname = g_branchip = _T("");
  298. g_sendhead.bsql = 1;
  299. g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
  300. g_pMainWnd->OnDisconnect();
  301. // 设置回分店连接;
  302. g_branchip = GetBranchIPbyId(lpStrBranchId);
  303. g_branchname = GetBranchNamebyId(lpStrBranchId);
  304. g_bBranchModify = TRUE;
  305. #endif
  306. }
  307. }
  308. if ( dwImgType == OImgtype )
  309. {// 最后一步,更新完了数据库,刷新TakFrom类所对应的对话框;
  310. HWND hWnd = ::FindWindowEx(g_pMainWnd->GetSafeHwnd(), NULL, _T("MDIClient"), NULL);
  311. if (hWnd)
  312. {
  313. hWnd = ::FindWindowEx(hWnd, NULL, NULL, _T("拍照"));
  314. if (hWnd)
  315. {
  316. hWnd = ::FindWindowEx(hWnd, NULL, _T("#32770"), NULL);
  317. if (hWnd)
  318. {
  319. ::SendMessage(hWnd, MSG_KERNEL_CALLBACK, 0, 0);
  320. }
  321. }
  322. }
  323. }
  324. }
  325. #endif
  326. /////////////////////////////////////////////////////////////////////////////
  327. // CMainFrame客人付款
  328. /////////////////////////////////////////////////////////////////////////////
  329. /////////////////////////////////////////////////////////////////////////////
  330. static void HandleClientNetEvent(IN SOCKET hSocket,
  331. IN ETransportEvent eEvent,
  332. IN void *pDataBuf,
  333. IN unsigned long nDataLen,
  334. IN int nError,
  335. IN void *pContext)
  336. {
  337. if (nError != TRANSPORT_OK)
  338. return;
  339. CMainFrame *pDlg = (CMainFrame *)pContext;
  340. if (NULL == pDlg)
  341. return;
  342. pDlg->ProcessNetEvent(eEvent, pDataBuf, nDataLen);
  343. }
  344. BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
  345. {
  346. CRect rtCtrl, rtWnd; // 子窗口,父窗口;
  347. if (hwnd)
  348. {
  349. ::GetWindowRect(hwnd, &rtCtrl); // 获取控件大小;
  350. ::GetWindowRect(GetParent(hwnd), &rtWnd); // 获取父窗口大小;
  351. // printf("Jeff:g_WidthScale=%d,g_HeightScale=%d,rtWnd.left=%d,rtWnd.top=%d\n\n",g_WidthScale,g_HeightScale,rtWnd.left,rtWnd.top);
  352. // 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);
  353. rtCtrl.OffsetRect(-rtWnd.left, -rtWnd.top);
  354. float temp;
  355. temp = (float)rtCtrl.left*g_WidthScale;
  356. rtCtrl.left = (int)temp + g_dx;
  357. temp = (float)rtCtrl.top*g_HeightScale;
  358. rtCtrl.top = (int)temp + g_dy;
  359. temp = (float)rtCtrl.right*g_WidthScale;
  360. rtCtrl.right = (int)temp + g_dx;
  361. temp = (float)rtCtrl.bottom*g_HeightScale;
  362. rtCtrl.bottom = (int)temp + g_dy;
  363. //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);
  364. ::MoveWindow(hwnd, rtCtrl.left, rtCtrl.top, rtCtrl.Width(), rtCtrl.Height(), TRUE);
  365. return TRUE;
  366. }
  367. else
  368. {
  369. return FALSE;
  370. }
  371. }
  372. IMPLEMENT_DYNCREATE(CMainFrame, CMDIFrameWnd)
  373. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  374. //{{AFX_MSG_MAP(CMainFrame)
  375. ON_WM_CREATE()
  376. ON_WM_DESTROY()
  377. ON_WM_CLOSE()
  378. ON_WM_TIMER()
  379. ON_COMMAND(IDM_choosephotoskin, Onchoosephotoskin)
  380. ON_COMMAND(IDM_PATH, OnPath)
  381. ON_COMMAND(IDM_SERVER, OnServer)
  382. ON_COMMAND(IDM_SHOWHIS, OnShowhis)
  383. ON_COMMAND(IDM_StaffAchievementShow, OnStaffAchievementShow)
  384. ON_COMMAND(IDM_AUTODELPHOTO, OnAutodelphoto)
  385. ON_COMMAND(IDM_PHOTOMANAGE, Onphotomanage)
  386. ON_COMMAND(IDM_COMPANYINFO, OnCompanyinfo)
  387. ON_COMMAND(IDM_HELPFILE, OnHelpfile)
  388. ON_COMMAND(IDM_PHOTOBAK, OnPhotobak)
  389. ON_COMMAND(IDM_TAOXIFG, OnTaoxifg)
  390. ON_COMMAND(IDM_ShowBakState, OnShowBakState)
  391. ON_WM_NCLBUTTONDBLCLK()
  392. ON_WM_NCHITTEST()
  393. ON_COMMAND(IDM_LOG, OnLog)
  394. //}}AFX_MSG_MAP
  395. ON_COMMAND_RANGE(0, 50000, OnCommandMenu)
  396. ON_MESSAGE(MSG_KERNEL_SENDMSG, OnKernelSendMessaage)
  397. END_MESSAGE_MAP()
  398. static UINT indicators[] =
  399. {
  400. ID_SEPARATOR, // status line indicator
  401. ID_INDICATOR_CAPS,
  402. ID_INDICATOR_NUM,
  403. ID_INDICATOR_SCRL,
  404. };
  405. /////////////////////////////////////////////////////////////////////////////
  406. // CMainFrame construction/destruction
  407. #ifdef VC60
  408. UINT CMainFrame::OnNcHitTest(CPoint point)
  409. {
  410. if (CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
  411. return HTCLIENT;
  412. return CWnd::OnNcHitTest(point);
  413. }
  414. #else
  415. LRESULT CMainFrame::OnNcHitTest(CPoint point)
  416. {
  417. if (CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
  418. return HTCLIENT;
  419. return CWnd::OnNcHitTest(point);
  420. }
  421. #endif
  422. void CMainFrame::OnNcLButtonDblClk(UINT nFlags, CPoint point)
  423. {
  424. if (nFlags != HTCAPTION)
  425. CMDIFrameWnd::OnNcLButtonDblClk(nFlags, point);
  426. }
  427. // 回调使用;
  428. LRESULT CMainFrame::OnKernelSendMessaage(WPARAM wp, LPARAM lp)
  429. {
  430. CString strBranchId = (LPCTSTR)wp;
  431. CString strSQLInsert = *(CString*)lp;
  432. // 如果连接的是分店,断开分店,回连本店;
  433. g_bBranchModify = FALSE;
  434. g_pMainWnd->OnDisconnect();
  435. g_branchname = g_branchip = _T("");
  436. g_sendhead.bsql = 1;
  437. g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
  438. g_pMainWnd->OnDisconnect();
  439. // 设置回分店连接;
  440. g_branchip = GetBranchIPbyId(strBranchId);
  441. g_branchname = GetBranchNamebyId(strBranchId);
  442. g_bBranchModify = TRUE;
  443. g_pMainWnd->OnConnect();
  444. return 0;
  445. }
  446. CMainFrame::CMainFrame()
  447. {
  448. // TODO: add member initialization code here
  449. SetConnectionID(INVALID_SOCKET);
  450. m_pMainFrimDlg2 = NULL;
  451. m_bCheckF2F3 = AfxGetApp()->GetProfileInt(LYFZVERSION, "f2f3", 0);
  452. if (0 == ::PathFileExists(g_mainpath + "\\skin\\5.lia"))
  453. {
  454. g_bNoLoginLia = 1;
  455. }
  456. }
  457. CMainFrame::~CMainFrame()
  458. {
  459. if (m_pMainFrimDlg2)
  460. {
  461. m_pMainFrimDlg2->DestroyWindow();
  462. delete m_pMainFrimDlg2;
  463. }
  464. }
  465. void InTheMe(HWND m_hWnd)
  466. {
  467. BOOL bXpVisualStyle = FALSE;
  468. OSVERSIONINFO osvi;
  469. osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  470. ::GetVersionEx(&osvi);
  471. if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvi.dwMajorVersion >= 5) && (osvi.dwMinorVersion >= 1))
  472. {
  473. HMODULE hUxTheme = ::LoadLibrary(_T("UxTheme.dll"));
  474. POPENTHEMEDATA pOpenThemeData;
  475. PCLOSETHEMEDATA pCloseThemeData;
  476. if (hUxTheme != NULL)
  477. {
  478. pOpenThemeData = (POPENTHEMEDATA)::GetProcAddress(hUxTheme, "OpenThemeData");
  479. pCloseThemeData = (PCLOSETHEMEDATA)::GetProcAddress(hUxTheme, "CloseThemeData");
  480. HTHEME hButtonTheme = (*pOpenThemeData)(m_hWnd, L"BUTTON");
  481. if (hButtonTheme != NULL)
  482. bXpVisualStyle = TRUE;
  483. (*pCloseThemeData)(hButtonTheme);
  484. }
  485. ::FreeLibrary(hUxTheme);
  486. }
  487. if (bXpVisualStyle)
  488. AfxMessageBox(_T("正在使用视觉主题 "));
  489. else
  490. AfxMessageBox(_T("没有使用视觉主题 "));
  491. }
  492. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  493. {
  494. if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  495. {
  496. // Jeff.创建失败的可能性小,加日志输出;
  497. return -1;
  498. }
  499. if (::PathFileExists(g_mainpath + "\\logo.ico"))
  500. {
  501. Bitmap *bmp = NULL;
  502. LoadImageFromFile((Image**)&bmp, g_mainpath + "\\logo.ico");
  503. // m_hIcon = AfxGetApp()->LoadIcon(g_mainpath+"\\logo.ico");
  504. bmp->GetHICON(&m_hIcon);
  505. delete bmp;
  506. SetIcon(m_hIcon, TRUE); // Set big icon
  507. SetIcon(m_hIcon, FALSE); // Set small icon
  508. }
  509. if (!m_wndClient.SubclassWindow(m_hWndMDIClient))
  510. {
  511. return -1;
  512. }
  513. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  514. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  515. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  516. {
  517. TRACE0("Failed to create toolbar\n");
  518. return -1; // fail to create
  519. }
  520. m_wndToolBar.LoadTrueColorToolBar(90, IDB_NORMAL, 0, IDB_DISABLE);
  521. // second toolbar must have different ID
  522. if (!m_wndToolBar2.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT | CBRS_NOALIGN,
  523. AFX_IDW_CONTROLBAR_FIRST + 32) ||
  524. !m_wndToolBar2.LoadToolBar(IDR_TOOLBAR1))
  525. {
  526. TRACE0("Failed to create toolbar\n");
  527. return -1; // fail to create
  528. }
  529. #ifndef NEW_SKIN
  530. if (!m_wndStatusBar.Create(this) ||
  531. !m_wndStatusBar.SetIndicators(indicators,
  532. sizeof(indicators)/sizeof(UINT)))
  533. {
  534. // Jeff.创建失败的可能性小,加日志输出;
  535. TRACE0("Failed to create status bar\n");
  536. return -1; // fail to create
  537. }
  538. m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_NORMAL,200);
  539. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  540. #endif
  541. // TODO: Delete these three lines if you don't want the toolbar to
  542. // be dockable
  543. NewMenu2();
  544. ::GetWindowRect(this->m_hWndMDIClient, g_rc);
  545. g_pMainWnd = this;
  546. m_wndToolBar2.Init();
  547. g_rc.top += 38;
  548. g_rc.left += 160;
  549. /* m_WidthScale = (float)g_rc.Width ()/722;
  550. m_HeightScale = (float)g_rc.Height ()/533;*/
  551. g_user.bLongin = 0;
  552. SetTimer(1, 100, NULL);
  553. #ifdef USE_KERNEL_DLL
  554. if ( g_pIMGProcess )
  555. g_pIMGProcess->SetCallBack(ImgImportMergeCallback);
  556. #endif
  557. return 0;
  558. }
  559. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  560. {
  561. if (!CMDIFrameWnd::PreCreateWindow(cs))
  562. return FALSE;
  563. // TODO: Modify the Window class or styles here by modifying
  564. // the CREATESTRUCT cs
  565. cs.style &= ~WS_MAXIMIZEBOX;
  566. cs.style &= ~WS_THICKFRAME;
  567. cs.lpszName = g_title + "影楼管理系统";
  568. cs.style &= ~FWS_ADDTOTITLE;
  569. RECT rect;
  570. HWND hWnd = ::FindWindow("Shell_TrayWnd", 0);
  571. ::GetWindowRect(hWnd, &rect);
  572. cs.x = 0;
  573. cs.y = 0;
  574. cs.cx = GetSystemMetrics(SM_CXSCREEN);
  575. cs.cy = GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top) + 3;
  576. return TRUE;
  577. }
  578. /////////////////////////////////////////////////////////////////////////////
  579. // CMainFrame diagnostics
  580. #ifdef _DEBUG
  581. void CMainFrame::AssertValid() const
  582. {
  583. CMDIFrameWnd::AssertValid();
  584. }
  585. void CMainFrame::Dump(CDumpContext& dc) const
  586. {
  587. CMDIFrameWnd::Dump(dc);
  588. }
  589. #endif //_DEBUG
  590. /////////////////////////////////////////////////////////////////////////////
  591. // CMainFrame message handlers
  592. void CMainFrame::OnDestroy()
  593. {
  594. OnDisconnect();
  595. #ifdef VC60
  596. Transport_UnInit();
  597. #else
  598. CClientTunnel::Transport_UnInit();
  599. #endif //#ifdef VC60
  600. m_Mdi.DeleteAll();
  601. if (g_hmouse)UnhookWindowsHookEx(g_hmouse);
  602. CMDIFrameWnd::OnDestroy();
  603. }
  604. void CMainFrame::OnClose()
  605. {
  606. g_bShowBar = 0;
  607. if (m_Mdi.MainClose())
  608. CMDIFrameWnd::OnClose();
  609. }//连接
  610. void CMainFrame::NewMenu2()
  611. {
  612. CMenu *pMemu = GetMenu();
  613. #ifdef BASIC_VERSION
  614. CMenu* submenu = pMemu->GetSubMenu(1);
  615. //submenu->RemoveMenu (IDM_StaffAchievementShow, MF_BYCOMMAND );//Jeff del 2014.06.16
  616. submenu->RemoveMenu (IDM_salaryset, MF_BYCOMMAND );
  617. #endif
  618. #if 0 // 此机用选片菜单项,去掉不用;
  619. {
  620. BOOL checked=AfxGetApp()->GetProfileInt (LYFZVERSION, "status", 0);
  621. if(checked)
  622. {
  623. CMenu* submenu = pMemu->GetSubMenu(1);
  624. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  625. }
  626. }
  627. #endif
  628. #ifndef BASIC_VERSION
  629. {
  630. BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status2", 0);
  631. if (checked)
  632. {
  633. #if 0 // Jeff:去掉菜单,此机用于员工业绩查看的菜单选项;
  634. CMenu* submenu = pMemu->GetSubMenu(1);
  635. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  636. #endif
  637. g_bStaffAchievementShow = 1;
  638. SetTimer(3, 100, NULL);
  639. }
  640. }
  641. #endif
  642. if (g_bShowOK == 0)
  643. {
  644. CMenu* submenu = pMemu->GetSubMenu(2);
  645. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  646. }
  647. }
  648. HMENU CMainFrame::NewMenu()
  649. {
  650. //设置菜单为XP风格 IDM_SHOWHIS
  651. BCMenu::SetMenuDrawMode(1);
  652. //若取消下面这句注释,则可看到菜单的图标栏和文字栏背景颜色为白色,
  653. //文字颜色为蓝色,选中项的前景色为紫红色
  654. //m_menuXP.SetMenuXPItemColor(0x00FFFFFF,0x00FFFFFF,0x00FF0000,0x00FF00FF);
  655. // 设置菜单中图标大小为32×32
  656. // m_menuXP.SetIconSize(32,32);
  657. // 加载菜单资源
  658. m_menuXP.LoadMenu(IDR_MAINFRAME);
  659. // 加载菜单对应的工具栏资源
  660. // m_menuXP.LoadToolbar(IDR_MAINFRAME);
  661. /*由于菜单左边栏中默认的图标大小为16×16,而与之对应的Toolbar中图标大小为32×32,
  662. 因此菜单中图标不能正确显示,只显示出工具栏中图标的左上角部分,所以修改菜单中各
  663. 项对应的图标为24b色位图资源IDB_***,或者在LoadMenu之前调用SetIconSize,设置菜单
  664. 中图标大小为32×32*/
  665. // m_menuXP.SetIconSize(24,24);
  666. // m_menuXP.ModifyODMenu(NULL,IDM_YWBU,IDB_YW); //
  667. /* m_menuXP.ModifyODMenu(NULL,ID_FILE_OPEN,IDB_BITMAP5);
  668. m_menuXP.ModifyODMenu(NULL,ID_FILE_SAVE,IDB_BITMAP7);
  669. m_menuXP.ModifyODMenu(NULL,ID_FILE_PRINT,IDB_BITMAP6);
  670. m_menuXP.ModifyODMenu(NULL,ID_APP_ABOUT,IDB_BITMAP3);
  671. m_menuXP.ModifyODMenu(NULL,ID_APP_EXIT,IDB_BITMAP2);*/
  672. // m_menuXP.EnableMenuItem (0, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  673. // m_menuXP.EnableMenuItem (2, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  674. // m_menuXP.EnableMenuItem (3, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  675. // m_menuXP.EnableMenuItem (4, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  676. // m_menuXP.EnableMenuItem (5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  677. // m_menuXP.EnableMenuItem (8, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  678. #if 0 // Jeff此机用选片菜单项不用;
  679. {
  680. BOOL checked=AfxGetApp()->GetProfileInt (LYFZVERSION, "status", 0);
  681. if(checked)
  682. {
  683. CMenu* submenu = m_menuXP.GetSubMenu(1);
  684. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  685. }
  686. }
  687. #endif
  688. {
  689. BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status2", 0);
  690. if (checked)
  691. {
  692. #if 0 // Jeff:去掉此机用于员工业绩查看的菜单选项;
  693. CMenu* submenu = m_menuXP.GetSubMenu(1);
  694. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  695. #endif
  696. g_bStaffAchievementShow = 1;
  697. SetTimer(3, 100, NULL);
  698. }
  699. }
  700. if (g_bShowOK == 0)
  701. {
  702. CMenu* submenu = m_menuXP.GetSubMenu(2);
  703. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  704. }
  705. return(m_menuXP.Detach());
  706. }
  707. ///////////////////////////////////////////////////////
  708. //减少代码
  709. #define OPEN_MENU(x) m_Mdi.Append(pName, RUNTIME_CLASS(x), IDR_MAINFRAME, this, nID)
  710. //响应菜单命令
  711. void CMainFrame::OnCommandMenu(UINT nID) // 所有菜单命令都在这里处理;
  712. {
  713. if (nID >= 2000 && nID <= 2100)
  714. {
  715. OnBranchData(nID);
  716. return;
  717. }
  718. if (g_user.bLongin == 0)
  719. {
  720. if (g_bNoLoginLia)
  721. {
  722. Login dlg;
  723. dlg.SetLiaPath("5.lia");
  724. dlg.DoModal();
  725. }
  726. else
  727. {
  728. Login3 dlg;
  729. dlg.SetLiaPath("5.lia");
  730. dlg.DoModal();
  731. }
  732. return;
  733. if (g_user.bLongin == 0)return;
  734. }
  735. else
  736. {
  737. InsideMsg();
  738. }
  739. ResetTimer();
  740. if (nID >= 1000 && nID <= 1100)
  741. {
  742. OnHistory(nID);
  743. return;
  744. }
  745. LPSTR pName;
  746. //打开窗口
  747. switch (nID)
  748. {
  749. case IDM_PayOutSet:
  750. {
  751. if (IsHasRights(16) == 0)return;
  752. PayOutSet dlg;
  753. dlg.DoModal();
  754. return;
  755. }
  756. case IDM_SPLB:
  757. {
  758. if (IsHasRightsnew(29) == 0)return;
  759. SPLBDlg dlg;
  760. dlg.DoModal();
  761. return;
  762. }
  763. case IDM_JD:
  764. {
  765. if (IsHasRightsnew(49) == 0)return;
  766. SPLBDlg dlg;
  767. dlg.m_mode = 1;
  768. dlg.DoModal();
  769. return;
  770. }
  771. case IDM_AREA:
  772. {
  773. if (IsHasRightsnew(47) == 0)return;
  774. AreaDlg dlg;
  775. dlg.DoModal();
  776. return;
  777. }
  778. case IDM_Psw:
  779. {
  780. Psw dlg;
  781. dlg.DoModal();
  782. return;
  783. }
  784. case IDM_Set:
  785. {
  786. if (IsHasRightsnew(49) == 0)return;
  787. Set dlg;
  788. dlg.DoModal();
  789. return;
  790. }
  791. case IDM_HIDEWINDOW:
  792. {
  793. HideWindow dlg;
  794. dlg.DoModal();
  795. return;
  796. }
  797. case IDM_Logout:// Jeff.注销;
  798. {
  799. if(g_user.bLongin)
  800. WriteLog("退出系统!", "退出系统!");
  801. g_user.bLongin = 0;
  802. g_user.name.Empty();
  803. g_user.rights.Empty();
  804. g_user.account.Empty();
  805. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  806. g_pMainWnd2->RefreshOutlookBar();
  807. #ifndef NEW_SKIN
  808. m_wndStatusBar.SetPaneText(1, "未登录", TRUE);
  809. #endif
  810. m_Mdi.CloseAll();
  811. #ifdef ENTERPRISE_VERSION
  812. g_branchname.Empty();
  813. g_branchip.Empty();
  814. g_pMainWnd->OnDisconnect();
  815. g_bBranchModify = 0;
  816. #endif
  817. if (g_pMainWnd2)
  818. {
  819. g_pMainWnd2->DrawLogin();
  820. g_pMainWnd2->ShowBar(0);
  821. }
  822. g_hisyeararray.RemoveAll();
  823. g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
  824. g_brancharray.RemoveAll();
  825. g_pMainWnd->AddBranchMenu(&g_brancharray);
  826. if (g_bNoLoginLia)
  827. {
  828. Login dlg;
  829. dlg.SetLiaPath("5.lia");
  830. dlg.DoModal();
  831. }
  832. else
  833. {
  834. Login3 dlg;
  835. dlg.SetLiaPath("5.lia");
  836. dlg.DoModal();
  837. }
  838. if (g_user.bLongin == 1)
  839. {
  840. if (g_pMainWnd2)
  841. {
  842. g_pMainWnd2->ShowBar(TRUE,TRUE);
  843. }
  844. }
  845. return;
  846. }
  847. case IDM_TODAY:
  848. pName = (LPSTR)(LPCSTR)"历史订单";
  849. // OPEN_MENU(SalarySet3);
  850. OPEN_MENU(DinDanHistroy);
  851. break;
  852. case IDM_TAKECONTROL:
  853. pName = (LPSTR)(LPCSTR)"摄控表";
  854. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))
  855. OPEN_MENU(TodayForm2);
  856. else
  857. OPEN_MENU(TodayForm);
  858. break;
  859. case IDM_CLIENTMONEY:
  860. pName = (LPSTR)(LPCSTR)"客人付款";
  861. OPEN_MENU(ClientMoney);
  862. break;
  863. case IDM_TAKEAWAYBOOK:
  864. pName = (LPSTR)(LPCSTR)"发片/取件";
  865. OPEN_MENU(outsourcing);
  866. break;
  867. case IDM_CODE:
  868. pName = (LPSTR)(LPCSTR)"商品报表";
  869. OPEN_MENU(SPForm);
  870. break;
  871. case IDM_Daily:
  872. // if(IsHasRightsnew(22)==0)return;
  873. // pName = (LPSTR)(LPCSTR)"日财务表";
  874. // OPEN_MENU(DailyForm);
  875. pName = (LPSTR)(LPCSTR)"沟通助手";
  876. OPEN_MENU(InsideMsg);
  877. break;
  878. case IDM_ProcessAlarm:
  879. pName = (LPSTR)(LPCSTR)"流程监控";
  880. OPEN_MENU(ProcessAlarm);
  881. break;
  882. case IDM_DINDAN:
  883. // if(IsHasRights(7)==0)return;
  884. pName = (LPSTR)(LPCSTR)"订单报表";
  885. OPEN_MENU(DinDanFrom);
  886. break;
  887. case IDM_CLIENT:
  888. //if(IsHasRights(8)==0)return;
  889. pName = (LPSTR)(LPCSTR)"客户报表";
  890. OPEN_MENU(CClientForm);
  891. break;
  892. case IDM_PayOutInput:
  893. if (IsHasRightsnew(20) == 0)return;
  894. pName = (LPSTR)(LPCSTR)"现金支出";
  895. OPEN_MENU(PayOutInput);
  896. break;
  897. case IDM_salaryset:
  898. if (IsHasRightsnew(25) == 0)return;
  899. pName = (LPSTR)(LPCSTR)"工资设置";
  900. OPEN_MENU(SalarySet);
  901. break;
  902. case IDM_mysalary:
  903. if (IsHasRights(16) == 0)return;
  904. pName = (LPSTR)(LPCSTR)"我的工资";
  905. OPEN_MENU(MySalary);
  906. break;
  907. case IDM_SP:
  908. // if(IsHasRightsnew(29)==0)return;
  909. pName = (LPSTR)(LPCSTR)"商品设置";
  910. OPEN_MENU(ShangPin);
  911. break;
  912. case IDM_WORKER:
  913. if (IsHasRightsnew(27) == 0)return;
  914. pName = (LPSTR)(LPCSTR)"员工设置";
  915. OPEN_MENU(Worker);
  916. break;
  917. case IDM_TAOXI:
  918. if (IsHasRightsnew(30) == 0)return;
  919. pName = (LPSTR)(LPCSTR)"套系设置";
  920. OPEN_MENU(TXDlg);
  921. break;
  922. case IDM_TAOXISP:
  923. if (IsHasRightsnew(30) == 0)return;
  924. pName = (LPSTR)(LPCSTR)"套系赠送商品设置";
  925. OPEN_MENU(TXSPDlg);
  926. break;
  927. case IDM_Provider:
  928. if (IsHasRightsnew(32) == 0)return;
  929. pName = (LPSTR)(LPCSTR)"供应商设置";
  930. OPEN_MENU(ProviderDlg);
  931. break;
  932. case IDM_BUMEN:
  933. {
  934. if (IsHasRightsnew(49) == 0)return;
  935. BuMenDlg dlg;
  936. dlg.DoModal();
  937. return;
  938. }
  939. case IDM_Account:
  940. if (IsHasRightsnew(49) == 0)return;
  941. pName = (LPSTR)(LPCSTR)"账号管理";
  942. OPEN_MENU(Account);
  943. break;
  944. case IDM_YLCD:
  945. {
  946. //AfxMessageBox("IDM_YLCD");
  947. ::CopyFile(_T(g_path7 + "\\接单系统\\Regsvr32.exe"), _T(g_mainpath + "\\Regsvr32.exe"), 0);
  948. ::CopyFile(_T(g_path7 + "\\接单系统\\Flash9f.ocx"), _T(g_mainpath + "\\Flash9f.ocx"), 0);
  949. CString temp;
  950. temp.Format("%s\\regsvr32.exe /s %s\\Flash9f.OCX", g_mainpath, g_mainpath);
  951. WinExec(temp, SW_HIDE);
  952. ::CopyFile(_T(g_path7 + "\\接单系统\\接单系统.exe"), _T(g_mainpath + "\\接单系统.exe"), 0);
  953. ::CopyFile(_T(g_path7 + "\\接单系统\\my32.dll"), _T(g_mainpath + "\\my32.dll"), 0);
  954. ::CopyFile(_T(g_path7 + "\\接单系统\\server.dat"), _T(g_mainpath + "\\server.dat"), 0);
  955. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\接单系统.exe"), g_server, NULL, SW_SHOWNORMAL);
  956. }
  957. break;
  958. case IDM_YLCDMANAGE:
  959. ::CopyFile(_T(g_path7 + "\\接单系统\\资源管理器.exe"), _T(g_mainpath + "\\资源管理器.exe"), 0);
  960. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\资源管理器.exe"), g_server, NULL, SW_SHOWNORMAL);
  961. break;
  962. }
  963. }
  964. //减少代码
  965. ///////////////////////////////////////////////////////////////////////////////
  966. void CMainFrame::OnDisconnect()
  967. {
  968. printf("断开TCP连接\n");
  969. m_tClientTunnel.net_CloseSocket();
  970. SetConnectionID(INVALID_SOCKET);
  971. }
  972. void CMainFrame::ProcessLoginResponse(void *pLoginResult)
  973. {
  974. if (NULL == pLoginResult) return;
  975. LOGIN_RESULT_STRU *ptLoginResult = (LOGIN_RESULT_STRU *)pLoginResult;
  976. DWORD dwConnectionID = ptLoginResult->tCommonMsg.dwConnectionID;
  977. SetConnectionID(dwConnectionID);
  978. BYTE byResult = ptLoginResult->byResult;
  979. if (LOGIN_RESULT_SUC == byResult)
  980. {
  981. //AfxMessageBox("登录成功"); // Jeff test;
  982. }
  983. else
  984. {
  985. OnDisconnect();
  986. }
  987. }
  988. /************************************************************************/
  989. /* 函数:ProcessLoginRequest[3/3/2016 IT];
  990. /* 描述:登陆服务器;
  991. /* 参数:;
  992. /* [IN] :;
  993. /* [OUT] :;
  994. /* [IN/OUT] :;
  995. /* 返回:登陆成功返回TRUE;
  996. /* 注意:;
  997. /* 示例:;
  998. /*
  999. /* 修改:;
  1000. /* 日期:;
  1001. /* 内容:;
  1002. /************************************************************************/
  1003. BOOL CMainFrame::ProcessLoginRequest()
  1004. {
  1005. // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
  1006. WORD wMessageId = 0;
  1007. if (g_conntype == 0 && !g_bConnLYFZ)
  1008. wMessageId = (MSG_LOGIN_REQ + 0X1FFF);
  1009. else// if (g_bConnLYFZ )
  1010. wMessageId = MSG_LOGIN_REQ;
  1011. // 2.填充发送数据;
  1012. TLOGIN_STRU tLogonInfo = { 0 };
  1013. tLogonInfo.tCommonMsg.dwConnectionID = GetConnectionID();//此时m_dwConnectionID为INVALIDE_SOCKET;
  1014. tLogonInfo.tCommonMsg.wMessageId = wMessageId;
  1015. CString strUserName = newGUID();// 以随机数作为登陆时的用户名称;
  1016. strUserName.TrimLeft();
  1017. strUserName.TrimRight();
  1018. #ifdef VC60
  1019. strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
  1020. #else
  1021. strcpy_s(tLogonInfo.tUserInfo.szUserName, 31, strUserName);
  1022. #endif
  1023. DWORD dwDataLen = sizeof(TLOGIN_STRU);
  1024. // 3.填充数据头;
  1025. TMessageHeader tHeader = { 0 };
  1026. tHeader.wMessageId = wMessageId;
  1027. tHeader.dwDataLen = dwDataLen;
  1028. // 4.发送数据;
  1029. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)&tLogonInfo, dwDataLen);
  1030. if (ulSendLen == SOCKET_ERROR)
  1031. {
  1032. return 0;
  1033. }
  1034. return 1;
  1035. }
  1036. DWORD CMainFrame::GetConnectionID()
  1037. {
  1038. return m_dwConnectionID;
  1039. }
  1040. void CMainFrame::SetConnectionID(DWORD dwConnection)
  1041. {
  1042. m_dwConnectionID = dwConnection;
  1043. }
  1044. /************************************************************************/
  1045. /* 函数:ProcessChatMessageRequest2[3/3/2016 IT];
  1046. /* 描述:;
  1047. /* 参数:;
  1048. /* [IN] code:;
  1049. /* 返回:void;
  1050. /* 注意:
  1051. OnConnect() -> ProcessChatMessageRequest()
  1052. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  1053. 2.SendDataDlg计时器里调用CConnectDlg对话框
  1054. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  1055. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  1056. 5.关闭对话框和断开连接;;
  1057. /* 示例:;
  1058. /*
  1059. /* 修改:;
  1060. /* 日期:;
  1061. /* 内容:;
  1062. /************************************************************************/
  1063. void CMainFrame::ProcessChatMessageRequest2(BYTE code)
  1064. {
  1065. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  1066. SendDataDlg dlg;
  1067. dlg.m_bycode = code;
  1068. dlg.DoModal();
  1069. }
  1070. //*********************************************//
  1071. /*
  1072. 函数:ProcessChatMessageRequest2
  1073. 参数:CString sql [IN]
  1074. 返回:无
  1075. 过程:OnConnect() -> ProcessChatMessageRequest()
  1076. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  1077. 2.SendDataDlg计时器里调用CConnectDlg对话框
  1078. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  1079. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  1080. 5.关闭对话框和断开连接;
  1081. */
  1082. //*********************************************//
  1083. void CMainFrame::ProcessChatMessageRequest2(CString sql)
  1084. {
  1085. if ((sql.Find("insert") != -1 || sql.Find("update") != -1 || sql.Find("delete") != -1) && g_branchname != "" && g_bBranchModify == 0)
  1086. {
  1087. AfxMessageBox("当前为分店数据查看状态,不能更改分店数据!", MB_ICONSTOP);
  1088. g_bSendOK = 0;
  1089. return;
  1090. }
  1091. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  1092. SendDataDlg dlg;
  1093. dlg.m_strSQL = sql;
  1094. dlg.DoModal();
  1095. }
  1096. //*********************************************//
  1097. /*
  1098. 函数:ProcessChatMessageRequest2
  1099. 参数:BYTE *pData [IN], int length [IN]
  1100. 返回:无
  1101. 过程:OnConnect() -> ProcessChatMessageRequest()
  1102. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  1103. 2.SendDataDlg计时器里调用CConnectDlg对话框
  1104. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  1105. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  1106. 5.关闭对话框和断开连接;
  1107. */
  1108. //*********************************************//
  1109. void CMainFrame::ProcessChatMessageRequest2(BYTE *pData, int length)
  1110. {
  1111. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  1112. SendDataDlg dlg;
  1113. dlg.m_pData = pData;
  1114. dlg.m_nlength = length;
  1115. dlg.DoModal(); // DoModal未执行完时,就被其他函数销毁,导致局部函数dlg无效;
  1116. }
  1117. /************************************************************************/
  1118. /*
  1119. 函数:ProcessChatMessageRequest
  1120. 描述:对服务发送数据;
  1121. 参数:void *szDataBuf[IN], int nDataLen[IN]
  1122. 返回:发送成功与否;
  1123. */
  1124. /************************************************************************/
  1125. BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)
  1126. {
  1127. // 1.获取当前与服务器连接的id;
  1128. DWORD dwFromUserID = GetConnectionID();
  1129. // 2.设置通信类型为MSG_CHATMESSAGE_REQ;
  1130. WORD wMessageId = 0;
  1131. if (g_conntype == 0 && !g_bConnLYFZ)
  1132. wMessageId = (MSG_CHATMESSAGE_REQ + 0X3FFF);
  1133. else
  1134. wMessageId = MSG_CHATMESSAGE_REQ;
  1135. // 3.计算出欲发送的数据的长度 dwDataLen;
  1136. DWORD dwDataLen = sizeof(TCHAT_MESSAGE_STRU) + nDataLen;
  1137. BYTE *pSendData = new BYTE[dwDataLen];
  1138. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU*)pSendData;
  1139. memset(pChatMessage, 0x00, dwDataLen);
  1140. // 3.1.g_nYearpos==-1,表示连接是当前主数据库,其他值表示历史数据库;
  1141. if (g_nYearpos == -1)
  1142. g_sendhead.length[99] = g_nYearpos;
  1143. else
  1144. g_sendhead.length[99] = g_nYearpos * 32142953 + 10966236;
  1145. g_sendhead.length[98] = 987123768;
  1146. memcpy(pSendData, &g_sendhead, sizeof(g_sendhead));
  1147. #ifdef ENTERPRISE_VERSION
  1148. if (g_bBranchModify == 0)
  1149. #ifdef VC60
  1150. strcpy(pChatMessage->szFromUserName, g_branchname);
  1151. #else
  1152. strcpy_s(pChatMessage->szFromUserName, 30, g_branchname);
  1153. #endif
  1154. #endif
  1155. // 4.填充发送的数据结构;
  1156. pChatMessage->tCommonMsg.dwConnectionID = GetConnectionID();
  1157. pChatMessage->tCommonMsg.wMessageId = wMessageId;
  1158. pChatMessage->dwFromUserID = dwFromUserID;
  1159. pChatMessage->dwToUserID = g_nSendCode;//▲▲g_nSendCode在服务端同为dwToUserID;
  1160. pChatMessage->wMessageLen = nDataLen;
  1161. memcpy(pChatMessage->byFileContent, szDataBuf, nDataLen);
  1162. // 5.填充数据头;
  1163. TMessageHeader tHeader = { 0 };
  1164. tHeader.wMessageId = wMessageId;
  1165. tHeader.dwDataLen = dwDataLen;
  1166. // 6.发送数据;
  1167. BOOL bRet = 0;
  1168. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)pChatMessage, dwDataLen);
  1169. if (ulSendLen != SOCKET_ERROR)
  1170. {
  1171. bRet = 1;
  1172. }
  1173. // 7.发送完毕,释放内存;
  1174. delete[] pSendData;
  1175. return bRet;
  1176. }
  1177. /************************************************************************/
  1178. /*
  1179. 函数:ProcessChatMessageResponse
  1180. 描述:接收服务返回的数据;
  1181. 参数:void *pResponse[IN]
  1182. 返回:无;
  1183. 调用关系:
  1184. 1.由 void CMainFrame::ProcessNetEvent(...)调用
  1185. */
  1186. /************************************************************************/
  1187. void CMainFrame::ProcessChatMessageResponse(void *pResponse)
  1188. {
  1189. // 1.数据空,直接返回;
  1190. if (NULL == pResponse)
  1191. return;
  1192. // 2.数据解析过程;
  1193. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pResponse;
  1194. int nMessageLen = pChatMessage->wMessageLen;
  1195. int nMessageLen2 = pChatMessage->dwToUserID; // 在服务器中被处理了,一般使dwToUserID=wMessageLen;
  1196. // Jeff.dwFromUserID==8888表示的内容是更新客户端skin界面数据,只有两处dwToUserID==211和dwToUserID==21;
  1197. // Jeff.其余的大多数都是 dwFromUserID = wMessageLen = dwToUserID 三者相等;
  1198. if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID != 8888)
  1199. {
  1200. // 2.1.清除全局变量g_pData数据,用于保存接收的实际数据;
  1201. if (g_pData)
  1202. delete[]g_pData;
  1203. g_pData = NULL;
  1204. g_pData = new BYTE[nMessageLen];
  1205. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1206. memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
  1207. g_nLeng = nMessageLen;
  1208. if (nMessageLen <= sizeof(DWORD))
  1209. {
  1210. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1211. }
  1212. KillTimer(2);
  1213. if (g_hSendWnd)
  1214. {
  1215. ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);//关闭发送对话框;
  1216. }
  1217. }
  1218. else if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID == 8888)
  1219. {
  1220. if (g_pData2)
  1221. delete[]g_pData2;
  1222. g_pData2 = NULL;
  1223. g_pData2 = new BYTE[nMessageLen2];
  1224. memcpy(g_pData2, pChatMessage->byFileContent, nMessageLen2);
  1225. g_nLeng2 = nMessageLen2;
  1226. KillTimer(2);
  1227. if (g_hSendWnd)
  1228. {
  1229. ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1230. }
  1231. }
  1232. else // 登陆返回;
  1233. {
  1234. if (g_bConnLYFZ)
  1235. {
  1236. if (g_pData)
  1237. delete[]g_pData;
  1238. g_pData = NULL;
  1239. g_pData = new BYTE[nMessageLen];
  1240. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1241. memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
  1242. g_nLeng = nMessageLen;
  1243. if (nMessageLen <= sizeof(DWORD))
  1244. {
  1245. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1246. }
  1247. KillTimer(2);
  1248. if (g_hSendWnd)
  1249. {
  1250. ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1251. }
  1252. return;
  1253. }
  1254. if (g_conntype) // Jeff.g_conntype == 1,表示连接公司服务器的返回,用于集团版解析*.ly.com的IP地址;
  1255. {
  1256. // KillTimer(2);
  1257. char *szChatMessage = new char[nMessageLen + 1];
  1258. memset(szChatMessage, 0x00, nMessageLen + 1);
  1259. memcpy(szChatMessage, pChatMessage->byFileContent, nMessageLen);
  1260. g_server = szChatMessage;
  1261. delete[]szChatMessage;
  1262. CStdioFile fp;
  1263. CString path = g_mainpath + "\\ip.txt";
  1264. ::DeleteFile(path); // 删除ip.txt;
  1265. fp.Open(path, CFile::modeCreate | CFile::modeWrite);
  1266. fp.WriteString(g_server);
  1267. fp.Close();
  1268. g_conntype = 0;
  1269. // g_serverip=g_server;
  1270. return;
  1271. }
  1272. if (g_pData2 == NULL)
  1273. {
  1274. g_pData2 = new BYTE[nMessageLen2];
  1275. g_nLeng2 = 0;
  1276. }
  1277. memcpy(g_pData2 + g_nLeng2, pChatMessage->byFileContent, nMessageLen);
  1278. g_nLeng2 += nMessageLen;
  1279. if (g_nLeng2 == nMessageLen2)//已收完
  1280. {
  1281. KillTimer(2);
  1282. if (g_hSendWnd)
  1283. {
  1284. ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1285. }
  1286. }
  1287. else
  1288. {
  1289. KillTimer(2);
  1290. SetTimer(2, g_ntimeout, NULL);
  1291. }
  1292. }
  1293. }
  1294. #if USE_SHARE_FLORD
  1295. /************************************************************************/
  1296. /*
  1297. Date: 2015-04-11
  1298. Author: Jeff
  1299. 函数:GetSharePathInfo
  1300. 描述:获取共享目录表的所有信息;
  1301. 参数:
  1302. 返回:成功返回TRUE;
  1303. 注意:获取的表记录存储在全局变量g_aryOfSharePathInfo中;
  1304. 调用约定:在登陆软件时调用,且必须连接的服务器是本店的;
  1305. */
  1306. /************************************************************************/
  1307. BOOL CMainFrame::GetSharePathInfo()
  1308. {
  1309. // 1.连接的数据库必须是本局域网的服务器;
  1310. if ( g_bAllBranch || !g_branchname.IsEmpty() || !g_branchip.IsEmpty() )
  1311. {
  1312. // 非当前局域网服务器;
  1313. return FALSE;
  1314. }
  1315. // 2.获取当前连接的分店域名是否与g_domain一致;
  1316. g_sendhead.bsql = 0;
  1317. g_sendhead.code[0] = 29;
  1318. g_sendhead.tabcount = 1;
  1319. g_pMainWnd->ProcessChatMessageRequest2(23);
  1320. if ( !g_bSendOK )
  1321. {
  1322. // 连接服务器失败;
  1323. return FALSE;
  1324. }
  1325. CArray<CStringArray,CStringArray> strArray;
  1326. DataToArray(&strArray);
  1327. CString strCurBranchDomain = _T("");
  1328. if ( strArray.GetSize() )
  1329. {
  1330. strCurBranchDomain = strArray.ElementAt(0).ElementAt(0);
  1331. if ( strCurBranchDomain.Find(_T(".ly.com")) == -1)
  1332. {
  1333. // 当前获取的域名有错;
  1334. return FALSE;
  1335. }
  1336. }
  1337. if ( g_domain.CompareNoCase(strCurBranchDomain) != 0)
  1338. {
  1339. // 当前连接的分店域名与局域网服务器域名不一致;
  1340. return FALSE;
  1341. }
  1342. // 3.获取可用的共享信息;//select * from NetShareInfo where enable = 1;
  1343. CString strFilter = _T("");
  1344. strFilter.Format(_T("enable = 1"));
  1345. int g_nYearposTemp=g_nYearpos;
  1346. g_nYearpos=-1;
  1347. g_bSendOK = 0;
  1348. g_sendhead.bsql = 0;
  1349. g_sendhead.code[0] = 236;
  1350. g_sendhead.tabcount = 1;
  1351. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  1352. g_nYearpos = g_nYearposTemp;
  1353. if ( !g_bSendOK )
  1354. {
  1355. // 获取共享信息失败;
  1356. return FALSE;
  1357. }
  1358. g_aryOfSharePathInfo.RemoveAll();
  1359. DataToArray(&g_aryOfSharePathInfo);
  1360. return g_aryOfSharePathInfo.GetSize() ? TRUE : FALSE;
  1361. }
  1362. #endif
  1363. BOOL CMainFrame::OnConnectBranch()
  1364. {
  1365. if (g_branchip == "")
  1366. {
  1367. return 0;
  1368. }
  1369. g_conntype = 0;
  1370. CString strServerAddress = g_branchip;
  1371. char *szServerAddress = strServerAddress.GetBuffer(0);
  1372. strServerAddress.ReleaseBuffer();
  1373. /*for Client, IP and Port can be 0,
  1374. and for Server, IP is LocalIP, and Port is Listening Port*/
  1375. int nResult = m_tClientTunnel.net_OpenSocket(
  1376. Transport_Client,
  1377. 0,
  1378. HandleClientNetEvent,
  1379. this);
  1380. if (TRANSPORT_OK != nResult)
  1381. {
  1382. // AfxMessageBox("网络初始化失败!");
  1383. return 0;
  1384. }
  1385. GetSysIniInfo(g_szModulePath, g_branchname + _T(".ini"));
  1386. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1387. DWORD wPort = g_dwCSPort;
  1388. #ifdef VC60
  1389. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1390. if (TRANSPORT_OK != nResult)
  1391. #else
  1392. nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
  1393. if (!nResult)
  1394. #endif
  1395. {
  1396. m_tClientTunnel.net_CloseSocket();
  1397. return OnConnectBranch2();
  1398. }
  1399. return ProcessLoginRequest();
  1400. }
  1401. BOOL CMainFrame::OnConnectBranch2()
  1402. {
  1403. if (g_branchip2 == "")
  1404. {
  1405. return 0;
  1406. }
  1407. g_conntype = 0;
  1408. CString strServerAddress = g_branchip2;
  1409. char *szServerAddress = strServerAddress.GetBuffer(0);
  1410. strServerAddress.ReleaseBuffer();
  1411. /*for Client, IP and Port can be 0,
  1412. and for Server, IP is LocalIP, and Port is Listening Port*/
  1413. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1414. 0,
  1415. HandleClientNetEvent,
  1416. this);
  1417. if (TRANSPORT_OK != nResult)
  1418. {
  1419. // AfxMessageBox("网络初始化失败!");
  1420. return 0;
  1421. }
  1422. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1423. DWORD wPort = SERVER_PORT; // 5678
  1424. #ifdef VC60
  1425. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1426. if (TRANSPORT_OK != nResult)
  1427. #else
  1428. nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
  1429. if (!nResult)
  1430. #endif
  1431. {
  1432. m_tClientTunnel.net_CloseSocket();
  1433. return 0;
  1434. }
  1435. return ProcessLoginRequest();
  1436. }
  1437. BOOL CMainFrame::OnConnectIP()
  1438. {
  1439. CString strServerAddress = g_server;
  1440. char *szServerAddress = strServerAddress.GetBuffer(0);
  1441. strServerAddress.ReleaseBuffer();
  1442. /*for Client, IP and Port can be 0,
  1443. and for Server, IP is LocalIP, and Port is Listening Port*/
  1444. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1445. 0,
  1446. HandleClientNetEvent,
  1447. this);
  1448. if (TRANSPORT_OK != nResult)
  1449. {
  1450. // AfxMessageBox("网络初始化失败!");
  1451. return 0;
  1452. }
  1453. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1454. DWORD wPort = SERVER_PORT; // 5678
  1455. #ifdef VC60
  1456. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1457. if (TRANSPORT_OK != nResult)
  1458. #else
  1459. nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
  1460. if (!nResult)
  1461. #endif
  1462. {
  1463. m_tClientTunnel.net_CloseSocket();
  1464. return 0;
  1465. }
  1466. return ProcessLoginRequest();
  1467. }
  1468. //ip.txt
  1469. BOOL CMainFrame::OnConnectLYFZ()
  1470. {
  1471. CString strBranchIP = "lijiafz.vicp.net";
  1472. MyGetIPByName2(strBranchIP);
  1473. if (strBranchIP == "")
  1474. {
  1475. return 0;
  1476. }
  1477. g_conntype = 0; // Jeff.Delete at 2014.10.18
  1478. //g_conntype = 1;
  1479. CString strServerAddress = strBranchIP;
  1480. char *szServerAddress = strServerAddress.GetBuffer(0);
  1481. strServerAddress.ReleaseBuffer();
  1482. /*for Client, IP and Port can be 0,
  1483. and for Server, IP is LocalIP, and Port is Listening Port*/
  1484. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1485. 0,
  1486. HandleClientNetEvent,
  1487. this);
  1488. if (TRANSPORT_OK != nResult)
  1489. {
  1490. return 0;
  1491. }
  1492. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1493. DWORD wPort = GetPort();
  1494. #ifdef VC60
  1495. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1496. if (TRANSPORT_OK != nResult)
  1497. #else
  1498. nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
  1499. if (!nResult)
  1500. #endif
  1501. {
  1502. m_tClientTunnel.net_CloseSocket();
  1503. return 0;
  1504. }
  1505. return ProcessLoginRequest();
  1506. }
  1507. BOOL CMainFrame::OnConnect()
  1508. {
  1509. // 1.Jeff 断开(如果有在在未关的连接)之前的连接;
  1510. OnDisconnect();
  1511. // 2.根据需要连接指定的服务器;
  1512. if (g_bBranchModify)
  1513. {
  1514. // Jeff.g_bBranchModify在g_bGenBranchData=1时,在welcome::OnTimer里被设置为1;
  1515. return OnConnectBranch();// 连接集团版分店;
  1516. }
  1517. if (g_bConnLYFZ)
  1518. {
  1519. return OnConnectLYFZ();// 连接公司服务端程序;
  1520. }
  1521. g_conntype = 0;
  1522. CString strServerAddress = g_server;
  1523. // 3.如果dbconfig.dat里保存的是*.ly.com的信息,就要读取ip.txt里的IP地址;
  1524. if (g_serverbak.Find(".ly.com") != -1)
  1525. {
  1526. strServerAddress = g_serverbak;
  1527. CStdioFile fp;
  1528. CString path = g_mainpath + "\\ip.txt";
  1529. if (::PathFileExists(path))
  1530. {
  1531. fp.Open(path, CFile::modeRead);
  1532. fp.ReadString(g_server);
  1533. fp.Close();
  1534. if (OnConnectIP())
  1535. {
  1536. // g_serverip=g_server;
  1537. return 1;
  1538. }
  1539. g_server = strServerAddress;
  1540. OnDisconnect();//MessageBox("ip失败");
  1541. }
  1542. g_conntype = 1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1543. strServerAddress = "lijiafz.vicp.net";
  1544. MyGetIPByName2(strServerAddress);
  1545. if (strServerAddress.IsEmpty())
  1546. {
  1547. return 0;//OnConnect2();
  1548. }
  1549. }
  1550. else if (g_ntimeout == 29000)//非远程 30000
  1551. {
  1552. strServerAddress = g_serverarray.ElementAt(g_conpos);
  1553. }
  1554. // 4.如果没有IP.txt或dbconfig.dat里的不是ly.com信息,而是一般的计算机名称;
  1555. char *szServerAddress = strServerAddress.GetBuffer(0);
  1556. strServerAddress.ReleaseBuffer();
  1557. // AfxMessageBox("连接:"+strServerAddress);
  1558. /*for Client, IP and Port can be 0,
  1559. and for Server, IP is LocalIP, and Port is Listening Port*/
  1560. // 5.创建通信对象连接;
  1561. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1562. 0,
  1563. HandleClientNetEvent,
  1564. this);
  1565. if (TRANSPORT_OK != nResult)
  1566. {
  1567. return 0;
  1568. }
  1569. GetSysIniInfo();
  1570. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1571. DWORD wPort = g_dwCSPort;
  1572. if (g_conntype) wPort = GetPort();
  1573. // 6.连接公司服务器或影楼服务器;
  1574. #ifdef VC60
  1575. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1576. if (TRANSPORT_OK != nResult)
  1577. #else
  1578. nResult = m_tClientTunnel.net_Connect(szServerAddress,wPort);
  1579. if (!nResult)
  1580. #endif
  1581. {
  1582. m_tClientTunnel.net_CloseSocket();
  1583. if (g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1584. {
  1585. return 0;//OnConnect2();
  1586. }
  1587. if (g_serverarray.GetSize() > 1)
  1588. {
  1589. if (g_conpos < (g_serverarray.GetSize() - 1))
  1590. {
  1591. g_conpos++;
  1592. return OnConnect();
  1593. }
  1594. else
  1595. {
  1596. g_conpos = 0;
  1597. return 0;
  1598. }
  1599. }
  1600. return 0;
  1601. }
  1602. return ProcessLoginRequest();
  1603. }
  1604. BOOL CMainFrame::OnConnect2()
  1605. {
  1606. g_conntype = 2;
  1607. CString server = "http://www.lyfz.net/download/ip.txt";
  1608. char buf[MAX_PATH];
  1609. ::GetTempPath(sizeof(buf), buf);
  1610. CString m_strTempDir = buf;
  1611. DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1612. INTERNET_PORT m_dwPort;
  1613. DWORD dwType;
  1614. CInternetSession m_cis;
  1615. CHttpConnection *m_pHttp;
  1616. CString m_strServer;
  1617. CString m_strIniPath;
  1618. AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
  1619. if (dwType != AFX_INET_SERVICE_HTTP)
  1620. {
  1621. return 0;//OnConnect3();
  1622. }
  1623. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
  1624. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1625. try
  1626. {
  1627. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1628. }
  1629. catch (CInternetException* pEx)
  1630. {
  1631. return 0;//OnConnect3();
  1632. }
  1633. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1634. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1635. try
  1636. {
  1637. pFile->SendRequest();
  1638. }
  1639. catch (CInternetException* pEx)
  1640. {
  1641. pFile->Close();
  1642. return 0;//OnConnect3();
  1643. }
  1644. if (pFile)
  1645. {
  1646. CStdioFile csf;
  1647. csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
  1648. char buf[2048];
  1649. int n;
  1650. while ((n = pFile->Read(buf, 2048)) > 0)
  1651. csf.Write(buf, n);
  1652. csf.Close();
  1653. pFile->Close();
  1654. }
  1655. CString strServerAddress;
  1656. CStdioFile fp;
  1657. fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
  1658. fp.ReadString(strServerAddress);
  1659. fp.Close();
  1660. char *szServerAddress = strServerAddress.GetBuffer(0);
  1661. strServerAddress.ReleaseBuffer();
  1662. /*for Client, IP and Port can be 0,
  1663. and for Server, IP is LocalIP, and Port is Listening Port*/
  1664. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1665. 0,
  1666. HandleClientNetEvent,
  1667. this);
  1668. if (TRANSPORT_OK != nResult)
  1669. {
  1670. return 0;
  1671. }
  1672. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1673. DWORD wPort = SERVER_PORT; // 5678
  1674. if (g_conntype)wPort = GetPort();
  1675. #ifdef VC60
  1676. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1677. if (TRANSPORT_OK != nResult)
  1678. #else
  1679. nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
  1680. if (!nResult)
  1681. #endif
  1682. {
  1683. m_tClientTunnel.net_CloseSocket();
  1684. return 0;//OnConnect3();
  1685. }
  1686. return ProcessLoginRequest();
  1687. }
  1688. BOOL CMainFrame::OnConnect3()
  1689. {
  1690. g_conntype = 3;
  1691. CString server = "http://photo.bjlyfz.com/download/ip.txt";
  1692. char buf[MAX_PATH];
  1693. ::GetTempPath(sizeof(buf), buf);
  1694. CString m_strTempDir = buf;
  1695. DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1696. INTERNET_PORT m_dwPort;
  1697. DWORD dwType;
  1698. CInternetSession m_cis;
  1699. CHttpConnection *m_pHttp;
  1700. CString m_strServer;
  1701. CString m_strIniPath;
  1702. AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
  1703. if (dwType != AFX_INET_SERVICE_HTTP)
  1704. {
  1705. return FALSE;
  1706. }
  1707. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
  1708. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1709. try
  1710. {
  1711. m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
  1712. }
  1713. catch (CInternetException* pEx)
  1714. {
  1715. return false;
  1716. }
  1717. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1718. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1719. try
  1720. {
  1721. pFile->SendRequest();
  1722. }
  1723. catch (CInternetException* pEx)
  1724. {
  1725. pFile->Close();
  1726. return false;
  1727. }
  1728. if (pFile)
  1729. {
  1730. CStdioFile csf;
  1731. csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
  1732. char buf[2048];
  1733. int n;
  1734. while ((n = pFile->Read(buf, 2048)) > 0)
  1735. csf.Write(buf, n);
  1736. csf.Close();
  1737. pFile->Close();
  1738. }
  1739. CString strServerAddress;
  1740. CStdioFile fp;
  1741. fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
  1742. fp.ReadString(strServerAddress);
  1743. fp.Close();
  1744. char *szServerAddress = strServerAddress.GetBuffer(0);
  1745. strServerAddress.ReleaseBuffer();
  1746. /*for Client, IP and Port can be 0,
  1747. and for Server, IP is LocalIP, and Port is Listening Port*/
  1748. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1749. 0,
  1750. HandleClientNetEvent,
  1751. this);
  1752. if (TRANSPORT_OK != nResult)
  1753. {
  1754. return 0;
  1755. }
  1756. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1757. DWORD wPort = SERVER_PORT; // 5678
  1758. if (g_conntype)wPort = GetPort();
  1759. #ifdef VC60
  1760. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1761. if (TRANSPORT_OK != nResult)
  1762. #else
  1763. nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
  1764. if (!nResult)
  1765. #endif
  1766. {
  1767. m_tClientTunnel.net_CloseSocket();
  1768. return 0;
  1769. }
  1770. return ProcessLoginRequest();
  1771. }
  1772. void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
  1773. {
  1774. //printf("Jeff:ProcessNetEvent\n\n");//Jeff Printf;
  1775. if (Transport_ReadEv == nEventType)
  1776. {
  1777. if (NULL == pRecvMsg) return;
  1778. TMessageHeader* pHeader = (TMessageHeader *)pRecvMsg;
  1779. char *pDataBuf = (char *)pRecvMsg + MESSAGE_HEADER_LEN;
  1780. WORD dwMessageID = pHeader->wMessageId;
  1781. switch (dwMessageID)
  1782. {
  1783. case MSG_LOGIN_RESP:
  1784. case (MSG_LOGIN_RESP + 0X2FFF) :
  1785. {
  1786. LOGIN_RESULT_STRU tLoginResult = { 0 };
  1787. memcpy(&tLoginResult, pDataBuf, sizeof(LOGIN_RESULT_STRU));
  1788. ProcessLoginResponse(&tLoginResult);
  1789. break;
  1790. }
  1791. case MSG_USERINFO_RESP:
  1792. {
  1793. break;
  1794. }
  1795. case MSG_LOGOUT_RESP:
  1796. {
  1797. break;
  1798. }
  1799. case MSG_CHATMESSAGE_RESP:
  1800. case (MSG_CHATMESSAGE_RESP + 0X4FFF) :
  1801. {
  1802. static int i = 0;
  1803. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pDataBuf;
  1804. ProcessChatMessageResponse((void *)pChatMessage);
  1805. break;
  1806. }
  1807. default:
  1808. {
  1809. break;
  1810. }
  1811. }
  1812. }
  1813. else if (Transport_CloseEv == nEventType)
  1814. {
  1815. OnDisconnect();
  1816. }
  1817. }
  1818. //extern BOOL g_bNeedCoon;
  1819. extern BOOL EncryptFile2(BYTE *buffer, DWORD leng, PCHAR szPassword);
  1820. void CMainFrame::OnTimer(UINT nIDEvent)
  1821. {
  1822. // TODO: Add your message handler code here and/or call default
  1823. if (1 == nIDEvent)
  1824. {
  1825. KillTimer(nIDEvent);
  1826. BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status", 0);//status:此机用选片菜单项
  1827. // checked==1:此机用选片菜单项
  1828. // g_bStaffAchievementShow==1:此机用于员工业绩查看
  1829. if (checked && g_bStaffAchievementShow == 0) // .此机用选片菜单项;
  1830. {
  1831. KillTimer(3);
  1832. #ifdef NEW_SKIN
  1833. Welcome weldlg;
  1834. weldlg.DoModal();
  1835. #endif
  1836. ChoosePhotoSkin dlg;
  1837. dlg.SetLiaPath("1.lia");
  1838. if (dlg.DoModal() != IDOK)
  1839. {
  1840. PostMessage(WM_QUIT);
  1841. return;
  1842. }
  1843. if (dlg.m_exitcode == 3)
  1844. {
  1845. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  1846. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  1847. }
  1848. else
  1849. {
  1850. ShowWindow(SW_SHOW);
  1851. #ifdef NEW_SKIN
  1852. if (m_pMainFrimDlg2 == NULL)
  1853. {
  1854. m_pMainFrimDlg2 = new MainFrimDlg2;
  1855. m_pMainFrimDlg2->SetLiaPath("10.lia");
  1856. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  1857. }
  1858. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1859. #endif
  1860. }
  1861. }
  1862. else if (g_bStaffAchievementShow == 0) // .非选片、非查看员工业绩;
  1863. {
  1864. #ifdef NEW_SKIN
  1865. g_bNoConnDlg = 1;
  1866. Welcome weldlg;
  1867. weldlg.DoModal();
  1868. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1869. ShowWindow(SW_SHOW);
  1870. g_bNoConnDlg = 0;
  1871. if (g_bNoLoginLia) // Jeff.OnCreate里判断skin文件有5.lia, g_bNoLoginLia = 0, 无 g_bNoLoginLia = 1;
  1872. {
  1873. Login dlg;
  1874. dlg.SetLiaPath("5.lia");
  1875. dlg.DoModal();
  1876. }
  1877. else
  1878. {
  1879. Login3 dlg;
  1880. dlg.SetLiaPath("5.lia"); // Login3的父类为MyDlg,在BOOL MyDlg::OnInitDialog()里调用了纯虚函数Init();
  1881. dlg.DoModal();
  1882. }
  1883. if (g_user.bLongin && g_pMainWnd2)
  1884. {
  1885. g_pMainWnd2->ShowBar(TRUE,TRUE);
  1886. InsideMsg();
  1887. }
  1888. #else
  1889. ShowWindow(SW_SHOW);
  1890. if (g_bNoLoginLia)
  1891. {
  1892. Login dlg;
  1893. dlg.SetLiaPath ("5.lia");
  1894. dlg.DoModal();
  1895. }
  1896. else
  1897. {
  1898. Login3 dlg;
  1899. dlg.SetLiaPath ("5.lia");
  1900. dlg.DoModal();
  1901. }
  1902. #endif
  1903. }
  1904. if (g_hmouse == NULL)
  1905. {
  1906. g_hmouse = SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId());
  1907. }
  1908. }
  1909. else if (2 == nIDEvent) //29秒后,若连接和发送未完成,将关闭连接和发送框;
  1910. {
  1911. KillTimer(2);
  1912. if (g_hConnectWnd)
  1913. ::PostMessage(g_hConnectWnd, WM_CLOSE, 0, 0);
  1914. if (g_hSendWnd)
  1915. ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);
  1916. if (g_bStaffAchievementShow == 0 && g_bConnLYFZ == 0)
  1917. {
  1918. if (g_bGenBranchData == 0)
  1919. {
  1920. if (g_branchip != "")
  1921. AfxMessageBox("连接分店:" + g_branchname + "失败!", MB_ICONINFORMATION);
  1922. else
  1923. AfxMessageBox("连接服务器失败!", MB_ICONINFORMATION);
  1924. }
  1925. OnDisconnect();
  1926. }
  1927. g_bSendOK = 0;
  1928. g_bNeedCoon = 1;
  1929. }
  1930. else if (3 == nIDEvent)
  1931. {
  1932. KillTimer(3);
  1933. #ifdef NEW_SKIN
  1934. Welcome weldlg;
  1935. weldlg.DoModal();
  1936. #endif
  1937. ShowWindow(SW_SHOW);
  1938. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1939. g_sendhead.bsql = 0;
  1940. g_sendhead.code[0] = 24;
  1941. g_sendhead.code[1] = 1;
  1942. g_sendhead.tabcount = 2;
  1943. g_pMainWnd->ProcessChatMessageRequest2(1);
  1944. if (g_bSendOK == 0)
  1945. {
  1946. return;
  1947. }
  1948. CArray<CStringArray, CStringArray>patharray;
  1949. CArray<CStringArray, CStringArray>userarray;
  1950. DataToArray(&g_cominfoarray, &g_hisyeararray);
  1951. g_userarray.SetSize(userarray.GetSize(), 1);
  1952. int count = 0;
  1953. for (int ii = 0; ii < userarray.GetSize(); ii++)
  1954. {
  1955. if (userarray.ElementAt(ii).ElementAt(10) == "在职")
  1956. g_userarray.ElementAt(count++).Copy(userarray.ElementAt(ii));
  1957. }
  1958. g_userarray.SetSize(count, 1);
  1959. StaffAchievementShowAll dlg;
  1960. g_pMainWnd->GetOcx();
  1961. dlg.DoModal();
  1962. }
  1963. else if (5 == nIDEvent)
  1964. {
  1965. if (g_bInSkin)
  1966. {
  1967. OutputDebugString("使用皮肤\n");
  1968. return;
  1969. }
  1970. if (g_nAutoShowStaffAchievement == 1){
  1971. OutputDebugString("用于选片\n");
  1972. return;
  1973. }
  1974. if (g_bAllBranch){
  1975. OutputDebugString("多店汇总当中\n");
  1976. return;
  1977. }
  1978. if (g_user.bLongin)
  1979. {
  1980. // m_Mdi.CloseAll();
  1981. g_pMainWnd->OnCommandMenu(IDM_Logout);
  1982. }
  1983. /* g_nAutoShowStaffAchievement=1;
  1984. KillTimer(5);
  1985. StaffAchievementShowAll dlg;
  1986. g_pMainWnd->GetOcx();
  1987. dlg.DoModal ();*/
  1988. }
  1989. else if (6 == nIDEvent)
  1990. {
  1991. static BOOL bDouble = 0;
  1992. bDouble = !bDouble;
  1993. if (bDouble)
  1994. g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
  1995. else
  1996. g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
  1997. }
  1998. else if (7 == nIDEvent)
  1999. {
  2000. // Jeff,当g_bSendLYFZ==TRUE时;
  2001. // 向lijiafz.vicp.net发送影楼信息,防止有盗版用户;
  2002. KillTimer(7);
  2003. if (g_bInSkin)return;
  2004. if (g_nAutoShowStaffAchievement == 1)return;
  2005. if (g_bAllBranch)return;
  2006. CString str = g_sInfo;
  2007. g_bConnLYFZ = 1; // Jeff指示连接的服务器为lijiafz.vicp.net
  2008. // 断开当前连接;
  2009. OnDisconnect();
  2010. BYTE *pData = new BYTE[str.GetLength()];
  2011. memcpy(pData, str.GetBuffer(0), str.GetLength());
  2012. str.ReleaseBuffer();
  2013. EncryptFile2(pData, str.GetLength(), "888666333");
  2014. g_nSendCode = 16;
  2015. g_pMainWnd->ProcessChatMessageRequest2(pData, str.GetLength());
  2016. g_nSendCode = 0;
  2017. delete[]pData;
  2018. OnDisconnect();
  2019. g_bSendLYFZ = 0;
  2020. g_bConnLYFZ = 0;
  2021. if (g_bSendOK)
  2022. {
  2023. char *pStr = new char[g_nLeng + 1];
  2024. memset(pStr, 0, g_nLeng + 1);
  2025. memcpy(pStr, g_pData, g_nLeng);
  2026. CString str = pStr;
  2027. delete[]pStr;
  2028. if (str == "g_bInSkin")
  2029. {
  2030. g_sendhead.bsql = 1;
  2031. g_pMainWnd->ProcessChatMessageRequest2("update version set [setcheck1]='ok'");
  2032. }
  2033. }
  2034. }
  2035. }
  2036. void CMainFrame::OnOutbarNotify(CString strMsg)
  2037. {
  2038. if (g_user.bLongin == 0)
  2039. {
  2040. if (g_bNoLoginLia)
  2041. {
  2042. Login dlg;
  2043. dlg.SetLiaPath("5.lia");
  2044. dlg.DoModal();
  2045. }
  2046. else
  2047. {
  2048. Login3 dlg;
  2049. dlg.SetLiaPath("5.lia");
  2050. dlg.DoModal();
  2051. }
  2052. return;
  2053. if (g_user.bLongin == 0)return;
  2054. }
  2055. else
  2056. {
  2057. InsideMsg();
  2058. }
  2059. ResetTimer();
  2060. if (strMsg == "开单")
  2061. {
  2062. if (IsHasRights(0) == 0)return;
  2063. Booking2 dlg;
  2064. dlg.DoModal();
  2065. return;
  2066. }
  2067. else if (strMsg == "拍照")
  2068. {
  2069. if (IsHasRights(1) == 0)return;
  2070. UINT nID = 1;
  2071. LPSTR pName;
  2072. pName = (LPSTR)(LPCSTR)"拍照";
  2073. OPEN_MENU(TakeFrom);
  2074. return;
  2075. }
  2076. else if (strMsg == "修片")
  2077. {
  2078. if (IsHasRights(1) == 0)return;
  2079. UINT nID = 1;
  2080. LPSTR pName;
  2081. pName = (LPSTR)(LPCSTR)"修片";
  2082. OPEN_MENU(BeautifySkinFrom);
  2083. return;
  2084. }
  2085. else if (strMsg == "选片")
  2086. {
  2087. if (IsHasRights(2) == 0)return;
  2088. UINT nID = 1;
  2089. LPSTR pName;
  2090. pName = (LPSTR)(LPCSTR)"选片";
  2091. OPEN_MENU(ChoosePhotoForm);
  2092. return;
  2093. }
  2094. else if (strMsg == "精修")
  2095. {
  2096. if (IsHasRights(2) == 0)return;
  2097. UINT nID = 1;
  2098. LPSTR pName;
  2099. pName = (LPSTR)(LPCSTR)"精修";
  2100. OPEN_MENU(BeautifySkinFrom2);
  2101. return;
  2102. }
  2103. else if (strMsg == "设计")
  2104. {
  2105. if (IsHasRights(2) == 0)return;
  2106. UINT nID = 1;
  2107. LPSTR pName;
  2108. pName = (LPSTR)(LPCSTR)"设计";
  2109. OPEN_MENU(DesignFrom);
  2110. return;
  2111. }
  2112. else if (strMsg == "数码安排")
  2113. {
  2114. UINT nID = 1;
  2115. LPSTR pName;
  2116. pName = (LPSTR)(LPCSTR)"数码安排";
  2117. OPEN_MENU(DigitalWork);
  2118. return;
  2119. }
  2120. else if (strMsg == "刻盘")
  2121. {
  2122. UINT nID = 1;
  2123. LPSTR pName;
  2124. pName = (LPSTR)(LPCSTR)"刻盘";
  2125. OPEN_MENU(BurnCD);
  2126. return;
  2127. }
  2128. else if (strMsg == "相片冲印")
  2129. {
  2130. UINT nID = 1;
  2131. LPSTR pName;
  2132. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  2133. OPEN_MENU(PhotoPrintFrom);
  2134. return;
  2135. }
  2136. else if (strMsg == "发片/取件")
  2137. {
  2138. if (IsHasRights(3) == 0)return;
  2139. UINT nID = 1;
  2140. LPSTR pName;
  2141. pName = (LPSTR)(LPCSTR)"发片/取件";
  2142. OPEN_MENU(outsourcing);
  2143. return;
  2144. }
  2145. else if (strMsg == "满意度")
  2146. {
  2147. UINT nID = 1;
  2148. LPSTR pName;
  2149. pName = (LPSTR)(LPCSTR)"满意度";
  2150. OPEN_MENU(Satisfaction);
  2151. return;
  2152. }
  2153. else if (strMsg == "满意度汇总")
  2154. {
  2155. UINT nID = 1;
  2156. LPSTR pName;
  2157. pName = (LPSTR)(LPCSTR)"满意度汇总";
  2158. OPEN_MENU(SatisfactionReportForm);
  2159. return;
  2160. }
  2161. #if JEFF_DELETE_ON // 2014.11.14-PM 16:20
  2162. else if (strMsg == "回复统计")
  2163. {
  2164. UINT nID = 1;
  2165. LPSTR pName;
  2166. pName = (LPSTR)(LPCSTR)"回复统计";
  2167. OPEN_MENU(MsgReg2);
  2168. return;
  2169. }
  2170. #endif
  2171. /* else if(strMsg=="取件")
  2172. {
  2173. if(IsHasRights(3)==0)return;
  2174. UINT nID=1;
  2175. LPSTR pName ;
  2176. pName = (LPSTR)(LPCSTR)"取件";
  2177. OPEN_MENU(TakeAwayFrom);
  2178. return;
  2179. }*/
  2180. else if (strMsg == "其它收入")
  2181. {
  2182. if (IsHasRightsnew(16) == 0)return;
  2183. // if(IsHasRightsnew(48)==0)return;
  2184. UINT nID = 1;
  2185. LPSTR pName;
  2186. pName = (LPSTR)(LPCSTR)"其它收入";
  2187. OPEN_MENU(IncomeInput);
  2188. return;
  2189. }
  2190. else if (strMsg == "其它二销")
  2191. {
  2192. if (IsHasRightsnew(16) == 0)return;
  2193. UINT nID = 1;
  2194. LPSTR pName;
  2195. pName = (LPSTR)(LPCSTR)"其它二销";
  2196. OPEN_MENU(IncomeInput2);
  2197. return;
  2198. }
  2199. else if (strMsg == "员工奖罚")
  2200. {
  2201. if (IsHasRightsnew(16) == 0)return;
  2202. UINT nID = 1;
  2203. LPSTR pName;
  2204. pName = (LPSTR)(LPCSTR)"员工奖罚";
  2205. OPEN_MENU(IncomeInput3);
  2206. return;
  2207. }
  2208. else if (strMsg == "员工奖惩")
  2209. {
  2210. if (IsHasRightsnew(16) == 0)return;
  2211. UINT nID = 1;
  2212. LPSTR pName;
  2213. pName = (LPSTR)(LPCSTR)"员工奖惩";
  2214. OPEN_MENU(IncomeInput4);
  2215. return;
  2216. }
  2217. else if (strMsg == "订单收款")
  2218. {
  2219. if (IsHasRights(17) == 0)return;
  2220. UINT nID = 1;
  2221. LPSTR pName;
  2222. pName = (LPSTR)(LPCSTR)"订单收款";
  2223. OPEN_MENU(FinanceForm);
  2224. return;
  2225. }
  2226. else if (strMsg == "日财务表")
  2227. {
  2228. if (IsHasRightsnew(22) == 0)return;
  2229. UINT nID = 2;
  2230. LPSTR pName;
  2231. pName = (LPSTR)(LPCSTR)"日财务表";
  2232. OPEN_MENU(DailyForm);
  2233. return;
  2234. }
  2235. else if (strMsg == "提成比例")
  2236. {
  2237. #ifndef ENTERPRISE_VERSION
  2238. #ifndef CHILD_VERSION
  2239. #ifdef BASIC_VERSION
  2240. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2241. {
  2242. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2243. exit(0);return;
  2244. }
  2245. #else
  2246. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2247. {
  2248. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2249. exit(0);return;
  2250. }
  2251. #endif
  2252. #else
  2253. #ifdef BASIC_VERSION
  2254. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2255. {
  2256. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2257. exit(0);return;
  2258. }
  2259. #else
  2260. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2261. {
  2262. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2263. exit(0); return;
  2264. }
  2265. #endif
  2266. #endif
  2267. #else
  2268. #ifndef CHILD_VERSION
  2269. #ifdef BASIC_VERSION
  2270. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2271. {
  2272. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2273. exit(0); return;
  2274. }
  2275. #else
  2276. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2277. {
  2278. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2279. exit(0); return;
  2280. }
  2281. #endif
  2282. #else
  2283. #ifdef BASIC_VERSION
  2284. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2285. {
  2286. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2287. exit(0);return;
  2288. }
  2289. #else
  2290. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2291. {
  2292. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2293. exit(0); return;
  2294. }
  2295. #endif
  2296. #endif
  2297. #endif
  2298. UINT nID = 2;
  2299. LPSTR pName;
  2300. pName = (LPSTR)(LPCSTR)"提成比例";
  2301. OPEN_MENU(SalarySet2);
  2302. return;
  2303. }
  2304. //else if(strMsg=="员工工作")
  2305. else if (strMsg == "计件提成")
  2306. {
  2307. UINT nID = 2;
  2308. LPSTR pName;
  2309. //pName = (LPSTR)(LPCSTR)"员工工作";
  2310. pName = (LPSTR)(LPCSTR)"计件提成";
  2311. OPEN_MENU(SalarySet3);
  2312. return;
  2313. }
  2314. else if (strMsg == "工资管理")
  2315. {
  2316. #ifndef ENTERPRISE_VERSION
  2317. #ifndef CHILD_VERSION
  2318. #ifdef BASIC_VERSION
  2319. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2320. {
  2321. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2322. exit(0);return;
  2323. }
  2324. #else
  2325. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2326. {
  2327. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2328. exit(0);return;
  2329. }
  2330. #endif
  2331. #else
  2332. #ifdef BASIC_VERSION
  2333. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2334. {
  2335. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2336. exit(0);return;
  2337. }
  2338. #else
  2339. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2340. {
  2341. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2342. exit(0); return;
  2343. }
  2344. #endif
  2345. #endif
  2346. #else
  2347. #ifndef CHILD_VERSION
  2348. #ifdef BASIC_VERSION
  2349. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2350. {
  2351. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2352. exit(0); return;
  2353. }
  2354. #else
  2355. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2356. {
  2357. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2358. exit(0); return;
  2359. }
  2360. #endif
  2361. #else
  2362. #ifdef BASIC_VERSION
  2363. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2364. {
  2365. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2366. exit(0);return;
  2367. }
  2368. #else
  2369. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2370. {
  2371. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2372. exit(0); return;
  2373. }
  2374. #endif
  2375. #endif
  2376. #endif
  2377. UINT nID = 2;
  2378. LPSTR pName;
  2379. pName = (LPSTR)(LPCSTR)"工资管理";
  2380. OPEN_MENU(MySalary);
  2381. return;
  2382. }
  2383. else if (strMsg == "客人付款")
  2384. {
  2385. UINT nID = 2;
  2386. LPSTR pName;
  2387. pName = (LPSTR)(LPCSTR)"客人付款";
  2388. OPEN_MENU(ClientMoney);
  2389. return;
  2390. }
  2391. else if (strMsg == "工资报表")
  2392. {
  2393. #ifndef ENTERPRISE_VERSION
  2394. #ifndef CHILD_VERSION
  2395. #ifdef BASIC_VERSION
  2396. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2397. {
  2398. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2399. exit(0);return;
  2400. }
  2401. #else
  2402. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2403. {
  2404. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2405. exit(0);return;
  2406. }
  2407. #endif
  2408. #else
  2409. #ifdef BASIC_VERSION
  2410. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2411. {
  2412. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2413. exit(0);return;
  2414. }
  2415. #else
  2416. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2417. {
  2418. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2419. exit(0); return;
  2420. }
  2421. #endif
  2422. #endif
  2423. #else
  2424. #ifndef CHILD_VERSION
  2425. #ifdef BASIC_VERSION
  2426. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2427. {
  2428. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2429. exit(0); return;
  2430. }
  2431. #else
  2432. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2433. {
  2434. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2435. exit(0); return;
  2436. }
  2437. #endif
  2438. #else
  2439. #ifdef BASIC_VERSION
  2440. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2441. {
  2442. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2443. exit(0);return;
  2444. }
  2445. #else
  2446. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2447. {
  2448. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2449. exit(0); return;
  2450. }
  2451. #endif
  2452. #endif
  2453. #endif
  2454. if (IsHasRightsnew(25) == 0)return;
  2455. UINT nID = 2;
  2456. LPSTR pName;
  2457. pName = (LPSTR)(LPCSTR)"工资报表";
  2458. g_ncount = 100;
  2459. OPEN_MENU(MySalary);
  2460. return;
  2461. }
  2462. else if (strMsg == "员工业绩")
  2463. {
  2464. #ifndef ENTERPRISE_VERSION
  2465. #ifndef CHILD_VERSION
  2466. #ifdef BASIC_VERSION
  2467. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2468. {
  2469. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2470. exit(0);return;
  2471. }
  2472. #else
  2473. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2474. {
  2475. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2476. exit(0);return;
  2477. }
  2478. #endif
  2479. #else
  2480. #ifdef BASIC_VERSION
  2481. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2482. {
  2483. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2484. exit(0);return;
  2485. }
  2486. #else
  2487. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2488. {
  2489. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2490. exit(0); return;
  2491. }
  2492. #endif
  2493. #endif
  2494. #else
  2495. #ifndef CHILD_VERSION
  2496. #ifdef BASIC_VERSION
  2497. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2498. {
  2499. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2500. exit(0); return;
  2501. }
  2502. #else
  2503. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2504. {
  2505. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2506. exit(0); return;
  2507. }
  2508. #endif
  2509. #else
  2510. #ifdef BASIC_VERSION
  2511. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2512. {
  2513. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2514. exit(0);return;
  2515. }
  2516. #else
  2517. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2518. {
  2519. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2520. exit(0); return;
  2521. }
  2522. #endif
  2523. #endif
  2524. #endif
  2525. if (IsHasRightsnew(33) == 0)return;
  2526. UINT nID = 2;
  2527. LPSTR pName;
  2528. pName = (LPSTR)(LPCSTR)"员工业绩";
  2529. OPEN_MENU(StaffAchievement);
  2530. return;
  2531. }
  2532. else if (strMsg == "订单客户")
  2533. {
  2534. UINT nID = 2;
  2535. LPSTR pName;
  2536. pName = (LPSTR)(LPCSTR)"订单客户";
  2537. g_dx += 10000;
  2538. OPEN_MENU(CClientForm);
  2539. if (g_dx >= 10000)g_dx -= 10000;
  2540. return;
  2541. }
  2542. else if (strMsg == "意向客户")
  2543. {
  2544. UINT nID = 2;
  2545. LPSTR pName;
  2546. pName = (LPSTR)(LPCSTR)"意向客户";
  2547. OPEN_MENU(Client2Form);
  2548. return;
  2549. }
  2550. else if (strMsg == "老客户")
  2551. {
  2552. UINT nID = 2;
  2553. LPSTR pName;
  2554. pName = (LPSTR)(LPCSTR)"老客户";
  2555. OPEN_MENU(OldClient);
  2556. return;
  2557. }
  2558. else if (strMsg == "客户来电")
  2559. {
  2560. UINT nID = 2;
  2561. LPSTR pName;
  2562. pName = (LPSTR)(LPCSTR)"客户来电";
  2563. OPEN_MENU(PhoneRecord);
  2564. return;
  2565. }
  2566. else if (strMsg == "拨出电话")
  2567. {
  2568. UINT nID = 2;
  2569. LPSTR pName;
  2570. pName = (LPSTR)(LPCSTR)"拨出电话";
  2571. OPEN_MENU(PhoneRecordOut);
  2572. return;
  2573. }
  2574. else if (strMsg == "未接来电")
  2575. {
  2576. UINT nID = 2;
  2577. LPSTR pName;
  2578. pName = (LPSTR)(LPCSTR)"未接来电";
  2579. OPEN_MENU(MissCall);
  2580. return;
  2581. }
  2582. else if (strMsg == "客户流失")
  2583. {
  2584. UINT nID = 2;
  2585. LPSTR pName;
  2586. pName = (LPSTR)(LPCSTR)"客户流失";
  2587. OPEN_MENU(ClientReasonChart);
  2588. return;
  2589. }
  2590. else if (strMsg == "客户来源")
  2591. {
  2592. UINT nID = 2;
  2593. LPSTR pName;
  2594. pName = (LPSTR)(LPCSTR)"客户来源";
  2595. OPEN_MENU(ClientFromChart);
  2596. return;
  2597. }
  2598. else if (strMsg == "月财务表")
  2599. {
  2600. if (IsHasRightsnew(23) == 0)return;
  2601. UINT nID = 2;
  2602. LPSTR pName;
  2603. pName = (LPSTR)(LPCSTR)"月财务表";
  2604. OPEN_MENU(MonthForm);
  2605. return;
  2606. }
  2607. else if (strMsg == "支出报表")
  2608. {
  2609. if (IsHasRightsnew(23) == 0)return;
  2610. UINT nID = 2;
  2611. LPSTR pName;
  2612. pName = (LPSTR)(LPCSTR)"支出报表";
  2613. OPEN_MENU(MonthForm2);
  2614. return;
  2615. }
  2616. else if (strMsg == "年财务表")
  2617. {
  2618. if (IsHasRightsnew(24) == 0)return;
  2619. UINT nID = 2;
  2620. LPSTR pName;
  2621. pName = (LPSTR)(LPCSTR)"年财务表";
  2622. OPEN_MENU(YearForm);
  2623. return;
  2624. }
  2625. else if (strMsg == "年财务图表")
  2626. {
  2627. if (IsHasRightsnew(24) == 0)return;
  2628. GetOcx();
  2629. UINT nID = 2;
  2630. LPSTR pName;
  2631. pName = (LPSTR)(LPCSTR)"年财务图表";
  2632. OPEN_MENU(YearForm2);
  2633. return;
  2634. }
  2635. else if (strMsg == "订单图表")
  2636. {
  2637. GetOcx();
  2638. UINT nID = 2;
  2639. LPSTR pName;
  2640. pName = (LPSTR)(LPCSTR)"订单图表";
  2641. OPEN_MENU(DinDanForm);
  2642. return;
  2643. }
  2644. #ifdef ENTERPRISE_VERSION
  2645. else if (strMsg == "订单报表")
  2646. {
  2647. GetOcx();
  2648. UINT nID = 2;
  2649. LPSTR pName;
  2650. pName = (LPSTR)(LPCSTR)"订单报表2";
  2651. OPEN_MENU(DinDanFromBranch);
  2652. return;
  2653. }
  2654. else if (strMsg == "财务图表")
  2655. {
  2656. GetOcx();
  2657. UINT nID = 2;
  2658. LPSTR pName;
  2659. pName = (LPSTR)(LPCSTR)"财务图表";
  2660. OPEN_MENU(YearFormBranch);
  2661. return;
  2662. }
  2663. else if (strMsg == "订单图表")
  2664. {
  2665. GetOcx();
  2666. UINT nID = 2;
  2667. LPSTR pName;
  2668. pName = (LPSTR)(LPCSTR)"订单图表";
  2669. OPEN_MENU(YearFormBranch2);
  2670. return;
  2671. }
  2672. else if (strMsg == "摄控安排")
  2673. {
  2674. UINT nID = 2;
  2675. LPSTR pName;
  2676. pName = (LPSTR)(LPCSTR)"摄控安排";
  2677. g_bookingtype = 0;
  2678. OPEN_MENU(TodayForm);
  2679. return;
  2680. }
  2681. else if (strMsg == "选片预约")
  2682. {
  2683. UINT nID = 2;
  2684. LPSTR pName;
  2685. pName = (LPSTR)(LPCSTR)"选片预约";
  2686. g_bookingtype = 1;
  2687. OPEN_MENU(TodayForm);
  2688. return;
  2689. }
  2690. else if (strMsg == "看样预约")
  2691. {
  2692. UINT nID = 2;
  2693. LPSTR pName;
  2694. pName = (LPSTR)(LPCSTR)"看样预约";
  2695. g_bookingtype = 2;
  2696. OPEN_MENU(TodayForm);
  2697. return;
  2698. }
  2699. else if (strMsg == "取件预约")
  2700. {
  2701. UINT nID = 2;
  2702. LPSTR pName;
  2703. pName = (LPSTR)(LPCSTR)"取件预约";
  2704. g_bookingtype = 3;
  2705. OPEN_MENU(TodayForm);
  2706. return;
  2707. }
  2708. else if (strMsg == "婚庆安排")
  2709. {
  2710. UINT nID = 2;
  2711. LPSTR pName;
  2712. pName = (LPSTR)(LPCSTR)"婚庆安排";
  2713. g_bookingtype = 4;
  2714. OPEN_MENU(TodayForm);
  2715. return;
  2716. }
  2717. #endif
  2718. else if (strMsg == "员工资料")
  2719. {
  2720. UINT nID = 2;
  2721. LPSTR pName;
  2722. pName = (LPSTR)(LPCSTR)"员工资料";
  2723. if (g_bAllBranch)
  2724. OPEN_MENU(EmployeeForm2);
  2725. else
  2726. OPEN_MENU(EmployeeForm);
  2727. return;
  2728. }
  2729. else if (strMsg == "客户区域")
  2730. {
  2731. // if(IsHasRightsnew(48)==0)return;
  2732. GetOcx();
  2733. UINT nID = 2;
  2734. LPSTR pName;
  2735. pName = (LPSTR)(LPCSTR)"客户区域";
  2736. OPEN_MENU(AreaClient);
  2737. return;
  2738. }
  2739. else if (strMsg == "客户报表")
  2740. {
  2741. UINT nID = 3;
  2742. LPSTR pName;
  2743. pName = (LPSTR)(LPCSTR)"客户报表";
  2744. OPEN_MENU(CClientForm);
  2745. return;
  2746. }
  2747. else if (strMsg == "现金支出")
  2748. {
  2749. if (IsHasRightsnew(16) == 0)return;
  2750. UINT nID = 3;
  2751. LPSTR pName;
  2752. pName = (LPSTR)(LPCSTR)"现金支出";
  2753. OPEN_MENU(PayOutInput);
  2754. return;
  2755. }
  2756. else if (strMsg == "短信群发")
  2757. {
  2758. UINT nID = 3;
  2759. LPSTR pName;
  2760. pName = (LPSTR)(LPCSTR)"短信群发";
  2761. OPEN_MENU(SendMsg);
  2762. return;
  2763. }
  2764. else if (strMsg == "短信发送")
  2765. {
  2766. UINT nID = 3;
  2767. LPSTR pName;
  2768. pName = (LPSTR)(LPCSTR)"客户报表";
  2769. OPEN_MENU(CClientForm);
  2770. return;
  2771. }
  2772. else if (strMsg == "流程短信")
  2773. {
  2774. UINT nID = 3;
  2775. LPSTR pName;
  2776. pName = (LPSTR)(LPCSTR)"流程短信";
  2777. OPEN_MENU(WorkMsg);
  2778. return;
  2779. }
  2780. else if (strMsg == "员工短信")
  2781. {
  2782. UINT nID = 3;
  2783. LPSTR pName;
  2784. pName = (LPSTR)(LPCSTR)"员工短信";
  2785. OPEN_MENU(EmployeeMsg);
  2786. return;
  2787. }
  2788. else if (strMsg == "发送记录")
  2789. {
  2790. UINT nID = 3;
  2791. LPSTR pName;
  2792. pName = (LPSTR)(LPCSTR)"发送记录";
  2793. OPEN_MENU(MsgReg);
  2794. return;
  2795. }
  2796. else if (strMsg == "短信设置")
  2797. {
  2798. if (IsHasRightsnew(49) == 0)return;
  2799. MsgSet dlg;
  2800. dlg.DoModal();
  2801. return;
  2802. }
  2803. else if (strMsg == "金卡会员")
  2804. {
  2805. #ifndef ENTERPRISE_VERSION
  2806. #ifndef CHILD_VERSION
  2807. #ifdef BASIC_VERSION
  2808. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2809. {
  2810. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2811. exit(0);return;
  2812. }
  2813. #else
  2814. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2815. {
  2816. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2817. exit(0);return;
  2818. }
  2819. #endif
  2820. #else
  2821. #ifdef BASIC_VERSION
  2822. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2823. {
  2824. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2825. exit(0);return;
  2826. }
  2827. #else
  2828. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2829. {
  2830. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2831. exit(0); return;
  2832. }
  2833. #endif
  2834. #endif
  2835. #else
  2836. #ifndef CHILD_VERSION
  2837. #ifdef BASIC_VERSION
  2838. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2839. {
  2840. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2841. exit(0); return;
  2842. }
  2843. #else
  2844. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2845. {
  2846. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2847. exit(0); return;
  2848. }
  2849. #endif
  2850. #else
  2851. #ifdef BASIC_VERSION
  2852. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2853. {
  2854. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2855. exit(0);return;
  2856. }
  2857. #else
  2858. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2859. {
  2860. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2861. exit(0); return;
  2862. }
  2863. #endif
  2864. #endif
  2865. #endif
  2866. UINT nID = 3;
  2867. LPSTR pName;
  2868. pName = (LPSTR)(LPCSTR)"金卡会员";
  2869. OPEN_MENU(ShowMember);
  2870. return;
  2871. }
  2872. else if (strMsg == "现金子卡")
  2873. {
  2874. UINT nID = 3;
  2875. LPSTR pName;
  2876. pName = (LPSTR)(LPCSTR)"现金子卡";
  2877. OPEN_MENU(ShowMember2);
  2878. return;
  2879. }
  2880. else if (strMsg == "蓝钻会员")
  2881. {
  2882. #ifndef ENTERPRISE_VERSION
  2883. #ifndef CHILD_VERSION
  2884. #ifdef BASIC_VERSION
  2885. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2886. {
  2887. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2888. exit(0);return;
  2889. }
  2890. #else
  2891. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2892. {
  2893. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2894. exit(0);return;
  2895. }
  2896. #endif
  2897. #else
  2898. #ifdef BASIC_VERSION
  2899. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2900. {
  2901. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2902. exit(0);return;
  2903. }
  2904. #else
  2905. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2906. {
  2907. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2908. exit(0); return;
  2909. }
  2910. #endif
  2911. #endif
  2912. #else
  2913. #ifndef CHILD_VERSION
  2914. #ifdef BASIC_VERSION
  2915. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2916. {
  2917. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2918. exit(0); return;
  2919. }
  2920. #else
  2921. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2922. {
  2923. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2924. exit(0); return;
  2925. }
  2926. #endif
  2927. #else
  2928. #ifdef BASIC_VERSION
  2929. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2930. {
  2931. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2932. exit(0);return;
  2933. }
  2934. #else
  2935. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  2936. {
  2937. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2938. exit(0); return;
  2939. }
  2940. #endif
  2941. #endif
  2942. #endif
  2943. UINT nID = 3;
  2944. LPSTR pName;
  2945. pName = (LPSTR)(LPCSTR)"蓝钻会员";
  2946. OPEN_MENU(ShowMemberBlue);
  2947. return;
  2948. }
  2949. else if (strMsg == "转介绍积分")
  2950. {
  2951. #ifndef ENTERPRISE_VERSION
  2952. #ifndef CHILD_VERSION
  2953. #ifdef BASIC_VERSION
  2954. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  2955. {
  2956. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2957. exit(0);return;
  2958. }
  2959. #else
  2960. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2961. {
  2962. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2963. exit(0);return;
  2964. }
  2965. #endif
  2966. #else
  2967. #ifdef BASIC_VERSION
  2968. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2969. {
  2970. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2971. exit(0);return;
  2972. }
  2973. #else
  2974. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  2975. {
  2976. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2977. exit(0); return;
  2978. }
  2979. #endif
  2980. #endif
  2981. #else
  2982. #ifndef CHILD_VERSION
  2983. #ifdef BASIC_VERSION
  2984. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2985. {
  2986. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2987. exit(0); return;
  2988. }
  2989. #else
  2990. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  2991. {
  2992. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2993. exit(0); return;
  2994. }
  2995. #endif
  2996. #else
  2997. #ifdef BASIC_VERSION
  2998. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  2999. {
  3000. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3001. exit(0);return;
  3002. }
  3003. #else
  3004. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3005. {
  3006. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3007. exit(0); return;
  3008. }
  3009. #endif
  3010. #endif
  3011. #endif
  3012. UINT nID = 3;
  3013. LPSTR pName;
  3014. pName = (LPSTR)(LPCSTR)"转介绍积分";
  3015. OPEN_MENU(Card2Reg);
  3016. return;
  3017. }
  3018. /* else if(strMsg=="转介绍图表")
  3019. {
  3020. #ifndef ENTERPRISE_VERSION
  3021. #ifndef CHILD_VERSION
  3022. #ifdef BASIC_VERSION
  3023. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3024. {
  3025. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3026. exit(0);return;
  3027. }
  3028. #else
  3029. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3030. {
  3031. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3032. exit(0);return;
  3033. }
  3034. #endif
  3035. #else
  3036. #ifdef BASIC_VERSION
  3037. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3038. {
  3039. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3040. exit(0);return;
  3041. }
  3042. #else
  3043. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3044. {
  3045. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3046. exit(0);return;
  3047. }
  3048. #endif
  3049. #endif
  3050. #else
  3051. #ifndef CHILD_VERSION
  3052. #ifdef BASIC_VERSION
  3053. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3054. {
  3055. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3056. exit(0);return;
  3057. }
  3058. #else
  3059. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3060. {
  3061. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3062. exit(0);return;
  3063. }
  3064. #endif
  3065. #else
  3066. #ifdef BASIC_VERSION
  3067. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3068. {
  3069. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3070. exit(0);return;
  3071. }
  3072. #else
  3073. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3074. {
  3075. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3076. exit(0);return;
  3077. }
  3078. #endif
  3079. #endif
  3080. #endif
  3081. UINT nID=3;
  3082. LPSTR pName ;
  3083. pName = (LPSTR)(LPCSTR)"转介绍图表";
  3084. OPEN_MENU(Card2RegChart);
  3085. return;
  3086. }*/
  3087. else if (strMsg == "金卡图表")
  3088. {
  3089. UINT nID = 3;
  3090. LPSTR pName;
  3091. pName = (LPSTR)(LPCSTR)"金卡图表";
  3092. OPEN_MENU(MemberChart);
  3093. return;
  3094. }
  3095. else if (strMsg == "积分短信")
  3096. {
  3097. UINT nID = 3;
  3098. LPSTR pName;
  3099. pName = (LPSTR)(LPCSTR)"积分短信";
  3100. OPEN_MENU(ShowMemberMsg);
  3101. return;
  3102. }
  3103. else if (strMsg == "转介绍返现")
  3104. {
  3105. #ifndef ENTERPRISE_VERSION
  3106. #ifndef CHILD_VERSION
  3107. #ifdef BASIC_VERSION
  3108. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3109. {
  3110. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3111. exit(0);return;
  3112. }
  3113. #else
  3114. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3115. {
  3116. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3117. exit(0);return;
  3118. }
  3119. #endif
  3120. #else
  3121. #ifdef BASIC_VERSION
  3122. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3123. {
  3124. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3125. exit(0);return;
  3126. }
  3127. #else
  3128. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3129. {
  3130. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3131. exit(0); return;
  3132. }
  3133. #endif
  3134. #endif
  3135. #else
  3136. #ifndef CHILD_VERSION
  3137. #ifdef BASIC_VERSION
  3138. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3139. {
  3140. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3141. exit(0); return;
  3142. }
  3143. #else
  3144. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3145. {
  3146. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3147. exit(0); return;
  3148. }
  3149. #endif
  3150. #else
  3151. #ifdef BASIC_VERSION
  3152. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3153. {
  3154. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3155. exit(0);return;
  3156. }
  3157. #else
  3158. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3159. {
  3160. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3161. exit(0); return;
  3162. }
  3163. #endif
  3164. #endif
  3165. #endif
  3166. UINT nID = 3;
  3167. LPSTR pName;
  3168. pName = (LPSTR)(LPCSTR)"转介绍返现";
  3169. OPEN_MENU(Card2RegBlue);
  3170. return;
  3171. }
  3172. else if (strMsg == "转介绍图表")
  3173. {
  3174. #ifndef ENTERPRISE_VERSION
  3175. #ifndef CHILD_VERSION
  3176. #ifdef BASIC_VERSION
  3177. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3178. {
  3179. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3180. exit(0);return;
  3181. }
  3182. #else
  3183. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3184. {
  3185. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3186. exit(0);return;
  3187. }
  3188. #endif
  3189. #else
  3190. #ifdef BASIC_VERSION
  3191. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3192. {
  3193. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3194. exit(0);return;
  3195. }
  3196. #else
  3197. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3198. {
  3199. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3200. exit(0); return;
  3201. }
  3202. #endif
  3203. #endif
  3204. #else
  3205. #ifndef CHILD_VERSION
  3206. #ifdef BASIC_VERSION
  3207. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3208. {
  3209. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3210. exit(0); return;
  3211. }
  3212. #else
  3213. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3214. {
  3215. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3216. exit(0); return;
  3217. }
  3218. #endif
  3219. #else
  3220. #ifdef BASIC_VERSION
  3221. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3222. {
  3223. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3224. exit(0);return;
  3225. }
  3226. #else
  3227. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3228. {
  3229. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3230. exit(0); return;
  3231. }
  3232. #endif
  3233. #endif
  3234. #endif
  3235. UINT nID = 3;
  3236. LPSTR pName;
  3237. pName = (LPSTR)(LPCSTR)"转介绍图表";
  3238. OPEN_MENU(Card2RegChartBlue);
  3239. return;
  3240. }
  3241. else if (strMsg == "积分设置")
  3242. {
  3243. if (IsHasRightsnew(49) == 0)return;
  3244. MemberSet dlg;
  3245. dlg.DoModal();
  3246. return;
  3247. }
  3248. else if (strMsg == "礼服录入")
  3249. {
  3250. if (IsHasRightsnew(39) == 0)return;
  3251. UINT nID = 3;
  3252. LPSTR pName;
  3253. pName = (LPSTR)(LPCSTR)"礼服录入";
  3254. OPEN_MENU(DressManage);
  3255. return;
  3256. }
  3257. else if (strMsg == "礼服查看")
  3258. {
  3259. #ifndef ENTERPRISE_VERSION
  3260. #ifndef CHILD_VERSION
  3261. #ifdef BASIC_VERSION
  3262. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3263. {
  3264. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3265. exit(0);return;
  3266. }
  3267. #else
  3268. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3269. {
  3270. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3271. exit(0);return;
  3272. }
  3273. #endif
  3274. #else
  3275. #ifdef BASIC_VERSION
  3276. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3277. {
  3278. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3279. exit(0);return;
  3280. }
  3281. #else
  3282. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3283. {
  3284. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3285. exit(0); return;
  3286. }
  3287. #endif
  3288. #endif
  3289. #else
  3290. #ifndef CHILD_VERSION
  3291. #ifdef BASIC_VERSION
  3292. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3293. {
  3294. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3295. exit(0); return;
  3296. }
  3297. #else
  3298. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3299. {
  3300. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3301. exit(0); return;
  3302. }
  3303. #endif
  3304. #else
  3305. #ifdef BASIC_VERSION
  3306. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3307. {
  3308. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3309. exit(0);return;
  3310. }
  3311. #else
  3312. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3313. {
  3314. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3315. exit(0); return;
  3316. }
  3317. #endif
  3318. #endif
  3319. #endif
  3320. if (IsHasRightsnew(40) == 0)return;
  3321. UINT nID = 3;
  3322. LPSTR pName;
  3323. pName = (LPSTR)(LPCSTR)"礼服查看";
  3324. OPEN_MENU(ShowDress);
  3325. return;
  3326. }
  3327. else if (strMsg == "撞期预警")
  3328. {
  3329. UINT nID = 3;
  3330. LPSTR pName;
  3331. pName = (LPSTR)(LPCSTR)"撞期预警";
  3332. OPEN_MENU(DressEarlyWarning);
  3333. return;
  3334. }
  3335. else if (strMsg == "礼服出租")
  3336. {
  3337. UINT nID = 3;
  3338. LPSTR pName;
  3339. pName = (LPSTR)(LPCSTR)"礼服出租";
  3340. OPEN_MENU(ShowHireReg);
  3341. return;
  3342. }
  3343. else if (strMsg == "礼服图片")
  3344. {
  3345. ShowPic dlg;
  3346. dlg.m_mode = 4;
  3347. //dlg.m_path = g_path5 + "\\";
  3348. dlg.m_id = g_path5 + "\\";
  3349. dlg.DoModal();
  3350. return;
  3351. }
  3352. else if (strMsg == "商品类别设置")
  3353. {
  3354. if (IsHasRightsnew(29) == 0)return;
  3355. SPLBDlg dlg;
  3356. dlg.DoModal();
  3357. return;
  3358. }
  3359. else if (strMsg == "商品名称设置")
  3360. {
  3361. if (IsHasRightsnew(29) == 0)return;
  3362. UINT nID = 3;
  3363. LPSTR pName;
  3364. pName = (LPSTR)(LPCSTR)"商品设置";
  3365. OPEN_MENU(ShangPin);
  3366. return;
  3367. }
  3368. else if (strMsg == "固定资产管理")
  3369. {
  3370. UINT nID = 3;
  3371. LPSTR pName;
  3372. pName = (LPSTR)(LPCSTR)"固定资产管理";
  3373. OPEN_MENU(FixedAssets);
  3374. return;
  3375. }
  3376. else if (strMsg == "入库单")
  3377. {
  3378. if (IsHasRightsnew(44) == 0)return;
  3379. InputGoods dlg;
  3380. dlg.DoModal();
  3381. return;
  3382. }
  3383. else if (strMsg == "出库单")
  3384. {
  3385. #ifndef ENTERPRISE_VERSION
  3386. #ifndef CHILD_VERSION
  3387. #ifdef BASIC_VERSION
  3388. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3389. {
  3390. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3391. exit(0);return;
  3392. }
  3393. #else
  3394. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3395. {
  3396. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3397. exit(0);return;
  3398. }
  3399. #endif
  3400. #else
  3401. #ifdef BASIC_VERSION
  3402. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3403. {
  3404. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3405. exit(0);return;
  3406. }
  3407. #else
  3408. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3409. {
  3410. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3411. exit(0); return;
  3412. }
  3413. #endif
  3414. #endif
  3415. #else
  3416. #ifndef CHILD_VERSION
  3417. #ifdef BASIC_VERSION
  3418. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3419. {
  3420. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3421. exit(0); return;
  3422. }
  3423. #else
  3424. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3425. {
  3426. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3427. exit(0); return;
  3428. }
  3429. #endif
  3430. #else
  3431. #ifdef BASIC_VERSION
  3432. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3433. {
  3434. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3435. exit(0);return;
  3436. }
  3437. #else
  3438. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3439. {
  3440. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3441. exit(0); return;
  3442. }
  3443. #endif
  3444. #endif
  3445. #endif
  3446. if (IsHasRightsnew(45) == 0)return;
  3447. InputGoods dlg;
  3448. dlg.m_mode = 1;
  3449. dlg.DoModal();
  3450. return;
  3451. }
  3452. else if (strMsg == "库存查询")
  3453. {
  3454. #ifndef ENTERPRISE_VERSION
  3455. #ifndef CHILD_VERSION
  3456. #ifdef BASIC_VERSION
  3457. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
  3458. {
  3459. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3460. exit(0);return;
  3461. }
  3462. #else
  3463. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3464. {
  3465. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3466. exit(0);return;
  3467. }
  3468. #endif
  3469. #else
  3470. #ifdef BASIC_VERSION
  3471. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3472. {
  3473. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3474. exit(0);return;
  3475. }
  3476. #else
  3477. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
  3478. {
  3479. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3480. exit(0); return;
  3481. }
  3482. #endif
  3483. #endif
  3484. #else
  3485. #ifndef CHILD_VERSION
  3486. #ifdef BASIC_VERSION
  3487. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3488. {
  3489. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3490. exit(0); return;
  3491. }
  3492. #else
  3493. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
  3494. {
  3495. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3496. exit(0); return;
  3497. }
  3498. #endif
  3499. #else
  3500. #ifdef BASIC_VERSION
  3501. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
  3502. {
  3503. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3504. exit(0);return;
  3505. }
  3506. #else
  3507. if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
  3508. {
  3509. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3510. exit(0); return;
  3511. }
  3512. #endif
  3513. #endif
  3514. #endif
  3515. UINT nID = 3;
  3516. LPSTR pName;
  3517. pName = (LPSTR)(LPCSTR)"库存查询";
  3518. OPEN_MENU(ShowGoods);
  3519. return;
  3520. }
  3521. else if (strMsg == "商品图表")
  3522. {
  3523. UINT nID = 3;
  3524. LPSTR pName;
  3525. pName = (LPSTR)(LPCSTR)"商品图表";
  3526. OPEN_MENU(StoreInfoChart);
  3527. return;
  3528. }
  3529. else if (strMsg == "成本核算")
  3530. {
  3531. UINT nID = 3;
  3532. LPSTR pName;
  3533. pName = (LPSTR)(LPCSTR)"成本核算";
  3534. OPEN_MENU(CostCal);
  3535. return;
  3536. }
  3537. else if (strMsg == "考勤记录")
  3538. {
  3539. UINT nID = 3;
  3540. LPSTR pName;
  3541. pName = (LPSTR)(LPCSTR)"考勤记录";
  3542. OPEN_MENU(LoginReg);
  3543. return;
  3544. }
  3545. else if (strMsg == "月统计")
  3546. {
  3547. UINT nID = 3;
  3548. LPSTR pName;
  3549. pName = (LPSTR)(LPCSTR)"月统计";
  3550. OPEN_MENU(LoginReg2);
  3551. return;
  3552. }
  3553. else if (strMsg == "时间设置")
  3554. {
  3555. if (IsHasRightsnew(21) == 0)return;
  3556. SetLoginTime dlg;
  3557. dlg.DoModal();
  3558. return;
  3559. }
  3560. else if (strMsg == "排班设置")
  3561. {
  3562. if (IsHasRightsnew(21) == 0)return;
  3563. SetLoginBan dlg;
  3564. dlg.DoModal();
  3565. return;
  3566. }
  3567. else if (strMsg == "意向查询")
  3568. {
  3569. UINT nID = 3;
  3570. LPSTR pName;
  3571. pName = (LPSTR)(LPCSTR)"意向查询";
  3572. OPEN_MENU(HospitalClient);
  3573. return;
  3574. }
  3575. else if (strMsg == "今日提醒")
  3576. {
  3577. UINT nID = 3;
  3578. LPSTR pName;
  3579. pName = (LPSTR)(LPCSTR)"今日提醒";
  3580. OPEN_MENU(HospitalClientAlarm);
  3581. return;
  3582. }
  3583. else if (strMsg == "跟踪短信")
  3584. {
  3585. UINT nID = 3;
  3586. LPSTR pName;
  3587. pName = (LPSTR)(LPCSTR)"跟踪短信";
  3588. OPEN_MENU(HospitalClientMsg);
  3589. return;
  3590. }
  3591. else if (strMsg == "意向单录入")
  3592. {
  3593. AddHospitalClient dlg;
  3594. dlg.DoModal();
  3595. return;
  3596. }
  3597. else if (strMsg == "资料设置")
  3598. {
  3599. HospitalInfoSet dlg;
  3600. dlg.DoModal();
  3601. return;
  3602. }
  3603. else if ( strMsg == _T("公众号设置"))
  3604. {
  3605. if (IsHasRightsnew(62) == 0)return;
  3606. if ( lyfzLibrary::LoadWeiXinLibaray() )
  3607. {
  3608. lyfzLibrary::g_PtrShowWeiXinDialog(g_rc, g_bkcol);
  3609. lyfzLibrary::FreeWeiXinLibaray();
  3610. }
  3611. return;
  3612. }
  3613. else if ( strMsg == _T("模板消息设置"))
  3614. {
  3615. if (IsHasRightsnew(63) == 0)return;
  3616. if ( lyfzLibrary::LoadWeiXinLibaray() )
  3617. {
  3618. lyfzLibrary::g_PtrShowWXMsgconfigDialog(g_rc, g_bkcol);
  3619. lyfzLibrary::FreeWeiXinLibaray();
  3620. }
  3621. return;
  3622. }
  3623. else if ( strMsg == _T("推送记录") )
  3624. {
  3625. if (IsHasRightsnew(64) == 0)return;
  3626. if ( lyfzLibrary::LoadWeiXinLibaray() )
  3627. {
  3628. lyfzLibrary::g_PtrShowWXMsgRcordDialog(g_rc, g_bkcol);
  3629. lyfzLibrary::FreeWeiXinLibaray();
  3630. }
  3631. return;
  3632. }
  3633. AfxMessageBox(strMsg + ",开发中...");
  3634. }
  3635. // Jeff.当版本号不一致时,调用AutoUpdate.exe来升级YLGL.exe
  3636. void CMainFrame::AutoUpdate()
  3637. {
  3638. if (g_bBranchModify)
  3639. {
  3640. AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
  3641. return;
  3642. }
  3643. else if (g_branchname != "")
  3644. {
  3645. AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
  3646. return;
  3647. }
  3648. g_ntimeout = 30000;
  3649. if (!::PathFileExists(g_mainpath + "\\AutoUpdate.exe"))
  3650. {
  3651. g_sendhead.bsql = 0;
  3652. g_sendhead.code[0] = 99;
  3653. g_sendhead.tabcount = 1;
  3654. g_pMainWnd->ProcessChatMessageRequest2(99);
  3655. if (g_bSendOK == 0)
  3656. goto failed;
  3657. CFile fp;
  3658. fp.Open(g_mainpath + "\\AutoUpdate.exe", CFile::modeWrite | CFile::modeCreate);
  3659. fp.Write(g_pData, g_nLeng);
  3660. fp.Close();
  3661. }
  3662. {
  3663. ::DeleteFile(g_mainpath + "\\YLGL2.exe"); // 删除ylgl.exe;
  3664. g_sendhead.bsql = 0;
  3665. g_sendhead.code[0] = 98;
  3666. g_sendhead.tabcount = 1;
  3667. g_pMainWnd->ProcessChatMessageRequest2(99); if (g_bSendOK == 0)goto failed;
  3668. CFile fp;
  3669. fp.Open(g_mainpath + "\\YLGL2.exe", CFile::modeWrite | CFile::modeCreate);
  3670. fp.Write(g_pData, g_nLeng);
  3671. fp.Close();
  3672. }
  3673. AfxMessageBox("自动升级成功!", MB_ICONINFORMATION);
  3674. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\AutoUpdate.exe"), "12345", NULL, SW_SHOWNORMAL);
  3675. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3676. exit(0);
  3677. return;
  3678. failed:
  3679. AfxMessageBox("自动升级失败!", MB_ICONINFORMATION);
  3680. if (g_ntimeout == 30000)//非远程
  3681. {
  3682. AfxMessageBox("提醒:升级过程中需要传输较多的数据,如果网速慢可能导致远程升级失败!\r\n\
  3683. 可拷贝店内客户端用QQ传过来覆盖除dbconfig.dat的文件即可。", MB_ICONINFORMATION);
  3684. }
  3685. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3686. }
  3687. void CMainFrame::Onchoosephotoskin() //Jeff:此机用于选片菜单项;不在使用2014.06.16
  3688. {
  3689. if (g_user.bLongin == 0)
  3690. {
  3691. if (g_bNoLoginLia)
  3692. {
  3693. Login dlg;
  3694. dlg.SetLiaPath("5.lia");
  3695. dlg.DoModal();
  3696. }
  3697. else
  3698. {
  3699. Login3 dlg;
  3700. dlg.SetLiaPath("5.lia");
  3701. dlg.DoModal();
  3702. }
  3703. if (g_user.bLongin == 0)return;
  3704. }
  3705. // TODO: Add your command handler code here
  3706. CMenu *pMenu = GetMenu();
  3707. CMenu* submenu = pMenu->GetSubMenu(1);
  3708. UINT status = submenu->GetMenuState(IDM_choosephotoskin, MF_BYCOMMAND);
  3709. if (status&MF_CHECKED)
  3710. {
  3711. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_UNCHECKED);
  3712. AfxGetApp()->WriteProfileInt(LYFZVERSION, "status", 0);
  3713. }
  3714. else
  3715. {
  3716. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  3717. AfxGetApp()->WriteProfileInt(LYFZVERSION, "status", 1);
  3718. }
  3719. }
  3720. /*BOOL g_bInSkin = 0;*/
  3721. BOOL CMainFrame::IsCtrlDown()
  3722. {
  3723. short state = GetKeyState(VK_LCONTROL);
  3724. BYTE sta = (BYTE)(state >> 8);
  3725. state = GetKeyState(VK_RCONTROL);
  3726. BYTE sta2 = (BYTE)(state >> 8);
  3727. if (sta || sta2)
  3728. return 1;
  3729. else
  3730. return 0;
  3731. }//IsShiftDown
  3732. BOOL CMainFrame::IsShiftDown()
  3733. {
  3734. short state = GetKeyState(VK_LSHIFT);
  3735. BYTE sta = (BYTE)(state >> 8);
  3736. state = GetKeyState(VK_RSHIFT);
  3737. BYTE sta2 = (BYTE)(state >> 8);
  3738. if (sta || sta2)
  3739. return 1;
  3740. else
  3741. return 0;
  3742. }
  3743. BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
  3744. {
  3745. // TODO: Add your specialized code here and/or call the base class IDM_Logout
  3746. if (pMsg->message == WM_KEYDOWN)
  3747. {
  3748. switch (pMsg->wParam)
  3749. {
  3750. case VK_F12:
  3751. g_pMainWnd->OnCommandMenu(IDM_Logout);
  3752. return 1;
  3753. case VK_F1:
  3754. ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  3755. return 1;
  3756. case VK_F2: // 此机用于选片和选设计;
  3757. {
  3758. if (g_pMainWnd->m_bCheckF2F3 && (IsShiftDown() == 0 || IsCtrlDown() == 0))return 1;
  3759. m_Mdi.MainClose();
  3760. if (g_user.bLongin)
  3761. {
  3762. SearchClient dlg;
  3763. dlg.SetLiaPath("2.lia");
  3764. if (dlg.DoModal() != IDOK)
  3765. {
  3766. if (dlg.m_bLogout)
  3767. {
  3768. g_user.bLongin = 0;
  3769. g_user.name.Empty();
  3770. g_user.rights.Empty();
  3771. g_user.account.Empty();
  3772. goto ll;
  3773. }
  3774. PostMessage(WM_QUIT);
  3775. return 1;
  3776. }
  3777. if (dlg.m_exitcode == 3)
  3778. {
  3779. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3780. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3781. }
  3782. else
  3783. {
  3784. ShowWindow(SW_SHOW);
  3785. #ifdef NEW_SKIN
  3786. if (m_pMainFrimDlg2 == NULL)
  3787. {
  3788. m_pMainFrimDlg2 = new MainFrimDlg2;
  3789. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3790. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3791. }
  3792. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3793. g_bInSkin = 0;
  3794. #endif
  3795. }
  3796. }
  3797. else
  3798. {
  3799. ll:
  3800. ChoosePhotoSkin dlg;
  3801. dlg.SetLiaPath("1.lia");
  3802. if (dlg.DoModal() != IDOK)
  3803. {
  3804. PostMessage(WM_QUIT);
  3805. return 1;
  3806. }
  3807. if (dlg.m_exitcode == 3)
  3808. {
  3809. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3810. keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3811. }
  3812. else
  3813. {
  3814. ShowWindow(SW_SHOW);
  3815. #ifdef NEW_SKIN
  3816. if (m_pMainFrimDlg2 == NULL)
  3817. {
  3818. m_pMainFrimDlg2 = new MainFrimDlg2;
  3819. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3820. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3821. }
  3822. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3823. g_bInSkin = 0;
  3824. #endif
  3825. }
  3826. }
  3827. }
  3828. return 1;
  3829. case VK_F3: // 此机用于选片和选设计;
  3830. {
  3831. if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
  3832. m_Mdi.MainClose();
  3833. if (g_user.bLongin)
  3834. {
  3835. SearchClient dlg;
  3836. dlg.m_mode = 1;
  3837. dlg.SetLiaPath("2.lia");
  3838. if (dlg.DoModal() != IDOK)
  3839. {
  3840. if (dlg.m_bLogout)
  3841. {
  3842. g_user.bLongin = 0;
  3843. g_user.name.Empty();
  3844. g_user.rights.Empty();
  3845. g_user.account.Empty();
  3846. goto mm;
  3847. }
  3848. PostMessage(WM_QUIT);
  3849. return 1;
  3850. }
  3851. if (dlg.m_exitcode == 2)
  3852. {
  3853. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3854. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3855. }
  3856. else
  3857. {
  3858. ShowWindow(SW_SHOW);
  3859. #ifdef NEW_SKIN
  3860. if (m_pMainFrimDlg2 == NULL)
  3861. {
  3862. m_pMainFrimDlg2 = new MainFrimDlg2;
  3863. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3864. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3865. }
  3866. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3867. g_bInSkin = 0;
  3868. #endif
  3869. }
  3870. }
  3871. else
  3872. {
  3873. mm:
  3874. ChoosePhotoSkin dlg;
  3875. dlg.m_mode = 1;
  3876. dlg.SetLiaPath("1.lia");
  3877. if (dlg.DoModal() != IDOK)
  3878. {
  3879. PostMessage(WM_QUIT);
  3880. return 1;
  3881. }
  3882. if (dlg.m_exitcode == 2)
  3883. {
  3884. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
  3885. keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
  3886. }
  3887. else
  3888. {
  3889. ShowWindow(SW_SHOW);
  3890. #ifdef NEW_SKIN
  3891. if (m_pMainFrimDlg2 == NULL)
  3892. {
  3893. m_pMainFrimDlg2 = new MainFrimDlg2;
  3894. m_pMainFrimDlg2->SetLiaPath("10.lia");
  3895. m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
  3896. }
  3897. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3898. g_bInSkin = 0;
  3899. #endif
  3900. }
  3901. }
  3902. }
  3903. return 1;
  3904. //#if 0 // 2015-05-30 禁用F11功能;
  3905. // case VK_F11:
  3906. // if (g_bInSkin)return 1;
  3907. // if (g_user.bLongin)
  3908. // {
  3909. // SqlDlg dlg;
  3910. // dlg.DoModal();
  3911. // }
  3912. // break;
  3913. //#endif
  3914. }
  3915. }
  3916. return CMDIFrameWnd::PreTranslateMessage(pMsg);
  3917. }
  3918. void CMainFrame::GetSkin()
  3919. {
  3920. return;
  3921. #ifdef MNLS_VERSION
  3922. if (::PathFileExists(g_mainpath + "\\skin\\4.lia"))
  3923. {
  3924. CFile fp;
  3925. fp.Open(g_mainpath + "\\skin\\4.lia", CFile::modeRead);
  3926. DWORD leng=fp.GetLength ();
  3927. fp.Close ();
  3928. if(leng!=194987)
  3929. ::DeleteFile (g_mainpath+"\\skin\\4.lia"); // 删除4.lia
  3930. }
  3931. if(!::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3932. {
  3933. ::CreateDirectory (g_mainpath+"\\skin", NULL);
  3934. g_sendhead.bsql=0;
  3935. g_sendhead.code[0]=100;
  3936. g_sendhead.tabcount=1;
  3937. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  3938. CFile fp;
  3939. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeWrite|CFile::modeCreate);
  3940. fp.Write (g_pData, g_nLeng);
  3941. fp.Close ();
  3942. }
  3943. #endif
  3944. }
  3945. void AutoDraw(CPrintRX &m_Print, CRect &StrRect, CString &str, float fscale)
  3946. {
  3947. CString tempbz =_T(""), temp = _T("");
  3948. BOOL bRun = 0;
  3949. CSize size;
  3950. int fontsize = 12;
  3951. int i = 0;
  3952. ll: tempbz = str;
  3953. i = 0;
  3954. m_Print.SetFontFace(fontsize, 1, "宋体");
  3955. while (1)
  3956. {
  3957. if (!tempbz.IsEmpty())
  3958. {
  3959. temp = tempbz;
  3960. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3961. int right = 0;
  3962. CRect temprc = StrRect;
  3963. temprc.top += i*(fontsize*fscale); i++;
  3964. temprc.bottom = temprc.top + fontsize;
  3965. if (temprc.bottom > StrRect.bottom)break;
  3966. while (size.cx > temprc.Width())
  3967. {
  3968. right++;
  3969. temp = tempbz.Left(tempbz.GetLength() - (right));
  3970. if (GIsHalfHZ(temp))
  3971. {
  3972. right++;
  3973. temp.Delete(temp.GetLength() - 1);
  3974. }
  3975. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3976. }
  3977. // 判断最后的字符是否还含有半个汉字;
  3978. if ( GIsHalfHZ(temp) )
  3979. {
  3980. right++;
  3981. temp.Delete(temp.GetLength() -1);
  3982. temp = tempbz.Left(tempbz.GetLength() - (right));
  3983. }
  3984. if (temp.Find("\r\n") != -1)
  3985. {
  3986. temp = temp.Left(temp.Find("\r\n"));//i++;
  3987. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength() - 2);
  3988. }
  3989. else
  3990. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
  3991. if (bRun)
  3992. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, temprc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3993. }
  3994. else
  3995. break;
  3996. }
  3997. if (tempbz.IsEmpty() == 0)
  3998. {
  3999. fontsize--;
  4000. goto ll;
  4001. }
  4002. if (bRun == 0)
  4003. {
  4004. bRun = 1;
  4005. goto ll;
  4006. }
  4007. }
  4008. void CMainFrame::PrintDinDan3(CString strOrderNumber)
  4009. {
  4010. // TODO: Add your control notification handler code here
  4011. CPrintRX m_Print;
  4012. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  4013. {
  4014. m_Print.InitToPrint(NULL, 1);
  4015. }
  4016. else
  4017. {
  4018. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  4019. if (name.IsEmpty())
  4020. m_Print.InitToPrint(NULL, 1);
  4021. else
  4022. {
  4023. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  4024. if (nret == -1)
  4025. {
  4026. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  4027. }
  4028. }
  4029. }
  4030. m_Print.StartPrint();
  4031. m_Print.StartPage();
  4032. LoadRect load;
  4033. load.SetLiaPath("11.lia");
  4034. load.SetMargins(0, 0);
  4035. if (!load.Load())return;
  4036. LoadRect load2;
  4037. load2.SetLiaPath("12.lia");
  4038. load2.SetMargins(0, 0);
  4039. if (!load2.Load())return;
  4040. LoadRect load3;
  4041. load3.SetLiaPath("13.lia");
  4042. load3.SetMargins(-6, 520);
  4043. if (!load3.Load())return;
  4044. int i;
  4045. //////////////////////////////////////////////////////////////
  4046. CStringArray txarray;
  4047. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "'";
  4048. g_sendhead.code[0] = 11;
  4049. g_sendhead.code[1] = 52;
  4050. g_sendhead.code[2] = 50;
  4051. g_sendhead.code[3] = 150;
  4052. g_sendhead.tabcount = 4;
  4053. g_sendhead.bsql = 0;
  4054. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  4055. CArray<CStringArray, CStringArray>sparray;
  4056. CArray<CStringArray, CStringArray>clientarray;
  4057. CArray<CStringArray, CStringArray>jdarray;
  4058. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray);
  4059. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  4060. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  4061. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  4062. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  4063. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  4064. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
  4065. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  4066. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  4067. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  4068. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  4069. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  4070. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  4071. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  4072. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  4073. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  4074. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  4075. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  4076. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  4077. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  4078. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  4079. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  4080. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  4081. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  4082. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  4083. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  4084. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  4085. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  4086. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  4087. CString m_bz = "其它要求: " + g_List1array.ElementAt(0).ElementAt(38);
  4088. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  4089. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  4090. if (IsHasRights2new(31) == 0)
  4091. {
  4092. m_phone1 = "***";
  4093. m_phone2 = "***";
  4094. }
  4095. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  4096. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  4097. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  4098. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  4099. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  4100. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  4101. CString m_addr = m_addr1 + ";";
  4102. m_addr.TrimLeft(";");
  4103. m_addr += m_addr2;
  4104. CString m_qq = m_qq1 + ";";
  4105. m_qq.TrimLeft(";");
  4106. m_qq += m_qq2;
  4107. CString m_jd;
  4108. for (i = 0; i < jdarray.GetSize(); i++)
  4109. {
  4110. m_jd += jdarray.ElementAt(i).ElementAt(1);
  4111. m_jd += ";";
  4112. }
  4113. m_jd.TrimRight(";");
  4114. m_money1.Format("%f", atof(m_taoxijiage));
  4115. m_money2.Format("%f", atof(m_payed1));
  4116. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  4117. ConvertToPrice(m_money1);
  4118. ConvertToPrice(m_money2);
  4119. ConvertToPrice(m_money3);
  4120. ////////////////////////////////////////////////////////////////
  4121. int rcpos = -1;
  4122. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  4123. m_Print.SetFontFace(17, 1, "宋体");
  4124. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4125. StrRect.top -= 0;
  4126. StrRect.bottom -= 10;
  4127. StrRect.left -= 140;
  4128. StrRect.right = StrRect.left + 48;
  4129. m_Print.SetFontFace(15, 1, "宋体");
  4130. m_Print.SetColor(0xffffff);
  4131. m_Print.DrawRect(StrRect, 0);
  4132. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4133. StrRect.left = StrRect.right;
  4134. StrRect.right = StrRect.left + 48;
  4135. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  4136. m_Print.SetColor(0, RGB(255, 0, 0));
  4137. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4138. m_Print.SetColor(0);
  4139. m_Print.SetFontFace(12, 1, "宋体");
  4140. StrRect.left -= 48;
  4141. int hei = StrRect.Height();
  4142. StrRect.top = StrRect.bottom + 2;
  4143. StrRect.bottom += hei + 2;
  4144. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4145. StrRect.top = StrRect.bottom - 2;
  4146. StrRect.bottom += hei - 5;
  4147. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  4148. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4149. m_Print.SetFontFace(12, 1, "宋体");
  4150. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4151. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4152. m_Print.SetFontFace(11, 1, "宋体");
  4153. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4154. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4155. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4156. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4157. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4158. m_Print.DrawRect2(StrRect, 2);
  4159. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4160. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4161. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4162. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4163. m_Print.DrawRect2(StrRect, 2);
  4164. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4165. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4166. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4167. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4168. m_Print.DrawRect2(StrRect, 2);
  4169. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4170. m_Print.DrawText((LPTSTR)(LPCTSTR)"约单时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4171. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4172. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4173. m_Print.DrawRect2(StrRect, 2);
  4174. ////////////
  4175. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4176. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4177. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4178. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4179. m_Print.DrawRect2(StrRect, 2);
  4180. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4181. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4182. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4183. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4184. m_Print.DrawRect2(StrRect, 2);
  4185. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4186. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4187. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4188. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4189. m_Print.DrawRect2(StrRect, 2);
  4190. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4191. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4192. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4193. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4194. m_Print.DrawRect2(StrRect, 2);
  4195. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4196. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4197. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4198. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4199. m_Print.DrawRect2(StrRect, 2);
  4200. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4201. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/邮箱:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4202. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4203. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4204. m_Print.DrawRect2(StrRect, 2);
  4205. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4206. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系金额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4207. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4208. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4209. m_Print.DrawRect2(StrRect, 2);
  4210. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4211. m_Print.DrawText((LPTSTR)(LPCTSTR)"定金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4212. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4213. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4214. m_Print.DrawRect2(StrRect, 2);
  4215. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4216. m_Print.DrawText((LPTSTR)(LPCTSTR)"余额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4217. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4218. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4219. m_Print.DrawRect2(StrRect, 2);
  4220. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4221. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4222. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4223. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4224. m_Print.DrawRect2(StrRect, 2);
  4225. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4226. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍摄景点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4227. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4228. m_Print.DrawText((LPTSTR)(LPCTSTR)m_jd, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4229. m_Print.DrawRect2(StrRect, 2);
  4230. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4231. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容提供: 男士服装:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4232. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4233. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4234. m_Print.DrawRect2(StrRect, 2);
  4235. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4236. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4237. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4238. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4239. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4240. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4241. m_Print.DrawRect2(StrRect, 2);
  4242. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4243. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4244. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4245. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内提供拍摄区服装/头饰造型", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4246. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4247. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4248. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4249. m_Print.DrawText((LPTSTR)(LPCTSTR)" ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4250. m_Print.DrawRect2(StrRect, 2);
  4251. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4252. m_Print.DrawText((LPTSTR)(LPCTSTR)"专业数码拍摄:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4253. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4254. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4255. m_Print.DrawRect2(StrRect, 2);
  4256. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4257. m_Print.DrawText((LPTSTR)(LPCTSTR)"张", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4258. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4259. m_Print.DrawText((LPTSTR)(LPCTSTR)"(JPG格式数据)", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4260. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4261. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内赠送:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4262. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4263. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_List1array.ElementAt(0).ElementAt(9)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4264. m_Print.DrawRect2(StrRect, 2);
  4265. StrRect = load.m_rcarray.ElementAt(++rcpos);
  4266. m_Print.DrawText((LPTSTR)(LPCTSTR)"张设计排版精修入册", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4267. //////////////////////load2
  4268. rcpos = -1;
  4269. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4270. m_Print.DrawText((LPTSTR)(LPCTSTR)"原始数据套系内张数JPG格式光盘壹只", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4271. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4272. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4273. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4274. // m_Print.DrawText((LPTSTR)(LPCTSTR)"", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4275. // AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4276. m_Print.DrawRect2(StrRect, 2);
  4277. m_Print.SetFontFace(11, 1, "宋体");
  4278. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4279. m_Print.DrawText((LPTSTR)(LPCTSTR)"客人产品:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4280. int rowcount = sparray.GetSize() / 8;
  4281. int needaddrow = 0;
  4282. while (sparray.GetSize() > rowcount * 8 + needaddrow)
  4283. needaddrow++;
  4284. int pos = 0;
  4285. CString str = "";
  4286. int addcount = 0;
  4287. if (needaddrow > 0)
  4288. addcount = 1;
  4289. else
  4290. addcount = 0;
  4291. needaddrow--;
  4292. str.Empty();
  4293. for (i = 0; i < rowcount + addcount; i++)
  4294. {
  4295. str += sparray.ElementAt(pos).ElementAt(5);
  4296. str += " 数量:";
  4297. str += sparray.ElementAt(pos).ElementAt(3);
  4298. str += ";";
  4299. pos++;
  4300. }
  4301. StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
  4302. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4303. m_Print.DrawRect2(StrRect, 2);
  4304. StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
  4305. if (needaddrow > 0)
  4306. addcount = 1;
  4307. else
  4308. addcount = 0;
  4309. needaddrow--;
  4310. str.Empty();
  4311. for (i = 0; i < rowcount + addcount; i++)
  4312. {
  4313. str += sparray.ElementAt(pos).ElementAt(5);
  4314. str += " 数量:";
  4315. str += sparray.ElementAt(pos).ElementAt(3);
  4316. str += ";";
  4317. pos++;
  4318. }
  4319. AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
  4320. m_Print.DrawRect2(StrRect, 2);
  4321. StrRect = load2.m_rcarray.ElementAt(++rcpos);//7
  4322. if (needaddrow > 0)
  4323. addcount = 1;
  4324. else
  4325. addcount = 0;
  4326. needaddrow--;
  4327. str.Empty();
  4328. for (i = 0; i < rowcount + addcount; i++)
  4329. {
  4330. str += sparray.ElementAt(pos).ElementAt(5);
  4331. str += " 数量:";
  4332. str += sparray.ElementAt(pos).ElementAt(3);
  4333. str += ";";
  4334. pos++;
  4335. }
  4336. AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
  4337. m_Print.DrawRect2(StrRect, 2);
  4338. StrRect = load2.m_rcarray.ElementAt(++rcpos);//8
  4339. if (needaddrow > 0)
  4340. addcount = 1;
  4341. else
  4342. addcount = 0;
  4343. needaddrow--;
  4344. str.Empty();
  4345. for (i = 0; i < rowcount + addcount; i++)
  4346. {
  4347. str += sparray.ElementAt(pos).ElementAt(5);
  4348. str += " 数量:";
  4349. str += sparray.ElementAt(pos).ElementAt(3);
  4350. str += ";";
  4351. pos++;
  4352. }
  4353. AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
  4354. m_Print.DrawRect2(StrRect, 2);
  4355. StrRect = load2.m_rcarray.ElementAt(++rcpos);//9
  4356. if (needaddrow > 0)
  4357. addcount = 1;
  4358. else
  4359. addcount = 0;
  4360. needaddrow--;
  4361. str.Empty();
  4362. for (i = 0; i < rowcount + addcount; i++)
  4363. {
  4364. str += sparray.ElementAt(pos).ElementAt(5);
  4365. str += " 数量:";
  4366. str += sparray.ElementAt(pos).ElementAt(3);
  4367. str += ";";
  4368. pos++;
  4369. }
  4370. AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
  4371. m_Print.DrawRect2(StrRect, 2);
  4372. StrRect = load2.m_rcarray.ElementAt(++rcpos);//10
  4373. if (needaddrow > 0)
  4374. addcount = 1;
  4375. else
  4376. addcount = 0;
  4377. needaddrow--;
  4378. str.Empty();
  4379. for (i = 0; i < rowcount + addcount; i++)
  4380. {
  4381. str += sparray.ElementAt(pos).ElementAt(5);
  4382. str += " 数量:";
  4383. str += sparray.ElementAt(pos).ElementAt(3);
  4384. str += ";";
  4385. pos++;
  4386. }
  4387. AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
  4388. m_Print.DrawRect2(StrRect, 2);
  4389. StrRect = load2.m_rcarray.ElementAt(++rcpos);//11
  4390. if (needaddrow > 0)
  4391. addcount = 1;
  4392. else
  4393. addcount = 0;
  4394. needaddrow--;
  4395. str.Empty();
  4396. for (i = 0; i < rowcount + addcount; i++)
  4397. {
  4398. str += sparray.ElementAt(pos).ElementAt(5);
  4399. str += " 数量:";
  4400. str += sparray.ElementAt(pos).ElementAt(3);
  4401. str += ";";
  4402. pos++;
  4403. }
  4404. AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
  4405. m_Print.DrawRect2(StrRect, 2);
  4406. StrRect = load2.m_rcarray.ElementAt(++rcpos);//12
  4407. if (needaddrow > 0)
  4408. addcount = 1;
  4409. else
  4410. addcount = 0;
  4411. needaddrow--;
  4412. str.Empty();
  4413. for (i = 0; i < rowcount + addcount; i++)
  4414. {
  4415. str += sparray.ElementAt(pos).ElementAt(5);
  4416. str += " 数量:";
  4417. str += sparray.ElementAt(pos).ElementAt(3);
  4418. str += ";";
  4419. pos++;
  4420. }
  4421. AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
  4422. m_Print.DrawRect2(StrRect, 2);
  4423. /* StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4424. if(needaddrow>0)
  4425. addcount=1;
  4426. else
  4427. addcount=0;
  4428. needaddrow--;
  4429. str.Empty ();
  4430. for( i=0; i<rowcount+addcount; i++)
  4431. {
  4432. str+=sparray.ElementAt (pos).ElementAt (5);
  4433. str+=" 数量:";
  4434. str+=sparray.ElementAt (pos).ElementAt (3);
  4435. str+=";";
  4436. pos++;
  4437. }
  4438. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4439. m_Print.DrawRect2(StrRect, 2);
  4440. StrRect=load2.m_rcarray .ElementAt (++rcpos);//14
  4441. if(needaddrow>0)
  4442. addcount=1;
  4443. else
  4444. addcount=0;
  4445. needaddrow--;
  4446. str.Empty ();
  4447. for( i=0; i<rowcount+addcount; i++)
  4448. {
  4449. str+=sparray.ElementAt (pos).ElementAt (5);
  4450. str+=" 数量:";
  4451. str+=sparray.ElementAt (pos).ElementAt (3);
  4452. str+=";";
  4453. pos++;
  4454. }
  4455. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4456. m_Print.DrawRect2(StrRect, 2);*/
  4457. CRect sprc[2];
  4458. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4459. // AutoDraw(m_Print, StrRect, m_bz.Left (leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4460. m_Print.DrawRect2(StrRect, 2);
  4461. sprc[0] = StrRect;
  4462. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  4463. // AutoDraw(m_Print, StrRect, m_bz.Right (leng-leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4464. m_Print.DrawRect2(StrRect, 2);
  4465. sprc[1] = StrRect;
  4466. //AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4467. {
  4468. CString temp, tempspno, tempbz;
  4469. CSize size;
  4470. BOOL bRun = 0;
  4471. int fontsize = 12;
  4472. ll: tempspno = m_bz;
  4473. m_Print.SetFontFace(fontsize, 1, "宋体");
  4474. for (i = 0; i<2; i++)
  4475. {
  4476. if (!tempspno.IsEmpty())
  4477. {
  4478. temp = tempspno;
  4479. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4480. int right = 0;
  4481. CRect temprc = sprc[i];
  4482. while (size.cx>temprc.Width())
  4483. {
  4484. right++;
  4485. temp = tempspno.Left(tempspno.GetLength() - (right));
  4486. if (GIsHalfHZ(temp))
  4487. {
  4488. right++;
  4489. temp.Delete(temp.GetLength() - 1);
  4490. }
  4491. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4492. }
  4493. if (bRun)
  4494. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4495. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  4496. if (tempspno.IsEmpty())i++;
  4497. }
  4498. }
  4499. if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
  4500. {
  4501. fontsize--;
  4502. goto ll;
  4503. }
  4504. if (bRun == 0)
  4505. {
  4506. bRun = 1;
  4507. goto ll;
  4508. }
  4509. }
  4510. m_Print.SetFontFace(11, 1, "宋体");
  4511. //////////////////////load3
  4512. rcpos = -1;
  4513. for (i = 0; i < 24; i++)
  4514. {
  4515. StrRect = load3.m_rcarray.ElementAt(i);
  4516. m_Print.DrawRect2(StrRect, 1);
  4517. }
  4518. CStringArray strarray;
  4519. strarray.Add("营业员");
  4520. strarray.Add("前台接待");
  4521. strarray.Add("化妆师");
  4522. strarray.Add("礼服师");
  4523. strarray.Add("摄影师");
  4524. strarray.Add("摄影助理");
  4525. strarray.Add("美工师");
  4526. strarray.Add("设计师");
  4527. for (i = 0; i < 8; i++)
  4528. {
  4529. StrRect = load3.m_rcarray.ElementAt(i);
  4530. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4531. }
  4532. strarray.RemoveAll();
  4533. strarray.Add(m_ren);
  4534. strarray.Add(g_List1array.ElementAt(0).ElementAt(49));
  4535. strarray.Add(m_waiter2);
  4536. strarray.Add(g_List1array.ElementAt(0).ElementAt(51));
  4537. strarray.Add(m_waiter1);
  4538. strarray.Add(g_List1array.ElementAt(0).ElementAt(50));
  4539. strarray.Add("");
  4540. strarray.Add(m_waiter4);
  4541. for (i = 8; i < 16; i++)
  4542. {
  4543. StrRect = load3.m_rcarray.ElementAt(i);
  4544. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 8), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4545. }
  4546. StrRect = load3.m_rcarray.ElementAt(27);
  4547. m_Print.DrawText((LPTSTR)(LPCTSTR)"客户电话: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4548. StrRect = load3.m_rcarray.ElementAt(28);
  4549. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4550. m_Print.SetFontFace(13, 1, "宋体");
  4551. StrRect = load3.m_rcarray.ElementAt(25);
  4552. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4553. StrRect = load3.m_rcarray.ElementAt(26);
  4554. m_Print.DrawRect2(StrRect, 2);
  4555. StrRect = load3.m_rcarray.ElementAt(24);
  4556. str = "\
  4557. 顾客须知\r\n\
  4558. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  4559. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  4560. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  4561. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  4562. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  4563. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  4564. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  4565. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  4566. AutoDraw(m_Print, StrRect, str, 1.8f);
  4567. PrintPreview dlg;
  4568. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4569. dlg.m_pDC = m_Print.GetPDC();
  4570. if (dlg.DoModal() != IDOK)return;
  4571. //结束打印
  4572. m_Print.EndPage();
  4573. m_Print.EndPrint();
  4574. }
  4575. void CMainFrame::PrintDailyForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4576. {
  4577. // TODO: Add your control notification handler code here
  4578. int pages = Listarray->GetSize() / 46;
  4579. if (Listarray->GetSize() % 46)pages++;
  4580. for (int aa = 0; aa < pages; aa++)
  4581. {
  4582. PrintPreview dlg;
  4583. CPrintRX m_Print;
  4584. m_Print.InitToPrint(NULL, 1);
  4585. m_Print.StartPrint();
  4586. m_Print.StartPage();
  4587. CRect mainrc(0, 0, 560, 793);
  4588. float fscale;
  4589. {
  4590. int w, h;
  4591. m_Print.GetWidHei(w, h);
  4592. fscale = (float)w / (float)h;
  4593. }
  4594. mainrc.DeflateRect(25, 40, 10, 0);
  4595. CRect rc, rc2;
  4596. rc = mainrc;
  4597. rc.bottom = rc.top;
  4598. rc.top -= 20;
  4599. m_Print.SetFontFace(16, 1, "黑体");
  4600. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4601. m_Print.SetFontFace(9, 1, "宋体");
  4602. CString str;
  4603. int wid[4] = { 320, 60, 60, 90 };
  4604. int hei = 16;
  4605. if (fscale > 0.71)hei = 15;
  4606. rc = mainrc;
  4607. rc.bottom = rc.top + hei;
  4608. for (int i = 0; i < 47; i++)
  4609. {
  4610. rc2.top = rc.top + i*hei;
  4611. rc2.bottom = rc.bottom + i*hei;
  4612. rc2.left = rc.left;
  4613. rc2.right = rc.left + wid[0];
  4614. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  4615. for (int j = 0; j<4; j++)
  4616. {
  4617. m_Print.DrawRect2(rc2, 1);
  4618. if (Listarray->GetSize()>aa * 46 + i)
  4619. {
  4620. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  4621. rc2.left += 3;
  4622. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4623. rc2.left -= 3;
  4624. }
  4625. rc2.left += wid[j];
  4626. rc2.right = rc2.left + wid[j + 1];
  4627. }
  4628. }
  4629. rc2.top += 2;
  4630. rc2.left += 2; rc2.right = mainrc.right + 4;
  4631. m_Print.SetFontFace(8, 1, "宋体");
  4632. int infopos = info.Find("***");
  4633. if (infopos != -1)
  4634. {
  4635. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Left(infopos), rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4636. CRect rc3 = rc2;
  4637. rc3.top = rc2.bottom - 4;
  4638. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Right(info.GetLength() - infopos - 3), rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4639. }
  4640. else
  4641. m_Print.DrawText((LPTSTR)(LPCTSTR)info, rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4642. str.Format(" 页:%d/%d", aa + 1, pages);
  4643. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4644. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  4645. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4646. dlg.m_pDC = m_Print.GetPDC();
  4647. // dlg.m_mode=1;
  4648. if (aa == 0)
  4649. {
  4650. if (dlg.DoModal() != IDOK)
  4651. return;
  4652. }
  4653. //结束打印
  4654. m_Print.EndPage();
  4655. m_Print.EndPrint();
  4656. }
  4657. }
  4658. void CMainFrame::PrintLoginForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4659. {
  4660. // TODO: Add your control notification handler code here
  4661. int sinlecount = 33 * 6;
  4662. int pages = Listarray->GetSize() / sinlecount;
  4663. if (Listarray->GetSize() % sinlecount)pages++;
  4664. for (int aa = 0; aa < pages; aa++)
  4665. {
  4666. PrintPreview dlg;
  4667. CPrintRX m_Print;
  4668. m_Print.InitToPrint(NULL, 1);
  4669. m_Print.StartPrint();
  4670. m_Print.StartPage();
  4671. CRect mainrc(0, 0, 560, 793);
  4672. float fscale;
  4673. {
  4674. int w, h;
  4675. m_Print.GetWidHei(w, h);
  4676. fscale = (float)w / (float)h;
  4677. }
  4678. mainrc.DeflateRect(25, 40, 10, 0);
  4679. CString str;
  4680. CRect rc, rc2;
  4681. rc = mainrc;
  4682. rc.bottom = rc.top;
  4683. rc.top -= 20;
  4684. rc.left -= 20;
  4685. m_Print.SetFontFace(12, 1, "黑体");
  4686. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4687. m_Print.SetFontFace(6, 1, "宋体");
  4688. str.Format(" 页:%d/%d", aa + 1, pages);
  4689. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4690. rc.right = mainrc.right + 20;
  4691. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4692. int wid[2] = { 50, 110 };
  4693. int hei = 11;
  4694. rc = mainrc;
  4695. rc.bottom = rc.top + hei;
  4696. rc.top += 10;
  4697. rc.bottom += 10;
  4698. int dtx = rc.Width() / 3 + 18;
  4699. int dty = 380;
  4700. for (int j = 0; j < 6; j++)
  4701. {
  4702. if (Listarray->GetSize() < aa*sinlecount + 33 * (j + 1))continue;
  4703. for (int i = 0; i < 33; i++)
  4704. {
  4705. rc2.top = rc.top + i*hei;
  4706. rc2.bottom = rc.bottom + i*hei;
  4707. rc2.left = rc.left;
  4708. rc2.right = rc.left + wid[0];
  4709. if (i == 0)
  4710. {
  4711. // rc2.left +=wid[1];
  4712. rc2.right += wid[1];
  4713. }
  4714. if (j == 1 || j == 4)
  4715. {
  4716. rc2.left += dtx;
  4717. rc2.right += dtx;
  4718. }
  4719. if (j == 2 || j == 5)
  4720. {
  4721. rc2.left += dtx * 2;
  4722. rc2.right += dtx * 2;
  4723. }
  4724. if (j == 3 || j == 4 || j == 5)
  4725. {
  4726. rc2.top += dty;
  4727. rc2.bottom += dty;
  4728. }
  4729. m_Print.DrawRect2(rc2, 1);
  4730. if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
  4731. {
  4732. str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(0);
  4733. rc2.left += 3;
  4734. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4735. rc2.left -= 3;
  4736. }
  4737. if (i == 0)continue;
  4738. rc2.left = rc2.right;
  4739. rc2.right += wid[1];
  4740. m_Print.DrawRect2(rc2, 1);
  4741. if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
  4742. {
  4743. if (Listarray->ElementAt(aa*sinlecount + 33 * j + i).GetSize() > 1)
  4744. {
  4745. str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(1);
  4746. rc2.left += 3;
  4747. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4748. rc2.left -= 3;
  4749. }
  4750. }
  4751. /* if(Listarray->GetSize ()>aa*46+i)
  4752. {
  4753. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4754. rc2.left +=3;
  4755. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4756. rc2.left -=3;
  4757. }
  4758. rc2.left +=wid[j];
  4759. rc2.right =rc2.left+wid[j+1];*/
  4760. }
  4761. }
  4762. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4763. dlg.m_pDC = m_Print.GetPDC();
  4764. if (aa == 0)
  4765. {
  4766. if (dlg.DoModal() != IDOK)
  4767. return;
  4768. }
  4769. //结束打印
  4770. m_Print.EndPage();
  4771. m_Print.EndPrint();
  4772. }
  4773. }
  4774. void CMainFrame::PrintTakeForm(CArray<CStringArray, CStringArray>*Listarray)
  4775. {
  4776. CString title;
  4777. CString info;
  4778. // TODO: Add your control notification handler code here
  4779. int sinlecount = 4;
  4780. int pages = Listarray->GetSize() / sinlecount;
  4781. if (Listarray->GetSize() % sinlecount)pages++;
  4782. for (int aa = 0; aa < pages; aa++)
  4783. {
  4784. PrintPreview dlg;
  4785. CPrintRX m_Print;
  4786. m_Print.InitToPrint(NULL, 1);
  4787. m_Print.StartPrint();
  4788. m_Print.StartPage();
  4789. CRect mainrc(0, 0, 560, 793);
  4790. float fscale;
  4791. {
  4792. int w, h;
  4793. m_Print.GetWidHei(w, h);
  4794. fscale = (float)w / (float)h;
  4795. }
  4796. mainrc.DeflateRect(25, 40, 10, 0);
  4797. CString str;
  4798. CRect rc, rc2;
  4799. rc = mainrc;
  4800. rc.bottom = rc.top;
  4801. rc.top -= 20;
  4802. rc.left -= 20;
  4803. m_Print.SetFontFace(6, 1, "宋体");
  4804. str.Format(" 页:%d/%d", aa + 1, pages);
  4805. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  4806. rc.right = mainrc.right + 10;
  4807. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4808. m_Print.SetFontFace(12, 1, "宋体");
  4809. int wid[2] = { 70, 190 };
  4810. int hei = 22;
  4811. rc = mainrc;
  4812. rc.bottom = rc.top + hei;
  4813. rc.top += 10;
  4814. rc.bottom += 10;
  4815. int dtx = rc.Width() / 2 + 18;
  4816. int dty = 380;
  4817. int arraysize = Listarray->ElementAt(0).GetSize();
  4818. for (int j = 0; j < 4; j++)
  4819. {
  4820. if (Listarray->GetSize() <= aa*sinlecount + j)continue;
  4821. for (int i = 0; i < arraysize; i++)
  4822. {
  4823. rc2.top = rc.top + i / 2 * hei;
  4824. rc2.bottom = rc.bottom + i / 2 * hei;
  4825. rc2.left = rc.left;
  4826. rc2.right = rc.left + wid[0];
  4827. if (i % 2)
  4828. {
  4829. rc2.left = rc2.right;
  4830. rc2.right += wid[1];
  4831. }
  4832. if (j == 1 || j == 3)
  4833. {
  4834. rc2.left += dtx;
  4835. rc2.right += dtx;
  4836. }
  4837. if (j == 2 || j == 3)
  4838. {
  4839. rc2.top += dty;
  4840. rc2.bottom += dty;
  4841. }
  4842. if (i == arraysize - 1 || i == arraysize - 2)
  4843. {
  4844. rc2.bottom += hei * 2;
  4845. }
  4846. m_Print.DrawRect2(rc2, 1);
  4847. {
  4848. str = Listarray->ElementAt(aa*sinlecount + j).ElementAt(i);
  4849. if (i == arraysize - 1)
  4850. {
  4851. CRect rc3 = rc2;
  4852. rc3.left += 3;
  4853. rc3.top += 3;
  4854. AutoDraw(m_Print, rc3, str, 1.4f);
  4855. }
  4856. else if (i == arraysize - 2)
  4857. {
  4858. CRect rc3 = rc2;
  4859. rc3.left += 3;
  4860. rc3.top += 3;
  4861. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4862. }
  4863. else
  4864. {
  4865. rc2.left += 3;
  4866. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4867. rc2.left -= 3;
  4868. }
  4869. }
  4870. }
  4871. }
  4872. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  4873. dlg.m_pDC = m_Print.GetPDC();
  4874. if (aa == 0)
  4875. {
  4876. if (dlg.DoModal() != IDOK)
  4877. return;
  4878. }
  4879. //结束打印
  4880. m_Print.EndPage();
  4881. m_Print.EndPrint();
  4882. }
  4883. }
  4884. void CMainFrame::PrintThumbNail(CStringArray *array, CString client, BOOL bDir, CString m_size)
  4885. {
  4886. // TODO: Add your control notification handler code here
  4887. CStringArray titlearray;
  4888. CStringArray namearray;
  4889. CStringArray noarray;
  4890. CArray<CRect, CRect>rcarray;
  4891. CArray<CRect, CRect>widtharray;
  4892. if (m_size != "")
  4893. {
  4894. int pos = m_size.Find(";");
  4895. while (pos != -1)
  4896. {
  4897. CString size = m_size.Left(pos);
  4898. int pos2 = size.Find(":");
  4899. if (pos2 != -1)
  4900. {
  4901. CString str;
  4902. CRect rc;
  4903. str = size.Left(pos2);
  4904. noarray.Add(str);
  4905. str = size.Right(size.GetLength() - pos2 - 1);
  4906. pos2 = str.Find(",");
  4907. namearray.Add(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4908. pos2 = str.Find(",");
  4909. rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4910. pos2 = str.Find(",");
  4911. rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4912. widtharray.Add(rc);
  4913. pos2 = str.Find(",");
  4914. rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4915. pos2 = str.Find(",");
  4916. rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4917. pos2 = str.Find(",");
  4918. rc.right = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
  4919. rc.bottom = atoi(str);
  4920. rcarray.Add(rc);
  4921. }
  4922. m_size = m_size.Right(m_size.GetLength() - pos - 1);
  4923. pos = m_size.Find(";");
  4924. }
  4925. }
  4926. PrintPreview dlg;
  4927. CPrintRX m_Print;
  4928. m_Print.InitToPrint(NULL, 1);
  4929. m_Print.StartPrint();
  4930. m_Print.StartPage();
  4931. CRect mainrc(0, 0, 560, 793);
  4932. mainrc.DeflateRect(25, 50, 10, 0);
  4933. m_Print.SetFontFace(10, 1, "宋体");
  4934. CRect rc, rc2;
  4935. rc = mainrc;
  4936. rc.bottom = rc.top;
  4937. rc.top -= 20;
  4938. m_Print.DrawText((LPTSTR)(LPCTSTR)client, rc, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4939. rc.bottom -= 5;
  4940. m_Print.DrawRect2(rc, 2);
  4941. if (array->GetSize() > 130)m_Print.SetFontFace(8, 1, "宋体");
  4942. if (bDir)m_Print.SetFontFace(6, 1, "宋体");
  4943. ////////////////////////////////////////////////////////////////
  4944. int imgcount = array->GetSize();
  4945. int dtx = 5;
  4946. int dty = 15;
  4947. int cx, cy;
  4948. int countx = 5;
  4949. int county = 1;
  4950. while (1)
  4951. {
  4952. if (countx*county >= imgcount)
  4953. {
  4954. cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
  4955. cy = cx * 4 / 3;
  4956. break;
  4957. }
  4958. else
  4959. {
  4960. cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
  4961. cy = cx * 4 / 3;
  4962. if (cy*(county + 1) + dty*county < mainrc.Height())//Y方向可以增加一个
  4963. {
  4964. county++;
  4965. }
  4966. else//Y方向不能加,X方向加
  4967. {
  4968. countx++;
  4969. county = 1;
  4970. }
  4971. }
  4972. }
  4973. int imgpos = 0;
  4974. CString stemp;
  4975. CPen pen(PS_SOLID, 1, RGB(255, 0, 0));
  4976. CPen *oldpen = m_Print.m_DC.SelectObject(&pen);
  4977. CPen *oldpen2 = m_Print.m_memdc.SelectObject(&pen);
  4978. for (int i = 0; i < county; i++)
  4979. {
  4980. for (int j = 0; j < countx; j++)
  4981. {
  4982. rc = mainrc;
  4983. rc.top += i*(cy + dty);
  4984. rc.left += j*(cx + dtx);
  4985. rc.right = rc.left + cx;
  4986. rc.bottom = rc.top + cy;
  4987. Image *pImg = NULL;
  4988. if (imgpos >= array->GetSize())break;
  4989. CString str = array->ElementAt(imgpos);
  4990. CString spath = str.Left(str.ReverseFind('\\') + 1);
  4991. spath += "m";
  4992. spath += str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  4993. if (PathFileExists(spath))
  4994. ::LoadImageFromBuf(&pImg, spath);
  4995. else
  4996. {
  4997. ::LoadImageFromBuf(&pImg, str);
  4998. if (pImg == NULL)continue;
  4999. int orientation = GetOrientation(pImg);
  5000. if (orientation == 8)
  5001. pImg->RotateFlip(Rotate270FlipNone);
  5002. else if (orientation == 6)
  5003. pImg->RotateFlip(Rotate90FlipNone);
  5004. }
  5005. if (pImg == NULL)continue;
  5006. rc2 = rc;
  5007. RectFitDes(pImg->GetWidth(), pImg->GetHeight(), rc);
  5008. imgpos++;
  5009. m_Print.DrawImage(pImg, rc);
  5010. int imgwidth = pImg->GetWidth();
  5011. delete pImg;
  5012. rc2.top = rc2.bottom + 3;
  5013. rc2.bottom += 10;
  5014. if (bDir == 0)
  5015. str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  5016. else
  5017. {
  5018. stemp = str.Left(str.ReverseFind('\\'));
  5019. str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
  5020. if (stemp.ReverseFind('\\') != -1)
  5021. {
  5022. stemp = stemp.Right(stemp.GetLength() - stemp.ReverseFind('\\') - 1);
  5023. str = stemp + "\\" + str;
  5024. }
  5025. }
  5026. if (str.Find(".") != -1)
  5027. str = str.Left(str.Find("."));
  5028. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5029. if (noarray.GetSize())
  5030. {
  5031. rc2 = rc;
  5032. for (int aa = 0; aa < noarray.GetSize(); aa++)
  5033. {
  5034. float scale = (float)rc2.Width() / (float)imgwidth;
  5035. if (noarray.ElementAt(aa) == str)
  5036. {
  5037. int nIndex = aa;
  5038. CRect rc = rcarray.ElementAt(nIndex);
  5039. int wid = widtharray.ElementAt(nIndex).left;
  5040. int hei = widtharray.ElementAt(nIndex).top;
  5041. scale *= (float)imgwidth / (float)wid;
  5042. rc.left *= scale;
  5043. rc.right *= scale;
  5044. rc.top *= scale;
  5045. rc.bottom *= scale;
  5046. rc.left += rc2.left;
  5047. rc.right += rc2.left;
  5048. rc.top += rc2.top;
  5049. rc.bottom += rc2.top;
  5050. if (rc.left < rc2.left)rc.left = rc2.left;
  5051. if (rc.right > rc2.right)rc.right = rc2.right;
  5052. if (rc.top < rc2.top)rc.top = rc2.top;
  5053. if (rc.bottom > rc2.bottom)rc.bottom = rc2.bottom;
  5054. m_Print.DrawRect2(rc, 1);
  5055. }
  5056. }
  5057. }
  5058. }
  5059. }
  5060. m_Print.m_DC.SelectObject(oldpen);
  5061. m_Print.m_memdc.SelectObject(oldpen2);
  5062. /* CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  5063. StrRect.top -=15;StrRect.bottom -=15;
  5064. Image *pImg=NULL;
  5065. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  5066. m_Print.DrawImage(pImg, StrRect);
  5067. delete pImg;
  5068. m_Print.SetFontFace(10, 1, "宋体");
  5069. StrRect=load.m_rcarray .ElementAt (20);
  5070. StrRect.right=load.m_rcarray .ElementAt (23).right;
  5071. StrRect.top -=18;StrRect.bottom -=18;
  5072. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  5073. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5074. */
  5075. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  5076. dlg.m_pDC = m_Print.GetPDC();
  5077. if (dlg.DoModal() != IDOK)
  5078. return;
  5079. //结束打印
  5080. m_Print.EndPage();
  5081. m_Print.EndPrint();
  5082. }
  5083. // remark by Jeff
  5084. // 函数:PrintDinDan
  5085. // 参数:
  5086. // strOrderNumber:订单单号;(Order number)
  5087. // 返回:void
  5088. // 注意:#
  5089. void CMainFrame::PrintDinDan(CString strOrderNumber)//打印订单报表;
  5090. {
  5091. int printcot = 1;
  5092. for (int aa = 0; aa < printcot; aa++)
  5093. {
  5094. PrintPreview dlg;
  5095. CPrintRX m_Print;
  5096. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  5097. {
  5098. m_Print.InitToPrint(NULL, 1);
  5099. }
  5100. else
  5101. {
  5102. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  5103. if (name.IsEmpty())
  5104. m_Print.InitToPrint(NULL, 1);
  5105. else
  5106. {
  5107. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  5108. if (nret == -1 && aa == 0)
  5109. {
  5110. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  5111. }
  5112. }
  5113. }
  5114. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 0)
  5115. {
  5116. #ifdef ZHIAI_VERSION
  5117. PrintDinDan3(strOrderNumber);
  5118. return;
  5119. #endif
  5120. #ifdef SZBLCT_VERSION
  5121. PrintDinDan4(strOrderNumber);
  5122. return;
  5123. #endif
  5124. m_Print.StartPrint();
  5125. m_Print.StartPage();
  5126. LoadRect load;
  5127. load.SetLiaPath("6.lia");
  5128. load.SetMargins(-14, 15);
  5129. if (!load.Load())return;
  5130. LoadRect load2;
  5131. load2.SetLiaPath("7.lia");
  5132. load2.SetMargins(-14, 216 + 15);
  5133. if (!load2.Load())return;
  5134. LoadRect load3;
  5135. load3.SetLiaPath("8.lia");
  5136. load3.SetMargins(-14, 705 + 15);
  5137. if (!load3.Load())return;
  5138. int i;
  5139. //////////////////////////////////////////////////////////////
  5140. CStringArray txarray;
  5141. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
  5142. g_sendhead.code[0] = 11;
  5143. g_sendhead.code[1] = 52;
  5144. g_sendhead.code[2] = 50;
  5145. g_sendhead.code[3] = 150;
  5146. g_sendhead.code[4] = 77;
  5147. g_sendhead.code[5] = 4;
  5148. g_sendhead.tabcount = 6;
  5149. g_sendhead.bsql = 0;
  5150. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5151. CArray<CStringArray, CStringArray>sparray;
  5152. CArray<CStringArray, CStringArray>clientarray;
  5153. CArray<CStringArray, CStringArray>phonearray;
  5154. CArray<CStringArray, CStringArray>fgarray;
  5155. CArray<CStringArray, CStringArray>danweiarray;
  5156. CArray<CStringArray, CStringArray>jdarray;
  5157. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5158. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5159. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5160. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5161. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5162. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5163. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5164. CString m_taoxiname;
  5165. if (m_zs.Find("\\") != -1)
  5166. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
  5167. else
  5168. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
  5169. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5170. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5171. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5172. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5173. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5174. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5175. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5176. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5177. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5178. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  5179. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  5180. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  5181. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  5182. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  5183. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  5184. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  5185. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  5186. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  5187. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  5188. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  5189. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  5190. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5191. if (jdarray.GetSize())
  5192. {
  5193. if (m_bz.IsEmpty() == 0)
  5194. m_bz = "\r\n" + m_bz;
  5195. m_bz += "景点:";
  5196. }
  5197. #ifdef DDF_VERSION
  5198. m_bz += "219店:219路馨园小区对面\r\n";
  5199. m_bz += "金色店:万科金色家园小区东门南走20米荣光社区一楼\r\n";
  5200. m_bz += "万泰店:万泰锦绣华城小区正门\r\n";
  5201. #else
  5202. for (i = 0; i < jdarray.GetSize(); i++)
  5203. {
  5204. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  5205. }
  5206. m_bz.TrimRight(";");
  5207. #endif
  5208. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  5209. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  5210. if (IsHasRights2new(31) == 0)
  5211. {
  5212. m_phone1 = "***";
  5213. m_phone2 = "***";
  5214. }
  5215. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5216. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5217. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  5218. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  5219. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  5220. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  5221. filter = "name='" + m_ren + "'";
  5222. g_sendhead.code[0] = 5;
  5223. g_sendhead.tabcount = 1;
  5224. g_sendhead.bsql = 0;
  5225. int g_nYearposTemp = g_nYearpos;
  5226. g_nYearpos = -1;
  5227. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5228. g_nYearpos = g_nYearposTemp;
  5229. if (g_bSendOK == 0)return;
  5230. DataToArray(&phonearray);
  5231. m_money1.Format("%f", atof(m_taoxijiage));
  5232. m_money2.Format("%f", atof(m_payed1));
  5233. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5234. ConvertToPrice(m_money1);
  5235. ConvertToPrice(m_money2);
  5236. ConvertToPrice(m_money3);
  5237. ////////////////////////////////////////////////////////////////
  5238. int rcpos = -1;
  5239. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  5240. StrRect.top -= 15; StrRect.bottom -= 15;
  5241. Image *pImg = NULL;
  5242. #ifdef MNLS_VERSION
  5243. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  5244. #else
  5245. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  5246. #endif
  5247. m_Print.DrawImage(pImg, StrRect);
  5248. delete pImg;
  5249. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5250. {
  5251. Image *pImg = NULL;
  5252. g_nSendCode = 31;
  5253. int g_nYearposTemp = g_nYearpos;
  5254. g_nYearpos = -1;
  5255. g_pMainWnd->ProcessChatMessageRequest2(1);
  5256. g_nYearpos = g_nYearposTemp;
  5257. g_nSendCode = 0;
  5258. if (g_bSendOK == 0)return;
  5259. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  5260. if (pImg)
  5261. {
  5262. StrRect.left = 30;
  5263. StrRect.top = 12;
  5264. StrRect.right = StrRect.left + 60;
  5265. StrRect.bottom = StrRect.top + 60;
  5266. m_Print.DrawImage(pImg, StrRect);
  5267. delete pImg; pImg = NULL;
  5268. }
  5269. }
  5270. m_Print.SetFontFace(11, 1, "宋体");
  5271. StrRect = load.m_rcarray.ElementAt(20);
  5272. StrRect.right = load.m_rcarray.ElementAt(23).right;
  5273. StrRect.top -= 18; StrRect.bottom -= 18;
  5274. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  5275. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5276. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  5277. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5278. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5279. StrRect.top -= 15; StrRect.bottom -= 15;
  5280. #ifdef MNLS_VERSION
  5281. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5282. #endif
  5283. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5284. StrRect.top -= 15; StrRect.bottom -= 15;
  5285. #ifdef MNLS_VERSION
  5286. m_Print.DrawRect(StrRect);
  5287. #endif
  5288. m_Print.SetFontFace(7, 1, "黑体");
  5289. m_Print.SetColor(0xffffff);
  5290. #ifdef MNLS_VERSION
  5291. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5292. #endif
  5293. m_Print.SetColor(0);
  5294. m_Print.SetFontFace(15, 1, "宋体");
  5295. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5296. StrRect.top -= 15; StrRect.bottom -= 15;
  5297. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5298. CStringArray strarray;
  5299. strarray.Add("NO: " + strOrderNumber);
  5300. CString date;
  5301. date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  5302. strarray.Add(date);
  5303. strarray.Add("喜爱");
  5304. strarray.Add("格调");
  5305. if (fgarray.GetSize() == 12)
  5306. {
  5307. for (int i = 0; i < 12; i++)
  5308. strarray.Add(fgarray.ElementAt(i).ElementAt(0));
  5309. }
  5310. else
  5311. {
  5312. strarray.Add("复古典雅");
  5313. strarray.Add("温文尔雅");
  5314. strarray.Add("豪华艳丽");
  5315. strarray.Add("传统大方");
  5316. strarray.Add("新潮个性");
  5317. strarray.Add("浪漫奔放");
  5318. strarray.Add("简单素雅");
  5319. strarray.Add("活泼俏丽");
  5320. strarray.Add("妩媚温馨");
  5321. strarray.Add("温柔贤惠");
  5322. strarray.Add("成熟感性");
  5323. strarray.Add("清纯可爱");
  5324. }
  5325. strarray.Add("姓名");
  5326. // strarray.Add("职业");
  5327. strarray.Add("");
  5328. strarray.Add("地址");
  5329. strarray.Add("电话");
  5330. #ifdef CHILD_VERSION
  5331. strarray.Add("家长");
  5332. strarray.Add("宝宝");
  5333. #else
  5334. strarray.Add("先生");
  5335. strarray.Add("女士");
  5336. #endif
  5337. m_Print.SetFontFace(11, 1, "宋体");
  5338. for (i = 0; i < strarray.GetSize(); i++)
  5339. {
  5340. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5341. if (i < 2)
  5342. {
  5343. StrRect.top -= 15; StrRect.bottom -= 15;
  5344. }
  5345. if (i>15)
  5346. m_Print.DrawRect2(StrRect, 1);
  5347. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5348. }
  5349. for (i = 29; i <= 40; i++)
  5350. {
  5351. if (m_style.GetLength() <= (i - 29))continue;
  5352. if (m_style.GetAt(i - 29) != '1')continue;
  5353. StrRect = load.m_rcarray.ElementAt(i - 1);
  5354. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5355. }
  5356. for (i = 27; i <= 48; i++)
  5357. {
  5358. StrRect = load.m_rcarray.ElementAt(++rcpos);
  5359. m_Print.DrawRect2(StrRect, 1);
  5360. }
  5361. #ifdef CHILD_VERSION
  5362. StrRect = load.m_rcarray.ElementAt(45);
  5363. StrRect.right = StrRect.left + 62;
  5364. m_Print.DrawRect2(StrRect, 1);
  5365. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5366. StrRect.left = StrRect.right;
  5367. StrRect.right = StrRect.left + 62;
  5368. m_Print.DrawRect2(StrRect, 1);
  5369. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5370. StrRect.left = StrRect.right;
  5371. StrRect.right = StrRect.left + 62;
  5372. m_Print.DrawRect2(StrRect, 1);
  5373. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5374. StrRect.left = StrRect.right;
  5375. StrRect.right = StrRect.left + 62;
  5376. m_Print.DrawRect2(StrRect, 1);
  5377. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5378. #endif
  5379. /////////////////////////
  5380. strarray.RemoveAll();
  5381. CString temp;
  5382. temp.Format("拍摄多款选 %d 款,其中影", atoi(m_outside) + atoi(m_outside2));
  5383. strarray.Add(temp);
  5384. temp.Format("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  5385. strarray.Add(temp);
  5386. strarray.Add("化妆");
  5387. strarray.Add("造型");
  5388. #ifdef CHILD_VERSION
  5389. strarray.Add("");
  5390. #else
  5391. strarray.Add("婚纱");
  5392. #endif
  5393. strarray.Add("服饰");
  5394. strarray.Add("配");
  5395. strarray.Add("置");
  5396. strarray.Add("其");
  5397. strarray.Add("它");
  5398. strarray.Add("套系名称");
  5399. strarray.Add("镜款");
  5400. strarray.Add("套系总价");
  5401. strarray.Add("主摄影师");
  5402. strarray.Add("拍摄日期");
  5403. strarray.Add("定金");
  5404. #ifdef CHILD_VERSION
  5405. strarray.Add("主引导师");
  5406. #else
  5407. strarray.Add("主化妆师");
  5408. #endif
  5409. strarray.Add("看样日期");
  5410. strarray.Add("欠款余额");
  5411. strarray.Add("总监");
  5412. strarray.Add("取件日期");
  5413. rcpos = -1;
  5414. for (i = 0; i < strarray.GetSize(); i++)
  5415. {
  5416. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  5417. if (i>9)
  5418. m_Print.DrawRect2(StrRect, 1);
  5419. #ifdef CHILD_VERSION
  5420. if (i == 5)
  5421. StrRect.top -= StrRect.Height();
  5422. #endif
  5423. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5424. }
  5425. for (i = 22; i <= 41; i++)
  5426. {
  5427. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  5428. m_Print.DrawRect2(StrRect, 1);
  5429. }
  5430. /////////////////////////////
  5431. strarray.RemoveAll();
  5432. #ifdef CHILD_VERSION
  5433. strarray.Add("顾客方 家长:");
  5434. strarray.Add("宝宝:");
  5435. #else
  5436. strarray.Add("顾客方 先生:");
  5437. strarray.Add("女士:");
  5438. #endif
  5439. strarray.Add("电话:");
  5440. strarray.Add("影楼方 店长:");
  5441. strarray.Add("接单人:");
  5442. strarray.Add("电话:");
  5443. rcpos = -1;
  5444. for (i = 0; i < strarray.GetSize(); i++)
  5445. {
  5446. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  5447. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5448. }
  5449. for (i = 7; i <= 12; i++)
  5450. {
  5451. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  5452. // if(i!=10)
  5453. m_Print.DrawRect2(StrRect, 2);
  5454. }
  5455. //////////////////////////////////////
  5456. //开始打数据
  5457. strarray.RemoveAll();
  5458. strarray.Add(m_name1);
  5459. strarray.Add(m_name2);
  5460. /// strarray.Add (m_occupation1);
  5461. // strarray.Add (m_occupation2);
  5462. strarray.Add("");
  5463. strarray.Add("");
  5464. strarray.Add(m_addr1);
  5465. #ifdef CHILD_VERSION
  5466. strarray.Add("");
  5467. #else
  5468. strarray.Add(m_addr2);
  5469. #endif
  5470. strarray.Add(m_phone1);
  5471. strarray.Add(m_phone2);
  5472. for (i = 41; i <= 48; i++)
  5473. {
  5474. StrRect = load.m_rcarray.ElementAt(i - 1);
  5475. StrRect.left += 4;
  5476. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5477. }
  5478. ///////////////////////////////
  5479. strarray.RemoveAll();
  5480. strarray.Add(m_money1);
  5481. strarray.Add(m_waiter1);
  5482. strarray.Add(m_time2);
  5483. strarray.Add(m_money2);
  5484. strarray.Add(m_waiter2);
  5485. strarray.Add(m_time4);
  5486. strarray.Add(m_money3);
  5487. strarray.Add("");
  5488. strarray.Add(m_time5);
  5489. for (i = 32; i <= 40; i++)
  5490. {
  5491. StrRect = load2.m_rcarray.ElementAt(i - 1);
  5492. StrRect.left += 4;
  5493. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5494. }
  5495. ///////////////////////////////
  5496. strarray.RemoveAll();
  5497. strarray.Add(m_name1);
  5498. strarray.Add(m_name2);
  5499. CString phone;
  5500. if (m_phone1.IsEmpty() == 0)
  5501. phone = m_phone1 + ",";
  5502. phone += m_phone2;
  5503. phone.TrimRight(",");
  5504. strarray.Add(phone);
  5505. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
  5506. strarray.Add(m_ren);
  5507. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  5508. for (i = 7; i <= 12; i++)
  5509. {
  5510. StrRect = load3.m_rcarray.ElementAt(i - 1);
  5511. StrRect.left += 4;
  5512. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5513. }
  5514. StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
  5515. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5516. StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
  5517. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5518. StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
  5519. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5520. //////////////////////////////
  5521. //开始画文字
  5522. StrRect = load2.m_rcarray.ElementAt(30);
  5523. StrRect.left += 3;
  5524. StrRect.top += 3;
  5525. StrRect.right -= 2;
  5526. StrRect.bottom -= 2;
  5527. AutoDraw(m_Print, StrRect, m_bz, 1.4f);
  5528. StrRect = load2.m_rcarray.ElementAt(29);
  5529. StrRect.left += 3;
  5530. StrRect.top += 3;
  5531. StrRect.right -= 2;
  5532. StrRect.bottom -= 2;
  5533. str = "";
  5534. for (i = 0; i < sparray.GetSize(); i++)
  5535. {
  5536. str += sparray.ElementAt(i).ElementAt(5);
  5537. str += " 数量:";
  5538. str += sparray.ElementAt(i).ElementAt(3);
  5539. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5540. str += "\r\n";
  5541. }
  5542. str.TrimRight("\r\n");
  5543. AutoDraw(m_Print, StrRect, str, 1.4);
  5544. StrRect = load2.m_rcarray.ElementAt(40);
  5545. StrRect.top += 8;
  5546. m_Print.SetFontFace(12, 1, "黑体");
  5547. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5548. StrRect.left += 3;
  5549. StrRect.top += 30;
  5550. StrRect.right -= 2;
  5551. StrRect.bottom -= 2;
  5552. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5553. if (str.IsEmpty())
  5554. {
  5555. str = "\
  5556. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5557. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5558. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5559. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5560. 持良好的心境.\r\n\
  5561. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5562. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5563. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5564. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5565. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5566. 勿进影室, 以免影响拍摄.\r\n\
  5567. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5568. 师或店长沟通.\r\n\
  5569. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5570. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5571. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5572. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5573. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5574. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5575. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5576. 还.";
  5577. }
  5578. AutoDraw(m_Print, StrRect, str, 1.8);
  5579. }
  5580. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 1)
  5581. {//AfxMessageBox("yyy");
  5582. m_Print.StartPrint();
  5583. m_Print.StartPage();
  5584. LoadRect load;
  5585. load.SetLiaPath("6-2.lia");
  5586. load.SetMargins(0, 0);
  5587. if (!load.Load())return;
  5588. int i;
  5589. //////////////////////////////////////////////////////////////
  5590. CStringArray txarray;
  5591. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
  5592. g_sendhead.code[0] = 11;
  5593. g_sendhead.code[1] = 52;
  5594. g_sendhead.code[2] = 50;
  5595. g_sendhead.code[3] = 150;
  5596. g_sendhead.code[4] = 77;
  5597. g_sendhead.code[5] = 4;
  5598. g_sendhead.tabcount = 6;
  5599. g_sendhead.bsql = 0;
  5600. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5601. CArray<CStringArray, CStringArray>sparray;
  5602. CArray<CStringArray, CStringArray>clientarray;
  5603. CArray<CStringArray, CStringArray>phonearray;
  5604. CArray<CStringArray, CStringArray>fgarray;
  5605. CArray<CStringArray, CStringArray>danweiarray;
  5606. CArray<CStringArray, CStringArray>jdarray;
  5607. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5608. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5609. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5610. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5611. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5612. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5613. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  5614. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5615. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5616. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5617. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5618. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5619. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5620. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5621. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5622. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5623. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5624. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  5625. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  5626. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  5627. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  5628. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  5629. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  5630. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  5631. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  5632. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  5633. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  5634. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  5635. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  5636. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  5637. if (jdarray.GetSize())
  5638. {
  5639. if (m_bz.IsEmpty() == 0)
  5640. m_bz = "\r\n" + m_bz;
  5641. m_bz += "景点:";
  5642. }
  5643. for (i = 0; i < jdarray.GetSize(); i++)
  5644. {
  5645. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  5646. }
  5647. m_bz.TrimRight(";");
  5648. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  5649. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  5650. if (IsHasRights2new(31) == 0)
  5651. {
  5652. m_phone1 = "***";
  5653. m_phone2 = "***";
  5654. }
  5655. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  5656. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  5657. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  5658. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  5659. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  5660. CString str;
  5661. filter = "name='" + m_ren + "'";
  5662. g_sendhead.code[0] = 5;
  5663. g_sendhead.tabcount = 1;
  5664. g_sendhead.bsql = 0;
  5665. int g_nYearposTemp = g_nYearpos;
  5666. g_nYearpos = -1;
  5667. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5668. g_nYearpos = g_nYearposTemp;
  5669. if (g_bSendOK == 0)return;
  5670. DataToArray(&phonearray);
  5671. m_money1.Format("%f", atof(m_taoxijiage));
  5672. m_money2.Format("%f", atof(m_payed1));
  5673. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  5674. ConvertToPrice(m_money1);
  5675. ConvertToPrice(m_money2);
  5676. ConvertToPrice(m_money3);
  5677. ////////////////////////////////////////////////////////////////
  5678. int rcpos = -1;
  5679. CRect StrRect = load.m_rcarray.ElementAt(0);
  5680. m_Print.SetFontFace(25, 1, "黑体");
  5681. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "预约单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5682. m_Print.SetFontFace(11, 1, "宋体");
  5683. StrRect = load.m_rcarray.ElementAt(1);
  5684. if (m_time1.GetLength() == 10)
  5685. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  5686. else
  5687. str = "开单日期:";
  5688. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5689. StrRect = load.m_rcarray.ElementAt(2);
  5690. m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + strOrderNumber), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5691. CStringArray strarray;
  5692. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5693. {
  5694. Image *pImg = NULL;
  5695. g_nSendCode = 31;
  5696. int g_nYearposTemp = g_nYearpos;
  5697. g_nYearpos = -1;
  5698. g_pMainWnd->ProcessChatMessageRequest2(1);
  5699. g_nYearpos = g_nYearposTemp;
  5700. g_nSendCode = 0;
  5701. if (g_bSendOK == 0)return;
  5702. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  5703. if (pImg)
  5704. {
  5705. StrRect.left = 47;
  5706. StrRect.top = 12;
  5707. StrRect.right = StrRect.left + 60;
  5708. StrRect.bottom = StrRect.top + 60;
  5709. m_Print.DrawImage(pImg, StrRect);
  5710. delete pImg; pImg = NULL;
  5711. }
  5712. }
  5713. #ifdef CHILD_VERSION
  5714. strarray.Add("家长姓名");
  5715. strarray.Add("宝宝姓名");
  5716. #else
  5717. strarray.Add("先生姓名");
  5718. strarray.Add("女士姓名");
  5719. #endif
  5720. strarray.Add("服装套数");
  5721. // strarray.Add ("拍摄张数");
  5722. #ifdef CHILD_VERSION
  5723. strarray.Add("出生日期");
  5724. #else
  5725. strarray.Add("结婚日期");
  5726. #endif
  5727. strarray.Add("拍摄日期");
  5728. strarray.Add("联系电话");
  5729. strarray.Add("联系电话");
  5730. strarray.Add("造型套数");
  5731. if (m_zs.Find("\\") != -1)
  5732. strarray.Add("入底\\入册");
  5733. else
  5734. strarray.Add("入底张数");
  5735. strarray.Add("选片日期");
  5736. strarray.Add("QQ/邮箱");
  5737. strarray.Add("套系总额");
  5738. strarray.Add("定金");
  5739. strarray.Add("余款金额");
  5740. strarray.Add("取件日期");
  5741. strarray.Add(m_name1);
  5742. strarray.Add(m_name2);
  5743. strarray.Add(m_clothescount);
  5744. // str.Format("%d", atoi(m_zs)*3);
  5745. // strarray.Add (str);
  5746. #ifdef CHILD_VERSION
  5747. strarray.Add(m_birthday1);
  5748. #else
  5749. strarray.Add(m_time3);
  5750. #endif
  5751. strarray.Add(m_time2);
  5752. strarray.Add(m_phone1);
  5753. strarray.Add(m_phone2);
  5754. strarray.Add(m_clothescount2);
  5755. strarray.Add(m_zs);
  5756. strarray.Add(m_time4);
  5757. strarray.Add(m_qq1);
  5758. strarray.Add(m_money1);
  5759. strarray.Add(m_money2);
  5760. strarray.Add(m_money3);
  5761. strarray.Add(m_time5);
  5762. for (i = 4; i <= 33; i++)
  5763. {
  5764. StrRect = load.m_rcarray.ElementAt(i - 1);
  5765. m_Print.DrawRect2(StrRect, 1);
  5766. if (strarray.GetSize() > (i - 4))
  5767. {
  5768. if (i <= 18)
  5769. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5770. else
  5771. {
  5772. StrRect.left += 4;
  5773. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5774. }
  5775. }
  5776. }
  5777. int dt = 413;
  5778. StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5779. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5780. StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5781. StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5782. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5783. StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  5784. StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
  5785. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5786. StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
  5787. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5788. StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
  5789. m_Print.DrawText((LPTSTR)(LPCTSTR)("网址:" + g_cominfoarray.ElementAt(0).ElementAt(13)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5790. //////////////////////////////
  5791. //开始画文字
  5792. StrRect = load.m_rcarray.ElementAt(7);
  5793. int hei = StrRect.Height();
  5794. StrRect.top += hei;
  5795. StrRect.bottom += hei;
  5796. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5797. StrRect.top += dt;
  5798. StrRect.bottom += dt;
  5799. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5800. StrRect = load.m_rcarray.ElementAt(17);
  5801. StrRect.top += hei;
  5802. StrRect.bottom += hei;
  5803. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5804. StrRect = load.m_rcarray.ElementAt(33);
  5805. StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
  5806. StrRect.top += hei;
  5807. StrRect.left += 3;
  5808. StrRect.top += 3;
  5809. StrRect.right -= 2;
  5810. StrRect.bottom -= 2;
  5811. str = "";
  5812. for (i = 0; i < sparray.GetSize(); i++)
  5813. {
  5814. str += sparray.ElementAt(i).ElementAt(5);
  5815. str += " 数量:";
  5816. str += sparray.ElementAt(i).ElementAt(3);
  5817. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  5818. str += "\r\n";
  5819. }
  5820. str.TrimRight("\r\n");
  5821. AutoDraw(m_Print, StrRect, str, 1.4);
  5822. StrRect = load.m_rcarray.ElementAt(33);
  5823. StrRect.top += dt;
  5824. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  5825. StrRect.top += hei;
  5826. StrRect.left += 3;
  5827. StrRect.top += 3;
  5828. StrRect.right -= 2;
  5829. StrRect.bottom -= 2;
  5830. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5831. StrRect = load.m_rcarray.ElementAt(34);
  5832. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  5833. StrRect.top += hei;
  5834. StrRect.left += 3;
  5835. StrRect.top += 3;
  5836. StrRect.right -= 2;
  5837. StrRect.bottom -= 2;
  5838. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  5839. if (str.IsEmpty())
  5840. {
  5841. str = "\
  5842. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5843. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5844. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5845. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5846. 持良好的心境.\r\n\
  5847. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5848. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5849. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5850. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5851. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5852. 勿进影室, 以免影响拍摄.\r\n\
  5853. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5854. 师或店长沟通.\r\n\
  5855. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5856. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5857. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5858. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5859. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5860. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5861. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5862. 还.";
  5863. }
  5864. AutoDraw(m_Print, StrRect, str, 1.8);
  5865. StrRect = load.m_rcarray.ElementAt(35);
  5866. StrRect.bottom += 100;
  5867. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  5868. 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∨";
  5869. // AutoDraw(m_Print, StrRect, str, 1.4);
  5870. }
  5871. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 2)
  5872. {
  5873. PrintDinDan5(strOrderNumber);
  5874. return;
  5875. }
  5876. else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
  5877. {
  5878. PrintDinDan6(strOrderNumber);
  5879. return;
  5880. }
  5881. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  5882. dlg.m_pDC = m_Print.GetPDC();
  5883. dlg.m_mode = 1;
  5884. if (aa == 0)
  5885. {
  5886. if (dlg.DoModal() != IDOK)
  5887. return;
  5888. printcot = dlg.m_num;
  5889. }
  5890. //结束打印
  5891. m_Print.EndPage();
  5892. m_Print.EndPrint();
  5893. }
  5894. }
  5895. void CovertDate2(CString date, CString &date2)
  5896. {
  5897. try
  5898. {
  5899. if (date == "2013-04-09")
  5900. {
  5901. date2 = "2013-02-29";
  5902. return;
  5903. }
  5904. ///////////////////////////////////
  5905. date2 = date;
  5906. GongToLong(date2);
  5907. ////////////////////////////////////
  5908. return;
  5909. CCalendarConvert m_CalendarConvert;
  5910. SYSTEMTIME src = { 0 };
  5911. SYSTEMTIME dst = { 0 };
  5912. COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0);
  5913. COleDateTime m_timeGregorian;
  5914. m_timeLunar.GetAsSystemTime(src);
  5915. BOOL bEmbolism = 0;
  5916. if (m_CalendarConvert.Gregorian2Lunar(&src, &dst, &bEmbolism))
  5917. {
  5918. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst);
  5919. date2.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay());
  5920. if (m_timeGregorian.GetYear() == -1)date2 = "2000-13-32";
  5921. }
  5922. else
  5923. {
  5924. date2.Empty();
  5925. }
  5926. }
  5927. catch (...)
  5928. {
  5929. }
  5930. }
  5931. void CMainFrame::PrintDinDan5(CString m_id)
  5932. {
  5933. int printcot = 1;
  5934. for (int aa = 0; aa < printcot; aa++)
  5935. {
  5936. PrintPreview dlg;
  5937. CPrintRX m_Print;
  5938. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  5939. {
  5940. m_Print.InitToPrint(NULL, 1);
  5941. }
  5942. else
  5943. {
  5944. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  5945. if (name.IsEmpty())
  5946. m_Print.InitToPrint(NULL, 1);
  5947. else
  5948. {
  5949. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  5950. if (nret == -1 && aa == 0)
  5951. {
  5952. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  5953. }
  5954. }
  5955. }
  5956. {
  5957. m_Print.StartPrint();
  5958. m_Print.StartPage();
  5959. LoadRect load;
  5960. load.SetLiaPath("19.lia");
  5961. load.SetMargins(0, -20);
  5962. if (!load.Load())return;
  5963. int i;
  5964. //////////////////////////////////////////////////////////////
  5965. CStringArray txarray;
  5966. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  5967. g_sendhead.code[0] = 11;
  5968. g_sendhead.code[1] = 52;
  5969. g_sendhead.code[2] = 50;
  5970. g_sendhead.code[3] = 150;
  5971. g_sendhead.code[4] = 77;
  5972. g_sendhead.code[5] = 4;
  5973. g_sendhead.tabcount = 6;
  5974. g_sendhead.bsql = 0;
  5975. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  5976. CArray<CStringArray, CStringArray>sparray;
  5977. CArray<CStringArray, CStringArray>clientarray;
  5978. CArray<CStringArray, CStringArray>phonearray;
  5979. CArray<CStringArray, CStringArray>fgarray;
  5980. CArray<CStringArray, CStringArray>danweiarray;
  5981. CArray<CStringArray, CStringArray>jdarray;
  5982. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5983. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  5984. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  5985. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  5986. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  5987. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  5988. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
  5989. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  5990. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  5991. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  5992. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  5993. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  5994. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  5995. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  5996. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  5997. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  5998. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  5999. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  6000. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  6001. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  6002. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  6003. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  6004. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  6005. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  6006. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  6007. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  6008. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  6009. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  6010. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(36);
  6011. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  6012. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  6013. CString m_txtype = g_List1array.ElementAt(0).ElementAt(52);
  6014. CString m_memberno = g_List1array.ElementAt(0).ElementAt(47);
  6015. CString str;
  6016. if (jdarray.GetSize())
  6017. {
  6018. if (m_bz.IsEmpty() == 0)
  6019. m_bz = "\r\n" + m_bz;
  6020. m_bz += "景点:";
  6021. }
  6022. for (i = 0; i < jdarray.GetSize(); i++)
  6023. {
  6024. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  6025. }
  6026. m_bz.TrimRight(";");
  6027. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  6028. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  6029. if (IsHasRights2new(31) == 0)
  6030. {
  6031. m_phone1 = "***";
  6032. m_phone2 = "***";
  6033. }
  6034. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  6035. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  6036. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  6037. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  6038. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  6039. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  6040. BOOL check1 = atoi(clientarray.ElementAt(0).ElementAt(15));
  6041. filter = "name='" + m_ren + "'";
  6042. g_sendhead.code[0] = 5;
  6043. g_sendhead.tabcount = 1;
  6044. g_sendhead.bsql = 0;
  6045. int g_nYearposTemp = g_nYearpos;
  6046. g_nYearpos = -1;
  6047. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6048. g_nYearpos = g_nYearposTemp;
  6049. if (g_bSendOK == 0)return;
  6050. DataToArray(&phonearray);
  6051. m_money1.Format("%f", atof(m_taoxijiage));
  6052. m_money2.Format("%f", atof(m_payed1));
  6053. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  6054. ConvertToPrice(m_money1);
  6055. ConvertToPrice(m_money2);
  6056. ConvertToPrice(m_money3);
  6057. ////////////////////////////////////////////////////////////////
  6058. int rcpos = -1;
  6059. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  6060. //Image *pImg=NULL;
  6061. // ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  6062. // m_Print.DrawImage(pImg, StrRect);
  6063. // delete pImg;
  6064. m_Print.SetFontFace(20, 1, "宋体");
  6065. StrRect = load.m_rcarray.ElementAt(1);
  6066. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "定单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6067. m_Print.SetFontFace(12, 1, "宋体");
  6068. StrRect = load.m_rcarray.ElementAt(2);
  6069. m_Print.DrawText((LPTSTR)(LPCTSTR)("NO." + m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6070. StrRect = load.m_rcarray.ElementAt(3);
  6071. str.Format("%s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  6072. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6073. StrRect = load.m_rcarray.ElementAt(4);
  6074. m_Print.DrawText((LPTSTR)(LPCTSTR)("联系人:" + m_name1), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6075. CStringArray strarray;
  6076. strarray.Add("姓名");
  6077. strarray.Add("性别");
  6078. strarray.Add("年龄");
  6079. strarray.Add("出生年月");
  6080. strarray.Add("套系价格");
  6081. strarray.Add("定金");
  6082. strarray.Add("欠款");
  6083. strarray.Add("拍摄类型");
  6084. strarray.Add("会员卡号");
  6085. strarray.Add("定单人");
  6086. strarray.Add("入底\\入册");
  6087. strarray.Add("联系电话");
  6088. for (i = 6; i <= 17; i++)
  6089. {
  6090. StrRect = load.m_rcarray.ElementAt(i - 1);
  6091. m_Print.DrawRect2(StrRect, 1);
  6092. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 6), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6093. }
  6094. strarray.RemoveAll();
  6095. strarray.Add(m_name2);
  6096. strarray.Add(m_sex);
  6097. if (m_birthday.GetLength() != 10)
  6098. strarray.Add("");
  6099. else
  6100. {
  6101. int year = 0;
  6102. if (check1)
  6103. {
  6104. CString date2;
  6105. CovertDate2(g_date, date2);
  6106. year = atoi(date2.Left(4)) - atoi(m_birthday.Left(4));
  6107. if (date2.Right(5) >= m_birthday.Right(5))
  6108. year++;
  6109. }
  6110. else
  6111. {
  6112. year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  6113. if (g_date.Right(5) >= m_birthday.Right(5))
  6114. year++;
  6115. }
  6116. str.Format("%d", year);
  6117. strarray.Add(str);
  6118. }
  6119. strarray.Add(m_birthday);
  6120. strarray.Add(m_money1);
  6121. strarray.Add(m_money2);
  6122. strarray.Add(m_money3);
  6123. strarray.Add(m_txtype);
  6124. strarray.Add(m_memberno);
  6125. strarray.Add(m_ren);
  6126. strarray.Add(m_zs);
  6127. if (!m_phone1.IsEmpty())
  6128. strarray.Add(m_phone1);
  6129. else
  6130. strarray.Add(m_phone2);
  6131. for (i = 18; i <= 29; i++)
  6132. {
  6133. StrRect = load.m_rcarray.ElementAt(i - 1);
  6134. m_Print.DrawRect2(StrRect, 1);
  6135. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6136. }
  6137. strarray.RemoveAll();
  6138. strarray.Add("摄影师");
  6139. strarray.Add("拍照时间");
  6140. strarray.Add("选片人");
  6141. strarray.Add("选片时间");
  6142. strarray.Add("引导师");
  6143. strarray.Add("设计师");
  6144. strarray.Add("取件时间");
  6145. strarray.Add("顾客签字");
  6146. for (i = 34; i <= 41; i++)
  6147. {
  6148. StrRect = load.m_rcarray.ElementAt(i - 1);
  6149. m_Print.DrawRect2(StrRect, 1);
  6150. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 34), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6151. }
  6152. strarray.RemoveAll();
  6153. strarray.Add(m_waiter1);
  6154. strarray.Add(m_time2);
  6155. strarray.Add(m_waiter3);
  6156. strarray.Add(m_time4);
  6157. strarray.Add(m_waiter2);
  6158. strarray.Add(m_waiter4);
  6159. strarray.Add(m_time5);
  6160. strarray.Add("");
  6161. for (i = 42; i <= 49; i++)
  6162. {
  6163. StrRect = load.m_rcarray.ElementAt(i - 1);
  6164. m_Print.DrawRect2(StrRect, 1);
  6165. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6166. }
  6167. m_Print.SetFontFace(15, 1, "宋体");
  6168. StrRect = load.m_rcarray.ElementAt(29);
  6169. m_Print.DrawRect2(StrRect, 1);
  6170. StrRect.top += 45;
  6171. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  6172. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  6173. m_Print.DrawText((LPTSTR)(LPCTSTR)"内", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  6174. m_Print.DrawText((LPTSTR)(LPCTSTR)"容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  6175. StrRect = load.m_rcarray.ElementAt(30);
  6176. m_Print.DrawRect2(StrRect, 1);
  6177. StrRect.top += 45;
  6178. m_Print.DrawText((LPTSTR)(LPCTSTR)"友", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  6179. m_Print.DrawText((LPTSTR)(LPCTSTR)"情", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  6180. m_Print.DrawText((LPTSTR)(LPCTSTR)"提", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
  6181. m_Print.DrawText((LPTSTR)(LPCTSTR)"示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  6182. m_Print.SetFontFace(10, 1, "宋体");
  6183. StrRect = load.m_rcarray.ElementAt(37); StrRect.top = StrRect.bottom + 2;
  6184. str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  6185. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  6186. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  6187. StrRect = load.m_rcarray.ElementAt(48); StrRect.top = StrRect.bottom + 2; StrRect.left -= 200;
  6188. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  6189. //开始画文字
  6190. StrRect = load.m_rcarray.ElementAt(31);
  6191. StrRect.left += 3;
  6192. StrRect.top += 3;
  6193. StrRect.right -= 2;
  6194. StrRect.bottom -= 2;
  6195. str = "";
  6196. for (i = 0; i < sparray.GetSize(); i++)
  6197. {
  6198. str += sparray.ElementAt(i).ElementAt(5);
  6199. str += " 数量:";
  6200. str += sparray.ElementAt(i).ElementAt(3);
  6201. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  6202. str += "\r\n";
  6203. }
  6204. str.TrimRight("\r\n");
  6205. m_bz = g_List1array.ElementAt(0).ElementAt(38);
  6206. m_bz.TrimLeft();
  6207. if (m_bz != "")
  6208. {
  6209. str += "\r\n"; str += "\r\n";
  6210. str += "备注:" + m_bz;
  6211. }
  6212. AutoDraw(m_Print, StrRect, str, 1.4);
  6213. StrRect = load.m_rcarray.ElementAt(32); m_Print.DrawRect2(StrRect, 1);
  6214. StrRect.left += 3;
  6215. StrRect.top += 3;
  6216. StrRect.right -= 2;
  6217. StrRect.bottom -= 2;
  6218. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  6219. if (str.IsEmpty())
  6220. {
  6221. str = "\
  6222. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6223. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6224. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6225. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6226. 持良好的心境.\r\n\
  6227. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6228. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6229. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6230. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6231. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6232. 勿进影室, 以免影响拍摄.\r\n\
  6233. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6234. 师或店长沟通.\r\n\
  6235. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6236. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6237. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6238. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6239. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6240. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6241. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6242. 还.";
  6243. }
  6244. AutoDraw(m_Print, StrRect, str, 1.8);
  6245. }
  6246. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6247. dlg.m_pDC = m_Print.GetPDC();
  6248. dlg.m_mode = 1;
  6249. if (aa == 0)
  6250. {
  6251. if (dlg.DoModal() != IDOK)
  6252. return;
  6253. printcot = dlg.m_num;
  6254. }
  6255. //结束打印
  6256. m_Print.EndPage();
  6257. m_Print.EndPrint();
  6258. }
  6259. }
  6260. void CMainFrame::PrintDinDan4(CString m_id)
  6261. {
  6262. // TODO: Add your control notification handler code here
  6263. CPrintRX m_Print;
  6264. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6265. {
  6266. m_Print.InitToPrint(NULL, 1);
  6267. }
  6268. else
  6269. {
  6270. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  6271. if (name.IsEmpty())
  6272. m_Print.InitToPrint(NULL, 1);
  6273. else
  6274. {
  6275. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6276. if (nret == -1)
  6277. {
  6278. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6279. }
  6280. }
  6281. }
  6282. m_Print.StartPrint();
  6283. m_Print.StartPage();
  6284. LoadRect load;
  6285. load.SetLiaPath("6-2.lia");
  6286. load.SetMargins(0, 0);
  6287. if (!load.Load())return;
  6288. int i;
  6289. //////////////////////////////////////////////////////////////
  6290. CStringArray txarray;
  6291. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  6292. g_sendhead.code[0] = 11;
  6293. g_sendhead.code[1] = 52;
  6294. g_sendhead.code[2] = 50;
  6295. g_sendhead.code[3] = 150;
  6296. g_sendhead.code[4] = 77;
  6297. g_sendhead.code[5] = 4;
  6298. g_sendhead.tabcount = 6;
  6299. g_sendhead.bsql = 0;
  6300. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  6301. CArray<CStringArray, CStringArray>sparray;
  6302. CArray<CStringArray, CStringArray>clientarray;
  6303. CArray<CStringArray, CStringArray>phonearray;
  6304. CArray<CStringArray, CStringArray>fgarray;
  6305. CArray<CStringArray, CStringArray>danweiarray;
  6306. CArray<CStringArray, CStringArray>jdarray;
  6307. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  6308. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  6309. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  6310. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  6311. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  6312. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  6313. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
  6314. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  6315. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  6316. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  6317. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  6318. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  6319. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  6320. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  6321. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  6322. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  6323. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  6324. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  6325. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  6326. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  6327. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  6328. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  6329. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  6330. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  6331. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  6332. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  6333. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  6334. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  6335. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  6336. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  6337. if (jdarray.GetSize())
  6338. {
  6339. if (m_bz.IsEmpty() == 0)
  6340. m_bz = "\r\n" + m_bz;
  6341. m_bz += "景点:";
  6342. }
  6343. for (i = 0; i < jdarray.GetSize(); i++)
  6344. {
  6345. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  6346. }
  6347. m_bz.TrimRight(";");
  6348. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  6349. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  6350. if (IsHasRights2new(31) == 0)
  6351. {
  6352. m_phone1 = "***";
  6353. m_phone2 = "***";
  6354. }
  6355. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  6356. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  6357. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  6358. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  6359. CString str;
  6360. filter = "name='" + m_ren + "'";
  6361. g_sendhead.code[0] = 5;
  6362. g_sendhead.tabcount = 1;
  6363. g_sendhead.bsql = 0;
  6364. int g_nYearposTemp = g_nYearpos;
  6365. g_nYearpos = -1;
  6366. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6367. g_nYearpos = g_nYearposTemp;
  6368. if (g_bSendOK == 0)return;
  6369. DataToArray(&phonearray);
  6370. m_money1.Format("%f", atof(m_taoxijiage));
  6371. m_money2.Format("%f", atof(m_payed1));
  6372. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  6373. ConvertToPrice(m_money1);
  6374. ConvertToPrice(m_money2);
  6375. ConvertToPrice(m_money3);
  6376. ////////////////////////////////////////////////////////////////
  6377. int rcpos = -1;
  6378. CRect StrRect = load.m_rcarray.ElementAt(0);
  6379. m_Print.SetFontFace(25, 1, "黑体");
  6380. m_Print.DrawText((LPTSTR)(LPCTSTR)"巴黎春天婚纱摄影预约单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6381. m_Print.SetFontFace(11, 1, "宋体");
  6382. StrRect = load.m_rcarray.ElementAt(1);
  6383. if (m_time1.GetLength() == 10)
  6384. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
  6385. else
  6386. str = "开单日期:";
  6387. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6388. StrRect = load.m_rcarray.ElementAt(2);
  6389. m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + m_id), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6390. CStringArray strarray;
  6391. strarray.Add("先生姓名");
  6392. strarray.Add("女士姓名");
  6393. strarray.Add("服装套数");
  6394. strarray.Add("拍摄张数");
  6395. strarray.Add("拍摄日期");
  6396. strarray.Add("联系电话");
  6397. strarray.Add("联系电话");
  6398. strarray.Add("造型套数");
  6399. strarray.Add("入册张数");
  6400. strarray.Add("选片日期");
  6401. strarray.Add("QQ/邮箱");
  6402. strarray.Add("套系总额");
  6403. strarray.Add("定金");
  6404. strarray.Add("余款金额");
  6405. strarray.Add("取件日期");
  6406. strarray.Add(m_name1);
  6407. strarray.Add(m_name2);
  6408. strarray.Add(m_clothescount);
  6409. str.Format("%d", atoi(m_zs) * 3);
  6410. strarray.Add(str);
  6411. strarray.Add(m_time2);
  6412. strarray.Add(m_phone1);
  6413. strarray.Add(m_phone2);
  6414. strarray.Add(m_clothescount2);
  6415. strarray.Add(m_zs);
  6416. strarray.Add(m_time4);
  6417. strarray.Add(m_qq1);
  6418. strarray.Add(m_money1);
  6419. strarray.Add(m_money2);
  6420. strarray.Add(m_money3);
  6421. strarray.Add(m_time5);
  6422. for (i = 4; i <= 33; i++)
  6423. {
  6424. StrRect = load.m_rcarray.ElementAt(i - 1);
  6425. m_Print.DrawRect2(StrRect, 1);
  6426. if (strarray.GetSize() > (i - 4))
  6427. {
  6428. if (i <= 18)
  6429. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6430. else
  6431. {
  6432. StrRect.left += 4;
  6433. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6434. }
  6435. }
  6436. }
  6437. int dt = 413;
  6438. StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6439. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6440. StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6441. StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6442. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6443. StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
  6444. StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
  6445. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址:深圳市红岭中路中深国际大厦首层,二十二层", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6446. StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
  6447. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:0755-61308198 61308199 25860696 25860697", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6448. StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
  6449. m_Print.DrawText((LPTSTR)(LPCTSTR)"网址:www.paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6450. StrRect = load.m_rcarray.ElementAt(43); StrRect.top += dt; StrRect.bottom += dt;
  6451. m_Print.DrawText((LPTSTR)(LPCTSTR)"邮箱:blct@paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6452. //////////////////////////////
  6453. //开始画文字
  6454. StrRect = load.m_rcarray.ElementAt(7);
  6455. int hei = StrRect.Height();
  6456. StrRect.top += hei;
  6457. StrRect.bottom += hei;
  6458. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6459. StrRect.top += dt;
  6460. StrRect.bottom += dt;
  6461. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6462. StrRect = load.m_rcarray.ElementAt(17);
  6463. StrRect.top += hei;
  6464. StrRect.bottom += hei;
  6465. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6466. StrRect = load.m_rcarray.ElementAt(33);
  6467. StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
  6468. StrRect.top += hei;
  6469. StrRect.left += 3;
  6470. StrRect.top += 3;
  6471. StrRect.right -= 2;
  6472. StrRect.bottom -= 2;
  6473. str = "";
  6474. for (i = 0; i < sparray.GetSize(); i++)
  6475. {
  6476. str += sparray.ElementAt(i).ElementAt(5);
  6477. str += " 数量:";
  6478. str += sparray.ElementAt(i).ElementAt(3);
  6479. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  6480. str += "\r\n";
  6481. }
  6482. str.TrimRight("\r\n");
  6483. AutoDraw(m_Print, StrRect, str, 1.4);
  6484. StrRect = load.m_rcarray.ElementAt(33);
  6485. StrRect.top += dt;
  6486. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  6487. StrRect.top += hei;
  6488. StrRect.left += 3;
  6489. StrRect.top += 3;
  6490. StrRect.right -= 2;
  6491. StrRect.bottom -= 2;
  6492. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6493. StrRect = load.m_rcarray.ElementAt(34);
  6494. StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
  6495. StrRect.top += hei;
  6496. StrRect.left += 3;
  6497. StrRect.top += 3;
  6498. StrRect.right -= 2;
  6499. StrRect.bottom -= 2;
  6500. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  6501. if (str.IsEmpty())
  6502. {
  6503. str = "\
  6504. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6505. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6506. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6507. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6508. 持良好的心境.\r\n\
  6509. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6510. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6511. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6512. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6513. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6514. 勿进影室, 以免影响拍摄.\r\n\
  6515. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6516. 师或店长沟通.\r\n\
  6517. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6518. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6519. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6520. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6521. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6522. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6523. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6524. 还.";
  6525. }
  6526. AutoDraw(m_Print, StrRect, str, 1.8);
  6527. StrRect = load.m_rcarray.ElementAt(35);
  6528. StrRect.bottom += 100;
  6529. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  6530. 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∨";
  6531. AutoDraw(m_Print, StrRect, str, 1.4);
  6532. PrintPreview dlg;
  6533. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6534. dlg.m_pDC = m_Print.GetPDC();
  6535. if (dlg.DoModal() != IDOK)return;
  6536. //结束打印
  6537. m_Print.EndPage();
  6538. m_Print.EndPrint();
  6539. }
  6540. int CalHeight_01(CRect &rc, CStringArray *saContent, CPrintRX *Print, int FORMAT)
  6541. {
  6542. CSize size;
  6543. int nMaxheight = 0;
  6544. CString strTemp;
  6545. CString strContent;
  6546. int nSize = saContent->GetSize();
  6547. int nRow = 0; // 行数;
  6548. for (int i = 0; i < nSize; i++)
  6549. {
  6550. strTemp = "";
  6551. strContent = saContent->ElementAt(i);
  6552. while (FALSE == strContent.IsEmpty())
  6553. {
  6554. strContent = strContent.Mid(strTemp.GetLength());
  6555. if (strContent.IsEmpty())
  6556. break;
  6557. Print->GetStrSize((LPTSTR)(LPCTSTR)strContent, size);
  6558. if (size.cx <= rc.Width())
  6559. {
  6560. CRect rc2 = rc;
  6561. rc2.top += nRow*(size.cy + 1);
  6562. rc2.bottom = rc2.top + (size.cy + 1);
  6563. Print->DrawText((LPTSTR)(LPCTSTR)strContent, rc2, 0, 0, FORMAT | FORMAT_UP);
  6564. nMaxheight = max(nMaxheight, rc2.bottom);
  6565. nRow++;
  6566. break;
  6567. }
  6568. int right = 0;
  6569. while (size.cx > rc.Width())
  6570. {
  6571. right++;
  6572. strTemp = strContent.Left(strContent.GetLength() - (right));
  6573. if (GIsHalfHZ(strTemp))
  6574. {
  6575. right++;
  6576. strTemp.Delete(strTemp.GetLength() - 1);
  6577. }
  6578. Print->GetStrSize((LPTSTR)(LPCTSTR)strTemp, size);
  6579. }
  6580. CRect rc2 = rc;
  6581. rc2.top += nRow*(size.cy + 1);
  6582. rc2.bottom = rc2.top + (size.cy + 1);
  6583. Print->DrawText((LPTSTR)(LPCTSTR)strTemp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6584. nRow++;
  6585. nMaxheight = max(nMaxheight, rc2.bottom);
  6586. }
  6587. }
  6588. return (nMaxheight == 0) ? (rc.bottom + 1) : (nMaxheight + 1);
  6589. }
  6590. /************************************************************************/
  6591. /*
  6592. 多字节字符编码下的CaleHeight函数;
  6593. 函数:CaleHeight
  6594. 描述:计算出一行高度可变,宽度特定的表格(CArray<CRect,CRect>),在输入指定内容时(CStringArray),表格高度变化最大的值。
  6595. 参数:
  6596. aRowRect: 一行表格,CArray::GetSize()表示表格列数;
  6597. aRowStr: 与表格对应的一行字符,CStringArray::GetSize()大小与CArray::GetSize()一致。
  6598. pPrinter: 打印机实例指针;
  6599. nFormat: 字符串的显示格式。
  6600. 返回:返回最大的表格高度;
  6601. 注意:只能多字节下使用,因为函数GIsHalfHZ。
  6602. */
  6603. /************************************************************************/
  6604. INT CalcHeight( IN CArray<CRect, CRect> &aRowRect, IN CStringArray &aRowStr, IN CPrintRX *pPrinter, IN CONST INT& nFormat)
  6605. {
  6606. // 参数有效性;
  6607. if( aRowRect.GetSize() != aRowStr.GetSize() )
  6608. {
  6609. OutputDebugString(_T("表格列数与字符列数不等!\n"));
  6610. return -1;
  6611. }
  6612. if( pPrinter == NULL )
  6613. {
  6614. OutputDebugString(_T("打印机句柄指针无效\n"));
  6615. return -1;
  6616. }
  6617. // 表格字串长度;
  6618. CSize size;
  6619. // 当前表格字体高度;
  6620. INT nGridFontHeight = 0;
  6621. // 当前表格区域;
  6622. CRect curGrid;
  6623. // 当前表格字符串;
  6624. CString strGridContent;
  6625. // 最大值高底;
  6626. INT nMaxHeigth = 0;
  6627. // 当前换行数;
  6628. INT nWrapRows = 0;
  6629. // 当前换行字串;
  6630. CString strWrapRow = _T("");
  6631. // 表格列数;
  6632. INT nColumns = aRowRect.GetSize();
  6633. // 临时表格;
  6634. CRect rcGrid;
  6635. // 循环计算每个表格的高度;
  6636. for( INT i = 0; i < nColumns; i++ )
  6637. {
  6638. nWrapRows = 0;
  6639. strWrapRow.Empty();
  6640. curGrid = aRowRect.ElementAt(i);
  6641. strGridContent = aRowStr.ElementAt(i);
  6642. nMaxHeigth = max(nMaxHeigth, curGrid.bottom);
  6643. while( !strGridContent.IsEmpty() )
  6644. {
  6645. strGridContent = strGridContent.Right(strGridContent.GetLength() - strWrapRow.GetLength());
  6646. if ( strGridContent.IsEmpty() )
  6647. {
  6648. OutputDebugString(_T("表格字符已空\n"));
  6649. break;
  6650. }
  6651. pPrinter->GetStrSize((LPTSTR)(LPCTSTR)strGridContent, size);
  6652. nGridFontHeight = size.cy + 1;
  6653. // 字串长度 <= 表格宽度;
  6654. if( size.cx <= curGrid.Width() )
  6655. {
  6656. rcGrid = curGrid;
  6657. rcGrid.top += nWrapRows*nGridFontHeight;
  6658. rcGrid.bottom = rcGrid.top + nGridFontHeight;
  6659. nMaxHeigth = max(nMaxHeigth, rcGrid.bottom);
  6660. pPrinter->DrawText((LPTSTR)(LPCTSTR)strGridContent, rcGrid, 0, 0, nFormat|FORMAT_UP);
  6661. break;
  6662. }
  6663. else
  6664. {// 字串长度 >= 表格宽度;
  6665. INT nRight = 0; // 字串右位置;
  6666. // 从右边开始逐个字符取出,直到左边字串小于表格宽度;
  6667. while( size.cx > curGrid.Width() )
  6668. {
  6669. nRight++;
  6670. strWrapRow = strGridContent.Left(strGridContent.GetLength() - nRight);
  6671. if( GIsHalfHZ(strWrapRow) )
  6672. {// 判断字串最后一个字符是否是汉字;
  6673. nRight++;
  6674. strWrapRow.Delete(strWrapRow.GetLength() - 1);
  6675. }
  6676. pPrinter->GetStrSize((LPTSTR)(LPCTSTR)strWrapRow, size);
  6677. }
  6678. rcGrid = curGrid;
  6679. rcGrid.top += nWrapRows*nGridFontHeight;
  6680. rcGrid.bottom = rcGrid.top + nGridFontHeight;
  6681. nMaxHeigth = max(nMaxHeigth, rcGrid.bottom);
  6682. pPrinter->DrawText((LPTSTR)(LPCTSTR)strWrapRow, rcGrid, 0, 0, nFormat|FORMAT_UP);
  6683. // 换行加+1;
  6684. nWrapRows++;
  6685. }
  6686. }
  6687. }
  6688. return nMaxHeigth + 1;
  6689. }
  6690. void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  6691. {
  6692. //AfxMessageBox("abce");
  6693. int i = 0;
  6694. int printcot = 1;
  6695. for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
  6696. {
  6697. g_sendhead.bsql = 0;
  6698. g_sendhead.code[0] = 24;
  6699. g_sendhead.tabcount = 1;
  6700. int g_nYearposTemp = g_nYearpos;
  6701. g_nYearpos = -1;
  6702. g_pMainWnd->ProcessChatMessageRequest2(1);
  6703. g_nYearpos = g_nYearposTemp;
  6704. if (0 == g_bSendOK)return;
  6705. DataToArray(&g_cominfoarray);
  6706. CString SerialNo;
  6707. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  6708. #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  6709. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  6710. CString sql;
  6711. sql.Format("update version set [serialno]='%s'", SerialNo);
  6712. g_sendhead.bsql=1;
  6713. g_nYearposTemp=g_nYearpos;
  6714. g_nYearpos=-1;
  6715. g_pMainWnd->ProcessChatMessageRequest2(sql);
  6716. g_nYearpos=g_nYearposTemp;
  6717. #endif
  6718. // 1.创建打印对象
  6719. CPrintRX m_Print;
  6720. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6721. {
  6722. m_Print.InitToPrint(NULL, 1);
  6723. }
  6724. else
  6725. {
  6726. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  6727. if (name.IsEmpty())
  6728. m_Print.InitToPrint(NULL, 1);
  6729. else
  6730. {
  6731. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6732. if (nret == -1 && aa == 0)
  6733. {
  6734. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6735. }
  6736. }
  6737. }
  6738. // 2.开始打印
  6739. m_Print.StartPrint();
  6740. m_Print.StartPage();
  6741. LoadRect load;
  6742. BOOL bSmall = 0;
  6743. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  6744. {
  6745. bSmall = 1;
  6746. load.SetLiaPath("20.lia");
  6747. }
  6748. else
  6749. load.SetLiaPath("10.lia");
  6750. if (bSmall)
  6751. load.SetMargins(0, 0);
  6752. else
  6753. load.SetMargins(10, 0);
  6754. if (!load.Load())return;
  6755. int rcpos = -1;
  6756. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  6757. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  6758. {
  6759. Image *pImg = NULL;
  6760. g_nSendCode = 31;
  6761. int g_nYearposTemp = g_nYearpos;
  6762. g_nYearpos = -1;
  6763. g_pMainWnd->ProcessChatMessageRequest2(1);
  6764. g_nYearpos = g_nYearposTemp;
  6765. g_nSendCode = 0;
  6766. if (g_bSendOK == 0)return;
  6767. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  6768. if (pImg)
  6769. {
  6770. StrRect.left = 65;
  6771. if (bSmall) StrRect.left = 55;
  6772. StrRect.top = 10;
  6773. StrRect.right = StrRect.left + 58;
  6774. StrRect.bottom = StrRect.top + 58;
  6775. // 3.打印2维码图像;
  6776. m_Print.DrawImage(pImg, StrRect);
  6777. delete pImg;
  6778. pImg = NULL;
  6779. }
  6780. }
  6781. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  6782. if (bSmall)
  6783. {
  6784. m_Print.SetFontFace(18, 1, "黑体");
  6785. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6786. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6787. m_Print.SetFontFace(9, 1, "宋体");
  6788. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6789. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6790. m_Print.SetFontFace(6, 1, "宋体");
  6791. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6792. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6793. m_Print.SetFontFace(9, 1, "宋体");
  6794. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6795. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6796. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6797. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6798. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6799. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6800. int hei = StrRect.Height();
  6801. StrRect.bottom = StrRect.top;
  6802. StrRect.top -= 8;
  6803. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6804. m_Print.SetFontFace(11, 1, "宋体");
  6805. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6806. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6807. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6808. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6809. m_Print.SetFontFace(8, 1, "宋体");
  6810. for (i = 7; i < 24; i++)
  6811. {
  6812. StrRect = load.m_rcarray.ElementAt(i);
  6813. m_Print.DrawRect2(StrRect, 1);
  6814. }
  6815. for (i = 9; i < 24; i++)
  6816. {
  6817. StrRect = load.m_rcarray.ElementAt(i);
  6818. StrRect.left += 2;
  6819. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6820. }
  6821. m_Print.SetFontFace(6, 1, "宋体");
  6822. for (i = 24; i < 26; i++)
  6823. {
  6824. StrRect = load.m_rcarray.ElementAt(i);
  6825. StrRect.left += 2;
  6826. if (i == 24)
  6827. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6828. else
  6829. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6830. }
  6831. // StrRect=load.m_rcarray .ElementAt (27);
  6832. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6833. }
  6834. else//大单
  6835. {
  6836. // 1.打印表头(蒙娜丽莎收款单)
  6837. m_Print.SetFontFace(20, 1, "黑体");
  6838. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6839. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6840. m_Print.SetFontFace(11, 1, "宋体");
  6841. // 2.打印订单号(NO.20140608-001)
  6842. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6843. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6844. // 3.打印SerialNo(SerialNo.01062)
  6845. int hei = StrRect.Height();
  6846. StrRect.bottom = StrRect.top;
  6847. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6848. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6849. // 4.打印影楼地址信息、电话;
  6850. m_Print.SetFontFace(8, 1, "宋体");
  6851. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6852. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6853. m_Print.SetFontFace(11, 1, "宋体");
  6854. // 5.打印客户姓名
  6855. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6856. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6857. // 6.打印客户联系电话
  6858. StrRect = load.m_rcarray.ElementAt(++rcpos);
  6859. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6860. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6861. // 7.打印开单日期
  6862. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6863. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6864. // 8.打印列字段:收款项目
  6865. m_Print.SetFontFace(13, 1, "宋体");
  6866. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6867. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6868. //printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6869. // 9.打印列字段:金额
  6870. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6871. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6872. //printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6873. // 10.打印列字段:开单人
  6874. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  6875. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6876. //printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6877. // 11.画表格-画3列;
  6878. m_Print.SetFontFace(11, 1, "宋体");
  6879. for (i = 7; i < 10; i++)
  6880. {
  6881. StrRect = load.m_rcarray.ElementAt(i);
  6882. m_Print.DrawRect2(StrRect, 1);
  6883. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  6884. }
  6885. // 12.打印详细内容
  6886. int dty = 0;
  6887. int dtytemp = 0;
  6888. // for( i=10; i<14; i+=3)
  6889. for (i = 10; i<22; i += 3) // 循环4次,再画
  6890. {
  6891. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  6892. CArray<CRect, CRect>rcarray;
  6893. CStringArray strarray2;
  6894. StrRect = load.m_rcarray.ElementAt(i);
  6895. StrRect.top += dty;
  6896. StrRect.bottom += dty;
  6897. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  6898. {
  6899. StrRect = load.m_rcarray.ElementAt(i - 1);
  6900. StrRect.top += dty;
  6901. StrRect.bottom += dty;
  6902. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  6903. break;
  6904. }
  6905. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  6906. StrRect.left += 2;
  6907. StrRect.right -= 2;
  6908. StrRect.top += 4;
  6909. rcarray.Add(StrRect);
  6910. strarray2.Add(pArray->ElementAt(i));
  6911. // 指定格子宽度,计算字符串占几行(高度).
  6912. INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  6913. dtytemp = bottom - StrRect.bottom;
  6914. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  6915. // 重新获取表格大小,并画出表格;
  6916. StrRect = load.m_rcarray.ElementAt(i);
  6917. StrRect.bottom += dtytemp;
  6918. StrRect.top += dty;
  6919. StrRect.bottom += dty;
  6920. m_Print.DrawRect2(StrRect, 1);
  6921. // 获取下一表格大小,并画出表格;
  6922. StrRect = load.m_rcarray.ElementAt(i + 1);
  6923. StrRect.top += dty;
  6924. StrRect.bottom += dty;
  6925. StrRect.bottom += dtytemp;
  6926. m_Print.DrawRect2(StrRect, 1);
  6927. StrRect.left += 2;
  6928. // 打印出金额字段内容
  6929. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6930. //printf("Jeff:%d:%s\n\n",i+1,pArray->ElementAt(i+1));//Jeff Printf;
  6931. StrRect = load.m_rcarray.ElementAt(i + 2);
  6932. StrRect.top += dty;
  6933. StrRect.bottom += dty;
  6934. StrRect.bottom += dtytemp;
  6935. m_Print.DrawRect2(StrRect, 1);
  6936. StrRect.left += 2;
  6937. // 打印开单人字段内容
  6938. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6939. //printf("Jeff:%d:%s\n\n",i+2,pArray->ElementAt(i+2));//Jeff Printf;
  6940. dty += dtytemp;
  6941. }
  6942. //.打印->付款情况 应付 实付 欠款.
  6943. i = 22;
  6944. StrRect = load.m_rcarray.ElementAt(i);
  6945. StrRect.top += dty;
  6946. StrRect.bottom += dty;
  6947. m_Print.DrawRect2(StrRect, 1);
  6948. StrRect.left += 2;
  6949. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6950. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  6951. //.打印->合计人民币(大写):.......
  6952. i = 23;
  6953. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  6954. m_Print.DrawRect2(StrRect, 1);
  6955. StrRect.left += 2;
  6956. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6957. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  6958. m_Print.SetFontFace(7, 1, "宋体");
  6959. for (i = 24; i < 27; i++)
  6960. {
  6961. StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
  6962. StrRect.left += 2;
  6963. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6964. }
  6965. StrRect = load.m_rcarray.ElementAt(24); StrRect.top += dty; StrRect.bottom += dty;
  6966. hei = StrRect.Height();
  6967. StrRect.top += hei;
  6968. StrRect.bottom += hei;
  6969. StrRect.right += 100;
  6970. StrRect.left += 2;
  6971. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  6972. AutoDraw(m_Print, StrRect, pArray->ElementAt(27), 1.0);
  6973. }
  6974. PrintPreview dlg;
  6975. dlg.m_mode = 3;
  6976. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  6977. dlg.m_pDC = m_Print.GetPDC();
  6978. if (aa == 0)
  6979. {
  6980. if (dlg.DoModal() != IDOK)
  6981. return;
  6982. printcot = dlg.m_num;
  6983. }
  6984. //结束打印
  6985. m_Print.EndPage();
  6986. m_Print.EndPrint();
  6987. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  6988. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  6989. CString sql;
  6990. sql.Format("update version set [serialno]='%s'", SerialNo);
  6991. g_sendhead.bsql = 1;
  6992. g_nYearposTemp = g_nYearpos;
  6993. g_nYearpos = -1;
  6994. g_pMainWnd->ProcessChatMessageRequest2(sql);
  6995. g_nYearpos = g_nYearposTemp;
  6996. #endif
  6997. }
  6998. }
  6999. /************************************************************************/
  7000. /*
  7001. 函数:PrintRechargeRecord
  7002. 描述:打印会员卡充值记录;
  7003. 参数:
  7004. pArryRechargeRecod[IN]:要打印的数据;
  7005. 返回:
  7006. 注意:
  7007. 示例:
  7008. */
  7009. /************************************************************************/
  7010. void CMainFrame::PrintRechargeRecord(CStringArray *pArryRechargeRecod)
  7011. {
  7012. }
  7013. void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7014. {
  7015. //AfxMessageBox("abce");
  7016. int i = 0;
  7017. int printcot = 1;
  7018. for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
  7019. {
  7020. g_sendhead.bsql = 0;
  7021. g_sendhead.code[0] = 24;
  7022. g_sendhead.tabcount = 1;
  7023. int g_nYearposTemp = g_nYearpos;
  7024. g_nYearpos = -1;
  7025. g_pMainWnd->ProcessChatMessageRequest2(1);
  7026. g_nYearpos = g_nYearposTemp;
  7027. if (0 == g_bSendOK)return;
  7028. DataToArray(&g_cominfoarray);
  7029. CString SerialNo;
  7030. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7031. #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  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. #endif
  7041. // 1.创建打印对象
  7042. CPrintRX m_Print;
  7043. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7044. {
  7045. m_Print.InitToPrint(NULL, 1);
  7046. }
  7047. else
  7048. {
  7049. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7050. if (name.IsEmpty())
  7051. m_Print.InitToPrint(NULL, 1);
  7052. else
  7053. {
  7054. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7055. if (nret == -1 && aa == 0)
  7056. {
  7057. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  7058. m_Print.InitToPrint(NULL, 1);
  7059. }
  7060. }
  7061. }
  7062. // 2.开始打印
  7063. m_Print.StartPrint();
  7064. m_Print.StartPage();
  7065. LoadRect load;
  7066. BOOL bSmall = 0;
  7067. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7068. {
  7069. bSmall = 1;
  7070. load.SetLiaPath("20.lia");
  7071. }
  7072. else
  7073. load.SetLiaPath("10.lia");
  7074. if (bSmall)
  7075. load.SetMargins(0, 0);
  7076. else
  7077. load.SetMargins(10, 0);
  7078. if (!load.Load())return;
  7079. int rcpos = -1;
  7080. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7081. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7082. {
  7083. Image *pImg = NULL;
  7084. g_nSendCode = 31;
  7085. int g_nYearposTemp = g_nYearpos;
  7086. g_nYearpos = -1;
  7087. g_pMainWnd->ProcessChatMessageRequest2(1);
  7088. g_nYearpos = g_nYearposTemp;
  7089. g_nSendCode = 0;
  7090. if (g_bSendOK == 0)return;
  7091. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7092. if (pImg)
  7093. {
  7094. StrRect.left = 65;
  7095. if (bSmall) StrRect.left = 55;
  7096. StrRect.top = 10;
  7097. StrRect.right = StrRect.left + 58;
  7098. StrRect.bottom = StrRect.top + 58;
  7099. // 3.打印2维码图像;
  7100. m_Print.DrawImage(pImg, StrRect);
  7101. delete pImg;
  7102. pImg = NULL;
  7103. }
  7104. }
  7105. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7106. if (bSmall)
  7107. {
  7108. m_Print.SetFontFace(18, 1, "黑体");
  7109. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7110. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7111. m_Print.SetFontFace(9, 1, "宋体");
  7112. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7113. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7114. m_Print.SetFontFace(6, 1, "宋体");
  7115. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7116. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7117. m_Print.SetFontFace(9, 1, "宋体");
  7118. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7119. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7120. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7121. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7122. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7123. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7124. int hei = StrRect.Height();
  7125. StrRect.bottom = StrRect.top;
  7126. StrRect.top -= 8;
  7127. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7128. m_Print.SetFontFace(11, 1, "宋体");
  7129. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7130. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7131. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7132. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7133. m_Print.SetFontFace(8, 1, "宋体");
  7134. for ( i = 7; i < 24; i++)
  7135. {
  7136. StrRect = load.m_rcarray.ElementAt(i);
  7137. m_Print.DrawRect2(StrRect, 1);
  7138. }
  7139. for (i = 9; i < 24; i++)
  7140. {
  7141. StrRect = load.m_rcarray.ElementAt(i);
  7142. StrRect.left += 2;
  7143. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7144. }
  7145. m_Print.SetFontFace(6, 1, "宋体");
  7146. for (i = 24; i < 26; i++)
  7147. {
  7148. StrRect = load.m_rcarray.ElementAt(i);
  7149. StrRect.left += 2;
  7150. if (i == 24)
  7151. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7152. else
  7153. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7154. }
  7155. // StrRect=load.m_rcarray .ElementAt (27);
  7156. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7157. }
  7158. else//大单
  7159. {
  7160. // 1.打印表头(蒙娜丽莎收款单)
  7161. m_Print.SetFontFace(20, 1, "黑体");
  7162. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7163. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7164. m_Print.SetFontFace(11, 1, "宋体");
  7165. // 2.打印订单号(NO.20140608-001)
  7166. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7167. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7168. // 3.打印SerialNo(SerialNo.01062)
  7169. int hei = StrRect.Height();
  7170. StrRect.bottom = StrRect.top;
  7171. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7172. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7173. // 4.打印影楼地址信息、电话;
  7174. m_Print.SetFontFace(8, 1, "宋体");
  7175. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7176. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7177. m_Print.SetFontFace(11, 1, "宋体");
  7178. // 5.打印客户姓名
  7179. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7180. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7181. // 6.打印客户联系电话
  7182. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7183. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7184. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7185. // 7.打印开单日期
  7186. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7187. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7188. #if 0 // Original Edition
  7189. // 8.打印列字段:收款项目
  7190. m_Print.SetFontFace(13, 1, "宋体");
  7191. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7192. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7193. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7194. // 9.打印列字段:金额
  7195. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7196. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7197. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7198. // 10.打印列字段:开单人
  7199. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7200. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7201. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7202. #else
  7203. // 8.打印列字段:收款项目
  7204. m_Print.SetFontFace(13, 1, "宋体");
  7205. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7206. StrRect = CRect(66, 85, 280, 105);
  7207. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7208. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7209. // 8.1 Jeff add:支付方式
  7210. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7211. StrRect = CRect(280, 85, 350, 105);
  7212. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7213. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7214. // 9.打印列字段:金额
  7215. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7216. StrRect = CRect(350, 85, 442, 105);
  7217. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7218. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7219. // 10.打印列字段:开单人
  7220. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7221. StrRect = CRect(442, 85, 535, 105);
  7222. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7223. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7224. //rcpos += 3;
  7225. #endif
  7226. // 11.画表格-画3列;old
  7227. // 11.draw 4 column
  7228. m_Print.SetFontFace(11, 1, "宋体");
  7229. //for( i=7; i<10; i++)
  7230. //{
  7231. // StrRect=load.m_rcarray.ElementAt(i);
  7232. // m_Print.DrawRect2(StrRect, 1);
  7233. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7234. //}
  7235. m_Print.DrawRect2(CRect(66, 85, 280, 105), 1);
  7236. m_Print.DrawRect2(CRect(280, 85, 350, 105), 1);
  7237. m_Print.DrawRect2(CRect(350, 85, 442, 105), 1);
  7238. m_Print.DrawRect2(CRect(442, 85, 535, 105), 1);
  7239. // 12.打印详细内容
  7240. int dty = 0;
  7241. int dtytemp = 0;
  7242. // for( i=10; i<14; i+=3)
  7243. //for( i=10; i<22; i+=3) // 循环4次,再画
  7244. int j = 0;
  7245. for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
  7246. {
  7247. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7248. CArray<CRect, CRect>rcarray;
  7249. CStringArray strarray2;
  7250. StrRect = load.m_rcarray.ElementAt(i);
  7251. StrRect.top += dty;
  7252. StrRect.bottom += dty;
  7253. StrRect.right -= 70; // Jeff add
  7254. //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;
  7255. /*
  7256. 4次的CRect
  7257. 66,105,350,125
  7258. 66,126,350,146
  7259. 66,147,350,167
  7260. 66,168,350,188
  7261. */
  7262. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  7263. {
  7264. StrRect = load.m_rcarray.ElementAt(i - 1);
  7265. StrRect.top += dty;
  7266. StrRect.bottom += dty;
  7267. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  7268. break;
  7269. }
  7270. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7271. StrRect.left += 2;
  7272. StrRect.right -= 2;
  7273. StrRect.top += 4;
  7274. rcarray.Add(StrRect);
  7275. //strarray2.Add(pArray->ElementAt(i+1));
  7276. strarray2.Add(pArray->ElementAt(j));
  7277. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7278. // 指定格子宽度,计算字符串占几行(高度).
  7279. INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  7280. dtytemp = bottom - StrRect.bottom;
  7281. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7282. // 重新获取表格大小,并画出表格;
  7283. /*
  7284. CRect(66,85,280,105),
  7285. CRect(280,85,350,105)
  7286. CRect(350,85,442,105)
  7287. CRect(442,85,535,105)
  7288. CRect(66,105,350,125),
  7289. CRect(66,126,350,146)
  7290. CRect(66,147,350,167)
  7291. CRect(66,168,350,188)
  7292. */
  7293. // 画收款项目框及打印内容;
  7294. StrRect = load.m_rcarray.ElementAt(i);
  7295. //StrRect=CRect(66,85,280,105);
  7296. StrRect.bottom += dtytemp;
  7297. StrRect.top += dty;
  7298. StrRect.bottom += dty;
  7299. //StrRect.left -= 70; // Jeff add
  7300. StrRect.right -= 70; // Jeff add
  7301. //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;
  7302. m_Print.DrawRect2(StrRect, 1);
  7303. // 画支付方式框及打印内容;
  7304. StrRect = load.m_rcarray.ElementAt(i);
  7305. //StrRect=CRect(280,85,350,105);
  7306. StrRect.bottom += dtytemp;
  7307. StrRect.top += dty;
  7308. StrRect.bottom += dty;
  7309. StrRect.left += StrRect.Width() - 70;
  7310. //StrRect.right += 70; // Jeff add
  7311. //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;
  7312. m_Print.DrawRect2(StrRect, 1);
  7313. StrRect.left += 2;
  7314. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7315. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7316. // 画金额框及打印内容;
  7317. StrRect = load.m_rcarray.ElementAt(i + 1);
  7318. //StrRect=CRect(350,85,442,105);
  7319. StrRect.top += dty;
  7320. StrRect.bottom += dty;
  7321. StrRect.bottom += dtytemp;
  7322. //StrRect.right -= 70; // Jeff add
  7323. //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;
  7324. m_Print.DrawRect2(StrRect, 1);
  7325. StrRect.left += 2;
  7326. // 打印出金额字段内容
  7327. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7328. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7329. // 画开单人框及打印内容;
  7330. StrRect = load.m_rcarray.ElementAt(i + 2);
  7331. //StrRect=CRect(442,85,535,105);
  7332. StrRect.top += dty;
  7333. StrRect.bottom += dty;
  7334. StrRect.bottom += dtytemp;
  7335. //StrRect.right -= 70; // Jeff add
  7336. //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;
  7337. m_Print.DrawRect2(StrRect, 1);
  7338. StrRect.left += 2;
  7339. // 打印开单人字段内容
  7340. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7341. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7342. dty += dtytemp;
  7343. }
  7344. //.打印->付款情况 应付 实付 欠款.
  7345. i = 22;
  7346. j = 27;
  7347. StrRect = load.m_rcarray.ElementAt(i);
  7348. StrRect.top += dty;
  7349. StrRect.bottom += dty;
  7350. m_Print.DrawRect2(StrRect, 1);
  7351. StrRect.left += 2;
  7352. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7353. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7354. //.打印->合计人民币(大写):.......
  7355. i = 23;
  7356. j = 28;
  7357. StrRect = load.m_rcarray.ElementAt(i);
  7358. StrRect.top += dty;
  7359. StrRect.bottom += dty;
  7360. m_Print.DrawRect2(StrRect, 1);
  7361. StrRect.left += 2;
  7362. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7363. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7364. // 打印总金额;
  7365. m_Print.SetFontFace(7, 1, "宋体");
  7366. for (i = 24, j = 29; i < 27; i++, j++)
  7367. {
  7368. StrRect = load.m_rcarray.ElementAt(i);
  7369. StrRect.top += dty;
  7370. StrRect.bottom += dty;
  7371. StrRect.left += 2;
  7372. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7373. }
  7374. StrRect = load.m_rcarray.ElementAt(24);
  7375. StrRect.top += dty;
  7376. StrRect.bottom += dty;
  7377. hei = StrRect.Height();
  7378. StrRect.top += hei;
  7379. StrRect.bottom += hei;
  7380. StrRect.right += 100;
  7381. StrRect.left += 2;
  7382. StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
  7383. AutoDraw(m_Print, StrRect, pArray->ElementAt(32), 1.0);
  7384. }
  7385. PrintPreview dlg;
  7386. dlg.m_mode = 3;
  7387. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  7388. dlg.m_pDC = m_Print.GetPDC();
  7389. if (aa == 0)
  7390. {
  7391. if (dlg.DoModal() != IDOK)
  7392. {
  7393. return;
  7394. }
  7395. printcot = dlg.m_num;
  7396. }
  7397. //结束打印
  7398. m_Print.EndPage();
  7399. m_Print.EndPrint();
  7400. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7401. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7402. CString sql;
  7403. sql.Format("update version set [serialno]='%s'", SerialNo);
  7404. g_sendhead.bsql = 1;
  7405. g_nYearposTemp = g_nYearpos;
  7406. g_nYearpos = -1;
  7407. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7408. g_nYearpos = g_nYearposTemp;
  7409. #endif
  7410. }
  7411. }
  7412. void CMainFrame::PrintReceipt_02(CStringArray *pArray, CPrintRX *pPrinter, const int &nCount, const BOOL bPrintImmediately) // 打印订单*预约收款、预约补款*
  7413. {
  7414. //AfxMessageBox("abce");
  7415. int printcot = 1;
  7416. // for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7417. // {
  7418. g_sendhead.bsql = 0;
  7419. g_sendhead.code[0] = 24;
  7420. g_sendhead.tabcount = 1;
  7421. int g_nYearposTemp = g_nYearpos;
  7422. g_nYearpos = -1;
  7423. g_pMainWnd->ProcessChatMessageRequest2(1);
  7424. g_nYearpos = g_nYearposTemp;
  7425. if (0 == g_bSendOK)return;
  7426. DataToArray(&g_cominfoarray);
  7427. CString SerialNo;
  7428. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7429. CPrintRX *tagPrinter = NULL;
  7430. if (pPrinter == NULL)
  7431. {
  7432. // 1.创建打印对象
  7433. tagPrinter = new CPrintRX;
  7434. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7435. {
  7436. tagPrinter->InitToPrint(NULL, 1);
  7437. }
  7438. else
  7439. {
  7440. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  7441. if (name.IsEmpty())
  7442. {
  7443. tagPrinter->InitToPrint(NULL, 1);
  7444. }
  7445. else
  7446. {
  7447. int nret = tagPrinter->InitToPrint((char*)(LPCTSTR)name, 1);
  7448. ///if(nret==-1 && aa==0)
  7449. if (nret == -1)
  7450. {
  7451. if (bPrintImmediately == FALSE)
  7452. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  7453. tagPrinter->InitToPrint(NULL, 1);
  7454. }
  7455. }
  7456. }
  7457. // 2.开始打印
  7458. tagPrinter->StartPrint();
  7459. tagPrinter->StartPage();
  7460. }
  7461. else
  7462. {
  7463. //SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7464. tagPrinter = pPrinter;
  7465. }
  7466. LoadRect load;
  7467. BOOL bSmall = 0;
  7468. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7469. {
  7470. bSmall = 1;
  7471. load.SetLiaPath("20.lia");
  7472. }
  7473. else
  7474. load.SetLiaPath("10.lia");
  7475. if (bSmall)
  7476. load.SetMargins(0, 0);
  7477. else
  7478. load.SetMargins(10, 0);
  7479. if (!load.Load())return;
  7480. int rcpos = -1;
  7481. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  7482. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7483. {
  7484. Image *pImg = NULL;
  7485. g_nSendCode = 31;
  7486. int g_nYearposTemp = g_nYearpos;
  7487. g_nYearpos = -1;
  7488. g_pMainWnd->ProcessChatMessageRequest2(1);
  7489. g_nYearpos = g_nYearposTemp;
  7490. g_nSendCode = 0;
  7491. if (g_bSendOK == 0)return;
  7492. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  7493. if (pImg)
  7494. {
  7495. StrRect.left = 65;
  7496. if (bSmall) StrRect.left = 55;
  7497. StrRect.top = 10;
  7498. StrRect.right = StrRect.left + 58;
  7499. StrRect.bottom = StrRect.top + 58;
  7500. // 3.打印2维码图像;
  7501. tagPrinter->DrawImage(pImg, StrRect);
  7502. delete pImg;
  7503. pImg = NULL;
  7504. }
  7505. }
  7506. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7507. if (bSmall)
  7508. {
  7509. tagPrinter->SetFontFace(18, 1, "黑体");
  7510. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7511. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7512. tagPrinter->SetFontFace(9, 1, "宋体");
  7513. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7514. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7515. tagPrinter->SetFontFace(6, 1, "宋体");
  7516. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7517. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7518. tagPrinter->SetFontFace(9, 1, "宋体");
  7519. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7520. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7521. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7522. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7523. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7524. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7525. int hei = StrRect.Height();
  7526. StrRect.bottom = StrRect.top;
  7527. StrRect.top -= 8;
  7528. tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7529. tagPrinter->SetFontFace(11, 1, "宋体");
  7530. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7531. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7532. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7533. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7534. tagPrinter->SetFontFace(8, 1, "宋体");
  7535. int i = 0;
  7536. for (i = 7; i < 24; i++)
  7537. {
  7538. StrRect = load.m_rcarray.ElementAt(i);
  7539. tagPrinter->DrawRect2(StrRect, 1);
  7540. }
  7541. for (i = 9; i < 24; i++)
  7542. {
  7543. StrRect = load.m_rcarray.ElementAt(i);
  7544. StrRect.left += 2;
  7545. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7546. }
  7547. tagPrinter->SetFontFace(6, 1, "宋体");
  7548. for (i = 24; i < 26; i++)
  7549. {
  7550. StrRect = load.m_rcarray.ElementAt(i);
  7551. StrRect.left += 2;
  7552. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7553. }
  7554. StrRect = load.m_rcarray.ElementAt(22);
  7555. int nH = StrRect.Height();
  7556. int nW = StrRect.Width();
  7557. int nlen = load.m_rcarray.GetSize();
  7558. int nLeft = StrRect.left;
  7559. int j = 0;
  7560. for (i = 27; i<32; i++)
  7561. {
  7562. CRect rct = StrRect;
  7563. if(i == 31)
  7564. {
  7565. rct.top = rct.top + (nH*(j - 1));
  7566. rct.bottom = rct.top + nH;
  7567. rct.left = rct.left + 200;
  7568. rct.right = rct.left + 200;
  7569. }
  7570. else
  7571. {
  7572. rct.top = rct.top + (nH*j);
  7573. rct.bottom = rct.top + nH;
  7574. rct.left = rct.left + 2;
  7575. rct.right = rct.left + 200;
  7576. }
  7577. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), rct, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7578. j++;
  7579. }
  7580. }
  7581. else//大单
  7582. {
  7583. // 1.打印表头(蒙娜丽莎收款单)
  7584. tagPrinter->SetFontFace(20, 1, "黑体");
  7585. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7586. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7587. tagPrinter->SetFontFace(11, 1, "宋体");
  7588. // 2.打印订单号(NO.20140608-001)
  7589. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7590. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7591. // 3.打印SerialNo(SerialNo.01062)
  7592. int hei = StrRect.Height();
  7593. StrRect.bottom = StrRect.top;
  7594. StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7595. tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7596. // 4.打印影楼地址信息、电话;
  7597. tagPrinter->SetFontFace(8, 1, "宋体");
  7598. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7599. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7600. tagPrinter->SetFontFace(11, 1, "宋体");
  7601. // 5.打印客户姓名
  7602. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7603. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7604. // 6.打印客户联系电话
  7605. StrRect = load.m_rcarray.ElementAt(++rcpos);
  7606. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7607. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7608. // 7.打印开单日期
  7609. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7610. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7611. #if 0 // Original Edition
  7612. // 8.打印列字段:收款项目
  7613. tagPrinter->SetFontFace(13, 1, "宋体");
  7614. StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7615. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7616. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7617. // 9.打印列字段:金额
  7618. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7619. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7620. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7621. // 10.打印列字段:开单人
  7622. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7623. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7624. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7625. #else
  7626. // 8.打印列字段:收款项目
  7627. tagPrinter->SetFontFace(13, 1, "宋体");
  7628. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7629. StrRect = CRect(66, 85, 280, 105);
  7630. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7631. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7632. // 8.1 Jeff add:支付方式
  7633. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7634. StrRect = CRect(280, 85, 350, 105);
  7635. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7636. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7637. // 9.打印列字段:金额
  7638. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7639. StrRect = CRect(350, 85, 442, 105);
  7640. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7641. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7642. // 10.打印列字段:开单人
  7643. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7644. StrRect = CRect(442, 85, 535, 105);
  7645. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7646. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7647. //rcpos += 3;
  7648. #endif
  7649. // 11.画表格-画3列;old
  7650. // 11.draw 4 column
  7651. tagPrinter->SetFontFace(11, 1, "宋体");
  7652. int i;
  7653. //for( i=7; i<10; i++)
  7654. //{
  7655. // StrRect=load.m_rcarray.ElementAt(i);
  7656. // m_Print.DrawRect2(StrRect, 1);
  7657. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7658. //}
  7659. tagPrinter->DrawRect2(CRect(66, 85, 280, 105), 1);
  7660. tagPrinter->DrawRect2(CRect(280, 85, 350, 105), 1);
  7661. tagPrinter->DrawRect2(CRect(350, 85, 442, 105), 1);
  7662. tagPrinter->DrawRect2(CRect(442, 85, 535, 105), 1);
  7663. // 12.打印详细内容
  7664. int dty = 0;
  7665. int dtytemp = 0;
  7666. // for( i=10; i<14; i+=3)
  7667. //for( i=10; i<22; i+=3) // 循环4次,再画
  7668. int j = 0;
  7669. for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
  7670. {
  7671. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7672. CArray<CRect, CRect>rcarray;
  7673. CStringArray strarray2;
  7674. StrRect = load.m_rcarray.ElementAt(i);
  7675. StrRect.top += dty;
  7676. StrRect.bottom += dty;
  7677. StrRect.right -= 70; // Jeff add
  7678. //printf("Jeff:i=%d:left=%d,top=%d,right=%d,bottom=%d.\n\n",i,StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7679. /*
  7680. 4次的CRect
  7681. 66,105,350,125
  7682. 66,126,350,146
  7683. 66,147,350,167
  7684. 66,168,350,188
  7685. */
  7686. if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
  7687. {
  7688. StrRect = load.m_rcarray.ElementAt(i - 1);
  7689. StrRect.top += dty;
  7690. StrRect.bottom += dty;
  7691. dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
  7692. break;
  7693. }
  7694. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7695. StrRect.left += 2;
  7696. StrRect.right -= 2;
  7697. StrRect.top += 4;
  7698. rcarray.Add(StrRect);
  7699. //strarray2.Add(pArray->ElementAt(i+1));
  7700. strarray2.Add(pArray->ElementAt(j));
  7701. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7702. // 指定格子宽度,计算字符串占几行(高度).
  7703. INT bottom = CalcHeight(rcarray, strarray2, tagPrinter, FORMAT_LEFT);
  7704. dtytemp = bottom - StrRect.bottom;
  7705. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7706. // 重新获取表格大小,并画出表格;
  7707. /*
  7708. CRect(66,85,280,105),
  7709. CRect(280,85,350,105)
  7710. CRect(350,85,442,105)
  7711. CRect(442,85,535,105)
  7712. CRect(66,105,350,125),
  7713. CRect(66,126,350,146)
  7714. CRect(66,147,350,167)
  7715. CRect(66,168,350,188)
  7716. */
  7717. // 画收款项目框及打印内容;
  7718. StrRect = load.m_rcarray.ElementAt(i);
  7719. //StrRect=CRect(66,85,280,105);
  7720. StrRect.bottom += dtytemp;
  7721. StrRect.top += dty;
  7722. StrRect.bottom += dty;
  7723. //StrRect.left -= 70; // Jeff add
  7724. StrRect.right -= 70; // Jeff add
  7725. //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;
  7726. tagPrinter->DrawRect2(StrRect, 1);
  7727. // 画支付方式框及打印内容;
  7728. StrRect = load.m_rcarray.ElementAt(i);
  7729. //StrRect=CRect(280,85,350,105);
  7730. StrRect.bottom += dtytemp;
  7731. StrRect.top += dty;
  7732. StrRect.bottom += dty;
  7733. StrRect.left += StrRect.Width() - 70;
  7734. //StrRect.right += 70; // Jeff add
  7735. //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;
  7736. tagPrinter->DrawRect2(StrRect, 1);
  7737. StrRect.left += 2;
  7738. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7739. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7740. // 画金额框及打印内容;
  7741. StrRect = load.m_rcarray.ElementAt(i + 1);
  7742. //StrRect=CRect(350,85,442,105);
  7743. StrRect.top += dty;
  7744. StrRect.bottom += dty;
  7745. StrRect.bottom += dtytemp;
  7746. //StrRect.right -= 70; // Jeff add
  7747. //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;
  7748. tagPrinter->DrawRect2(StrRect, 1);
  7749. StrRect.left += 2;
  7750. // 打印出金额字段内容
  7751. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7752. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7753. // 画开单人框及打印内容;
  7754. StrRect = load.m_rcarray.ElementAt(i + 2);
  7755. //StrRect=CRect(442,85,535,105);
  7756. StrRect.top += dty;
  7757. StrRect.bottom += dty;
  7758. StrRect.bottom += dtytemp;
  7759. //StrRect.right -= 70; // Jeff add
  7760. //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;
  7761. tagPrinter->DrawRect2(StrRect, 1);
  7762. StrRect.left += 2;
  7763. // 打印开单人字段内容
  7764. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7765. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7766. dty += dtytemp;
  7767. }
  7768. //.打印->付款情况 应付 实付 欠款.
  7769. i = 22;
  7770. j = 27;
  7771. StrRect = load.m_rcarray.ElementAt(i);
  7772. StrRect.top += dty;
  7773. StrRect.bottom += dty;
  7774. tagPrinter->DrawRect2(StrRect, 1);
  7775. StrRect.left += 2;
  7776. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7777. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7778. //.打印->合计人民币(大写):.......
  7779. i = 23;
  7780. j = 28;
  7781. StrRect = load.m_rcarray.ElementAt(i);
  7782. StrRect.top += dty;
  7783. StrRect.bottom += dty;
  7784. tagPrinter->DrawRect2(StrRect, 1);
  7785. StrRect.left += 2;
  7786. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7787. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7788. // 打印总金额;
  7789. tagPrinter->SetFontFace(7, 1, "宋体");
  7790. for (i = 24, j = 29; i < 27; i++, j++)
  7791. {
  7792. StrRect = load.m_rcarray.ElementAt(i);
  7793. StrRect.top += dty;
  7794. StrRect.bottom += dty;
  7795. StrRect.left += 2;
  7796. tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7797. }
  7798. StrRect = load.m_rcarray.ElementAt(24);
  7799. StrRect.top += dty;
  7800. StrRect.bottom += dty;
  7801. hei = StrRect.Height();
  7802. StrRect.top += hei;
  7803. StrRect.bottom += hei;
  7804. StrRect.right += 100;
  7805. StrRect.left += 2;
  7806. StrRect = load.m_rcarray.ElementAt(27);
  7807. StrRect.top += dty;
  7808. StrRect.bottom += dty;
  7809. AutoDraw(*tagPrinter, StrRect, pArray->ElementAt(32), 1.0);
  7810. }
  7811. if (bPrintImmediately == TRUE)
  7812. {
  7813. printcot = nCount;
  7814. ////结束打印
  7815. tagPrinter->EndPage();
  7816. tagPrinter->EndPrint();
  7817. #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
  7818. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  7819. CString sql;
  7820. sql.Format("update version set [serialno]='%s'", SerialNo);
  7821. g_sendhead.bsql = 1;
  7822. g_nYearposTemp = g_nYearpos;
  7823. g_nYearpos = -1;
  7824. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7825. g_nYearpos = g_nYearposTemp;
  7826. #endif
  7827. }
  7828. else
  7829. {
  7830. PrintPreview dlg;
  7831. dlg.m_mode = 3;
  7832. tagPrinter->GetWidHei(dlg.m_w, dlg.m_h);
  7833. dlg.m_pDC = tagPrinter->GetPDC();
  7834. //if(aa==0)
  7835. //{
  7836. if (dlg.DoModal() != IDOK)
  7837. {
  7838. return;
  7839. }
  7840. else
  7841. {
  7842. printcot = dlg.m_num;
  7843. //m_Print.deletePrinter();
  7844. for (int i = 0; i < printcot; i++)
  7845. {
  7846. //tagPrinter->EndPage();
  7847. //tagPrinter->m_DC.AbortDoc(); // 结束清空由StartDoc写入的内容;2014-09-15;
  7848. //tagPrinter->m_DC.EndDoc();
  7849. //Sleep(10000);
  7850. //tagPrinter->StartPrint();
  7851. //tagPrinter->NewPage();
  7852. //PrintReceipt_02(pArray,/*tagPrinter*/NULL,printcot,TRUE);
  7853. PrintReceipt_02(pArray, tagPrinter, printcot, TRUE);
  7854. }
  7855. }
  7856. if (tagPrinter) delete tagPrinter;
  7857. //}
  7858. }
  7859. //}
  7860. }
  7861. void CMainFrame::PrintFlowChart(CString strOrderNumber) // 选片打单;
  7862. {
  7863. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
  7864. {
  7865. // Jeff 使用风格2打印;
  7866. //PrintFlowChart3_20151116(strOrderNumber);
  7867. PrintFlowChart3(strOrderNumber);
  7868. return;
  7869. }
  7870. #ifdef ZHIAI_VERSION
  7871. PrintFlowChart2(strOrderNumber);
  7872. return;
  7873. #endif
  7874. int i = 0;
  7875. int printcot = 1;
  7876. for (int aa = 0; aa < printcot; aa++)
  7877. {
  7878. CPrintRX m_Print;
  7879. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7880. {
  7881. m_Print.InitToPrint(NULL, 1);
  7882. }
  7883. else
  7884. {
  7885. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  7886. if (name.IsEmpty())
  7887. m_Print.InitToPrint(NULL, 1);
  7888. else
  7889. {
  7890. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7891. if (nret == -1 && aa == 0)
  7892. {
  7893. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7894. }
  7895. }
  7896. }
  7897. m_Print.StartPrint();
  7898. m_Print.StartPage();
  7899. // CRect StrRect(0,0,560,818);
  7900. LoadRect load;
  7901. load.SetLiaPath("4.lia");
  7902. load.SetMargins(-14, -14);
  7903. if (!load.Load())return;
  7904. LoadRect load2;
  7905. load2.SetMargins(-14, 472 + 27 - 14);
  7906. load2.SetLiaPath("5.lia");
  7907. if (!load2.Load())return;
  7908. //////////////////////////////////////////////////////////////
  7909. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2'";
  7910. g_sendhead.code[0] = 54;
  7911. g_sendhead.code[1] = 223;
  7912. g_sendhead.tabcount = 2;
  7913. g_sendhead.bsql = 0;
  7914. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  7915. CArray<CStringArray, CStringArray>sparray;
  7916. DataToArray(&g_List1array, &sparray);
  7917. CString spno;
  7918. for ( i = 0; i < sparray.GetSize(); i++)
  7919. {
  7920. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  7921. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  7922. if (sparray.ElementAt(i).ElementAt(5) == "入册" && sparray.ElementAt(i).ElementAt(5) == "入底" && sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  7923. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  7924. spno += sparray.ElementAt(i).ElementAt(5);
  7925. if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7926. spno += "; ";
  7927. else
  7928. {
  7929. spno += ":";
  7930. spno += sparray.ElementAt(i).ElementAt(6);
  7931. spno += "; ";
  7932. }
  7933. }
  7934. spno += " 加挑:";
  7935. for (i = 0; i < sparray.GetSize(); i++)
  7936. {
  7937. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  7938. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  7939. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  7940. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  7941. spno += sparray.ElementAt(i).ElementAt(5);
  7942. if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7943. spno += "; ";
  7944. else
  7945. {
  7946. spno += ":";
  7947. spno += sparray.ElementAt(i).ElementAt(6);
  7948. spno += "; ";
  7949. }
  7950. }
  7951. if (spno.Right(6) == " 加挑:")
  7952. {
  7953. spno = spno.Left(spno.GetLength() - 6);
  7954. }
  7955. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  7956. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  7957. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  7958. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  7959. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  7960. if (m_urgent.IsEmpty())m_urgent = "否";
  7961. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  7962. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  7963. // CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  7964. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  7965. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  7966. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  7967. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  7968. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  7969. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  7970. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  7971. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  7972. CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(17) + g_List1array.ElementAt(0).ElementAt(29);
  7973. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  7974. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  7975. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  7976. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  7977. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  7978. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  7979. CString m_sum3;
  7980. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  7981. ::ConvertToPrice(m_sum3);
  7982. if (m_money3.IsEmpty())m_money3 = "0";
  7983. // m_money3=m_money3+"/"+m_sum3;
  7984. CString name;
  7985. if (!m_name1.IsEmpty())
  7986. name = m_name1 + ",";
  7987. name += m_name2;
  7988. name.TrimRight(",");
  7989. CString phone;
  7990. if (!m_phone1.IsEmpty())
  7991. phone = m_phone1 + ",";
  7992. phone += m_phone2; phone.TrimRight(",");
  7993. if (IsHasRights2new(31) == 0)
  7994. phone = "***";
  7995. CStringArray strarray;
  7996. strarray.Add(m_urgent);
  7997. strarray.Add(m_ren);
  7998. strarray.Add(m_waiter3);
  7999. strarray.Add(name);
  8000. strarray.Add(m_time2);
  8001. strarray.Add(m_time4);
  8002. strarray.Add(m_money3);
  8003. strarray.Add(m_sum3);
  8004. strarray.Add(m_takezs);
  8005. strarray.Add(m_taoxizs);
  8006. strarray.Add(m_choosezs);
  8007. strarray.Add(strOrderNumber);
  8008. strarray.Add(phone);
  8009. ////////////////////////////////////////////////////////////////
  8010. int rcpos = -1;
  8011. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8012. Image *pImg = NULL;
  8013. #ifdef MNLS_VERSION
  8014. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  8015. #else
  8016. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  8017. #endif
  8018. m_Print.DrawImage(pImg, StrRect);
  8019. delete pImg;
  8020. m_Print.SetFontFace(11, 1, "宋体");
  8021. StrRect = load2.m_rcarray.ElementAt(7);
  8022. StrRect.top = load2.m_rcarray.ElementAt(15).top - 15;
  8023. StrRect.bottom = load2.m_rcarray.ElementAt(15).bottom - 15;
  8024. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  8025. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8026. StrRect.top += 15;
  8027. StrRect.bottom += 15;
  8028. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  8029. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8030. m_Print.SetFontFace(15, 1, "宋体");
  8031. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8032. #ifdef MNLS_VERSION
  8033. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8034. #endif
  8035. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8036. #ifdef MNLS_VERSION
  8037. m_Print.DrawRect(StrRect);
  8038. #endif
  8039. m_Print.SetFontFace(7, 1, "黑体");
  8040. m_Print.SetColor(0xffffff);
  8041. #ifdef MNLS_VERSION
  8042. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8043. #endif
  8044. m_Print.SetColor(0);
  8045. m_Print.SetFontFace(25, 1, "黑体");
  8046. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8047. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8048. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8049. {
  8050. Image *pImg = NULL;
  8051. g_nSendCode = 31;
  8052. int g_nYearposTemp = g_nYearpos;
  8053. g_nYearpos = -1;
  8054. g_pMainWnd->ProcessChatMessageRequest2(1);
  8055. g_nYearpos = g_nYearposTemp;
  8056. g_nSendCode = 0;
  8057. if (g_bSendOK == 0)return;
  8058. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8059. if (pImg)
  8060. {
  8061. StrRect.left = 450;
  8062. StrRect.top = 22;
  8063. StrRect.right = StrRect.left + 60;
  8064. StrRect.bottom = StrRect.top + 60;
  8065. m_Print.DrawImage(pImg, StrRect);
  8066. delete pImg; pImg = NULL;
  8067. }
  8068. }
  8069. #ifdef CHILD_VERSION
  8070. CString title[13] = { "是否加急:", "接单门市:", \
  8071. "选样人员:", "客人姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
  8072. "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:"
  8073. };
  8074. #else
  8075. CString title[13] = { "是否加急:", "接单门市:", \
  8076. "选样人员:", "新郎新娘姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
  8077. "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:" };
  8078. #endif
  8079. m_Print.SetFontFace(12, 1, "宋体");
  8080. for (i = 0; i < 13; i++)
  8081. {
  8082. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8083. if (i < 3)
  8084. m_Print.DrawRect2(StrRect, 0);
  8085. else
  8086. m_Print.DrawRect2(StrRect, 1);
  8087. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8088. }
  8089. for (i = 18; i <= 37; i++)
  8090. {
  8091. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8092. if (i >= 19 && i <= 21)
  8093. m_Print.DrawRect2(StrRect, 2);
  8094. /* else if(i==26)
  8095. {
  8096. CRect rc=StrRect;
  8097. CRect rc2=rc;
  8098. rc.right -=rc2.Width ()/2;
  8099. m_Print.DrawRect2(rc, 1);
  8100. rc2.left +=rc.Width ();
  8101. m_Print.DrawRect2(rc2, 1);
  8102. }*/
  8103. else
  8104. m_Print.DrawRect2(StrRect, 1);
  8105. if (i == 18)
  8106. {
  8107. StrRect.left += 5;
  8108. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8109. }
  8110. }
  8111. //////////////////////////////////////
  8112. rcpos = -1;
  8113. for (i = 0; i < 8; i++)
  8114. {
  8115. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8116. m_Print.DrawRect2(StrRect, 1);
  8117. }
  8118. #ifdef CHILD_VERSION
  8119. CString title2[4] = { "引导师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
  8120. #else
  8121. CString title2[4] = { "化妆师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
  8122. #endif
  8123. for (i = 0; i < 4; i++)
  8124. {
  8125. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8126. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8127. }
  8128. for (i = 0; i < 4; i++)
  8129. {
  8130. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  8131. m_Print.DrawRect2(StrRect, 2);
  8132. }
  8133. StrRect = load2.m_rcarray.ElementAt(11);
  8134. StrRect.top -= 15;
  8135. StrRect.bottom -= 15;
  8136. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客选片签名:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8137. StrRect = load2.m_rcarray.ElementAt(15);
  8138. StrRect.top -= 15;
  8139. StrRect.bottom -= 15;
  8140. m_Print.DrawRect2(StrRect, 2);
  8141. ///////////////////////////////////////////
  8142. for (i = 19; i <= 31; i++)
  8143. {
  8144. StrRect = load.m_rcarray.ElementAt(i - 1);
  8145. StrRect.left += 4;
  8146. if (i == 31)
  8147. {
  8148. if (m_phone1.IsEmpty() == 0 && m_phone2.IsEmpty() == 0)
  8149. {
  8150. StrRect.top += 2;
  8151. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  8152. StrRect.top += 8;
  8153. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8154. }
  8155. else
  8156. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8157. }
  8158. /* else if((i-19)==7)
  8159. {
  8160. CRect rc=StrRect;
  8161. CRect rc2=rc;
  8162. rc.right -=rc2.Width ()/2;
  8163. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8164. rc2.left +=rc.Width ()+3;
  8165. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8166. }*/
  8167. else
  8168. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8169. }
  8170. strarray.RemoveAll();
  8171. strarray.Add(m_waiter2);
  8172. strarray.Add(m_waiter1);
  8173. strarray.Add(m_waiter4);
  8174. for (i = 13; i <= 15; i++)
  8175. {
  8176. StrRect = load2.m_rcarray.ElementAt(i - 1);
  8177. StrRect.left += 4;
  8178. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8179. }
  8180. ///////////spno
  8181. CRect sprc[14];
  8182. for (i = 0; i < 14; i++)
  8183. {
  8184. if (i < 7)
  8185. {
  8186. if (i == 0)
  8187. {
  8188. StrRect = load.m_rcarray.ElementAt(17); StrRect.left += 94; StrRect.right -= 3;
  8189. }
  8190. else
  8191. {
  8192. StrRect = load.m_rcarray.ElementAt(30 + i); StrRect.left += 4; StrRect.right -= 3;
  8193. }
  8194. }
  8195. else
  8196. {
  8197. StrRect = load2.m_rcarray.ElementAt(i - 7); StrRect.left += 4; StrRect.right -= 3;
  8198. }
  8199. sprc[i] = StrRect;
  8200. }
  8201. CString temp, tempspno, tempbz;
  8202. CSize size;
  8203. BOOL bRun = 0;
  8204. int fontsize = 12;
  8205. ll: tempspno = spno;
  8206. tempbz = m_bz;
  8207. m_Print.SetFontFace(fontsize, 1, "宋体");
  8208. for (i = 0; i<14; i++)
  8209. {
  8210. if (!tempspno.IsEmpty())
  8211. {
  8212. temp = tempspno;
  8213. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8214. int right = 0;
  8215. CRect temprc = sprc[i];
  8216. while (size.cx>temprc.Width())
  8217. {
  8218. right++;
  8219. temp = tempspno.Left(tempspno.GetLength() - (right));
  8220. if (GIsHalfHZ(temp))
  8221. {
  8222. right++;
  8223. temp.Delete(temp.GetLength() - 1);
  8224. }
  8225. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8226. }
  8227. if (bRun)
  8228. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8229. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  8230. if (tempspno.IsEmpty())i++;
  8231. }
  8232. else if (!tempbz.IsEmpty())
  8233. {
  8234. temp = tempbz;
  8235. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8236. int right = 0;
  8237. CRect temprc = sprc[i];
  8238. while (size.cx > temprc.Width())
  8239. {
  8240. right++;
  8241. temp = tempbz.Left(tempbz.GetLength() - (right));
  8242. if (GIsHalfHZ(temp))
  8243. {
  8244. right++;
  8245. temp.Delete(temp.GetLength() - 1);
  8246. }
  8247. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8248. }
  8249. if (bRun)
  8250. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8251. tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
  8252. }
  8253. }
  8254. if (tempspno.IsEmpty() == 0 || tempbz.IsEmpty() == 0)
  8255. {
  8256. fontsize--;
  8257. goto ll;
  8258. }
  8259. if (bRun == 0)
  8260. {
  8261. bRun = 1;
  8262. goto ll;
  8263. }
  8264. PrintPreview dlg;
  8265. dlg.m_mode = 2;
  8266. dlg.m_name = name;
  8267. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  8268. dlg.m_pDC = m_Print.GetPDC();
  8269. if (aa == 0)
  8270. {
  8271. if (dlg.DoModal() != IDOK)
  8272. return;
  8273. printcot = dlg.m_num;
  8274. }
  8275. //结束打印
  8276. m_Print.EndPage();
  8277. m_Print.EndPrint();
  8278. }
  8279. }
  8280. void CMainFrame::PrintFlowChart3LKAY(CString strOrderNumber)
  8281. {
  8282. int i = 0;
  8283. int printcot = 1;
  8284. for (int aa = 0; aa < printcot; aa++)
  8285. {
  8286. CPrintRX m_Print;
  8287. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8288. {
  8289. m_Print.InitToPrint(NULL, 1);
  8290. }
  8291. else
  8292. {
  8293. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  8294. if (name.IsEmpty())
  8295. m_Print.InitToPrint(NULL, 1);
  8296. else
  8297. {
  8298. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8299. if (nret == -1 && aa == 0)
  8300. {
  8301. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8302. }
  8303. }
  8304. }
  8305. m_Print.StartPrint();
  8306. m_Print.StartPage();
  8307. LoadRect load;
  8308. load.SetLiaPath("18.lia");
  8309. load.SetMargins(10, 0);
  8310. if (!load.Load())return;
  8311. CString str;
  8312. int rcpos = -1;
  8313. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8314. m_Print.SetFontFace(25, 1, "宋体");
  8315. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8316. m_Print.SetFontFace(15, 1, "宋体");
  8317. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8318. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8319. m_Print.SetFontFace(9, 1, "宋体");
  8320. //////////////////////////////////////////////////////////////
  8321. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  8322. g_sendhead.code[0] = 54;
  8323. g_sendhead.code[1] = 223;
  8324. g_sendhead.code[2] = 52;
  8325. g_sendhead.tabcount = 3;
  8326. g_sendhead.bsql = 0;
  8327. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  8328. CArray<CStringArray, CStringArray>sparray;
  8329. CArray<CStringArray, CStringArray>clientarray;
  8330. DataToArray(&g_List1array, &sparray, &clientarray);
  8331. CString spno;
  8332. CStringArray sparray2;
  8333. for ( i = 0; i < sparray.GetSize(); i++)
  8334. {
  8335. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8336. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  8337. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8338. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8339. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8340. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  8341. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8342. sparray2.Add(sparray.ElementAt(i).ElementAt(9));
  8343. sparray2.Add(sparray.ElementAt(i).ElementAt(10));
  8344. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8345. }
  8346. for (i = 0; i < sparray.GetSize(); i++)
  8347. {
  8348. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  8349. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  8350. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  8351. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8352. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8353. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  8354. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8355. sparray2.Add(sparray.ElementAt(i).ElementAt(9));
  8356. sparray2.Add(sparray.ElementAt(i).ElementAt(10));
  8357. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8358. }
  8359. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  8360. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  8361. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  8362. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  8363. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  8364. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  8365. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  8366. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  8367. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  8368. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  8369. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  8370. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  8371. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  8372. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  8373. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  8374. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  8375. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  8376. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  8377. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  8378. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  8379. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  8380. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  8381. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  8382. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  8383. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  8384. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  8385. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  8386. CString m_sum3;
  8387. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  8388. ::ConvertToPrice(m_sum3);
  8389. if (m_money3.IsEmpty())m_money3 = "0";
  8390. int dty = 0;
  8391. CString name;
  8392. if (!m_name1.IsEmpty())
  8393. name = m_name1 + ",";
  8394. name += m_name2;
  8395. name.TrimRight(",");
  8396. CString phone;
  8397. if (!m_phone1.IsEmpty())
  8398. phone = m_phone1 + ",";
  8399. phone += m_phone2; phone.TrimRight(",");
  8400. if (IsHasRights2new(31) == 0)
  8401. phone = "***";
  8402. CStringArray strarray;
  8403. #ifdef CHILD_VERSION
  8404. if (m_birthday.IsEmpty())
  8405. strarray.Add("姓名/性别");
  8406. else
  8407. strarray.Add("姓名/性别/年龄");
  8408. #else
  8409. strarray.Add("客人姓名");
  8410. #endif
  8411. strarray.Add("电话");
  8412. strarray.Add("单号");
  8413. strarray.Add("套系");
  8414. strarray.Add("选样");
  8415. strarray.Add("余款/加挑");
  8416. strarray.Add("选片/日期");
  8417. #ifdef CHILD_VERSION
  8418. if (m_birthday.IsEmpty())
  8419. strarray.Add(name + "/" + m_sex);
  8420. else
  8421. {
  8422. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  8423. m_birthday.Format("%d", year + 1);
  8424. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  8425. }
  8426. #else
  8427. strarray.Add(name);
  8428. #endif
  8429. strarray.Add(phone);
  8430. strarray.Add(strOrderNumber);
  8431. strarray.Add(m_taoxiname);
  8432. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8433. strarray.Add(str);
  8434. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  8435. strarray.Add(str);
  8436. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  8437. for (i = 3; i <= 16; i++)
  8438. {
  8439. StrRect = load.m_rcarray.ElementAt(i - 1);
  8440. if (i < 10)
  8441. {
  8442. m_Print.DrawRect2(StrRect, 1);
  8443. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8444. }
  8445. }
  8446. StrRect = load.m_rcarray.ElementAt(29);
  8447. m_Print.DrawRect2(StrRect, 1);
  8448. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8449. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8450. {
  8451. Image *pImg = NULL;
  8452. g_nSendCode = 31;
  8453. int g_nYearposTemp = g_nYearpos;
  8454. g_nYearpos = -1;
  8455. g_pMainWnd->ProcessChatMessageRequest2(1);
  8456. g_nYearpos = g_nYearposTemp;
  8457. g_nSendCode = 0;
  8458. if (g_bSendOK == 0)return;
  8459. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8460. if (pImg)
  8461. {
  8462. StrRect.left = 485;
  8463. StrRect.top = 12;
  8464. StrRect.right = StrRect.left + 60;
  8465. StrRect.bottom = StrRect.top + 60;
  8466. m_Print.DrawImage(pImg, StrRect);
  8467. delete pImg; pImg = NULL;
  8468. }
  8469. }
  8470. CArray<CRect, CRect>rcarray;
  8471. CStringArray strarray2;
  8472. for (i = 10; i <= 16; i++)
  8473. {
  8474. StrRect = load.m_rcarray.ElementAt(i - 1);
  8475. StrRect.left += 2;
  8476. StrRect.right -= 2;
  8477. StrRect.top += 2;
  8478. rcarray.Add(StrRect);
  8479. strarray2.Add(strarray.ElementAt(7 + i - 10));
  8480. }
  8481. if (1)
  8482. {
  8483. StrRect = load.m_rcarray.ElementAt(30);
  8484. StrRect.left += 2;
  8485. StrRect.right -= 2;
  8486. StrRect.top += 2;
  8487. rcarray.Add(StrRect);
  8488. strarray2.Add(m_time6 + "/" + m_time5);
  8489. }
  8490. INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  8491. for (i = 10; i <= 16; i++)
  8492. {
  8493. StrRect = load.m_rcarray.ElementAt(i - 1);
  8494. if (i == 10)
  8495. {
  8496. dty += bottom - StrRect.bottom;
  8497. }
  8498. StrRect.bottom = bottom;
  8499. m_Print.DrawRect2(StrRect, 1);
  8500. }
  8501. if (1)
  8502. {
  8503. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  8504. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  8505. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  8506. }
  8507. m_Print.SetFontFace(15, 1, "宋体");
  8508. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  8509. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8510. m_Print.SetFontFace(9, 1, "宋体");
  8511. strarray.RemoveAll();
  8512. strarray.Add("产品名称");
  8513. strarray.Add("数量");
  8514. strarray.Add("P数");
  8515. strarray.Add("张数");
  8516. strarray.Add("照片编号");
  8517. CArray<CRect, CRect>rc2array;
  8518. int wid = 25;
  8519. for (i = 18; i <= 22; i++)
  8520. {
  8521. StrRect = load.m_rcarray.ElementAt(i - 1);
  8522. if (i == 19)
  8523. {
  8524. StrRect.right = StrRect.left + wid;
  8525. }
  8526. if (i == 20)
  8527. {
  8528. StrRect = load.m_rcarray.ElementAt(i - 2);
  8529. StrRect.left += wid; StrRect.right = StrRect.left;
  8530. StrRect.right += wid;
  8531. }
  8532. if (i == 21)
  8533. {
  8534. StrRect = load.m_rcarray.ElementAt(i - 3);
  8535. StrRect.left += wid * 2; StrRect.right = StrRect.left;
  8536. StrRect.right += wid;
  8537. wid = StrRect.right;
  8538. }
  8539. if (i == 22)
  8540. {
  8541. StrRect = load.m_rcarray.ElementAt(i - 3);
  8542. StrRect.left = wid;
  8543. }
  8544. StrRect.top += dty; StrRect.bottom += dty;
  8545. m_Print.DrawRect2(StrRect, 1);
  8546. StrRect.left += 2;
  8547. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8548. StrRect.left -= 2;
  8549. StrRect.top = StrRect.bottom;
  8550. StrRect.bottom += 18;
  8551. rc2array.Add(StrRect);
  8552. }
  8553. int curypos = 0;
  8554. for (i = 0; i < sparray2.GetSize(); i += 5)
  8555. {
  8556. rcarray.RemoveAll();
  8557. strarray2.RemoveAll();
  8558. int j = 0;
  8559. for ( j = 0; j < 5; j++)
  8560. {
  8561. StrRect = rc2array.ElementAt(j);
  8562. StrRect.left += 2;
  8563. StrRect.right -= 2;
  8564. StrRect.top += 2;
  8565. rcarray.Add(StrRect);
  8566. strarray2.Add(sparray2.ElementAt(i + j));
  8567. }
  8568. INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  8569. rcarray.RemoveAll();
  8570. for (j = 0; j < 5; j++)
  8571. {
  8572. StrRect = rc2array.ElementAt(j);
  8573. if (j == 0)
  8574. {
  8575. dty += bottom - StrRect.bottom;
  8576. }
  8577. StrRect.bottom = bottom;
  8578. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  8579. StrRect.top = StrRect.bottom;
  8580. StrRect.bottom += 18;
  8581. rcarray.Add(StrRect);
  8582. }
  8583. rc2array.RemoveAll();
  8584. rc2array.Copy(rcarray);
  8585. }
  8586. m_Print.SetFontFace(15, 1, "宋体");
  8587. StrRect = load.m_rcarray.ElementAt(20);
  8588. dty = curypos - StrRect.bottom + 35;
  8589. StrRect.top += dty; StrRect.bottom += dty;
  8590. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8591. m_Print.SetFontFace(9, 1, "宋体");
  8592. rcarray.RemoveAll();
  8593. strarray2.RemoveAll();
  8594. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  8595. StrRect.left += 2;
  8596. StrRect.right -= 2;
  8597. StrRect.top += 2;
  8598. rcarray.Add(StrRect);
  8599. strarray2.Add(m_bz);
  8600. bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  8601. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  8602. dty += bottom - StrRect.bottom;
  8603. StrRect.bottom = bottom;
  8604. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  8605. m_Print.SetFontFace(10, 1, "宋体");
  8606. StrRect = load.m_rcarray.ElementAt(22);
  8607. dty = curypos - StrRect.bottom + 25;
  8608. StrRect.top += dty; StrRect.bottom += dty;
  8609. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  8610. if (m_edit9.IsEmpty())
  8611. {
  8612. m_edit9 = "\
  8613. 经确认后的照片均排入制作流程,\r\n\
  8614. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8615. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8616. }
  8617. CString info1, info2, info3;
  8618. int newlinepos = m_edit9.Find("\r\n");
  8619. if (newlinepos != -1)
  8620. {
  8621. info1 = m_edit9.Left(newlinepos);
  8622. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8623. }
  8624. newlinepos = m_edit9.Find("\r\n");
  8625. if (newlinepos != -1)
  8626. {
  8627. info2 = m_edit9.Left(newlinepos);
  8628. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  8629. info3 = m_edit9;
  8630. }
  8631. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8632. StrRect = load.m_rcarray.ElementAt(23);
  8633. StrRect.top += dty; StrRect.bottom += dty;
  8634. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8635. StrRect = load.m_rcarray.ElementAt(24);
  8636. StrRect.top += dty; StrRect.bottom += dty;
  8637. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8638. StrRect.top += 15;
  8639. StrRect.bottom += 15;
  8640. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8641. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  8642. StrRect = load.m_rcarray.ElementAt(25);
  8643. StrRect.top += dty - dy;
  8644. StrRect.bottom += dty - dy;
  8645. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8646. StrRect = load.m_rcarray.ElementAt(26);
  8647. StrRect.top += dty - dy;
  8648. StrRect.bottom += dty - dy;
  8649. m_Print.DrawRect2(StrRect, 2);
  8650. StrRect = load.m_rcarray.ElementAt(25);
  8651. StrRect.top += dty + 15 - dy;
  8652. StrRect.bottom += dty + 15 - dy;
  8653. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8654. StrRect = load.m_rcarray.ElementAt(26);
  8655. StrRect.top += dty + 15 - dy;
  8656. StrRect.bottom += dty + 15 - dy;
  8657. m_Print.DrawRect2(StrRect, 2);
  8658. StrRect = load.m_rcarray.ElementAt(25);
  8659. StrRect.top += dty + 15 * 2 - dy;
  8660. StrRect.bottom += dty + 15 * 2 - dy;
  8661. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8662. StrRect = load.m_rcarray.ElementAt(26);
  8663. StrRect.top += dty + 15 * 2 - dy;
  8664. StrRect.bottom += dty + 15 * 2 - dy;
  8665. m_Print.DrawRect2(StrRect, 2);
  8666. PrintPreview dlg; dlg.m_mode = 2;
  8667. dlg.m_name = name;
  8668. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  8669. dlg.m_pDC = m_Print.GetPDC();
  8670. if (aa == 0)
  8671. {
  8672. if (dlg.DoModal() != IDOK)
  8673. return;
  8674. printcot = dlg.m_num;
  8675. }
  8676. //结束打印
  8677. m_Print.EndPage();
  8678. m_Print.EndPrint();
  8679. }
  8680. }
  8681. void CMainFrame::PrintFlowChart3(CString strOrderNumber) // 选片打单 风格2;
  8682. {
  8683. #ifdef LKAY_VERSION
  8684. PrintFlowChart3LKAY(strOrderNumber);
  8685. return;
  8686. #endif
  8687. int i = 0;
  8688. int j = 0;
  8689. int printcot = 1;
  8690. for (int aa = 0; aa < printcot; aa++)
  8691. {
  8692. BOOL bSecondPage = 0;
  8693. int nPrintedPos = 0;
  8694. for (int bb = 0; bb < 2; bb++)
  8695. {
  8696. if (bb && bSecondPage == 0)break;
  8697. CPrintRX m_Print;
  8698. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58))) // 58-[version].[setcheck1] ==1,使用默认打印机;
  8699. {
  8700. m_Print.InitToPrint(NULL, 1);
  8701. }
  8702. else // 否则使用指定的打印机;
  8703. {
  8704. CString name = g_cominfoarray.ElementAt(0).ElementAt(64); // 64-[version].[printer2] 制作单打印机;
  8705. if (name.IsEmpty())
  8706. m_Print.InitToPrint(NULL, 1);
  8707. else
  8708. {
  8709. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8710. if (nret == -1 && aa == 0)
  8711. {
  8712. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8713. }
  8714. }
  8715. }
  8716. m_Print.StartPrint();
  8717. m_Print.StartPage();
  8718. LoadRect load;
  8719. load.SetLiaPath("18.lia");
  8720. load.SetMargins(10, 0);
  8721. if (!load.Load())return;
  8722. CString str;
  8723. int rcpos = -1;
  8724. // ■■■■■■从18.lia获取到第一个区域大小 - 1.显示店名;
  8725. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  8726. if ((bb == 0 && bSecondPage == 0))
  8727. {
  8728. m_Print.SetFontFace(25, 1, "宋体");
  8729. // 10-[version].[info1] 店名;
  8730. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8731. m_Print.SetFontFace(15, 1, "宋体");
  8732. // ■■■■■■从18.lia获取第二个区域大小 - 2.显示"基本资料";
  8733. StrRect = load.m_rcarray.ElementAt(++rcpos);
  8734. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8735. m_Print.SetFontFace(9, 1, "宋体");
  8736. }
  8737. //////////////////////////////////////////////////////////////
  8738. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  8739. g_sendhead.code[0] = 54; // dindan;
  8740. g_sendhead.code[1] = 223; // dindanspview2; shangpin+dindansp;
  8741. g_sendhead.code[2] = 52; // client;
  8742. g_sendhead.tabcount = 3;
  8743. g_sendhead.bsql = 0;
  8744. g_pMainWnd->ProcessChatMessageRequest2(filter);
  8745. if (g_bSendOK == 0)return;
  8746. CArray<CStringArray, CStringArray>sparray;
  8747. CArray<CStringArray, CStringArray>clientarray;
  8748. DataToArray(&g_List1array, &sparray, &clientarray);
  8749. CString spno;
  8750. CStringArray sparray2;
  8751. for ( i = 0; i < sparray.GetSize(); i++)
  8752. {
  8753. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8754. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  8755. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  8756. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8757. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  8758. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8759. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  8760. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8761. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8762. }
  8763. for (i = 0; i < sparray.GetSize(); i++)
  8764. {
  8765. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  8766. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  8767. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  8768. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  8769. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  8770. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  8771. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  8772. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  8773. sparray2.Add(sparray.ElementAt(i).ElementAt(6));
  8774. }
  8775. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  8776. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  8777. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  8778. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  8779. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  8780. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  8781. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  8782. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  8783. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  8784. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  8785. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  8786. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  8787. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  8788. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  8789. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  8790. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  8791. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  8792. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  8793. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  8794. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  8795. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  8796. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  8797. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  8798. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  8799. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  8800. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  8801. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  8802. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  8803. CString m_sum3;
  8804. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  8805. ::ConvertToPrice(m_sum3);
  8806. if (m_money3.IsEmpty())m_money3 = "0";
  8807. int dty = 0;
  8808. CString name;
  8809. if (!m_name1.IsEmpty())
  8810. name = m_name1 + ",";
  8811. name += m_name2;
  8812. name.TrimRight(",");
  8813. CString phone;
  8814. if (!m_phone1.IsEmpty())
  8815. phone = m_phone1 + ",";
  8816. phone += m_phone2; phone.TrimRight(",");
  8817. if (IsHasRights2new(31) == 0)
  8818. phone = "***";
  8819. CStringArray strarray;
  8820. CArray<CRect, CRect>rcarray;
  8821. CStringArray strarray2; CArray<CRect, CRect>rc2array;
  8822. int bottom;
  8823. if ((bb == 0 && bSecondPage == 0))
  8824. {
  8825. #ifdef CHILD_VERSION
  8826. if (m_birthday.IsEmpty())
  8827. strarray.Add("姓名/性别");
  8828. else
  8829. strarray.Add("姓名/性别/年龄");
  8830. #else
  8831. strarray.Add("客人姓名"); // 第3.1区域 -3.显示客人姓名;
  8832. #endif
  8833. strarray.Add("电话");
  8834. strarray.Add("单号");
  8835. strarray.Add("套系");
  8836. strarray.Add("选样");
  8837. strarray.Add("余款/加挑");
  8838. strarray.Add("选片/日期");
  8839. #ifdef CHILD_VERSION
  8840. if (m_birthday.IsEmpty())
  8841. strarray.Add(name + "/" + m_sex);
  8842. else
  8843. {
  8844. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  8845. m_birthday.Format("%d", year + 1);
  8846. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  8847. }
  8848. #else
  8849. strarray.Add(name); // 第4.1区域 -3.显示客人姓名;
  8850. #endif
  8851. strarray.Add(phone);
  8852. strarray.Add(strOrderNumber);
  8853. strarray.Add(m_taoxiname);
  8854. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8855. strarray.Add(str);
  8856. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  8857. strarray.Add(str);
  8858. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  8859. for (i = 3; i <= 16; i++)
  8860. {
  8861. // ■■■■■■从18.lia中获取第3~16的区域大小;
  8862. StrRect = load.m_rcarray.ElementAt(i - 1);
  8863. if (i < 10)
  8864. {
  8865. m_Print.DrawRect2(StrRect, 1);
  8866. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8867. }
  8868. }
  8869. // ■■■■■■从18.lia中获取第30的区域大小;
  8870. StrRect = load.m_rcarray.ElementAt(29);
  8871. m_Print.DrawRect2(StrRect, 1);
  8872. BOOL bPrintDate = 1;
  8873. #ifdef DDF_VERSION
  8874. // bPrintDate=0;
  8875. #else
  8876. if (m_time5 == "" && m_time6 == "")
  8877. bPrintDate = 0;
  8878. #endif
  8879. if (bPrintDate)
  8880. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8881. else
  8882. {
  8883. #ifdef CHILD_VERSION
  8884. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8885. #else
  8886. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8887. #endif
  8888. }
  8889. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138))) // [version].[reverse3]
  8890. {
  8891. Image *pImg = NULL;
  8892. g_nSendCode = 31;
  8893. int g_nYearposTemp = g_nYearpos;
  8894. g_nYearpos = -1;
  8895. g_pMainWnd->ProcessChatMessageRequest2(1);
  8896. g_nYearpos = g_nYearposTemp;
  8897. g_nSendCode = 0;
  8898. if (g_bSendOK == 0)return;
  8899. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  8900. // Jeff二维码的区域不是从18.lia里获取的,是固定在右上角指定区域;
  8901. if (pImg)
  8902. {
  8903. StrRect.left = 485;
  8904. StrRect.top = 12;
  8905. StrRect.right = StrRect.left + 60;
  8906. StrRect.bottom = StrRect.top + 60;
  8907. m_Print.DrawImage(pImg, StrRect);
  8908. delete pImg; pImg = NULL;
  8909. }
  8910. }
  8911. // CArray<CRect,CRect>rcarray;
  8912. // CStringArray strarray2;
  8913. // ■■■■■■从18.lia中获取第10的区域大小;
  8914. for (i = 10; i <= 16; i++)
  8915. {
  8916. StrRect = load.m_rcarray.ElementAt(i - 1);
  8917. StrRect.left += 2;
  8918. StrRect.right -= 2;
  8919. StrRect.top += 2;
  8920. rcarray.Add(StrRect);
  8921. strarray2.Add(strarray.ElementAt(7 + i - 10));
  8922. }
  8923. if (1)
  8924. {
  8925. // ■■■■■■从18.lia中获取第31的区域大小;
  8926. StrRect = load.m_rcarray.ElementAt(30);
  8927. StrRect.left += 2;
  8928. StrRect.right -= 2;
  8929. StrRect.top += 2;
  8930. rcarray.Add(StrRect);
  8931. if (bPrintDate)
  8932. strarray2.Add(m_time6 + "/" + m_time5);
  8933. else
  8934. {
  8935. strarray2.Add(m_waiter1 + "/" + m_waiter2);
  8936. }
  8937. }
  8938. INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_HCENTER);
  8939. for (i = 10; i <= 16; i++)
  8940. {
  8941. StrRect = load.m_rcarray.ElementAt(i - 1);
  8942. if (i == 10)
  8943. {
  8944. dty += bottom - StrRect.bottom;
  8945. }
  8946. StrRect.bottom = bottom;
  8947. m_Print.DrawRect2(StrRect, 1);
  8948. }
  8949. if (1)
  8950. {
  8951. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  8952. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  8953. }
  8954. m_Print.SetFontFace(15, 1, "宋体");
  8955. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  8956. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8957. }
  8958. int curypos = 0;
  8959. int oldpos = 0;
  8960. if (bb == 1)
  8961. {
  8962. dty = -100;
  8963. oldpos = nPrintedPos;
  8964. if (oldpos == 0)oldpos = 10000;
  8965. }
  8966. m_Print.SetFontFace(9, 1, "宋体");
  8967. strarray.RemoveAll();
  8968. if ((oldpos != 10000 && oldpos < sparray2.GetSize()) || bb == 0)
  8969. {
  8970. strarray.Add("产品名称");
  8971. strarray.Add("数量");
  8972. strarray.Add("照片编号");
  8973. for (i = 18; i <= 20; i++)
  8974. {
  8975. StrRect = load.m_rcarray.ElementAt(i - 1);
  8976. StrRect.top += dty;
  8977. StrRect.bottom += dty;
  8978. m_Print.DrawRect2(StrRect, 1);
  8979. StrRect.left += 2;
  8980. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8981. StrRect.left -= 2;
  8982. StrRect.top = StrRect.bottom;
  8983. StrRect.bottom += 18;
  8984. rc2array.Add(StrRect);
  8985. }
  8986. }
  8987. for (i = oldpos; i < sparray2.GetSize(); i += 3)
  8988. {
  8989. rcarray.RemoveAll();
  8990. strarray2.RemoveAll();
  8991. for ( j = 0; j < 3; j++)
  8992. {
  8993. StrRect = rc2array.ElementAt(j);
  8994. StrRect.left += 2;
  8995. StrRect.right -= 2;
  8996. StrRect.top += 2;
  8997. rcarray.Add(StrRect);
  8998. #if JEFF_TEST_ON
  8999. if (2 == j)
  9000. {
  9001. CString strImg = sparray2.ElementAt(i + 2);
  9002. int nImgCount = strImg.Replace(SEPS_VEB, SEPS_VEB);
  9003. if (nImgCount != 0)
  9004. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
  9005. else if (!strImg.IsEmpty())
  9006. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  9007. strarray2.Add(strImg);
  9008. }
  9009. else
  9010. strarray2.Add(sparray2.ElementAt(i + j));
  9011. #else
  9012. strarray2.Add(sparray2.ElementAt(i + j));
  9013. #endif
  9014. }
  9015. bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  9016. rcarray.RemoveAll();
  9017. for (j = 0; j < 3; j++)
  9018. {
  9019. StrRect = rc2array.ElementAt(j);
  9020. if (j == 0)
  9021. {
  9022. dty += bottom - StrRect.bottom;
  9023. }
  9024. StrRect.bottom = bottom;
  9025. m_Print.DrawRect2(StrRect, 1);
  9026. curypos = StrRect.bottom;
  9027. StrRect.top = StrRect.bottom;
  9028. StrRect.bottom += 18;
  9029. rcarray.Add(StrRect);
  9030. }
  9031. rc2array.RemoveAll();
  9032. rc2array.Copy(rcarray);
  9033. if (bottom > 750)
  9034. {
  9035. bSecondPage = 1;
  9036. nPrintedPos = i + 3;
  9037. break;
  9038. }
  9039. }
  9040. if ((bb == 0 && bSecondPage == 0) || (bb == 1 && bSecondPage == 1))
  9041. {
  9042. m_Print.SetFontFace(15, 1, "宋体");
  9043. StrRect = load.m_rcarray.ElementAt(20);
  9044. dty = curypos - StrRect.bottom + 35;
  9045. StrRect.top += dty;
  9046. StrRect.bottom += dty;
  9047. if (StrRect.bottom > 700 && bb == 0)
  9048. {
  9049. bSecondPage = 1;
  9050. }
  9051. else
  9052. {
  9053. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9054. m_Print.SetFontFace(9, 1, "宋体");
  9055. rcarray.RemoveAll();
  9056. strarray2.RemoveAll();
  9057. StrRect = load.m_rcarray.ElementAt(21);
  9058. StrRect.top += dty;
  9059. StrRect.bottom += dty;
  9060. StrRect.left += 2;
  9061. StrRect.right -= 2;
  9062. StrRect.top += 2;
  9063. rcarray.Add(StrRect);
  9064. #if JEFF_TEST_ON
  9065. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  9066. strarray2.RemoveAll();
  9067. CString strFind = "要求:";
  9068. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  9069. do
  9070. {
  9071. int nIndex = strbz3.Find(strFind, 1);
  9072. if (nIndex != -1)
  9073. {
  9074. CString strbz = strbz3.Left(nIndex);
  9075. strbz3 = strbz3.Mid(nIndex);
  9076. strarray2.Add(strbz);
  9077. }
  9078. else
  9079. {
  9080. strarray2.Add(strbz3);
  9081. strbz3 = "";
  9082. }
  9083. } while (strbz3.Find(strFind) != -1);
  9084. strarray2.Add(g_List1array.ElementAt(0).ElementAt(29));
  9085. strarray2.Add(g_List1array.ElementAt(0).ElementAt(23));
  9086. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  9087. #else
  9088. strarray2.Add(m_bz);
  9089. bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  9090. #endif
  9091. StrRect = load.m_rcarray.ElementAt(21);
  9092. StrRect.top += dty;
  9093. StrRect.bottom += dty;
  9094. dty += bottom - StrRect.bottom;
  9095. StrRect.bottom = bottom;
  9096. m_Print.DrawRect2(StrRect, 1);
  9097. curypos = StrRect.bottom;
  9098. m_Print.SetFontFace(10, 1, "宋体");
  9099. StrRect = load.m_rcarray.ElementAt(22);
  9100. dty = curypos - StrRect.bottom + 25;
  9101. StrRect.top += dty;
  9102. StrRect.bottom += dty;
  9103. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  9104. if (m_edit9.IsEmpty())
  9105. {
  9106. m_edit9 = "\
  9107. 经确认后的照片均排入制作流程,\r\n\
  9108. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9109. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9110. }
  9111. CString info1, info2, info3;
  9112. int newlinepos = m_edit9.Find("\r\n");
  9113. if (newlinepos != -1)
  9114. {
  9115. info1 = m_edit9.Left(newlinepos);
  9116. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9117. }
  9118. newlinepos = m_edit9.Find("\r\n");
  9119. if (newlinepos != -1)
  9120. {
  9121. info2 = m_edit9.Left(newlinepos);
  9122. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9123. info3 = m_edit9;
  9124. }
  9125. #ifdef QCH_VERSION
  9126. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9127. StrRect = load.m_rcarray.ElementAt(23);
  9128. StrRect.top += dty; StrRect.bottom += dty;
  9129. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9130. StrRect=load.m_rcarray .ElementAt (24);
  9131. StrRect.top +=dty;StrRect.bottom +=dty;
  9132. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9133. StrRect.top +=15;
  9134. StrRect.bottom +=15;
  9135. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9136. #else
  9137. if (1)
  9138. {
  9139. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9140. StrRect = load.m_rcarray.ElementAt(23);
  9141. StrRect.top += dty; StrRect.bottom += dty;
  9142. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9143. StrRect = load.m_rcarray.ElementAt(24);
  9144. StrRect.top += dty; StrRect.bottom += dty;
  9145. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9146. }
  9147. else
  9148. {
  9149. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9150. StrRect = load.m_rcarray.ElementAt(23);
  9151. StrRect.top += dty; StrRect.bottom += dty;
  9152. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9153. StrRect = load.m_rcarray.ElementAt(24);
  9154. StrRect.top += dty; StrRect.bottom += dty;
  9155. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9156. }
  9157. StrRect.top += 15;
  9158. StrRect.bottom += 15;
  9159. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9160. #endif
  9161. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  9162. StrRect = load.m_rcarray.ElementAt(25);
  9163. StrRect.top += dty - dy;
  9164. StrRect.bottom += dty - dy;
  9165. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9166. StrRect = load.m_rcarray.ElementAt(26);
  9167. StrRect.top += dty - dy;
  9168. StrRect.bottom += dty - dy;
  9169. m_Print.DrawRect2(StrRect, 2);
  9170. StrRect = load.m_rcarray.ElementAt(25);
  9171. StrRect.top += dty + 15 - dy;
  9172. StrRect.bottom += dty + 15 - dy;
  9173. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9174. StrRect = load.m_rcarray.ElementAt(26);
  9175. StrRect.top += dty + 15 - dy;
  9176. StrRect.bottom += dty + 15 - dy;
  9177. m_Print.DrawRect2(StrRect, 2);
  9178. StrRect = load.m_rcarray.ElementAt(25);
  9179. StrRect.top += dty + 15 * 2 - dy;
  9180. StrRect.bottom += dty + 15 * 2 - dy;
  9181. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9182. StrRect = load.m_rcarray.ElementAt(26);
  9183. StrRect.top += dty + 15 * 2 - dy;
  9184. StrRect.bottom += dty + 15 * 2 - dy;
  9185. m_Print.DrawRect2(StrRect, 2);
  9186. }
  9187. }
  9188. PrintPreview dlg; dlg.m_mode = 2;
  9189. dlg.m_name = name;
  9190. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  9191. dlg.m_pDC = m_Print.GetPDC();
  9192. if (aa == 0)
  9193. {
  9194. if (dlg.DoModal() != IDOK)
  9195. return;
  9196. printcot = dlg.m_num;
  9197. }
  9198. //结束打印
  9199. m_Print.EndPage();
  9200. m_Print.EndPrint();
  9201. }
  9202. }
  9203. }
  9204. void CMainFrame::PrintFlowChart3_20151116(CString strOrderNumber) // 选片打单 风格2;
  9205. {
  9206. #ifdef LKAY_VERSION
  9207. PrintFlowChart3LKAY(strOrderNumber);
  9208. return;
  9209. #endif
  9210. int i = 0;
  9211. int j = 0;
  9212. int printcot = 1;
  9213. for (int aa = 0; aa < printcot; aa++)
  9214. {
  9215. BOOL bSecondPage = 0;
  9216. int nPrintedPos = 0;
  9217. for (int bb = 0; bb < 3; bb++)
  9218. {
  9219. if (bb && bSecondPage == 0)break;
  9220. CPrintRX m_Print;
  9221. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58))) // 58-[version].[setcheck1] ==1,使用默认打印机;
  9222. {
  9223. m_Print.InitToPrint(NULL, 1);
  9224. }
  9225. else // 否则使用指定的打印机;
  9226. {
  9227. CString name = g_cominfoarray.ElementAt(0).ElementAt(64); // 64-[version].[printer2] 制作单打印机;
  9228. if (name.IsEmpty())
  9229. m_Print.InitToPrint(NULL, 1);
  9230. else
  9231. {
  9232. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9233. if (nret == -1 && aa == 0)
  9234. {
  9235. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9236. }
  9237. }
  9238. }
  9239. m_Print.StartPrint();
  9240. m_Print.StartPage();
  9241. LoadRect load;
  9242. load.SetLiaPath("18.lia");
  9243. load.SetMargins(10, 0);
  9244. if (!load.Load())return;
  9245. CString str;
  9246. int rcpos = -1;
  9247. // ■■■■■■从18.lia获取到第一个区域大小 - 1.显示店名;
  9248. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  9249. if ((bb == 0 && bSecondPage == 0))
  9250. {
  9251. m_Print.SetFontFace(25, 1, "宋体");
  9252. // 10-[version].[info1] 店名;
  9253. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9254. m_Print.SetFontFace(15, 1, "宋体");
  9255. // ■■■■■■从18.lia获取第二个区域大小 - 2.显示"基本资料";
  9256. StrRect = load.m_rcarray.ElementAt(++rcpos);
  9257. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9258. m_Print.SetFontFace(9, 1, "宋体");
  9259. }
  9260. //////////////////////////////////////////////////////////////////////////
  9261. // 获取打印所需要的数据,并布局好;
  9262. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  9263. g_sendhead.code[0] = 54; // dindan;
  9264. g_sendhead.code[1] = 223; // dindanspview2; shangpin+dindansp;
  9265. g_sendhead.code[2] = 52; // client;
  9266. g_sendhead.tabcount = 3;
  9267. g_sendhead.bsql = 0;
  9268. g_pMainWnd->ProcessChatMessageRequest2(filter);
  9269. if (g_bSendOK == 0)return;
  9270. CArray<CStringArray, CStringArray>sparray;
  9271. CArray<CStringArray, CStringArray>clientarray;
  9272. DataToArray(&g_List1array, &sparray, &clientarray);
  9273. CString spno;
  9274. CStringArray sparray2;
  9275. for ( i = 0; i < sparray.GetSize(); i++)
  9276. {
  9277. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9278. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  9279. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  9280. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9281. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  9282. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9283. sparray2.Add(sparray.ElementAt(i).ElementAt(5)); // 商品名称;
  9284. sparray2.Add(sparray.ElementAt(i).ElementAt(3)); // 商品数量;
  9285. sparray2.Add(sparray.ElementAt(i).ElementAt(6)); // 选中的相片串;
  9286. sparray2.Add(sparray.ElementAt(i).ElementAt(10)); // 商品备注;
  9287. }
  9288. for (i = 0; i < sparray.GetSize(); i++)
  9289. {
  9290. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  9291. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  9292. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  9293. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9294. // 136 - [version].[reverse1] // 6 - [dindansp].[no]
  9295. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9296. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+"); // 商品名称;
  9297. sparray2.Add(sparray.ElementAt(i).ElementAt(3)); // 商品数量;
  9298. sparray2.Add(sparray.ElementAt(i).ElementAt(6)); // 选中的相片串;
  9299. sparray2.Add(sparray.ElementAt(i).ElementAt(10)); // 商品备注;
  9300. }
  9301. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  9302. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  9303. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  9304. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  9305. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  9306. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  9307. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  9308. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  9309. CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
  9310. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  9311. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  9312. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  9313. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  9314. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  9315. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  9316. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  9317. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  9318. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  9319. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  9320. CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
  9321. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
  9322. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  9323. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  9324. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  9325. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  9326. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  9327. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  9328. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  9329. CString m_sum3;
  9330. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  9331. ::ConvertToPrice(m_sum3);
  9332. if (m_money3.IsEmpty())m_money3 = "0";
  9333. int dty = 0;
  9334. CString name;
  9335. if (!m_name1.IsEmpty())
  9336. name = m_name1 + ",";
  9337. name += m_name2;
  9338. name.TrimRight(",");
  9339. CString phone;
  9340. if (!m_phone1.IsEmpty())
  9341. phone = m_phone1 + ",";
  9342. phone += m_phone2; phone.TrimRight(",");
  9343. if (IsHasRights2new(31) == 0)
  9344. phone = "***";
  9345. CStringArray strarray;
  9346. CArray<CRect, CRect>rcarray;
  9347. CStringArray strarray2; CArray<CRect, CRect>rc2array;
  9348. int bottom;
  9349. //////////////////////////////////////////////////////////////////////////
  9350. // 开始画打印DC;
  9351. if ((bb == 0 && bSecondPage == 0))
  9352. {
  9353. #ifdef CHILD_VERSION
  9354. if (m_birthday.IsEmpty())
  9355. strarray.Add("姓名/性别");
  9356. else
  9357. strarray.Add("姓名/性别/年龄");
  9358. #else
  9359. strarray.Add("客人姓名"); // 第3.1区域 -3.显示客人姓名;
  9360. #endif
  9361. strarray.Add("电话");
  9362. strarray.Add("单号");
  9363. strarray.Add("套系");
  9364. strarray.Add("选样");
  9365. strarray.Add("余款/加挑");
  9366. strarray.Add("选片/日期");
  9367. #ifdef CHILD_VERSION
  9368. if (m_birthday.IsEmpty())
  9369. strarray.Add(name + "/" + m_sex);
  9370. else
  9371. {
  9372. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  9373. m_birthday.Format("%d", year + 1);
  9374. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  9375. }
  9376. #else
  9377. strarray.Add(name); // 第4.1区域 -3.显示客人姓名;
  9378. #endif
  9379. strarray.Add(phone);
  9380. strarray.Add(strOrderNumber);
  9381. strarray.Add(m_taoxiname);
  9382. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9383. strarray.Add(str);
  9384. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  9385. strarray.Add(str);
  9386. strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
  9387. for (i = 3; i <= 16; i++)
  9388. {
  9389. // ■■■■■■从18.lia中获取第3~16的区域大小;
  9390. StrRect = load.m_rcarray.ElementAt(i - 1);
  9391. if (i < 10)
  9392. {
  9393. m_Print.DrawRect2(StrRect, 1);
  9394. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9395. }
  9396. }
  9397. // ■■■■■■从18.lia中获取第30的区域大小;
  9398. StrRect = load.m_rcarray.ElementAt(29);
  9399. m_Print.DrawRect2(StrRect, 1);
  9400. BOOL bPrintDate = 1;
  9401. #ifdef DDF_VERSION
  9402. // bPrintDate=0;
  9403. #else
  9404. if (m_time5 == "" && m_time6 == "")
  9405. bPrintDate = 0;
  9406. #endif
  9407. if (bPrintDate)
  9408. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9409. else
  9410. {
  9411. #ifdef CHILD_VERSION
  9412. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9413. #else
  9414. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9415. #endif
  9416. }
  9417. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138))) // [version].[reverse3]
  9418. {
  9419. Image *pImg = NULL;
  9420. g_nSendCode = 31;
  9421. int g_nYearposTemp = g_nYearpos;
  9422. g_nYearpos = -1;
  9423. g_pMainWnd->ProcessChatMessageRequest2(1);
  9424. g_nYearpos = g_nYearposTemp;
  9425. g_nSendCode = 0;
  9426. if (g_bSendOK == 0)return;
  9427. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  9428. // Jeff二维码的区域不是从18.lia里获取的,是固定在右上角指定区域;
  9429. if (pImg)
  9430. {
  9431. StrRect.left = 485;
  9432. StrRect.top = 12;
  9433. StrRect.right = StrRect.left + 60;
  9434. StrRect.bottom = StrRect.top + 60;
  9435. m_Print.DrawImage(pImg, StrRect);
  9436. delete pImg; pImg = NULL;
  9437. }
  9438. }
  9439. // CArray<CRect,CRect>rcarray;
  9440. // CStringArray strarray2;
  9441. // ■■■■■■从18.lia中获取第10的区域大小;
  9442. for (i = 10; i <= 16; i++)
  9443. {
  9444. StrRect = load.m_rcarray.ElementAt(i - 1);
  9445. StrRect.left += 2;
  9446. StrRect.right -= 2;
  9447. StrRect.top += 2;
  9448. rcarray.Add(StrRect);
  9449. strarray2.Add(strarray.ElementAt(7 + i - 10));
  9450. }
  9451. if (1)
  9452. {
  9453. // ■■■■■■从18.lia中获取第31的区域大小;
  9454. StrRect = load.m_rcarray.ElementAt(30);
  9455. StrRect.left += 2;
  9456. StrRect.right -= 2;
  9457. StrRect.top += 2;
  9458. rcarray.Add(StrRect);
  9459. if (bPrintDate)
  9460. strarray2.Add(m_time6 + "/" + m_time5);
  9461. else
  9462. {
  9463. strarray2.Add(m_waiter1 + "/" + m_waiter2);
  9464. }
  9465. }
  9466. int bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_HCENTER);
  9467. for (i = 10; i <= 16; i++)
  9468. {
  9469. StrRect = load.m_rcarray.ElementAt(i - 1);
  9470. if (i == 10)
  9471. {
  9472. dty += bottom - StrRect.bottom;
  9473. }
  9474. StrRect.bottom = bottom;
  9475. m_Print.DrawRect2(StrRect, 1);
  9476. }
  9477. if (1)
  9478. {
  9479. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  9480. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  9481. }
  9482. m_Print.SetFontFace(15, 1, "宋体");
  9483. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  9484. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9485. }
  9486. int curypos = 0;
  9487. int oldpos = 0;
  9488. if (bb == 1)
  9489. {
  9490. dty = -100;
  9491. oldpos = nPrintedPos;
  9492. if (oldpos == 0)oldpos = 10000;
  9493. }
  9494. m_Print.SetFontFace(9, 1, "宋体");
  9495. strarray.RemoveAll();
  9496. if ((oldpos != 10000 && oldpos < sparray2.GetSize()) || bb == 0)
  9497. {
  9498. strarray.Add("产品名称");
  9499. strarray.Add("数量");
  9500. strarray.Add("照片编号");
  9501. strarray.Add(_T("备注"));
  9502. CRect mycr[4] = {
  9503. CRect(39,172,130,189), // 产品名称;
  9504. CRect(130,172,157,189), // 产品数量;
  9505. CRect(157,172,407,189), // 相片;
  9506. CRect(407,172,546,189) // 备注;
  9507. };
  9508. for (i = 0; i <= 3; i++)
  9509. {
  9510. StrRect = mycr[i];
  9511. StrRect.top += dty;
  9512. StrRect.bottom += dty;
  9513. m_Print.DrawRect2(StrRect, 1);
  9514. StrRect.left += 2;
  9515. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9516. StrRect.left -= 2;
  9517. StrRect.top = StrRect.bottom;
  9518. StrRect.bottom += 18;
  9519. rc2array.Add(StrRect);
  9520. }
  9521. }
  9522. for (i = oldpos; i < sparray2.GetSize(); i += 4)
  9523. {
  9524. rcarray.RemoveAll();
  9525. strarray2.RemoveAll();
  9526. for ( j = 0; j < 4; j++)
  9527. {
  9528. StrRect = rc2array.ElementAt(j);
  9529. StrRect.left += 2;
  9530. StrRect.right -= 2;
  9531. StrRect.top += 2;
  9532. rcarray.Add(StrRect);
  9533. #if JEFF_TEST_ON
  9534. if (2 == j)
  9535. {
  9536. CString strImg = sparray2.ElementAt(i + 2);
  9537. //int nImgCount = strImg.Replace(",", ",");
  9538. int nImgCount = strImg.Replace(SEPS_VEB, SEPS_VEB);
  9539. if (nImgCount != 0)
  9540. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
  9541. else if (!strImg.IsEmpty())
  9542. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  9543. strarray2.Add(strImg);
  9544. }
  9545. else
  9546. strarray2.Add(sparray2.ElementAt(i + j));
  9547. #else
  9548. strarray2.Add(sparray2.ElementAt(i + j));
  9549. #endif
  9550. }
  9551. bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  9552. rcarray.RemoveAll();
  9553. for (j = 0; j < 4; j++)
  9554. {
  9555. StrRect = rc2array.ElementAt(j);
  9556. if (j == 0)
  9557. {
  9558. dty += bottom - StrRect.bottom;
  9559. }
  9560. StrRect.bottom = bottom;
  9561. m_Print.DrawRect2(StrRect, 1);
  9562. curypos = StrRect.bottom;
  9563. StrRect.top = StrRect.bottom;
  9564. StrRect.bottom += 18;
  9565. rcarray.Add(StrRect);
  9566. }
  9567. rc2array.RemoveAll();
  9568. rc2array.Copy(rcarray);
  9569. if (bottom > 750)
  9570. {
  9571. bSecondPage = 1;
  9572. nPrintedPos = i + 3;
  9573. break;
  9574. }
  9575. }
  9576. if ((bb == 0 && bSecondPage == 0) || (bb == 1 && bSecondPage == 1))
  9577. {
  9578. m_Print.SetFontFace(15, 1, "宋体");
  9579. StrRect = load.m_rcarray.ElementAt(20);
  9580. dty = curypos - StrRect.bottom + 35;
  9581. StrRect.top += dty;
  9582. StrRect.bottom += dty;
  9583. if (StrRect.bottom > 700 && bb == 0)
  9584. {
  9585. bSecondPage = 1;
  9586. }
  9587. else
  9588. {
  9589. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9590. m_Print.SetFontFace(9, 1, "宋体");
  9591. rcarray.RemoveAll();
  9592. strarray2.RemoveAll();
  9593. StrRect = load.m_rcarray.ElementAt(21);
  9594. StrRect.top += dty;
  9595. StrRect.bottom += dty;
  9596. StrRect.left += 2;
  9597. StrRect.right -= 2;
  9598. StrRect.top += 2;
  9599. rcarray.Add(StrRect);
  9600. #if JEFF_TEST_ON
  9601. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  9602. strarray2.RemoveAll();
  9603. CString strFind = "要求:";
  9604. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  9605. do
  9606. {
  9607. int nIndex = strbz3.Find(strFind, 1);
  9608. if (nIndex != -1)
  9609. {
  9610. CString strbz = strbz3.Left(nIndex);
  9611. strbz3 = strbz3.Mid(nIndex);
  9612. strarray2.Add(strbz);
  9613. }
  9614. else
  9615. {
  9616. strarray2.Add(strbz3);
  9617. strbz3 = "";
  9618. }
  9619. } while (strbz3.Find(strFind) != -1);
  9620. strarray2.Add(g_List1array.ElementAt(0).ElementAt(29));
  9621. strarray2.Add(g_List1array.ElementAt(0).ElementAt(23));
  9622. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  9623. #else
  9624. strarray2.Add(m_bz);
  9625. bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  9626. #endif
  9627. StrRect = load.m_rcarray.ElementAt(21);
  9628. StrRect.top += dty;
  9629. StrRect.bottom += dty;
  9630. dty += bottom - StrRect.bottom;
  9631. StrRect.bottom = bottom;
  9632. m_Print.DrawRect2(StrRect, 1);
  9633. curypos = StrRect.bottom;
  9634. m_Print.SetFontFace(10, 1, "宋体");
  9635. StrRect = load.m_rcarray.ElementAt(22);
  9636. dty = curypos - StrRect.bottom + 25;
  9637. StrRect.top += dty;
  9638. StrRect.bottom += dty;
  9639. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  9640. if (m_edit9.IsEmpty())
  9641. {
  9642. m_edit9 = "\
  9643. 经确认后的照片均排入制作流程,\r\n\
  9644. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9645. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9646. }
  9647. CString info1, info2, info3;
  9648. int newlinepos = m_edit9.Find("\r\n");
  9649. if (newlinepos != -1)
  9650. {
  9651. info1 = m_edit9.Left(newlinepos);
  9652. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9653. }
  9654. newlinepos = m_edit9.Find("\r\n");
  9655. if (newlinepos != -1)
  9656. {
  9657. info2 = m_edit9.Left(newlinepos);
  9658. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  9659. info3 = m_edit9;
  9660. }
  9661. #ifdef QCH_VERSION
  9662. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9663. StrRect = load.m_rcarray.ElementAt(23);
  9664. StrRect.top += dty; StrRect.bottom += dty;
  9665. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9666. StrRect=load.m_rcarray .ElementAt (24);
  9667. StrRect.top +=dty;StrRect.bottom +=dty;
  9668. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9669. StrRect.top +=15;
  9670. StrRect.bottom +=15;
  9671. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9672. #else
  9673. if (1)
  9674. {
  9675. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9676. StrRect = load.m_rcarray.ElementAt(23);
  9677. StrRect.top += dty; StrRect.bottom += dty;
  9678. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9679. StrRect = load.m_rcarray.ElementAt(24);
  9680. StrRect.top += dty; StrRect.bottom += dty;
  9681. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9682. }
  9683. else
  9684. {
  9685. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9686. StrRect = load.m_rcarray.ElementAt(23);
  9687. StrRect.top += dty; StrRect.bottom += dty;
  9688. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9689. StrRect = load.m_rcarray.ElementAt(24);
  9690. StrRect.top += dty; StrRect.bottom += dty;
  9691. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9692. }
  9693. StrRect.top += 15;
  9694. StrRect.bottom += 15;
  9695. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9696. #endif
  9697. int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
  9698. StrRect = load.m_rcarray.ElementAt(25);
  9699. StrRect.top += dty - dy;
  9700. StrRect.bottom += dty - dy;
  9701. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9702. StrRect = load.m_rcarray.ElementAt(26);
  9703. StrRect.top += dty - dy;
  9704. StrRect.bottom += dty - dy;
  9705. m_Print.DrawRect2(StrRect, 2);
  9706. StrRect = load.m_rcarray.ElementAt(25);
  9707. StrRect.top += dty + 15 - dy;
  9708. StrRect.bottom += dty + 15 - dy;
  9709. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9710. StrRect = load.m_rcarray.ElementAt(26);
  9711. StrRect.top += dty + 15 - dy;
  9712. StrRect.bottom += dty + 15 - dy;
  9713. m_Print.DrawRect2(StrRect, 2);
  9714. StrRect = load.m_rcarray.ElementAt(25);
  9715. StrRect.top += dty + 15 * 2 - dy;
  9716. StrRect.bottom += dty + 15 * 2 - dy;
  9717. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9718. StrRect = load.m_rcarray.ElementAt(26);
  9719. StrRect.top += dty + 15 * 2 - dy;
  9720. StrRect.bottom += dty + 15 * 2 - dy;
  9721. m_Print.DrawRect2(StrRect, 2);
  9722. }
  9723. }
  9724. PrintPreview dlg; dlg.m_mode = 2;
  9725. dlg.m_name = name;
  9726. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  9727. dlg.m_pDC = m_Print.GetPDC();
  9728. if (aa == 0)
  9729. {
  9730. if (dlg.DoModal() != IDOK)
  9731. return;
  9732. printcot = dlg.m_num;
  9733. }
  9734. //结束打印
  9735. m_Print.EndPage();
  9736. m_Print.EndPrint();
  9737. }
  9738. }
  9739. }
  9740. //void CMainFrame::PrintFlowChart4(CString m_id) // 选设计打单函数;
  9741. void CMainFrame::PrintFlowChart4(CString strOrderNumber) // 选设计打单函数,使用18.lia文件;
  9742. {
  9743. int i = 0;
  9744. int j = 0;
  9745. int printcot = 1;
  9746. for (int aa = 0; aa < printcot; aa++)
  9747. {
  9748. CPrintRX m_Print;
  9749. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9750. {
  9751. m_Print.InitToPrint(NULL, 1);
  9752. }
  9753. else
  9754. {
  9755. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  9756. if (name.IsEmpty())
  9757. m_Print.InitToPrint(NULL, 1);
  9758. else
  9759. {
  9760. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9761. if (nret == -1 && aa == 0)
  9762. {
  9763. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9764. }
  9765. }
  9766. }
  9767. m_Print.StartPrint();
  9768. m_Print.StartPage();
  9769. LoadRect load;
  9770. load.SetLiaPath("18.lia");
  9771. load.SetMargins(10, 0);
  9772. if (!load.Load())return;
  9773. CString str;
  9774. int rcpos = -1;
  9775. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  9776. m_Print.SetFontFace(25, 1, "宋体");
  9777. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9778. m_Print.SetFontFace(15, 1, "宋体");
  9779. StrRect = load.m_rcarray.ElementAt(++rcpos);
  9780. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9781. m_Print.SetFontFace(9, 1, "宋体");
  9782. //////////////////////////////////////////////////////////////
  9783. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
  9784. g_sendhead.code[0] = 54;
  9785. g_sendhead.code[1] = 223;
  9786. g_sendhead.code[2] = 52;
  9787. g_sendhead.tabcount = 3;
  9788. g_sendhead.bsql = 0;
  9789. g_pMainWnd->ProcessChatMessageRequest2(filter);
  9790. if (g_bSendOK == 0)return;
  9791. CArray<CStringArray, CStringArray>sparray;
  9792. CArray<CStringArray, CStringArray>clientarray;
  9793. DataToArray(&g_List1array, &sparray, &clientarray);
  9794. CString spno;
  9795. CStringArray sparray2;
  9796. for ( i = 0; i < sparray.GetSize(); i++)
  9797. {
  9798. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  9799. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(8).IsEmpty())continue;
  9800. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9801. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9802. sparray2.Add(sparray.ElementAt(i).ElementAt(5));
  9803. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  9804. sparray2.Add(sparray.ElementAt(i).ElementAt(8));
  9805. }
  9806. for (i = 0; i < sparray.GetSize(); i++)
  9807. {
  9808. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  9809. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  9810. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  9811. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  9812. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  9813. sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
  9814. sparray2.Add(sparray.ElementAt(i).ElementAt(3));
  9815. sparray2.Add(sparray.ElementAt(i).ElementAt(8));
  9816. }
  9817. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  9818. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  9819. CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
  9820. CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
  9821. CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
  9822. CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
  9823. CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
  9824. CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
  9825. CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
  9826. CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
  9827. CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
  9828. CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
  9829. CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
  9830. CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
  9831. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
  9832. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
  9833. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
  9834. CString m_bz = g_List1array.ElementAt(0).ElementAt(17);
  9835. m_bz += ";" + g_List1array.ElementAt(0).ElementAt(25);
  9836. CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
  9837. CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
  9838. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
  9839. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
  9840. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
  9841. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
  9842. CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
  9843. CString m_waiter8 = g_List1array.ElementAt(0).ElementAt(27);
  9844. CString m_replace = g_List1array.ElementAt(0).ElementAt(28);
  9845. if (!m_replace.IsEmpty())
  9846. {
  9847. m_replace = "设计替换照片:" + m_replace;
  9848. m_replace.Replace("$", ";");
  9849. m_replace.TrimLeft(";");
  9850. m_bz += ";";
  9851. m_bz += m_replace;
  9852. }
  9853. CString m_sum3;
  9854. m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
  9855. ::ConvertToPrice(m_sum3);
  9856. if (m_money3.IsEmpty())m_money3 = "0";
  9857. int dty = 0;
  9858. CString name;
  9859. if (!m_name1.IsEmpty())
  9860. name = m_name1 + ",";
  9861. name += m_name2;
  9862. name.TrimRight(",");
  9863. CString phone;
  9864. if (!m_phone1.IsEmpty())
  9865. phone = m_phone1 + ",";
  9866. phone += m_phone2; phone.TrimRight(",");
  9867. if (IsHasRights2new(31) == 0)
  9868. phone = "***";
  9869. CStringArray strarray;
  9870. #ifdef CHILD_VERSION
  9871. if (m_birthday.IsEmpty())
  9872. strarray.Add("姓名/性别");
  9873. else
  9874. strarray.Add("姓名/性别/年龄");
  9875. #else
  9876. strarray.Add("客人姓名");
  9877. #endif
  9878. strarray.Add("电话");
  9879. strarray.Add("单号");
  9880. strarray.Add("套系");
  9881. strarray.Add("");
  9882. strarray.Add("余款/加挑");
  9883. strarray.Add("看设计/日期");
  9884. #ifdef CHILD_VERSION
  9885. if (m_birthday.IsEmpty())
  9886. strarray.Add(name + "/" + m_sex);
  9887. else
  9888. {
  9889. int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
  9890. m_birthday.Format("%d", year + 1);
  9891. strarray.Add(name + "/" + m_sex + "/" + m_birthday);
  9892. }
  9893. #else
  9894. strarray.Add(name);
  9895. #endif
  9896. strarray.Add(phone);
  9897. strarray.Add(strOrderNumber);
  9898. strarray.Add(m_taoxiname);
  9899. str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9900. strarray.Add("");
  9901. str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
  9902. strarray.Add(str);
  9903. strarray.Add(m_waiter8 + "/" + m_time6);
  9904. //////////////////////////////////////////////
  9905. if (1)
  9906. {
  9907. StrRect = load.m_rcarray.ElementAt(6);
  9908. int addwid = StrRect.Width() / 6;
  9909. for (i = 3; i <= 6; i++)
  9910. {
  9911. StrRect = load.m_rcarray.ElementAt(i - 1);
  9912. StrRect.left += (i - 3)*addwid;
  9913. StrRect.right += (i - 2)*addwid;
  9914. load.m_rcarray.SetAt(i - 1, StrRect);
  9915. }
  9916. StrRect.left = StrRect.right = -1;
  9917. load.m_rcarray.SetAt(6, StrRect);
  9918. for (i = 10; i <= 13; i++)
  9919. {
  9920. StrRect = load.m_rcarray.ElementAt(i - 1);
  9921. StrRect.left += (i - 10)*addwid;
  9922. StrRect.right += (i - 9)*addwid;
  9923. load.m_rcarray.SetAt(i - 1, StrRect);
  9924. }
  9925. StrRect.left = StrRect.right = -1;
  9926. load.m_rcarray.SetAt(13, StrRect);
  9927. StrRect = load.m_rcarray.ElementAt(7);
  9928. int rcwid = StrRect.Width();
  9929. StrRect.left = load.m_rcarray.ElementAt(5).right;
  9930. StrRect.right = StrRect.left + rcwid + addwid;
  9931. load.m_rcarray.SetAt(7, StrRect);
  9932. StrRect = load.m_rcarray.ElementAt(8);
  9933. StrRect.left = load.m_rcarray.ElementAt(7).right;
  9934. StrRect.right = load.m_rcarray.ElementAt(29).left;
  9935. load.m_rcarray.SetAt(8, StrRect);
  9936. StrRect = load.m_rcarray.ElementAt(14);
  9937. rcwid = StrRect.Width();
  9938. StrRect.left = load.m_rcarray.ElementAt(12).right;
  9939. StrRect.right = StrRect.left + rcwid + addwid;
  9940. load.m_rcarray.SetAt(14, StrRect);
  9941. StrRect = load.m_rcarray.ElementAt(15);
  9942. StrRect.left = load.m_rcarray.ElementAt(14).right;
  9943. StrRect.right = load.m_rcarray.ElementAt(29).left;
  9944. load.m_rcarray.SetAt(15, StrRect);
  9945. }
  9946. ////////////////////////////////////////////////
  9947. for (i = 3; i <= 16; i++)
  9948. {
  9949. StrRect = load.m_rcarray.ElementAt(i - 1);
  9950. if (i < 10)
  9951. {
  9952. m_Print.DrawRect2(StrRect, 1);
  9953. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9954. }
  9955. }
  9956. StrRect = load.m_rcarray.ElementAt(29);
  9957. m_Print.DrawRect2(StrRect, 1);
  9958. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9959. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  9960. {
  9961. Image *pImg = NULL;
  9962. g_nSendCode = 31;
  9963. int g_nYearposTemp = g_nYearpos;
  9964. g_nYearpos = -1;
  9965. g_pMainWnd->ProcessChatMessageRequest2(1);
  9966. g_nYearpos = g_nYearposTemp;
  9967. g_nSendCode = 0;
  9968. if (g_bSendOK == 0)return;
  9969. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  9970. if (pImg)
  9971. {
  9972. StrRect.left = 485;
  9973. StrRect.top = 12;
  9974. StrRect.right = StrRect.left + 60;
  9975. StrRect.bottom = StrRect.top + 60;
  9976. m_Print.DrawImage(pImg, StrRect);
  9977. delete pImg; pImg = NULL;
  9978. }
  9979. }
  9980. CArray<CRect, CRect>rcarray;
  9981. CStringArray strarray2;
  9982. for (i = 10; i <= 16; i++)
  9983. {
  9984. StrRect = load.m_rcarray.ElementAt(i - 1);
  9985. StrRect.left += 2;
  9986. StrRect.right -= 2;
  9987. StrRect.top += 2;
  9988. rcarray.Add(StrRect);
  9989. strarray2.Add(strarray.ElementAt(7 + i - 10));
  9990. }
  9991. INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_HCENTER);
  9992. for (i = 10; i <= 16; i++)
  9993. {
  9994. StrRect = load.m_rcarray.ElementAt(i - 1);
  9995. if (i == 10)
  9996. {
  9997. dty += bottom - StrRect.bottom;
  9998. }
  9999. StrRect.bottom = bottom;
  10000. m_Print.DrawRect2(StrRect, 1);
  10001. }
  10002. StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
  10003. m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
  10004. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  10005. m_Print.SetFontFace(15, 1, "宋体");
  10006. StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
  10007. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10008. m_Print.SetFontFace(9, 1, "宋体");
  10009. strarray.RemoveAll();
  10010. strarray.Add("产品名称");
  10011. strarray.Add("数量");
  10012. strarray.Add("照片编号");
  10013. CArray<CRect, CRect>rc2array;
  10014. for (i = 18; i <= 20; i++)
  10015. {
  10016. StrRect = load.m_rcarray.ElementAt(i - 1); StrRect.top += dty; StrRect.bottom += dty;
  10017. m_Print.DrawRect2(StrRect, 1);
  10018. StrRect.left += 2;
  10019. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10020. StrRect.left -= 2;
  10021. StrRect.top = StrRect.bottom;
  10022. StrRect.bottom += 18;
  10023. rc2array.Add(StrRect);
  10024. }
  10025. int curypos = 0;
  10026. for (i = 0; i < sparray2.GetSize(); i += 3)
  10027. {
  10028. rcarray.RemoveAll();
  10029. strarray2.RemoveAll();
  10030. for ( j = 0; j < 3; j++)
  10031. {
  10032. StrRect = rc2array.ElementAt(j);
  10033. StrRect.left += 2;
  10034. StrRect.right -= 2;
  10035. StrRect.top += 2;
  10036. rcarray.Add(StrRect);
  10037. #if JEFF_TEST_ON
  10038. if (2 == j)
  10039. {
  10040. CString strImg = sparray2.ElementAt(i + 2);
  10041. //int nImgCount = strImg.Replace(",", ",");
  10042. int nImgCount = strImg.Replace(SEPS_VEB, SEPS_VEB);
  10043. if (nImgCount != 0)
  10044. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
  10045. else if (!strImg.IsEmpty())
  10046. strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
  10047. strarray2.Add(strImg);
  10048. }
  10049. else
  10050. strarray2.Add(sparray2.ElementAt(i + j));
  10051. #else
  10052. strarray2.Add(sparray2.ElementAt(i + j));
  10053. #endif
  10054. }
  10055. INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  10056. rcarray.RemoveAll();
  10057. for (j = 0; j < 3; j++)
  10058. {
  10059. StrRect = rc2array.ElementAt(j);
  10060. if (j == 0)
  10061. {
  10062. dty += bottom - StrRect.bottom;
  10063. }
  10064. StrRect.bottom = bottom;
  10065. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  10066. StrRect.top = StrRect.bottom;
  10067. StrRect.bottom += 18;
  10068. rcarray.Add(StrRect);
  10069. }
  10070. rc2array.RemoveAll();
  10071. rc2array.Copy(rcarray);
  10072. }
  10073. m_Print.SetFontFace(15, 1, "宋体");
  10074. StrRect = load.m_rcarray.ElementAt(20);
  10075. dty = curypos - StrRect.bottom + 35;
  10076. StrRect.top += dty; StrRect.bottom += dty;
  10077. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10078. m_Print.SetFontFace(9, 1, "宋体");
  10079. rcarray.RemoveAll();
  10080. strarray2.RemoveAll();
  10081. StrRect = load.m_rcarray.ElementAt(21);
  10082. StrRect.top += dty;
  10083. StrRect.bottom += dty;
  10084. StrRect.left += 2;
  10085. StrRect.right -= 2;
  10086. StrRect.top += 2;
  10087. rcarray.Add(StrRect);
  10088. #if JEFF_TEST_ON
  10089. // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
  10090. strarray2.RemoveAll();
  10091. CString strFind = "要求:";
  10092. CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
  10093. do
  10094. {
  10095. int nIndex = strbz3.Find(strFind, 1);
  10096. if (nIndex != -1)
  10097. {
  10098. CString strbz = strbz3.Left(nIndex);
  10099. strbz3 = strbz3.Mid(nIndex);
  10100. strarray2.Add(strbz);
  10101. }
  10102. else
  10103. {
  10104. strarray2.Add(strbz3);
  10105. strbz3 = "";
  10106. }
  10107. } while (strbz3.Find(strFind) != -1);
  10108. strarray2.Add(g_List1array.ElementAt(0).ElementAt(25));
  10109. if (!m_replace.IsEmpty())
  10110. {
  10111. m_replace = "设计替换照片:" + m_replace;
  10112. m_replace.Replace("$", ";");
  10113. m_replace.TrimLeft(";");
  10114. }
  10115. strarray2.Add(m_replace);
  10116. bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
  10117. #else
  10118. strarray2.Add(m_bz);
  10119. bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
  10120. #endif
  10121. StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
  10122. dty += bottom - StrRect.bottom;
  10123. StrRect.bottom = bottom;
  10124. m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
  10125. m_Print.SetFontFace(10, 1, "宋体");
  10126. StrRect = load.m_rcarray.ElementAt(22);
  10127. dty = curypos - StrRect.bottom + 25;
  10128. StrRect.top += dty; StrRect.bottom += dty;
  10129. CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
  10130. if (m_edit9.IsEmpty())
  10131. {
  10132. m_edit9 = "\
  10133. 经确认后的照片均排入制作流程,\r\n\
  10134. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  10135. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  10136. }
  10137. CString info1, info2, info3;
  10138. int newlinepos = m_edit9.Find("\r\n");
  10139. if (newlinepos != -1)
  10140. {
  10141. info1 = m_edit9.Left(newlinepos);
  10142. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  10143. }
  10144. newlinepos = m_edit9.Find("\r\n");
  10145. if (newlinepos != -1)
  10146. {
  10147. info2 = m_edit9.Left(newlinepos);
  10148. m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
  10149. info3 = m_edit9;
  10150. }
  10151. if (1)
  10152. {
  10153. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10154. StrRect = load.m_rcarray.ElementAt(23);
  10155. StrRect.top += dty; StrRect.bottom += dty;
  10156. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10157. StrRect = load.m_rcarray.ElementAt(24);
  10158. StrRect.top += dty; StrRect.bottom += dty;
  10159. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10160. }
  10161. else
  10162. {
  10163. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10164. StrRect = load.m_rcarray.ElementAt(23);
  10165. StrRect.top += dty; StrRect.bottom += dty;
  10166. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10167. StrRect = load.m_rcarray.ElementAt(24);
  10168. StrRect.top += dty; StrRect.bottom += dty;
  10169. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10170. }
  10171. StrRect = load.m_rcarray.ElementAt(25);
  10172. StrRect.top += dty; StrRect.bottom += dty;
  10173. m_Print.DrawText((LPTSTR)(LPCTSTR)"贵宾签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10174. StrRect = load.m_rcarray.ElementAt(26);
  10175. StrRect.top += dty; StrRect.bottom += dty;
  10176. m_Print.DrawRect2(StrRect, 2);
  10177. m_Print.SetFontFace(9, 1, "宋体");
  10178. StrRect = load.m_rcarray.ElementAt(27);
  10179. StrRect.top += dty; StrRect.bottom += dty;
  10180. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10181. StrRect = load.m_rcarray.ElementAt(28);
  10182. StrRect.top += dty; StrRect.bottom += dty;
  10183. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  10184. PrintPreview dlg;//dlg.m_mode=2;
  10185. dlg.m_name = name;
  10186. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  10187. dlg.m_pDC = m_Print.GetPDC();
  10188. if (aa == 0)
  10189. {
  10190. if (dlg.DoModal() != IDOK)
  10191. return;
  10192. printcot = dlg.m_num;
  10193. }
  10194. //结束打印
  10195. m_Print.EndPage();
  10196. m_Print.EndPrint();
  10197. }
  10198. }
  10199. /*
  10200. void CMainFrame::PrintFlowChart(CString m_id)
  10201. {
  10202. CPrintRX m_Print;
  10203. m_Print.InitToPrint(NULL, 1);
  10204. m_Print.StartPrint();
  10205. m_Print.StartPage();
  10206. // CRect StrRect(0,0,560,818);
  10207. LoadRect load;
  10208. load.SetLiaPath ("4.lia");
  10209. load.SetMargins(-14,-14);
  10210. if(!load.Load ())return;
  10211. LoadRect load2;
  10212. load2.SetMargins(-14,472+27-14);
  10213. load2.SetLiaPath ("5.lia");
  10214. if(!load2.Load ())return;
  10215. //////////////////////////////////////////////////////////////
  10216. CString filter="id='"+m_id+"';id='"+m_id+"'";
  10217. g_sendhead.code[0]=54;
  10218. g_sendhead.code[1]=50;
  10219. g_sendhead.tabcount=2;
  10220. g_sendhead.bsql=0;
  10221. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  10222. CArray<CStringArray, CStringArray>sparray;
  10223. DataToArray(&g_List1array,&sparray);
  10224. CString spno;
  10225. for(int i=0; i<sparray.GetSize (); i++)
  10226. {
  10227. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册")continue;
  10228. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  10229. spno+=sparray.ElementAt (i).ElementAt (5);
  10230. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  10231. spno+=";";
  10232. else
  10233. {
  10234. spno+=":";
  10235. spno+=sparray.ElementAt (i).ElementAt (6);
  10236. spno+=";";
  10237. }
  10238. }
  10239. spno+=" 加挑:";
  10240. for( i=0; i<sparray.GetSize (); i++)
  10241. {
  10242. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  10243. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  10244. spno+=sparray.ElementAt (i).ElementAt (5);
  10245. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  10246. spno+=";";
  10247. else
  10248. {
  10249. spno+=":";
  10250. spno+=sparray.ElementAt (i).ElementAt (6);
  10251. spno+=";";
  10252. }
  10253. }
  10254. if(spno.Right (6)==" 加挑:")
  10255. {
  10256. spno=spno.Left (spno.GetLength ()-6);
  10257. }
  10258. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  10259. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  10260. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  10261. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  10262. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  10263. if(m_urgent.IsEmpty ())m_urgent="否";
  10264. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  10265. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  10266. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  10267. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  10268. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  10269. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  10270. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  10271. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  10272. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  10273. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  10274. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  10275. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17);
  10276. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  10277. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  10278. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  10279. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  10280. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  10281. CString m_sum3;
  10282. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  10283. ::ConvertToPrice (m_sum3);
  10284. if(m_money3.IsEmpty ())m_money3="0";
  10285. // m_money3=m_money3+"/"+m_sum3;
  10286. CString name;
  10287. if(!m_name1.IsEmpty ())
  10288. name=m_name1+",";
  10289. name+=m_name2;
  10290. name.TrimRight (",");
  10291. CString phone;
  10292. if(!m_phone1.IsEmpty ())
  10293. phone=m_phone1+",";
  10294. phone+=m_phone2;phone.TrimRight (",");
  10295. CStringArray strarray;
  10296. strarray.Add (m_urgent);
  10297. strarray.Add (m_ren);
  10298. strarray.Add (m_waiter3);
  10299. strarray.Add (name);
  10300. strarray.Add (m_time2);
  10301. strarray.Add (m_time4);
  10302. strarray.Add (m_time5);
  10303. strarray.Add (m_money3);
  10304. strarray.Add (m_takezs);
  10305. strarray.Add (m_taoxizs);
  10306. strarray.Add (m_choosezs);
  10307. strarray.Add (m_id);
  10308. strarray.Add (phone);
  10309. ////////////////////////////////////////////////////////////////
  10310. int rcpos=-1;
  10311. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  10312. Image *pImg=NULL;
  10313. #ifdef MNLS_VERSION
  10314. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  10315. #else
  10316. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  10317. #endif
  10318. m_Print.DrawImage(pImg, StrRect);
  10319. delete pImg;
  10320. m_Print.SetFontFace(15, 1, "宋体");
  10321. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10322. #ifdef MNLS_VERSION
  10323. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10324. #endif
  10325. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10326. #ifdef MNLS_VERSION
  10327. m_Print.DrawRect(StrRect);
  10328. #endif
  10329. m_Print.SetFontFace(7, 1, "黑体");
  10330. m_Print.SetColor(0xffffff);
  10331. #ifdef MNLS_VERSION
  10332. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10333. #endif
  10334. m_Print.SetColor(0);
  10335. m_Print.SetFontFace(25, 1, "黑体");
  10336. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10337. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10338. CString title[13]={"是否加急:","接单门市:","选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","取件日期:","加挑/余款:","拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  10339. m_Print.SetFontFace(12, 1, "宋体");
  10340. for( i=0; i<13; i++)
  10341. {
  10342. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10343. if(i<3)
  10344. m_Print.DrawRect2(StrRect, 0);
  10345. else
  10346. m_Print.DrawRect2(StrRect, 1);
  10347. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10348. }
  10349. for( i=18; i<=37; i++)
  10350. {
  10351. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10352. if(i>=19&&i<=21)
  10353. m_Print.DrawRect2(StrRect, 2);
  10354. else if(i==26)
  10355. {
  10356. CRect rc=StrRect;
  10357. CRect rc2=rc;
  10358. rc.right -=rc2.Width ()/2;
  10359. m_Print.DrawRect2(rc, 1);
  10360. rc2.left +=rc.Width ();
  10361. m_Print.DrawRect2(rc2, 1);
  10362. }
  10363. else
  10364. m_Print.DrawRect2(StrRect, 1);
  10365. if(i==18)
  10366. {
  10367. StrRect.left +=5;
  10368. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10369. }
  10370. }
  10371. //////////////////////////////////////
  10372. rcpos=-1;
  10373. for( i=0; i<8; i++)
  10374. {
  10375. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10376. m_Print.DrawRect2(StrRect, 1);
  10377. }
  10378. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客签名:"};
  10379. for( i=0; i<4; i++)
  10380. {
  10381. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10382. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10383. }
  10384. for( i=0; i<4; i++)
  10385. {
  10386. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  10387. m_Print.DrawRect2(StrRect, 2);
  10388. }
  10389. ///////////////////////////////////////////
  10390. for( i=19; i<=31; i++)
  10391. {
  10392. StrRect=load.m_rcarray .ElementAt (i-1);
  10393. StrRect.left +=4;
  10394. if(i==31)
  10395. {
  10396. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  10397. {
  10398. StrRect.top +=2;
  10399. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  10400. StrRect.top +=8;
  10401. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10402. }
  10403. else
  10404. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10405. }
  10406. else if((i-19)==7)
  10407. {
  10408. CRect rc=StrRect;
  10409. CRect rc2=rc;
  10410. rc.right -=rc2.Width ()/2;
  10411. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10412. rc2.left +=rc.Width ()+3;
  10413. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10414. }
  10415. else
  10416. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10417. }
  10418. strarray.RemoveAll ();
  10419. strarray.Add (m_waiter2);
  10420. strarray.Add (m_waiter1);
  10421. strarray.Add (m_waiter4);
  10422. for( i=13; i<=15; i++)
  10423. {
  10424. StrRect=load2.m_rcarray .ElementAt (i-1);
  10425. StrRect.left +=4;
  10426. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10427. }
  10428. ///////////spno
  10429. CRect sprc[14];
  10430. for(i=0; i<14; i++)
  10431. {
  10432. if(i<7)
  10433. {
  10434. if(i==0)
  10435. {
  10436. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  10437. }
  10438. else
  10439. {
  10440. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  10441. }
  10442. }
  10443. else
  10444. {
  10445. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  10446. }
  10447. sprc[i]=StrRect;
  10448. // m_Print.DrawText((LPTSTR)(LPCTSTR)"xxx", sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10449. }
  10450. CString temp,tempspno,tempbz;
  10451. CSize size;
  10452. BOOL bRun=0;
  10453. int fontsize=12;
  10454. ll: tempspno=spno;
  10455. tempbz=m_bz;
  10456. m_Print.SetFontFace(fontsize, 1, "宋体");
  10457. for( i=0; i<14; i++)
  10458. {
  10459. if(!tempspno.IsEmpty ())
  10460. {
  10461. temp=tempspno;
  10462. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10463. int right=0;
  10464. CRect temprc=sprc[i];
  10465. while(size.cx>temprc.Width ())
  10466. {
  10467. right++;
  10468. temp=tempspno.Left (tempspno.GetLength ()-(right));
  10469. if(GIsHalfHZ(temp))
  10470. {
  10471. right++;
  10472. temp.Delete (temp.GetLength ()-1);
  10473. }
  10474. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10475. }
  10476. if(bRun)
  10477. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10478. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  10479. if(tempspno.IsEmpty ())i++;
  10480. }
  10481. else if(!tempbz.IsEmpty ())
  10482. {
  10483. temp=tempbz;
  10484. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10485. int right=0;
  10486. CRect temprc=sprc[i];
  10487. while(size.cx>temprc.Width ())
  10488. {
  10489. right++;
  10490. temp=tempbz.Left (tempbz.GetLength ()-(right));
  10491. if(GIsHalfHZ(temp))
  10492. {
  10493. right++;
  10494. temp.Delete (temp.GetLength ()-1);
  10495. }
  10496. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10497. }
  10498. if(bRun)
  10499. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10500. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  10501. }
  10502. }
  10503. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  10504. {
  10505. fontsize--;
  10506. goto ll;
  10507. }
  10508. if(bRun==0)
  10509. {
  10510. bRun=1;
  10511. goto ll;
  10512. }
  10513. PrintPreview dlg;
  10514. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  10515. dlg.m_pDC =m_Print.GetPDC() ;
  10516. if(dlg.DoModal ()!=IDOK)return;
  10517. //结束打印
  10518. m_Print.EndPage();
  10519. m_Print.EndPrint();
  10520. }
  10521. void CMainFrame::SetSelFolder(int pos)
  10522. {
  10523. m_wndToolBar2.SetSelFolder(pos);
  10524. }*/
  10525. void CMainFrame::ToPhotoPrint()
  10526. {
  10527. UINT nID = 1;
  10528. LPSTR pName;
  10529. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  10530. OPEN_MENU(PhotoPrintFrom);
  10531. }
  10532. void CMainFrame::GetOcx()
  10533. {
  10534. char path[MAX_PATH];
  10535. ::GetSystemDirectory(path, MAX_PATH);
  10536. CString syspath = path;
  10537. try
  10538. {
  10539. if (!::PathFileExists(syspath + "\\MSCHRT20.OCX"))
  10540. {
  10541. g_sendhead.bsql = 0;
  10542. g_sendhead.code[0] = 103;
  10543. g_sendhead.tabcount = 1;
  10544. g_pMainWnd->ProcessChatMessageRequest2(1); if (g_bSendOK == 0)return;
  10545. CFile fp;
  10546. if (fp.Open(syspath + "\\MSCHRT20.OCX", CFile::modeWrite | CFile::modeCreate))
  10547. {
  10548. fp.Write(g_pData, g_nLeng);
  10549. fp.Close();
  10550. ::Sleep(1000);
  10551. }
  10552. }
  10553. CString temp;
  10554. temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10555. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10556. }
  10557. catch (...)
  10558. {
  10559. }
  10560. try
  10561. {
  10562. CString temp;
  10563. temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10564. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10565. }
  10566. catch (...)
  10567. {
  10568. }
  10569. }
  10570. void CMainFrame::OnServer()
  10571. {
  10572. // TODO: Add your command handler code here
  10573. DBConfig dlg;
  10574. dlg.DoModal();
  10575. }
  10576. void CMainFrame::OnPath()
  10577. {
  10578. // TODO: Add your command handler code here
  10579. if (g_user.bLongin == 0)
  10580. {
  10581. if (g_bNoLoginLia)
  10582. {
  10583. Login dlg;
  10584. dlg.SetLiaPath("5.lia");
  10585. dlg.DoModal();
  10586. }
  10587. else
  10588. {
  10589. Login3 dlg;
  10590. dlg.SetLiaPath("5.lia");
  10591. dlg.DoModal();
  10592. }
  10593. if (g_user.bLongin == 0)return;
  10594. }
  10595. if (IsHasRightsnew(49) == 0)return;
  10596. SetPathDlg2 dlg;
  10597. dlg.DoModal();
  10598. }
  10599. void CMainFrame::OnShowhis()
  10600. {
  10601. // TODO: Add your command handler code here
  10602. if (g_user.bLongin == 0)
  10603. {
  10604. if (g_bNoLoginLia)
  10605. {
  10606. Login dlg;
  10607. dlg.SetLiaPath("5.lia");
  10608. dlg.DoModal();
  10609. }
  10610. else
  10611. {
  10612. Login3 dlg;
  10613. dlg.SetLiaPath("5.lia");
  10614. dlg.DoModal();
  10615. }
  10616. if (g_user.bLongin == 0)return;
  10617. }
  10618. if (IsHasRightsnew(52) == 0)return;
  10619. CMenu *pMenu = GetMenu();
  10620. CMenu* submenu = pMenu->GetSubMenu(2);
  10621. UINT status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
  10622. if (status&MF_CHECKED)
  10623. {
  10624. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_UNCHECKED);
  10625. g_bShowOK = 1;
  10626. }
  10627. else
  10628. {
  10629. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  10630. g_bShowOK = 0;
  10631. } m_Mdi.CloseAll();
  10632. }
  10633. void CMainFrame::AddHistoryMenu(CArray<CStringArray, CStringArray>*hisyeararray) // 添加历史数据库菜单;
  10634. {
  10635. #ifdef NEW_SKIN
  10636. CMenu* m_menuXP = GetMenu();
  10637. CMenu* submenu = m_menuXP->GetSubMenu(2);
  10638. // 删除原有菜单;
  10639. int i = 0;
  10640. for ( i = 0; i < 100; i++)
  10641. {
  10642. submenu->DeleteMenu(1000 + i, MF_BYCOMMAND);
  10643. }
  10644. // 重创菜单,从资源ID1000开始;
  10645. for (i = 0; i < hisyeararray->GetSize(); i++)
  10646. {
  10647. submenu->AppendMenu(MF_STRING, 1000 + i, "查看历史数据:" + hisyeararray->ElementAt(i).ElementAt(0)); // 第一项菜单项;
  10648. }
  10649. g_nYearpos = -1;
  10650. #else
  10651. HMENU hMenu = ::GetMenu(m_hWnd);
  10652. m_menuXP.Attach(hMenu);
  10653. BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
  10654. for (int i = 0; i < 100; i++)
  10655. {
  10656. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10657. }
  10658. for( i=0; i<hisyeararray->GetSize (); i++)
  10659. {
  10660. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10661. }
  10662. m_menuXP.Detach ();
  10663. g_nYearpos = -1;
  10664. #endif
  10665. }
  10666. /************************************************************************/
  10667. /*
  10668. Jeff
  10669. 函数:AddBranchMenu()
  10670. 参数:CArray<CStringArray, CStringArray> *branchArray
  10671. 返回:void
  10672. 注意:
  10673. 调用关系:
  10674. */
  10675. /************************************************************************/
  10676. void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*branchArray)
  10677. {
  10678. //WriteTextLog("AddBranchMenu,添加集团版菜单");
  10679. #ifdef ENTERPRISE_VERSION
  10680. CMenu *m_menuXP = GetMenu();
  10681. CMenu* submenu = m_menuXP->GetSubMenu(0);
  10682. int i = 0;
  10683. for ( i = 0; i < 100; i++)
  10684. {
  10685. submenu->DeleteMenu(2000 + i, MF_BYCOMMAND);
  10686. }
  10687. g_menubranchname.RemoveAll();
  10688. CString name;
  10689. int a = 0;
  10690. #if 0 // Jeff.add for test
  10691. CString strCount;
  10692. strCount.Format("历史数据库个数=%d", branchArray->GetSize());
  10693. WriteTextLog(strCount);
  10694. #endif
  10695. for (i = 0; i < branchArray->GetSize() - 1; i++)
  10696. {
  10697. //WriteTextLog("111");
  10698. //WriteTextLog(hisyeararray->ElementAt(i).ElementAt(0));
  10699. //WriteTextLog(name);
  10700. if (name == "")
  10701. {
  10702. name = branchArray->ElementAt(i).ElementAt(0);
  10703. #ifndef SQLSERVER_VERSION
  10704. submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
  10705. a++;
  10706. #endif
  10707. submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
  10708. a++;
  10709. g_menubranchname.Add(name);
  10710. continue;
  10711. }
  10712. else if (branchArray->ElementAt(i).ElementAt(0).Find(name) != -1 && ((branchArray->ElementAt(i).ElementAt(0).GetLength() - name.GetLength()) == 4))
  10713. {
  10714. continue;
  10715. }
  10716. name = branchArray->ElementAt(i).ElementAt(0);
  10717. #ifndef SQLSERVER_VERSION
  10718. submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
  10719. a++;
  10720. #endif
  10721. submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
  10722. g_menubranchname.Add(name);
  10723. a++;
  10724. //WriteTextLog("222");
  10725. }
  10726. if ((branchArray->GetSize() - 1) > 0)
  10727. {
  10728. if (branchArray->ElementAt(0).ElementAt(3) == "总店")
  10729. submenu->AppendMenu(MF_STRING, 2000 + a, "多店数据汇总");
  10730. }
  10731. #endif
  10732. }
  10733. // Jeff:如果选择了历史数据库,则开单的数据会录入到该历史数据库中,而非当前数据库;
  10734. // g_nYearpos==-1,表示当前主数据库,其他>=0的值表示历史数据库在g_historydb中的索引值;
  10735. void CMainFrame::OnHistory(UINT nID) // 选择历史数据库菜单响应;
  10736. {
  10737. CMenu* pMenu = GetMenu();
  10738. CMenu* submenu = pMenu->GetSubMenu(2);
  10739. UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
  10740. if (g_user.bLongin == 0)
  10741. {
  10742. if (g_bNoLoginLia)
  10743. {
  10744. Login dlg;
  10745. dlg.SetLiaPath("5.lia");
  10746. dlg.DoModal();
  10747. }
  10748. else
  10749. {
  10750. Login3 dlg;
  10751. dlg.SetLiaPath("5.lia");
  10752. dlg.DoModal();
  10753. }
  10754. if (g_user.bLongin == 0)return;
  10755. }
  10756. if (IsHasRightsnew(52) == 0)return;
  10757. m_Mdi.CloseAll();
  10758. for (int i = 0; i < 100; i++)
  10759. {
  10760. submenu->CheckMenuItem(1000 + i, MF_BYCOMMAND | MF_UNCHECKED);
  10761. }
  10762. if (status&MF_CHECKED)
  10763. {
  10764. g_nYearpos = -1;
  10765. status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
  10766. if (status&MF_CHECKED)
  10767. g_bShowOK = 0;
  10768. else
  10769. g_bShowOK = 1;
  10770. }
  10771. else
  10772. {
  10773. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10774. g_nYearpos = nID - 1000;
  10775. g_bShowOK = 1;
  10776. }
  10777. }
  10778. void CMainFrame::OnBranchData(UINT nID)
  10779. {
  10780. #ifdef ENTERPRISE_VERSION
  10781. #ifdef SQLSERVER_VERSION
  10782. OnBranchData2(nID);
  10783. return;
  10784. #endif
  10785. #endif
  10786. }
  10787. void CMainFrame::OnBranchData2(UINT nID)
  10788. {
  10789. #ifdef ENTERPRISE_VERSION
  10790. g_bAllBranch = 0;
  10791. m_Mdi.CloseAll();
  10792. OnDisconnect();
  10793. CMenu *pMenu = GetMenu();
  10794. CMenu* submenu = pMenu->GetSubMenu(0);
  10795. UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
  10796. for (int i = 0; i < 100; i++)
  10797. {
  10798. submenu->CheckMenuItem(2000 + i, MF_BYCOMMAND | MF_UNCHECKED);
  10799. }
  10800. if (status&MF_CHECKED)
  10801. {
  10802. g_branchname.Empty();
  10803. g_branchip.Empty();
  10804. g_bBranchModify = 0;
  10805. g_user.bLongin = 0;
  10806. if (g_bNoLoginLia)
  10807. {
  10808. Login dlg;
  10809. dlg.SetLiaPath("5.lia");
  10810. dlg.DoModal();
  10811. }
  10812. else
  10813. {
  10814. Login3 dlg;
  10815. dlg.SetLiaPath("5.lia");
  10816. dlg.DoModal();
  10817. }
  10818. g_pMainWnd2->RefreshOutlookBar();
  10819. g_pMainWnd2->DrawLogin();
  10820. g_path1 = g_path1bak;
  10821. g_path2 = g_path2bak;
  10822. g_path3 = g_path3bak;
  10823. g_path4 = g_path4bak;
  10824. g_path5 = g_path5bak;
  10825. g_path6 = g_path6bak;
  10826. g_path7 = g_path7bak;
  10827. g_pMainWnd2->EnableBtns(1);
  10828. }
  10829. else
  10830. {
  10831. BOOL bNeedCheckRights = 1;
  10832. if (g_user.bLongin && g_branchname == "")//无需登陆本店判断其访问分店权限
  10833. {
  10834. bNeedCheckRights = 0;
  10835. }
  10836. #ifndef SQLSERVER_VERSION
  10837. if ((g_menubranchname.GetSize() * 2) == nID - 2000)//多店数据汇总
  10838. #else
  10839. if ((g_menubranchname.GetSize()) == nID - 2000)//多店数据汇总
  10840. #endif
  10841. {
  10842. g_branchname.Empty();
  10843. g_branchip.Empty();
  10844. g_bBranchModify = 0;
  10845. if (bNeedCheckRights)
  10846. {
  10847. g_user.bLongin = 0;
  10848. if (g_user.bLongin == 0)
  10849. {
  10850. if (g_bNoLoginLia)
  10851. {
  10852. Login dlg;
  10853. dlg.SetLiaPath("5.lia");
  10854. dlg.DoModal();
  10855. }
  10856. else
  10857. {
  10858. Login3 dlg;
  10859. dlg.SetLiaPath("5.lia");
  10860. dlg.DoModal();
  10861. }
  10862. if (g_user.bLongin == 0)return;
  10863. }
  10864. }
  10865. if (IsHasRightsnew(28) == 0)
  10866. {
  10867. return;
  10868. }
  10869. g_bAllBranch = 1; g_pMainWnd2->ShowBar(0);
  10870. g_pMainWnd2->RefreshOutlookBar2();
  10871. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10872. g_branchname.Empty();
  10873. g_branchip.Empty();
  10874. g_bBranchModify = 0;
  10875. g_pMainWnd2->DrawLogin();
  10876. g_pMainWnd2->EnableBtns(0);
  10877. g_path1 = g_path1bak;
  10878. g_path2 = g_path2bak;
  10879. g_path3 = g_path3bak;
  10880. g_path4 = g_path4bak;
  10881. g_path5 = g_path5bak;
  10882. g_path6 = g_path6bak;
  10883. g_path7 = g_path7bak;
  10884. }
  10885. else
  10886. {
  10887. if (bNeedCheckRights)
  10888. {
  10889. g_branchname.Empty();
  10890. g_branchip.Empty();
  10891. g_bBranchModify = 0;
  10892. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
  10893. g_user.bLongin = 0;
  10894. if (g_pMainWnd2)
  10895. {
  10896. g_pMainWnd2->DrawLogin();
  10897. g_pMainWnd2->ShowBar(0);
  10898. }
  10899. if (g_bNoLoginLia)
  10900. {
  10901. Login dlg;
  10902. dlg.SetLiaPath("5.lia");
  10903. dlg.DoModal();
  10904. }
  10905. else
  10906. {
  10907. Login3 dlg;
  10908. dlg.SetLiaPath("5.lia");
  10909. dlg.DoModal();
  10910. }
  10911. if (g_user.bLongin == 0)return;
  10912. }
  10913. if (IsHasRightsnew(28) == 0)
  10914. {
  10915. return;
  10916. }
  10917. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10918. #ifndef SQLSERVER_VERSION
  10919. if (nID % 2 == 0)
  10920. g_branchname = g_menubranchname.ElementAt((nID - 2000) / 2);
  10921. else
  10922. g_branchname = g_menubranchname.ElementAt((nID - 2001) / 2);
  10923. #else
  10924. g_branchname = g_menubranchname.ElementAt(nID - 2000);
  10925. #endif
  10926. //printf("选择分店:%s\n", g_branchname);
  10927. g_branchip.Empty();
  10928. CString domainname = "";
  10929. for (int i = 0; i < g_brancharray.GetSize(); i++)
  10930. {
  10931. /*
  10932. for(int j=0; j<g_brancharray.GetSize(); j++)
  10933. printf("%s\n", g_brancharray.ElementAt(i).ElementAt(j));
  10934. */
  10935. if (g_branchname == g_brancharray.ElementAt(i).ElementAt(0))
  10936. {
  10937. g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
  10938. g_branchip2 = g_brancharray.ElementAt(i).ElementAt(4);
  10939. domainname = g_brancharray.ElementAt(i).ElementAt(2);
  10940. }
  10941. }
  10942. g_path1 = g_path1bak;
  10943. g_path2 = g_path2bak;
  10944. g_path3 = g_path3bak;
  10945. g_path4 = g_path4bak;
  10946. g_path5 = g_path5bak;
  10947. g_path6 = g_path6bak;
  10948. g_path7 = g_path7bak;
  10949. if (domainname.IsEmpty())
  10950. {
  10951. g_path1 = g_path2 = g_path3 = g_path4 = g_path5 = g_path6 = g_path7 = "xxx";
  10952. }
  10953. else
  10954. {
  10955. g_path1 += "\\" + domainname;
  10956. g_path2 += "\\" + domainname;
  10957. g_path3 += "\\" + domainname;
  10958. g_path4 += "\\" + domainname;
  10959. g_path5 += "\\" + domainname;
  10960. g_path6 += "\\" + domainname;
  10961. g_path7 += "\\" + domainname;
  10962. }
  10963. g_bBranchModify = 1;
  10964. /* CArray<CStringArray, CStringArray>yeararray;
  10965. for( i=0; i<g_brancharray.GetSize (); i++)
  10966. {
  10967. if(g_brancharray.ElementAt (i).ElementAt (0).Find (g_branchname)!=-1 && g_branchname!=g_brancharray.ElementAt (i).ElementAt (0))
  10968. {
  10969. int size=yeararray.GetSize ();
  10970. yeararray.SetSize(size+1,1);
  10971. CString str=g_brancharray.ElementAt (i).ElementAt (0);
  10972. str.Delete (0, g_branchname.GetLength ());
  10973. yeararray.ElementAt (size).Add (str);
  10974. }
  10975. }
  10976. AddHistoryMenu(&yeararray);*/
  10977. if (g_bBranchModify)OnDisconnect();
  10978. if (1)
  10979. {
  10980. g_user.bLongin = 0;
  10981. g_user.name.Empty();
  10982. g_user.rights.Empty();
  10983. g_user.account.Empty();
  10984. g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  10985. g_pMainWnd2->RefreshOutlookBar();
  10986. m_Mdi.CloseAll();
  10987. if (g_pMainWnd2)
  10988. {
  10989. g_pMainWnd2->DrawLogin();
  10990. g_pMainWnd2->ShowBar(0);
  10991. }
  10992. if (g_bNoLoginLia)
  10993. {
  10994. Login dlg;
  10995. dlg.SetLiaPath("5.lia");
  10996. dlg.DoModal();
  10997. }
  10998. else
  10999. {
  11000. Login3 dlg;
  11001. dlg.SetLiaPath("5.lia");
  11002. dlg.DoModal();
  11003. }
  11004. if (g_user.bLongin == 0)return;
  11005. if (g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  11006. }
  11007. g_pMainWnd2->DrawLogin();
  11008. g_pMainWnd2->EnableBtns(1);
  11009. }
  11010. g_nYearpos = -1;
  11011. }
  11012. #endif
  11013. }
  11014. void CMainFrame::OnStaffAchievementShow() //Jeff:此机只用于员工看业绩;
  11015. {
  11016. // TODO: Add your command handler code here
  11017. if (g_user.bLongin == 0) // 是否登陆系统;
  11018. {
  11019. if (g_bNoLoginLia)
  11020. {
  11021. Login dlg;
  11022. dlg.SetLiaPath("5.lia");
  11023. dlg.DoModal();
  11024. }
  11025. else
  11026. {
  11027. Login3 dlg;
  11028. dlg.SetLiaPath("5.lia");
  11029. dlg.DoModal();
  11030. }
  11031. if (g_user.bLongin == 0)return;
  11032. }
  11033. if (IsHasRightsnew(49) == 0)return;// 是否有权限进行设置;
  11034. CMenu *pMenu = GetMenu();
  11035. CMenu* submenu = pMenu->GetSubMenu(1);
  11036. UINT status = submenu->GetMenuState(IDM_StaffAchievementShow, MF_BYCOMMAND);
  11037. if (status&MF_CHECKED)
  11038. {
  11039. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_UNCHECKED);
  11040. AfxGetApp()->WriteProfileInt(LYFZVERSION, "status2", 0);
  11041. g_bStaffAchievementShow = 0;
  11042. TCHAR szKey[MAX_PATH];
  11043. TCHAR szDir[MAX_PATH];
  11044. ::GetModuleFileName(NULL, szDir, MAX_PATH);
  11045. HKEY hKey = 0;
  11046. DWORD disp = 0;
  11047. lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  11048. int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
  11049. if (lResult == ERROR_SUCCESS)
  11050. {
  11051. RegDeleteValue(hKey, "YLGLMAINAUTORUN");
  11052. RegDeleteKey(hKey, "YLGLMAINAUTORUN");
  11053. RegCloseKey(hKey);
  11054. }
  11055. }
  11056. else
  11057. {
  11058. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  11059. AfxGetApp()->WriteProfileInt(LYFZVERSION, "status2", 1);
  11060. g_bStaffAchievementShow = 1;
  11061. TCHAR szKey[MAX_PATH];
  11062. TCHAR szDir[MAX_PATH];
  11063. ::GetModuleFileName(NULL, szDir, MAX_PATH);
  11064. HKEY hKey = 0;
  11065. DWORD disp = 0;
  11066. lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  11067. int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
  11068. if (lResult == ERROR_SUCCESS)
  11069. {
  11070. lResult = RegSetValueEx(hKey, "YLGLMAINAUTORUN", 0, REG_SZ, (const unsigned char*)szDir, lstrlen(szDir));
  11071. RegCloseKey(hKey);
  11072. }
  11073. StaffAchievementSet dlg;
  11074. dlg.DoModal();
  11075. }
  11076. }
  11077. void CMainFrame::PrintDinDan2(CString m_id)
  11078. {
  11079. #ifdef MODERN_VERSION
  11080. SelContent seldlg;
  11081. if (seldlg.DoModal() != IDOK)return;
  11082. CPrintRX m_Print;
  11083. m_Print.InitToPrint(NULL, 1);
  11084. m_Print.StartPrint();
  11085. m_Print.StartPage();
  11086. // CRect StrRect(0,0,560,818);
  11087. LoadRect load;
  11088. LoadRect load2;
  11089. LoadRect load3;
  11090. load.SetLiaPath ("9.lia");
  11091. load.SetMargins(-14,0);
  11092. if(!load.Load ())return;
  11093. int i;
  11094. //////////////////////////////////////////////////////////////
  11095. CStringArray txarray;
  11096. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  11097. g_sendhead.code[0]=11;
  11098. g_sendhead.code[1]=52;
  11099. g_sendhead.code[2]=50;
  11100. g_sendhead.code[3]=38;
  11101. g_sendhead.code[4]=27;
  11102. g_sendhead.tabcount=5;
  11103. g_sendhead.bsql=0;
  11104. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11105. CArray<CStringArray, CStringArray>sparray;
  11106. CArray<CStringArray, CStringArray>clientarray;
  11107. CArray<CStringArray, CStringArray>phonearray;
  11108. CArray<CStringArray, CStringArray>bukuan2array;
  11109. CArray<CStringArray, CStringArray>bukuanarray;
  11110. DataToArray(&g_List1array, &clientarray, &sparray, &bukuan2array, &bukuanarray);
  11111. CTime tm=CTime::GetCurrentTime ();
  11112. CString str;
  11113. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11114. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11115. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11116. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11117. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11118. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  11119. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11120. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11121. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11122. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11123. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11124. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11125. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11126. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11127. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11128. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11129. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11130. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11131. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11132. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11133. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11134. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11135. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11136. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11137. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11138. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11139. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11140. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11141. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11142. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11143. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11144. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11145. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11146. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  11147. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  11148. filter="name='"+m_ren+"'";
  11149. g_sendhead.code[0]=5;
  11150. g_sendhead.tabcount=1;
  11151. g_sendhead.bsql=0;
  11152. int g_nYearposTemp=g_nYearpos;
  11153. g_nYearpos=-1;
  11154. g_pMainWnd->ProcessChatMessageRequest2(filter);
  11155. g_nYearpos=g_nYearposTemp;
  11156. if(g_bSendOK==0)return;
  11157. DataToArray(&phonearray);
  11158. m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
  11159. m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
  11160. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11161. ConvertToPrice(m_money1);
  11162. ConvertToPrice(m_money2);
  11163. ConvertToPrice(m_money3);
  11164. ////////////////////////////////////////////////////////////////
  11165. int rcpos=-1;
  11166. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11167. Image *pImg=NULL;
  11168. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo2.jpg");
  11169. if(seldlg.m_bFrame)
  11170. m_Print.DrawImage(pImg, StrRect);
  11171. delete pImg;
  11172. m_Print.SetFontFace(16, 1, "黑体");
  11173. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11174. if(seldlg.m_bFrame)
  11175. ///////////////////////////////不用改
  11176. m_Print.DrawText((LPTSTR)(LPCTSTR)"摩登新娘工作流程单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11177. m_Print.SetFontFace(10, 1, "宋体");
  11178. for( i=3; i<=6; i++)
  11179. {
  11180. StrRect=load.m_rcarray .ElementAt (i-1);
  11181. if(seldlg.m_bFrame)
  11182. m_Print.DrawRect2(StrRect, 1);
  11183. }
  11184. CStringArray strarray;
  11185. if(seldlg.m_bBooking==0)
  11186. {
  11187. m_name1.Empty ();
  11188. m_name2.Empty ();
  11189. m_phone1.Empty ();
  11190. m_phone2.Empty ();
  11191. m_addr1.Empty ();
  11192. m_addr2.Empty ();
  11193. m_taoxiname.Empty ();
  11194. m_taoxijiage.Empty ();
  11195. }
  11196. if(seldlg.m_bFrame )
  11197. {
  11198. strarray.Add("新郎:"+m_name1);
  11199. strarray.Add("H");
  11200. strarray.Add("O");
  11201. strarray.Add("手机:"+m_phone1);
  11202. strarray.Add("新娘:"+m_name2);
  11203. strarray.Add("H");
  11204. strarray.Add("O");
  11205. strarray.Add("手机:"+m_phone2);
  11206. }
  11207. else
  11208. {
  11209. strarray.Add(" "+m_name1);
  11210. strarray.Add("");
  11211. strarray.Add("");
  11212. strarray.Add(" "+m_phone1);
  11213. strarray.Add(" "+m_name2);
  11214. strarray.Add("");
  11215. strarray.Add("");
  11216. strarray.Add(" "+m_phone2);
  11217. }
  11218. for( i=7; i<=14; i++)
  11219. {
  11220. StrRect=load.m_rcarray .ElementAt (i-1);
  11221. StrRect.left +=2;
  11222. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11223. }
  11224. StrRect=load.m_rcarray .ElementAt (3);
  11225. StrRect.left +=2;
  11226. if(seldlg.m_bFrame)
  11227. str="地址:"+m_addr1;
  11228. else
  11229. str=" "+m_addr1;
  11230. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11231. StrRect=load.m_rcarray .ElementAt (5);
  11232. StrRect.left +=2;
  11233. if(seldlg.m_bFrame)
  11234. str="地址:"+m_addr2;
  11235. else
  11236. str=" "+m_addr2;
  11237. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11238. //////////////////////////////////////////////////////
  11239. StrRect=load.m_rcarray .ElementAt (14);
  11240. str="预\r\n约";
  11241. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11242. StrRect.top +=46;
  11243. StrRect.left +=2;
  11244. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11245. m_Print.SetFontFace(10, 1, "宋体");
  11246. StrRect=load.m_rcarray .ElementAt (15);
  11247. if(seldlg.m_bFrame)
  11248. str="套系名称:"+m_taoxiname;
  11249. else
  11250. str=" "+m_taoxiname;
  11251. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11252. StrRect.left +=4;
  11253. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11254. StrRect=load.m_rcarray .ElementAt (16);
  11255. if(seldlg.m_bFrame)
  11256. str="单价:"+m_taoxijiage;
  11257. else
  11258. str=" "+m_taoxijiage;
  11259. StrRect.left +=2;
  11260. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11261. StrRect=load.m_rcarray .ElementAt (21);
  11262. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11263. str="新人签名:";
  11264. StrRect.left +=2;
  11265. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11266. StrRect=load.m_rcarray .ElementAt (22);
  11267. if(seldlg.m_bBooking==0)
  11268. {
  11269. if(seldlg.m_bFrame)
  11270. str="未付款:";
  11271. else
  11272. str=" ";
  11273. }
  11274. else
  11275. {
  11276. if(seldlg.m_bFrame)
  11277. str="未付款:"+m_money3;
  11278. else
  11279. str=" "+m_money3;
  11280. }
  11281. StrRect.left +=2;
  11282. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11283. StrRect=load.m_rcarray .ElementAt (23);
  11284. str="结婚秘书:";
  11285. StrRect.left +=2;
  11286. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11287. StrRect=load.m_rcarray .ElementAt (24);
  11288. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11289. StrRect.left +=3;
  11290. StrRect.top +=3;
  11291. StrRect.right -=2;
  11292. StrRect.bottom -=2;
  11293. int realpos=0;str="";
  11294. for(i=0; i<sparray.GetSize (); i++)
  11295. {
  11296. if(atoi(sparray.ElementAt (i).ElementAt (4))!=1)continue;
  11297. str+=sparray.ElementAt (i).ElementAt (5);
  11298. str+=" 数量:";
  11299. str+=sparray.ElementAt (i).ElementAt (3);
  11300. if(realpos%2)
  11301. str+="\r\n";
  11302. else
  11303. str+=" ";
  11304. realpos++;
  11305. }
  11306. str.TrimRight ("\r\n");
  11307. str.TrimRight (" ");
  11308. if(seldlg.m_bBooking)AutoDraw(m_Print, StrRect, str, 1.4);
  11309. ///////////////////////////////////////////////////////////
  11310. StrRect=load.m_rcarray .ElementAt (14);
  11311. StrRect.top +=1*122;
  11312. StrRect.bottom +=1*122;
  11313. str="拍\r\n照";
  11314. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11315. StrRect.top +=46;
  11316. StrRect.left +=2;
  11317. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11318. m_Print.SetFontFace(10, 1, "宋体");
  11319. StrRect=load.m_rcarray .ElementAt (15);
  11320. StrRect.top +=1*122;
  11321. StrRect.bottom +=1*122;
  11322. str="拍照内容: 白 晚 特 便";
  11323. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11324. StrRect.left +=4;
  11325. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11326. StrRect=load.m_rcarray .ElementAt (21);
  11327. StrRect.top +=1*122;
  11328. StrRect.bottom +=1*122;
  11329. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11330. str=" 新人签名:";
  11331. StrRect.left +=2;
  11332. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11333. StrRect=load.m_rcarray .ElementAt (22);
  11334. StrRect.top +=1*122;
  11335. StrRect.bottom +=1*122;
  11336. if(seldlg.m_bTake)
  11337. {
  11338. if(seldlg.m_bFrame)
  11339. str="未付款:"+m_money3;
  11340. else
  11341. str=" "+m_money3;
  11342. }
  11343. else
  11344. {
  11345. if(seldlg.m_bFrame)
  11346. str="未付款:";
  11347. else
  11348. str=" ";
  11349. }
  11350. StrRect.left +=2;
  11351. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11352. StrRect=load.m_rcarray .ElementAt (23);
  11353. StrRect.top +=1*122;
  11354. StrRect.bottom +=1*122;
  11355. str="结婚秘书:";
  11356. StrRect.left +=2;
  11357. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11358. StrRect=load.m_rcarray .ElementAt (24);
  11359. StrRect.top +=1*122;
  11360. StrRect.bottom +=1*122;
  11361. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11362. StrRect.left +=3;
  11363. StrRect.top +=3;
  11364. StrRect.right -=2;
  11365. StrRect.bottom -=2;
  11366. if(seldlg.m_bTake)
  11367. {
  11368. str="";
  11369. for(i=0; i<bukuan2array.GetSize (); i++)
  11370. {
  11371. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=1)continue;
  11372. str+="加挑: ";
  11373. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11374. str+="\r\n";
  11375. }
  11376. str.TrimRight ("\r\n");
  11377. str.TrimRight (" ");
  11378. AutoDraw(m_Print, StrRect, str, 1.4);
  11379. }
  11380. ///////////////////////////////////////////////////////////
  11381. StrRect=load.m_rcarray .ElementAt (14);
  11382. StrRect.top +=2*122;
  11383. StrRect.bottom +=2*122;
  11384. str="选\r\n样";
  11385. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11386. StrRect.top +=46;
  11387. StrRect.left +=2;
  11388. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11389. m_Print.SetFontFace(10, 1, "宋体");
  11390. StrRect=load.m_rcarray .ElementAt (15);
  11391. StrRect.top +=2*122;
  11392. StrRect.bottom +=2*122;
  11393. str="选片内容:";
  11394. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11395. StrRect.left +=4;
  11396. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11397. StrRect=load.m_rcarray .ElementAt (21);
  11398. StrRect.top +=2*122;
  11399. StrRect.bottom +=2*122;
  11400. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11401. str=" 新人签名:";
  11402. StrRect.left +=2;
  11403. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11404. StrRect=load.m_rcarray .ElementAt (22);
  11405. StrRect.top +=2*122;
  11406. StrRect.bottom +=2*122;
  11407. if(seldlg.m_bChoose)
  11408. {
  11409. if(seldlg.m_bFrame)
  11410. str="未付款:"+m_money3;
  11411. else
  11412. str=" "+m_money3;
  11413. }
  11414. else
  11415. {
  11416. if(seldlg.m_bFrame)
  11417. str="未付款:";
  11418. else
  11419. str=" ";
  11420. }
  11421. StrRect.left +=2;
  11422. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11423. StrRect=load.m_rcarray .ElementAt (23);
  11424. StrRect.top +=2*122;
  11425. StrRect.bottom +=2*122;
  11426. str="结婚秘书:";
  11427. StrRect.left +=2;
  11428. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11429. StrRect=load.m_rcarray .ElementAt (24);
  11430. StrRect.top +=2*122;
  11431. StrRect.bottom +=2*122;
  11432. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11433. if(seldlg.m_bChoose)
  11434. {
  11435. StrRect.left +=3;
  11436. StrRect.top +=3;
  11437. StrRect.right -=2;
  11438. StrRect.bottom -=2;
  11439. str="";
  11440. for(i=0; i<bukuan2array.GetSize (); i++)
  11441. {
  11442. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=2)continue;
  11443. str+="加挑: ";
  11444. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11445. str+="\r\n";
  11446. }
  11447. str.TrimRight ("\r\n");
  11448. str.TrimRight (" ");
  11449. AutoDraw(m_Print, StrRect, str, 1.4);
  11450. }
  11451. ///////////////////////////////////////////////////////////
  11452. StrRect=load.m_rcarray .ElementAt (14);
  11453. StrRect.top +=3*122;
  11454. StrRect.bottom +=3*122;
  11455. str="结\r\n婚";
  11456. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11457. StrRect.top +=46;
  11458. StrRect.left +=2;
  11459. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11460. m_Print.SetFontFace(10, 1, "宋体");
  11461. StrRect=load.m_rcarray .ElementAt (15);
  11462. StrRect.top +=3*122;
  11463. StrRect.bottom +=3*122;
  11464. str="结婚内容: 区 白 晚 押金:";
  11465. if(seldlg.m_bFrame) m_Print.DrawRect2(StrRect, 1);
  11466. StrRect.left +=4;
  11467. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11468. StrRect=load.m_rcarray .ElementAt (21);
  11469. StrRect.top +=3*122;
  11470. StrRect.bottom +=3*122;
  11471. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11472. str=" 新人签名:";
  11473. StrRect.left +=2;
  11474. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11475. StrRect=load.m_rcarray .ElementAt (22);
  11476. StrRect.top +=3*122;
  11477. StrRect.bottom +=3*122;
  11478. if(seldlg.m_bBooking)
  11479. {
  11480. if(seldlg.m_bFrame)
  11481. str="未付款:"+m_money3;
  11482. else
  11483. str=" "+m_money3;
  11484. }
  11485. else
  11486. {
  11487. if(seldlg.m_bFrame)
  11488. str="未付款:";
  11489. else
  11490. str=" ";
  11491. }
  11492. StrRect.left +=2;
  11493. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11494. StrRect=load.m_rcarray .ElementAt (23);
  11495. StrRect.top +=3*122;
  11496. StrRect.bottom +=3*122;
  11497. str="结婚秘书:";
  11498. StrRect.left +=2;
  11499. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11500. StrRect=load.m_rcarray .ElementAt (24);
  11501. StrRect.top +=3*122;
  11502. StrRect.bottom +=3*122;
  11503. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11504. if(seldlg.m_bBooking)
  11505. {
  11506. StrRect.left +=3;
  11507. StrRect.top +=3;
  11508. StrRect.right -=2;
  11509. StrRect.bottom -=2;
  11510. realpos=0;str="";
  11511. for(i=0; i<sparray.GetSize (); i++)
  11512. {
  11513. if(atoi(sparray.ElementAt (i).ElementAt (4))!=2)continue;
  11514. str+=sparray.ElementAt (i).ElementAt (5);
  11515. str+=" 数量:";
  11516. str+=sparray.ElementAt (i).ElementAt (3);
  11517. if(realpos%2)
  11518. str+="\r\n";
  11519. else
  11520. str+=" ";
  11521. realpos++;
  11522. }
  11523. str.TrimRight ("\r\n");
  11524. str.TrimRight (" ");
  11525. AutoDraw(m_Print, StrRect, str, 1.4);
  11526. }
  11527. ///////////////////////////////////////
  11528. strarray.RemoveAll ();
  11529. if(seldlg.m_bFrame)
  11530. {
  11531. strarray.Add ("项目");
  11532. strarray.Add ("万");
  11533. strarray.Add ("千");
  11534. strarray.Add ("百");
  11535. strarray.Add ("十");
  11536. strarray.Add ("个");
  11537. strarray.Add ("收 银");
  11538. }
  11539. else
  11540. {
  11541. strarray.Add ("");
  11542. strarray.Add ("");
  11543. strarray.Add ("");
  11544. strarray.Add ("");
  11545. strarray.Add ("");
  11546. strarray.Add ("");
  11547. strarray.Add ("");
  11548. }
  11549. CStringArray strarray2;
  11550. float ftotal=0;
  11551. int realcount=0;
  11552. if(seldlg.m_bBooking)
  11553. {
  11554. for(i=0; i<bukuanarray.GetSize (); i++)
  11555. {
  11556. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=3 && atoi(bukuanarray.ElementAt (i).ElementAt (6))!=4)continue;
  11557. realcount++;
  11558. if(realcount>6)break;
  11559. str=bukuanarray.ElementAt (i).ElementAt (1);
  11560. ftotal+=atof(str);
  11561. strarray2.Add (GetW(str));
  11562. strarray2.Add (GetK(str));
  11563. strarray2.Add (GetB(str));
  11564. strarray2.Add (GetS(str));
  11565. strarray2.Add (GetG(str));
  11566. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11567. }
  11568. }
  11569. while(strarray2.GetSize ()<36)
  11570. strarray2.Add ("");
  11571. str.Format ("%f", ftotal);
  11572. strarray2.Add (GetW(str));
  11573. strarray2.Add (GetK(str));
  11574. strarray2.Add (GetB(str));
  11575. strarray2.Add (GetS(str));
  11576. strarray2.Add (GetG(str));
  11577. strarray2.Add ("");
  11578. //拍照
  11579. ftotal=0;
  11580. realcount=0;
  11581. if(seldlg.m_bTake)
  11582. {
  11583. for(i=0; i<bukuanarray.GetSize (); i++)
  11584. {
  11585. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=1)continue;
  11586. realcount++;
  11587. if(realcount>6)break;
  11588. str=bukuanarray.ElementAt (i).ElementAt (1);
  11589. ftotal+=atof(str);
  11590. strarray2.Add (GetW(str));
  11591. strarray2.Add (GetK(str));
  11592. strarray2.Add (GetB(str));
  11593. strarray2.Add (GetS(str));
  11594. strarray2.Add (GetG(str));
  11595. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11596. }
  11597. }
  11598. while(strarray2.GetSize ()<42+36)
  11599. strarray2.Add ("");
  11600. str.Format ("%f", ftotal);
  11601. strarray2.Add (GetW(str));
  11602. strarray2.Add (GetK(str));
  11603. strarray2.Add (GetB(str));
  11604. strarray2.Add (GetS(str));
  11605. strarray2.Add (GetG(str));
  11606. strarray2.Add ("");
  11607. //选片
  11608. ftotal=0;
  11609. realcount=0;
  11610. if(seldlg.m_bChoose)
  11611. {
  11612. for(i=0; i<bukuanarray.GetSize (); i++)
  11613. {
  11614. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=2)continue;
  11615. realcount++;
  11616. if(realcount>6)break;
  11617. str=bukuanarray.ElementAt (i).ElementAt (1);
  11618. ftotal+=atof(str);
  11619. strarray2.Add (GetW(str));
  11620. strarray2.Add (GetK(str));
  11621. strarray2.Add (GetB(str));
  11622. strarray2.Add (GetS(str));
  11623. strarray2.Add (GetG(str));
  11624. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11625. }
  11626. }
  11627. while(strarray2.GetSize ()<42*2+36)
  11628. strarray2.Add ("");
  11629. str.Format ("%f", ftotal);
  11630. strarray2.Add (GetW(str));
  11631. strarray2.Add (GetK(str));
  11632. strarray2.Add (GetB(str));
  11633. strarray2.Add (GetS(str));
  11634. strarray2.Add (GetG(str));
  11635. strarray2.Add ("");
  11636. /////////////////////////////
  11637. CRect temprc;
  11638. for(int n=0; n<4; n++)
  11639. {
  11640. StrRect=load.m_rcarray .ElementAt (17);
  11641. StrRect.top +=n*122;
  11642. StrRect.bottom +=n*122;
  11643. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11644. StrRect=load.m_rcarray .ElementAt (18);
  11645. if(n)
  11646. {
  11647. StrRect.left +=36;
  11648. StrRect.right +=36;
  11649. }
  11650. StrRect.top +=n*122;
  11651. StrRect.bottom +=n*122;
  11652. if(seldlg.m_bFrame)
  11653. str.Format("%d年", tm.GetYear ());
  11654. else
  11655. str.Format("%d ", tm.GetYear ());
  11656. 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))
  11657. {
  11658. if(seldlg.m_bFrame)
  11659. str=" 年";
  11660. else
  11661. str=" ";
  11662. }
  11663. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11664. StrRect=load.m_rcarray .ElementAt (19);
  11665. if(n)
  11666. {
  11667. StrRect.left +=38;
  11668. StrRect.right +=38;
  11669. }
  11670. StrRect.top +=n*122;
  11671. StrRect.bottom +=n*122;
  11672. if(seldlg.m_bFrame)
  11673. str.Format("%02d月", tm.GetMonth ());
  11674. else
  11675. str.Format("%02d ", tm.GetMonth ());
  11676. 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))
  11677. {
  11678. if(seldlg.m_bFrame)
  11679. str=" 月";
  11680. else
  11681. str=" ";
  11682. }
  11683. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11684. StrRect=load.m_rcarray .ElementAt (20);
  11685. if(n)
  11686. {
  11687. StrRect.left +=36;
  11688. StrRect.right +=36;
  11689. }
  11690. StrRect.top +=n*122;
  11691. StrRect.bottom +=n*122;
  11692. if(seldlg.m_bFrame)
  11693. str.Format("%02d日", tm.GetDay ());
  11694. else
  11695. str.Format("%02d ", tm.GetDay ());
  11696. 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))
  11697. {
  11698. if(seldlg.m_bFrame)
  11699. str=" 日";
  11700. else
  11701. str=" ";
  11702. }
  11703. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11704. for(i=26; i<=32; i++)
  11705. {
  11706. StrRect=load.m_rcarray .ElementAt (i-1);
  11707. StrRect.bottom -=14;
  11708. for(int j=0; j<8; j++)
  11709. {
  11710. StrRect.top=StrRect.bottom;
  11711. if(j>2)
  11712. {
  11713. StrRect.bottom =StrRect.top+14;
  11714. }
  11715. else
  11716. {
  11717. StrRect.bottom =StrRect.top+13;
  11718. }
  11719. temprc=StrRect;
  11720. StrRect.top +=n*122;
  11721. StrRect.bottom +=n*122;
  11722. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11723. if(i==26 && j==4 && seldlg.m_bFrame)
  11724. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11725. else if(i==26 && j==5 && seldlg.m_bFrame)
  11726. m_Print.DrawText((LPTSTR)(LPCTSTR)"付款", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11727. else if(i==26 && j==7 && seldlg.m_bFrame)
  11728. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11729. else if(j==0)
  11730. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-26), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11731. else if(j && i>26 && n<3)
  11732. {
  11733. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray2.ElementAt ((j-1)*6+(i-27)+n*42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11734. }
  11735. StrRect=temprc;
  11736. }
  11737. }
  11738. }
  11739. if(seldlg.m_bFrame)
  11740. {
  11741. StrRect=load.m_rcarray .ElementAt (32);
  11742. str="注\r\n意\r\n事\r\n项";
  11743. StrRect.top +=367;
  11744. StrRect.bottom +=367;
  11745. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11746. StrRect.top +=17;
  11747. StrRect.left +=2;
  11748. AutoDraw(m_Print, StrRect, str, 1.4);
  11749. StrRect=load.m_rcarray .ElementAt (33);
  11750. str="1: 本预约单自预定日期起一年内有效.定金在拍照套系金额中扣出.预定金一概不退\r\n\
  11751. 2: 多拍照片只供筛选.恕不奉送.版权所有.不得私自拷贝\r\n\
  11752. 3: 拍照款请于拍照时一次付清\r\n\
  11753. 4: 新娘装AM8:00前钟点费另计.婚纱礼服出租押金500-2000元\r\n\
  11754. 5: 本公司设有豪华VIP礼服区.及皇家御用礼服展区.但需另外加价.详情请咨本店人员\r\n\
  11755. 6: 安瓶, 美甲一次性化妆用具等均属增值服务部分,则需另外加价,详情咨询本店工作人员\r\n\
  11756. 7: 本电脑机械故障导致文件资料丢失.本公司只提供补拍服务\r\n\
  11757. 8: 每次前来请务必携带本单交给工作人员.本单是您在摩登新娘拍照的凭证.办理有关手续凭本单办理盖\r\n\
  11758. 章后方可生效";
  11759. StrRect.top +=367;
  11760. StrRect.bottom +=367;
  11761. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11762. StrRect.top +=4;
  11763. StrRect.left +=2;
  11764. AutoDraw(m_Print, StrRect, str, 1.0);
  11765. StrRect=load.m_rcarray .ElementAt (34);
  11766. 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)";
  11767. AutoDraw(m_Print, StrRect, str, 1.0);
  11768. m_Print.SetFontFace(13, 1, "宋体");
  11769. StrRect=load.m_rcarray .ElementAt (35);
  11770. str="地 址: 汉口 . 解放大道 . 头道街东部购物公园C栋二,三层";
  11771. StrRect.top +=367;
  11772. StrRect.bottom +=367;
  11773. StrRect.left +=2;
  11774. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11775. StrRect=load.m_rcarray .ElementAt (36);
  11776. str="喜讯热线: 027-81888799 81888599 81888699";
  11777. StrRect.top +=367;
  11778. StrRect.bottom +=367;
  11779. StrRect.left +=2;
  11780. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11781. }
  11782. PrintPreview dlg;
  11783. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11784. dlg.m_pDC =m_Print.GetPDC() ;
  11785. if(dlg.DoModal ()!=IDOK)return;
  11786. //结束打印
  11787. m_Print.EndPage();
  11788. m_Print.EndPrint();
  11789. #endif
  11790. }
  11791. extern CString GetHMoney(CString str);
  11792. void CMainFrame::PrintReceipt3(CString strOrderNumber, CStringArray *pArray, float money)
  11793. {
  11794. int printcot = 1;
  11795. for (int aa = 0; aa < printcot; aa++)
  11796. {
  11797. g_sendhead.bsql = 0;
  11798. g_sendhead.code[0] = 24;
  11799. g_sendhead.tabcount = 1;
  11800. int g_nYearposTemp = g_nYearpos;
  11801. g_nYearpos = -1;
  11802. g_pMainWnd->ProcessChatMessageRequest2(1);
  11803. g_nYearpos = g_nYearposTemp;
  11804. if (0 == g_bSendOK)return;
  11805. DataToArray(&g_cominfoarray);
  11806. CString SerialNo;
  11807. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  11808. CPrintRX m_Print;
  11809. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11810. {
  11811. m_Print.InitToPrint(NULL, 1);
  11812. }
  11813. else
  11814. {
  11815. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  11816. if (name.IsEmpty())
  11817. m_Print.InitToPrint(NULL, 1);
  11818. else
  11819. {
  11820. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11821. if (nret == -1 && aa == 0)
  11822. {
  11823. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11824. }
  11825. }
  11826. }
  11827. m_Print.StartPrint();
  11828. m_Print.StartPage();
  11829. LoadRect load;
  11830. load.SetLiaPath("15.lia");
  11831. load.SetMargins(0, 0);
  11832. if (!load.Load())return;
  11833. int i;
  11834. //////////////////////////////////////////////////////////////
  11835. CStringArray txarray;
  11836. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  11837. g_sendhead.code[0] = 11;
  11838. g_sendhead.code[1] = 52;
  11839. g_sendhead.tabcount = 2;
  11840. g_sendhead.bsql = 0;
  11841. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  11842. CArray<CStringArray, CStringArray>sparray;
  11843. CArray<CStringArray, CStringArray>clientarray;
  11844. DataToArray(&g_List1array, &clientarray);
  11845. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  11846. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  11847. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  11848. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  11849. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  11850. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11851. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  11852. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  11853. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  11854. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  11855. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  11856. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  11857. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  11858. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  11859. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  11860. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  11861. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  11862. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  11863. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  11864. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  11865. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  11866. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  11867. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  11868. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  11869. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  11870. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  11871. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  11872. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  11873. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  11874. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  11875. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  11876. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  11877. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  11878. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  11879. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  11880. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  11881. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  11882. CString m_addr = m_addr1 + ";";
  11883. m_addr.TrimLeft(";");
  11884. m_addr += m_addr2;
  11885. CString m_qq = m_qq1 + ";";
  11886. m_qq.TrimLeft(";");
  11887. m_qq += m_qq2;
  11888. m_money1.Format("%f", atof(m_taoxijiage));
  11889. m_money2.Format("%f", atof(m_payed1));
  11890. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  11891. ConvertToPrice(m_money1);
  11892. ConvertToPrice(m_money2);
  11893. ConvertToPrice(m_money3);
  11894. ////////////////////////////////////////////////////////////////
  11895. int rcpos = -1;
  11896. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  11897. m_Print.SetFontFace(17, 1, "宋体");
  11898. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11899. StrRect.top -= 0;
  11900. StrRect.bottom -= 10;
  11901. StrRect.left -= 140;
  11902. StrRect.right = StrRect.left + 48;
  11903. m_Print.SetFontFace(15, 1, "宋体");
  11904. m_Print.SetColor(0xffffff);
  11905. m_Print.DrawRect(StrRect, 0);
  11906. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11907. StrRect.left = StrRect.right;
  11908. StrRect.right = StrRect.left + 48;
  11909. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  11910. m_Print.SetColor(0, RGB(255, 0, 0));
  11911. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11912. m_Print.SetColor(0);
  11913. m_Print.SetFontFace(12, 1, "宋体");
  11914. StrRect.left -= 48;
  11915. int hei = StrRect.Height();
  11916. StrRect.top = StrRect.bottom + 2;
  11917. StrRect.bottom += hei + 2;
  11918. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11919. StrRect.top = StrRect.bottom - 2;
  11920. StrRect.bottom += hei - 5;
  11921. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11922. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11923. m_Print.SetFontFace(12, 1, "宋体");
  11924. m_Print.DrawText((LPTSTR)(LPCTSTR)"收款单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11925. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11926. m_Print.SetFontFace(9, 1, "宋体");
  11927. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11928. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11929. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11930. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11931. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11932. m_Print.DrawRect2(StrRect, 2);
  11933. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11934. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11935. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11936. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11937. m_Print.DrawRect2(StrRect, 2);
  11938. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11939. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11940. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11941. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11942. m_Print.DrawRect2(StrRect, 2);
  11943. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11944. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11945. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11946. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11947. m_Print.DrawRect2(StrRect, 2);
  11948. ////////////
  11949. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11950. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11951. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11952. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11953. m_Print.DrawRect2(StrRect, 2);
  11954. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11955. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11956. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11957. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11958. m_Print.DrawRect2(StrRect, 2);
  11959. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11960. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11961. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11962. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11963. m_Print.DrawRect2(StrRect, 2);
  11964. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11965. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11966. StrRect = load.m_rcarray.ElementAt(++rcpos);
  11967. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11968. m_Print.DrawRect2(StrRect, 2);
  11969. for (i = 19; i < 49; i++)
  11970. {
  11971. if (i >= 44)
  11972. {
  11973. StrRect = load.m_rcarray.ElementAt(i - 5);
  11974. int hei = StrRect.Height();
  11975. StrRect.top += hei;
  11976. StrRect.bottom += hei;
  11977. }
  11978. else
  11979. StrRect = load.m_rcarray.ElementAt(i);
  11980. m_Print.DrawRect2(StrRect, 1);
  11981. }
  11982. float fmoney = 0;
  11983. for (i = 19; i < 49; i++)
  11984. {
  11985. if (i >= 44)
  11986. {
  11987. StrRect = load.m_rcarray.ElementAt(i - 5);
  11988. int hei = StrRect.Height();
  11989. StrRect.top += hei;
  11990. StrRect.bottom += hei;
  11991. }
  11992. else
  11993. StrRect = load.m_rcarray.ElementAt(i);
  11994. StrRect.left += 2;
  11995. /* if((i-19)%5==2)
  11996. {
  11997. fmoney+=atof(pArray->ElementAt (i-19));
  11998. }*/
  11999. m_Print.DrawText((LPTSTR)(LPCTSTR)(pArray->ElementAt(i - 19)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12000. }
  12001. m_money2.Format("%f", money);
  12002. ConvertToPrice(m_money2);
  12003. StrRect = load.m_rcarray.ElementAt(44);
  12004. CString str;
  12005. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 实收¥: %s 元 收银员: %s", \
  12006. GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
  12007. m_money2, g_user.name);
  12008. m_Print.DrawRect2(StrRect, 1);
  12009. StrRect.left += 3;
  12010. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12011. StrRect = load.m_rcarray.ElementAt(46);
  12012. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12013. StrRect = load.m_rcarray.ElementAt(47);
  12014. m_Print.DrawRect2(StrRect, 2);
  12015. StrRect = load.m_rcarray.ElementAt(48);
  12016. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12017. StrRect = load.m_rcarray.ElementAt(45);
  12018. str = "\
  12019. 顾客须知\r\n\
  12020. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  12021. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  12022. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  12023. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  12024. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  12025. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  12026. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  12027. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12028. AutoDraw(m_Print, StrRect, str, 1.8);
  12029. PrintPreview dlg;
  12030. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12031. dlg.m_pDC = m_Print.GetPDC();
  12032. if (aa == 0)
  12033. {
  12034. if (dlg.DoModal() != IDOK)
  12035. return;
  12036. printcot = dlg.m_num;
  12037. }
  12038. //结束打印
  12039. m_Print.EndPage();
  12040. m_Print.EndPrint();
  12041. }
  12042. }
  12043. void CMainFrame::PrintReceipt2(CString strOrderNumber)
  12044. {
  12045. int printcot = 1;
  12046. for (int aa = 0; aa < printcot; aa++)
  12047. {
  12048. g_sendhead.bsql = 0;
  12049. g_sendhead.code[0] = 24;
  12050. g_sendhead.tabcount = 1;
  12051. int g_nYearposTemp = g_nYearpos;
  12052. g_nYearpos = -1;
  12053. g_pMainWnd->ProcessChatMessageRequest2(1);
  12054. g_nYearpos = g_nYearposTemp;
  12055. if (0 == g_bSendOK)return;
  12056. DataToArray(&g_cominfoarray);
  12057. CString SerialNo;
  12058. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
  12059. CPrintRX m_Print;
  12060. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12061. {
  12062. m_Print.InitToPrint(NULL, 1);
  12063. }
  12064. else
  12065. {
  12066. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  12067. if (name.IsEmpty())
  12068. m_Print.InitToPrint(NULL, 1);
  12069. else
  12070. {
  12071. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12072. if (nret == -1 && aa == 0)
  12073. {
  12074. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12075. }
  12076. }
  12077. }
  12078. m_Print.StartPrint();
  12079. m_Print.StartPage();
  12080. LoadRect load;
  12081. load.SetLiaPath("14.lia");
  12082. load.SetMargins(0, 0);
  12083. if (!load.Load())return;
  12084. int i;
  12085. //////////////////////////////////////////////////////////////
  12086. CStringArray txarray;
  12087. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  12088. g_sendhead.code[0] = 11;
  12089. g_sendhead.code[1] = 52;
  12090. g_sendhead.code[2] = 93;
  12091. g_sendhead.tabcount = 3;
  12092. g_sendhead.bsql = 0;
  12093. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12094. CArray<CStringArray, CStringArray>sparray;
  12095. CArray<CStringArray, CStringArray>clientarray;
  12096. CArray<CStringArray, CStringArray>moneyarray;
  12097. DataToArray(&g_List1array, &clientarray, &moneyarray);
  12098. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12099. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12100. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12101. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12102. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12103. CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  12104. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12105. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12106. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12107. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12108. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12109. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12110. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12111. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12112. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12113. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12114. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12115. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12116. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12117. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12118. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12119. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12120. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12121. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12122. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12123. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12124. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12125. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12126. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  12127. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12128. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12129. CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
  12130. CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
  12131. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  12132. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  12133. CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
  12134. CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
  12135. CString m_addr = m_addr1 + ";";
  12136. m_addr.TrimLeft(";");
  12137. m_addr += m_addr2;
  12138. CString m_qq = m_qq1 + ";";
  12139. m_qq.TrimLeft(";");
  12140. m_qq += m_qq2;
  12141. m_money1.Format("%f", atof(m_taoxijiage));
  12142. m_money2 = "0";
  12143. for (i = 0; i < moneyarray.GetSize(); i++)
  12144. {
  12145. if (moneyarray.ElementAt(i).ElementAt(5) == "预约收款")
  12146. m_money2 = moneyarray.ElementAt(i).ElementAt(1);
  12147. }
  12148. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  12149. ConvertToPrice(m_money1);
  12150. ConvertToPrice(m_money2);
  12151. ConvertToPrice(m_money3);
  12152. ////////////////////////////////////////////////////////////////
  12153. int rcpos = -1;
  12154. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12155. m_Print.SetFontFace(17, 1, "宋体");
  12156. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12157. StrRect.top -= 0;
  12158. StrRect.bottom -= 10;
  12159. StrRect.left -= 140;
  12160. StrRect.right = StrRect.left + 48;
  12161. m_Print.SetFontFace(15, 1, "宋体");
  12162. m_Print.SetColor(0xffffff);
  12163. m_Print.DrawRect(StrRect, 0);
  12164. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12165. StrRect.left = StrRect.right;
  12166. StrRect.right = StrRect.left + 48;
  12167. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12168. m_Print.SetColor(0, RGB(255, 0, 0));
  12169. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12170. m_Print.SetColor(0);
  12171. m_Print.SetFontFace(12, 1, "宋体");
  12172. StrRect.left -= 48;
  12173. int hei = StrRect.Height();
  12174. StrRect.top = StrRect.bottom + 2;
  12175. StrRect.bottom += hei + 2;
  12176. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12177. StrRect.top = StrRect.bottom - 2;
  12178. StrRect.bottom += hei - 5;
  12179. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12180. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12181. m_Print.SetFontFace(12, 1, "宋体");
  12182. m_Print.DrawText((LPTSTR)(LPCTSTR)"定金单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12183. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12184. m_Print.SetFontFace(9, 1, "宋体");
  12185. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12186. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12187. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12188. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12189. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12190. m_Print.DrawRect2(StrRect, 2);
  12191. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12192. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12193. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12194. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12195. m_Print.DrawRect2(StrRect, 2);
  12196. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12197. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12198. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12199. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12200. m_Print.DrawRect2(StrRect, 2);
  12201. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12202. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12203. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12204. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12205. m_Print.DrawRect2(StrRect, 2);
  12206. ////////////
  12207. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12208. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12209. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12210. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12211. m_Print.DrawRect2(StrRect, 2);
  12212. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12213. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12214. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12215. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12216. m_Print.DrawRect2(StrRect, 2);
  12217. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12218. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12219. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12220. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12221. m_Print.DrawRect2(StrRect, 2);
  12222. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12223. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12224. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12225. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12226. m_Print.DrawRect2(StrRect, 2);
  12227. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12228. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12229. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12230. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12231. m_Print.DrawRect2(StrRect, 2);
  12232. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12233. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12234. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12235. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12236. m_Print.DrawRect2(StrRect, 2);
  12237. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12238. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/MSN:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12239. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12240. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12241. m_Print.DrawRect2(StrRect, 2);
  12242. CStringArray strarray;
  12243. strarray.Add("套系名称");
  12244. strarray.Add("总 额");
  12245. strarray.Add("定 金");
  12246. strarray.Add("余 款");
  12247. strarray.Add("摄影日期");
  12248. strarray.Add(m_taoxiname);
  12249. strarray.Add(m_money1);
  12250. strarray.Add(m_money2);
  12251. strarray.Add(m_money3);
  12252. strarray.Add(m_time2);
  12253. for (i = 25; i < 37; i++)
  12254. {
  12255. StrRect = load.m_rcarray.ElementAt(i);
  12256. m_Print.DrawRect2(StrRect, 1);
  12257. }
  12258. for (i = 25; i < 35; i++)
  12259. {
  12260. StrRect = load.m_rcarray.ElementAt(i);
  12261. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 25), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12262. }
  12263. StrRect = load.m_rcarray.ElementAt(35);
  12264. StrRect.left += 5;
  12265. StrRect.top += 5;
  12266. m_Print.DrawText((LPTSTR)(LPCTSTR)" 备 注:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  12267. StrRect = load.m_rcarray.ElementAt(36);
  12268. CString str;
  12269. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 ¥: %s 元 收银员: %s", \
  12270. GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
  12271. m_money2, g_user.name);
  12272. StrRect.left += 3;
  12273. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12274. StrRect = load.m_rcarray.ElementAt(38);
  12275. m_Print.DrawText((LPTSTR)(LPCTSTR)"营业员:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12276. StrRect = load.m_rcarray.ElementAt(39);
  12277. m_Print.DrawText((LPTSTR)(LPCTSTR)m_ren, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12278. m_Print.DrawRect2(StrRect, 2);
  12279. StrRect = load.m_rcarray.ElementAt(40);
  12280. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12281. StrRect = load.m_rcarray.ElementAt(41);
  12282. m_Print.DrawRect2(StrRect, 2);
  12283. StrRect = load.m_rcarray.ElementAt(42);
  12284. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12285. StrRect = load.m_rcarray.ElementAt(37);
  12286. str = "\
  12287. 顾客须知\r\n\
  12288. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  12289. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  12290. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  12291. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  12292. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  12293. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  12294. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  12295. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12296. AutoDraw(m_Print, StrRect, str, 1.8);
  12297. PrintPreview dlg;
  12298. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12299. dlg.m_pDC = m_Print.GetPDC();
  12300. if (aa == 0)
  12301. {
  12302. if (dlg.DoModal() != IDOK)
  12303. return;
  12304. printcot = dlg.m_num;
  12305. }
  12306. //结束打印
  12307. m_Print.EndPage();
  12308. m_Print.EndPrint();
  12309. }
  12310. }
  12311. void CMainFrame::OnAutodelphoto()
  12312. {
  12313. // TODO: Add your command handler code here
  12314. if (g_user.bLongin == 0)
  12315. {
  12316. if (g_bNoLoginLia)
  12317. {
  12318. Login dlg;
  12319. dlg.SetLiaPath("5.lia");
  12320. dlg.DoModal();
  12321. }
  12322. else
  12323. {
  12324. Login3 dlg;
  12325. dlg.SetLiaPath("5.lia");
  12326. dlg.DoModal();
  12327. }
  12328. if (g_user.bLongin == 0)return;
  12329. }
  12330. if (IsHasRightsnew(49) == 0)return;
  12331. DelPhotoSet dlg;
  12332. dlg.DoModal();
  12333. }
  12334. void CMainFrame::Onphotomanage() // 客照管理中心;
  12335. {
  12336. if (g_user.bLongin == 0)
  12337. {
  12338. if (g_bNoLoginLia)
  12339. {
  12340. Login dlg;
  12341. dlg.SetLiaPath("5.lia");
  12342. dlg.DoModal();
  12343. }
  12344. else
  12345. {
  12346. Login3 dlg;
  12347. dlg.SetLiaPath("5.lia");
  12348. dlg.DoModal();
  12349. }
  12350. if (g_user.bLongin == 0)return;
  12351. }
  12352. if (IsHasRightsnew(49) == 0)return;
  12353. ShowPic3 dlg;
  12354. dlg.DoModal();
  12355. }
  12356. void CMainFrame::OnCompanyinfo()
  12357. {
  12358. // TODO: Add your command handler code here
  12359. if (g_user.bLongin == 0)
  12360. {
  12361. if (g_bNoLoginLia)
  12362. {
  12363. Login dlg;
  12364. dlg.SetLiaPath("5.lia");
  12365. dlg.DoModal();
  12366. }
  12367. else
  12368. {
  12369. Login3 dlg;
  12370. dlg.SetLiaPath("5.lia");
  12371. dlg.DoModal();
  12372. }
  12373. if (g_user.bLongin == 0)return;
  12374. }
  12375. if (IsHasRightsnew(49) == 0)return;
  12376. CompanyInfo dlg;
  12377. dlg.DoModal();
  12378. }
  12379. void CMainFrame::OnTaoxifg()
  12380. {
  12381. // TODO: Add your command handler code here
  12382. if (g_user.bLongin == 0)
  12383. {
  12384. if (g_bNoLoginLia)
  12385. {
  12386. Login dlg;
  12387. dlg.SetLiaPath("5.lia");
  12388. dlg.DoModal();
  12389. }
  12390. else
  12391. {
  12392. Login3 dlg;
  12393. dlg.SetLiaPath("5.lia");
  12394. dlg.DoModal();
  12395. }
  12396. if (g_user.bLongin == 0)return;
  12397. }
  12398. if (IsHasRightsnew(49) == 0)return;
  12399. TXFG dlg;
  12400. dlg.DoModal();
  12401. }
  12402. void CMainFrame::OnHelpfile()
  12403. {
  12404. // TODO: Add your command handler code here
  12405. // ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  12406. // if(::PathFileExists (g_mainpath+"\\zx.dll"))
  12407. // ShellExecute(NULL, _T("open"), _T("www.zcsmkj.com"), "", NULL, SW_SHOWNORMAL);
  12408. // else
  12409. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  12410. }
  12411. void CMainFrame::OnPhotobak()
  12412. {
  12413. // TODO: Add your command handler code here
  12414. if (g_user.bLongin == 0)
  12415. {
  12416. if (g_bNoLoginLia)
  12417. {
  12418. Login dlg;
  12419. dlg.SetLiaPath("5.lia");
  12420. dlg.DoModal();
  12421. }
  12422. else
  12423. {
  12424. Login3 dlg;
  12425. dlg.SetLiaPath("5.lia");
  12426. dlg.DoModal();
  12427. }
  12428. if (g_user.bLongin == 0)return;
  12429. }
  12430. if (IsHasRightsnew(49) == 0)return;
  12431. PhotoBak dlg;
  12432. dlg.DoModal();
  12433. }
  12434. //客户报表
  12435. void CMainFrame::OnClose2()
  12436. { // TODO: Add your message handler code here and/or call default
  12437. if (AfxMessageBox("是否退出系统?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
  12438. if(g_user.bLongin)
  12439. WriteLog("退出系统!", "退出系统!");
  12440. g_bShowBar = 0;
  12441. if (m_Mdi.MainClose())
  12442. CMDIFrameWnd::OnClose();
  12443. }
  12444. //
  12445. void CMainFrame::ResetTimer()
  12446. {
  12447. }
  12448. void CMainFrame::LinkClick(CString str, int nParent)
  12449. {
  12450. g_pMainWnd2->m_bar.LinkClick(str);
  12451. }
  12452. void CMainFrame::PrintFlowChart2(CString m_id)
  12453. {
  12454. CPrintRX m_Print;
  12455. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12456. {
  12457. m_Print.InitToPrint(NULL, 1);
  12458. }
  12459. else
  12460. {
  12461. CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
  12462. if (name.IsEmpty())
  12463. m_Print.InitToPrint(NULL, 1);
  12464. else
  12465. {
  12466. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12467. if (nret == -1)
  12468. {
  12469. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12470. }
  12471. }
  12472. }
  12473. m_Print.StartPrint();
  12474. m_Print.StartPage();
  12475. LoadRect load;
  12476. load.SetLiaPath("16.lia");
  12477. load.SetMargins(0, 0);
  12478. if (!load.Load())return;
  12479. LoadRect load2;
  12480. load2.SetLiaPath("17.lia");
  12481. load2.SetMargins(0, 660);
  12482. if (!load2.Load())return;
  12483. int i;
  12484. //////////////////////////////////////////////////////////////
  12485. CStringArray txarray;
  12486. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and kind<>'2'";
  12487. g_sendhead.code[0] = 11;
  12488. g_sendhead.code[1] = 52;
  12489. g_sendhead.code[2] = 223;
  12490. g_sendhead.tabcount = 3;
  12491. g_sendhead.bsql = 0;
  12492. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  12493. CArray<CStringArray, CStringArray>sparray;
  12494. CArray<CStringArray, CStringArray>clientarray;
  12495. DataToArray(&g_List1array, &clientarray, &sparray);
  12496. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  12497. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  12498. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  12499. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  12500. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  12501. CString m_photocount = g_List1array.ElementAt(0).ElementAt(9);
  12502. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  12503. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  12504. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  12505. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  12506. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  12507. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  12508. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  12509. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  12510. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  12511. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  12512. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  12513. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  12514. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  12515. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  12516. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  12517. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  12518. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  12519. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  12520. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  12521. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  12522. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  12523. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  12524. CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(39) + g_List1array.ElementAt(0).ElementAt(75);
  12525. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  12526. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  12527. CString spno;
  12528. for (i = 0; i < sparray.GetSize(); i++)
  12529. {
  12530. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12531. if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
  12532. if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
  12533. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  12534. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  12535. spno += sparray.ElementAt(i).ElementAt(5);
  12536. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
  12537. spno += "; ";
  12538. else
  12539. {
  12540. spno += ":";
  12541. spno += sparray.ElementAt(i).ElementAt(6);
  12542. spno += "; ";
  12543. }
  12544. }
  12545. spno += " 加挑:";
  12546. for (i = 0; i < sparray.GetSize(); i++)
  12547. {
  12548. if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
  12549. if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
  12550. if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
  12551. if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
  12552. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
  12553. spno += sparray.ElementAt(i).ElementAt(5);
  12554. if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
  12555. spno += "; ";
  12556. else
  12557. {
  12558. spno += ":";
  12559. spno += sparray.ElementAt(i).ElementAt(6);
  12560. spno += "; ";
  12561. }
  12562. }
  12563. if (spno.Right(6) == " 加挑:")
  12564. {
  12565. spno = spno.Left(spno.GetLength() - 6);
  12566. }
  12567. ////////////////////////////////////////////////////////////////
  12568. int rcpos = -1;
  12569. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12570. m_Print.SetFontFace(17, 1, "宋体");
  12571. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12572. StrRect.top -= 0;
  12573. StrRect.bottom -= 10;
  12574. StrRect.left -= 140;
  12575. StrRect.right = StrRect.left + 48;
  12576. m_Print.SetFontFace(15, 1, "宋体");
  12577. m_Print.SetColor(0xffffff);
  12578. m_Print.DrawRect(StrRect, 0);
  12579. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12580. StrRect.left = StrRect.right;
  12581. StrRect.right = StrRect.left + 48;
  12582. m_Print.DrawRect(StrRect, RGB(255, 0, 0));
  12583. m_Print.SetColor(0, RGB(255, 0, 0));
  12584. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12585. m_Print.SetColor(0);
  12586. m_Print.SetFontFace(12, 1, "宋体");
  12587. StrRect.left -= 48;
  12588. int hei = StrRect.Height();
  12589. StrRect.top = StrRect.bottom + 2;
  12590. StrRect.bottom += hei + 2;
  12591. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12592. StrRect.top = StrRect.bottom - 2;
  12593. StrRect.bottom += hei - 5;
  12594. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12595. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12596. m_Print.SetFontFace(12, 1, "宋体");
  12597. m_Print.DrawText((LPTSTR)(LPCTSTR)"加做取件单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12598. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12599. m_Print.SetFontFace(11, 1, "宋体");
  12600. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + m_id), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12601. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12602. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12603. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12604. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12605. m_Print.DrawRect2(StrRect, 2);
  12606. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12607. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12608. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12609. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12610. m_Print.DrawRect2(StrRect, 2);
  12611. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12612. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12613. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12614. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time4, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12615. m_Print.DrawRect2(StrRect, 2);
  12616. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12617. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12618. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12619. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12620. m_Print.DrawRect2(StrRect, 2);
  12621. ////////////
  12622. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12623. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12624. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12625. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12626. m_Print.DrawRect2(StrRect, 2);
  12627. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12628. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12629. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12630. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12631. m_Print.DrawRect2(StrRect, 2);
  12632. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12633. m_Print.DrawText((LPTSTR)(LPCTSTR)"赠送张数:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12634. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12635. m_Print.DrawText((LPTSTR)(LPCTSTR)m_photocount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12636. m_Print.DrawRect2(StrRect, 2);
  12637. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12638. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12639. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12640. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12641. m_Print.DrawRect2(StrRect, 2);
  12642. ////////////
  12643. ///////////spno
  12644. CRect sprc[22];
  12645. StrRect = load.m_rcarray.ElementAt(19);
  12646. StrRect.left += 4; StrRect.right -= 3;
  12647. hei = StrRect.Height();
  12648. for (i = 0; i < 22; i++)
  12649. {
  12650. sprc[i] = StrRect;
  12651. m_Print.DrawRect2(StrRect, 1);
  12652. if (i == 0)
  12653. {
  12654. StrRect.left += 5;
  12655. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12656. StrRect.left -= 5;
  12657. }
  12658. StrRect.top = StrRect.bottom;
  12659. StrRect.bottom = StrRect.top + hei;
  12660. sprc[i].left += 4; sprc[i].right -= 3;
  12661. }
  12662. StrRect.bottom = StrRect.top + 60;
  12663. m_Print.DrawRect2(StrRect, 1);
  12664. StrRect.left += 3; StrRect.top += 3;
  12665. StrRect.right -= 3; StrRect.bottom -= 3;
  12666. AutoDraw(m_Print, StrRect, m_bz, 1.8);
  12667. CString temp, tempspno, tempbz;
  12668. CSize size;
  12669. BOOL bRun = 0;
  12670. int fontsize = 12;
  12671. ll: tempspno = spno;
  12672. m_Print.SetFontFace(fontsize, 1, "宋体");
  12673. for (i = 1; i<22; i++)
  12674. {
  12675. if (!tempspno.IsEmpty())
  12676. {
  12677. temp = tempspno;
  12678. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12679. int right = 0;
  12680. CRect temprc = sprc[i];
  12681. while (size.cx>temprc.Width())
  12682. {
  12683. right++;
  12684. temp = tempspno.Left(tempspno.GetLength() - (right));
  12685. if (GIsHalfHZ(temp))
  12686. {
  12687. right++;
  12688. temp.Delete(temp.GetLength() - 1);
  12689. }
  12690. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12691. }
  12692. if (bRun)
  12693. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12694. tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
  12695. if (tempspno.IsEmpty())i++;
  12696. }
  12697. }
  12698. if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
  12699. {
  12700. fontsize--;
  12701. goto ll;
  12702. }
  12703. if (bRun == 0)
  12704. {
  12705. bRun = 1;
  12706. goto ll;
  12707. }
  12708. m_Print.SetFontFace(12, 1, "宋体");
  12709. StrRect = load2.m_rcarray.ElementAt(1);
  12710. m_Print.DrawText((LPTSTR)(LPCTSTR)"喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12711. StrRect = load2.m_rcarray.ElementAt(2);
  12712. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12713. StrRect = load2.m_rcarray.ElementAt(3);
  12714. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12715. StrRect = load2.m_rcarray.ElementAt(4);
  12716. m_Print.DrawRect2(StrRect, 2);
  12717. StrRect = load2.m_rcarray.ElementAt(0);
  12718. CString str = "\
  12719. 爱心提示:如对制作有任何要求请清楚列出,所有制作内容一经确认将按要求制作。\r\n\
  12720. 选样文件从拍摄日期计算将保留二个月;套相成品按取件日期保留三个月,逾期不做保留。\r\n\
  12721. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12722. AutoDraw(m_Print, StrRect, str, 1.8);
  12723. PrintPreview dlg; dlg.m_mode = 2;
  12724. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12725. dlg.m_pDC = m_Print.GetPDC();
  12726. if (dlg.DoModal() != IDOK)return;
  12727. //结束打印
  12728. m_Print.EndPage();
  12729. m_Print.EndPrint();
  12730. }
  12731. //分店
  12732. CString CMainFrame::GetDanWei(CString name, CArray<CStringArray, CStringArray>*array)
  12733. {
  12734. for (int i = 0; i < array->GetSize(); i++)
  12735. {
  12736. if (name == array->ElementAt(i).ElementAt(1))
  12737. return array->ElementAt(i).ElementAt(2);
  12738. }
  12739. return "";
  12740. }
  12741. //g_sendhead
  12742. int CMainFrame::GetPort()
  12743. {
  12744. static int aaa = -1;
  12745. if (aaa == -1)
  12746. {
  12747. aaa = CTime::GetCurrentTime().GetSecond() % 7;
  12748. }
  12749. aaa++;
  12750. if (aaa >= 7)aaa = 0;
  12751. return 8387 + aaa;
  12752. }
  12753. void CMainFrame::OnShowBakState()
  12754. {
  12755. // TODO: Add your command handler code here
  12756. g_sendhead.bsql = 0;
  12757. g_sendhead.code[0] = 171;
  12758. g_sendhead.tabcount = 1;
  12759. g_pMainWnd->ProcessChatMessageRequest2(1);
  12760. if (g_bSendOK == 0)
  12761. {
  12762. return;
  12763. }
  12764. CArray<CStringArray, CStringArray>g_bakstatearray;
  12765. DataToArray(&g_bakstatearray);
  12766. while (g_bakstatearray.GetSize() > 7)
  12767. {
  12768. g_bakstatearray.RemoveAt(0);
  12769. }
  12770. int photocount = 0;
  12771. int infocount = 0;
  12772. for (int i = 0; i < g_bakstatearray.GetSize(); i++)
  12773. {
  12774. if (g_bakstatearray.ElementAt(i).ElementAt(1) != "1")photocount++;
  12775. if (g_bakstatearray.ElementAt(i).ElementAt(2) != "1")infocount++;
  12776. }
  12777. ShowBakState dlg;
  12778. dlg.m_pArray = &g_bakstatearray;
  12779. dlg.DoModal();
  12780. }
  12781. void CMainFrame::PrintReceipt2(CStringArray *pArray)
  12782. {
  12783. int i = 0;
  12784. int printcot = 1;
  12785. for (int aa = 0; aa < printcot; aa++)
  12786. {
  12787. g_sendhead.bsql = 0;
  12788. g_sendhead.code[0] = 24;
  12789. g_sendhead.tabcount = 1;
  12790. int g_nYearposTemp = g_nYearpos;
  12791. g_nYearpos = -1;
  12792. g_pMainWnd->ProcessChatMessageRequest2(1);
  12793. g_nYearpos = g_nYearposTemp;
  12794. if (0 == g_bSendOK)return;
  12795. DataToArray(&g_cominfoarray);
  12796. CString SerialNo;
  12797. SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
  12798. CPrintRX m_Print;
  12799. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12800. {
  12801. m_Print.InitToPrint(NULL, 1);
  12802. }
  12803. else
  12804. {
  12805. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  12806. if (name.IsEmpty())
  12807. m_Print.InitToPrint(NULL, 1);
  12808. else
  12809. {
  12810. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12811. if (nret == -1 && aa == 0)
  12812. {
  12813. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12814. }
  12815. }
  12816. }
  12817. m_Print.StartPrint();
  12818. m_Print.StartPage();
  12819. LoadRect load;
  12820. BOOL bSmall = 0;
  12821. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  12822. {
  12823. bSmall = 1;
  12824. load.SetLiaPath("20.lia");
  12825. }
  12826. else
  12827. load.SetLiaPath("10.lia");
  12828. if (bSmall)
  12829. load.SetMargins(-10, 0);
  12830. else
  12831. load.SetMargins(10, 0);
  12832. if (!load.Load())return;
  12833. int rcpos = -1;
  12834. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  12835. Image *pImg = NULL;
  12836. #ifdef MNLS_VERSION
  12837. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  12838. #else
  12839. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  12840. #endif
  12841. // m_Print.DrawImage(pImg, StrRect);
  12842. delete pImg;
  12843. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  12844. {
  12845. Image *pImg = NULL;
  12846. g_nSendCode = 31;
  12847. int g_nYearposTemp = g_nYearpos;
  12848. g_nYearpos = -1;
  12849. g_pMainWnd->ProcessChatMessageRequest2(1);
  12850. g_nYearpos = g_nYearposTemp;
  12851. g_nSendCode = 0;
  12852. if (g_bSendOK == 0)return;
  12853. ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
  12854. if (pImg)
  12855. {
  12856. StrRect.left = 65;
  12857. if (bSmall)StrRect.left = 55;
  12858. StrRect.top = 10;
  12859. StrRect.right = StrRect.left + 58;
  12860. StrRect.bottom = StrRect.top + 58;
  12861. m_Print.DrawImage(pImg, StrRect);
  12862. delete pImg; pImg = NULL;
  12863. }
  12864. }
  12865. if (bSmall)
  12866. {
  12867. m_Print.SetFontFace(18, 1, "黑体");
  12868. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12869. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12870. m_Print.SetFontFace(9, 1, "宋体");
  12871. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12872. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12873. m_Print.SetFontFace(6, 1, "宋体");
  12874. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12875. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12876. m_Print.SetFontFace(9, 1, "宋体");
  12877. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12878. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12879. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12880. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12881. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12882. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12883. int hei = StrRect.Height();
  12884. StrRect.bottom = StrRect.top;
  12885. StrRect.top -= 8;
  12886. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12887. m_Print.SetFontFace(10, 1, "宋体");
  12888. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12889. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12890. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12891. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12892. m_Print.SetFontFace(9, 1, "宋体");
  12893. for ( i = 7; i < 24; i++)
  12894. {
  12895. StrRect = load.m_rcarray.ElementAt(i);
  12896. m_Print.DrawRect2(StrRect, 1);
  12897. }
  12898. for (i = 9; i < 24; i++)
  12899. {
  12900. StrRect = load.m_rcarray.ElementAt(i);
  12901. StrRect.left += 2;
  12902. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12903. }
  12904. m_Print.SetFontFace(6, 1, "宋体");
  12905. for (i = 24; i < 26; i++)
  12906. {
  12907. StrRect = load.m_rcarray.ElementAt(i);
  12908. StrRect.left += 2;
  12909. if (i == 24)
  12910. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12911. else
  12912. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12913. }
  12914. }
  12915. else//大单
  12916. {
  12917. m_Print.SetFontFace(20, 1, "黑体");
  12918. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12919. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12920. m_Print.SetFontFace(11, 1, "宋体");
  12921. // StrRect=load.m_rcarray .ElementAt (++rcpos);
  12922. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12923. StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15;
  12924. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12925. int hei = StrRect.Height();
  12926. StrRect.bottom = StrRect.top;
  12927. StrRect.top -= 10;
  12928. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12929. m_Print.SetFontFace(8, 1, "宋体");
  12930. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12931. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12932. m_Print.SetFontFace(11, 1, "宋体");
  12933. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12934. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12935. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12936. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12937. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12938. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12939. m_Print.SetFontFace(13, 1, "宋体");
  12940. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12941. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12942. StrRect = load.m_rcarray.ElementAt(++rcpos);
  12943. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12944. m_Print.SetFontFace(11, 1, "宋体");
  12945. for ( i = 7; i < 24; i++)
  12946. {
  12947. StrRect = load.m_rcarray.ElementAt(i);
  12948. m_Print.DrawRect2(StrRect, 1);
  12949. }
  12950. for (i = 9; i < 24; i++)
  12951. {
  12952. StrRect = load.m_rcarray.ElementAt(i);
  12953. StrRect.left += 2;
  12954. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12955. }
  12956. m_Print.SetFontFace(8, 1, "宋体");
  12957. for (i = 24; i < 27; i++)
  12958. {
  12959. StrRect = load.m_rcarray.ElementAt(i);
  12960. StrRect.left += 2;
  12961. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12962. }
  12963. }
  12964. PrintPreview dlg;
  12965. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  12966. dlg.m_pDC = m_Print.GetPDC();
  12967. if (aa == 0)
  12968. {
  12969. if (dlg.DoModal() != IDOK)
  12970. return;
  12971. printcot = dlg.m_num;
  12972. }
  12973. //结束打印
  12974. m_Print.EndPage();
  12975. m_Print.EndPrint();
  12976. SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
  12977. CString sql;
  12978. sql.Format("update version set [serialno2]='%s'", SerialNo);
  12979. g_sendhead.bsql = 1;
  12980. g_nYearposTemp = g_nYearpos;
  12981. g_nYearpos = -1;
  12982. g_pMainWnd->ProcessChatMessageRequest2(sql);
  12983. g_nYearpos = g_nYearposTemp;
  12984. }
  12985. }
  12986. //出生年月
  12987. //第一联
  12988. void CMainFrame::OnLog()
  12989. {
  12990. // TODO: Add your command handler code here OnShowBakState
  12991. if (IsHasRightsnew(49) == 0)return;
  12992. ShowLOg dlg;
  12993. dlg.DoModal();
  12994. }
  12995. // www.lyfz.net 8888
  12996. void CMainFrame::PrintDinDan6(CString m_id)
  12997. {
  12998. // TODO: Add your control notification handler code here 预约订单
  12999. int printcot = 1;
  13000. for (int aa = 0; aa < printcot; aa++)
  13001. {
  13002. PrintPreview dlg;
  13003. CPrintRX m_Print;
  13004. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13005. {
  13006. m_Print.InitToPrint(NULL, 1);
  13007. }
  13008. else
  13009. {
  13010. CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
  13011. if (name.IsEmpty())
  13012. m_Print.InitToPrint(NULL, 1);
  13013. else
  13014. {
  13015. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13016. if (nret == -1 && aa == 0)
  13017. {
  13018. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13019. }
  13020. }
  13021. }
  13022. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
  13023. {
  13024. m_Print.StartPrint();
  13025. m_Print.StartPage();
  13026. LoadRect load;
  13027. load.SetLiaPath("6.lia");
  13028. load.SetMargins(-14, 15);
  13029. if (!load.Load())return;
  13030. LoadRect load2;
  13031. load2.SetLiaPath("7.lia");
  13032. load2.SetMargins(-14, 216 + 15);
  13033. if (!load2.Load())return;
  13034. LoadRect load3;
  13035. load3.SetLiaPath("8.lia");
  13036. load3.SetMargins(-14, 705 + 15);
  13037. if (!load3.Load())return;
  13038. int i;
  13039. //////////////////////////////////////////////////////////////
  13040. CStringArray txarray;
  13041. CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
  13042. g_sendhead.code[0] = 11;
  13043. g_sendhead.code[1] = 52;
  13044. g_sendhead.code[2] = 50;
  13045. g_sendhead.code[3] = 150;
  13046. g_sendhead.code[4] = 77;
  13047. g_sendhead.code[5] = 4;
  13048. g_sendhead.tabcount = 6;
  13049. g_sendhead.bsql = 0;
  13050. g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
  13051. CArray<CStringArray, CStringArray>sparray;
  13052. CArray<CStringArray, CStringArray>clientarray;
  13053. CArray<CStringArray, CStringArray>phonearray;
  13054. CArray<CStringArray, CStringArray>fgarray;
  13055. CArray<CStringArray, CStringArray>danweiarray;
  13056. CArray<CStringArray, CStringArray>jdarray;
  13057. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  13058. CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
  13059. CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
  13060. CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
  13061. CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
  13062. CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
  13063. CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
  13064. CString m_taoxiname;
  13065. if (m_zs.Find("\\") != -1)
  13066. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
  13067. else
  13068. m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
  13069. CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
  13070. CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
  13071. CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
  13072. CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
  13073. CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
  13074. CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
  13075. CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
  13076. CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
  13077. CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
  13078. CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
  13079. CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
  13080. CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
  13081. CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
  13082. CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
  13083. CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
  13084. CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
  13085. CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
  13086. CString m_style = g_List1array.ElementAt(0).ElementAt(30);
  13087. CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
  13088. CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
  13089. CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
  13090. CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
  13091. if (jdarray.GetSize())
  13092. {
  13093. if (m_bz.IsEmpty() == 0)
  13094. m_bz = "\r\n" + m_bz;
  13095. m_bz += "景点:";
  13096. }
  13097. for (i = 0; i < jdarray.GetSize(); i++)
  13098. {
  13099. m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
  13100. }
  13101. m_bz.TrimRight(";");
  13102. CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
  13103. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  13104. if (IsHasRights2new(31) == 0)
  13105. {
  13106. m_phone1 = "***";
  13107. m_phone2 = "***";
  13108. }
  13109. CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
  13110. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  13111. CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
  13112. CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
  13113. CString m_sex = clientarray.ElementAt(0).ElementAt(18);
  13114. CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
  13115. filter = "name='" + m_ren + "'";
  13116. g_sendhead.code[0] = 5;
  13117. g_sendhead.tabcount = 1;
  13118. g_sendhead.bsql = 0;
  13119. int g_nYearposTemp = g_nYearpos;
  13120. g_nYearpos = -1;
  13121. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13122. g_nYearpos = g_nYearposTemp;
  13123. if (g_bSendOK == 0)return;
  13124. DataToArray(&phonearray);
  13125. m_money1.Format("%f", atof(m_taoxijiage));
  13126. m_money2.Format("%f", atof(m_payed1));
  13127. m_money3.Format("%f", atof(m_money1) - atof(m_money2));
  13128. ConvertToPrice(m_money1);
  13129. ConvertToPrice(m_money2);
  13130. ConvertToPrice(m_money3);
  13131. ////////////////////////////////////////////////////////////////
  13132. int rcpos = -1;
  13133. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13134. StrRect.top -= 15; StrRect.bottom -= 15;
  13135. Image *pImg = NULL;
  13136. #ifdef MNLS_VERSION
  13137. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
  13138. #else
  13139. ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
  13140. #endif
  13141. m_Print.DrawImage(pImg, StrRect);
  13142. delete pImg;
  13143. m_Print.SetFontFace(11, 1, "宋体");
  13144. StrRect = load.m_rcarray.ElementAt(20);
  13145. StrRect.right = load.m_rcarray.ElementAt(23).right;
  13146. StrRect.top -= 18; StrRect.bottom -= 18;
  13147. CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
  13148. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13149. str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
  13150. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13151. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13152. StrRect.top -= 15; StrRect.bottom -= 15;
  13153. #ifdef MNLS_VERSION
  13154. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13155. #endif
  13156. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13157. StrRect.top -= 15; StrRect.bottom -= 15;
  13158. #ifdef MNLS_VERSION
  13159. m_Print.DrawRect(StrRect);
  13160. #endif
  13161. m_Print.SetFontFace(7, 1, "黑体");
  13162. m_Print.SetColor(0xffffff);
  13163. #ifdef MNLS_VERSION
  13164. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13165. #endif
  13166. m_Print.SetColor(0);
  13167. m_Print.SetFontFace(15, 1, "宋体");
  13168. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13169. StrRect.top -= 15; StrRect.bottom -= 15;
  13170. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同拍摄单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13171. CStringArray strarray;
  13172. strarray.Add("NO: " + m_id);
  13173. CString date;
  13174. date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
  13175. strarray.Add(date);
  13176. strarray.Add("喜爱");
  13177. strarray.Add("格调");
  13178. if (fgarray.GetSize() == 12)
  13179. {
  13180. for (int i = 0; i < 12; i++)
  13181. strarray.Add(fgarray.ElementAt(i).ElementAt(0));
  13182. }
  13183. else
  13184. {
  13185. strarray.Add("复古典雅");
  13186. strarray.Add("温文尔雅");
  13187. strarray.Add("豪华艳丽");
  13188. strarray.Add("传统大方");
  13189. strarray.Add("新潮个性");
  13190. strarray.Add("浪漫奔放");
  13191. strarray.Add("简单素雅");
  13192. strarray.Add("活泼俏丽");
  13193. strarray.Add("妩媚温馨");
  13194. strarray.Add("温柔贤惠");
  13195. strarray.Add("成熟感性");
  13196. strarray.Add("清纯可爱");
  13197. }
  13198. strarray.Add("姓名");
  13199. // strarray.Add("职业");
  13200. strarray.Add("");
  13201. strarray.Add("地址");
  13202. strarray.Add("电话");
  13203. #ifdef CHILD_VERSION
  13204. strarray.Add("家长");
  13205. strarray.Add("宝宝");
  13206. #else
  13207. strarray.Add("先生");
  13208. strarray.Add("女士");
  13209. #endif
  13210. m_Print.SetFontFace(11, 1, "宋体");
  13211. for (i = 0; i < strarray.GetSize(); i++)
  13212. {
  13213. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13214. if (i < 2)
  13215. {
  13216. StrRect.top -= 15; StrRect.bottom -= 15;
  13217. }
  13218. if (i>15)
  13219. m_Print.DrawRect2(StrRect, 1);
  13220. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13221. }
  13222. for (i = 29; i <= 40; i++)
  13223. {
  13224. if (m_style.GetLength() <= (i - 29))continue;
  13225. if (m_style.GetAt(i - 29) != '1')continue;
  13226. StrRect = load.m_rcarray.ElementAt(i - 1);
  13227. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13228. }
  13229. for (i = 27; i <= 48; i++)
  13230. {
  13231. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13232. m_Print.DrawRect2(StrRect, 1);
  13233. }
  13234. #ifdef CHILD_VERSION
  13235. StrRect = load.m_rcarray.ElementAt(45);
  13236. StrRect.right = StrRect.left + 62;
  13237. m_Print.DrawRect2(StrRect, 1);
  13238. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13239. StrRect.left = StrRect.right;
  13240. StrRect.right = StrRect.left + 62;
  13241. m_Print.DrawRect2(StrRect, 1);
  13242. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13243. StrRect.left = StrRect.right;
  13244. StrRect.right = StrRect.left + 62;
  13245. m_Print.DrawRect2(StrRect, 1);
  13246. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13247. StrRect.left = StrRect.right;
  13248. StrRect.right = StrRect.left + 62;
  13249. m_Print.DrawRect2(StrRect, 1);
  13250. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13251. #endif
  13252. /////////////////////////
  13253. strarray.RemoveAll();
  13254. CString temp;
  13255. temp.Format("拍摄 选 %d 款,其中", atoi(m_outside) + atoi(m_outside2));
  13256. strarray.Add(temp);
  13257. temp.Format("内景 %d 款,外景 %d 款.", atoi(m_outside2), atoi(m_outside));
  13258. strarray.Add(temp);
  13259. strarray.Add("化妆");
  13260. strarray.Add("造型");
  13261. #ifdef CHILD_VERSION
  13262. strarray.Add("");
  13263. #else
  13264. strarray.Add("婚纱");
  13265. #endif
  13266. strarray.Add("服饰");
  13267. strarray.Add("配");
  13268. strarray.Add("置");
  13269. strarray.Add("其");
  13270. strarray.Add("它");
  13271. strarray.Add("套系名称");
  13272. strarray.Add("镜款");
  13273. strarray.Add("套系总价");
  13274. strarray.Add("主摄影师");
  13275. strarray.Add("拍摄日期");
  13276. strarray.Add("定金");
  13277. #ifdef CHILD_VERSION
  13278. strarray.Add("主引导师");
  13279. #else
  13280. strarray.Add("主化妆师");
  13281. #endif
  13282. strarray.Add("看样日期");
  13283. strarray.Add("补 余 款");
  13284. strarray.Add("总监");
  13285. strarray.Add("取件日期");
  13286. rcpos = -1;
  13287. for (i = 0; i < strarray.GetSize(); i++)
  13288. {
  13289. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  13290. if (i>9)
  13291. m_Print.DrawRect2(StrRect, 1);
  13292. #ifdef CHILD_VERSION
  13293. if (i == 5)
  13294. StrRect.top -= StrRect.Height();
  13295. #endif
  13296. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13297. }
  13298. for (i = 22; i <= 41; i++)
  13299. {
  13300. StrRect = load2.m_rcarray.ElementAt(++rcpos);
  13301. m_Print.DrawRect2(StrRect, 1);
  13302. }
  13303. /////////////////////////////
  13304. strarray.RemoveAll();
  13305. #ifdef CHILD_VERSION
  13306. strarray.Add("顾客方 家长:");
  13307. strarray.Add("宝宝:");
  13308. #else
  13309. strarray.Add("顾客方 先生:");
  13310. strarray.Add("女士:");
  13311. #endif
  13312. strarray.Add("电话:");
  13313. strarray.Add("影楼方 店长:");
  13314. strarray.Add("接单人:");
  13315. strarray.Add("电话:");
  13316. rcpos = -1;
  13317. for (i = 0; i < strarray.GetSize(); i++)
  13318. {
  13319. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  13320. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13321. }
  13322. for (i = 7; i <= 12; i++)
  13323. {
  13324. StrRect = load3.m_rcarray.ElementAt(++rcpos);
  13325. // if(i!=10)
  13326. m_Print.DrawRect2(StrRect, 2);
  13327. }
  13328. //////////////////////////////////////
  13329. //开始打数据
  13330. strarray.RemoveAll();
  13331. strarray.Add(m_name1);
  13332. strarray.Add(m_name2);
  13333. strarray.Add("");
  13334. strarray.Add("");
  13335. strarray.Add(m_addr1);
  13336. #ifdef CHILD_VERSION
  13337. strarray.Add("");
  13338. #else
  13339. strarray.Add(m_addr2);
  13340. #endif
  13341. strarray.Add(m_phone1);
  13342. strarray.Add(m_phone2);
  13343. for (i = 41; i <= 48; i++)
  13344. {
  13345. StrRect = load.m_rcarray.ElementAt(i - 1);
  13346. StrRect.left += 4;
  13347. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13348. }
  13349. ///////////////////////////////
  13350. strarray.RemoveAll();
  13351. strarray.Add(m_money1);
  13352. strarray.Add(m_waiter1);
  13353. strarray.Add(m_time2);
  13354. strarray.Add(m_money2);
  13355. strarray.Add(m_waiter2);
  13356. strarray.Add(m_time4);
  13357. strarray.Add(m_money3);
  13358. strarray.Add("");
  13359. strarray.Add(m_time5);
  13360. for (i = 32; i <= 40; i++)
  13361. {
  13362. StrRect = load2.m_rcarray.ElementAt(i - 1);
  13363. StrRect.left += 4;
  13364. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13365. }
  13366. ///////////////////////////////
  13367. strarray.RemoveAll();
  13368. strarray.Add("");//m_name1);
  13369. strarray.Add("");//m_name2);
  13370. CString phone;
  13371. if (m_phone1.IsEmpty() == 0)
  13372. phone = m_phone1 + ",";
  13373. phone += m_phone2;
  13374. phone.TrimRight(",");
  13375. strarray.Add("");//phone);
  13376. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
  13377. strarray.Add(m_ren);
  13378. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13379. for (i = 7; i <= 12; i++)
  13380. {
  13381. StrRect = load3.m_rcarray.ElementAt(i - 1);
  13382. StrRect.left += 4;
  13383. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13384. }
  13385. StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
  13386. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13387. StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
  13388. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13389. StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
  13390. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13391. //////////////////////////////
  13392. //开始画文字
  13393. StrRect = load2.m_rcarray.ElementAt(30);
  13394. StrRect.left += 3;
  13395. StrRect.top += 3;
  13396. StrRect.right -= 2;
  13397. StrRect.bottom -= 2;
  13398. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  13399. StrRect = load2.m_rcarray.ElementAt(29);
  13400. StrRect.left += 3;
  13401. StrRect.top += 3;
  13402. StrRect.right -= 2;
  13403. StrRect.bottom -= 2;
  13404. str = "";
  13405. for (i = 0; i < sparray.GetSize(); i++)
  13406. {
  13407. str += sparray.ElementAt(i).ElementAt(5);
  13408. str += " 数量:";
  13409. str += sparray.ElementAt(i).ElementAt(3);
  13410. str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
  13411. str += "\r\n";
  13412. }
  13413. str.TrimRight("\r\n");
  13414. AutoDraw(m_Print, StrRect, str, 1.4);
  13415. StrRect = load2.m_rcarray.ElementAt(40);
  13416. StrRect.top += 8;
  13417. m_Print.SetFontFace(12, 1, "黑体");
  13418. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  13419. StrRect.left += 3;
  13420. StrRect.top += 30;
  13421. StrRect.right -= 2;
  13422. StrRect.bottom -= 2;
  13423. str = g_cominfoarray.ElementAt(0).ElementAt(37);
  13424. if (str.IsEmpty())
  13425. {
  13426. str = "\
  13427. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  13428. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  13429. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  13430. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  13431. 持良好的心境.\r\n\
  13432. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  13433. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  13434. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  13435. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  13436. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  13437. 勿进影室, 以免影响拍摄.\r\n\
  13438. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  13439. 师或店长沟通.\r\n\
  13440. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  13441. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  13442. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  13443. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  13444. 9. 本合同余额欠款须在拍照前付清.\r\n\
  13445. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  13446. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  13447. 还.";
  13448. }
  13449. AutoDraw(m_Print, StrRect, str, 1.8);
  13450. }
  13451. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13452. dlg.m_pDC = m_Print.GetPDC();
  13453. dlg.m_mode = 1;
  13454. if (aa == 0)
  13455. {
  13456. if (dlg.DoModal() != IDOK)
  13457. return;
  13458. printcot = dlg.m_num;
  13459. }
  13460. //结束打印
  13461. m_Print.EndPage();
  13462. m_Print.EndPrint();
  13463. }
  13464. }
  13465. void CMainFrame::InsideMsg()
  13466. {
  13467. ///内部消息
  13468. CString str;
  13469. g_sendhead.bsql = 0;
  13470. g_sendhead.code[0] = 126;
  13471. g_sendhead.tabcount = 1;
  13472. g_bNoConnDlg = 1;
  13473. g_pMainWnd->ProcessChatMessageRequest2(1); g_bNoConnDlg = 0;
  13474. if (g_bSendOK == 0)return;
  13475. CArray<CStringArray, CStringArray>m_List1array;
  13476. DataToArray(&g_List1array);//, &m_List1array);
  13477. int i = 0;
  13478. m_List1array.SetSize(g_List1array.GetSize());
  13479. for ( i = 0; i < g_List1array.GetSize(); i++)
  13480. {
  13481. m_List1array.ElementAt(i).Copy(g_List1array.ElementAt(i));
  13482. }
  13483. str = "," + g_user.name + ",";
  13484. for (i = g_List1array.GetSize() - 1; i >= 0; i--)
  13485. {
  13486. CString receivers2 = g_List1array.ElementAt(i).ElementAt(4);
  13487. receivers2.TrimLeft(",");
  13488. receivers2.TrimRight(",");
  13489. receivers2 = "," + receivers2 + ",";
  13490. CString receivers = g_List1array.ElementAt(i).ElementAt(3);
  13491. receivers.TrimLeft(",");
  13492. receivers.TrimRight(",");
  13493. receivers = "," + receivers + ",";
  13494. if (receivers.Find(str) == -1)
  13495. g_List1array.RemoveAt(i);
  13496. else if (receivers2.Find(str) != -1)
  13497. g_List1array.RemoveAt(i);
  13498. }
  13499. if (g_List1array.GetSize())
  13500. {
  13501. ShowMsg dlg;
  13502. dlg.DoModal();
  13503. }
  13504. for (i = m_List1array.GetSize() - 1; i >= 0; i--)
  13505. {
  13506. CString receivers2 = m_List1array.ElementAt(i).ElementAt(4);
  13507. receivers2.TrimLeft(",");
  13508. receivers2.TrimRight(",");
  13509. receivers2 = "," + receivers2 + ",";
  13510. CString receivers = m_List1array.ElementAt(i).ElementAt(3);
  13511. if (receivers != "")
  13512. m_List1array.RemoveAt(i);
  13513. else if (receivers2.Find(str) != -1)
  13514. m_List1array.RemoveAt(i);
  13515. }
  13516. if (m_List1array.GetSize())
  13517. {
  13518. SendInsideMsg2 dlg;
  13519. dlg.m_bShow = 1;
  13520. dlg.m_pArray = &m_List1array;
  13521. dlg.DoModal();
  13522. }
  13523. }
  13524. //定金
  13525. /************************************************************************/
  13526. /*
  13527. 函数:PrintHireDress
  13528. 描述:打印礼服出租单;
  13529. 参数:
  13530. strOrderNumber 礼服订单号;
  13531. 注意:
  13532. */
  13533. /************************************************************************/
  13534. void CMainFrame::PrintHireDress(CString strOrderNumber) // 打印礼服出租单;
  13535. {
  13536. int printcot = 1;
  13537. for (int aa = 0; aa < printcot; aa++)
  13538. {
  13539. CPrintRX m_Print;
  13540. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13541. {
  13542. m_Print.InitToPrint(NULL, 1);
  13543. }
  13544. else
  13545. {
  13546. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13547. if (name.IsEmpty())
  13548. m_Print.InitToPrint(NULL, 1);
  13549. else
  13550. {
  13551. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13552. if (nret == -1 && aa == 0)
  13553. {
  13554. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13555. }
  13556. }
  13557. }
  13558. m_Print.StartPrint();
  13559. m_Print.StartPage();
  13560. LoadRect load;
  13561. load.SetLiaPath("21.lia");
  13562. load.SetMargins(0, 0);
  13563. if (!load.Load())
  13564. {
  13565. return;
  13566. }
  13567. int i;
  13568. //////////////////////////////////////////////////////////////
  13569. //CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  13570. CString strFilter;
  13571. strFilter.Format("id='%s';id='%s';id='%s'", strOrderNumber, strOrderNumber, strOrderNumber);
  13572. g_sendhead.bsql = 0;
  13573. g_sendhead.code[0] = 73;
  13574. g_sendhead.code[1] = 74;
  13575. g_sendhead.code[2] = 52;
  13576. g_sendhead.tabcount = 3;
  13577. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  13578. if (g_bSendOK == 0)
  13579. {
  13580. return;
  13581. }
  13582. CArray<CStringArray, CStringArray>dresshirearray;
  13583. CArray<CStringArray, CStringArray>dresshiredataarray;
  13584. CArray<CStringArray, CStringArray>clientarray;
  13585. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13586. if (dresshirearray.GetSize() == 0)
  13587. {
  13588. return;
  13589. }
  13590. CString m_remark = dresshirearray.ElementAt(0).ElementAt(10);
  13591. CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7);
  13592. CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8);
  13593. CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6);
  13594. if (clientarray.GetSize() == 0)
  13595. {
  13596. return;
  13597. }
  13598. //AfxMessageBox("打印礼服出租单-()");
  13599. CString m_name2 = clientarray.ElementAt(0).ElementAt(2);
  13600. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
  13601. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
  13602. CString m_time3 = clientarray.ElementAt(0).ElementAt(20);
  13603. //#if JEFF_TEST
  13604. // if ( dresshiredataarray.GetSize() == 0 )
  13605. // {
  13606. // AfxMessageBox("没衣服");
  13607. // }
  13608. //#endif
  13609. CString sItem;
  13610. for (i = 0; i < dresshiredataarray.GetSize(); i++)
  13611. {
  13612. sItem += "编号:";
  13613. sItem += dresshiredataarray.ElementAt(i).ElementAt(1);
  13614. sItem += " ";
  13615. sItem += " 名称:";
  13616. sItem += dresshiredataarray.ElementAt(i).ElementAt(2);
  13617. sItem += " 数量:";
  13618. sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n";
  13619. }
  13620. sItem += "金额:";
  13621. sItem += dresshirearray.ElementAt(0).ElementAt(1);
  13622. sItem += " ";
  13623. sItem += " 押金:";
  13624. sItem += dresshirearray.ElementAt(0).ElementAt(2) + "\r\n";
  13625. ////////////////////////////////////////////////////////////////
  13626. int rcpos = -1;
  13627. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13628. m_Print.SetFontFace(17, 1, "宋体");
  13629. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13630. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13631. m_Print.SetFontFace(10, 1, "宋体");
  13632. m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13633. CStringArray strarray;
  13634. strarray.Add("客户姓名");
  13635. strarray.Add("客户电话");
  13636. strarray.Add("预定日期");
  13637. strarray.Add("结婚日期");
  13638. strarray.Add("取件日期");
  13639. strarray.Add("归还日期");
  13640. strarray.Add("本店地址");
  13641. strarray.Add("电 话");
  13642. strarray.Add("客户地址");
  13643. strarray.Add("客户签名");
  13644. for (i = 2; i < 12; i++)
  13645. {
  13646. StrRect = load.m_rcarray.ElementAt(i);
  13647. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13648. }
  13649. strarray.RemoveAll();
  13650. strarray.Add(m_name2);
  13651. strarray.Add(m_phone2);
  13652. strarray.Add(m_inputdate);
  13653. strarray.Add(m_time3);
  13654. strarray.Add(m_date1);
  13655. strarray.Add(m_date2);
  13656. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
  13657. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13658. strarray.Add(m_addr2);
  13659. strarray.Add("");
  13660. for (i = 12; i < 22; i++)
  13661. {
  13662. StrRect = load.m_rcarray.ElementAt(i);
  13663. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13664. m_Print.DrawRect2(StrRect, 2);
  13665. }
  13666. for (i = 25; i < 30; i++)
  13667. {
  13668. StrRect = load.m_rcarray.ElementAt(i);
  13669. m_Print.DrawRect2(StrRect, 1);
  13670. }
  13671. StrRect = load.m_rcarray.ElementAt(22);
  13672. StrRect.top += 7;
  13673. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13674. StrRect = load.m_rcarray.ElementAt(23);
  13675. StrRect.top += 7;
  13676. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13677. StrRect = load.m_rcarray.ElementAt(24);
  13678. StrRect.top += 7;
  13679. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13680. StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
  13681. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13682. StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
  13683. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13684. StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
  13685. CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
  13686. if (str.IsEmpty())
  13687. {
  13688. str = "\
  13689. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13690. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13691. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13692. 4. 如有破损酌情赔偿.";
  13693. }
  13694. AutoDraw(m_Print, StrRect, str, 1.5);
  13695. PrintPreview dlg;
  13696. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13697. dlg.m_pDC = m_Print.GetPDC();
  13698. if (aa == 0)
  13699. {
  13700. if (dlg.DoModal() != IDOK)
  13701. return;
  13702. printcot = dlg.m_num;
  13703. }
  13704. //结束打印
  13705. m_Print.EndPage();
  13706. m_Print.EndPrint();
  13707. }
  13708. }
  13709. void CMainFrame::PrintHireDress_01(CString strOrderNumber) // 打印礼服出租单,无法改变结构,需要修改21.lia才能改变打印的布局;
  13710. {
  13711. int printcot = 1;
  13712. for (int aa = 0; aa < printcot; aa++)
  13713. {
  13714. CPrintRX m_Print;
  13715. if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13716. {
  13717. m_Print.InitToPrint(NULL, 1);
  13718. }
  13719. else
  13720. {
  13721. CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
  13722. if (name.IsEmpty())
  13723. m_Print.InitToPrint(NULL, 1);
  13724. else
  13725. {
  13726. int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13727. if (nret == -1 && aa == 0)
  13728. {
  13729. AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
  13730. m_Print.InitToPrint(NULL, 1);
  13731. }
  13732. }
  13733. }
  13734. m_Print.StartPrint();
  13735. m_Print.StartPage();
  13736. LoadRect load;
  13737. load.SetLiaPath("21.lia");
  13738. load.SetMargins(0, 0);
  13739. if (!load.Load())return;
  13740. int i;
  13741. //////////////////////////////////////////////////////////////
  13742. CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
  13743. g_sendhead.bsql = 0;
  13744. g_sendhead.code[0] = 73; // dresshire表;
  13745. g_sendhead.code[1] = 74; // dresshiredata表;
  13746. g_sendhead.code[2] = 52; // client表;
  13747. g_sendhead.tabcount = 3;
  13748. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13749. if (g_bSendOK == 0)
  13750. {
  13751. return;
  13752. }
  13753. CArray<CStringArray, CStringArray>dresshirearray;
  13754. CArray<CStringArray, CStringArray>dresshiredataarray;
  13755. CArray<CStringArray, CStringArray>clientarray;
  13756. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13757. if (dresshirearray.GetSize() == 0)return;
  13758. // dresshire;
  13759. CString m_remark = dresshirearray.ElementAt(0).ElementAt(10); // 备注;
  13760. CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7); // 取衣日期;
  13761. CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8); // 还衣日期;
  13762. CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6); // 记录日期;
  13763. CString strPrice = dresshirearray.ElementAt(0).ElementAt(1); // 金额;
  13764. CString strDeposit = dresshirearray.ElementAt(0).ElementAt(2); // 押金;
  13765. // client表;
  13766. if (clientarray.GetSize() == 0)return;
  13767. CString m_name2 = clientarray.ElementAt(0).ElementAt(2); // 女宾姓名;
  13768. CString m_phone2 = clientarray.ElementAt(0).ElementAt(4); // 女宾手机;
  13769. CString m_addr2 = clientarray.ElementAt(0).ElementAt(8); // 女宾地址;
  13770. CString m_time3 = clientarray.ElementAt(0).ElementAt(20); // 婚期;
  13771. // dresshiredata表;
  13772. CString sItem;
  13773. for (i = 0; i < dresshiredataarray.GetSize(); i++)
  13774. {
  13775. sItem += dresshiredataarray.ElementAt(i).ElementAt(1); // 礼服编号;
  13776. sItem += " ";
  13777. sItem += dresshiredataarray.ElementAt(i).ElementAt(2); // 礼服名称;
  13778. sItem += " 数量:";
  13779. sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n"; // 礼服数量;
  13780. }
  13781. sItem += " 金额:";
  13782. sItem += dresshirearray.ElementAt(0).ElementAt(1); // 出租金额;
  13783. sItem += " 押金:";
  13784. sItem += dresshirearray.ElementAt(0).ElementAt(2) + "\r\n"; // 押金;
  13785. ////////////////////////////////////////////////////////////////
  13786. int rcpos = -1;
  13787. CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
  13788. m_Print.SetFontFace(17, 1, "宋体");
  13789. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13790. StrRect = load.m_rcarray.ElementAt(++rcpos);
  13791. m_Print.SetFontFace(10, 1, "宋体");
  13792. m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13793. CStringArray strarray;
  13794. strarray.Add("客户姓名"); // 1.
  13795. strarray.Add("客户电话");
  13796. strarray.Add("预定日期");
  13797. strarray.Add("结婚日期");
  13798. strarray.Add("取件日期"); // 5.
  13799. strarray.Add("归还日期");
  13800. strarray.Add("本店地址");
  13801. strarray.Add("电 话");
  13802. strarray.Add("客户地址");
  13803. strarray.Add("客户签名"); // 10.
  13804. //strarray.Add("金额");
  13805. //strarray.Add("押金");
  13806. for( i=2; i<12; i++)
  13807. //for (i = 2; i < 14; i++)
  13808. {
  13809. StrRect = load.m_rcarray.ElementAt(i);
  13810. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13811. }
  13812. strarray.RemoveAll();
  13813. strarray.Add(m_name2);
  13814. strarray.Add(m_phone2);
  13815. strarray.Add(m_inputdate);
  13816. strarray.Add(m_time3);
  13817. strarray.Add(m_date1);
  13818. strarray.Add(m_date2);
  13819. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
  13820. strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
  13821. strarray.Add(m_addr2);
  13822. strarray.Add("");
  13823. strarray.Add(strPrice); // 金额;
  13824. strarray.Add(strDeposit); // 押金;
  13825. for( i=12; i<22; i++)
  13826. //for (i = 14; i < 24; i++)
  13827. {
  13828. StrRect = load.m_rcarray.ElementAt(i);
  13829. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13830. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 14), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13831. m_Print.DrawRect2(StrRect, 2);
  13832. }
  13833. for (i = 25; i < 30; i++)
  13834. {
  13835. StrRect = load.m_rcarray.ElementAt(i);
  13836. m_Print.DrawRect2(StrRect, 1);
  13837. }
  13838. StrRect = load.m_rcarray.ElementAt(22);
  13839. StrRect.top += 7;
  13840. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13841. StrRect = load.m_rcarray.ElementAt(23);
  13842. StrRect.top += 7;
  13843. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13844. StrRect = load.m_rcarray.ElementAt(24);
  13845. StrRect.top += 7;
  13846. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13847. StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
  13848. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13849. StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
  13850. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13851. StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
  13852. CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
  13853. if (str.IsEmpty())
  13854. {
  13855. str = "\
  13856. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13857. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13858. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13859. 4. 如有破损酌情赔偿.";
  13860. }
  13861. AutoDraw(m_Print, StrRect, str, 1.5);
  13862. PrintPreview dlg;
  13863. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13864. dlg.m_pDC = m_Print.GetPDC();
  13865. if (aa == 0)
  13866. {
  13867. if (dlg.DoModal() != IDOK)
  13868. return;
  13869. printcot = dlg.m_num;
  13870. }
  13871. //结束打印
  13872. m_Print.EndPage();
  13873. m_Print.EndPrint();
  13874. }
  13875. }
  13876. // ****************************************************************************
  13877. // Jeff:
  13878. // 函数:PrintHireDress2
  13879. // 无参;
  13880. // 调用者:DinDanFrom.cpp
  13881. // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
  13882. // 当订单数大于1000,设置连接公司服务器开关量为真;
  13883. // -----------------------------------------------------------------------------
  13884. // 修改:Jeff
  13885. // 时间:2014.10.18
  13886. // 内容:将 g_ncot 比较值改为100;
  13887. // ****************************************************************************
  13888. void CMainFrame::PrintHireDress2()
  13889. {
  13890. if (g_ncot > 100) g_bSendLYFZ = 1;
  13891. // g_pMainWnd->SetTimer (7, 3000, NULL);
  13892. }
  13893. void CMainFrame::PrintTakeForm2(CArray<CStringArray, CStringArray>*Listarray)
  13894. {
  13895. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "选片客人明细表";
  13896. int pages = Listarray->GetSize() / 46;
  13897. if (Listarray->GetSize() % 46)pages++;
  13898. for (int aa = 0; aa < pages; aa++)
  13899. {
  13900. PrintPreview dlg;
  13901. CPrintRX m_Print;
  13902. m_Print.InitToPrint(NULL, 1);
  13903. m_Print.StartPrint();
  13904. m_Print.StartPage();
  13905. CRect mainrc(0, 0, 560, 793);
  13906. float fscale;
  13907. {
  13908. int w, h;
  13909. m_Print.GetWidHei(w, h);
  13910. fscale = (float)w / (float)h;
  13911. }
  13912. mainrc.DeflateRect(25, 40, 10, 0);
  13913. CRect rc, rc2;
  13914. rc = mainrc;
  13915. rc.bottom = rc.top;
  13916. rc.top -= 20;
  13917. m_Print.SetFontFace(16, 1, "黑体");
  13918. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13919. m_Print.SetFontFace(9, 1, "宋体");
  13920. CString str;
  13921. int wid[5] = { 200, 110, 70, 85, 62 };
  13922. int hei = 16;
  13923. if (fscale > 0.71)hei = 15;
  13924. rc = mainrc;
  13925. rc.bottom = rc.top + hei;
  13926. for (int i = 0; i < 47; i++)
  13927. {
  13928. rc2.top = rc.top + i*hei;
  13929. rc2.bottom = rc.bottom + i*hei;
  13930. rc2.left = rc.left;
  13931. rc2.right = rc.left + wid[0];
  13932. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  13933. for (int j = 0; j<5; j++)
  13934. {
  13935. m_Print.DrawRect2(rc2, 1);
  13936. if (Listarray->GetSize()>aa * 46 + i)
  13937. {
  13938. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  13939. rc2.left += 3;
  13940. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13941. rc2.left -= 3;
  13942. }
  13943. rc2.left += wid[j];
  13944. rc2.right = rc2.left + wid[j + 1];
  13945. }
  13946. }
  13947. rc2.top += 2;
  13948. rc2.left += 2; rc2.right = mainrc.right + 4;
  13949. m_Print.SetFontFace(8, 1, "宋体");
  13950. str.Format(" 页:%d/%d", aa + 1, pages);
  13951. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  13952. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13953. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  13954. dlg.m_pDC = m_Print.GetPDC();
  13955. // dlg.m_mode=1;
  13956. if (aa == 0)
  13957. {
  13958. if (dlg.DoModal() != IDOK)
  13959. return;
  13960. }
  13961. //结束打印
  13962. m_Print.EndPage();
  13963. m_Print.EndPrint();
  13964. }
  13965. }
  13966. void CMainFrame::PrintTakeForm3(CArray<CStringArray, CStringArray>*Listarray)
  13967. {
  13968. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "看设计客人明细表";
  13969. int pages = Listarray->GetSize() / 46;
  13970. if (Listarray->GetSize() % 46)pages++;
  13971. for (int aa = 0; aa < pages; aa++)
  13972. {
  13973. PrintPreview dlg;
  13974. CPrintRX m_Print;
  13975. m_Print.InitToPrint(NULL, 1);
  13976. m_Print.StartPrint();
  13977. m_Print.StartPage();
  13978. CRect mainrc(0, 0, 560, 793);
  13979. float fscale;
  13980. {
  13981. int w, h;
  13982. m_Print.GetWidHei(w, h);
  13983. fscale = (float)w / (float)h;
  13984. }
  13985. mainrc.DeflateRect(25, 40, 10, 0);
  13986. CRect rc, rc2;
  13987. rc = mainrc;
  13988. rc.bottom = rc.top;
  13989. rc.top -= 20;
  13990. m_Print.SetFontFace(16, 1, "黑体");
  13991. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13992. m_Print.SetFontFace(9, 1, "宋体");
  13993. CString str;
  13994. int wid[5] = { 200, 110, 70, 85, 62 };
  13995. int hei = 16;
  13996. if (fscale > 0.71)hei = 15;
  13997. rc = mainrc;
  13998. rc.bottom = rc.top + hei;
  13999. for (int i = 0; i < 47; i++)
  14000. {
  14001. rc2.top = rc.top + i*hei;
  14002. rc2.bottom = rc.bottom + i*hei;
  14003. rc2.left = rc.left;
  14004. rc2.right = rc.left + wid[0];
  14005. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14006. for (int j = 0; j<5; j++)
  14007. {
  14008. m_Print.DrawRect2(rc2, 1);
  14009. if (Listarray->GetSize()>aa * 46 + i)
  14010. {
  14011. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14012. rc2.left += 3;
  14013. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14014. rc2.left -= 3;
  14015. }
  14016. rc2.left += wid[j];
  14017. rc2.right = rc2.left + wid[j + 1];
  14018. }
  14019. }
  14020. rc2.top += 2;
  14021. rc2.left += 2; rc2.right = mainrc.right + 4;
  14022. m_Print.SetFontFace(8, 1, "宋体");
  14023. str.Format(" 页:%d/%d", aa + 1, pages);
  14024. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14025. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14026. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14027. dlg.m_pDC = m_Print.GetPDC();
  14028. // dlg.m_mode=1;
  14029. if (aa == 0)
  14030. {
  14031. if (dlg.DoModal() != IDOK)
  14032. return;
  14033. }
  14034. //结束打印
  14035. m_Print.EndPage();
  14036. m_Print.EndPrint();
  14037. }
  14038. }
  14039. void CMainFrame::PrintTakeForm4(CArray<CStringArray, CStringArray>*Listarray)
  14040. {
  14041. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "取件客人明细表";
  14042. int pages = Listarray->GetSize() / 46;
  14043. if (Listarray->GetSize() % 46)pages++;
  14044. for (int aa = 0; aa < pages; aa++)
  14045. {
  14046. PrintPreview dlg;
  14047. CPrintRX m_Print;
  14048. m_Print.InitToPrint(NULL, 1);
  14049. m_Print.StartPrint();
  14050. m_Print.StartPage();
  14051. CRect mainrc(0, 0, 560, 793);
  14052. float fscale;
  14053. {
  14054. int w, h;
  14055. m_Print.GetWidHei(w, h);
  14056. fscale = (float)w / (float)h;
  14057. }
  14058. mainrc.DeflateRect(25, 40, 10, 0);
  14059. CRect rc, rc2;
  14060. rc = mainrc;
  14061. rc.bottom = rc.top;
  14062. rc.top -= 20;
  14063. m_Print.SetFontFace(16, 1, "黑体");
  14064. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14065. m_Print.SetFontFace(9, 1, "宋体");
  14066. CString str;
  14067. int wid[5] = { 200, 110, 70, 85, 62 };
  14068. int hei = 16;
  14069. if (fscale > 0.71)hei = 15;
  14070. rc = mainrc;
  14071. rc.bottom = rc.top + hei;
  14072. for (int i = 0; i < 47; i++)
  14073. {
  14074. rc2.top = rc.top + i*hei;
  14075. rc2.bottom = rc.bottom + i*hei;
  14076. rc2.left = rc.left;
  14077. rc2.right = rc.left + wid[0];
  14078. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14079. for (int j = 0; j<5; j++)
  14080. {
  14081. m_Print.DrawRect2(rc2, 1);
  14082. if (Listarray->GetSize()>aa * 46 + i)
  14083. {
  14084. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14085. rc2.left += 3;
  14086. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14087. rc2.left -= 3;
  14088. }
  14089. rc2.left += wid[j];
  14090. rc2.right = rc2.left + wid[j + 1];
  14091. }
  14092. }
  14093. rc2.top += 2;
  14094. rc2.left += 2; rc2.right = mainrc.right + 4;
  14095. m_Print.SetFontFace(8, 1, "宋体");
  14096. str.Format(" 页:%d/%d", aa + 1, pages);
  14097. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14098. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14099. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14100. dlg.m_pDC = m_Print.GetPDC();
  14101. // dlg.m_mode=1;
  14102. if (aa == 0)
  14103. {
  14104. if (dlg.DoModal() != IDOK)
  14105. return;
  14106. }
  14107. //结束打印
  14108. m_Print.EndPage();
  14109. m_Print.EndPrint();
  14110. }
  14111. }
  14112. void CMainFrame::PrintTakeForm5(CArray<CStringArray, CStringArray>*Listarray)
  14113. {
  14114. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "婚庆客人明细表";
  14115. int pages = Listarray->GetSize() / 46;
  14116. if (Listarray->GetSize() % 46)pages++;
  14117. for (int aa = 0; aa < pages; aa++)
  14118. {
  14119. PrintPreview dlg;
  14120. CPrintRX m_Print;
  14121. m_Print.InitToPrint(NULL, 1);
  14122. m_Print.StartPrint();
  14123. m_Print.StartPage();
  14124. CRect mainrc(0, 0, 560, 793);
  14125. float fscale;
  14126. {
  14127. int w, h;
  14128. m_Print.GetWidHei(w, h);
  14129. fscale = (float)w / (float)h;
  14130. }
  14131. mainrc.DeflateRect(25, 40, 10, 0);
  14132. CRect rc, rc2;
  14133. rc = mainrc;
  14134. rc.bottom = rc.top;
  14135. rc.top -= 20;
  14136. m_Print.SetFontFace(16, 1, "黑体");
  14137. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14138. m_Print.SetFontFace(8, 1, "宋体");
  14139. CString str;
  14140. int wid[7] = { 165, 90, 90, 45, 45, 60, 35 };
  14141. int hei = 16;
  14142. if (fscale > 0.71)hei = 15;
  14143. rc = mainrc;
  14144. rc.bottom = rc.top + hei;
  14145. for (int i = 0; i < 47; i++)
  14146. {
  14147. rc2.top = rc.top + i*hei;
  14148. rc2.bottom = rc.bottom + i*hei;
  14149. rc2.left = rc.left;
  14150. rc2.right = rc.left + wid[0];
  14151. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14152. for (int j = 0; j<7; j++)
  14153. {
  14154. m_Print.DrawRect2(rc2, 1);
  14155. if (Listarray->GetSize()>aa * 46 + i)
  14156. {
  14157. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14158. rc2.left += 3;
  14159. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14160. rc2.left -= 3;
  14161. }
  14162. rc2.left += wid[j];
  14163. rc2.right = rc2.left + wid[j + 1];
  14164. }
  14165. }
  14166. rc2.top += 2;
  14167. rc2.left += 2; rc2.right = mainrc.right + 4;
  14168. m_Print.SetFontFace(8, 1, "宋体");
  14169. str.Format(" 页:%d/%d", aa + 1, pages);
  14170. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14171. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14172. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14173. dlg.m_pDC = m_Print.GetPDC();
  14174. // dlg.m_mode=1;
  14175. if (aa == 0)
  14176. {
  14177. if (dlg.DoModal() != IDOK)
  14178. return;
  14179. }
  14180. //结束打印
  14181. m_Print.EndPage();
  14182. m_Print.EndPrint();
  14183. }
  14184. }
  14185. void CMainFrame::PrintTakeForm1(CArray<CStringArray, CStringArray>*Listarray)
  14186. {
  14187. CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "拍照客人明细表";
  14188. int pages = Listarray->GetSize() / 46;
  14189. if (Listarray->GetSize() % 46)pages++;
  14190. for (int aa = 0; aa < pages; aa++)
  14191. {
  14192. PrintPreview dlg;
  14193. CPrintRX m_Print;
  14194. m_Print.InitToPrint(NULL, 1);
  14195. m_Print.StartPrint();
  14196. m_Print.StartPage();
  14197. CRect mainrc(0, 0, 560, 793);
  14198. float fscale;
  14199. {
  14200. int w, h;
  14201. m_Print.GetWidHei(w, h);
  14202. fscale = (float)w / (float)h;
  14203. }
  14204. mainrc.DeflateRect(25, 40, 10, 0);
  14205. CRect rc, rc2;
  14206. rc = mainrc;
  14207. rc.bottom = rc.top;
  14208. rc.top -= 20;
  14209. m_Print.SetFontFace(16, 1, "黑体");
  14210. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  14211. m_Print.SetFontFace(8, 1, "宋体");
  14212. CString str;
  14213. int wid[7] = { 165, 60, 90, 60, 60, 60, 35 };
  14214. int hei = 16;
  14215. if (fscale > 0.71)hei = 15;
  14216. rc = mainrc;
  14217. rc.bottom = rc.top + hei;
  14218. for (int i = 0; i < 47; i++)
  14219. {
  14220. rc2.top = rc.top + i*hei;
  14221. rc2.bottom = rc.bottom + i*hei;
  14222. rc2.left = rc.left;
  14223. rc2.right = rc.left + wid[0];
  14224. if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
  14225. for (int j = 0; j<7; j++)
  14226. {
  14227. m_Print.DrawRect2(rc2, 1);
  14228. if (Listarray->GetSize()>aa * 46 + i)
  14229. {
  14230. str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
  14231. rc2.left += 3;
  14232. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  14233. rc2.left -= 3;
  14234. }
  14235. rc2.left += wid[j];
  14236. rc2.right = rc2.left + wid[j + 1];
  14237. }
  14238. }
  14239. rc2.top += 2;
  14240. rc2.left += 2; rc2.right = mainrc.right + 4;
  14241. m_Print.SetFontFace(8, 1, "宋体");
  14242. str.Format(" 页:%d/%d", aa + 1, pages);
  14243. str = "制表:" + g_user.name + " 日期:" + g_date + str;
  14244. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  14245. m_Print.GetWidHei(dlg.m_w, dlg.m_h);
  14246. dlg.m_pDC = m_Print.GetPDC();
  14247. // dlg.m_mode=1;
  14248. if (aa == 0)
  14249. {
  14250. if (dlg.DoModal() != IDOK)
  14251. return;
  14252. }
  14253. //结束打印
  14254. m_Print.EndPage();
  14255. m_Print.EndPrint();
  14256. }
  14257. }
  14258. void CMainFrame::ShowMonthForm2()
  14259. {
  14260. }
  14261. // dlg;