MainFrm.cpp 441 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912
  1. // MainFrm.cpp : implementation of the CMainFrame class 员工工作
  2. #include "stdafx.h"
  3. #include "YLGL.h"
  4. #include "resource.h"
  5. #include "MainFrm.h"
  6. #include <afxinet.h>
  7. #include "ConnectDlg.h"
  8. #include "SendDataDlg.h"
  9. #include "DinDanHistroy.h"
  10. #include "ShangPin.h"
  11. #include "SPLBDlg.h"
  12. #include "BuMenDlg.h"
  13. #include "Worker.h"
  14. #include "ShowPic3.h"
  15. #include "TXDlg.h"
  16. #include "TXSPDlg.h"
  17. #include "MsgReg2.h"
  18. #include "ProviderDlg.h"
  19. #include "Booking.h"
  20. #include "Booking2.h"
  21. #include "PayOutSet.h"
  22. #include "PayOutInput.h"
  23. #include "IncomeInput.h"
  24. #include "IncomeInput2.h"
  25. #include "IncomeInput3.h"
  26. #include "IncomeInput4.h"
  27. #include "DressEarlyWarning.h"
  28. #include "annualfee.h"
  29. #include "DailyForm.h"
  30. #include "MonthForm.h"
  31. #include "ProcessAlarm.h"
  32. #include "MonthForm2.h"
  33. #include "YearForm.h"
  34. #include "ClientForm.h"
  35. #include "ClientForm2.h"
  36. #include "ClientForm3.h"
  37. #include "DinDanFrom.h"
  38. #include "Satisfaction.h"
  39. #include "SatisfactionForm.h"
  40. #include "TodayForm.h"
  41. #include "WorkerReport.h"
  42. #include "TodayForm2.h"
  43. #include "SendInsideMsg2.h"
  44. #include "StoreInfoChart.h"
  45. #include "FixedAssets.h"
  46. #include "SPForm.h"
  47. #include "ShowMsg.h"
  48. #include "Account.h"
  49. #include "Login.h"
  50. #include "Login3.h"
  51. #include "Psw.h"
  52. #include "AreaDlg.h"
  53. #include "TakeFrom.h"
  54. #include "ChoosePhotoForm.h"
  55. #include "BeautifySkinFrom.h"
  56. #include "DesignFrom.h"
  57. #include "outsourcing.h"
  58. #include "ChoosePhotoSkin.h"
  59. #include "SalarySet.h"
  60. #include "SalarySet2.h"
  61. #include "MySalary.h"
  62. #include "PrintRX.h"
  63. #include "LoadRect.h"
  64. #include "PrintPreview.h"
  65. #include "SearchClient.h"
  66. #include "BeautifySkinFrom2.h"
  67. #include "FinanceForm.h"
  68. #include "PhotoPrintFrom.h"
  69. #include "SqlDlg.h"
  70. #include "YearForm2.h"
  71. #include "AreaClient.h"
  72. #include "DBConfig.h"
  73. #include "SetPathDlg2.h"
  74. #include "StaffAchievement.h"
  75. #include "BurnCD.h"
  76. #include "StaffAchievementSet.h"
  77. #include "StaffAchievementShowAll.h"
  78. #include "SelContent.h"
  79. #include "ClientMoney.h"
  80. #include "DelPhotoSet.h"
  81. #include "ompanyInfo.h"
  82. #include "ClientForm.h"
  83. #include "PhotoBak.h"
  84. #include "MsgReg.h"
  85. #include "SendMsg.h"
  86. #include "MsgSet.h"
  87. #include "ShowMember.h"
  88. #include "ShowMember2.h"
  89. #include "MemberSet.h"
  90. #include "DressManage.h"
  91. #include "ShowDress.h"
  92. #include "ShowPic.h"
  93. #include "ShowHireReg.h"
  94. #include "InputGoods.h"
  95. #include "ShowGoods.h"
  96. #include "CostCal.h"
  97. #include "Welcome.h"
  98. #include "EmployeeMsg.h"
  99. #include "TXFG.h"
  100. #include "EmployeeForm.h"
  101. #include "EmployeeForm2.h"
  102. #include "Client2Form.h"
  103. #include "Client2FormLYFZ.h"
  104. #include "OldClient.h"
  105. #include "ClientReasonChart.h"
  106. #include "ClientFromChart.h"
  107. #include "WorkMsg.h"
  108. #include "SetLoginTime.h"
  109. #include "SetLoginBan.h"
  110. #include "LoginReg.h"
  111. #include "LoginReg2.h"
  112. #include "PhoneRecord.h"
  113. #include "PhoneRecordOut.h"
  114. #include "MissCall.h"
  115. #include "InsideMsg.h"
  116. #include "Card2Reg.h"
  117. #include "Card2RegChart.h"
  118. #include "ShowMemberBlue.h"
  119. #include "Card2RegBlue.h"
  120. #include "Card2RegChartBlue.h"
  121. #include "DigitalWork.h"
  122. #include "HideWindow.h"
  123. #include "SalarySet3.h"
  124. #include "YearFormBranch.h"
  125. #include "YearFormBranch2.h"
  126. #include "Set.h"
  127. #include "DinDanFromBranch.h"
  128. #include "MemberChart.h"
  129. #include "ShowMemberMsg.h"
  130. #include "ShowBakState.h"
  131. #include "DinDanForm.h"
  132. #include "CalendarConvert.h"
  133. #include "ShowLOg.h"
  134. #include "HospitalClient.h"
  135. #include "HospitalClientAlarm.h"
  136. #include "HospitalInfoSet.h"
  137. #include "AddHospitalClient.h"
  138. #include "HospitalClientMsg.h"
  139. #if 1
  140. #include "FileManage.h"
  141. #endif
  142. #ifdef _DEBUG
  143. #define new DEBUG_NEW
  144. #undef THIS_FILE
  145. static char THIS_FILE[] = __FILE__;
  146. #endif
  147. #ifndef WINVER
  148. #define WINVER 0x0400
  149. #endif
  150. #ifndef _WIN32_WINNT
  151. #define _WIN32_WINNT 0x0400
  152. #endif
  153. #ifndef _WIN32_WINDOWS
  154. #define _WIN32_WINDOWS 0x0410
  155. #endif
  156. #ifndef _WIN32_IE
  157. #define _WIN32_IE 0x0400
  158. #endif
  159. #include "uxtheme.h "
  160. typedef HTHEME (__stdcall * POPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
  161. typedef HRESULT (__stdcall * PCLOSETHEMEDATA)(HTHEME hTheme);
  162. /************************************************************************/
  163. /*
  164. Jeff:g_conntype
  165. g_conntype == 0 :表示正常连接?(或是连接普通服务器?)
  166. g_conntype == 1 :表示连接公司服务器
  167. g_conntype == 2 :http://www.lyfz.net/download/ip.txt
  168. g_conntype == 3 :http://photo.bjlyfz.com/download/ip.txt
  169. g_conntype == 4 :
  170. */
  171. /************************************************************************/
  172. HHOOK g_hmouse=NULL; //g_sendhead zx.dll
  173. //extern void WriteClientLog(CString str); // Jeff写客户端日志;
  174. // Jeff.remark;
  175. // 函数:MouseProc
  176. // 参数:
  177. // nCode hook code
  178. // wParam message identifier
  179. // lParam mouse coordinates
  180. // 返回:
  181. //
  182. LRESULT CALLBACK MouseProc(int nCode,WPARAM wParam,LPARAM lParam)
  183. {
  184. if(g_pMainWnd)
  185. {
  186. if( atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
  187. {
  188. g_pMainWnd->KillTimer (5);
  189. g_pMainWnd->SetTimer (5, atoi(g_cominfoarray.ElementAt(0).ElementAt(134))*60*1000, NULL);
  190. }
  191. if(g_bSendLYFZ)
  192. {
  193. g_pMainWnd->KillTimer (7);
  194. g_pMainWnd->SetTimer (7, 5*60*1000, NULL);
  195. }
  196. }
  197. return CallNextHookEx(g_hmouse, nCode, wParam, lParam);
  198. }
  199. CRect g_rc;
  200. CMainFrame *g_pMainWnd=NULL;
  201. extern HWND g_hSendWnd;
  202. extern HWND g_hConnectWnd;
  203. /////////////////////////////////////////////////////////////////////////////
  204. // CMainFrame客人付款
  205. /////////////////////////////////////////////////////////////////////////////
  206. /////////////////////////////////////////////////////////////////////////////
  207. static void HandleClientNetEvent(IN SOCKET hSocket,
  208. IN ETransportEvent eEvent,
  209. IN void *pDataBuf,
  210. IN unsigned long nDataLen,
  211. IN int nError,
  212. IN void *pContext)
  213. {
  214. if( nError != TRANSPORT_OK )
  215. return;
  216. CMainFrame *pDlg = (CMainFrame *)pContext;
  217. if( NULL == pDlg )
  218. return;
  219. pDlg->ProcessNetEvent(eEvent, pDataBuf, nDataLen);
  220. }
  221. BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam)
  222. {
  223. CRect rtCtrl,rtWnd; // 子窗口,父窗口;
  224. if(hwnd)
  225. {
  226. ::GetWindowRect(hwnd,&rtCtrl); // 获取控件大小;
  227. ::GetWindowRect(GetParent(hwnd),&rtWnd); // 获取父窗口大小;
  228. // printf("Jeff:g_WidthScale=%d,g_HeightScale=%d,rtWnd.left=%d,rtWnd.top=%d\n\n",g_WidthScale,g_HeightScale,rtWnd.left,rtWnd.top);
  229. // printf("Jeff:old:ctrl.left=%d,ctrl.top=%d,ctrl.right=%d,ctrl.bottom=%d\n\n",rtCtrl.left,rtCtrl.top,rtCtrl.right,rtCtrl.bottom);
  230. rtCtrl.OffsetRect(-rtWnd.left,-rtWnd.top);
  231. float temp;
  232. temp= (float)rtCtrl.left*g_WidthScale;
  233. rtCtrl.left = (int)temp+g_dx;
  234. temp= (float)rtCtrl.top*g_HeightScale;
  235. rtCtrl.top = (int)temp+g_dy;
  236. temp = (float)rtCtrl.right*g_WidthScale;
  237. rtCtrl.right = (int)temp+g_dx;
  238. temp =(float)rtCtrl.bottom*g_HeightScale;
  239. rtCtrl.bottom =(int)temp+g_dy;
  240. //printf("Jeff:new:ctrl.left=%d,ctrl.top=%d,ctrl.right=%d,ctrl.bottom=%d\n\n",rtCtrl.left,rtCtrl.top,rtCtrl.right,rtCtrl.bottom);
  241. ::MoveWindow(hwnd,rtCtrl.left,rtCtrl.top,rtCtrl.Width(),rtCtrl.Height(),TRUE);
  242. return TRUE;
  243. }
  244. else
  245. {
  246. return FALSE;
  247. }
  248. }
  249. IMPLEMENT_DYNCREATE(CMainFrame, CMDIFrameWnd)
  250. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  251. //{{AFX_MSG_MAP(CMainFrame)
  252. ON_WM_CREATE()
  253. ON_WM_DESTROY()
  254. ON_WM_CLOSE()
  255. ON_WM_TIMER()
  256. ON_COMMAND(IDM_choosephotoskin, Onchoosephotoskin)
  257. ON_COMMAND(IDM_PATH, OnPath)
  258. ON_COMMAND(IDM_SERVER, OnServer)
  259. ON_COMMAND(IDM_SHOWHIS, OnShowhis)
  260. ON_COMMAND(IDM_StaffAchievementShow, OnStaffAchievementShow)
  261. ON_COMMAND(IDM_AUTODELPHOTO, OnAutodelphoto)
  262. ON_COMMAND(IDM_PHOTOMANAGE, Onphotomanage)
  263. ON_COMMAND(IDM_COMPANYINFO, OnCompanyinfo)
  264. ON_COMMAND(IDM_HELPFILE, OnHelpfile)
  265. ON_COMMAND(IDM_PHOTOBAK, OnPhotobak)
  266. ON_COMMAND(IDM_TAOXIFG, OnTaoxifg)
  267. ON_COMMAND(IDM_ShowBakState, OnShowBakState)
  268. ON_WM_NCLBUTTONDBLCLK()
  269. ON_WM_NCHITTEST()
  270. ON_COMMAND(IDM_LOG, OnLog)
  271. //}}AFX_MSG_MAP
  272. ON_COMMAND_RANGE(0, 50000, OnCommandMenu)
  273. END_MESSAGE_MAP()
  274. static UINT indicators[] =
  275. {
  276. ID_SEPARATOR, // status line indicator
  277. ID_INDICATOR_CAPS,
  278. ID_INDICATOR_NUM,
  279. ID_INDICATOR_SCRL,
  280. };
  281. /////////////////////////////////////////////////////////////////////////////
  282. // CMainFrame construction/destruction
  283. UINT CMainFrame::OnNcHitTest(CPoint point)
  284. {
  285. if(CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
  286. return HTCLIENT;
  287. return CWnd::OnNcHitTest(point);
  288. }
  289. void CMainFrame::OnNcLButtonDblClk(UINT nFlags, CPoint point)
  290. {
  291. if(nFlags != HTCAPTION)
  292. CMDIFrameWnd::OnNcLButtonDblClk(nFlags, point);
  293. }
  294. CMainFrame::CMainFrame()
  295. {
  296. // TODO: add member initialization code here
  297. SetConnectionID(INVALID_SOCKET);
  298. m_pMainFrimDlg2=NULL;
  299. CString version = _T ("Version 1.0");
  300. m_bCheckF2F3=AfxGetApp()->GetProfileInt (version, "f2f3", 0);
  301. if(0==::PathFileExists(g_mainpath+"\\skin\\5.lia"))
  302. {
  303. g_bNoLoginLia=1;
  304. }
  305. }
  306. CMainFrame::~CMainFrame()
  307. {
  308. if(m_pMainFrimDlg2)
  309. {
  310. m_pMainFrimDlg2->DestroyWindow ();
  311. delete m_pMainFrimDlg2;
  312. }
  313. }
  314. void InTheMe(HWND m_hWnd)
  315. {
  316. BOOL bXpVisualStyle=FALSE;
  317. OSVERSIONINFO osvi;
  318. osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  319. ::GetVersionEx (&osvi);
  320. if((osvi.dwPlatformId==VER_PLATFORM_WIN32_NT)&&(osvi.dwMajorVersion>=5)&&(osvi.dwMinorVersion>=1))
  321. {
  322. HMODULE hUxTheme=::LoadLibrary(_T( "UxTheme.dll"));
  323. POPENTHEMEDATA pOpenThemeData;
  324. PCLOSETHEMEDATA pCloseThemeData;
  325. if(hUxTheme!=NULL)
  326. {
  327. pOpenThemeData=(POPENTHEMEDATA)::GetProcAddress(hUxTheme, "OpenThemeData");
  328. pCloseThemeData=(PCLOSETHEMEDATA)::GetProcAddress (hUxTheme, "CloseThemeData");
  329. HTHEME hButtonTheme=(*pOpenThemeData)(m_hWnd,L"BUTTON");
  330. if(hButtonTheme!=NULL)
  331. bXpVisualStyle=TRUE;
  332. (*pCloseThemeData)(hButtonTheme);
  333. }
  334. ::FreeLibrary(hUxTheme);
  335. }
  336. if(bXpVisualStyle)
  337. AfxMessageBox(_T( "正在使用视觉主题 "));
  338. else
  339. AfxMessageBox(_T( "没有使用视觉主题 "));
  340. }
  341. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  342. {
  343. if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  344. {
  345. // Jeff.创建失败的可能性小,加日志输出;
  346. return -1;
  347. }
  348. if(g_server.Find (".ly.com")!=-1)
  349. {
  350. g_ntimeout=30000;
  351. }
  352. if(::PathFileExists (g_mainpath+"\\logo.ico"))
  353. {
  354. Bitmap *bmp=NULL;
  355. LoadImageFromFile (&bmp, g_mainpath+"\\logo.ico");
  356. // m_hIcon = AfxGetApp()->LoadIcon(g_mainpath+"\\logo.ico");
  357. bmp->GetHICON(&m_hIcon);
  358. delete bmp;
  359. SetIcon(m_hIcon, TRUE); // Set big icon
  360. SetIcon(m_hIcon, FALSE); // Set small icon
  361. }
  362. if(!m_wndClient.SubclassWindow (m_hWndMDIClient))
  363. {
  364. // Jeff.创建失败的可能性小,加日志输出;
  365. return -1;
  366. }
  367. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  368. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  369. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  370. {
  371. // Jeff.创建失败的可能性小,加日志输出;
  372. TRACE0("Failed to create toolbar\n");
  373. return -1; // fail to create
  374. }
  375. m_wndToolBar.LoadTrueColorToolBar(90, IDB_NORMAL, 0, IDB_DISABLE);
  376. // second toolbar must have different ID
  377. if (!m_wndToolBar2.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT | CBRS_NOALIGN,
  378. AFX_IDW_CONTROLBAR_FIRST + 32) ||
  379. !m_wndToolBar2.LoadToolBar(IDR_TOOLBAR1))
  380. {
  381. // Jeff.创建失败的可能性小,加日志输出;
  382. TRACE0("Failed to create toolbar\n");
  383. return -1; // fail to create
  384. }
  385. #ifndef NEW_SKIN
  386. if (!m_wndStatusBar.Create(this) ||
  387. !m_wndStatusBar.SetIndicators(indicators,
  388. sizeof(indicators)/sizeof(UINT)))
  389. {
  390. // Jeff.创建失败的可能性小,加日志输出;
  391. TRACE0("Failed to create status bar\n");
  392. return -1; // fail to create
  393. }
  394. m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_NORMAL,200);
  395. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  396. #endif
  397. // TODO: Delete these three lines if you don't want the toolbar to
  398. // be dockable
  399. NewMenu2();
  400. ::GetWindowRect (this->m_hWndMDIClient, g_rc);
  401. /* CString ss;
  402. ss.Format ("%d,%d,%d,%d", g_rc.left , g_rc.top , g_rc.right , g_rc.bottom );
  403. AfxMessageBox(ss);*/
  404. g_pMainWnd=this;
  405. m_wndToolBar2.Init ();
  406. g_rc.top +=38;
  407. g_rc.left +=160;
  408. /* m_WidthScale = (float)g_rc.Width ()/722;
  409. m_HeightScale = (float)g_rc.Height ()/533;*/
  410. g_user.bLongin =0;
  411. SetTimer(1, 100, NULL);
  412. return 0;
  413. }
  414. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  415. {
  416. if( !CMDIFrameWnd::PreCreateWindow(cs) )
  417. return FALSE;
  418. // TODO: Modify the Window class or styles here by modifying
  419. // the CREATESTRUCT cs
  420. cs.style&=~WS_MAXIMIZEBOX;
  421. cs.style&=~WS_THICKFRAME;
  422. cs.lpszName=g_title+"影楼管理系统";
  423. cs.style&=~FWS_ADDTOTITLE;
  424. RECT rect;
  425. HWND hWnd = ::FindWindow("Shell_TrayWnd", 0);
  426. ::GetWindowRect(hWnd,&rect);
  427. cs.x=0;
  428. cs.y=0;
  429. cs.cx=GetSystemMetrics(SM_CXSCREEN);
  430. cs.cy=GetSystemMetrics(SM_CYSCREEN)-(rect.bottom -rect.top)+3;
  431. return TRUE;
  432. }
  433. /////////////////////////////////////////////////////////////////////////////
  434. // CMainFrame diagnostics
  435. #ifdef _DEBUG
  436. void CMainFrame::AssertValid() const
  437. {
  438. CMDIFrameWnd::AssertValid();
  439. }
  440. void CMainFrame::Dump(CDumpContext& dc) const
  441. {
  442. CMDIFrameWnd::Dump(dc);
  443. }
  444. #endif //_DEBUG
  445. /////////////////////////////////////////////////////////////////////////////
  446. // CMainFrame message handlers
  447. void CMainFrame::OnDestroy()
  448. {
  449. //WriteLog("退出系统");//Jeff.add
  450. OnDisconnect();
  451. Transport_UnInit();
  452. m_Mdi.DeleteAll();
  453. if(g_hmouse)UnhookWindowsHookEx(g_hmouse);
  454. CMDIFrameWnd::OnDestroy();
  455. }
  456. void CMainFrame::OnClose()
  457. {
  458. g_bShowBar=0;
  459. if(m_Mdi.MainClose())
  460. CMDIFrameWnd::OnClose();
  461. }//连接
  462. void CMainFrame::NewMenu2()
  463. {
  464. CMenu *pMemu=GetMenu();
  465. #ifdef BASIC_VERSION
  466. CMenu* submenu = pMemu->GetSubMenu(1);
  467. //submenu->RemoveMenu (IDM_StaffAchievementShow, MF_BYCOMMAND );//Jeff del 2014.06.16
  468. submenu->RemoveMenu (IDM_salaryset, MF_BYCOMMAND );
  469. #endif
  470. #if 0 // 此机用选片菜单项,去掉不用;
  471. {
  472. CString version = _T ("Version 1.0");
  473. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  474. if(checked)
  475. {
  476. CMenu* submenu = pMemu->GetSubMenu(1);
  477. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  478. }
  479. }
  480. #endif
  481. #ifndef BASIC_VERSION
  482. {
  483. CString version = _T ("Version 1.0");
  484. BOOL checked=AfxGetApp()->GetProfileInt (version, "status2", 0);
  485. if(checked)
  486. {
  487. #if 0 // Jeff:去掉菜单,此机用于员工业绩查看的菜单选项;
  488. CMenu* submenu = pMemu->GetSubMenu(1);
  489. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  490. #endif
  491. g_bStaffAchievementShow=1;
  492. SetTimer(3, 100, NULL);
  493. }
  494. }
  495. #endif
  496. if(g_bShowOK==0)
  497. {
  498. CMenu* submenu = pMemu->GetSubMenu(2);
  499. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  500. }
  501. }
  502. HMENU CMainFrame::NewMenu()
  503. {
  504. //设置菜单为XP风格 IDM_SHOWHIS
  505. BCMenu::SetMenuDrawMode(1);
  506. //若取消下面这句注释,则可看到菜单的图标栏和文字栏背景颜色为白色,
  507. //文字颜色为蓝色,选中项的前景色为紫红色
  508. //m_menuXP.SetMenuXPItemColor(0x00FFFFFF,0x00FFFFFF,0x00FF0000,0x00FF00FF);
  509. // 设置菜单中图标大小为32×32
  510. // m_menuXP.SetIconSize(32,32);
  511. // 加载菜单资源
  512. m_menuXP.LoadMenu(IDR_MAINFRAME);
  513. // 加载菜单对应的工具栏资源
  514. // m_menuXP.LoadToolbar(IDR_MAINFRAME);
  515. /*由于菜单左边栏中默认的图标大小为16×16,而与之对应的Toolbar中图标大小为32×32,
  516. 因此菜单中图标不能正确显示,只显示出工具栏中图标的左上角部分,所以修改菜单中各
  517. 项对应的图标为24b色位图资源IDB_***,或者在LoadMenu之前调用SetIconSize,设置菜单
  518. 中图标大小为32×32*/
  519. // m_menuXP.SetIconSize(24,24);
  520. // m_menuXP.ModifyODMenu(NULL,IDM_YWBU,IDB_YW); //
  521. /* m_menuXP.ModifyODMenu(NULL,ID_FILE_OPEN,IDB_BITMAP5);
  522. m_menuXP.ModifyODMenu(NULL,ID_FILE_SAVE,IDB_BITMAP7);
  523. m_menuXP.ModifyODMenu(NULL,ID_FILE_PRINT,IDB_BITMAP6);
  524. m_menuXP.ModifyODMenu(NULL,ID_APP_ABOUT,IDB_BITMAP3);
  525. m_menuXP.ModifyODMenu(NULL,ID_APP_EXIT,IDB_BITMAP2);*/
  526. // m_menuXP.EnableMenuItem (0, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  527. // m_menuXP.EnableMenuItem (2, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  528. // m_menuXP.EnableMenuItem (3, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  529. // m_menuXP.EnableMenuItem (4, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  530. // m_menuXP.EnableMenuItem (5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  531. // m_menuXP.EnableMenuItem (8, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
  532. #if 0 // Jeff此机用选片菜单项不用;
  533. {
  534. CString version = _T ("Version 1.0");
  535. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
  536. if(checked)
  537. {
  538. CMenu* submenu = m_menuXP.GetSubMenu(1);
  539. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  540. }
  541. }
  542. #endif
  543. {
  544. CString version = _T ("Version 1.0");
  545. BOOL checked=AfxGetApp()->GetProfileInt (version, "status2", 0);
  546. if(checked)
  547. {
  548. #if 0 // Jeff:去掉此机用于员工业绩查看的菜单选项;
  549. CMenu* submenu = m_menuXP.GetSubMenu(1);
  550. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  551. #endif
  552. g_bStaffAchievementShow=1;
  553. SetTimer(3, 100, NULL);
  554. }
  555. }
  556. if(g_bShowOK==0)
  557. {
  558. CMenu* submenu = m_menuXP.GetSubMenu(2);
  559. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  560. }
  561. return(m_menuXP.Detach());
  562. }
  563. ///////////////////////////////////////////////////////
  564. //减少代码
  565. #define OPEN_MENU(x) m_Mdi.Append(pName, RUNTIME_CLASS(x), IDR_MAINFRAME, this, nID)
  566. //响应菜单命令
  567. void CMainFrame::OnCommandMenu(UINT nID)
  568. {
  569. if(nID>=2000 && nID<=2100)
  570. {
  571. OnBranchData(nID);
  572. return;
  573. }
  574. if(g_user.bLongin==0)
  575. {
  576. if(g_bNoLoginLia)
  577. {
  578. Login dlg;
  579. dlg.SetLiaPath ("5.lia");
  580. dlg.DoModal();
  581. }
  582. else
  583. {
  584. Login3 dlg;
  585. dlg.SetLiaPath ("5.lia");
  586. dlg.DoModal();
  587. }
  588. return;
  589. if(g_user.bLongin==0)return;
  590. }
  591. else
  592. {
  593. InsideMsg();
  594. }
  595. ResetTimer();
  596. if(nID>=1000 && nID<=1100)
  597. {
  598. OnHistory(nID);
  599. return;
  600. }
  601. LPSTR pName ;
  602. //打开窗口
  603. switch(nID)
  604. {
  605. case IDM_PayOutSet:
  606. {
  607. if(IsHasRights(16)==0)return;
  608. PayOutSet dlg;
  609. dlg.DoModal ();
  610. return;
  611. }
  612. case IDM_SPLB:
  613. {
  614. if(IsHasRightsnew(29)==0)return;
  615. SPLBDlg dlg;
  616. dlg.DoModal ();
  617. return;
  618. }
  619. case IDM_JD:
  620. {
  621. if(IsHasRightsnew(49)==0)return;
  622. SPLBDlg dlg;
  623. dlg.m_mode=1;
  624. dlg.DoModal ();
  625. return;
  626. }
  627. case IDM_AREA:
  628. {
  629. if(IsHasRightsnew(47)==0)return;
  630. AreaDlg dlg;
  631. dlg.DoModal ();
  632. return;
  633. }
  634. case IDM_Psw:
  635. {
  636. Psw dlg;
  637. dlg.DoModal ();
  638. return;
  639. }
  640. case IDM_Set:
  641. {
  642. if(IsHasRightsnew(49)==0)return;
  643. /* if(g_bBranchModify)
  644. {
  645. AfxMessageBox("系统设置不支持远程访问,请直接访问该分店!", MB_ICONINFORMATION);
  646. return;
  647. }*/
  648. Set dlg;
  649. dlg.DoModal();
  650. //if(dlg.DoModal() != IDOK)
  651. //{
  652. //AfxMessageBox("789");
  653. //Set::SetCancle();
  654. //}
  655. return;
  656. }
  657. case IDM_HIDEWINDOW:
  658. {
  659. HideWindow dlg;
  660. dlg.DoModal ();
  661. return;
  662. }
  663. case IDM_Logout:// Jeff.注销;
  664. {
  665. WriteLog("退出系统");//Jeff.add;
  666. g_user.bLongin=0;
  667. g_user.name.Empty();
  668. g_user.rights.Empty();
  669. g_user.account.Empty();
  670. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  671. g_pMainWnd2->RefreshOutlookBar();
  672. #ifndef NEW_SKIN
  673. m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
  674. #endif
  675. m_Mdi.CloseAll();
  676. #ifdef ENTERPRISE_VERSION
  677. g_branchname.Empty();
  678. g_branchip.Empty();
  679. g_pMainWnd->OnDisconnect();
  680. g_bBranchModify=0;
  681. #endif
  682. if(g_pMainWnd2)
  683. {
  684. g_pMainWnd2->DrawLogin();
  685. g_pMainWnd2->ShowBar(0);
  686. }
  687. g_hisyeararray.RemoveAll();
  688. g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
  689. g_brancharray.RemoveAll();
  690. g_pMainWnd->AddBranchMenu(&g_brancharray);
  691. if(g_bNoLoginLia)
  692. {
  693. Login dlg;
  694. dlg.SetLiaPath ("5.lia");
  695. dlg.DoModal();
  696. }
  697. else
  698. {
  699. Login3 dlg;
  700. dlg.SetLiaPath ("5.lia");
  701. dlg.DoModal();
  702. }
  703. if(g_user.bLongin==0)
  704. if(g_pMainWnd2)g_pMainWnd2->ShowBar(1);
  705. return;
  706. }
  707. case IDM_TODAY:
  708. pName = (LPSTR)(LPCSTR)"历史订单";
  709. // OPEN_MENU(SalarySet3);
  710. OPEN_MENU(DinDanHistroy);
  711. break;
  712. case IDM_TAKECONTROL:
  713. pName = (LPSTR)(LPCSTR)"摄控表";
  714. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))
  715. OPEN_MENU(TodayForm2);
  716. else
  717. OPEN_MENU(TodayForm);
  718. break;
  719. case IDM_CLIENTMONEY:
  720. pName = (LPSTR)(LPCSTR)"客人付款";
  721. OPEN_MENU(ClientMoney);
  722. break;
  723. case IDM_TAKEAWAYBOOK:
  724. pName = (LPSTR)(LPCSTR)"发片/取件";
  725. OPEN_MENU(outsourcing);
  726. break;
  727. case IDM_CODE:
  728. pName = (LPSTR)(LPCSTR)"商品报表";
  729. OPEN_MENU(SPForm);
  730. break;
  731. case IDM_Daily:
  732. // if(IsHasRightsnew(22)==0)return;
  733. // pName = (LPSTR)(LPCSTR)"日财务表";
  734. // OPEN_MENU(DailyForm);
  735. pName = (LPSTR)(LPCSTR)"沟通助手";
  736. OPEN_MENU(InsideMsg);
  737. break;
  738. case IDM_ProcessAlarm:
  739. pName = (LPSTR)(LPCSTR)"流程监控";
  740. OPEN_MENU(ProcessAlarm);
  741. break;
  742. case IDM_DINDAN:
  743. // if(IsHasRights(7)==0)return;
  744. pName = (LPSTR)(LPCSTR)"订单报表";
  745. OPEN_MENU(DinDanFrom);
  746. break;
  747. case IDM_CLIENT:
  748. //if(IsHasRights(8)==0)return;
  749. pName = (LPSTR)(LPCSTR)"客户报表";
  750. OPEN_MENU(CClientForm);
  751. break;
  752. case IDM_PayOutInput:
  753. if(IsHasRightsnew(20)==0)return;
  754. pName = (LPSTR)(LPCSTR)"现金支出";
  755. OPEN_MENU(PayOutInput);
  756. break;
  757. case IDM_salaryset:
  758. if(IsHasRightsnew(25)==0)return;
  759. pName = (LPSTR)(LPCSTR)"工资设置";
  760. OPEN_MENU(SalarySet);
  761. break;
  762. case IDM_mysalary:
  763. if(IsHasRights(16)==0)return;
  764. pName = (LPSTR)(LPCSTR)"我的工资";
  765. OPEN_MENU(MySalary);
  766. break;
  767. case IDM_SP:
  768. // if(IsHasRightsnew(29)==0)return;
  769. pName = (LPSTR)(LPCSTR)"商品设置";
  770. OPEN_MENU(ShangPin);
  771. break;
  772. case IDM_WORKER:
  773. if(IsHasRightsnew(27)==0)return;
  774. pName = (LPSTR)(LPCSTR)"员工设置";
  775. OPEN_MENU(Worker);
  776. break;
  777. case IDM_TAOXI:
  778. if(IsHasRightsnew(30)==0)return;
  779. pName = (LPSTR)(LPCSTR)"套系设置";
  780. OPEN_MENU(TXDlg);
  781. break;
  782. case IDM_TAOXISP:
  783. if(IsHasRightsnew(30)==0)return;
  784. pName = (LPSTR)(LPCSTR)"套系赠送商品设置";
  785. OPEN_MENU(TXSPDlg);
  786. break;
  787. case IDM_Provider:
  788. if(IsHasRightsnew(32)==0)return;
  789. pName = (LPSTR)(LPCSTR)"供应商设置";
  790. OPEN_MENU(ProviderDlg);
  791. break;
  792. case IDM_BUMEN:
  793. {if(IsHasRightsnew(49)==0)return;
  794. BuMenDlg dlg;
  795. dlg.DoModal ();
  796. return;
  797. }
  798. case IDM_Account:
  799. if(IsHasRightsnew(49)==0)return;
  800. pName = (LPSTR)(LPCSTR)"账号管理";
  801. OPEN_MENU(Account);
  802. break;
  803. case IDM_YLCD:
  804. {
  805. //AfxMessageBox("IDM_YLCD");
  806. ::CopyFile (_T(g_path7+"\\接单系统\\Regsvr32.exe"), _T(g_mainpath+"\\Regsvr32.exe"), 0);
  807. ::CopyFile (_T(g_path7+"\\接单系统\\Flash9f.ocx"), _T(g_mainpath+"\\Flash9f.ocx"), 0);
  808. CString temp;
  809. temp.Format ("%s\\regsvr32.exe /s %s\\Flash9f.OCX", g_mainpath,g_mainpath);
  810. WinExec(temp,SW_HIDE);
  811. ::CopyFile (_T(g_path7+"\\接单系统\\接单系统.exe"), _T(g_mainpath+"\\接单系统.exe"), 0);
  812. ::CopyFile (_T(g_path7+"\\接单系统\\my32.dll"), _T(g_mainpath+"\\my32.dll"), 0);
  813. ::CopyFile (_T(g_path7+"\\接单系统\\server.dat"), _T(g_mainpath+"\\server.dat"), 0);
  814. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\接单系统.exe"), g_server, NULL, SW_SHOWNORMAL);
  815. }
  816. break;
  817. case IDM_YLCDMANAGE:
  818. ::CopyFile (_T(g_path7+"\\接单系统\\资源管理器.exe"), _T(g_mainpath+"\\资源管理器.exe"), 0);
  819. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\资源管理器.exe"), g_server, NULL, SW_SHOWNORMAL);
  820. break;
  821. }
  822. }
  823. //减少代码
  824. ///////////////////////////////////////////////////////////////////////////////
  825. void CMainFrame::OnDisconnect()
  826. {
  827. m_tClientTunnel.net_CloseSocket();
  828. SetConnectionID(INVALID_SOCKET);
  829. }
  830. void CMainFrame::ProcessLoginResponse(void *pLoginResult)
  831. {
  832. if( NULL == pLoginResult ) return;
  833. LOGIN_RESULT_STRU *ptLoginResult = (LOGIN_RESULT_STRU *)pLoginResult;
  834. DWORD dwConnectionID = ptLoginResult->tCommonMsg.dwConnectionID;
  835. SetConnectionID(dwConnectionID);
  836. BYTE byResult = ptLoginResult->byResult;
  837. if(LOGIN_RESULT_SUC == byResult)
  838. {
  839. }
  840. else
  841. {
  842. OnDisconnect();
  843. }
  844. }
  845. BOOL CMainFrame::ProcessLoginRequest()
  846. {
  847. // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
  848. WORD wMessageId = MSG_LOGIN_REQ;
  849. // 2.填充发送数据;
  850. TLOGIN_STRU tLogonInfo = {0};
  851. tLogonInfo.tCommonMsg.dwConnectionID = GetConnectionID();//此时m_dwConnectionID为INVALIDE_SOCKET;
  852. tLogonInfo.tCommonMsg.wMessageId = wMessageId;
  853. CString strUserName = newGUID();// 以随机数作为登陆时的用户名称;
  854. strUserName.TrimLeft();
  855. strUserName.TrimRight();
  856. strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
  857. DWORD dwDataLen = sizeof(TLOGIN_STRU);
  858. // 3.填充数据头;
  859. TMessageHeader tHeader = {0};
  860. tHeader.wMessageId = wMessageId;
  861. tHeader.dwDataLen = dwDataLen;
  862. // 4.发送数据;
  863. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)&tLogonInfo, dwDataLen);
  864. if( ulSendLen == SOCKET_ERROR )
  865. {
  866. return 0;
  867. }
  868. return 1;
  869. }
  870. DWORD CMainFrame::GetConnectionID()
  871. {
  872. return m_dwConnectionID;
  873. }
  874. void CMainFrame::SetConnectionID(DWORD dwConnection)
  875. {
  876. m_dwConnectionID = dwConnection;
  877. }
  878. /************************************************************************/
  879. /*
  880. Date: 2015-04-11
  881. Author: Jeff
  882. 函数:GetSharePathInfo
  883. 描述:获取共享目录表的所有信息;
  884. 参数:
  885. 返回:成功返回TRUE;
  886. 注意:获取的表记录存储在全局变量g_aryOfSharePathInfo中;
  887. 调用约定:在登陆软件时调用,且必须连接的服务器是本店的;
  888. */
  889. /************************************************************************/
  890. BOOL CMainFrame::GetSharePathInfo()
  891. {
  892. // 1.连接的数据库必须是本局域网的服务器;
  893. if ( g_bAllBranch || !g_branchname.IsEmpty() || !g_branchip.IsEmpty() )
  894. {
  895. // 非当前局域网服务器;
  896. return FALSE;
  897. }
  898. // 2.获取当前连接的分店域名是否与g_domain一致;
  899. g_sendhead.bsql = 0;
  900. g_sendhead.code[0] = 29;
  901. g_sendhead.tabcount = 1;
  902. g_pMainWnd->ProcessChatMessageRequest2(23);
  903. if ( !g_bSendOK )
  904. {
  905. // 连接服务器失败;
  906. return FALSE;
  907. }
  908. CArray<CStringArray,CStringArray> strArray;
  909. DataToArray(&strArray);
  910. CString strCurBranchDomain = _T("");
  911. if ( strArray.GetSize() )
  912. {
  913. strCurBranchDomain = strArray.ElementAt(0).ElementAt(0);
  914. if ( strCurBranchDomain.Find(_T(".ly.com")) == -1)
  915. {
  916. // 当前获取的域名有错;
  917. return FALSE;
  918. }
  919. }
  920. if ( g_domain.CompareNoCase(strCurBranchDomain) != 0)
  921. {
  922. // 当前连接的分店域名与局域网服务器域名不一致;
  923. return FALSE;
  924. }
  925. // 3.获取可用的共享信息;//select * from NetShareInfo where enable = 1;
  926. CString strFilter = _T("");
  927. strFilter.Format(_T("enable = 1"));
  928. g_sendhead.bsql = 0;
  929. g_sendhead.code[0] = 300;
  930. g_sendhead.tabcount = 1;
  931. g_pMainWnd->ProcessChatMessageRequest2(strFilter);
  932. if ( !g_bSendOK )
  933. {
  934. // 获取共享信息失败;
  935. return FALSE;
  936. }
  937. g_aryOfSharePathInfo.RemoveAll();
  938. DataToArray(&g_aryOfSharePathInfo);
  939. return g_aryOfSharePathInfo.GetSize() ? TRUE : FALSE;
  940. }
  941. //*********************************************//
  942. /*
  943. 函数:ProcessChatMessageRequest2
  944. 参数:BYTE code [IN]
  945. 返回:无
  946. 过程:OnConnect() -> ProcessChatMessageRequest()
  947. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  948. 2.SendDataDlg计时器里调用CConnectDlg对话框
  949. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  950. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  951. 5.关闭对话框和断开连接;
  952. */
  953. //*********************************************//
  954. void CMainFrame::ProcessChatMessageRequest2(BYTE code)
  955. {
  956. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  957. SendDataDlg dlg;
  958. dlg.m_bycode =code;
  959. dlg.DoModal();
  960. }
  961. //*********************************************//
  962. /*
  963. 函数:ProcessChatMessageRequest2
  964. 参数:CString sql [IN]
  965. 返回:无
  966. 过程:OnConnect() -> ProcessChatMessageRequest()
  967. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  968. 2.SendDataDlg计时器里调用CConnectDlg对话框
  969. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  970. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  971. 5.关闭对话框和断开连接;
  972. */
  973. //*********************************************//
  974. void CMainFrame::ProcessChatMessageRequest2(CString sql)
  975. {
  976. if( (sql.Find ("insert")!=-1 || sql.Find ("update")!=-1 || sql.Find ("delete")!=-1) && g_branchname!="" && g_bBranchModify==0)
  977. {
  978. AfxMessageBox("当前为分店数据查看状态,不能更改分店数据!", MB_ICONSTOP);
  979. g_bSendOK=0;
  980. return;
  981. }
  982. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  983. SendDataDlg dlg;
  984. dlg.m_strSQL = sql;
  985. dlg.DoModal ();
  986. }
  987. //*********************************************//
  988. /*
  989. 函数:ProcessChatMessageRequest2
  990. 参数:BYTE *pData [IN], int length [IN]
  991. 返回:无
  992. 过程:OnConnect() -> ProcessChatMessageRequest()
  993. 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
  994. 2.SendDataDlg计时器里调用CConnectDlg对话框
  995. 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
  996. 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
  997. 5.关闭对话框和断开连接;
  998. */
  999. //*********************************************//
  1000. void CMainFrame::ProcessChatMessageRequest2(BYTE *pData, int length)
  1001. {
  1002. SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
  1003. SendDataDlg dlg;
  1004. dlg.m_pData =pData;
  1005. dlg.m_nlength =length;
  1006. dlg.DoModal ();
  1007. }
  1008. /************************************************************************/
  1009. /*
  1010. 函数:ProcessChatMessageRequest
  1011. 描述:对服务发送数据;
  1012. 参数:void *szDataBuf[IN], int nDataLen[IN]
  1013. 返回:发送成功与否;
  1014. */
  1015. /************************************************************************/
  1016. BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)
  1017. {
  1018. // 1.获取当前与服务器连接的id;
  1019. DWORD dwFromUserID = GetConnectionID();
  1020. // 2.设置通信类型为MSG_CHATMESSAGE_REQ;
  1021. WORD wMessageId = MSG_CHATMESSAGE_REQ;
  1022. // 3.计算出欲发送的数据的长度 dwDataLen;
  1023. DWORD dwDataLen = sizeof(TCHAT_MESSAGE_STRU) + nDataLen;
  1024. BYTE *pSendData = new BYTE[dwDataLen];
  1025. TCHAT_MESSAGE_STRU *pChatMessage=(TCHAT_MESSAGE_STRU*)pSendData;
  1026. memset(pChatMessage, 0x00, dwDataLen);
  1027. // 3.1.g_nYearpos第一次与服务端通信时为-1;
  1028. if(g_nYearpos == -1)
  1029. g_sendhead.length[99]=g_nYearpos;
  1030. else
  1031. g_sendhead.length[99]=g_nYearpos*32142953+10966236;
  1032. g_sendhead.length[98]=987123768;
  1033. memcpy(pSendData, &g_sendhead, sizeof(g_sendhead));
  1034. #ifdef ENTERPRISE_VERSION
  1035. if(g_bBranchModify==0)
  1036. strcpy(pChatMessage->szFromUserName, g_branchname);
  1037. #endif
  1038. // 4.填充发送的数据结构;
  1039. pChatMessage->tCommonMsg.dwConnectionID = GetConnectionID();
  1040. pChatMessage->tCommonMsg.wMessageId = wMessageId;
  1041. pChatMessage->dwFromUserID = dwFromUserID;
  1042. pChatMessage->dwToUserID = g_nSendCode;//▲▲g_nSendCode在服务端同为dwToUserID;
  1043. pChatMessage->wMessageLen = nDataLen;
  1044. memcpy(pChatMessage->byFileContent, szDataBuf, nDataLen);
  1045. // 5.填充数据头;
  1046. TMessageHeader tHeader = {0};
  1047. tHeader.wMessageId = wMessageId;
  1048. tHeader.dwDataLen = dwDataLen;
  1049. // 6.发送数据;
  1050. BOOL bRet=0;
  1051. unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)pChatMessage, dwDataLen);
  1052. if( ulSendLen != SOCKET_ERROR )
  1053. {
  1054. bRet=1;
  1055. }
  1056. // 7.发送完毕,释放内存;
  1057. delete [] pSendData;
  1058. return bRet;
  1059. }
  1060. /************************************************************************/
  1061. /*
  1062. 函数:ProcessChatMessageResponse
  1063. 描述:接收服务返回的数据;
  1064. 参数:void *pResponse[IN]
  1065. 返回:无;
  1066. 调用关系:
  1067. 1.由 void CMainFrame::ProcessNetEvent(...)调用
  1068. */
  1069. /************************************************************************/
  1070. void CMainFrame::ProcessChatMessageResponse(void *pResponse)
  1071. {
  1072. // 1.数据空,直接返回;
  1073. if( NULL == pResponse )
  1074. return;
  1075. // 2.数据解析过程;
  1076. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pResponse;
  1077. int nMessageLen = pChatMessage->wMessageLen;
  1078. int nMessageLen2 = pChatMessage->dwToUserID; // 在服务器中被处理了,一般使dwToUserID=wMessageLen;
  1079. // Jeff.dwFromUserID==8888表示的内容是更新客户端skin界面数据,只有两处dwToUserID==211和dwToUserID==21;
  1080. // Jeff.其余的大多数都是 dwFromUserID = wMessageLen = dwToUserID 三者相等;
  1081. if(nMessageLen==nMessageLen2 && pChatMessage->dwFromUserID!=8888)
  1082. {
  1083. // 2.1.清除全局变量g_pData数据,用于保存接收的实际数据;
  1084. if(g_pData)
  1085. delete []g_pData;
  1086. g_pData=NULL;
  1087. g_pData=new BYTE[nMessageLen];
  1088. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1089. memcpy( &g_sendhead, pChatMessage, sizeof(g_sendhead));
  1090. g_nLeng=nMessageLen;
  1091. if(nMessageLen<=sizeof(DWORD))
  1092. {
  1093. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1094. }
  1095. KillTimer(2);
  1096. if(g_hSendWnd)
  1097. {
  1098. ::SendMessage(g_hSendWnd, WM_CLOSE, 0, 0);//关闭发送对话框;
  1099. }
  1100. }
  1101. else if(nMessageLen==nMessageLen2 && pChatMessage->dwFromUserID==8888)
  1102. {
  1103. if(g_pData2)
  1104. delete []g_pData2;
  1105. g_pData2=NULL;
  1106. g_pData2=new BYTE[nMessageLen2];
  1107. memcpy(g_pData2, pChatMessage->byFileContent, nMessageLen2);
  1108. g_nLeng2=nMessageLen2;
  1109. KillTimer(2);
  1110. if(g_hSendWnd )
  1111. {
  1112. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1113. }
  1114. }
  1115. else // 登陆返回;
  1116. {
  1117. if(g_bConnLYFZ)
  1118. {
  1119. if(g_pData)
  1120. delete []g_pData;
  1121. g_pData=NULL;
  1122. g_pData=new BYTE[nMessageLen];
  1123. memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
  1124. memcpy( &g_sendhead, pChatMessage, sizeof(g_sendhead));
  1125. g_nLeng=nMessageLen;
  1126. if(nMessageLen<=sizeof(DWORD))
  1127. {
  1128. memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
  1129. }
  1130. KillTimer(2);
  1131. if(g_hSendWnd )
  1132. {
  1133. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1134. }
  1135. return;
  1136. }
  1137. if(g_conntype) // Jeff.g_conntype == 1,表示连接公司服务器的返回,用于集团版解析*.ly.com的IP地址;
  1138. {
  1139. // KillTimer(2);
  1140. char *szChatMessage = new char[nMessageLen+1];
  1141. memset(szChatMessage, 0x00, nMessageLen+1);
  1142. memcpy(szChatMessage, pChatMessage->byFileContent, nMessageLen);
  1143. g_server=szChatMessage;
  1144. delete []szChatMessage;
  1145. CStdioFile fp;
  1146. CString path=g_mainpath+"\\ip.txt";
  1147. ::DeleteFile(path);
  1148. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  1149. fp.WriteString(g_server);
  1150. fp.Close();
  1151. g_conntype=0;
  1152. // g_serverip=g_server;
  1153. return;
  1154. }
  1155. if(g_pData2==NULL)
  1156. {
  1157. g_pData2=new BYTE[nMessageLen2];
  1158. g_nLeng2=0;
  1159. }
  1160. memcpy(g_pData2+g_nLeng2, pChatMessage->byFileContent, nMessageLen);
  1161. g_nLeng2+=nMessageLen;
  1162. if(g_nLeng2==nMessageLen2)//已收完
  1163. {
  1164. KillTimer(2);
  1165. if(g_hSendWnd )
  1166. {
  1167. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1168. }
  1169. }
  1170. else
  1171. {
  1172. KillTimer(2);
  1173. SetTimer(2, g_ntimeout, NULL);
  1174. }
  1175. }
  1176. }
  1177. BOOL CMainFrame::OnConnectBranch()
  1178. {
  1179. if(g_branchip=="")
  1180. {
  1181. return 0;
  1182. }
  1183. g_conntype=0;
  1184. CString strServerAddress = g_branchip;
  1185. char *szServerAddress = strServerAddress.GetBuffer(0);
  1186. strServerAddress.ReleaseBuffer();
  1187. /*for Client, IP and Port can be 0,
  1188. and for Server, IP is LocalIP, and Port is Listening Port*/
  1189. int nResult = m_tClientTunnel.net_OpenSocket(
  1190. Transport_Client,
  1191. 0,
  1192. HandleClientNetEvent,
  1193. this);
  1194. if( TRANSPORT_OK != nResult )
  1195. {
  1196. // AfxMessageBox("网络初始化失败!");
  1197. return 0;
  1198. }
  1199. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1200. WORD wPort = SERVER_PORT;
  1201. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1202. if( TRANSPORT_OK != nResult )
  1203. {
  1204. m_tClientTunnel.net_CloseSocket();
  1205. return OnConnectBranch2();
  1206. return 0;
  1207. }
  1208. return ProcessLoginRequest();
  1209. }
  1210. BOOL CMainFrame::OnConnectBranch2()
  1211. {
  1212. if(g_branchip2=="")
  1213. {
  1214. return 0;
  1215. }
  1216. g_conntype=0;
  1217. CString strServerAddress = g_branchip2;
  1218. char *szServerAddress = strServerAddress.GetBuffer(0);
  1219. strServerAddress.ReleaseBuffer();
  1220. /*for Client, IP and Port can be 0,
  1221. and for Server, IP is LocalIP, and Port is Listening Port*/
  1222. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1223. 0,
  1224. HandleClientNetEvent,
  1225. this);
  1226. if( TRANSPORT_OK != nResult )
  1227. {
  1228. // AfxMessageBox("网络初始化失败!");
  1229. return 0;
  1230. }
  1231. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1232. WORD wPort = SERVER_PORT;
  1233. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1234. if( TRANSPORT_OK != nResult )
  1235. {
  1236. m_tClientTunnel.net_CloseSocket();
  1237. return 0;
  1238. }
  1239. return ProcessLoginRequest();
  1240. }
  1241. BOOL CMainFrame::OnConnectIP()
  1242. {
  1243. CString strServerAddress = g_server;
  1244. char *szServerAddress = strServerAddress.GetBuffer(0);
  1245. strServerAddress.ReleaseBuffer();
  1246. /*for Client, IP and Port can be 0,
  1247. and for Server, IP is LocalIP, and Port is Listening Port*/
  1248. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1249. 0,
  1250. HandleClientNetEvent,
  1251. this);
  1252. if( TRANSPORT_OK != nResult )
  1253. {
  1254. // AfxMessageBox("网络初始化失败!");
  1255. return 0;
  1256. }
  1257. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1258. WORD wPort = SERVER_PORT;
  1259. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1260. if( TRANSPORT_OK != nResult )
  1261. {
  1262. m_tClientTunnel.net_CloseSocket();
  1263. return 0;
  1264. }
  1265. return ProcessLoginRequest();
  1266. }
  1267. //ip.txt
  1268. BOOL CMainFrame::OnConnectLYFZ()
  1269. {
  1270. CString strBranchIP = "lijiafz.vicp.net";
  1271. MyGetIPByName2(strBranchIP);
  1272. if(strBranchIP=="")
  1273. {
  1274. return 0;
  1275. }
  1276. g_conntype=0;
  1277. CString strServerAddress = strBranchIP;
  1278. char *szServerAddress = strServerAddress.GetBuffer(0);
  1279. strServerAddress.ReleaseBuffer();
  1280. /*for Client, IP and Port can be 0,
  1281. and for Server, IP is LocalIP, and Port is Listening Port*/
  1282. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1283. 0,
  1284. HandleClientNetEvent,
  1285. this);
  1286. if( TRANSPORT_OK != nResult )
  1287. {
  1288. // AfxMessageBox("网络初始化失败!");
  1289. return 0;
  1290. }
  1291. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1292. WORD wPort = GetPort();
  1293. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1294. if( TRANSPORT_OK != nResult )
  1295. {
  1296. m_tClientTunnel.net_CloseSocket();
  1297. return 0;
  1298. }
  1299. return ProcessLoginRequest();
  1300. }
  1301. BOOL CMainFrame::OnConnect()
  1302. {
  1303. // 1.Jeff 断开(如果有在在未关的连接)之前的连接;
  1304. OnDisconnect();
  1305. // 2.根据需要连接指定的服务器;
  1306. if(g_bBranchModify)
  1307. {
  1308. // Jeff.g_bBranchModify在g_bGenBranchData=1时,在welcome::OnTimer里被设置为1;
  1309. return OnConnectBranch();// 连接集团版分店;
  1310. }
  1311. if(g_bConnLYFZ)
  1312. {
  1313. return OnConnectLYFZ();// 连接公司服务端程序;
  1314. }
  1315. g_conntype=0;
  1316. CString strServerAddress = g_server;
  1317. // 3.如果dbconfig.dat里保存的是*.ly.com的信息,就要读取ip.txt里的IP地址;
  1318. if(g_serverbak.Find(".ly.com")!=-1)
  1319. {
  1320. strServerAddress=g_serverbak;
  1321. CStdioFile fp;
  1322. CString path=g_mainpath+"\\ip.txt";
  1323. if(::PathFileExists(path))
  1324. {
  1325. fp.Open(path, CFile::modeRead);
  1326. fp.ReadString(g_server);
  1327. fp.Close();
  1328. if(OnConnectIP())
  1329. {
  1330. //MessageBox("ip成功");
  1331. // g_serverip=g_server;
  1332. //LOG4C((LOG_NOTICE,"OnConnectIP == 1,return 1"));
  1333. return 1;
  1334. }
  1335. g_server=strServerAddress ;
  1336. OnDisconnect();//MessageBox("ip失败");
  1337. }
  1338. g_conntype=1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1339. strServerAddress="lijiafz.vicp.net";
  1340. MyGetIPByName2(strServerAddress);
  1341. if(strServerAddress.IsEmpty())
  1342. {
  1343. //LOG4C((LOG_NOTICE,"strServerAddress == 0,return 0"));
  1344. return 0;//OnConnect2();
  1345. }
  1346. }
  1347. else if(g_ntimeout==29000)//非远程 30000
  1348. {
  1349. strServerAddress=g_serverarray.ElementAt(g_conpos);
  1350. }
  1351. // 4.如果没有IP.txt或dbconfig.dat里的不是ly.com信息,而是一般的计算机名称;
  1352. char *szServerAddress = strServerAddress.GetBuffer(0);
  1353. strServerAddress.ReleaseBuffer();
  1354. // AfxMessageBox("连接:"+strServerAddress);
  1355. /*for Client, IP and Port can be 0,
  1356. and for Server, IP is LocalIP, and Port is Listening Port*/
  1357. // 5.创建通信对象连接;
  1358. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1359. 0,
  1360. HandleClientNetEvent,
  1361. this);
  1362. if( TRANSPORT_OK != nResult )
  1363. {
  1364. // AfxMessageBox("网络初始化失败!");
  1365. // LOG4C((LOG_NOTICE,"网络初始化失败!,return 0"));
  1366. return 0;
  1367. }
  1368. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1369. WORD wPort = SERVER_PORT;
  1370. if(g_conntype) wPort=GetPort();
  1371. // 6.连接公司服务器或影楼服务器;
  1372. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1373. if( TRANSPORT_OK != nResult )
  1374. {
  1375. // AfxMessageBox("连接失败");
  1376. m_tClientTunnel.net_CloseSocket();
  1377. if(g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
  1378. {
  1379. // LOG4C((LOG_NOTICE,"连接失败,return 0"));
  1380. return 0;//OnConnect2();
  1381. }
  1382. if(g_serverarray.GetSize()>1)
  1383. {
  1384. if(g_conpos<(g_serverarray.GetSize()-1))
  1385. {
  1386. g_conpos++;
  1387. return OnConnect();
  1388. }
  1389. else
  1390. {
  1391. g_conpos=0;
  1392. return 0;
  1393. }
  1394. }
  1395. return 0;
  1396. }
  1397. // LOG4C((LOG_NOTICE,"ok send"));
  1398. return ProcessLoginRequest();
  1399. }
  1400. BOOL CMainFrame::OnConnect2()
  1401. {
  1402. g_conntype=2;
  1403. CString server="http://www.lyfz.net/download/ip.txt";
  1404. char buf[MAX_PATH];
  1405. ::GetTempPath(sizeof(buf),buf);
  1406. CString m_strTempDir=buf;
  1407. DWORD m_dwHttpRequestFlags=HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1408. INTERNET_PORT m_dwPort;
  1409. DWORD dwType;
  1410. CInternetSession m_cis;
  1411. CHttpConnection *m_pHttp;
  1412. CString m_strServer;
  1413. CString m_strIniPath;
  1414. AfxParseURL(server,dwType,m_strServer,m_strIniPath,m_dwPort);
  1415. if(dwType!=AFX_INET_SERVICE_HTTP)
  1416. {
  1417. return 0;//OnConnect3();
  1418. }
  1419. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,5);
  1420. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1421. try
  1422. {
  1423. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1424. }
  1425. catch(CInternetException* pEx)
  1426. {
  1427. return 0;//OnConnect3();
  1428. }
  1429. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1430. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1431. try
  1432. {
  1433. pFile->SendRequest();
  1434. }
  1435. catch(CInternetException* pEx)
  1436. {
  1437. pFile->Close();
  1438. return 0;//OnConnect3();
  1439. }
  1440. if(pFile)
  1441. {
  1442. CStdioFile csf;
  1443. csf.Open(m_strTempDir+"\\ip.txt",CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
  1444. char buf[2048];
  1445. int n;
  1446. while((n=pFile->Read(buf,2048))>0)
  1447. csf.Write(buf,n);
  1448. csf.Close();
  1449. pFile->Close();
  1450. }
  1451. CString strServerAddress ;
  1452. CStdioFile fp;
  1453. fp.Open (m_strTempDir+"\\ip.txt", CFile::modeRead);
  1454. fp.ReadString (strServerAddress);
  1455. fp.Close ();
  1456. char *szServerAddress = strServerAddress.GetBuffer(0);
  1457. strServerAddress.ReleaseBuffer();
  1458. /*for Client, IP and Port can be 0,
  1459. and for Server, IP is LocalIP, and Port is Listening Port*/
  1460. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1461. 0,
  1462. HandleClientNetEvent,
  1463. this);
  1464. if( TRANSPORT_OK != nResult )
  1465. {
  1466. return 0;
  1467. }
  1468. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1469. WORD wPort = SERVER_PORT;
  1470. if(g_conntype)wPort=GetPort();
  1471. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1472. if( TRANSPORT_OK != nResult )
  1473. {
  1474. m_tClientTunnel.net_CloseSocket();
  1475. return 0;//OnConnect3();
  1476. }
  1477. return ProcessLoginRequest();
  1478. }
  1479. BOOL CMainFrame::OnConnect3()
  1480. {
  1481. g_conntype=3;
  1482. CString server="http://photo.bjlyfz.com/download/ip.txt";
  1483. char buf[MAX_PATH];
  1484. ::GetTempPath(sizeof(buf),buf);
  1485. CString m_strTempDir=buf;
  1486. DWORD m_dwHttpRequestFlags=HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
  1487. INTERNET_PORT m_dwPort;
  1488. DWORD dwType;
  1489. CInternetSession m_cis;
  1490. CHttpConnection *m_pHttp;
  1491. CString m_strServer;
  1492. CString m_strIniPath;
  1493. AfxParseURL(server,dwType,m_strServer,m_strIniPath,m_dwPort);
  1494. if(dwType!=AFX_INET_SERVICE_HTTP)
  1495. {
  1496. return FALSE;
  1497. }
  1498. m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,5);
  1499. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1500. try
  1501. {
  1502. m_pHttp=m_cis.GetHttpConnection(m_strServer,m_dwPort);
  1503. }
  1504. catch(CInternetException* pEx)
  1505. {
  1506. return false;
  1507. }
  1508. CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
  1509. m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
  1510. try
  1511. {
  1512. pFile->SendRequest();
  1513. }
  1514. catch(CInternetException* pEx)
  1515. {
  1516. pFile->Close();
  1517. return false;
  1518. }
  1519. if(pFile)
  1520. {
  1521. CStdioFile csf;
  1522. csf.Open(m_strTempDir+"\\ip.txt",CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
  1523. char buf[2048];
  1524. int n;
  1525. while((n=pFile->Read(buf,2048))>0)
  1526. csf.Write(buf,n);
  1527. csf.Close();
  1528. pFile->Close();
  1529. }
  1530. CString strServerAddress ;
  1531. CStdioFile fp;
  1532. fp.Open (m_strTempDir+"\\ip.txt", CFile::modeRead);
  1533. fp.ReadString (strServerAddress);
  1534. fp.Close ();
  1535. char *szServerAddress = strServerAddress.GetBuffer(0);
  1536. strServerAddress.ReleaseBuffer();
  1537. /*for Client, IP and Port can be 0,
  1538. and for Server, IP is LocalIP, and Port is Listening Port*/
  1539. int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
  1540. 0,
  1541. HandleClientNetEvent,
  1542. this);
  1543. if( TRANSPORT_OK != nResult )
  1544. {
  1545. return 0;
  1546. }
  1547. DWORD dwRemoteIPValue = inet_addr(szServerAddress);
  1548. WORD wPort = SERVER_PORT;
  1549. if(g_conntype)wPort=GetPort();
  1550. nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
  1551. if( TRANSPORT_OK != nResult )
  1552. {
  1553. m_tClientTunnel.net_CloseSocket();
  1554. return 0;
  1555. }
  1556. return ProcessLoginRequest();
  1557. }
  1558. void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
  1559. {
  1560. if( Transport_ReadEv == nEventType )
  1561. {
  1562. if( NULL == pRecvMsg ) return;
  1563. TMessageHeader* pHeader = (TMessageHeader *)pRecvMsg;
  1564. char *pDataBuf = (char *)pRecvMsg + MESSAGE_HEADER_LEN;
  1565. WORD dwMessageID = pHeader->wMessageId;
  1566. switch(dwMessageID)
  1567. {
  1568. case MSG_LOGIN_RESP:
  1569. {
  1570. LOGIN_RESULT_STRU tLoginResult = {0};
  1571. memcpy(&tLoginResult, pDataBuf, sizeof(LOGIN_RESULT_STRU));
  1572. ProcessLoginResponse(&tLoginResult);
  1573. break;
  1574. }
  1575. case MSG_USERINFO_RESP:
  1576. {
  1577. break;
  1578. }
  1579. case MSG_LOGOUT_RESP:
  1580. {
  1581. break;
  1582. }
  1583. case MSG_CHATMESSAGE_RESP:
  1584. {
  1585. //AfxMessageBox("登陆成功");
  1586. static int i = 0;
  1587. TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pDataBuf;
  1588. ProcessChatMessageResponse((void *)pChatMessage);
  1589. break;
  1590. }
  1591. default:
  1592. {
  1593. break;
  1594. }
  1595. }
  1596. }
  1597. else if( Transport_CloseEv == nEventType )
  1598. {
  1599. OnDisconnect();
  1600. }
  1601. }
  1602. extern BOOL EncryptFile2(BYTE *buffer, DWORD leng, PCHAR szPassword);
  1603. void CMainFrame::OnTimer(UINT nIDEvent)
  1604. {
  1605. // TODO: Add your message handler code here and/or call default
  1606. if( 1 == nIDEvent )
  1607. {
  1608. KillTimer(nIDEvent);
  1609. CString version = _T ("Version 1.0");
  1610. BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);//status:此机用选片菜单项
  1611. // checked==1:此机用选片菜单项
  1612. // g_bStaffAchievementShow==1:此机用于员工业绩查看
  1613. if(checked && g_bStaffAchievementShow==0) // .此机用选片菜单项;
  1614. {
  1615. KillTimer(3);
  1616. #ifdef NEW_SKIN
  1617. Welcome weldlg;
  1618. weldlg.DoModal();
  1619. #endif
  1620. ChoosePhotoSkin dlg;
  1621. dlg.SetLiaPath ("1.lia");
  1622. if(dlg.DoModal ()!=IDOK)
  1623. {
  1624. PostMessage(WM_QUIT);
  1625. return;
  1626. }
  1627. if(dlg.m_exitcode==3)
  1628. {
  1629. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  1630. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  1631. }
  1632. else
  1633. {
  1634. ShowWindow(SW_SHOW);
  1635. #ifdef NEW_SKIN
  1636. if(m_pMainFrimDlg2==NULL)
  1637. {
  1638. m_pMainFrimDlg2=new MainFrimDlg2;
  1639. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  1640. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  1641. }
  1642. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1643. #endif
  1644. }
  1645. }
  1646. else if(g_bStaffAchievementShow==0) // .非选片、非查看员工业绩;
  1647. {
  1648. #ifdef NEW_SKIN
  1649. g_bNoConnDlg=1;
  1650. Welcome weldlg;
  1651. weldlg.DoModal();
  1652. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1653. ShowWindow(SW_SHOW);
  1654. g_bNoConnDlg=0;
  1655. if(g_bNoLoginLia) // Jeff.OnCreate里判断skin文件有5.lia, g_bNoLoginLia = 0, 无 g_bNoLoginLia = 1;
  1656. {
  1657. Login dlg;
  1658. dlg.SetLiaPath("5.lia");
  1659. dlg.DoModal();
  1660. }
  1661. else
  1662. {
  1663. Login3 dlg;
  1664. dlg.SetLiaPath("5.lia");
  1665. dlg.DoModal();
  1666. }
  1667. if(g_user.bLongin && g_pMainWnd2)
  1668. {
  1669. g_pMainWnd2->ShowBar (1);
  1670. InsideMsg();
  1671. }
  1672. #else
  1673. ShowWindow(SW_SHOW);
  1674. if(g_bNoLoginLia)
  1675. {
  1676. Login dlg;
  1677. dlg.SetLiaPath ("5.lia");
  1678. dlg.DoModal();
  1679. }
  1680. else
  1681. {
  1682. Login3 dlg;
  1683. dlg.SetLiaPath ("5.lia");
  1684. dlg.DoModal();
  1685. }
  1686. #endif
  1687. }
  1688. if(g_hmouse==NULL )//&& atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
  1689. {
  1690. g_hmouse=SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId ());
  1691. }
  1692. }
  1693. else if( 2 == nIDEvent ) //29秒后,若连接和发送未完成,将关闭连接和发送框;
  1694. {
  1695. KillTimer(2);
  1696. if(g_hConnectWnd )
  1697. ::SendMessage (g_hConnectWnd, WM_CLOSE, 0, 0);
  1698. if(g_hSendWnd )
  1699. ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
  1700. if(g_bStaffAchievementShow==0 && g_bConnLYFZ==0)
  1701. {
  1702. if(g_bGenBranchData==0)
  1703. {
  1704. if(g_branchip!="")
  1705. AfxMessageBox("连接分店:"+g_branchname+"失败!", MB_ICONINFORMATION);
  1706. else
  1707. AfxMessageBox("连接服务器失败!", MB_ICONINFORMATION);
  1708. }
  1709. OnDisconnect();
  1710. }
  1711. g_bSendOK=0; g_bNeedCoon=1;
  1712. }
  1713. else if( 3 == nIDEvent )
  1714. {
  1715. KillTimer(3);
  1716. #ifdef NEW_SKIN
  1717. Welcome weldlg;
  1718. weldlg.DoModal();
  1719. #endif
  1720. ShowWindow(SW_SHOW);
  1721. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  1722. g_sendhead.bsql=0;
  1723. g_sendhead.code[0]=24;
  1724. g_sendhead.code[1]=1;
  1725. g_sendhead.tabcount=2;
  1726. g_pMainWnd->ProcessChatMessageRequest2(1);
  1727. if(g_bSendOK==0)
  1728. {
  1729. return;
  1730. }
  1731. CArray<CStringArray, CStringArray>patharray;
  1732. CArray<CStringArray, CStringArray>userarray;
  1733. DataToArray(&g_cominfoarray,&g_hisyeararray);
  1734. g_userarray.SetSize( userarray.GetSize (), 1 );
  1735. int count=0;
  1736. for(int ii=0; ii<userarray.GetSize (); ii++)
  1737. {
  1738. if(userarray.ElementAt (ii).ElementAt (10)=="在职")
  1739. g_userarray.ElementAt (count++).Copy (userarray.ElementAt (ii));
  1740. }
  1741. g_userarray.SetSize( count, 1 );
  1742. StaffAchievementShowAll dlg;
  1743. g_pMainWnd->GetOcx();
  1744. dlg.DoModal ();
  1745. }
  1746. else if( 5 == nIDEvent )
  1747. {
  1748. if(g_bInSkin)return;
  1749. if(g_nAutoShowStaffAchievement==1)return;
  1750. if(g_bAllBranch)return;
  1751. if(g_user.bLongin)
  1752. {
  1753. // m_Mdi.CloseAll();
  1754. g_pMainWnd->OnCommandMenu(IDM_Logout);
  1755. }
  1756. /* g_nAutoShowStaffAchievement=1;
  1757. KillTimer(5);
  1758. StaffAchievementShowAll dlg;
  1759. g_pMainWnd->GetOcx();
  1760. dlg.DoModal ();*/
  1761. }
  1762. else if( 6 == nIDEvent )
  1763. {
  1764. static BOOL bDouble=0;
  1765. bDouble=!bDouble;
  1766. if(bDouble)
  1767. g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
  1768. else
  1769. g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
  1770. }
  1771. else if( 7 == nIDEvent )
  1772. {
  1773. KillTimer(7);
  1774. if(g_bInSkin)return;
  1775. if(g_nAutoShowStaffAchievement==1)return;
  1776. if(g_bAllBranch)return;
  1777. CString str=g_sInfo;
  1778. g_bConnLYFZ=1;
  1779. OnDisconnect();
  1780. BYTE *pData=new BYTE[str.GetLength ()];
  1781. memcpy(pData, str.GetBuffer (0), str.GetLength ());
  1782. str.ReleaseBuffer ();
  1783. EncryptFile2(pData, str.GetLength (), "888666333");
  1784. g_nSendCode=16;
  1785. g_pMainWnd->ProcessChatMessageRequest2(pData, str.GetLength ());
  1786. g_nSendCode=0;
  1787. delete []pData;
  1788. OnDisconnect();
  1789. g_bSendLYFZ=0;
  1790. g_bConnLYFZ=0;
  1791. if(g_bSendOK)
  1792. {
  1793. char *pStr=new char[g_nLeng+1];
  1794. memset(pStr, 0, g_nLeng+1);
  1795. memcpy(pStr, g_pData, g_nLeng);
  1796. CString str=pStr;
  1797. delete []pStr;
  1798. if(str=="g_bInSkin")
  1799. {
  1800. g_sendhead.bsql=1;
  1801. g_pMainWnd->ProcessChatMessageRequest2("update version set [setcheck1]='ok'");
  1802. }
  1803. }
  1804. }
  1805. }
  1806. void CMainFrame::OnOutbarNotify(CString strMsg)
  1807. {
  1808. if(g_user.bLongin==0)
  1809. {
  1810. if(g_bNoLoginLia)
  1811. {
  1812. Login dlg;
  1813. dlg.SetLiaPath ("5.lia");
  1814. dlg.DoModal();
  1815. }
  1816. else
  1817. {
  1818. Login3 dlg;
  1819. dlg.SetLiaPath ("5.lia");
  1820. dlg.DoModal();
  1821. }
  1822. return;
  1823. if(g_user.bLongin==0)return;
  1824. }
  1825. else
  1826. {
  1827. InsideMsg();
  1828. }
  1829. ResetTimer();
  1830. if(strMsg=="开单")
  1831. {
  1832. if(IsHasRights(0)==0)return;
  1833. /* UINT nID=0;
  1834. LPSTR pName ;
  1835. pName = (LPSTR)(LPCSTR)"开单";
  1836. OPEN_MENU(Booking);*/
  1837. Booking2 dlg;
  1838. dlg.DoModal ();
  1839. return;
  1840. }
  1841. else if(strMsg=="拍照")
  1842. {
  1843. if(IsHasRights(1)==0)return;
  1844. UINT nID=1;
  1845. LPSTR pName ;
  1846. pName = (LPSTR)(LPCSTR)"拍照";
  1847. OPEN_MENU(TakeFrom);
  1848. return;
  1849. }
  1850. else if(strMsg=="修片")
  1851. {
  1852. if(IsHasRights(1)==0)return;
  1853. UINT nID=1;
  1854. LPSTR pName ;
  1855. pName = (LPSTR)(LPCSTR)"修片";
  1856. OPEN_MENU(BeautifySkinFrom);
  1857. return;
  1858. }
  1859. else if(strMsg=="选片")
  1860. {
  1861. if(IsHasRights(2)==0)return;
  1862. UINT nID=1;
  1863. LPSTR pName ;
  1864. pName = (LPSTR)(LPCSTR)"选片";
  1865. OPEN_MENU(ChoosePhotoForm);
  1866. return;
  1867. }
  1868. else if(strMsg=="精修")
  1869. {
  1870. if(IsHasRights(2)==0)return;
  1871. UINT nID=1;
  1872. LPSTR pName ;
  1873. pName = (LPSTR)(LPCSTR)"精修";
  1874. OPEN_MENU(BeautifySkinFrom2);
  1875. return;
  1876. }
  1877. else if(strMsg=="设计")
  1878. {
  1879. if(IsHasRights(2)==0)return;
  1880. UINT nID=1;
  1881. LPSTR pName ;
  1882. pName = (LPSTR)(LPCSTR)"设计";
  1883. OPEN_MENU(DesignFrom);
  1884. return;
  1885. }
  1886. else if(strMsg=="数码安排")
  1887. {
  1888. UINT nID=1;
  1889. LPSTR pName ;
  1890. pName = (LPSTR)(LPCSTR)"数码安排";
  1891. OPEN_MENU(DigitalWork);
  1892. return;
  1893. }
  1894. else if(strMsg=="刻盘")
  1895. {
  1896. UINT nID=1;
  1897. LPSTR pName ;
  1898. pName = (LPSTR)(LPCSTR)"刻盘";
  1899. OPEN_MENU(BurnCD);
  1900. return;
  1901. }
  1902. else if(strMsg=="相片冲印")
  1903. {
  1904. UINT nID=1;
  1905. LPSTR pName ;
  1906. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  1907. OPEN_MENU(PhotoPrintFrom);
  1908. return;
  1909. }
  1910. else if(strMsg=="发片/取件")
  1911. {
  1912. if(IsHasRights(3)==0)return;
  1913. UINT nID=1;
  1914. LPSTR pName ;
  1915. pName = (LPSTR)(LPCSTR)"发片/取件";
  1916. OPEN_MENU(outsourcing);
  1917. return;
  1918. }
  1919. else if(strMsg=="满意度")
  1920. {
  1921. UINT nID=1;
  1922. LPSTR pName ;
  1923. pName = (LPSTR)(LPCSTR)"满意度";
  1924. OPEN_MENU(Satisfaction);
  1925. return;
  1926. }
  1927. else if(strMsg=="满意度图表")
  1928. {
  1929. UINT nID=1;
  1930. LPSTR pName ;
  1931. pName = (LPSTR)(LPCSTR)"满意度图表";
  1932. OPEN_MENU(SatisfactionForm);
  1933. return;
  1934. }
  1935. else if(strMsg=="回复统计")
  1936. {
  1937. UINT nID=1;
  1938. LPSTR pName ;
  1939. pName = (LPSTR)(LPCSTR)"回复统计";
  1940. OPEN_MENU(MsgReg2);
  1941. return;
  1942. }
  1943. /* else if(strMsg=="取件")
  1944. {
  1945. if(IsHasRights(3)==0)return;
  1946. UINT nID=1;
  1947. LPSTR pName ;
  1948. pName = (LPSTR)(LPCSTR)"取件";
  1949. OPEN_MENU(TakeAwayFrom);
  1950. return;
  1951. }*/
  1952. else if(strMsg=="其它收入")
  1953. {
  1954. if(IsHasRightsnew(16)==0)return;
  1955. // if(IsHasRightsnew(48)==0)return;
  1956. UINT nID=1;
  1957. LPSTR pName ;
  1958. pName = (LPSTR)(LPCSTR)"其它收入";
  1959. OPEN_MENU(IncomeInput);
  1960. return;
  1961. }
  1962. else if(strMsg=="其它二销")
  1963. {
  1964. if(IsHasRightsnew(16)==0)return;
  1965. UINT nID=1;
  1966. LPSTR pName ;
  1967. pName = (LPSTR)(LPCSTR)"其它二销";
  1968. OPEN_MENU(IncomeInput2);
  1969. return;
  1970. }
  1971. else if(strMsg=="员工奖罚")
  1972. {
  1973. if(IsHasRightsnew(16)==0)return;
  1974. UINT nID=1;
  1975. LPSTR pName ;
  1976. pName = (LPSTR)(LPCSTR)"员工奖罚";
  1977. OPEN_MENU(IncomeInput3);
  1978. return;
  1979. }
  1980. else if(strMsg=="员工奖惩")
  1981. {
  1982. if(IsHasRightsnew(16)==0)return;
  1983. UINT nID=1;
  1984. LPSTR pName ;
  1985. pName = (LPSTR)(LPCSTR)"员工奖惩";
  1986. OPEN_MENU(IncomeInput4);
  1987. return;
  1988. }
  1989. else if(strMsg=="订单收款")
  1990. {
  1991. if(IsHasRights(17)==0)return;
  1992. UINT nID=1;
  1993. LPSTR pName ;
  1994. pName = (LPSTR)(LPCSTR)"订单收款";
  1995. OPEN_MENU(FinanceForm);
  1996. return;
  1997. }
  1998. else if(strMsg=="日财务表")
  1999. {
  2000. if(IsHasRightsnew(22)==0)return;
  2001. UINT nID=2;
  2002. LPSTR pName ;
  2003. pName = (LPSTR)(LPCSTR)"日财务表";
  2004. OPEN_MENU(DailyForm);
  2005. return;
  2006. }
  2007. else if(strMsg=="提成比例")
  2008. {
  2009. #ifndef ENTERPRISE_VERSION
  2010. #ifndef CHILD_VERSION
  2011. #ifdef BASIC_VERSION
  2012. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2013. {
  2014. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2015. exit(0);return;
  2016. }
  2017. #else
  2018. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2019. {
  2020. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2021. exit(0);return;
  2022. }
  2023. #endif
  2024. #else
  2025. #ifdef BASIC_VERSION
  2026. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2027. {
  2028. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2029. exit(0);return;
  2030. }
  2031. #else
  2032. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2033. {
  2034. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2035. exit(0);return;
  2036. }
  2037. #endif
  2038. #endif
  2039. #else
  2040. #ifndef CHILD_VERSION
  2041. #ifdef BASIC_VERSION
  2042. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2043. {
  2044. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2045. exit(0);return;
  2046. }
  2047. #else
  2048. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2049. {
  2050. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2051. exit(0);return;
  2052. }
  2053. #endif
  2054. #else
  2055. #ifdef BASIC_VERSION
  2056. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2057. {
  2058. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2059. exit(0);return;
  2060. }
  2061. #else
  2062. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2063. {
  2064. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2065. exit(0);return;
  2066. }
  2067. #endif
  2068. #endif
  2069. #endif
  2070. UINT nID=2;
  2071. LPSTR pName ;
  2072. pName = (LPSTR)(LPCSTR)"提成比例";
  2073. OPEN_MENU(SalarySet2);
  2074. return;
  2075. }
  2076. //else if(strMsg=="员工工作")
  2077. else if(strMsg=="计件提成")
  2078. {
  2079. UINT nID=2;
  2080. LPSTR pName ;
  2081. //pName = (LPSTR)(LPCSTR)"员工工作";
  2082. pName = (LPSTR)(LPCSTR)"计件提成";
  2083. OPEN_MENU(SalarySet3);
  2084. return;
  2085. }
  2086. else if(strMsg=="工资管理")
  2087. {
  2088. #ifndef ENTERPRISE_VERSION
  2089. #ifndef CHILD_VERSION
  2090. #ifdef BASIC_VERSION
  2091. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2092. {
  2093. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2094. exit(0);return;
  2095. }
  2096. #else
  2097. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2098. {
  2099. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2100. exit(0);return;
  2101. }
  2102. #endif
  2103. #else
  2104. #ifdef BASIC_VERSION
  2105. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2106. {
  2107. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2108. exit(0);return;
  2109. }
  2110. #else
  2111. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2112. {
  2113. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2114. exit(0);return;
  2115. }
  2116. #endif
  2117. #endif
  2118. #else
  2119. #ifndef CHILD_VERSION
  2120. #ifdef BASIC_VERSION
  2121. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2122. {
  2123. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2124. exit(0);return;
  2125. }
  2126. #else
  2127. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2128. {
  2129. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2130. exit(0);return;
  2131. }
  2132. #endif
  2133. #else
  2134. #ifdef BASIC_VERSION
  2135. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2136. {
  2137. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2138. exit(0);return;
  2139. }
  2140. #else
  2141. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2142. {
  2143. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2144. exit(0);return;
  2145. }
  2146. #endif
  2147. #endif
  2148. #endif
  2149. UINT nID=2;
  2150. LPSTR pName ;
  2151. pName = (LPSTR)(LPCSTR)"工资管理";
  2152. OPEN_MENU(MySalary);
  2153. return;
  2154. }
  2155. else if(strMsg=="客人付款")
  2156. {
  2157. UINT nID=2;
  2158. LPSTR pName ;
  2159. pName = (LPSTR)(LPCSTR)"客人付款";
  2160. OPEN_MENU(ClientMoney);
  2161. return;
  2162. }
  2163. else if(strMsg=="工资报表")
  2164. {
  2165. #ifndef ENTERPRISE_VERSION
  2166. #ifndef CHILD_VERSION
  2167. #ifdef BASIC_VERSION
  2168. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2169. {
  2170. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2171. exit(0);return;
  2172. }
  2173. #else
  2174. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2175. {
  2176. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2177. exit(0);return;
  2178. }
  2179. #endif
  2180. #else
  2181. #ifdef BASIC_VERSION
  2182. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2183. {
  2184. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2185. exit(0);return;
  2186. }
  2187. #else
  2188. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2189. {
  2190. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2191. exit(0);return;
  2192. }
  2193. #endif
  2194. #endif
  2195. #else
  2196. #ifndef CHILD_VERSION
  2197. #ifdef BASIC_VERSION
  2198. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2199. {
  2200. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2201. exit(0);return;
  2202. }
  2203. #else
  2204. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2205. {
  2206. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2207. exit(0);return;
  2208. }
  2209. #endif
  2210. #else
  2211. #ifdef BASIC_VERSION
  2212. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2213. {
  2214. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2215. exit(0);return;
  2216. }
  2217. #else
  2218. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2219. {
  2220. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2221. exit(0);return;
  2222. }
  2223. #endif
  2224. #endif
  2225. #endif
  2226. if(IsHasRightsnew(25)==0)return;
  2227. UINT nID=2;
  2228. LPSTR pName ;
  2229. pName = (LPSTR)(LPCSTR)"工资报表";
  2230. g_ncount=100;
  2231. OPEN_MENU(MySalary);
  2232. return;
  2233. }
  2234. else if(strMsg=="员工业绩")
  2235. {
  2236. #ifndef ENTERPRISE_VERSION
  2237. #ifndef CHILD_VERSION
  2238. #ifdef BASIC_VERSION
  2239. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2240. {
  2241. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2242. exit(0);return;
  2243. }
  2244. #else
  2245. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2246. {
  2247. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2248. exit(0);return;
  2249. }
  2250. #endif
  2251. #else
  2252. #ifdef BASIC_VERSION
  2253. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2254. {
  2255. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2256. exit(0);return;
  2257. }
  2258. #else
  2259. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2260. {
  2261. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2262. exit(0);return;
  2263. }
  2264. #endif
  2265. #endif
  2266. #else
  2267. #ifndef CHILD_VERSION
  2268. #ifdef BASIC_VERSION
  2269. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2270. {
  2271. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2272. exit(0);return;
  2273. }
  2274. #else
  2275. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2276. {
  2277. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2278. exit(0);return;
  2279. }
  2280. #endif
  2281. #else
  2282. #ifdef BASIC_VERSION
  2283. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2284. {
  2285. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2286. exit(0);return;
  2287. }
  2288. #else
  2289. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2290. {
  2291. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2292. exit(0);return;
  2293. }
  2294. #endif
  2295. #endif
  2296. #endif
  2297. if(IsHasRightsnew(33)==0)return;
  2298. UINT nID=2;
  2299. LPSTR pName ;
  2300. pName = (LPSTR)(LPCSTR)"员工业绩";
  2301. OPEN_MENU(StaffAchievement);
  2302. return;
  2303. }
  2304. else if(strMsg=="订单客户")
  2305. {
  2306. UINT nID=2;
  2307. LPSTR pName ;
  2308. pName = (LPSTR)(LPCSTR)"订单客户";
  2309. g_dx+=10000;
  2310. OPEN_MENU(CClientForm);
  2311. if(g_dx>=10000)g_dx-=10000;
  2312. return;
  2313. }
  2314. else if(strMsg=="服务记录")
  2315. {
  2316. UINT nID=2;
  2317. LPSTR pName ;
  2318. pName = (LPSTR)(LPCSTR)"服务记录";
  2319. OPEN_MENU(CClientForm2);
  2320. return;
  2321. }
  2322. else if(strMsg=="服务统计")
  2323. {
  2324. UINT nID=2;
  2325. LPSTR pName ;
  2326. pName = (LPSTR)(LPCSTR)"服务统计";
  2327. OPEN_MENU(CClientForm3);
  2328. return;
  2329. }
  2330. else if(strMsg=="意向客户")
  2331. {
  2332. UINT nID=2;
  2333. LPSTR pName ;
  2334. pName = (LPSTR)(LPCSTR)"意向客户";
  2335. #ifdef LYFZ_VERSION
  2336. OPEN_MENU(Client2FormLYFZ);
  2337. #else
  2338. OPEN_MENU(Client2Form);
  2339. #endif
  2340. return;
  2341. }
  2342. else if(strMsg=="老客户")
  2343. {
  2344. UINT nID=2;
  2345. LPSTR pName ;
  2346. pName = (LPSTR)(LPCSTR)"老客户";
  2347. OPEN_MENU(OldClient);
  2348. return;
  2349. }
  2350. else if(strMsg=="客户来电")
  2351. {
  2352. UINT nID=2;
  2353. LPSTR pName ;
  2354. pName = (LPSTR)(LPCSTR)"客户来电";
  2355. OPEN_MENU(PhoneRecord);
  2356. return;
  2357. }
  2358. else if(strMsg=="拨出电话")
  2359. {
  2360. UINT nID=2;
  2361. LPSTR pName ;
  2362. pName = (LPSTR)(LPCSTR)"拨出电话";
  2363. OPEN_MENU(PhoneRecordOut);
  2364. return;
  2365. }
  2366. else if(strMsg=="未接来电")
  2367. {
  2368. UINT nID=2;
  2369. LPSTR pName ;
  2370. pName = (LPSTR)(LPCSTR)"未接来电";
  2371. OPEN_MENU(MissCall);
  2372. return;
  2373. }
  2374. else if(strMsg=="客户流失")
  2375. {
  2376. UINT nID=2;
  2377. LPSTR pName ;
  2378. pName = (LPSTR)(LPCSTR)"客户流失";
  2379. OPEN_MENU(ClientReasonChart);
  2380. return;
  2381. }
  2382. else if(strMsg=="客户来源")
  2383. {
  2384. UINT nID=2;
  2385. LPSTR pName ;
  2386. pName = (LPSTR)(LPCSTR)"客户来源";
  2387. OPEN_MENU(ClientFromChart);
  2388. return;
  2389. }
  2390. else if(strMsg=="月财务表")
  2391. {
  2392. if(IsHasRightsnew(23)==0)return;
  2393. UINT nID=2;
  2394. LPSTR pName ;
  2395. pName = (LPSTR)(LPCSTR)"月财务表";
  2396. OPEN_MENU(MonthForm);
  2397. return;
  2398. }
  2399. else if(strMsg=="支出报表")
  2400. {
  2401. if(IsHasRightsnew(23)==0)return;
  2402. UINT nID=2;
  2403. LPSTR pName ;
  2404. pName = (LPSTR)(LPCSTR)"支出报表";
  2405. OPEN_MENU(MonthForm2);
  2406. return;
  2407. }
  2408. else if(strMsg=="年财务表")
  2409. {
  2410. if(IsHasRightsnew(24)==0)return;
  2411. UINT nID=2;
  2412. LPSTR pName ;
  2413. pName = (LPSTR)(LPCSTR)"年财务表";
  2414. OPEN_MENU(YearForm);
  2415. return;
  2416. }
  2417. else if(strMsg=="年财务图表")
  2418. {
  2419. if(IsHasRightsnew(24)==0)return;
  2420. GetOcx();
  2421. UINT nID=2;
  2422. LPSTR pName ;
  2423. pName = (LPSTR)(LPCSTR)"年财务图表";
  2424. OPEN_MENU(YearForm2);
  2425. return;
  2426. }
  2427. else if(strMsg=="订单图表")
  2428. {
  2429. GetOcx();
  2430. UINT nID=2;
  2431. LPSTR pName ;
  2432. pName = (LPSTR)(LPCSTR)"订单图表";
  2433. OPEN_MENU(DinDanForm);
  2434. return;
  2435. }
  2436. #ifdef ENTERPRISE_VERSION
  2437. else if(strMsg=="订单报表")
  2438. {
  2439. GetOcx();
  2440. UINT nID=2;
  2441. LPSTR pName ;
  2442. pName = (LPSTR)(LPCSTR)"订单报表2";
  2443. OPEN_MENU(DinDanFromBranch);
  2444. return;
  2445. }
  2446. else if(strMsg=="财务图表")
  2447. {
  2448. GetOcx();
  2449. UINT nID=2;
  2450. LPSTR pName ;
  2451. pName = (LPSTR)(LPCSTR)"财务图表";
  2452. OPEN_MENU(YearFormBranch);
  2453. return;
  2454. }
  2455. else if(strMsg=="订单图表")
  2456. {
  2457. GetOcx();
  2458. UINT nID=2;
  2459. LPSTR pName ;
  2460. pName = (LPSTR)(LPCSTR)"订单图表";
  2461. OPEN_MENU(YearFormBranch2);
  2462. return;
  2463. }
  2464. else if(strMsg=="摄控安排")
  2465. {
  2466. UINT nID=2;
  2467. LPSTR pName ;
  2468. pName = (LPSTR)(LPCSTR)"摄控安排";
  2469. g_bookingtype=0;
  2470. OPEN_MENU(TodayForm);
  2471. return;
  2472. }
  2473. else if(strMsg=="选片预约")
  2474. {
  2475. UINT nID=2;
  2476. LPSTR pName ;
  2477. pName = (LPSTR)(LPCSTR)"选片预约";
  2478. g_bookingtype=1;
  2479. OPEN_MENU(TodayForm);
  2480. return;
  2481. }
  2482. else if(strMsg=="看样预约")
  2483. {
  2484. UINT nID=2;
  2485. LPSTR pName ;
  2486. pName = (LPSTR)(LPCSTR)"看样预约";
  2487. g_bookingtype=2;
  2488. OPEN_MENU(TodayForm);
  2489. return;
  2490. }
  2491. else if(strMsg=="取件预约")
  2492. {
  2493. UINT nID=2;
  2494. LPSTR pName ;
  2495. pName = (LPSTR)(LPCSTR)"取件预约";
  2496. g_bookingtype=3;
  2497. OPEN_MENU(TodayForm);
  2498. return;
  2499. }
  2500. else if(strMsg=="婚庆安排")
  2501. {
  2502. UINT nID=2;
  2503. LPSTR pName ;
  2504. pName = (LPSTR)(LPCSTR)"婚庆安排";
  2505. g_bookingtype=4;
  2506. OPEN_MENU(TodayForm);
  2507. return;
  2508. }
  2509. #endif
  2510. else if(strMsg=="员工资料")
  2511. {
  2512. UINT nID=2;
  2513. LPSTR pName ;
  2514. pName = (LPSTR)(LPCSTR)"员工资料";
  2515. if(g_bAllBranch)
  2516. OPEN_MENU(EmployeeForm2);
  2517. else
  2518. OPEN_MENU(EmployeeForm);
  2519. return;
  2520. }
  2521. else if(strMsg=="客户区域")
  2522. {
  2523. // if(IsHasRightsnew(48)==0)return;
  2524. GetOcx();
  2525. UINT nID=2;
  2526. LPSTR pName ;
  2527. pName = (LPSTR)(LPCSTR)"客户区域";
  2528. OPEN_MENU(AreaClient);
  2529. return;
  2530. }
  2531. else if(strMsg=="客户报表")
  2532. {
  2533. UINT nID=3;
  2534. LPSTR pName ;
  2535. pName = (LPSTR)(LPCSTR)"客户报表";
  2536. OPEN_MENU(CClientForm);
  2537. return;
  2538. }
  2539. else if(strMsg=="每日签到")
  2540. {
  2541. UINT nID=3;
  2542. LPSTR pName ;
  2543. pName = (LPSTR)(LPCSTR)"每日签到";
  2544. OPEN_MENU(WorkerReport);
  2545. return;
  2546. }
  2547. else if(strMsg=="服务费")
  2548. {
  2549. UINT nID=3;
  2550. LPSTR pName ;
  2551. pName = (LPSTR)(LPCSTR)"服务费";
  2552. OPEN_MENU(annualfee);
  2553. return;
  2554. }
  2555. else if(strMsg=="现金支出")
  2556. {
  2557. if(IsHasRightsnew(16)==0)return;
  2558. UINT nID=3;
  2559. LPSTR pName ;
  2560. pName = (LPSTR)(LPCSTR)"现金支出";
  2561. OPEN_MENU(PayOutInput);
  2562. return;
  2563. }
  2564. else if(strMsg=="短信群发")
  2565. {
  2566. UINT nID=3;
  2567. LPSTR pName ;
  2568. pName = (LPSTR)(LPCSTR)"短信群发";
  2569. OPEN_MENU(SendMsg);
  2570. return;
  2571. }
  2572. else if(strMsg=="短信发送")
  2573. {
  2574. UINT nID=3;
  2575. LPSTR pName ;
  2576. pName = (LPSTR)(LPCSTR)"客户报表";
  2577. OPEN_MENU(CClientForm);
  2578. return;
  2579. }
  2580. else if(strMsg=="流程短信")
  2581. {
  2582. UINT nID=3;
  2583. LPSTR pName ;
  2584. pName = (LPSTR)(LPCSTR)"流程短信";
  2585. OPEN_MENU(WorkMsg);
  2586. return;
  2587. }
  2588. else if(strMsg=="员工短信")
  2589. {
  2590. UINT nID=3;
  2591. LPSTR pName ;
  2592. pName = (LPSTR)(LPCSTR)"员工短信";
  2593. OPEN_MENU(EmployeeMsg);
  2594. return;
  2595. }
  2596. else if(strMsg=="发送记录")
  2597. {
  2598. UINT nID=3;
  2599. LPSTR pName ;
  2600. pName = (LPSTR)(LPCSTR)"发送记录";
  2601. OPEN_MENU(MsgReg);
  2602. return;
  2603. }
  2604. else if(strMsg=="短信设置")
  2605. {
  2606. if(IsHasRightsnew(49)==0)return;
  2607. MsgSet dlg;
  2608. dlg.DoModal();
  2609. return;
  2610. }
  2611. else if(strMsg=="金卡会员")
  2612. {
  2613. #ifndef ENTERPRISE_VERSION
  2614. #ifndef CHILD_VERSION
  2615. #ifdef BASIC_VERSION
  2616. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2617. {
  2618. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2619. exit(0);return;
  2620. }
  2621. #else
  2622. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2623. {
  2624. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2625. exit(0);return;
  2626. }
  2627. #endif
  2628. #else
  2629. #ifdef BASIC_VERSION
  2630. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2631. {
  2632. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2633. exit(0);return;
  2634. }
  2635. #else
  2636. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2637. {
  2638. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2639. exit(0);return;
  2640. }
  2641. #endif
  2642. #endif
  2643. #else
  2644. #ifndef CHILD_VERSION
  2645. #ifdef BASIC_VERSION
  2646. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2647. {
  2648. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2649. exit(0);return;
  2650. }
  2651. #else
  2652. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2653. {
  2654. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2655. exit(0);return;
  2656. }
  2657. #endif
  2658. #else
  2659. #ifdef BASIC_VERSION
  2660. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2661. {
  2662. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2663. exit(0);return;
  2664. }
  2665. #else
  2666. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2667. {
  2668. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2669. exit(0);return;
  2670. }
  2671. #endif
  2672. #endif
  2673. #endif
  2674. UINT nID=3;
  2675. LPSTR pName ;
  2676. pName = (LPSTR)(LPCSTR)"金卡会员";
  2677. OPEN_MENU(ShowMember);
  2678. return;
  2679. }
  2680. else if(strMsg=="现金子卡")
  2681. {
  2682. UINT nID=3;
  2683. LPSTR pName ;
  2684. pName = (LPSTR)(LPCSTR)"现金子卡";
  2685. OPEN_MENU(ShowMember2);
  2686. return;
  2687. }
  2688. else if(strMsg=="蓝钻会员")
  2689. {
  2690. #ifndef ENTERPRISE_VERSION
  2691. #ifndef CHILD_VERSION
  2692. #ifdef BASIC_VERSION
  2693. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2694. {
  2695. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2696. exit(0);return;
  2697. }
  2698. #else
  2699. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2700. {
  2701. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2702. exit(0);return;
  2703. }
  2704. #endif
  2705. #else
  2706. #ifdef BASIC_VERSION
  2707. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2708. {
  2709. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2710. exit(0);return;
  2711. }
  2712. #else
  2713. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2714. {
  2715. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2716. exit(0);return;
  2717. }
  2718. #endif
  2719. #endif
  2720. #else
  2721. #ifndef CHILD_VERSION
  2722. #ifdef BASIC_VERSION
  2723. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2724. {
  2725. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2726. exit(0);return;
  2727. }
  2728. #else
  2729. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2730. {
  2731. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2732. exit(0);return;
  2733. }
  2734. #endif
  2735. #else
  2736. #ifdef BASIC_VERSION
  2737. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2738. {
  2739. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2740. exit(0);return;
  2741. }
  2742. #else
  2743. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2744. {
  2745. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2746. exit(0);return;
  2747. }
  2748. #endif
  2749. #endif
  2750. #endif
  2751. UINT nID=3;
  2752. LPSTR pName ;
  2753. pName = (LPSTR)(LPCSTR)"蓝钻会员";
  2754. OPEN_MENU(ShowMemberBlue);
  2755. return;
  2756. }
  2757. else if(strMsg=="转介绍积分")
  2758. {
  2759. #ifndef ENTERPRISE_VERSION
  2760. #ifndef CHILD_VERSION
  2761. #ifdef BASIC_VERSION
  2762. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2763. {
  2764. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2765. exit(0);return;
  2766. }
  2767. #else
  2768. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2769. {
  2770. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2771. exit(0);return;
  2772. }
  2773. #endif
  2774. #else
  2775. #ifdef BASIC_VERSION
  2776. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2777. {
  2778. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2779. exit(0);return;
  2780. }
  2781. #else
  2782. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2783. {
  2784. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2785. exit(0);return;
  2786. }
  2787. #endif
  2788. #endif
  2789. #else
  2790. #ifndef CHILD_VERSION
  2791. #ifdef BASIC_VERSION
  2792. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2793. {
  2794. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2795. exit(0);return;
  2796. }
  2797. #else
  2798. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2799. {
  2800. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2801. exit(0);return;
  2802. }
  2803. #endif
  2804. #else
  2805. #ifdef BASIC_VERSION
  2806. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2807. {
  2808. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2809. exit(0);return;
  2810. }
  2811. #else
  2812. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2813. {
  2814. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2815. exit(0);return;
  2816. }
  2817. #endif
  2818. #endif
  2819. #endif
  2820. UINT nID=3;
  2821. LPSTR pName ;
  2822. pName = (LPSTR)(LPCSTR)"转介绍积分";
  2823. OPEN_MENU(Card2Reg);
  2824. return;
  2825. }
  2826. /* else if(strMsg=="转介绍图表")
  2827. {
  2828. #ifndef ENTERPRISE_VERSION
  2829. #ifndef CHILD_VERSION
  2830. #ifdef BASIC_VERSION
  2831. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2832. {
  2833. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2834. exit(0);return;
  2835. }
  2836. #else
  2837. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2838. {
  2839. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2840. exit(0);return;
  2841. }
  2842. #endif
  2843. #else
  2844. #ifdef BASIC_VERSION
  2845. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2846. {
  2847. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2848. exit(0);return;
  2849. }
  2850. #else
  2851. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2852. {
  2853. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2854. exit(0);return;
  2855. }
  2856. #endif
  2857. #endif
  2858. #else
  2859. #ifndef CHILD_VERSION
  2860. #ifdef BASIC_VERSION
  2861. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2862. {
  2863. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2864. exit(0);return;
  2865. }
  2866. #else
  2867. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2868. {
  2869. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2870. exit(0);return;
  2871. }
  2872. #endif
  2873. #else
  2874. #ifdef BASIC_VERSION
  2875. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2876. {
  2877. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2878. exit(0);return;
  2879. }
  2880. #else
  2881. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2882. {
  2883. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2884. exit(0);return;
  2885. }
  2886. #endif
  2887. #endif
  2888. #endif
  2889. UINT nID=3;
  2890. LPSTR pName ;
  2891. pName = (LPSTR)(LPCSTR)"转介绍图表";
  2892. OPEN_MENU(Card2RegChart);
  2893. return;
  2894. }*/
  2895. else if(strMsg=="金卡图表")
  2896. {
  2897. UINT nID=3;
  2898. LPSTR pName ;
  2899. pName = (LPSTR)(LPCSTR)"金卡图表";
  2900. OPEN_MENU(MemberChart);
  2901. return;
  2902. }
  2903. else if(strMsg=="积分短信")
  2904. {
  2905. UINT nID=3;
  2906. LPSTR pName ;
  2907. pName = (LPSTR)(LPCSTR)"积分短信";
  2908. OPEN_MENU(ShowMemberMsg);
  2909. return;
  2910. }
  2911. else if(strMsg=="转介绍返现")
  2912. {
  2913. #ifndef ENTERPRISE_VERSION
  2914. #ifndef CHILD_VERSION
  2915. #ifdef BASIC_VERSION
  2916. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2917. {
  2918. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2919. exit(0);return;
  2920. }
  2921. #else
  2922. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2923. {
  2924. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2925. exit(0);return;
  2926. }
  2927. #endif
  2928. #else
  2929. #ifdef BASIC_VERSION
  2930. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  2931. {
  2932. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2933. exit(0);return;
  2934. }
  2935. #else
  2936. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  2937. {
  2938. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2939. exit(0);return;
  2940. }
  2941. #endif
  2942. #endif
  2943. #else
  2944. #ifndef CHILD_VERSION
  2945. #ifdef BASIC_VERSION
  2946. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  2947. {
  2948. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2949. exit(0);return;
  2950. }
  2951. #else
  2952. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  2953. {
  2954. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2955. exit(0);return;
  2956. }
  2957. #endif
  2958. #else
  2959. #ifdef BASIC_VERSION
  2960. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  2961. {
  2962. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2963. exit(0);return;
  2964. }
  2965. #else
  2966. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  2967. {
  2968. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2969. exit(0);return;
  2970. }
  2971. #endif
  2972. #endif
  2973. #endif
  2974. UINT nID=3;
  2975. LPSTR pName ;
  2976. pName = (LPSTR)(LPCSTR)"转介绍返现";
  2977. OPEN_MENU(Card2RegBlue);
  2978. return;
  2979. }
  2980. else if(strMsg=="转介绍图表")
  2981. {
  2982. #ifndef ENTERPRISE_VERSION
  2983. #ifndef CHILD_VERSION
  2984. #ifdef BASIC_VERSION
  2985. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  2986. {
  2987. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2988. exit(0);return;
  2989. }
  2990. #else
  2991. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  2992. {
  2993. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  2994. exit(0);return;
  2995. }
  2996. #endif
  2997. #else
  2998. #ifdef BASIC_VERSION
  2999. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3000. {
  3001. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3002. exit(0);return;
  3003. }
  3004. #else
  3005. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3006. {
  3007. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3008. exit(0);return;
  3009. }
  3010. #endif
  3011. #endif
  3012. #else
  3013. #ifndef CHILD_VERSION
  3014. #ifdef BASIC_VERSION
  3015. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3016. {
  3017. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3018. exit(0);return;
  3019. }
  3020. #else
  3021. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3022. {
  3023. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3024. exit(0);return;
  3025. }
  3026. #endif
  3027. #else
  3028. #ifdef BASIC_VERSION
  3029. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3030. {
  3031. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3032. exit(0);return;
  3033. }
  3034. #else
  3035. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3036. {
  3037. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3038. exit(0);return;
  3039. }
  3040. #endif
  3041. #endif
  3042. #endif
  3043. UINT nID=3;
  3044. LPSTR pName ;
  3045. pName = (LPSTR)(LPCSTR)"转介绍图表";
  3046. OPEN_MENU(Card2RegChartBlue);
  3047. return;
  3048. }
  3049. else if(strMsg=="积分设置")
  3050. {
  3051. if(IsHasRightsnew(49)==0)return;
  3052. MemberSet dlg;
  3053. dlg.DoModal();
  3054. return;
  3055. }
  3056. else if(strMsg=="礼服录入")
  3057. {
  3058. if(IsHasRightsnew(39)==0)return;
  3059. UINT nID=3;
  3060. LPSTR pName ;
  3061. pName = (LPSTR)(LPCSTR)"礼服录入";
  3062. OPEN_MENU(DressManage);
  3063. return;
  3064. }
  3065. else if(strMsg=="礼服查看")
  3066. {
  3067. #ifndef ENTERPRISE_VERSION
  3068. #ifndef CHILD_VERSION
  3069. #ifdef BASIC_VERSION
  3070. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3071. {
  3072. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3073. exit(0);return;
  3074. }
  3075. #else
  3076. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3077. {
  3078. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3079. exit(0);return;
  3080. }
  3081. #endif
  3082. #else
  3083. #ifdef BASIC_VERSION
  3084. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3085. {
  3086. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3087. exit(0);return;
  3088. }
  3089. #else
  3090. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3091. {
  3092. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3093. exit(0);return;
  3094. }
  3095. #endif
  3096. #endif
  3097. #else
  3098. #ifndef CHILD_VERSION
  3099. #ifdef BASIC_VERSION
  3100. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3101. {
  3102. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3103. exit(0);return;
  3104. }
  3105. #else
  3106. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3107. {
  3108. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3109. exit(0);return;
  3110. }
  3111. #endif
  3112. #else
  3113. #ifdef BASIC_VERSION
  3114. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3115. {
  3116. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3117. exit(0);return;
  3118. }
  3119. #else
  3120. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3121. {
  3122. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3123. exit(0);return;
  3124. }
  3125. #endif
  3126. #endif
  3127. #endif
  3128. if(IsHasRightsnew(40)==0)return;
  3129. UINT nID=3;
  3130. LPSTR pName ;
  3131. pName = (LPSTR)(LPCSTR)"礼服查看";
  3132. OPEN_MENU(ShowDress);
  3133. return;
  3134. }
  3135. else if(strMsg=="撞期预警")
  3136. {
  3137. UINT nID=3;
  3138. LPSTR pName ;
  3139. pName = (LPSTR)(LPCSTR)"撞期预警";
  3140. OPEN_MENU(DressEarlyWarning);
  3141. return;
  3142. }
  3143. else if(strMsg=="礼服出租")
  3144. {
  3145. UINT nID=3;
  3146. LPSTR pName ;
  3147. pName = (LPSTR)(LPCSTR)"礼服出租";
  3148. OPEN_MENU(ShowHireReg);
  3149. return;
  3150. }
  3151. else if(strMsg=="礼服图片")
  3152. {
  3153. ShowPic dlg;
  3154. dlg.m_mode=4;
  3155. dlg.m_path=g_path5+"\\";
  3156. dlg.DoModal ();
  3157. return;
  3158. }
  3159. else if(strMsg=="商品类别设置")
  3160. {
  3161. if(IsHasRightsnew(29)==0)return;
  3162. SPLBDlg dlg;
  3163. dlg.DoModal ();
  3164. return;
  3165. }
  3166. else if(strMsg=="商品名称设置")
  3167. {
  3168. if(IsHasRightsnew(29)==0)return;
  3169. UINT nID=3;
  3170. LPSTR pName ;
  3171. pName = (LPSTR)(LPCSTR)"商品设置";
  3172. OPEN_MENU(ShangPin);
  3173. return;
  3174. }
  3175. else if(strMsg=="固定资产管理")
  3176. {
  3177. UINT nID=3;
  3178. LPSTR pName ;
  3179. pName = (LPSTR)(LPCSTR)"固定资产管理";
  3180. OPEN_MENU(FixedAssets);
  3181. return;
  3182. }
  3183. else if(strMsg=="入库单")
  3184. {
  3185. if(IsHasRightsnew(44)==0)return;
  3186. InputGoods dlg;
  3187. dlg.DoModal ();
  3188. return;
  3189. }
  3190. else if(strMsg=="出库单")
  3191. {
  3192. #ifndef ENTERPRISE_VERSION
  3193. #ifndef CHILD_VERSION
  3194. #ifdef BASIC_VERSION
  3195. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3196. {
  3197. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3198. exit(0);return;
  3199. }
  3200. #else
  3201. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3202. {
  3203. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3204. exit(0);return;
  3205. }
  3206. #endif
  3207. #else
  3208. #ifdef BASIC_VERSION
  3209. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3210. {
  3211. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3212. exit(0);return;
  3213. }
  3214. #else
  3215. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3216. {
  3217. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3218. exit(0);return;
  3219. }
  3220. #endif
  3221. #endif
  3222. #else
  3223. #ifndef CHILD_VERSION
  3224. #ifdef BASIC_VERSION
  3225. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3226. {
  3227. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3228. exit(0);return;
  3229. }
  3230. #else
  3231. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3232. {
  3233. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3234. exit(0);return;
  3235. }
  3236. #endif
  3237. #else
  3238. #ifdef BASIC_VERSION
  3239. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3240. {
  3241. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3242. exit(0);return;
  3243. }
  3244. #else
  3245. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3246. {
  3247. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3248. exit(0);return;
  3249. }
  3250. #endif
  3251. #endif
  3252. #endif
  3253. if(IsHasRightsnew(45)==0)return;
  3254. InputGoods dlg;
  3255. dlg.m_mode=1;
  3256. dlg.DoModal ();
  3257. return;
  3258. }
  3259. else if(strMsg=="库存查询")
  3260. {
  3261. #ifndef ENTERPRISE_VERSION
  3262. #ifndef CHILD_VERSION
  3263. #ifdef BASIC_VERSION
  3264. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
  3265. {
  3266. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3267. exit(0);return;
  3268. }
  3269. #else
  3270. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
  3271. {
  3272. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3273. exit(0);return;
  3274. }
  3275. #endif
  3276. #else
  3277. #ifdef BASIC_VERSION
  3278. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
  3279. {
  3280. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3281. exit(0);return;
  3282. }
  3283. #else
  3284. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
  3285. {
  3286. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3287. exit(0);return;
  3288. }
  3289. #endif
  3290. #endif
  3291. #else
  3292. #ifndef CHILD_VERSION
  3293. #ifdef BASIC_VERSION
  3294. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
  3295. {
  3296. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3297. exit(0);return;
  3298. }
  3299. #else
  3300. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
  3301. {
  3302. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3303. exit(0);return;
  3304. }
  3305. #endif
  3306. #else
  3307. #ifdef BASIC_VERSION
  3308. if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
  3309. {
  3310. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3311. exit(0);return;
  3312. }
  3313. #else
  3314. if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
  3315. {
  3316. AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
  3317. exit(0);return;
  3318. }
  3319. #endif
  3320. #endif
  3321. #endif
  3322. UINT nID=3;
  3323. LPSTR pName ;
  3324. pName = (LPSTR)(LPCSTR)"库存查询";
  3325. OPEN_MENU(ShowGoods);
  3326. return;
  3327. }
  3328. else if(strMsg=="商品图表")
  3329. {
  3330. UINT nID=3;
  3331. LPSTR pName ;
  3332. pName = (LPSTR)(LPCSTR)"商品图表";
  3333. OPEN_MENU(StoreInfoChart);
  3334. return;
  3335. }
  3336. else if(strMsg=="成本核算")
  3337. {
  3338. UINT nID=3;
  3339. LPSTR pName ;
  3340. pName = (LPSTR)(LPCSTR)"成本核算";
  3341. OPEN_MENU(CostCal);
  3342. return;
  3343. }
  3344. else if(strMsg=="考勤记录")
  3345. {
  3346. UINT nID=3;
  3347. LPSTR pName ;
  3348. pName = (LPSTR)(LPCSTR)"考勤记录";
  3349. OPEN_MENU(LoginReg);
  3350. return;
  3351. }
  3352. else if(strMsg=="月统计")
  3353. {
  3354. UINT nID=3;
  3355. LPSTR pName ;
  3356. pName = (LPSTR)(LPCSTR)"月统计";
  3357. OPEN_MENU(LoginReg2);
  3358. return;
  3359. }
  3360. else if(strMsg=="时间设置")
  3361. {
  3362. if(IsHasRightsnew(21)==0)return;
  3363. SetLoginTime dlg;
  3364. dlg.DoModal ();
  3365. return;
  3366. }
  3367. else if(strMsg=="排班设置")
  3368. {
  3369. if(IsHasRightsnew(21)==0)return;
  3370. SetLoginBan dlg;
  3371. dlg.DoModal ();
  3372. return;
  3373. }
  3374. else if(strMsg=="意向查询")
  3375. {
  3376. UINT nID=3;
  3377. LPSTR pName ;
  3378. pName = (LPSTR)(LPCSTR)"意向查询";
  3379. OPEN_MENU(HospitalClient);
  3380. return;
  3381. }
  3382. else if(strMsg=="今日提醒")
  3383. {
  3384. UINT nID=3;
  3385. LPSTR pName ;
  3386. pName = (LPSTR)(LPCSTR)"今日提醒";
  3387. OPEN_MENU(HospitalClientAlarm);
  3388. return;
  3389. }
  3390. else if(strMsg=="跟踪短信")
  3391. {
  3392. UINT nID=3;
  3393. LPSTR pName ;
  3394. pName = (LPSTR)(LPCSTR)"跟踪短信";
  3395. OPEN_MENU(HospitalClientMsg);
  3396. return;
  3397. }
  3398. else if(strMsg=="意向单录入")
  3399. {
  3400. AddHospitalClient dlg;
  3401. dlg.DoModal();
  3402. return;
  3403. }
  3404. else if(strMsg=="资料设置")
  3405. {
  3406. HospitalInfoSet dlg;
  3407. dlg.DoModal ();
  3408. return;
  3409. }
  3410. #if 1 // Jeff.add.2014.07.08.多多福文件柜功能;
  3411. else if ( strMsg == "文件柜")
  3412. {
  3413. //FileManage dlg;
  3414. UINT nID=3;
  3415. LPSTR pName ;
  3416. pName = (LPSTR)(LPCSTR)"文件柜";
  3417. OPEN_MENU(FileManage);
  3418. return;
  3419. }
  3420. #endif
  3421. AfxMessageBox(strMsg+",开发中...");
  3422. }
  3423. void CMainFrame::AutoUpdate()
  3424. {
  3425. if(g_bBranchModify)
  3426. {
  3427. AfxMessageBox("此店与分店"+g_branchname+"软件版本不同,请同时升级! ");
  3428. return;
  3429. }
  3430. else if(g_branchname!="")
  3431. {
  3432. AfxMessageBox("此店与分店"+g_branchname+"软件版本不同,请同时升级! ");
  3433. return;
  3434. }
  3435. g_ntimeout=30000;
  3436. if(!::PathFileExists (g_mainpath+"\\AutoUpdate.exe"))
  3437. {
  3438. g_sendhead.bsql=0;
  3439. g_sendhead.code[0]=99;
  3440. g_sendhead.tabcount=1;
  3441. g_pMainWnd->ProcessChatMessageRequest2(99);
  3442. if(g_bSendOK==0)
  3443. goto failed;
  3444. CFile fp;
  3445. fp.Open (g_mainpath+"\\AutoUpdate.exe", CFile::modeWrite|CFile::modeCreate);
  3446. fp.Write (g_pData, g_nLeng);
  3447. fp.Close ();
  3448. }
  3449. {
  3450. ::DeleteFile (g_mainpath+"\\YLGL2.exe");
  3451. g_sendhead.bsql=0;
  3452. g_sendhead.code[0]=98;
  3453. g_sendhead.tabcount=1;
  3454. g_pMainWnd->ProcessChatMessageRequest2(99);if(g_bSendOK==0)goto failed;
  3455. CFile fp;
  3456. fp.Open (g_mainpath+"\\YLGL2.exe", CFile::modeWrite|CFile::modeCreate);
  3457. fp.Write (g_pData, g_nLeng);
  3458. fp.Close ();
  3459. }
  3460. AfxMessageBox("自动升级成功!", MB_ICONINFORMATION);
  3461. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\AutoUpdate.exe"), "12345", NULL, SW_SHOWNORMAL);
  3462. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3463. exit(0);
  3464. return ;
  3465. failed:
  3466. AfxMessageBox("自动升级失败!", MB_ICONINFORMATION);
  3467. if(g_ntimeout==30000)//非远程
  3468. {
  3469. AfxMessageBox("提醒:升级过程中需要传输较多的数据,如果网速慢可能导致远程升级失败!\r\n\
  3470. 可拷贝店内客户端用QQ传过来覆盖除dbconfig.dat的文件即可。", MB_ICONINFORMATION);
  3471. }
  3472. g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
  3473. }
  3474. void CMainFrame::Onchoosephotoskin() //Jeff:此机用于选片菜单项;不在使用2014.06.16
  3475. {
  3476. if(g_user.bLongin==0)
  3477. {
  3478. if(g_bNoLoginLia)
  3479. {
  3480. Login dlg;
  3481. dlg.SetLiaPath ("5.lia");
  3482. dlg.DoModal();
  3483. }
  3484. else
  3485. {
  3486. Login3 dlg;
  3487. dlg.SetLiaPath ("5.lia");
  3488. dlg.DoModal();
  3489. }
  3490. if(g_user.bLongin==0)return;
  3491. }
  3492. // TODO: Add your command handler code here
  3493. CString version = _T ("Version 1.0");
  3494. CMenu *pMenu=GetMenu();
  3495. CMenu* submenu = pMenu->GetSubMenu(1);
  3496. UINT status=submenu->GetMenuState(IDM_choosephotoskin, MF_BYCOMMAND );
  3497. if(status&MF_CHECKED)
  3498. {
  3499. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_UNCHECKED);
  3500. AfxGetApp()->WriteProfileInt (version, "status", 0);
  3501. }
  3502. else
  3503. {
  3504. submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
  3505. AfxGetApp()->WriteProfileInt (version, "status", 1);
  3506. }
  3507. }
  3508. BOOL CMainFrame::IsCtrlDown()
  3509. {
  3510. short state=GetKeyState(VK_LCONTROL);
  3511. BYTE sta=(BYTE)(state>>8);
  3512. state=GetKeyState(VK_RCONTROL);
  3513. BYTE sta2=(BYTE)(state>>8);
  3514. if(sta||sta2)
  3515. return 1;
  3516. else
  3517. return 0;
  3518. }//IsShiftDown
  3519. BOOL CMainFrame::IsShiftDown()
  3520. {
  3521. short state=GetKeyState(VK_LSHIFT);
  3522. BYTE sta=(BYTE)(state>>8);
  3523. state=GetKeyState(VK_RSHIFT);
  3524. BYTE sta2=(BYTE)(state>>8);
  3525. if(sta||sta2)
  3526. return 1;
  3527. else
  3528. return 0;
  3529. }
  3530. BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
  3531. {
  3532. // TODO: Add your specialized code here and/or call the base class IDM_Logout
  3533. if(pMsg->message==WM_KEYDOWN)
  3534. {
  3535. switch (pMsg->wParam)
  3536. {
  3537. case VK_F12:
  3538. g_pMainWnd->OnCommandMenu(IDM_Logout);
  3539. return 1;
  3540. case VK_F1:
  3541. ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  3542. return 1;
  3543. case VK_F2:
  3544. {
  3545. if(g_pMainWnd->m_bCheckF2F3 && (IsShiftDown()==0 || IsCtrlDown()==0) )return 1;
  3546. m_Mdi.MainClose();
  3547. if(g_user.bLongin)
  3548. {
  3549. SearchClient dlg;
  3550. dlg.SetLiaPath ("2.lia");
  3551. if(dlg.DoModal ()!=IDOK)
  3552. {
  3553. if(dlg.m_bLogout)
  3554. {
  3555. g_user.bLongin=0;
  3556. g_user.name.Empty ();
  3557. g_user.rights.Empty ();
  3558. g_user.account.Empty ();
  3559. goto ll;
  3560. }
  3561. PostMessage(WM_QUIT);
  3562. return 1;
  3563. }
  3564. if(dlg.m_exitcode==3)
  3565. {
  3566. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3567. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3568. }
  3569. else
  3570. {
  3571. ShowWindow(SW_SHOW);
  3572. #ifdef NEW_SKIN
  3573. if(m_pMainFrimDlg2==NULL)
  3574. {
  3575. m_pMainFrimDlg2=new MainFrimDlg2;
  3576. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3577. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3578. }
  3579. m_pMainFrimDlg2->ShowWindow(SW_SHOW);
  3580. g_bInSkin=0;
  3581. #endif
  3582. }
  3583. }
  3584. else
  3585. {
  3586. ll:
  3587. ChoosePhotoSkin dlg;
  3588. dlg.SetLiaPath ("1.lia");
  3589. if(dlg.DoModal ()!=IDOK)
  3590. {
  3591. PostMessage(WM_QUIT);
  3592. return 1;
  3593. }
  3594. if(dlg.m_exitcode==3)
  3595. {
  3596. keybd_event(VK_F3,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3597. keybd_event(VK_F3,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3598. }
  3599. else
  3600. {
  3601. ShowWindow(SW_SHOW);
  3602. #ifdef NEW_SKIN
  3603. if(m_pMainFrimDlg2==NULL)
  3604. {
  3605. m_pMainFrimDlg2=new MainFrimDlg2;
  3606. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3607. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3608. }
  3609. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3610. #endif
  3611. }
  3612. }
  3613. }
  3614. return 1;
  3615. case VK_F3:
  3616. {
  3617. if(g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown()==0 || g_pMainWnd->IsCtrlDown()==0) )return 1;
  3618. m_Mdi.MainClose();
  3619. if(g_user.bLongin)
  3620. {
  3621. SearchClient dlg;
  3622. dlg.m_mode =1;
  3623. dlg.SetLiaPath ("2.lia");
  3624. if(dlg.DoModal ()!=IDOK)
  3625. {
  3626. if(dlg.m_bLogout)
  3627. {
  3628. g_user.bLongin=0;
  3629. g_user.name.Empty ();
  3630. g_user.rights.Empty ();
  3631. g_user.account.Empty ();
  3632. goto mm;
  3633. }
  3634. PostMessage(WM_QUIT);
  3635. return 1;
  3636. }
  3637. if(dlg.m_exitcode==2)
  3638. {
  3639. keybd_event(VK_F2,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3640. keybd_event(VK_F2,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3641. }
  3642. else
  3643. {
  3644. ShowWindow(SW_SHOW);
  3645. #ifdef NEW_SKIN
  3646. if(m_pMainFrimDlg2==NULL)
  3647. {
  3648. m_pMainFrimDlg2=new MainFrimDlg2;
  3649. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3650. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3651. }
  3652. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3653. #endif
  3654. }
  3655. }
  3656. else
  3657. {
  3658. mm:
  3659. ChoosePhotoSkin dlg;
  3660. dlg.m_mode =1;
  3661. dlg.SetLiaPath ("1.lia");
  3662. if(dlg.DoModal ()!=IDOK)
  3663. {
  3664. PostMessage(WM_QUIT);
  3665. return 1;
  3666. }
  3667. if(dlg.m_exitcode==2)
  3668. {
  3669. keybd_event(VK_F2,0x45, KEYEVENTF_EXTENDEDKEY |0, 0 );
  3670. keybd_event(VK_F2,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP|0,0 );
  3671. }
  3672. else
  3673. {
  3674. ShowWindow(SW_SHOW);
  3675. #ifdef NEW_SKIN
  3676. if(m_pMainFrimDlg2==NULL)
  3677. {
  3678. m_pMainFrimDlg2=new MainFrimDlg2;
  3679. m_pMainFrimDlg2->SetLiaPath ("10.lia");
  3680. m_pMainFrimDlg2->Create (IDD_DLGmydlg, this);
  3681. }
  3682. m_pMainFrimDlg2->ShowWindow(SW_SHOW); g_bInSkin=0;
  3683. #endif
  3684. }
  3685. }
  3686. }
  3687. return 1;
  3688. case VK_F11:
  3689. if(g_bInSkin)return 1;
  3690. if(g_user.bLongin)
  3691. {
  3692. SqlDlg dlg;
  3693. dlg.DoModal ();
  3694. }
  3695. break;
  3696. #ifdef LYFZ_VERSION
  3697. case VK_F4:
  3698. if(g_user.bLongin)
  3699. {
  3700. g_sendhead.bsql=0;
  3701. g_sendhead.code[0]=199;
  3702. g_sendhead.tabcount=1;
  3703. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return 0;
  3704. DataToArray(&g_List1array);
  3705. CStdioFile fp;
  3706. CString path=g_mainpath+"\\NullBalance.txt";
  3707. ::DeleteFile (path);
  3708. fp.Open (path, CFile::modeCreate|CFile::modeWrite);
  3709. CString str;
  3710. for(int i=0; i<g_List1array.GetSize (); i++)
  3711. {
  3712. for(int j=0; j<g_List1array.ElementAt (0).GetSize (); j++)
  3713. {
  3714. str=g_List1array.ElementAt (0).ElementAt (j)+"\n";
  3715. str.TrimLeft ();
  3716. fp.WriteString (str);
  3717. }
  3718. }
  3719. fp.Close ();
  3720. ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
  3721. }
  3722. break;
  3723. #endif
  3724. }
  3725. }
  3726. return CMDIFrameWnd::PreTranslateMessage(pMsg);
  3727. }
  3728. void CMainFrame::GetSkin()
  3729. {return;
  3730. #ifdef MNLS_VERSION
  3731. if(::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3732. {
  3733. CFile fp;
  3734. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeRead);
  3735. DWORD leng=fp.GetLength ();
  3736. fp.Close ();
  3737. if(leng!=194987)
  3738. ::DeleteFile (g_mainpath+"\\skin\\4.lia");
  3739. }
  3740. if(!::PathFileExists (g_mainpath+"\\skin\\4.lia"))
  3741. {
  3742. ::CreateDirectory (g_mainpath+"\\skin", NULL);
  3743. g_sendhead.bsql=0;
  3744. g_sendhead.code[0]=100;
  3745. g_sendhead.tabcount=1;
  3746. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  3747. CFile fp;
  3748. fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeWrite|CFile::modeCreate);
  3749. fp.Write (g_pData, g_nLeng);
  3750. fp.Close ();
  3751. }
  3752. #endif
  3753. }
  3754. void AutoDraw(CPrintRX &m_Print, CRect &StrRect, CString &str, float fscale)
  3755. {
  3756. CString tempbz,temp;
  3757. BOOL bRun=0;
  3758. CSize size;
  3759. int fontsize=12;
  3760. int i=0;
  3761. ll: tempbz=str;
  3762. i=0;
  3763. m_Print.SetFontFace(fontsize, 1, "宋体");
  3764. while(1)
  3765. {
  3766. if(!tempbz.IsEmpty ())
  3767. {
  3768. temp=tempbz;
  3769. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3770. int right=0;
  3771. CRect temprc=StrRect;
  3772. temprc.top += i*(fontsize*fscale);i++;
  3773. temprc.bottom =temprc.top +fontsize;
  3774. if(temprc.bottom >StrRect.bottom )break;
  3775. while(size.cx>temprc.Width ())
  3776. {
  3777. right++;
  3778. temp=tempbz.Left (tempbz.GetLength ()-(right));
  3779. if(GIsHalfHZ(temp))
  3780. {
  3781. right++;
  3782. temp.Delete (temp.GetLength ()-1);
  3783. }
  3784. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  3785. }
  3786. if(temp.Find ("\r\n")!=-1)
  3787. {
  3788. temp=temp.Left (temp.Find ("\r\n"));//i++;
  3789. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ()-2);
  3790. }
  3791. else
  3792. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  3793. if(bRun)
  3794. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, temprc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3795. }
  3796. else
  3797. break;
  3798. }
  3799. if(tempbz.IsEmpty ()==0)
  3800. {
  3801. fontsize--;
  3802. goto ll;
  3803. }
  3804. if(bRun==0)
  3805. {
  3806. bRun=1;
  3807. goto ll;
  3808. }
  3809. }
  3810. void CMainFrame::PrintDinDan3(CString strOrderNumber)
  3811. {
  3812. // TODO: Add your control notification handler code here
  3813. CPrintRX m_Print;
  3814. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  3815. {
  3816. m_Print.InitToPrint(NULL, 1);
  3817. }
  3818. else
  3819. {
  3820. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  3821. if(name.IsEmpty ())
  3822. m_Print.InitToPrint(NULL, 1);
  3823. else
  3824. {
  3825. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  3826. if(nret==-1)
  3827. {
  3828. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  3829. }
  3830. }
  3831. }
  3832. m_Print.StartPrint();
  3833. m_Print.StartPage();
  3834. LoadRect load;
  3835. load.SetLiaPath ("11.lia");
  3836. load.SetMargins(0,0);
  3837. if(!load.Load ())return;
  3838. LoadRect load2;
  3839. load2.SetLiaPath ("12.lia");
  3840. load2.SetMargins(0,0);
  3841. if(!load2.Load ())return;
  3842. LoadRect load3;
  3843. load3.SetLiaPath ("13.lia");
  3844. load3.SetMargins(-6,520);
  3845. if(!load3.Load ())return;
  3846. int i;
  3847. //////////////////////////////////////////////////////////////
  3848. CStringArray txarray;
  3849. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"'";
  3850. g_sendhead.code[0]=11;
  3851. g_sendhead.code[1]=52;
  3852. g_sendhead.code[2]=50;
  3853. g_sendhead.code[3]=150;
  3854. g_sendhead.tabcount=4;
  3855. g_sendhead.bsql=0;
  3856. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  3857. CArray<CStringArray, CStringArray>sparray;
  3858. CArray<CStringArray, CStringArray>clientarray;
  3859. CArray<CStringArray, CStringArray>jdarray;
  3860. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray);
  3861. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  3862. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  3863. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  3864. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  3865. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  3866. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  3867. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  3868. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  3869. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  3870. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  3871. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  3872. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  3873. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  3874. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  3875. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  3876. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  3877. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  3878. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  3879. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  3880. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  3881. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  3882. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  3883. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  3884. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  3885. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  3886. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  3887. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  3888. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  3889. CString m_bz ="其它要求: "+g_List1array.ElementAt (0).ElementAt (38);
  3890. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  3891. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  3892. if(IsHasRights2new(31)==0)
  3893. {
  3894. m_phone1="***";
  3895. m_phone2="***";
  3896. }
  3897. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  3898. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  3899. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  3900. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  3901. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  3902. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  3903. CString m_addr=m_addr1+";";
  3904. m_addr.TrimLeft (";");
  3905. m_addr+=m_addr2;
  3906. CString m_qq=m_qq1+";";
  3907. m_qq.TrimLeft (";");
  3908. m_qq+=m_qq2;
  3909. CString m_jd;
  3910. for( i=0; i<jdarray.GetSize (); i++)
  3911. {
  3912. m_jd+=jdarray.ElementAt (i).ElementAt (1);
  3913. m_jd+=";";
  3914. }
  3915. m_jd.TrimRight (";");
  3916. m_money1.Format ("%f", atof(m_taoxijiage));
  3917. m_money2.Format ("%f", atof(m_payed1));
  3918. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  3919. ConvertToPrice(m_money1);
  3920. ConvertToPrice(m_money2);
  3921. ConvertToPrice(m_money3);
  3922. ////////////////////////////////////////////////////////////////
  3923. int rcpos=-1;
  3924. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  3925. m_Print.SetFontFace(17, 1, "宋体");
  3926. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3927. StrRect.top -=0;
  3928. StrRect.bottom -=10;
  3929. StrRect.left -=140;
  3930. StrRect.right =StrRect.left+48;
  3931. m_Print.SetFontFace(15, 1, "宋体");
  3932. m_Print.SetColor(0xffffff);
  3933. m_Print.DrawRect(StrRect, 0);
  3934. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3935. StrRect.left =StrRect.right ;
  3936. StrRect.right =StrRect.left+48;
  3937. m_Print.DrawRect(StrRect, RGB(255,0,0));
  3938. m_Print.SetColor(0, RGB(255,0,0));
  3939. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3940. m_Print.SetColor(0);
  3941. m_Print.SetFontFace(12, 1, "宋体");
  3942. StrRect.left -=48;
  3943. int hei=StrRect.Height ();
  3944. StrRect.top =StrRect.bottom+2;
  3945. StrRect.bottom +=hei+2;
  3946. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3947. StrRect.top =StrRect.bottom-2;
  3948. StrRect.bottom +=hei-5;
  3949. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  3950. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3951. m_Print.SetFontFace(12, 1, "宋体");
  3952. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  3953. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3954. m_Print.SetFontFace(11, 1, "宋体");
  3955. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3956. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3957. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3958. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3959. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3960. m_Print.DrawRect2(StrRect, 2);
  3961. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3962. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3963. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3964. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3965. m_Print.DrawRect2(StrRect, 2);
  3966. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3967. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3968. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3969. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3970. m_Print.DrawRect2(StrRect, 2);
  3971. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3972. m_Print.DrawText((LPTSTR)(LPCTSTR)"约单时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3973. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3974. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3975. m_Print.DrawRect2(StrRect, 2);
  3976. ////////////
  3977. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3978. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3979. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3980. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3981. m_Print.DrawRect2(StrRect, 2);
  3982. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3983. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3984. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3985. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3986. m_Print.DrawRect2(StrRect, 2);
  3987. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3988. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3989. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3990. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3991. m_Print.DrawRect2(StrRect, 2);
  3992. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3993. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3994. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3995. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3996. m_Print.DrawRect2(StrRect, 2);
  3997. StrRect=load.m_rcarray .ElementAt (++rcpos);
  3998. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  3999. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4000. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4001. m_Print.DrawRect2(StrRect, 2);
  4002. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4003. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/邮箱:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4004. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4005. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4006. m_Print.DrawRect2(StrRect, 2);
  4007. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4008. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系金额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4009. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4010. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4011. m_Print.DrawRect2(StrRect, 2);
  4012. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4013. //m_Print.DrawText((LPTSTR)(LPCTSTR)"定金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4014. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4015. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4016. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4017. m_Print.DrawRect2(StrRect, 2);
  4018. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4019. m_Print.DrawText((LPTSTR)(LPCTSTR)"余额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4020. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4021. m_Print.DrawText((LPTSTR)(LPCTSTR)m_money3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4022. m_Print.DrawRect2(StrRect, 2);
  4023. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4024. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4025. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4026. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4027. m_Print.DrawRect2(StrRect, 2);
  4028. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4029. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍摄景点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4030. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4031. m_Print.DrawText((LPTSTR)(LPCTSTR)m_jd, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4032. m_Print.DrawRect2(StrRect, 2);
  4033. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4034. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容提供: 男士服装:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4035. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4036. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0,FORMAT_HCENTER | FORMAT_VCENTER);
  4037. m_Print.DrawRect2(StrRect, 2);
  4038. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4039. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT| FORMAT_VCENTER);
  4040. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4041. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4042. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4043. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_HCENTER| FORMAT_VCENTER);
  4044. m_Print.DrawRect2(StrRect, 2);
  4045. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4046. m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0,FORMAT_LEFT | FORMAT_VCENTER);
  4047. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4048. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内提供拍摄区服装/头饰造型", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4049. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4050. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4051. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4052. m_Print.DrawText((LPTSTR)(LPCTSTR)" ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4053. m_Print.DrawRect2(StrRect, 2);
  4054. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4055. m_Print.DrawText((LPTSTR)(LPCTSTR)"专业数码拍摄:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4056. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4057. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4058. m_Print.DrawRect2(StrRect, 2);
  4059. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4060. m_Print.DrawText((LPTSTR)(LPCTSTR)"张", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4061. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4062. m_Print.DrawText((LPTSTR)(LPCTSTR)"(JPG格式数据)", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4063. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4064. m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内赠送:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4065. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4066. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_List1array.ElementAt (0).ElementAt (9)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4067. m_Print.DrawRect2(StrRect, 2);
  4068. StrRect=load.m_rcarray .ElementAt (++rcpos);
  4069. m_Print.DrawText((LPTSTR)(LPCTSTR)"张设计排版精修入册", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4070. //////////////////////load2
  4071. rcpos=-1;
  4072. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4073. m_Print.DrawText((LPTSTR)(LPCTSTR)"原始数据套系内张数JPG格式光盘壹只", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4074. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4075. m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4076. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4077. // m_Print.DrawText((LPTSTR)(LPCTSTR)"", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4078. // AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4079. m_Print.DrawRect2(StrRect, 2);
  4080. m_Print.SetFontFace(11, 1, "宋体");
  4081. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4082. m_Print.DrawText((LPTSTR)(LPCTSTR)"客人产品:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4083. int rowcount=sparray.GetSize ()/8;
  4084. int needaddrow=0;
  4085. while(sparray.GetSize ()>rowcount*8+needaddrow)
  4086. needaddrow++;
  4087. int pos=0;
  4088. CString str="";
  4089. int addcount=0;
  4090. if(needaddrow>0)
  4091. addcount=1;
  4092. else
  4093. addcount=0;
  4094. needaddrow--;
  4095. str.Empty ();
  4096. for( i=0; i<rowcount+addcount; i++)
  4097. {
  4098. str+=sparray.ElementAt (pos).ElementAt (5);
  4099. str+=" 数量:";
  4100. str+=sparray.ElementAt (pos).ElementAt (3);
  4101. str+=";";
  4102. pos++;
  4103. }
  4104. StrRect=load2.m_rcarray .ElementAt (++rcpos);//6
  4105. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4106. m_Print.DrawRect2(StrRect, 2);
  4107. StrRect=load2.m_rcarray .ElementAt (++rcpos);//6
  4108. if(needaddrow>0)
  4109. addcount=1;
  4110. else
  4111. addcount=0;
  4112. needaddrow--;
  4113. str.Empty ();
  4114. for( i=0; i<rowcount+addcount; i++)
  4115. {
  4116. str+=sparray.ElementAt (pos).ElementAt (5);
  4117. str+=" 数量:";
  4118. str+=sparray.ElementAt (pos).ElementAt (3);
  4119. str+=";";
  4120. pos++;
  4121. }
  4122. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4123. m_Print.DrawRect2(StrRect, 2);
  4124. StrRect=load2.m_rcarray .ElementAt (++rcpos);//7
  4125. if(needaddrow>0)
  4126. addcount=1;
  4127. else
  4128. addcount=0;
  4129. needaddrow--;
  4130. str.Empty ();
  4131. for( i=0; i<rowcount+addcount; i++)
  4132. {
  4133. str+=sparray.ElementAt (pos).ElementAt (5);
  4134. str+=" 数量:";
  4135. str+=sparray.ElementAt (pos).ElementAt (3);
  4136. str+=";";
  4137. pos++;
  4138. }
  4139. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4140. m_Print.DrawRect2(StrRect, 2);
  4141. StrRect=load2.m_rcarray .ElementAt (++rcpos);//8
  4142. if(needaddrow>0)
  4143. addcount=1;
  4144. else
  4145. addcount=0;
  4146. needaddrow--;
  4147. str.Empty ();
  4148. for( i=0; i<rowcount+addcount; i++)
  4149. {
  4150. str+=sparray.ElementAt (pos).ElementAt (5);
  4151. str+=" 数量:";
  4152. str+=sparray.ElementAt (pos).ElementAt (3);
  4153. str+=";";
  4154. pos++;
  4155. }
  4156. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4157. m_Print.DrawRect2(StrRect, 2);
  4158. StrRect=load2.m_rcarray .ElementAt (++rcpos);//9
  4159. if(needaddrow>0)
  4160. addcount=1;
  4161. else
  4162. addcount=0;
  4163. needaddrow--;
  4164. str.Empty ();
  4165. for( i=0; i<rowcount+addcount; i++)
  4166. {
  4167. str+=sparray.ElementAt (pos).ElementAt (5);
  4168. str+=" 数量:";
  4169. str+=sparray.ElementAt (pos).ElementAt (3);
  4170. str+=";";
  4171. pos++;
  4172. }
  4173. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4174. m_Print.DrawRect2(StrRect, 2);
  4175. StrRect=load2.m_rcarray .ElementAt (++rcpos);//10
  4176. if(needaddrow>0)
  4177. addcount=1;
  4178. else
  4179. addcount=0;
  4180. needaddrow--;
  4181. str.Empty ();
  4182. for( i=0; i<rowcount+addcount; i++)
  4183. {
  4184. str+=sparray.ElementAt (pos).ElementAt (5);
  4185. str+=" 数量:";
  4186. str+=sparray.ElementAt (pos).ElementAt (3);
  4187. str+=";";
  4188. pos++;
  4189. }
  4190. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4191. m_Print.DrawRect2(StrRect, 2);
  4192. StrRect=load2.m_rcarray .ElementAt (++rcpos);//11
  4193. if(needaddrow>0)
  4194. addcount=1;
  4195. else
  4196. addcount=0;
  4197. needaddrow--;
  4198. str.Empty ();
  4199. for( i=0; i<rowcount+addcount; i++)
  4200. {
  4201. str+=sparray.ElementAt (pos).ElementAt (5);
  4202. str+=" 数量:";
  4203. str+=sparray.ElementAt (pos).ElementAt (3);
  4204. str+=";";
  4205. pos++;
  4206. }
  4207. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4208. m_Print.DrawRect2(StrRect, 2);
  4209. StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4210. if(needaddrow>0)
  4211. addcount=1;
  4212. else
  4213. addcount=0;
  4214. needaddrow--;
  4215. str.Empty ();
  4216. for( i=0; i<rowcount+addcount; i++)
  4217. {
  4218. str+=sparray.ElementAt (pos).ElementAt (5);
  4219. str+=" 数量:";
  4220. str+=sparray.ElementAt (pos).ElementAt (3);
  4221. str+=";";
  4222. pos++;
  4223. }
  4224. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4225. m_Print.DrawRect2(StrRect, 2);
  4226. /* StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
  4227. if(needaddrow>0)
  4228. addcount=1;
  4229. else
  4230. addcount=0;
  4231. needaddrow--;
  4232. str.Empty ();
  4233. for( i=0; i<rowcount+addcount; i++)
  4234. {
  4235. str+=sparray.ElementAt (pos).ElementAt (5);
  4236. str+=" 数量:";
  4237. str+=sparray.ElementAt (pos).ElementAt (3);
  4238. str+=";";
  4239. pos++;
  4240. }
  4241. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4242. m_Print.DrawRect2(StrRect, 2);
  4243. StrRect=load2.m_rcarray .ElementAt (++rcpos);//14
  4244. if(needaddrow>0)
  4245. addcount=1;
  4246. else
  4247. addcount=0;
  4248. needaddrow--;
  4249. str.Empty ();
  4250. for( i=0; i<rowcount+addcount; i++)
  4251. {
  4252. str+=sparray.ElementAt (pos).ElementAt (5);
  4253. str+=" 数量:";
  4254. str+=sparray.ElementAt (pos).ElementAt (3);
  4255. str+=";";
  4256. pos++;
  4257. }
  4258. AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4259. m_Print.DrawRect2(StrRect, 2);*/
  4260. CRect sprc[2];
  4261. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4262. // AutoDraw(m_Print, StrRect, m_bz.Left (leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4263. m_Print.DrawRect2(StrRect, 2);
  4264. sprc[0]=StrRect;
  4265. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  4266. // AutoDraw(m_Print, StrRect, m_bz.Right (leng-leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
  4267. m_Print.DrawRect2(StrRect, 2);
  4268. sprc[1]=StrRect;
  4269. //AutoDraw(m_Print, StrRect, m_bz, 1.4);
  4270. {
  4271. CString temp,tempspno,tempbz;
  4272. CSize size;
  4273. BOOL bRun=0;
  4274. int fontsize=12;
  4275. ll: tempspno=m_bz;
  4276. m_Print.SetFontFace(fontsize, 1, "宋体");
  4277. for( i=0; i<2; i++)
  4278. {
  4279. if(!tempspno.IsEmpty ())
  4280. {
  4281. temp=tempspno;
  4282. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4283. int right=0;
  4284. CRect temprc=sprc[i];
  4285. while(size.cx>temprc.Width ())
  4286. {
  4287. right++;
  4288. temp=tempspno.Left (tempspno.GetLength ()-(right));
  4289. if(GIsHalfHZ(temp))
  4290. {
  4291. right++;
  4292. temp.Delete (temp.GetLength ()-1);
  4293. }
  4294. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  4295. }
  4296. if(bRun)
  4297. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4298. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  4299. if(tempspno.IsEmpty ())i++;
  4300. }
  4301. }
  4302. if(tempspno.IsEmpty ()==0)//|| tempbz.IsEmpty ()==0)
  4303. {
  4304. fontsize--;
  4305. goto ll;
  4306. }
  4307. if(bRun==0)
  4308. {
  4309. bRun=1;
  4310. goto ll;
  4311. }
  4312. }
  4313. m_Print.SetFontFace(11, 1, "宋体");
  4314. //////////////////////load3
  4315. rcpos=-1;
  4316. for( i=0; i<24; i++)
  4317. {
  4318. StrRect=load3.m_rcarray .ElementAt (i);
  4319. m_Print.DrawRect2(StrRect, 1);
  4320. }
  4321. CStringArray strarray;
  4322. strarray.Add("营业员");
  4323. strarray.Add("前台接待");
  4324. strarray.Add("化妆师");
  4325. strarray.Add("礼服师");
  4326. strarray.Add("摄影师");
  4327. strarray.Add("摄影助理");
  4328. strarray.Add("美工师");
  4329. strarray.Add("设计师");
  4330. for( i=0; i<8; i++)
  4331. {
  4332. StrRect=load3.m_rcarray .ElementAt (i);
  4333. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4334. }
  4335. strarray.RemoveAll();
  4336. strarray.Add(m_ren);
  4337. strarray.Add(g_List1array.ElementAt (0).ElementAt (49) );
  4338. strarray.Add(m_waiter2);
  4339. strarray.Add(g_List1array.ElementAt (0).ElementAt (51));
  4340. strarray.Add(m_waiter1);
  4341. strarray.Add(g_List1array.ElementAt (0).ElementAt (50));
  4342. strarray.Add("");
  4343. strarray.Add(m_waiter4);
  4344. for( i=8; i<16; i++)
  4345. {
  4346. StrRect=load3.m_rcarray .ElementAt (i);
  4347. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-8), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4348. }
  4349. StrRect=load3.m_rcarray .ElementAt (27);
  4350. m_Print.DrawText((LPTSTR)(LPCTSTR)"客户电话: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4351. StrRect=load3.m_rcarray .ElementAt (28);
  4352. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4353. m_Print.SetFontFace(13, 1, "宋体");
  4354. StrRect=load3.m_rcarray .ElementAt (25);
  4355. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4356. StrRect=load3.m_rcarray .ElementAt (26);
  4357. m_Print.DrawRect2(StrRect, 2);
  4358. StrRect=load3.m_rcarray .ElementAt (24);
  4359. str="\
  4360. 顾客须知\r\n\
  4361. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  4362. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  4363. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  4364. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  4365. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  4366. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  4367. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  4368. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  4369. AutoDraw(m_Print, StrRect, str, 1.8);
  4370. PrintPreview dlg;
  4371. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4372. dlg.m_pDC =m_Print.GetPDC() ;
  4373. if(dlg.DoModal ()!=IDOK)return;
  4374. //结束打印
  4375. m_Print.EndPage();
  4376. m_Print.EndPrint();
  4377. }
  4378. void CMainFrame::PrintDailyForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4379. {
  4380. // TODO: Add your control notification handler code here
  4381. int pages=Listarray->GetSize ()/46;
  4382. if(Listarray->GetSize ()%46)pages++;
  4383. for(int aa=0; aa<pages; aa++)
  4384. {
  4385. PrintPreview dlg;
  4386. CPrintRX m_Print;
  4387. m_Print.InitToPrint(NULL, 1);
  4388. m_Print.StartPrint();
  4389. m_Print.StartPage();
  4390. CRect mainrc(0,0,560,793);
  4391. float fscale;
  4392. {
  4393. int w,h;
  4394. m_Print.GetWidHei(w , h );
  4395. fscale=(float)w/(float)h;
  4396. }
  4397. mainrc.DeflateRect (25, 40, 10, 0);
  4398. CRect rc,rc2;
  4399. rc=mainrc;
  4400. rc.bottom =rc.top ;
  4401. rc.top -=20;
  4402. m_Print.SetFontFace(16, 1, "黑体");
  4403. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4404. m_Print.SetFontFace(9, 1, "宋体");
  4405. CString str;
  4406. int wid[4]={320,60,60,90};
  4407. int hei=16;
  4408. if(fscale>0.71)hei=15;
  4409. rc=mainrc;
  4410. rc.bottom =rc.top +hei;
  4411. for(int i=0; i<47; i++)
  4412. {
  4413. rc2.top =rc.top +i*hei;
  4414. rc2.bottom =rc.bottom +i*hei;
  4415. rc2.left =rc.left ;
  4416. rc2.right =rc.left +wid[0];
  4417. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  4418. for(int j=0; j<4; j++)
  4419. {
  4420. m_Print.DrawRect2(rc2, 1);
  4421. if(Listarray->GetSize ()>aa*46+i)
  4422. {
  4423. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4424. rc2.left +=3;
  4425. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4426. rc2.left -=3;
  4427. }
  4428. rc2.left +=wid[j];
  4429. rc2.right =rc2.left+wid[j+1];
  4430. }
  4431. }
  4432. rc2.top +=2;
  4433. rc2.left +=2;rc2.right =mainrc.right+4;
  4434. m_Print.SetFontFace(8, 1, "宋体");
  4435. int infopos=info.Find ("***");
  4436. if(infopos!=-1)
  4437. {
  4438. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Left (infopos), rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4439. CRect rc3=rc2;
  4440. rc3.top =rc2.bottom -4;
  4441. m_Print.DrawText((LPTSTR)(LPCTSTR)info.Right (info.GetLength ()-infopos-3), rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4442. }
  4443. else
  4444. m_Print.DrawText((LPTSTR)(LPCTSTR)info, rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4445. str.Format (" 页:%d/%d", aa+1, pages);
  4446. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4447. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  4448. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4449. dlg.m_pDC =m_Print.GetPDC() ;
  4450. // dlg.m_mode=1;
  4451. if(aa==0)
  4452. {
  4453. if(dlg.DoModal ()!=IDOK)
  4454. return;
  4455. }
  4456. //结束打印
  4457. m_Print.EndPage();
  4458. m_Print.EndPrint();
  4459. }
  4460. }
  4461. void CMainFrame::PrintLoginForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
  4462. {
  4463. // TODO: Add your control notification handler code here
  4464. int sinlecount=33*6;
  4465. int pages=Listarray->GetSize ()/sinlecount;
  4466. if(Listarray->GetSize ()%sinlecount)pages++;
  4467. for(int aa=0; aa<pages; aa++)
  4468. {
  4469. PrintPreview dlg;
  4470. CPrintRX m_Print;
  4471. m_Print.InitToPrint(NULL, 1);
  4472. m_Print.StartPrint();
  4473. m_Print.StartPage();
  4474. CRect mainrc(0,0,560,793);
  4475. float fscale;
  4476. {
  4477. int w,h;
  4478. m_Print.GetWidHei(w , h );
  4479. fscale=(float)w/(float)h;
  4480. }
  4481. mainrc.DeflateRect (25, 40, 10, 0);
  4482. CString str;
  4483. CRect rc,rc2;
  4484. rc=mainrc;
  4485. rc.bottom =rc.top ;
  4486. rc.top -=20;
  4487. rc.left -=20;
  4488. m_Print.SetFontFace(12, 1, "黑体");
  4489. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  4490. m_Print.SetFontFace(6, 1, "宋体");
  4491. str.Format (" 页:%d/%d", aa+1, pages);
  4492. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4493. rc.right =mainrc.right+20 ;
  4494. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4495. int wid[2]={50,110};
  4496. int hei=11;
  4497. rc=mainrc;
  4498. rc.bottom =rc.top +hei;
  4499. rc.top +=10;
  4500. rc.bottom +=10;
  4501. int dtx=rc.Width ()/3+18;
  4502. int dty=380;
  4503. for(int j=0; j<6; j++)
  4504. {
  4505. if(Listarray->GetSize ()<aa*sinlecount+33*(j+1))continue;
  4506. for(int i=0; i<33; i++)
  4507. {
  4508. rc2.top =rc.top +i*hei;
  4509. rc2.bottom =rc.bottom +i*hei;
  4510. rc2.left =rc.left ;
  4511. rc2.right =rc.left +wid[0];
  4512. if(i==0)
  4513. {
  4514. // rc2.left +=wid[1];
  4515. rc2.right +=wid[1];
  4516. }
  4517. if(j==1 || j==4)
  4518. {
  4519. rc2.left +=dtx;
  4520. rc2.right +=dtx;
  4521. }
  4522. if(j==2 || j==5)
  4523. {
  4524. rc2.left +=dtx*2;
  4525. rc2.right +=dtx*2;
  4526. }
  4527. if(j==3 || j==4 || j==5)
  4528. {
  4529. rc2.top +=dty;
  4530. rc2.bottom +=dty;
  4531. }
  4532. m_Print.DrawRect2(rc2, 1);
  4533. if(Listarray->GetSize ()>aa*sinlecount+33*j+i)
  4534. {
  4535. str=Listarray->ElementAt (aa*sinlecount+33*j+i).ElementAt (0);
  4536. rc2.left +=3;
  4537. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4538. rc2.left -=3;
  4539. }
  4540. if(i==0)continue;
  4541. rc2.left =rc2.right ;
  4542. rc2.right +=wid[1];
  4543. m_Print.DrawRect2(rc2, 1);
  4544. if(Listarray->GetSize ()>aa*sinlecount+33*j+i)
  4545. {
  4546. if(Listarray->ElementAt (aa*sinlecount+33*j+i).GetSize ()>1)
  4547. {
  4548. str=Listarray->ElementAt (aa*sinlecount+33*j+i).ElementAt (1);
  4549. rc2.left +=3;
  4550. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4551. rc2.left -=3;
  4552. }
  4553. }
  4554. /* if(Listarray->GetSize ()>aa*46+i)
  4555. {
  4556. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  4557. rc2.left +=3;
  4558. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4559. rc2.left -=3;
  4560. }
  4561. rc2.left +=wid[j];
  4562. rc2.right =rc2.left+wid[j+1];*/
  4563. }
  4564. }
  4565. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4566. dlg.m_pDC =m_Print.GetPDC() ;
  4567. if(aa==0)
  4568. {
  4569. if(dlg.DoModal ()!=IDOK)
  4570. return;
  4571. }
  4572. //结束打印
  4573. m_Print.EndPage();
  4574. m_Print.EndPrint();
  4575. }
  4576. }
  4577. void CMainFrame::PrintTakeForm(CArray<CStringArray, CStringArray>*Listarray)
  4578. {
  4579. CString title;
  4580. CString info;
  4581. // TODO: Add your control notification handler code here
  4582. int sinlecount=4;
  4583. int pages=Listarray->GetSize ()/sinlecount;
  4584. if(Listarray->GetSize ()%sinlecount)pages++;
  4585. for(int aa=0; aa<pages; aa++)
  4586. {
  4587. PrintPreview dlg;
  4588. CPrintRX m_Print;
  4589. m_Print.InitToPrint(NULL, 1);
  4590. m_Print.StartPrint();
  4591. m_Print.StartPage();
  4592. CRect mainrc(0,0,560,793);
  4593. float fscale;
  4594. {
  4595. int w,h;
  4596. m_Print.GetWidHei(w , h );
  4597. fscale=(float)w/(float)h;
  4598. }
  4599. mainrc.DeflateRect (25, 40, 10, 0);
  4600. CString str;
  4601. CRect rc,rc2;
  4602. rc=mainrc;
  4603. rc.bottom =rc.top ;
  4604. rc.top -=20;
  4605. rc.left -=20;
  4606. m_Print.SetFontFace(6, 1, "宋体");
  4607. str.Format (" 页:%d/%d", aa+1, pages);
  4608. str="制表:"+g_user.name+" 日期:"+g_date+str;
  4609. rc.right =mainrc.right+10 ;
  4610. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  4611. m_Print.SetFontFace(12, 1, "宋体");
  4612. int wid[2]={70,190};
  4613. int hei=22;
  4614. rc=mainrc;
  4615. rc.bottom =rc.top +hei;
  4616. rc.top +=10;
  4617. rc.bottom +=10;
  4618. int dtx=rc.Width ()/2+18;
  4619. int dty=380;
  4620. int arraysize=Listarray->ElementAt (0).GetSize();
  4621. for(int j=0; j<4; j++)
  4622. {
  4623. if(Listarray->GetSize ()<=aa*sinlecount+j)continue;
  4624. for(int i=0; i<arraysize; i++)
  4625. {
  4626. rc2.top =rc.top +i/2*hei;
  4627. rc2.bottom =rc.bottom +i/2*hei;
  4628. rc2.left =rc.left ;
  4629. rc2.right =rc.left +wid[0];
  4630. if(i%2)
  4631. {
  4632. rc2.left=rc2.right;
  4633. rc2.right +=wid[1];
  4634. }
  4635. if(j==1 || j==3)
  4636. {
  4637. rc2.left +=dtx;
  4638. rc2.right +=dtx;
  4639. }
  4640. if(j==2 || j==3 )
  4641. {
  4642. rc2.top +=dty;
  4643. rc2.bottom +=dty;
  4644. }
  4645. if(i==arraysize-1 || i==arraysize-2)
  4646. {
  4647. rc2.bottom +=hei*2;
  4648. }
  4649. m_Print.DrawRect2(rc2, 1);
  4650. {
  4651. str=Listarray->ElementAt (aa*sinlecount+j).ElementAt (i);
  4652. if(i==arraysize-1)
  4653. {
  4654. CRect rc3=rc2;
  4655. rc3.left+=3;
  4656. rc3.top+=3;
  4657. AutoDraw(m_Print, rc3, str, 1.4);
  4658. }
  4659. else if(i==arraysize-2)
  4660. {
  4661. CRect rc3=rc2;
  4662. rc3.left+=3;
  4663. rc3.top+=3;
  4664. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4665. }
  4666. else
  4667. {
  4668. rc2.left +=3;
  4669. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4670. rc2.left -=3;
  4671. }
  4672. }
  4673. }
  4674. }
  4675. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4676. dlg.m_pDC =m_Print.GetPDC() ;
  4677. if(aa==0)
  4678. {
  4679. if(dlg.DoModal ()!=IDOK)
  4680. return;
  4681. }
  4682. //结束打印
  4683. m_Print.EndPage();
  4684. m_Print.EndPrint();
  4685. }
  4686. }
  4687. void CMainFrame::PrintThumbNail(CStringArray *array, CString client, BOOL bDir, CString m_size)
  4688. {
  4689. // TODO: Add your control notification handler code here
  4690. CStringArray titlearray;
  4691. CStringArray namearray;
  4692. CStringArray noarray;
  4693. CArray<CRect,CRect>rcarray;
  4694. CArray<CRect,CRect>widtharray;
  4695. if(m_size!="")
  4696. {
  4697. int pos=m_size.Find (";");
  4698. while(pos!=-1)
  4699. {
  4700. CString size=m_size.Left (pos);
  4701. int pos2=size.Find (":");
  4702. if(pos2!=-1)
  4703. {
  4704. CString str;
  4705. CRect rc;
  4706. str=size.Left (pos2);
  4707. noarray.Add (str);
  4708. str=size.Right (size.GetLength ()-pos2-1);
  4709. pos2=str.Find (",");
  4710. namearray.Add(str.Left (pos2));str.Delete (0, pos2+1);
  4711. pos2=str.Find (",");
  4712. rc.left=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4713. pos2=str.Find (",");
  4714. rc.top=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4715. widtharray.Add (rc);
  4716. pos2=str.Find (",");
  4717. rc.left=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4718. pos2=str.Find (",");
  4719. rc.top=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4720. pos2=str.Find (",");
  4721. rc.right=atoi(str.Left (pos2));str.Delete (0, pos2+1);
  4722. rc.bottom=atoi(str);
  4723. rcarray.Add (rc);
  4724. }
  4725. m_size=m_size.Right (m_size.GetLength ()-pos-1);
  4726. pos=m_size.Find (";");
  4727. }
  4728. }
  4729. PrintPreview dlg;
  4730. CPrintRX m_Print;
  4731. m_Print.InitToPrint(NULL, 1);
  4732. m_Print.StartPrint();
  4733. m_Print.StartPage();
  4734. CRect mainrc(0,0,560,793);
  4735. mainrc.DeflateRect (25, 50, 10, 0);
  4736. m_Print.SetFontFace(10, 1, "宋体");
  4737. CRect rc,rc2;
  4738. rc=mainrc;
  4739. rc.bottom =rc.top ;
  4740. rc.top -=20;
  4741. m_Print.DrawText((LPTSTR)(LPCTSTR)client, rc, 0, 0, FORMAT_LEFT | FORMAT_UP);
  4742. rc.bottom -=5;
  4743. m_Print.DrawRect2(rc, 2);
  4744. if(array->GetSize ()>130)m_Print.SetFontFace(8, 1, "宋体");
  4745. if(bDir)m_Print.SetFontFace(6, 1, "宋体");
  4746. ////////////////////////////////////////////////////////////////
  4747. int imgcount=array->GetSize ();
  4748. int dtx=5;
  4749. int dty=15;
  4750. int cx,cy;
  4751. int countx=5;
  4752. int county=1;
  4753. while(1)
  4754. {
  4755. if(countx*county>=imgcount)
  4756. {
  4757. cx=(mainrc.Width ()-(countx-1)*dtx)/countx;
  4758. cy=cx*4/3;
  4759. break;
  4760. }
  4761. else
  4762. {
  4763. cx=(mainrc.Width ()-(countx-1)*dtx)/countx;
  4764. cy=cx*4/3;
  4765. if(cy*(county+1)+dty*county < mainrc.Height ())//Y方向可以增加一个
  4766. {
  4767. county++;
  4768. }
  4769. else//Y方向不能加,X方向加
  4770. {
  4771. countx++;
  4772. county=1;
  4773. }
  4774. }
  4775. }
  4776. int imgpos=0;
  4777. CString stemp;
  4778. CPen pen( PS_SOLID, 1, RGB(255, 0, 0) );
  4779. CPen *oldpen=m_Print.m_DC.SelectObject(&pen);
  4780. CPen *oldpen2=m_Print.m_memdc.SelectObject(&pen);
  4781. for(int i=0; i<county; i++)
  4782. {
  4783. for(int j=0; j<countx; j++)
  4784. {
  4785. rc=mainrc;
  4786. rc.top +=i*(cy+dty);
  4787. rc.left +=j*(cx+dtx);
  4788. rc.right =rc.left +cx;
  4789. rc.bottom =rc.top +cy;
  4790. Image *pImg=NULL;
  4791. if(imgpos>=array->GetSize ())break;
  4792. CString str=array->ElementAt (imgpos);
  4793. CString spath=str.Left (str.ReverseFind ('\\')+1);
  4794. spath+="m";
  4795. spath+=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4796. if(::CheckFileExist (spath))
  4797. ::LoadImageFromBuf (&pImg, spath);
  4798. else
  4799. {
  4800. ::LoadImageFromBuf (&pImg, str);
  4801. if(pImg==NULL)continue;
  4802. int orientation=GetOrientation(pImg);
  4803. if(orientation==8)
  4804. pImg->RotateFlip( Rotate270FlipNone );
  4805. else if(orientation==6)
  4806. pImg->RotateFlip( Rotate90FlipNone );
  4807. }
  4808. if(pImg==NULL)continue;
  4809. rc2=rc;
  4810. RectFitDes(pImg->GetWidth(), pImg->GetHeight(), rc);
  4811. imgpos++;
  4812. m_Print.DrawImage(pImg, rc);
  4813. int imgwidth=pImg->GetWidth();
  4814. delete pImg;
  4815. rc2.top =rc2.bottom+3 ;
  4816. rc2.bottom +=10;
  4817. if(bDir==0)
  4818. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4819. else
  4820. {
  4821. stemp=str.Left (str.ReverseFind ('\\'));
  4822. str=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
  4823. if(stemp.ReverseFind ('\\')!=-1)
  4824. {
  4825. stemp=stemp.Right (stemp.GetLength ()-stemp.ReverseFind ('\\')-1);
  4826. str=stemp+"\\"+str;
  4827. }
  4828. }
  4829. if(str.Find (".")!=-1)
  4830. str=str.Left (str.Find ("."));
  4831. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  4832. if(noarray.GetSize())
  4833. {
  4834. rc2=rc;
  4835. for(int aa=0; aa<noarray.GetSize(); aa++)
  4836. {
  4837. float scale=(float)rc2.Width ()/(float)imgwidth;
  4838. if(noarray.ElementAt(aa)==str)
  4839. {
  4840. int nIndex=aa;
  4841. CRect rc=rcarray.ElementAt (nIndex);
  4842. int wid=widtharray.ElementAt (nIndex).left;
  4843. int hei=widtharray.ElementAt (nIndex).top;
  4844. scale*=(float)imgwidth/(float)wid;
  4845. rc.left *=scale;
  4846. rc.right *=scale;
  4847. rc.top *=scale;
  4848. rc.bottom *=scale;
  4849. rc.left+=rc2.left;
  4850. rc.right+=rc2.left;
  4851. rc.top +=rc2.top;
  4852. rc.bottom +=rc2.top;
  4853. if(rc.left<rc2.left)rc.left=rc2.left;
  4854. if(rc.right>rc2.right)rc.right=rc2.right;
  4855. if(rc.top<rc2.top)rc.top=rc2.top;
  4856. if(rc.bottom>rc2.bottom)rc.bottom=rc2.bottom;
  4857. m_Print.DrawRect2(rc, 1);
  4858. }
  4859. }
  4860. }
  4861. }
  4862. }
  4863. m_Print.m_DC.SelectObject(oldpen);
  4864. m_Print.m_memdc.SelectObject(oldpen2);
  4865. /* CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  4866. StrRect.top -=15;StrRect.bottom -=15;
  4867. Image *pImg=NULL;
  4868. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  4869. m_Print.DrawImage(pImg, StrRect);
  4870. delete pImg;
  4871. m_Print.SetFontFace(10, 1, "宋体");
  4872. StrRect=load.m_rcarray .ElementAt (20);
  4873. StrRect.right=load.m_rcarray .ElementAt (23).right;
  4874. StrRect.top -=18;StrRect.bottom -=18;
  4875. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  4876. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  4877. */
  4878. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  4879. dlg.m_pDC =m_Print.GetPDC() ;
  4880. if(dlg.DoModal ()!=IDOK)
  4881. return;
  4882. //结束打印
  4883. m_Print.EndPage();
  4884. m_Print.EndPrint();
  4885. }
  4886. // remark by Jeff
  4887. // 函数:PrintDinDan
  4888. // 参数:
  4889. // strOrderNumber:订单单号;(Order number)
  4890. // 返回:void
  4891. // 注意:#
  4892. void CMainFrame::PrintDinDan(CString strOrderNumber)//打印订单报表;
  4893. {
  4894. // TODO: Add your control notification handler code here
  4895. int printcot=1;
  4896. for(int aa=0; aa<printcot; aa++)
  4897. {
  4898. PrintPreview dlg;
  4899. CPrintRX m_Print;
  4900. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  4901. {
  4902. m_Print.InitToPrint(NULL, 1);
  4903. }
  4904. else
  4905. {
  4906. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  4907. if(name.IsEmpty ())
  4908. m_Print.InitToPrint(NULL, 1);
  4909. else
  4910. {
  4911. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  4912. if(nret==-1 && aa==0)
  4913. {
  4914. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  4915. }
  4916. }
  4917. }
  4918. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==0)
  4919. {
  4920. #ifdef ZHIAI_VERSION
  4921. PrintDinDan3(strOrderNumber);
  4922. return;
  4923. #endif
  4924. #ifdef SZBLCT_VERSION
  4925. PrintDinDan4(strOrderNumber);
  4926. return;
  4927. #endif
  4928. m_Print.StartPrint();
  4929. m_Print.StartPage();
  4930. LoadRect load;
  4931. load.SetLiaPath ("6.lia");
  4932. load.SetMargins(-14,15);
  4933. if(!load.Load ())return;
  4934. LoadRect load2;
  4935. load2.SetLiaPath ("7.lia");
  4936. load2.SetMargins(-14,216+15);
  4937. if(!load2.Load ())return;
  4938. LoadRect load3;
  4939. load3.SetLiaPath ("8.lia");
  4940. load3.SetMargins(-14,705+15);
  4941. if(!load3.Load ())return;
  4942. int i;
  4943. //////////////////////////////////////////////////////////////
  4944. CStringArray txarray;
  4945. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"';;";
  4946. g_sendhead.code[0]=11;
  4947. g_sendhead.code[1]=52;
  4948. g_sendhead.code[2]=50;
  4949. g_sendhead.code[3]=150;
  4950. g_sendhead.code[4]=77;
  4951. g_sendhead.code[5]=4;
  4952. g_sendhead.tabcount=6;
  4953. g_sendhead.bsql=0;
  4954. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  4955. CArray<CStringArray, CStringArray>sparray;
  4956. CArray<CStringArray, CStringArray>clientarray;
  4957. CArray<CStringArray, CStringArray>phonearray;
  4958. CArray<CStringArray, CStringArray>fgarray;
  4959. CArray<CStringArray, CStringArray>danweiarray;
  4960. CArray<CStringArray, CStringArray>jdarray;
  4961. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  4962. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  4963. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  4964. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  4965. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  4966. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  4967. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  4968. CString m_taoxiname;
  4969. if(m_zs.Find ("\\")!=-1)
  4970. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底\\入册:"+g_List1array.ElementAt (0).ElementAt (9);
  4971. else
  4972. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底:"+g_List1array.ElementAt (0).ElementAt (9);
  4973. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  4974. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  4975. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  4976. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  4977. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  4978. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  4979. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  4980. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  4981. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  4982. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  4983. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  4984. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  4985. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  4986. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  4987. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  4988. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  4989. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  4990. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  4991. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  4992. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  4993. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  4994. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  4995. if(jdarray.GetSize ())
  4996. {
  4997. if(!m_bz.IsEmpty())
  4998. m_bz += "\r\n景点:\r\n";
  4999. else
  5000. m_bz = "景点:\r\n";
  5001. }
  5002. #ifdef DDF_VERSION
  5003. m_bz+="□219片场:219路馨园小区对面\r\n";
  5004. m_bz+="□金色样片片场:万科金色家园小区东门南走20米荣光社区一楼\r\n";
  5005. m_bz+="□孟泰片场:立山孟泰公园北门对面沛芝堂二楼\r\n";
  5006. m_bz+="□开发区样片片场:铁西去永宁街兴盛南路27号\r\n";
  5007. #else
  5008. for( i=0; i<jdarray.GetSize (); i++)
  5009. {
  5010. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5011. }
  5012. m_bz.TrimRight (";");
  5013. #endif
  5014. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5015. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5016. if(IsHasRights2new(31)==0)
  5017. {
  5018. m_phone1="***";
  5019. m_phone2="***";
  5020. }
  5021. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5022. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5023. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  5024. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  5025. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  5026. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  5027. filter="name='"+m_ren+"'";
  5028. g_sendhead.code[0]=5;
  5029. g_sendhead.tabcount=1;
  5030. g_sendhead.bsql=0;
  5031. int g_nYearposTemp=g_nYearpos;
  5032. g_nYearpos=-1;
  5033. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5034. g_nYearpos=g_nYearposTemp;
  5035. if(g_bSendOK==0)return;
  5036. DataToArray(&phonearray);
  5037. m_money1.Format ("%f", atof(m_taoxijiage));
  5038. m_money2.Format ("%f", atof(m_payed1));
  5039. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5040. ConvertToPrice(m_money1);
  5041. ConvertToPrice(m_money2);
  5042. ConvertToPrice(m_money3);
  5043. ////////////////////////////////////////////////////////////////
  5044. int rcpos=-1;
  5045. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  5046. StrRect.top -=15;StrRect.bottom -=15;
  5047. Image *pImg=NULL;
  5048. #ifdef MNLS_VERSION
  5049. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  5050. #else
  5051. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  5052. #endif
  5053. m_Print.DrawImage(pImg, StrRect);
  5054. delete pImg;
  5055. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5056. {
  5057. Image *pImg=NULL;
  5058. g_nSendCode=31;
  5059. int g_nYearposTemp=g_nYearpos;
  5060. g_nYearpos=-1;
  5061. g_pMainWnd->ProcessChatMessageRequest2(1);
  5062. g_nYearpos=g_nYearposTemp;
  5063. g_nSendCode=0;
  5064. if(g_bSendOK==0)return;
  5065. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  5066. if(pImg)
  5067. {
  5068. StrRect.left=30;
  5069. StrRect.top=12;
  5070. StrRect.right=StrRect.left+60;
  5071. StrRect.bottom=StrRect.top+60;
  5072. m_Print.DrawImage(pImg, StrRect);
  5073. delete pImg;pImg=NULL;
  5074. }
  5075. }
  5076. m_Print.SetFontFace(11, 1, "宋体");
  5077. StrRect=load.m_rcarray .ElementAt (20);
  5078. StrRect.right=load.m_rcarray .ElementAt (23).right;
  5079. StrRect.top -=18;StrRect.bottom -=18;
  5080. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  5081. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5082. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  5083. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5084. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5085. StrRect.top -=15;StrRect.bottom -=15;
  5086. #ifdef MNLS_VERSION
  5087. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5088. #endif
  5089. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5090. StrRect.top -=15;StrRect.bottom -=15;
  5091. #ifdef MNLS_VERSION
  5092. m_Print.DrawRect(StrRect);
  5093. #endif
  5094. m_Print.SetFontFace(7, 1, "黑体");
  5095. m_Print.SetColor(0xffffff);
  5096. #ifdef MNLS_VERSION
  5097. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5098. #endif
  5099. m_Print.SetColor(0);
  5100. m_Print.SetFontFace(15, 1, "宋体");
  5101. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5102. StrRect.top -=15;StrRect.bottom -=15;
  5103. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5104. CStringArray strarray;
  5105. strarray.Add("NO: "+strOrderNumber);
  5106. CString date;
  5107. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  5108. strarray.Add(date);
  5109. strarray.Add("喜爱");
  5110. strarray.Add("格调");
  5111. if(fgarray.GetSize ()==12)
  5112. {
  5113. for(int i=0; i<12; i++)
  5114. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  5115. }
  5116. else
  5117. {
  5118. strarray.Add("复古典雅");
  5119. strarray.Add("温文尔雅");
  5120. strarray.Add("豪华艳丽");
  5121. strarray.Add("传统大方");
  5122. strarray.Add("新潮个性");
  5123. strarray.Add("浪漫奔放");
  5124. strarray.Add("简单素雅");
  5125. strarray.Add("活泼俏丽");
  5126. strarray.Add("妩媚温馨");
  5127. strarray.Add("温柔贤惠");
  5128. strarray.Add("成熟感性");
  5129. strarray.Add("清纯可爱");
  5130. }
  5131. strarray.Add("姓名");
  5132. // strarray.Add("职业");
  5133. strarray.Add("");
  5134. strarray.Add("地址");
  5135. strarray.Add("电话");
  5136. #ifdef CHILD_VERSION
  5137. strarray.Add("家长");
  5138. strarray.Add("宝宝");
  5139. #else
  5140. strarray.Add("先生");
  5141. strarray.Add("女士");
  5142. #endif
  5143. m_Print.SetFontFace(11, 1, "宋体");
  5144. for( i=0; i<strarray.GetSize (); i++)
  5145. {
  5146. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5147. if(i<2)
  5148. {
  5149. StrRect.top -=15;StrRect.bottom -=15;
  5150. }
  5151. if(i>15)
  5152. m_Print.DrawRect2(StrRect, 1);
  5153. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5154. }
  5155. for( i=29; i<=40; i++)
  5156. {
  5157. if(m_style.GetLength ()<=(i-29))continue;
  5158. if(m_style.GetAt (i-29)!='1')continue;
  5159. StrRect=load.m_rcarray .ElementAt (i-1);
  5160. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5161. }
  5162. for( i=27; i<=48; i++)
  5163. {
  5164. StrRect=load.m_rcarray .ElementAt (++rcpos);
  5165. m_Print.DrawRect2(StrRect, 1);
  5166. }
  5167. #ifdef CHILD_VERSION
  5168. StrRect=load.m_rcarray .ElementAt (45);
  5169. StrRect.right =StrRect.left +62;
  5170. m_Print.DrawRect2(StrRect, 1);
  5171. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5172. StrRect.left =StrRect.right ;
  5173. StrRect.right =StrRect.left +62;
  5174. m_Print.DrawRect2(StrRect, 1);
  5175. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5176. StrRect.left =StrRect.right ;
  5177. StrRect.right =StrRect.left +62;
  5178. m_Print.DrawRect2(StrRect, 1);
  5179. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5180. StrRect.left =StrRect.right ;
  5181. StrRect.right =StrRect.left +62;
  5182. m_Print.DrawRect2(StrRect, 1);
  5183. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5184. #endif
  5185. /////////////////////////
  5186. strarray.RemoveAll ();
  5187. CString temp;
  5188. temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  5189. strarray.Add (temp);
  5190. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  5191. strarray.Add (temp);
  5192. strarray.Add ("化妆");
  5193. strarray.Add ("造型");
  5194. #ifdef CHILD_VERSION
  5195. strarray.Add ("");
  5196. #else
  5197. strarray.Add ("婚纱");
  5198. #endif
  5199. strarray.Add ("服饰");
  5200. strarray.Add ("配");
  5201. strarray.Add ("置");
  5202. strarray.Add ("其");
  5203. strarray.Add ("它");
  5204. strarray.Add ("套系名称");
  5205. strarray.Add ("镜款");
  5206. strarray.Add ("套系总价");
  5207. strarray.Add ("主摄影师");
  5208. strarray.Add ("拍摄日期");
  5209. strarray.Add ("预约金");
  5210. #ifdef CHILD_VERSION
  5211. strarray.Add ("主引导师");
  5212. #else
  5213. strarray.Add ("主化妆师");
  5214. #endif
  5215. strarray.Add ("看样日期");
  5216. strarray.Add ("欠款余额");
  5217. strarray.Add ("总监");
  5218. strarray.Add ("取件日期");
  5219. rcpos=-1;
  5220. for( i=0; i<strarray.GetSize (); i++)
  5221. {
  5222. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  5223. if(i>9)
  5224. m_Print.DrawRect2(StrRect, 1);
  5225. #ifdef CHILD_VERSION
  5226. if(i==5)
  5227. StrRect.top -=StrRect.Height ();
  5228. #endif
  5229. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5230. }
  5231. for( i=22; i<=41; i++)
  5232. {
  5233. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  5234. m_Print.DrawRect2(StrRect, 1);
  5235. }
  5236. /////////////////////////////
  5237. strarray.RemoveAll ();
  5238. #ifdef CHILD_VERSION
  5239. strarray.Add ("顾客方 家长:");
  5240. strarray.Add ("宝宝:");
  5241. #else
  5242. strarray.Add ("顾客方 先生:");
  5243. strarray.Add ("女士:");
  5244. #endif
  5245. strarray.Add ("电话:");
  5246. strarray.Add ("影楼方 店长:");
  5247. strarray.Add ("接单人:");
  5248. strarray.Add ("电话:");
  5249. rcpos=-1;
  5250. for( i=0; i<strarray.GetSize (); i++)
  5251. {
  5252. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  5253. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5254. }
  5255. for( i=7; i<=12; i++)
  5256. {
  5257. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  5258. // if(i!=10)
  5259. m_Print.DrawRect2(StrRect, 2);
  5260. }
  5261. //////////////////////////////////////
  5262. //开始打数据
  5263. strarray.RemoveAll ();
  5264. strarray.Add (m_name1);
  5265. strarray.Add (m_name2);
  5266. /// strarray.Add (m_occupation1);
  5267. // strarray.Add (m_occupation2);
  5268. strarray.Add ("");
  5269. strarray.Add ("");
  5270. strarray.Add (m_addr1);
  5271. #ifdef CHILD_VERSION
  5272. strarray.Add ("");
  5273. #else
  5274. strarray.Add (m_addr2);
  5275. #endif
  5276. strarray.Add (m_phone1);
  5277. strarray.Add (m_phone2);
  5278. for( i=41; i<=48; i++)
  5279. {
  5280. StrRect=load.m_rcarray .ElementAt (i-1);
  5281. StrRect.left +=4;
  5282. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5283. }
  5284. ///////////////////////////////
  5285. strarray.RemoveAll ();
  5286. strarray.Add (m_money1);
  5287. strarray.Add (m_waiter1);
  5288. strarray.Add (m_time2);
  5289. strarray.Add (m_money2);
  5290. strarray.Add (m_waiter2);
  5291. strarray.Add (m_time4);
  5292. strarray.Add (m_money3);
  5293. strarray.Add ("");
  5294. strarray.Add (m_time5);
  5295. for( i=32; i<=40; i++)
  5296. {
  5297. StrRect=load2.m_rcarray .ElementAt (i-1);
  5298. StrRect.left +=4;
  5299. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5300. }
  5301. ///////////////////////////////
  5302. strarray.RemoveAll ();
  5303. strarray.Add (m_name1);
  5304. strarray.Add (m_name2);
  5305. CString phone;
  5306. if(m_phone1.IsEmpty ()==0)
  5307. phone=m_phone1+",";
  5308. phone+=m_phone2;
  5309. phone.TrimRight (",");
  5310. strarray.Add (phone);
  5311. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  5312. strarray.Add (m_ren);
  5313. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  5314. for( i=7; i<=12; i++)
  5315. {
  5316. StrRect=load3.m_rcarray .ElementAt (i-1);
  5317. StrRect.left +=4;
  5318. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5319. }
  5320. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  5321. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5322. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  5323. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5324. StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  5325. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5326. //////////////////////////////
  5327. //开始画文字
  5328. StrRect=load2.m_rcarray .ElementAt (30);
  5329. StrRect.left +=3;
  5330. StrRect.top +=3;
  5331. StrRect.right -=2;
  5332. StrRect.bottom -=2;
  5333. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5334. StrRect=load2.m_rcarray .ElementAt (29);
  5335. StrRect.left +=3;
  5336. StrRect.top +=3;
  5337. StrRect.right -=2;
  5338. StrRect.bottom -=2;
  5339. str="";
  5340. for(i=0; i<sparray.GetSize (); i++)
  5341. {
  5342. str+=sparray.ElementAt (i).ElementAt (5);
  5343. str+=" 数量:";
  5344. str+=sparray.ElementAt (i).ElementAt (3);
  5345. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  5346. str+="\r\n";
  5347. }
  5348. str.TrimRight ("\r\n");
  5349. AutoDraw(m_Print, StrRect, str, 1.4);
  5350. StrRect=load2.m_rcarray .ElementAt (40);
  5351. StrRect.top +=8;
  5352. m_Print.SetFontFace(12, 1, "黑体");
  5353. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5354. StrRect.left +=3;
  5355. StrRect.top +=30;
  5356. StrRect.right -=2;
  5357. StrRect.bottom -=2;
  5358. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  5359. if(str.IsEmpty ())
  5360. {
  5361. str="\
  5362. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5363. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5364. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5365. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5366. 持良好的心境.\r\n\
  5367. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5368. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5369. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5370. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5371. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5372. 勿进影室, 以免影响拍摄.\r\n\
  5373. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5374. 师或店长沟通.\r\n\
  5375. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5376. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5377. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5378. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5379. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5380. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5381. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5382. 还.";
  5383. }
  5384. AutoDraw(m_Print, StrRect, str, 1.8);
  5385. }
  5386. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==1)
  5387. {//AfxMessageBox("yyy");
  5388. m_Print.StartPrint();
  5389. m_Print.StartPage();
  5390. LoadRect load;
  5391. load.SetLiaPath ("6-2.lia");
  5392. load.SetMargins(0,0);
  5393. if(!load.Load ())return;
  5394. int i;
  5395. //////////////////////////////////////////////////////////////
  5396. CStringArray txarray;
  5397. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"' and name<>'入册' and name<>'入底';id='"+strOrderNumber+"';;";
  5398. g_sendhead.code[0]=11;
  5399. g_sendhead.code[1]=52;
  5400. g_sendhead.code[2]=50;
  5401. g_sendhead.code[3]=150;
  5402. g_sendhead.code[4]=77;
  5403. g_sendhead.code[5]=4;
  5404. g_sendhead.tabcount=6;
  5405. g_sendhead.bsql=0;
  5406. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  5407. CArray<CStringArray, CStringArray>sparray;
  5408. CArray<CStringArray, CStringArray>clientarray;
  5409. CArray<CStringArray, CStringArray>phonearray;
  5410. CArray<CStringArray, CStringArray>fgarray;
  5411. CArray<CStringArray, CStringArray>danweiarray;
  5412. CArray<CStringArray, CStringArray>jdarray;
  5413. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5414. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  5415. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  5416. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  5417. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  5418. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  5419. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  5420. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  5421. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  5422. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  5423. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  5424. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  5425. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  5426. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  5427. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  5428. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  5429. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  5430. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  5431. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  5432. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  5433. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  5434. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  5435. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  5436. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  5437. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  5438. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  5439. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  5440. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  5441. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  5442. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  5443. if(jdarray.GetSize ())
  5444. {
  5445. if(m_bz.IsEmpty ()==0)
  5446. m_bz="\r\n"+m_bz;
  5447. m_bz+="景点:";
  5448. }
  5449. for( i=0; i<jdarray.GetSize (); i++)
  5450. {
  5451. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5452. }
  5453. m_bz.TrimRight (";");
  5454. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5455. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5456. if(IsHasRights2new(31)==0)
  5457. {
  5458. m_phone1="***";
  5459. m_phone2="***";
  5460. }
  5461. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5462. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5463. CString m_birthday1 = clientarray.ElementAt (0).ElementAt (11);
  5464. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  5465. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  5466. CString str;
  5467. filter="name='"+m_ren+"'";
  5468. g_sendhead.code[0]=5;
  5469. g_sendhead.tabcount=1;
  5470. g_sendhead.bsql=0;
  5471. int g_nYearposTemp=g_nYearpos;
  5472. g_nYearpos=-1;
  5473. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5474. g_nYearpos=g_nYearposTemp;
  5475. if(g_bSendOK==0)return;
  5476. DataToArray(&phonearray);
  5477. m_money1.Format ("%f", atof(m_taoxijiage));
  5478. m_money2.Format ("%f", atof(m_payed1));
  5479. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5480. ConvertToPrice(m_money1);
  5481. ConvertToPrice(m_money2);
  5482. ConvertToPrice(m_money3);
  5483. ////////////////////////////////////////////////////////////////
  5484. int rcpos=-1;
  5485. CRect StrRect=load.m_rcarray.ElementAt (0);
  5486. m_Print.SetFontFace(25, 1, "黑体");
  5487. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"预约单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5488. m_Print.SetFontFace(11, 1, "宋体");
  5489. StrRect=load.m_rcarray .ElementAt (1);
  5490. if(m_time1.GetLength ()==10)
  5491. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2));
  5492. else
  5493. str="开单日期:";
  5494. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5495. StrRect=load.m_rcarray .ElementAt (2);
  5496. m_Print.DrawText((LPTSTR)(LPCTSTR)("No."+strOrderNumber), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5497. CStringArray strarray;
  5498. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
  5499. {
  5500. Image *pImg=NULL;
  5501. g_nSendCode=31;
  5502. int g_nYearposTemp=g_nYearpos;
  5503. g_nYearpos=-1;
  5504. g_pMainWnd->ProcessChatMessageRequest2(1);
  5505. g_nYearpos=g_nYearposTemp;
  5506. g_nSendCode=0;
  5507. if(g_bSendOK==0)return;
  5508. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  5509. if(pImg)
  5510. {
  5511. StrRect.left=47;
  5512. StrRect.top=12;
  5513. StrRect.right=StrRect.left+60;
  5514. StrRect.bottom=StrRect.top+60;
  5515. m_Print.DrawImage(pImg, StrRect);
  5516. delete pImg;pImg=NULL;
  5517. }
  5518. }
  5519. #ifdef CHILD_VERSION
  5520. strarray.Add("家长姓名");
  5521. strarray.Add("宝宝姓名");
  5522. #else
  5523. strarray.Add("先生姓名");
  5524. strarray.Add("女士姓名");
  5525. #endif
  5526. strarray.Add ("服装套数");
  5527. // strarray.Add ("拍摄张数");
  5528. #ifdef CHILD_VERSION
  5529. strarray.Add("出生日期");
  5530. #else
  5531. strarray.Add("结婚日期");
  5532. #endif
  5533. strarray.Add ("拍摄日期");
  5534. strarray.Add ("联系电话");
  5535. strarray.Add ("联系电话");
  5536. strarray.Add ("造型套数");
  5537. if(m_zs.Find ("\\")!=-1)
  5538. strarray.Add ("入底\\入册");
  5539. else
  5540. strarray.Add ("入底张数");
  5541. strarray.Add ("选片日期");
  5542. strarray.Add ("QQ/邮箱");
  5543. strarray.Add ("套系总额");
  5544. strarray.Add ("预约金");
  5545. strarray.Add ("余款金额");
  5546. strarray.Add ("取件日期");
  5547. strarray.Add (m_name1);
  5548. strarray.Add (m_name2);
  5549. strarray.Add (m_clothescount);
  5550. // str.Format("%d", atoi(m_zs)*3);
  5551. // strarray.Add (str);
  5552. #ifdef CHILD_VERSION
  5553. strarray.Add(m_birthday1);
  5554. #else
  5555. strarray.Add(m_time3);
  5556. #endif
  5557. strarray.Add (m_time2);
  5558. strarray.Add (m_phone1);
  5559. strarray.Add (m_phone2);
  5560. strarray.Add (m_clothescount2);
  5561. strarray.Add (m_zs);
  5562. strarray.Add (m_time4);
  5563. strarray.Add (m_qq1);
  5564. strarray.Add (m_money1);
  5565. strarray.Add (m_money2);
  5566. strarray.Add (m_money3);
  5567. strarray.Add (m_time5);
  5568. for( i=4; i<=33; i++)
  5569. {
  5570. StrRect=load.m_rcarray .ElementAt (i-1);
  5571. m_Print.DrawRect2(StrRect, 1);
  5572. if(strarray.GetSize ()>(i-4))
  5573. {
  5574. if(i<=18)
  5575. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5576. else
  5577. {
  5578. StrRect.left +=4;
  5579. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5580. }
  5581. }
  5582. }
  5583. int dt=413;
  5584. StrRect=load.m_rcarray .ElementAt (36);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5585. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5586. StrRect=load.m_rcarray .ElementAt (37);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5587. StrRect=load.m_rcarray .ElementAt (38);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5588. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5589. StrRect=load.m_rcarray .ElementAt (39);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  5590. StrRect=load.m_rcarray .ElementAt (40);StrRect.top +=dt;StrRect.bottom +=dt;
  5591. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5592. StrRect=load.m_rcarray .ElementAt (41);StrRect.top +=dt;StrRect.bottom +=dt;
  5593. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5594. StrRect=load.m_rcarray .ElementAt (42);StrRect.top +=dt;StrRect.bottom +=dt;
  5595. m_Print.DrawText((LPTSTR)(LPCTSTR)("网址:"+g_cominfoarray.ElementAt (0).ElementAt (13)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  5596. //////////////////////////////
  5597. //开始画文字
  5598. StrRect=load.m_rcarray .ElementAt (7);
  5599. int hei=StrRect.Height ();
  5600. StrRect.top+=hei ;
  5601. StrRect.bottom+=hei ;
  5602. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5603. StrRect.top+=dt ;
  5604. StrRect.bottom+=dt ;
  5605. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5606. StrRect=load.m_rcarray .ElementAt (17);
  5607. StrRect.top+=hei ;
  5608. StrRect.bottom+=hei ;
  5609. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5610. StrRect=load.m_rcarray .ElementAt (33);
  5611. StrRect.bottom =StrRect.top +dt ; m_Print.DrawRect2(StrRect, 1);
  5612. StrRect.top+=hei;
  5613. StrRect.left +=3;
  5614. StrRect.top +=3;
  5615. StrRect.right -=2;
  5616. StrRect.bottom -=2;
  5617. str="";
  5618. for(i=0; i<sparray.GetSize (); i++)
  5619. {
  5620. str+=sparray.ElementAt (i).ElementAt (5);
  5621. str+=" 数量:";
  5622. str+=sparray.ElementAt (i).ElementAt (3);
  5623. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  5624. str+="\r\n";
  5625. }
  5626. str.TrimRight ("\r\n");
  5627. AutoDraw(m_Print, StrRect, str, 1.4);
  5628. StrRect=load.m_rcarray .ElementAt (33);
  5629. StrRect.top +=dt ;
  5630. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  5631. StrRect.top+=hei;
  5632. StrRect.left +=3;
  5633. StrRect.top +=3;
  5634. StrRect.right -=2;
  5635. StrRect.bottom -=2;
  5636. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  5637. StrRect=load.m_rcarray .ElementAt (34);
  5638. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  5639. StrRect.top+=hei;
  5640. StrRect.left +=3;
  5641. StrRect.top +=3;
  5642. StrRect.right -=2;
  5643. StrRect.bottom -=2;
  5644. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  5645. if(str.IsEmpty ())
  5646. {
  5647. str="\
  5648. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  5649. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  5650. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  5651. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  5652. 持良好的心境.\r\n\
  5653. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  5654. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  5655. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  5656. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  5657. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  5658. 勿进影室, 以免影响拍摄.\r\n\
  5659. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  5660. 师或店长沟通.\r\n\
  5661. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  5662. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  5663. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  5664. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  5665. 9. 本合同余额欠款须在拍照前付清.\r\n\
  5666. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  5667. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  5668. 还.";
  5669. }
  5670. AutoDraw(m_Print, StrRect, str, 1.8);
  5671. StrRect=load.m_rcarray .ElementAt (35);
  5672. StrRect.bottom +=100;
  5673. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  5674. 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∨";
  5675. // AutoDraw(m_Print, StrRect, str, 1.4);
  5676. }
  5677. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==2)
  5678. {
  5679. PrintDinDan5(strOrderNumber);
  5680. return;
  5681. }
  5682. else if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==3)
  5683. {
  5684. PrintDinDan6(strOrderNumber);
  5685. return;
  5686. }
  5687. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  5688. dlg.m_pDC =m_Print.GetPDC() ;
  5689. dlg.m_mode=1;
  5690. if(aa==0)
  5691. {
  5692. if(dlg.DoModal ()!=IDOK)
  5693. return;
  5694. printcot=dlg.m_num;
  5695. }
  5696. //结束打印
  5697. m_Print.EndPage();
  5698. m_Print.EndPrint();
  5699. }
  5700. }
  5701. void CovertDate2(CString date, CString &date2)
  5702. {
  5703. try
  5704. {
  5705. if(date=="2013-04-09")
  5706. {
  5707. date2="2013-02-29";
  5708. return;
  5709. }
  5710. ///////////////////////////////////
  5711. date2=date;
  5712. GongToLong(date2);
  5713. ////////////////////////////////////
  5714. return;
  5715. CCalendarConvert m_CalendarConvert;
  5716. SYSTEMTIME src = {0};
  5717. SYSTEMTIME dst = {0};
  5718. COleDateTime m_timeLunar(atoi(date.Mid (0,4)),atoi(date.Mid (5,2)),atoi(date.Mid (8,2)),0,0,0);
  5719. COleDateTime m_timeGregorian;
  5720. m_timeLunar.GetAsSystemTime ( src );
  5721. BOOL bEmbolism = 0;
  5722. if ( m_CalendarConvert.Gregorian2Lunar ( &src, &dst , &bEmbolism) )
  5723. {
  5724. m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime ( &dst );
  5725. date2.Format ("%04d-%02d-%02d", m_timeGregorian.GetYear (), m_timeGregorian.GetMonth (), m_timeGregorian.GetDay ());
  5726. if(m_timeGregorian.GetYear ()==-1)date2="2000-13-32";
  5727. }
  5728. else
  5729. {
  5730. date2.Empty ();
  5731. }
  5732. }
  5733. catch(...)
  5734. {
  5735. }
  5736. }
  5737. void CMainFrame::PrintDinDan5(CString m_id)
  5738. {
  5739. int printcot=1;
  5740. for(int aa=0; aa<printcot; aa++)
  5741. {
  5742. PrintPreview dlg;
  5743. CPrintRX m_Print;
  5744. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  5745. {
  5746. m_Print.InitToPrint(NULL, 1);
  5747. }
  5748. else
  5749. {
  5750. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  5751. if(name.IsEmpty ())
  5752. m_Print.InitToPrint(NULL, 1);
  5753. else
  5754. {
  5755. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  5756. if(nret==-1 && aa==0)
  5757. {
  5758. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  5759. }
  5760. }
  5761. }
  5762. {
  5763. m_Print.StartPrint();
  5764. m_Print.StartPage();
  5765. LoadRect load;
  5766. load.SetLiaPath ("19.lia");
  5767. load.SetMargins(0,-20);
  5768. if(!load.Load ())return;
  5769. int i;
  5770. //////////////////////////////////////////////////////////////
  5771. CStringArray txarray;
  5772. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  5773. g_sendhead.code[0]=11;
  5774. g_sendhead.code[1]=52;
  5775. g_sendhead.code[2]=50;
  5776. g_sendhead.code[3]=150;
  5777. g_sendhead.code[4]=77;
  5778. g_sendhead.code[5]=4;
  5779. g_sendhead.tabcount=6;
  5780. g_sendhead.bsql=0;
  5781. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  5782. CArray<CStringArray, CStringArray>sparray;
  5783. CArray<CStringArray, CStringArray>clientarray;
  5784. CArray<CStringArray, CStringArray>phonearray;
  5785. CArray<CStringArray, CStringArray>fgarray;
  5786. CArray<CStringArray, CStringArray>danweiarray;
  5787. CArray<CStringArray, CStringArray>jdarray;
  5788. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  5789. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  5790. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  5791. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  5792. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  5793. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  5794. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  5795. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  5796. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  5797. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  5798. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  5799. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  5800. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  5801. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  5802. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  5803. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  5804. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  5805. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  5806. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  5807. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  5808. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  5809. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  5810. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  5811. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  5812. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  5813. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  5814. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  5815. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  5816. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (36);
  5817. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  5818. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  5819. CString m_txtype = g_List1array.ElementAt (0).ElementAt (52);
  5820. CString m_memberno = g_List1array.ElementAt (0).ElementAt (47);
  5821. CString str;
  5822. if(jdarray.GetSize ())
  5823. {
  5824. if(m_bz.IsEmpty ()==0)
  5825. m_bz="\r\n"+m_bz;
  5826. m_bz+="景点:";
  5827. }
  5828. for( i=0; i<jdarray.GetSize (); i++)
  5829. {
  5830. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  5831. }
  5832. m_bz.TrimRight (";");
  5833. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  5834. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  5835. if(IsHasRights2new(31)==0)
  5836. {
  5837. m_phone1="***";
  5838. m_phone2="***";
  5839. }
  5840. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  5841. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  5842. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  5843. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  5844. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  5845. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  5846. BOOL check1=atoi(clientarray.ElementAt (0).ElementAt (15));
  5847. filter="name='"+m_ren+"'";
  5848. g_sendhead.code[0]=5;
  5849. g_sendhead.tabcount=1;
  5850. g_sendhead.bsql=0;
  5851. int g_nYearposTemp=g_nYearpos;
  5852. g_nYearpos=-1;
  5853. g_pMainWnd->ProcessChatMessageRequest2(filter);
  5854. g_nYearpos=g_nYearposTemp;
  5855. if(g_bSendOK==0)return;
  5856. DataToArray(&phonearray);
  5857. m_money1.Format ("%f", atof(m_taoxijiage));
  5858. m_money2.Format ("%f", atof(m_payed1));
  5859. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  5860. ConvertToPrice(m_money1);
  5861. ConvertToPrice(m_money2);
  5862. ConvertToPrice(m_money3);
  5863. ////////////////////////////////////////////////////////////////
  5864. int rcpos=-1;
  5865. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  5866. //Image *pImg=NULL;
  5867. // ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  5868. // m_Print.DrawImage(pImg, StrRect);
  5869. // delete pImg;
  5870. m_Print.SetFontFace(20, 1, "宋体");
  5871. StrRect=load.m_rcarray .ElementAt (1);
  5872. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"定单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5873. m_Print.SetFontFace(12, 1, "宋体");
  5874. StrRect=load.m_rcarray .ElementAt (2);
  5875. m_Print.DrawText((LPTSTR)(LPCTSTR)("NO."+m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5876. StrRect=load.m_rcarray .ElementAt (3);
  5877. str.Format ("%s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2) );
  5878. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5879. StrRect=load.m_rcarray .ElementAt (4);
  5880. m_Print.DrawText((LPTSTR)(LPCTSTR)("联系人:"+m_name1), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  5881. CStringArray strarray;
  5882. strarray.Add("姓名");
  5883. strarray.Add("性别");
  5884. strarray.Add("年龄");
  5885. strarray.Add("出生年月");
  5886. strarray.Add("套系价格");
  5887. strarray.Add("预约金");
  5888. strarray.Add("欠款");
  5889. strarray.Add("拍摄类型");
  5890. strarray.Add("会员卡号");
  5891. strarray.Add("定单人");
  5892. strarray.Add("入底\\入册");
  5893. strarray.Add("联系电话");
  5894. for( i=6; i<=17; i++)
  5895. {
  5896. StrRect=load.m_rcarray .ElementAt (i-1);
  5897. m_Print.DrawRect2(StrRect, 1);
  5898. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-6), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5899. }
  5900. strarray.RemoveAll ();
  5901. strarray.Add(m_name2);
  5902. strarray.Add(m_sex);
  5903. if(m_birthday.GetLength ()!=10)
  5904. strarray.Add("");
  5905. else
  5906. {
  5907. int year=0;
  5908. if(check1)
  5909. {
  5910. CString date2;
  5911. CovertDate2(g_date, date2);
  5912. year=atoi(date2.Left (4))-atoi(m_birthday.Left (4));
  5913. if(date2.Right(5)>=m_birthday.Right(5))
  5914. year++;
  5915. }
  5916. else
  5917. {
  5918. year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  5919. if(g_date.Right(5)>=m_birthday.Right(5))
  5920. year++;
  5921. }
  5922. str.Format ("%d", year);
  5923. strarray.Add(str);
  5924. }
  5925. strarray.Add(m_birthday);
  5926. strarray.Add(m_money1);
  5927. strarray.Add(m_money2);
  5928. strarray.Add(m_money3);
  5929. strarray.Add(m_txtype);
  5930. strarray.Add(m_memberno);
  5931. strarray.Add(m_ren);
  5932. strarray.Add(m_zs);
  5933. if(!m_phone1.IsEmpty ())
  5934. strarray.Add(m_phone1);
  5935. else
  5936. strarray.Add(m_phone2);
  5937. for( i=18; i<=29; i++)
  5938. {
  5939. StrRect=load.m_rcarray .ElementAt (i-1);
  5940. m_Print.DrawRect2(StrRect, 1);
  5941. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5942. }
  5943. strarray.RemoveAll ();
  5944. strarray.Add("摄影师");
  5945. strarray.Add("拍照时间");
  5946. strarray.Add("选片人");
  5947. strarray.Add("选片时间");
  5948. strarray.Add("引导师");
  5949. strarray.Add("设计师");
  5950. strarray.Add("取件时间");
  5951. strarray.Add("顾客签字");
  5952. for( i=34; i<=41; i++)
  5953. {
  5954. StrRect=load.m_rcarray .ElementAt (i-1);
  5955. m_Print.DrawRect2(StrRect, 1);
  5956. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-34), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5957. }
  5958. strarray.RemoveAll ();
  5959. strarray.Add(m_waiter1);
  5960. strarray.Add(m_time2);
  5961. strarray.Add(m_waiter3);
  5962. strarray.Add(m_time4);
  5963. strarray.Add(m_waiter2);
  5964. strarray.Add(m_waiter4);
  5965. strarray.Add(m_time5);
  5966. strarray.Add("");
  5967. for( i=42; i<=49; i++)
  5968. {
  5969. StrRect=load.m_rcarray .ElementAt (i-1);
  5970. m_Print.DrawRect2(StrRect, 1);
  5971. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  5972. }
  5973. m_Print.SetFontFace(15, 1, "宋体");
  5974. StrRect=load.m_rcarray .ElementAt (29);
  5975. m_Print.DrawRect2(StrRect, 1);
  5976. StrRect.top +=45;
  5977. m_Print.DrawText((LPTSTR)(LPCTSTR)"拍", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5978. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5979. m_Print.DrawText((LPTSTR)(LPCTSTR)"内", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5980. m_Print.DrawText((LPTSTR)(LPCTSTR)"容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5981. StrRect=load.m_rcarray .ElementAt (30);
  5982. m_Print.DrawRect2(StrRect, 1);
  5983. StrRect.top +=45;
  5984. m_Print.DrawText((LPTSTR)(LPCTSTR)"友", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5985. m_Print.DrawText((LPTSTR)(LPCTSTR)"情", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5986. m_Print.DrawText((LPTSTR)(LPCTSTR)"提", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);StrRect.top +=20;
  5987. m_Print.DrawText((LPTSTR)(LPCTSTR)"示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  5988. m_Print.SetFontFace(10, 1, "宋体");
  5989. StrRect=load.m_rcarray .ElementAt (37);StrRect.top =StrRect.bottom +2;
  5990. str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  5991. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  5992. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  5993. StrRect=load.m_rcarray .ElementAt (48);StrRect.top =StrRect.bottom +2;StrRect.left -=200;
  5994. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  5995. //开始画文字
  5996. StrRect=load.m_rcarray .ElementAt (31);
  5997. StrRect.left +=3;
  5998. StrRect.top +=3;
  5999. StrRect.right -=2;
  6000. StrRect.bottom -=2;
  6001. str="";
  6002. for(i=0; i<sparray.GetSize (); i++)
  6003. {
  6004. str+=sparray.ElementAt (i).ElementAt (5);
  6005. str+=" 数量:";
  6006. str+=sparray.ElementAt (i).ElementAt (3);
  6007. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  6008. str+="\r\n";
  6009. }
  6010. str.TrimRight ("\r\n");
  6011. m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6012. m_bz.TrimLeft();
  6013. if(m_bz!="")
  6014. { str+="\r\n";str+="\r\n";
  6015. str+="备注:"+m_bz;
  6016. }
  6017. AutoDraw(m_Print, StrRect, str, 1.4);
  6018. StrRect=load.m_rcarray .ElementAt (32); m_Print.DrawRect2(StrRect, 1);
  6019. StrRect.left +=3;
  6020. StrRect.top +=3;
  6021. StrRect.right -=2;
  6022. StrRect.bottom -=2;
  6023. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6024. if(str.IsEmpty ())
  6025. {
  6026. str="\
  6027. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6028. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6029. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6030. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6031. 持良好的心境.\r\n\
  6032. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6033. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6034. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6035. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6036. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6037. 勿进影室, 以免影响拍摄.\r\n\
  6038. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6039. 师或店长沟通.\r\n\
  6040. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6041. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6042. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6043. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6044. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6045. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6046. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6047. 还.";
  6048. }
  6049. AutoDraw(m_Print, StrRect, str, 1.8);
  6050. }
  6051. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6052. dlg.m_pDC =m_Print.GetPDC() ;
  6053. dlg.m_mode=1;
  6054. if(aa==0)
  6055. {
  6056. if(dlg.DoModal ()!=IDOK)
  6057. return;
  6058. printcot=dlg.m_num;
  6059. }
  6060. //结束打印
  6061. m_Print.EndPage();
  6062. m_Print.EndPrint();
  6063. }
  6064. }
  6065. void CMainFrame::PrintDinDan4(CString m_id)
  6066. {
  6067. // TODO: Add your control notification handler code here
  6068. CPrintRX m_Print;
  6069. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6070. {
  6071. m_Print.InitToPrint(NULL, 1);
  6072. }
  6073. else
  6074. {
  6075. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  6076. if(name.IsEmpty ())
  6077. m_Print.InitToPrint(NULL, 1);
  6078. else
  6079. {
  6080. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6081. if(nret==-1)
  6082. {
  6083. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6084. }
  6085. }
  6086. }
  6087. m_Print.StartPrint();
  6088. m_Print.StartPage();
  6089. LoadRect load;
  6090. load.SetLiaPath ("6-2.lia");
  6091. load.SetMargins(0,0);
  6092. if(!load.Load ())return;
  6093. int i;
  6094. //////////////////////////////////////////////////////////////
  6095. CStringArray txarray;
  6096. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  6097. g_sendhead.code[0]=11;
  6098. g_sendhead.code[1]=52;
  6099. g_sendhead.code[2]=50;
  6100. g_sendhead.code[3]=150;
  6101. g_sendhead.code[4]=77;
  6102. g_sendhead.code[5]=4;
  6103. g_sendhead.tabcount=6;
  6104. g_sendhead.bsql=0;
  6105. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  6106. CArray<CStringArray, CStringArray>sparray;
  6107. CArray<CStringArray, CStringArray>clientarray;
  6108. CArray<CStringArray, CStringArray>phonearray;
  6109. CArray<CStringArray, CStringArray>fgarray;
  6110. CArray<CStringArray, CStringArray>danweiarray;
  6111. CArray<CStringArray, CStringArray>jdarray;
  6112. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  6113. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  6114. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  6115. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  6116. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  6117. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  6118. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  6119. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  6120. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  6121. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  6122. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  6123. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  6124. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  6125. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  6126. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  6127. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  6128. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  6129. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  6130. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  6131. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  6132. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  6133. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  6134. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  6135. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  6136. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  6137. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  6138. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  6139. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  6140. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  6141. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6142. if(jdarray.GetSize ())
  6143. {
  6144. if(m_bz.IsEmpty ()==0)
  6145. m_bz="\r\n"+m_bz;
  6146. m_bz+="景点:";
  6147. }
  6148. for( i=0; i<jdarray.GetSize (); i++)
  6149. {
  6150. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  6151. }
  6152. m_bz.TrimRight (";");
  6153. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  6154. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  6155. if(IsHasRights2new(31)==0)
  6156. {
  6157. m_phone1="***";
  6158. m_phone2="***";
  6159. }
  6160. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  6161. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  6162. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  6163. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  6164. CString str;
  6165. filter="name='"+m_ren+"'";
  6166. g_sendhead.code[0]=5;
  6167. g_sendhead.tabcount=1;
  6168. g_sendhead.bsql=0;
  6169. int g_nYearposTemp=g_nYearpos;
  6170. g_nYearpos=-1;
  6171. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6172. g_nYearpos=g_nYearposTemp;
  6173. if(g_bSendOK==0)return;
  6174. DataToArray(&phonearray);
  6175. m_money1.Format ("%f", atof(m_taoxijiage));
  6176. m_money2.Format ("%f", atof(m_payed1));
  6177. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  6178. ConvertToPrice(m_money1);
  6179. ConvertToPrice(m_money2);
  6180. ConvertToPrice(m_money3);
  6181. ////////////////////////////////////////////////////////////////
  6182. int rcpos=-1;
  6183. CRect StrRect=load.m_rcarray.ElementAt (0);
  6184. m_Print.SetFontFace(25, 1, "黑体");
  6185. m_Print.DrawText((LPTSTR)(LPCTSTR)"巴黎春天婚纱摄影预约单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6186. m_Print.SetFontFace(11, 1, "宋体");
  6187. StrRect=load.m_rcarray .ElementAt (1);
  6188. if(m_time1.GetLength ()==10)
  6189. str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left (4), m_time1.Mid (5, 2), m_time1.Mid (8, 2));
  6190. else
  6191. str="开单日期:";
  6192. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6193. StrRect=load.m_rcarray .ElementAt (2);
  6194. m_Print.DrawText((LPTSTR)(LPCTSTR)("No."+m_id), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6195. CStringArray strarray;
  6196. strarray.Add ("先生姓名");
  6197. strarray.Add ("女士姓名");
  6198. strarray.Add ("服装套数");
  6199. strarray.Add ("拍摄张数");
  6200. strarray.Add ("拍摄日期");
  6201. strarray.Add ("联系电话");
  6202. strarray.Add ("联系电话");
  6203. strarray.Add ("造型套数");
  6204. strarray.Add ("入册张数");
  6205. strarray.Add ("选片日期");
  6206. strarray.Add ("QQ/邮箱");
  6207. strarray.Add ("套系总额");
  6208. strarray.Add ("预约金");
  6209. strarray.Add ("余款金额");
  6210. strarray.Add ("取件日期");
  6211. strarray.Add (m_name1);
  6212. strarray.Add (m_name2);
  6213. strarray.Add (m_clothescount);
  6214. str.Format("%d", atoi(m_zs)*3);
  6215. strarray.Add (str);
  6216. strarray.Add (m_time2);
  6217. strarray.Add (m_phone1);
  6218. strarray.Add (m_phone2);
  6219. strarray.Add (m_clothescount2);
  6220. strarray.Add (m_zs);
  6221. strarray.Add (m_time4);
  6222. strarray.Add (m_qq1);
  6223. strarray.Add (m_money1);
  6224. strarray.Add (m_money2);
  6225. strarray.Add (m_money3);
  6226. strarray.Add (m_time5);
  6227. for( i=4; i<=33; i++)
  6228. {
  6229. StrRect=load.m_rcarray .ElementAt (i-1);
  6230. m_Print.DrawRect2(StrRect, 1);
  6231. if(strarray.GetSize ()>(i-4))
  6232. {
  6233. if(i<=18)
  6234. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6235. else
  6236. {
  6237. StrRect.left +=4;
  6238. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6239. }
  6240. }
  6241. }
  6242. int dt=413;
  6243. StrRect=load.m_rcarray .ElementAt (36);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6244. m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6245. StrRect=load.m_rcarray .ElementAt (37);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6246. StrRect=load.m_rcarray .ElementAt (38);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6247. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6248. StrRect=load.m_rcarray .ElementAt (39);StrRect.top +=dt;StrRect.bottom +=dt;m_Print.DrawRect2(StrRect, 1);StrRect.left +=4;
  6249. StrRect=load.m_rcarray .ElementAt (40);StrRect.top +=dt;StrRect.bottom +=dt;
  6250. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址:深圳市红岭中路中深国际大厦首层,二十二层", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6251. StrRect=load.m_rcarray .ElementAt (41);StrRect.top +=dt;StrRect.bottom +=dt;
  6252. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:0755-61308198 61308199 25860696 25860697", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6253. StrRect=load.m_rcarray .ElementAt (42);StrRect.top +=dt;StrRect.bottom +=dt;
  6254. m_Print.DrawText((LPTSTR)(LPCTSTR)"网址:www.paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6255. StrRect=load.m_rcarray .ElementAt (43);StrRect.top +=dt;StrRect.bottom +=dt;
  6256. m_Print.DrawText((LPTSTR)(LPCTSTR)"邮箱:blct@paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6257. //////////////////////////////
  6258. //开始画文字
  6259. StrRect=load.m_rcarray .ElementAt (7);
  6260. int hei=StrRect.Height ();
  6261. StrRect.top+=hei ;
  6262. StrRect.bottom+=hei ;
  6263. m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6264. StrRect.top+=dt ;
  6265. StrRect.bottom+=dt ;
  6266. m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6267. StrRect=load.m_rcarray .ElementAt (17);
  6268. StrRect.top+=hei ;
  6269. StrRect.bottom+=hei ;
  6270. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6271. StrRect=load.m_rcarray .ElementAt (33);
  6272. StrRect.bottom =StrRect.top +dt ; m_Print.DrawRect2(StrRect, 1);
  6273. StrRect.top+=hei;
  6274. StrRect.left +=3;
  6275. StrRect.top +=3;
  6276. StrRect.right -=2;
  6277. StrRect.bottom -=2;
  6278. str="";
  6279. for(i=0; i<sparray.GetSize (); i++)
  6280. {
  6281. str+=sparray.ElementAt (i).ElementAt (5);
  6282. str+=" 数量:";
  6283. str+=sparray.ElementAt (i).ElementAt (3);
  6284. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  6285. str+="\r\n";
  6286. }
  6287. str.TrimRight ("\r\n");
  6288. AutoDraw(m_Print, StrRect, str, 1.4);
  6289. StrRect=load.m_rcarray .ElementAt (33);
  6290. StrRect.top +=dt ;
  6291. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  6292. StrRect.top+=hei;
  6293. StrRect.left +=3;
  6294. StrRect.top +=3;
  6295. StrRect.right -=2;
  6296. StrRect.bottom -=2;
  6297. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6298. StrRect=load.m_rcarray .ElementAt (34);
  6299. StrRect.bottom +=dt ;m_Print.DrawRect2(StrRect, 1);
  6300. StrRect.top+=hei;
  6301. StrRect.left +=3;
  6302. StrRect.top +=3;
  6303. StrRect.right -=2;
  6304. StrRect.bottom -=2;
  6305. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6306. if(str.IsEmpty ())
  6307. {
  6308. str="\
  6309. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6310. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6311. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6312. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6313. 持良好的心境.\r\n\
  6314. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6315. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6316. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6317. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6318. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6319. 勿进影室, 以免影响拍摄.\r\n\
  6320. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6321. 师或店长沟通.\r\n\
  6322. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6323. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6324. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6325. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6326. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6327. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6328. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6329. 还.";
  6330. }
  6331. AutoDraw(m_Print, StrRect, str, 1.8);
  6332. StrRect=load.m_rcarray .ElementAt (35);
  6333. StrRect.bottom +=100;
  6334. // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
  6335. 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∨";
  6336. AutoDraw(m_Print, StrRect, str, 1.4);
  6337. PrintPreview dlg;
  6338. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6339. dlg.m_pDC =m_Print.GetPDC() ;
  6340. if(dlg.DoModal ()!=IDOK)return;
  6341. //结束打印
  6342. m_Print.EndPage();
  6343. m_Print.EndPrint();
  6344. }
  6345. int CalHeight(CArray<CRect,CRect>*rcarray, CStringArray *strarray2, CPrintRX *Print, int FORMAT)
  6346. {
  6347. CSize size;
  6348. CString str,temp;
  6349. CRect rc;
  6350. int maxhei=1;
  6351. int fonthei;
  6352. for(int i=0; i < rcarray->GetSize (); i++)
  6353. {
  6354. rc=rcarray->ElementAt (i);
  6355. maxhei=max(maxhei, rc.bottom );
  6356. str=strarray2->ElementAt (i);
  6357. temp.Empty ();
  6358. int hei=0;
  6359. while(str.IsEmpty()==0)
  6360. {
  6361. str=str.Right (str.GetLength ()-temp.GetLength ());
  6362. if(str.IsEmpty ())break;
  6363. Print->GetStrSize((LPTSTR)(LPCTSTR)str, size);
  6364. fonthei=size.cy+1;
  6365. if(size.cx<=rc.Width())
  6366. {
  6367. CRect rc2=rc;
  6368. rc2.top +=hei*fonthei;
  6369. rc2.bottom =rc2.top+fonthei;
  6370. Print->DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT | FORMAT_UP);
  6371. //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6372. maxhei=max(maxhei, rc2.bottom );
  6373. break;
  6374. }
  6375. int right=0;
  6376. while(size.cx>rc.Width ())
  6377. {
  6378. right++;
  6379. temp=str.Left (str.GetLength ()-(right));
  6380. if(GIsHalfHZ(temp))
  6381. {
  6382. right++;
  6383. temp.Delete (temp.GetLength ()-1);
  6384. }
  6385. Print->GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  6386. }
  6387. CRect rc2=rc;
  6388. rc2.top +=hei*fonthei;
  6389. rc2.bottom =rc2.top+fonthei;
  6390. Print->DrawText((LPTSTR)(LPCTSTR)temp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
  6391. hei++;
  6392. maxhei=max(maxhei, rc2.bottom );
  6393. }
  6394. }
  6395. return maxhei+1;
  6396. }
  6397. /* CPrintRX m_Print;
  6398. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6399. {
  6400. m_Print.InitToPrint(NULL, 1);
  6401. }
  6402. else
  6403. {
  6404. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  6405. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6406. if(nret==-1)
  6407. {
  6408. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6409. }
  6410. }
  6411. m_Print.StartPrint();
  6412. m_Print.StartPage();
  6413. LoadRect load;
  6414. load.SetLiaPath ("6.lia");
  6415. load.SetMargins(-14,35);
  6416. if(!load.Load ())return;
  6417. LoadRect load2;
  6418. load2.SetLiaPath ("7.lia");
  6419. load2.SetMargins(-14,216+35);
  6420. if(!load2.Load ())return;
  6421. LoadRect load3;
  6422. load3.SetLiaPath ("8.lia");
  6423. load3.SetMargins(-14,705+35);
  6424. if(!load3.Load ())return;
  6425. int i;
  6426. //////////////////////////////////////////////////////////////
  6427. CStringArray txarray;
  6428. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册';";
  6429. g_sendhead.code[0]=11;
  6430. g_sendhead.code[1]=52;
  6431. g_sendhead.code[2]=50;
  6432. g_sendhead.code[3]=77;
  6433. g_sendhead.tabcount=4;
  6434. g_sendhead.bsql=0;
  6435. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  6436. CArray<CStringArray, CStringArray>sparray;
  6437. CArray<CStringArray, CStringArray>clientarray;
  6438. CArray<CStringArray, CStringArray>phonearray;
  6439. CArray<CStringArray, CStringArray>fgarray;
  6440. DataToArray(&g_List1array, &clientarray, &sparray, &fgarray);
  6441. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  6442. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  6443. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  6444. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  6445. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  6446. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  6447. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  6448. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  6449. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  6450. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  6451. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  6452. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  6453. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  6454. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  6455. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  6456. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  6457. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  6458. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  6459. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  6460. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  6461. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  6462. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  6463. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  6464. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  6465. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  6466. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  6467. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  6468. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  6469. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  6470. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  6471. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  6472. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  6473. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  6474. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  6475. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  6476. filter="name='"+m_ren+"'";
  6477. g_sendhead.code[0]=5;
  6478. g_sendhead.tabcount=1;
  6479. g_sendhead.bsql=0;
  6480. int g_nYearposTemp=g_nYearpos;
  6481. g_nYearpos=-1;
  6482. g_pMainWnd->ProcessChatMessageRequest2(filter);
  6483. g_nYearpos=g_nYearposTemp;
  6484. if(g_bSendOK==0)return;
  6485. DataToArray(&phonearray);
  6486. m_money1.Format ("%f", atof(m_taoxijiage));
  6487. m_money2.Format ("%f", atof(m_payed1));
  6488. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  6489. ConvertToPrice(m_money1);
  6490. ConvertToPrice(m_money2);
  6491. ConvertToPrice(m_money3);
  6492. ////////////////////////////////////////////////////////////////
  6493. int rcpos=-1;
  6494. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6495. StrRect.top -=15;StrRect.bottom -=15;
  6496. Image *pImg=NULL;
  6497. #ifdef MNLS_VERSION
  6498. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  6499. #else
  6500. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  6501. #endif
  6502. m_Print.DrawImage(pImg, StrRect);
  6503. delete pImg;
  6504. m_Print.SetFontFace(11, 1, "宋体");
  6505. StrRect=load.m_rcarray .ElementAt (20);
  6506. StrRect.right=load.m_rcarray .ElementAt (23).right;
  6507. StrRect.top -=18;StrRect.bottom -=18;
  6508. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  6509. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6510. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  6511. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6512. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6513. StrRect.top -=15;StrRect.bottom -=15;
  6514. #ifdef MNLS_VERSION
  6515. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6516. #endif
  6517. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6518. StrRect.top -=15;StrRect.bottom -=15;
  6519. #ifdef MNLS_VERSION
  6520. m_Print.DrawRect(StrRect);
  6521. #endif
  6522. m_Print.SetFontFace(7, 1, "黑体");
  6523. m_Print.SetColor(0xffffff);
  6524. #ifdef MNLS_VERSION
  6525. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6526. #endif
  6527. m_Print.SetColor(0);
  6528. m_Print.SetFontFace(15, 1, "宋体");
  6529. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6530. StrRect.top -=15;StrRect.bottom -=15;
  6531. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6532. CStringArray strarray;
  6533. strarray.Add("NO: "+m_id);
  6534. CString date;
  6535. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  6536. strarray.Add(date);
  6537. strarray.Add("喜爱");
  6538. strarray.Add("格调");
  6539. if(fgarray.GetSize ()==12)
  6540. {
  6541. for(int i=0; i<12; i++)
  6542. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  6543. }
  6544. else
  6545. {
  6546. strarray.Add("复古典雅");
  6547. strarray.Add("温文尔雅");
  6548. strarray.Add("豪华艳丽");
  6549. strarray.Add("传统大方");
  6550. strarray.Add("新潮个性");
  6551. strarray.Add("浪漫奔放");
  6552. strarray.Add("简单素雅");
  6553. strarray.Add("活泼俏丽");
  6554. strarray.Add("妩媚温馨");
  6555. strarray.Add("温柔贤惠");
  6556. strarray.Add("成熟感性");
  6557. strarray.Add("清纯可爱");
  6558. }
  6559. strarray.Add("姓名");
  6560. strarray.Add("");
  6561. strarray.Add("电话");
  6562. strarray.Add("QQ/邮箱");
  6563. #ifdef CHILD_VERSION
  6564. strarray.Add("家长");
  6565. strarray.Add("宝宝");
  6566. #else
  6567. strarray.Add("先生");
  6568. strarray.Add("女士");
  6569. #endif
  6570. m_Print.SetFontFace(11, 1, "宋体");
  6571. for( i=0; i<strarray.GetSize (); i++)
  6572. {
  6573. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6574. if(i<2)
  6575. {
  6576. StrRect.top -=15;StrRect.bottom -=15;
  6577. }
  6578. if(i>15)
  6579. {
  6580. if(i==18)
  6581. StrRect.right-=80;
  6582. else if(i==19)
  6583. StrRect.left-=80;
  6584. m_Print.DrawRect2(StrRect, 1);
  6585. }
  6586. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6587. }
  6588. for( i=29; i<=40; i++)
  6589. {
  6590. if(m_style.GetLength ()<=(i-29))continue;
  6591. if(m_style.GetAt (i-29)!='1')continue;
  6592. StrRect=load.m_rcarray .ElementAt (i-1);
  6593. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6594. }
  6595. for( i=27; i<=48; i++)
  6596. {
  6597. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6598. if(i==45 || i==46)
  6599. StrRect.right-=80;
  6600. else if(i==47 || i==48)
  6601. StrRect.left-=80;
  6602. m_Print.DrawRect2(StrRect, 1);
  6603. }
  6604. /////////////////////////
  6605. strarray.RemoveAll ();
  6606. CString temp;
  6607. // temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  6608. strarray.Add (temp);
  6609. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  6610. strarray.Add (temp);
  6611. strarray.Add ("造型/");
  6612. strarray.Add ("服饰");
  6613. strarray.Add ("");
  6614. strarray.Add ("");
  6615. strarray.Add ("配");
  6616. strarray.Add ("置");
  6617. strarray.Add ("其");
  6618. strarray.Add ("它");
  6619. strarray.Add ("套系名称");
  6620. strarray.Add ("镜款");
  6621. strarray.Add ("套系总价");
  6622. strarray.Add ("拍摄张数");
  6623. strarray.Add ("选片日期");
  6624. strarray.Add ("定金");
  6625. strarray.Add ("入册张数");
  6626. strarray.Add ("");
  6627. strarray.Add ("欠款余额");
  6628. strarray.Add ("拍摄日期");
  6629. strarray.Add ("");
  6630. rcpos=-1;
  6631. for( i=0; i<strarray.GetSize (); i++)
  6632. {
  6633. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6634. if(i>9)
  6635. m_Print.DrawRect2(StrRect, 1);
  6636. if(i==1)
  6637. {
  6638. StrRect=load2.m_rcarray .ElementAt (21);StrRect.left +=4;
  6639. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6640. }
  6641. else if(i==6 || i==7)
  6642. {
  6643. StrRect.top -=25;
  6644. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6645. }
  6646. else
  6647. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6648. }
  6649. for( i=22; i<=41; i++)
  6650. {
  6651. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  6652. if(rcpos==23 || rcpos==28)continue;
  6653. if(rcpos==24 || rcpos==29)
  6654. StrRect.top-=39;
  6655. m_Print.DrawRect2(StrRect, 1);
  6656. }
  6657. /////////////////////////////
  6658. strarray.RemoveAll ();
  6659. strarray.Add ("顾客签字:");
  6660. strarray.Add ("");
  6661. strarray.Add ("");
  6662. strarray.Add ("门市签字:");
  6663. strarray.Add ("");
  6664. strarray.Add ("");
  6665. rcpos=-1;
  6666. for( i=0; i<strarray.GetSize (); i++)
  6667. {
  6668. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6669. if(i==0 || i==3)
  6670. {
  6671. StrRect.bottom+=20;
  6672. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6673. }
  6674. }
  6675. for( i=7; i<=12; i++)
  6676. {
  6677. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  6678. if(i==7 || i==10)
  6679. {
  6680. StrRect.bottom+=12;
  6681. m_Print.DrawRect2(StrRect, 2);
  6682. }
  6683. }
  6684. //////////////////////////////////////
  6685. //开始打数据
  6686. strarray.RemoveAll ();
  6687. strarray.Add (m_name1);
  6688. strarray.Add (m_name2);
  6689. strarray.Add ("");
  6690. strarray.Add ("");
  6691. strarray.Add (m_phone1);
  6692. #ifdef CHILD_VERSION
  6693. strarray.Add ("");
  6694. #else
  6695. strarray.Add (m_phone2);
  6696. #endif
  6697. strarray.Add (m_qq1);
  6698. strarray.Add (m_qq2);
  6699. for( i=41; i<=48; i++)
  6700. {
  6701. StrRect=load.m_rcarray .ElementAt (i-1);
  6702. StrRect.left +=4;
  6703. if(i==45 || i==46)
  6704. StrRect.right-=80;
  6705. else if(i==47 || i==48)
  6706. StrRect.left-=80;
  6707. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6708. }
  6709. ///////////////////////////////
  6710. strarray.RemoveAll ();
  6711. strarray.Add (m_money1);
  6712. str.Format("%d", atoi(m_zs)*2);
  6713. strarray.Add (str);
  6714. strarray.Add (m_time4);
  6715. strarray.Add (m_money2);
  6716. strarray.Add (m_zs);
  6717. strarray.Add ("");
  6718. strarray.Add (m_money3);
  6719. strarray.Add (m_time2);
  6720. strarray.Add ("");
  6721. for( i=32; i<=40; i++)
  6722. {
  6723. StrRect=load2.m_rcarray .ElementAt (i-1);
  6724. StrRect.left +=4;
  6725. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6726. }
  6727. ///////////////////////////////
  6728. strarray.RemoveAll ();
  6729. strarray.Add (m_name1);
  6730. strarray.Add (m_name2);
  6731. CString phone;
  6732. if(m_phone1.IsEmpty ()==0)
  6733. phone=m_phone1+",";
  6734. phone+=m_phone2;
  6735. phone.TrimRight (",");
  6736. strarray.Add (phone);
  6737. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  6738. strarray.Add (m_ren);
  6739. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  6740. for( i=7; i<=12; i++)
  6741. {
  6742. StrRect=load3.m_rcarray .ElementAt (i-1);
  6743. StrRect.left +=4;
  6744. //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6745. }
  6746. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  6747. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6748. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  6749. str.Format("造型 %d 款,服装 %d 套", atoi(m_clothescount2), atoi(m_clothescount));
  6750. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6751. // StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  6752. // m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6753. //////////////////////////////
  6754. //开始画文字
  6755. StrRect=load2.m_rcarray .ElementAt (30);
  6756. StrRect.left +=3;
  6757. StrRect.top +=3;
  6758. StrRect.right -=2;
  6759. StrRect.bottom -=2;
  6760. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  6761. StrRect=load2.m_rcarray .ElementAt (29); StrRect.top -=39;
  6762. StrRect.left +=3;
  6763. StrRect.top +=3;
  6764. StrRect.right -=2;
  6765. StrRect.bottom -=2;
  6766. str="";
  6767. for(i=0; i<sparray.GetSize (); i++)
  6768. {
  6769. str+=sparray.ElementAt (i).ElementAt (5);
  6770. str+=" 数量:";
  6771. str+=sparray.ElementAt (i).ElementAt (3);
  6772. str+="\r\n";
  6773. }
  6774. str.TrimRight ("\r\n");
  6775. AutoDraw(m_Print, StrRect, str, 1.4);
  6776. StrRect=load2.m_rcarray .ElementAt (40);
  6777. StrRect.top +=8;
  6778. m_Print.SetFontFace(12, 1, "黑体");
  6779. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客须知", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  6780. StrRect.left +=3;
  6781. StrRect.top +=30;
  6782. StrRect.right -=2;
  6783. StrRect.bottom -=2;
  6784. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  6785. if(str.IsEmpty ())
  6786. {
  6787. str="\
  6788. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  6789. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  6790. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  6791. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  6792. 持良好的心境.\r\n\
  6793. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  6794. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  6795. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  6796. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  6797. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  6798. 勿进影室, 以免影响拍摄.\r\n\
  6799. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  6800. 师或店长沟通.\r\n\
  6801. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  6802. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  6803. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  6804. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  6805. 9. 本合同余额欠款须在拍照前付清.\r\n\
  6806. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  6807. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  6808. 还.";
  6809. }
  6810. AutoDraw(m_Print, StrRect, str, 1.8);
  6811. PrintPreview dlg;
  6812. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6813. dlg.m_pDC =m_Print.GetPDC() ;
  6814. if(dlg.DoModal ()!=IDOK)return;
  6815. //结束打印
  6816. m_Print.EndPage();
  6817. m_Print.EndPrint();*/
  6818. /*
  6819. void CMainFrame::PrintReceipt(CStringArray *pArray)
  6820. {
  6821. g_sendhead.bsql=0;
  6822. g_sendhead.code[0]=24;
  6823. g_sendhead.tabcount=1;
  6824. int g_nYearposTemp=g_nYearpos;
  6825. g_nYearpos=-1;
  6826. g_pMainWnd->ProcessChatMessageRequest2(1);
  6827. g_nYearpos=g_nYearposTemp;
  6828. if(0==g_bSendOK)return;
  6829. DataToArray(&g_cominfoarray);
  6830. CString SerialNo;
  6831. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  6832. CPrintRX m_Print;
  6833. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  6834. {
  6835. m_Print.InitToPrint(NULL, 1);
  6836. }
  6837. else
  6838. {
  6839. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  6840. if(name.IsEmpty ())
  6841. m_Print.InitToPrint(NULL, 1);
  6842. else
  6843. {
  6844. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  6845. if(nret==-1)
  6846. {
  6847. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  6848. }
  6849. }
  6850. }
  6851. m_Print.StartPrint();
  6852. m_Print.StartPage();
  6853. LoadRect load;
  6854. BOOL bSmall=0;
  6855. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  6856. {
  6857. bSmall=1;
  6858. load.SetLiaPath ("20.lia");
  6859. }
  6860. else
  6861. load.SetLiaPath ("10.lia");
  6862. if(bSmall)
  6863. load.SetMargins(0,0);
  6864. else
  6865. load.SetMargins(10,0);
  6866. if(!load.Load ())return;
  6867. int rcpos=-1;
  6868. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  6869. if(bSmall)
  6870. {
  6871. m_Print.SetFontFace(18, 1, "黑体");
  6872. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6873. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6874. m_Print.SetFontFace(9, 1, "宋体");
  6875. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6876. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6877. m_Print.SetFontFace(6, 1, "宋体");
  6878. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6879. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6880. m_Print.SetFontFace(9, 1, "宋体");
  6881. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6882. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6883. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6884. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6885. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6886. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6887. int hei=StrRect.Height ();
  6888. StrRect.bottom=StrRect.top;
  6889. StrRect.top -=8;
  6890. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6891. m_Print.SetFontFace(11, 1, "宋体");
  6892. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6893. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6894. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6895. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6896. m_Print.SetFontFace(8, 1, "宋体");
  6897. for(int i=7; i<24; i++)
  6898. {
  6899. StrRect=load.m_rcarray .ElementAt (i);
  6900. m_Print.DrawRect2(StrRect, 1);
  6901. }
  6902. for( i=9; i<24; i++)
  6903. {
  6904. StrRect=load.m_rcarray .ElementAt (i);
  6905. StrRect.left +=2;
  6906. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6907. }
  6908. m_Print.SetFontFace(6, 1, "宋体");
  6909. for(i=24; i<26; i++)
  6910. {
  6911. StrRect=load.m_rcarray .ElementAt (i);
  6912. StrRect.left +=2;
  6913. if(i==24)
  6914. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6915. else
  6916. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6917. }
  6918. // StrRect=load.m_rcarray .ElementAt (27);
  6919. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6920. }
  6921. else//大单
  6922. {
  6923. m_Print.SetFontFace(20, 1, "黑体");
  6924. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6925. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6926. m_Print.SetFontFace(11, 1, "宋体");
  6927. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15;
  6928. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6929. int hei=StrRect.Height ();
  6930. StrRect.bottom=StrRect.top;
  6931. StrRect.top -=10;
  6932. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  6933. m_Print.SetFontFace(8, 1, "宋体");
  6934. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6935. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  6936. #ifdef LYFZ_VERSION
  6937. m_Print.SetFontFace(9, 1, "宋体");
  6938. #else
  6939. m_Print.SetFontFace(11, 1, "宋体");
  6940. #endif
  6941. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6942. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6943. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6944. #ifdef LYFZ_VERSION
  6945. StrRect.left +=30;
  6946. StrRect.right +=30;
  6947. #endif
  6948. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6949. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6950. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  6951. m_Print.SetFontFace(13, 1, "宋体");
  6952. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6953. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6954. StrRect=load.m_rcarray .ElementAt (++rcpos);
  6955. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6956. m_Print.SetFontFace(11, 1, "宋体");
  6957. for(int i=7; i<24; i++)
  6958. {
  6959. StrRect=load.m_rcarray .ElementAt (i);
  6960. m_Print.DrawRect2(StrRect, 1);
  6961. }
  6962. for( i=9; i<24; i++)
  6963. {
  6964. StrRect=load.m_rcarray .ElementAt (i);
  6965. StrRect.left +=2;
  6966. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6967. }
  6968. #ifdef LYFZ_VERSION
  6969. m_Print.SetFontFace(7, 1, "宋体");
  6970. for(i=24; i<25; i++)
  6971. {
  6972. StrRect=load.m_rcarray .ElementAt (i);
  6973. StrRect.left +=2;
  6974. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6975. }
  6976. #else
  6977. m_Print.SetFontFace(7, 1, "宋体");
  6978. for(i=24; i<27; i++)
  6979. {
  6980. StrRect=load.m_rcarray .ElementAt (i);
  6981. StrRect.left +=2;
  6982. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  6983. }
  6984. #endif
  6985. StrRect=load.m_rcarray .ElementAt (24);
  6986. hei=StrRect.Height ();
  6987. StrRect.top +=hei;
  6988. StrRect.bottom +=hei;
  6989. StrRect.right +=100;
  6990. StrRect.left +=2;
  6991. StrRect=load.m_rcarray .ElementAt (27);
  6992. AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  6993. }
  6994. PrintPreview dlg;
  6995. dlg.m_mode=3;
  6996. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  6997. dlg.m_pDC =m_Print.GetPDC() ;
  6998. if(dlg.DoModal ()!=IDOK)return;
  6999. //结束打印
  7000. m_Print.EndPage();
  7001. m_Print.EndPrint();
  7002. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7003. CString sql;
  7004. sql.Format("update version set [serialno]='%s'", SerialNo);
  7005. g_sendhead.bsql=1;
  7006. g_nYearposTemp=g_nYearpos;
  7007. g_nYearpos=-1;
  7008. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7009. g_nYearpos=g_nYearposTemp;
  7010. }
  7011. */
  7012. void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7013. {
  7014. //AfxMessageBox("abce");
  7015. int printcot=1;
  7016. for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7017. {
  7018. g_sendhead.bsql=0;
  7019. g_sendhead.code[0]=24;
  7020. g_sendhead.tabcount=1;
  7021. int g_nYearposTemp=g_nYearpos;
  7022. g_nYearpos=-1;
  7023. g_pMainWnd->ProcessChatMessageRequest2(1);
  7024. g_nYearpos=g_nYearposTemp;
  7025. if(0==g_bSendOK)return;
  7026. DataToArray(&g_cominfoarray);
  7027. CString SerialNo;
  7028. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7029. // 1.创建打印对象
  7030. CPrintRX m_Print;
  7031. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7032. {
  7033. m_Print.InitToPrint(NULL, 1);
  7034. }
  7035. else
  7036. {
  7037. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  7038. if(name.IsEmpty ())
  7039. m_Print.InitToPrint(NULL, 1);
  7040. else
  7041. {
  7042. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7043. if(nret==-1 && aa==0)
  7044. {
  7045. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7046. }
  7047. }
  7048. }
  7049. // 2.开始打印
  7050. m_Print.StartPrint();
  7051. m_Print.StartPage();
  7052. LoadRect load;
  7053. BOOL bSmall=0;
  7054. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7055. {
  7056. bSmall=1;
  7057. load.SetLiaPath ("20.lia");
  7058. }
  7059. else
  7060. load.SetLiaPath ("10.lia");
  7061. if(bSmall)
  7062. load.SetMargins(0,0);
  7063. else
  7064. load.SetMargins(10,0);
  7065. if(!load.Load ())return;
  7066. int rcpos=-1;
  7067. CRect StrRect=load.m_rcarray.ElementAt (++rcpos);
  7068. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7069. {
  7070. Image *pImg=NULL;
  7071. g_nSendCode=31;
  7072. int g_nYearposTemp=g_nYearpos;
  7073. g_nYearpos=-1;
  7074. g_pMainWnd->ProcessChatMessageRequest2(1);
  7075. g_nYearpos=g_nYearposTemp;
  7076. g_nSendCode=0;
  7077. if(g_bSendOK==0)return;
  7078. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7079. if(pImg)
  7080. {
  7081. StrRect.left=65;
  7082. if(bSmall) StrRect.left=55;
  7083. StrRect.top=10;
  7084. StrRect.right=StrRect.left+58;
  7085. StrRect.bottom=StrRect.top+58;
  7086. // 3.打印2维码图像;
  7087. m_Print.DrawImage(pImg, StrRect);
  7088. delete pImg;
  7089. pImg=NULL;
  7090. }
  7091. }
  7092. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7093. if(bSmall)
  7094. {
  7095. m_Print.SetFontFace(18, 1, "黑体");
  7096. StrRect=load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7097. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7098. m_Print.SetFontFace(9, 1, "宋体");
  7099. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7100. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7101. m_Print.SetFontFace(6, 1, "宋体");
  7102. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7103. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7104. m_Print.SetFontFace(9, 1, "宋体");
  7105. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7106. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7107. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7108. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7109. 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_RIGHT | FORMAT_VCENTER);
  7111. int hei=StrRect.Height ();
  7112. StrRect.bottom=StrRect.top;
  7113. StrRect.top -=8;
  7114. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7115. m_Print.SetFontFace(11, 1, "宋体");
  7116. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7117. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7118. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7119. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7120. int i=7;
  7121. m_Print.SetFontFace(8, 1, "宋体");
  7122. for(/*int*/ i=7; i<24; i++)
  7123. {
  7124. StrRect=load.m_rcarray .ElementAt (i);
  7125. m_Print.DrawRect2(StrRect, 1);
  7126. }
  7127. for( i=9; i<24; i++)
  7128. {
  7129. StrRect=load.m_rcarray .ElementAt (i);
  7130. StrRect.left +=2;
  7131. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7132. }
  7133. m_Print.SetFontFace(6, 1, "宋体");
  7134. for(i=24; i<26; i++)
  7135. {
  7136. StrRect=load.m_rcarray .ElementAt (i);
  7137. StrRect.left +=2;
  7138. if(i==24)
  7139. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7140. else
  7141. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7142. }
  7143. // StrRect=load.m_rcarray .ElementAt (27);
  7144. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7145. }
  7146. else//大单
  7147. {
  7148. // 1.打印表头(蒙娜丽莎收款单)
  7149. m_Print.SetFontFace(20, 1, "黑体");
  7150. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7151. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7152. m_Print.SetFontFace(11, 1, "宋体");
  7153. // 2.打印订单号(NO.20140608-001)
  7154. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7155. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7156. // 3.打印SerialNo(SerialNo.01062)
  7157. int hei=StrRect.Height ();
  7158. StrRect.bottom=StrRect.top;
  7159. StrRect.top -=10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7160. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7161. // 4.打印影楼地址信息、电话;
  7162. m_Print.SetFontFace(8, 1, "宋体");
  7163. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7164. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7165. #ifdef LYFZ_VERSION
  7166. m_Print.SetFontFace(9, 1, "宋体");
  7167. #else
  7168. m_Print.SetFontFace(11, 1, "宋体");
  7169. #endif
  7170. // 5.打印客户姓名
  7171. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7172. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7173. // 6.打印客户联系电话
  7174. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7175. #ifdef LYFZ_VERSION
  7176. StrRect.left +=30;
  7177. StrRect.right +=30;
  7178. #endif
  7179. //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. // 7.打印开单日期
  7182. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7183. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7184. // 8.打印列字段:收款项目
  7185. m_Print.SetFontFace(13, 1, "宋体");
  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_LEFT | FORMAT_VCENTER);
  7188. //printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7189. // 9.打印列字段:金额
  7190. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7191. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7192. //printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7193. // 10.打印列字段:开单人
  7194. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7195. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7196. //printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7197. // 11.画表格-画3列;
  7198. m_Print.SetFontFace(11, 1, "宋体");
  7199. int i;
  7200. for( i=7; i<10; i++)
  7201. {
  7202. StrRect=load.m_rcarray.ElementAt (i);
  7203. m_Print.DrawRect2(StrRect, 1);
  7204. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7205. }
  7206. // 12.打印详细内容
  7207. int dty=0;
  7208. int dtytemp=0;
  7209. // for( i=10; i<14; i+=3)
  7210. for( i=10; i<22; i+=3) // 循环4次,再画
  7211. {
  7212. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7213. CArray<CRect,CRect>rcarray;
  7214. CStringArray strarray2;
  7215. StrRect=load.m_rcarray.ElementAt(i);
  7216. StrRect.top +=dty;
  7217. StrRect.bottom +=dty;
  7218. if(StrRect.bottom > load.m_rcarray.ElementAt(22).top+5)
  7219. {
  7220. StrRect=load.m_rcarray.ElementAt(i-1);
  7221. StrRect.top +=dty;
  7222. StrRect.bottom +=dty;
  7223. dty=StrRect.bottom-load.m_rcarray.ElementAt (22).top;
  7224. break;
  7225. }
  7226. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7227. StrRect.left +=2;
  7228. StrRect.right -=2;
  7229. StrRect.top +=4;
  7230. rcarray.Add(StrRect);
  7231. strarray2.Add(pArray->ElementAt(i));
  7232. // 指定格子宽度,计算字符串占几行(高度).
  7233. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7234. dtytemp=bottom-StrRect.bottom;
  7235. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7236. // 重新获取表格大小,并画出表格;
  7237. StrRect=load.m_rcarray.ElementAt (i);
  7238. StrRect.bottom +=dtytemp;
  7239. StrRect.top +=dty;
  7240. StrRect.bottom +=dty;
  7241. m_Print.DrawRect2(StrRect, 1);
  7242. // 获取下一表格大小,并画出表格;
  7243. StrRect=load.m_rcarray.ElementAt(i+1);
  7244. StrRect.top +=dty;
  7245. StrRect.bottom +=dty;
  7246. StrRect.bottom +=dtytemp;
  7247. m_Print.DrawRect2(StrRect, 1);
  7248. StrRect.left +=2;
  7249. // 打印出金额字段内容
  7250. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i+1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7251. //printf("Jeff:%d:%s\n\n",i+1,pArray->ElementAt(i+1));//Jeff Printf;
  7252. StrRect=load.m_rcarray.ElementAt(i+2);
  7253. StrRect.top +=dty;
  7254. StrRect.bottom +=dty;
  7255. StrRect.bottom +=dtytemp;
  7256. m_Print.DrawRect2(StrRect, 1);
  7257. StrRect.left +=2;
  7258. // 打印开单人字段内容
  7259. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i+2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7260. //printf("Jeff:%d:%s\n\n",i+2,pArray->ElementAt(i+2));//Jeff Printf;
  7261. dty+=dtytemp;
  7262. }
  7263. //.打印->付款情况 应付 实付 欠款.
  7264. i=22;
  7265. StrRect=load.m_rcarray.ElementAt (i);
  7266. StrRect.top +=dty;
  7267. StrRect.bottom +=dty;
  7268. m_Print.DrawRect2(StrRect, 1);
  7269. StrRect.left +=2;
  7270. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7271. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7272. //.打印->合计人民币(大写):.......
  7273. i=23;
  7274. StrRect=load.m_rcarray .ElementAt(i);StrRect.top +=dty;StrRect.bottom +=dty;
  7275. m_Print.DrawRect2(StrRect, 1);
  7276. StrRect.left +=2;
  7277. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7278. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7279. #ifdef LYFZ_VERSION
  7280. m_Print.SetFontFace(7, 1, "宋体");
  7281. for(i=24; i<25; i++)
  7282. {
  7283. StrRect=load.m_rcarray .ElementAt (i);StrRect.top +=dty;StrRect.bottom +=dty;
  7284. StrRect.left +=2;
  7285. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7286. }
  7287. #else
  7288. m_Print.SetFontFace(7, 1, "宋体");
  7289. for(i=24; i<27; i++)
  7290. {
  7291. StrRect=load.m_rcarray .ElementAt (i);StrRect.top +=dty;StrRect.bottom +=dty;
  7292. StrRect.left +=2;
  7293. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7294. }
  7295. #endif
  7296. StrRect=load.m_rcarray .ElementAt (24);StrRect.top +=dty;StrRect.bottom +=dty;
  7297. hei=StrRect.Height ();
  7298. StrRect.top +=hei;
  7299. StrRect.bottom +=hei;
  7300. StrRect.right +=100;
  7301. StrRect.left +=2;
  7302. StrRect=load.m_rcarray .ElementAt (27);StrRect.top +=dty;StrRect.bottom +=dty;
  7303. AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7304. }
  7305. PrintPreview dlg;
  7306. dlg.m_mode=3;
  7307. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7308. dlg.m_pDC =m_Print.GetPDC() ;
  7309. if(aa==0)
  7310. {
  7311. if(dlg.DoModal ()!=IDOK)
  7312. return;
  7313. printcot=dlg.m_num;
  7314. }
  7315. //结束打印
  7316. m_Print.EndPage();
  7317. m_Print.EndPrint();
  7318. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7319. CString sql;
  7320. sql.Format("update version set [serialno]='%s'", SerialNo);
  7321. g_sendhead.bsql=1;
  7322. g_nYearposTemp=g_nYearpos;
  7323. g_nYearpos=-1;
  7324. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7325. g_nYearpos=g_nYearposTemp;
  7326. }
  7327. }
  7328. void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
  7329. {
  7330. //AfxMessageBox("abce");
  7331. int printcot=1;
  7332. for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
  7333. {
  7334. g_sendhead.bsql=0;
  7335. g_sendhead.code[0]=24;
  7336. g_sendhead.tabcount=1;
  7337. int g_nYearposTemp=g_nYearpos;
  7338. g_nYearpos=-1;
  7339. g_pMainWnd->ProcessChatMessageRequest2(1);
  7340. g_nYearpos=g_nYearposTemp;
  7341. if(0==g_bSendOK)return;
  7342. DataToArray(&g_cominfoarray);
  7343. CString SerialNo;
  7344. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7345. // 1.创建打印对象
  7346. CPrintRX m_Print;
  7347. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7348. {
  7349. m_Print.InitToPrint(NULL, 1);
  7350. }
  7351. else
  7352. {
  7353. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  7354. if(name.IsEmpty ())
  7355. m_Print.InitToPrint(NULL, 1);
  7356. else
  7357. {
  7358. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7359. if(nret==-1 && aa==0)
  7360. {
  7361. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7362. }
  7363. }
  7364. }
  7365. // 2.开始打印
  7366. m_Print.StartPrint();
  7367. m_Print.StartPage();
  7368. LoadRect load;
  7369. BOOL bSmall=0;
  7370. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  7371. {
  7372. bSmall=1;
  7373. load.SetLiaPath ("20.lia");
  7374. }
  7375. else
  7376. load.SetLiaPath ("10.lia");
  7377. if(bSmall)
  7378. load.SetMargins(0,0);
  7379. else
  7380. load.SetMargins(10,0);
  7381. if(!load.Load ())return;
  7382. int rcpos=-1;
  7383. CRect StrRect=load.m_rcarray.ElementAt (++rcpos);
  7384. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  7385. {
  7386. Image *pImg=NULL;
  7387. g_nSendCode=31;
  7388. int g_nYearposTemp=g_nYearpos;
  7389. g_nYearpos=-1;
  7390. g_pMainWnd->ProcessChatMessageRequest2(1);
  7391. g_nYearpos=g_nYearposTemp;
  7392. g_nSendCode=0;
  7393. if(g_bSendOK==0)return;
  7394. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7395. if(pImg)
  7396. {
  7397. StrRect.left=65;
  7398. if(bSmall) StrRect.left=55;
  7399. StrRect.top=10;
  7400. StrRect.right=StrRect.left+58;
  7401. StrRect.bottom=StrRect.top+58;
  7402. // 3.打印2维码图像;
  7403. m_Print.DrawImage(pImg, StrRect);
  7404. delete pImg;
  7405. pImg=NULL;
  7406. }
  7407. }
  7408. //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
  7409. if(bSmall)
  7410. {
  7411. m_Print.SetFontFace(18, 1, "黑体");
  7412. StrRect=load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7413. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7414. m_Print.SetFontFace(9, 1, "宋体");
  7415. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7416. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7417. m_Print.SetFontFace(6, 1, "宋体");
  7418. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7419. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7420. m_Print.SetFontFace(9, 1, "宋体");
  7421. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7422. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7423. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7424. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7425. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7426. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7427. int hei=StrRect.Height ();
  7428. StrRect.bottom=StrRect.top;
  7429. StrRect.top -=8;
  7430. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7431. m_Print.SetFontFace(11, 1, "宋体");
  7432. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7433. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7434. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7435. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7436. int i=7;
  7437. m_Print.SetFontFace(8, 1, "宋体");
  7438. for(/*int*/ i=7; i<24; i++)
  7439. {
  7440. StrRect=load.m_rcarray .ElementAt (i);
  7441. m_Print.DrawRect2(StrRect, 1);
  7442. }
  7443. for( i=9; i<24; i++)
  7444. {
  7445. StrRect=load.m_rcarray .ElementAt (i);
  7446. StrRect.left +=2;
  7447. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7448. }
  7449. m_Print.SetFontFace(6, 1, "宋体");
  7450. for(i=24; i<26; i++)
  7451. {
  7452. StrRect=load.m_rcarray .ElementAt (i);
  7453. StrRect.left +=2;
  7454. if(i==24)
  7455. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7456. else
  7457. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7458. }
  7459. // StrRect=load.m_rcarray .ElementAt (27);
  7460. // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
  7461. }
  7462. else//大单
  7463. {
  7464. // 1.打印表头(蒙娜丽莎收款单)
  7465. m_Print.SetFontFace(20, 1, "黑体");
  7466. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7467. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7468. m_Print.SetFontFace(11, 1, "宋体");
  7469. // 2.打印订单号(NO.20140608-001)
  7470. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7471. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7472. // 3.打印SerialNo(SerialNo.01062)
  7473. int hei=StrRect.Height ();
  7474. StrRect.bottom=StrRect.top;
  7475. StrRect.top -=10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7476. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  7477. // 4.打印影楼地址信息、电话;
  7478. m_Print.SetFontFace(8, 1, "宋体");
  7479. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7480. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7481. #ifdef LYFZ_VERSION
  7482. m_Print.SetFontFace(9, 1, "宋体");
  7483. #else
  7484. m_Print.SetFontFace(11, 1, "宋体");
  7485. #endif
  7486. // 5.打印客户姓名
  7487. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7488. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7489. // 6.打印客户联系电话
  7490. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7491. #ifdef LYFZ_VERSION
  7492. StrRect.left +=30;
  7493. StrRect.right +=30;
  7494. #endif
  7495. //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7496. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7497. // 7.打印开单日期
  7498. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7499. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  7500. #if 0 // Original Edition
  7501. // 8.打印列字段:收款项目
  7502. m_Print.SetFontFace(13, 1, "宋体");
  7503. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7504. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7505. printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7506. // 9.打印列字段:金额
  7507. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7508. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7509. printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7510. // 10.打印列字段:开单人
  7511. StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7512. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7513. printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7514. #else
  7515. // 8.打印列字段:收款项目
  7516. m_Print.SetFontFace(13, 1, "宋体");
  7517. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7518. StrRect=CRect(66,85,280,105);
  7519. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7520. //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7521. // 8.1 Jeff add:支付方式
  7522. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7523. StrRect=CRect(280,85,350,105);
  7524. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7525. //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7526. // 9.打印列字段:金额
  7527. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7528. StrRect=CRect(350,85,442,105);
  7529. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7530. //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7531. // 10.打印列字段:开单人
  7532. //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
  7533. StrRect=CRect(442,85,535,105);
  7534. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7535. //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
  7536. //rcpos += 3;
  7537. #endif
  7538. // 11.画表格-画3列;old
  7539. // 11.draw 4 column
  7540. m_Print.SetFontFace(11, 1, "宋体");
  7541. int i;
  7542. //for( i=7; i<10; i++)
  7543. //{
  7544. // StrRect=load.m_rcarray.ElementAt(i);
  7545. // m_Print.DrawRect2(StrRect, 1);
  7546. //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
  7547. //}
  7548. m_Print.DrawRect2(CRect(66,85,280,105),1);
  7549. m_Print.DrawRect2(CRect(280,85,350,105),1);
  7550. m_Print.DrawRect2(CRect(350,85,442,105),1);
  7551. m_Print.DrawRect2(CRect(442,85,535,105),1);
  7552. // 12.打印详细内容
  7553. int dty=0;
  7554. int dtytemp=0;
  7555. // for( i=10; i<14; i+=3)
  7556. //for( i=10; i<22; i+=3) // 循环4次,再画
  7557. int j = 0;
  7558. for( i=10,j=11; i<22; i+=3,j+=4) // 循环4次,再画
  7559. {
  7560. /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
  7561. CArray<CRect,CRect>rcarray;
  7562. CStringArray strarray2;
  7563. StrRect=load.m_rcarray.ElementAt(i);
  7564. StrRect.top +=dty;
  7565. StrRect.bottom +=dty;
  7566. StrRect.right -= 70; // Jeff add
  7567. //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;
  7568. /*
  7569. 4次的CRect
  7570. 66,105,350,125
  7571. 66,126,350,146
  7572. 66,147,350,167
  7573. 66,168,350,188
  7574. */
  7575. if(StrRect.bottom > load.m_rcarray.ElementAt(22).top+5)
  7576. {
  7577. StrRect=load.m_rcarray.ElementAt(i-1);
  7578. StrRect.top +=dty;
  7579. StrRect.bottom +=dty;
  7580. dty=StrRect.bottom-load.m_rcarray.ElementAt (22).top;
  7581. break;
  7582. }
  7583. // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
  7584. StrRect.left +=2;
  7585. StrRect.right -=2;
  7586. StrRect.top +=4;
  7587. rcarray.Add(StrRect);
  7588. //strarray2.Add(pArray->ElementAt(i+1));
  7589. strarray2.Add(pArray->ElementAt(j));
  7590. //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
  7591. // 指定格子宽度,计算字符串占几行(高度).
  7592. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  7593. dtytemp=bottom-StrRect.bottom;
  7594. /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
  7595. // 重新获取表格大小,并画出表格;
  7596. /*
  7597. CRect(66,85,280,105),
  7598. CRect(280,85,350,105)
  7599. CRect(350,85,442,105)
  7600. CRect(442,85,535,105)
  7601. CRect(66,105,350,125),
  7602. CRect(66,126,350,146)
  7603. CRect(66,147,350,167)
  7604. CRect(66,168,350,188)
  7605. */
  7606. // 画收款项目框及打印内容;
  7607. StrRect=load.m_rcarray.ElementAt(i);
  7608. //StrRect=CRect(66,85,280,105);
  7609. StrRect.bottom +=dtytemp;
  7610. StrRect.top +=dty;
  7611. StrRect.bottom +=dty;
  7612. //StrRect.left -= 70; // Jeff add
  7613. StrRect.right -= 70; // Jeff add
  7614. //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;
  7615. m_Print.DrawRect2(StrRect, 1);
  7616. // 画支付方式框及打印内容;
  7617. StrRect=load.m_rcarray.ElementAt(i);
  7618. //StrRect=CRect(280,85,350,105);
  7619. StrRect.bottom +=dtytemp;
  7620. StrRect.top +=dty;
  7621. StrRect.bottom +=dty;
  7622. StrRect.left += StrRect.Width()-70;
  7623. //StrRect.right += 70; // Jeff add
  7624. //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;
  7625. m_Print.DrawRect2(StrRect, 1);
  7626. StrRect.left +=2;
  7627. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7628. //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
  7629. // 画金额框及打印内容;
  7630. StrRect=load.m_rcarray.ElementAt(i+1);
  7631. //StrRect=CRect(350,85,442,105);
  7632. StrRect.top +=dty;
  7633. StrRect.bottom +=dty;
  7634. StrRect.bottom +=dtytemp;
  7635. //StrRect.right -= 70; // Jeff add
  7636. //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;
  7637. m_Print.DrawRect2(StrRect, 1);
  7638. StrRect.left +=2;
  7639. // 打印出金额字段内容
  7640. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7641. //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
  7642. // 画开单人框及打印内容;
  7643. StrRect=load.m_rcarray.ElementAt(i+2);
  7644. //StrRect=CRect(442,85,535,105);
  7645. StrRect.top +=dty;
  7646. StrRect.bottom +=dty;
  7647. StrRect.bottom +=dtytemp;
  7648. //StrRect.right -= 70; // Jeff add
  7649. //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;
  7650. m_Print.DrawRect2(StrRect, 1);
  7651. StrRect.left +=2;
  7652. // 打印开单人字段内容
  7653. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j+3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7654. //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
  7655. dty+=dtytemp;
  7656. }
  7657. //.打印->付款情况 应付 实付 欠款.
  7658. i=22;
  7659. j=27;
  7660. StrRect=load.m_rcarray.ElementAt (i);
  7661. StrRect.top +=dty;
  7662. StrRect.bottom +=dty;
  7663. m_Print.DrawRect2(StrRect, 1);
  7664. StrRect.left +=2;
  7665. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7666. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7667. //.打印->合计人民币(大写):.......
  7668. i=23;
  7669. j=28;
  7670. StrRect=load.m_rcarray.ElementAt(i);
  7671. StrRect.top +=dty;
  7672. StrRect.bottom +=dty;
  7673. m_Print.DrawRect2(StrRect, 1);
  7674. StrRect.left +=2;
  7675. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7676. //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
  7677. // 打印总金额;
  7678. #ifdef LYFZ_VERSION
  7679. m_Print.SetFontFace(7, 1, "宋体");
  7680. for(i=24; i<25; i++)
  7681. {
  7682. StrRect=load.m_rcarray.ElementAt(i);
  7683. StrRect.top +=dty;
  7684. StrRect.bottom +=dty;
  7685. StrRect.left +=2;
  7686. m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7687. }
  7688. #else
  7689. m_Print.SetFontFace(7, 1, "宋体");
  7690. for(i=24,j=29; i<27; i++,j++)
  7691. {
  7692. StrRect=load.m_rcarray.ElementAt(i);
  7693. StrRect.top +=dty;
  7694. StrRect.bottom +=dty;
  7695. StrRect.left +=2;
  7696. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7697. }
  7698. #endif
  7699. StrRect=load.m_rcarray.ElementAt (24);
  7700. StrRect.top +=dty;
  7701. StrRect.bottom +=dty;
  7702. hei=StrRect.Height ();
  7703. StrRect.top +=hei;
  7704. StrRect.bottom +=hei;
  7705. StrRect.right +=100;
  7706. StrRect.left +=2;
  7707. StrRect=load.m_rcarray .ElementAt(27);StrRect.top +=dty;StrRect.bottom +=dty;
  7708. AutoDraw(m_Print, StrRect, pArray->ElementAt(32), 1.0);
  7709. }
  7710. PrintPreview dlg;
  7711. dlg.m_mode=3;
  7712. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  7713. dlg.m_pDC =m_Print.GetPDC() ;
  7714. if(aa==0)
  7715. {
  7716. if(dlg.DoModal ()!=IDOK)
  7717. return;
  7718. printcot=dlg.m_num;
  7719. }
  7720. //结束打印
  7721. m_Print.EndPage();
  7722. m_Print.EndPrint();
  7723. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  7724. CString sql;
  7725. sql.Format("update version set [serialno]='%s'", SerialNo);
  7726. g_sendhead.bsql=1;
  7727. g_nYearposTemp=g_nYearpos;
  7728. g_nYearpos=-1;
  7729. g_pMainWnd->ProcessChatMessageRequest2(sql);
  7730. g_nYearpos=g_nYearposTemp;
  7731. }
  7732. }
  7733. void CMainFrame::PrintFlowChart(CString strOrderNumber)
  7734. {
  7735. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
  7736. {
  7737. PrintFlowChart3(strOrderNumber);return;
  7738. }
  7739. #ifdef ZHIAI_VERSION
  7740. PrintFlowChart2(strOrderNumber);
  7741. return;
  7742. #endif
  7743. int printcot=1;
  7744. for(int aa=0; aa<printcot; aa++)
  7745. {
  7746. CPrintRX m_Print;
  7747. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  7748. {
  7749. m_Print.InitToPrint(NULL, 1);
  7750. }
  7751. else
  7752. {
  7753. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  7754. if(name.IsEmpty ())
  7755. m_Print.InitToPrint(NULL, 1);
  7756. else
  7757. {
  7758. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  7759. if(nret==-1 && aa==0)
  7760. {
  7761. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  7762. }
  7763. }
  7764. }
  7765. m_Print.StartPrint();
  7766. m_Print.StartPage();
  7767. // CRect StrRect(0,0,560,818);
  7768. LoadRect load;
  7769. load.SetLiaPath ("4.lia");
  7770. load.SetMargins(-14,-14);
  7771. if(!load.Load ())return;
  7772. LoadRect load2;
  7773. load2.SetMargins(-14,472+27-14);
  7774. load2.SetLiaPath ("5.lia");
  7775. if(!load2.Load ())return;
  7776. //////////////////////////////////////////////////////////////
  7777. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2'";
  7778. g_sendhead.code[0]=54;
  7779. g_sendhead.code[1]=223;
  7780. g_sendhead.tabcount=2;
  7781. g_sendhead.bsql=0;
  7782. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  7783. CArray<CStringArray, CStringArray>sparray;
  7784. DataToArray(&g_List1array,&sparray);
  7785. CString spno;
  7786. int i = 0;
  7787. for(/*int*/ i=0; i<sparray.GetSize (); i++)
  7788. {
  7789. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  7790. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  7791. if(sparray.ElementAt (i).ElementAt (5)=="入册" && sparray.ElementAt (i).ElementAt (5)=="入底" && sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  7792. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  7793. spno+=sparray.ElementAt (i).ElementAt (5);
  7794. if(0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7795. spno+="; ";
  7796. else
  7797. {
  7798. spno+=":";
  7799. spno+=sparray.ElementAt (i).ElementAt (6);
  7800. spno+="; ";
  7801. }
  7802. }
  7803. spno+=" 加挑:";
  7804. for( i=0; i<sparray.GetSize (); i++)
  7805. {
  7806. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  7807. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  7808. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  7809. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  7810. spno+=sparray.ElementAt (i).ElementAt (5);
  7811. if(0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  7812. spno+="; ";
  7813. else
  7814. {
  7815. spno+=":";
  7816. spno+=sparray.ElementAt (i).ElementAt (6);
  7817. spno+="; ";
  7818. }
  7819. }
  7820. if(spno.Right (6)==" 加挑:")
  7821. {
  7822. spno=spno.Left (spno.GetLength ()-6);
  7823. }
  7824. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  7825. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  7826. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  7827. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  7828. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  7829. if(m_urgent.IsEmpty ())m_urgent="否";
  7830. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  7831. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  7832. // CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  7833. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  7834. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  7835. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  7836. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  7837. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  7838. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  7839. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  7840. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  7841. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17)+g_List1array.ElementAt (0).ElementAt (29);
  7842. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  7843. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  7844. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  7845. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  7846. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  7847. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  7848. CString m_sum3;
  7849. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  7850. ::ConvertToPrice (m_sum3);
  7851. if(m_money3.IsEmpty ())m_money3="0";
  7852. // m_money3=m_money3+"/"+m_sum3;
  7853. CString name;
  7854. if(!m_name1.IsEmpty ())
  7855. name=m_name1+",";
  7856. name+=m_name2;
  7857. name.TrimRight (",");
  7858. CString phone;
  7859. if(!m_phone1.IsEmpty ())
  7860. phone=m_phone1+",";
  7861. phone+=m_phone2;phone.TrimRight (",");
  7862. if(IsHasRights2new(31)==0)
  7863. phone="***";
  7864. CStringArray strarray;
  7865. strarray.Add (m_urgent);
  7866. strarray.Add (m_ren);
  7867. strarray.Add (m_waiter3);
  7868. strarray.Add (name);
  7869. strarray.Add (m_time2);
  7870. strarray.Add (m_time4);
  7871. strarray.Add (m_money3);
  7872. strarray.Add (m_sum3);
  7873. strarray.Add (m_takezs);
  7874. strarray.Add (m_taoxizs);
  7875. strarray.Add (m_choosezs);
  7876. strarray.Add (strOrderNumber);
  7877. strarray.Add (phone);
  7878. ////////////////////////////////////////////////////////////////
  7879. int rcpos=-1;
  7880. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  7881. Image *pImg=NULL;
  7882. #ifdef MNLS_VERSION
  7883. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  7884. #else
  7885. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  7886. #endif
  7887. m_Print.DrawImage(pImg, StrRect);
  7888. delete pImg;
  7889. m_Print.SetFontFace(11, 1, "宋体");
  7890. StrRect=load2.m_rcarray .ElementAt (7);
  7891. StrRect.top=load2.m_rcarray .ElementAt (15).top-15 ;
  7892. StrRect.bottom=load2.m_rcarray .ElementAt (15).bottom-15 ;
  7893. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  7894. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7895. StrRect.top+=15;
  7896. StrRect.bottom+=15;
  7897. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  7898. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7899. m_Print.SetFontFace(15, 1, "宋体");
  7900. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7901. #ifdef MNLS_VERSION
  7902. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7903. #endif
  7904. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7905. #ifdef MNLS_VERSION
  7906. m_Print.DrawRect(StrRect);
  7907. #endif
  7908. m_Print.SetFontFace(7, 1, "黑体");
  7909. m_Print.SetColor(0xffffff);
  7910. #ifdef MNLS_VERSION
  7911. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7912. #endif
  7913. m_Print.SetColor(0);
  7914. m_Print.SetFontFace(25, 1, "黑体");
  7915. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7916. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7917. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  7918. {
  7919. Image *pImg=NULL;
  7920. g_nSendCode=31;
  7921. int g_nYearposTemp=g_nYearpos;
  7922. g_nYearpos=-1;
  7923. g_pMainWnd->ProcessChatMessageRequest2(1);
  7924. g_nYearpos=g_nYearposTemp;
  7925. g_nSendCode=0;
  7926. if(g_bSendOK==0)return;
  7927. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  7928. if(pImg)
  7929. {
  7930. StrRect.left=450;
  7931. StrRect.top=22;
  7932. StrRect.right=StrRect.left+60;
  7933. StrRect.bottom=StrRect.top+60;
  7934. m_Print.DrawImage(pImg, StrRect);
  7935. delete pImg;pImg=NULL;
  7936. }
  7937. }
  7938. #ifdef CHILD_VERSION
  7939. CString title[13]={"是否加急:","接单门市:",\
  7940. "选样人员:","客人姓名:","拍照日期:","选片日期:","加挑:","余款:",\
  7941. "拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  7942. #else
  7943. CString title[13]={"是否加急:","接单门市:",\
  7944. "选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","加挑:","余款:",\
  7945. "拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  7946. #endif
  7947. m_Print.SetFontFace(12, 1, "宋体");
  7948. for( i=0; i<13; i++)
  7949. {
  7950. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7951. if(i<3)
  7952. m_Print.DrawRect2(StrRect, 0);
  7953. else
  7954. m_Print.DrawRect2(StrRect, 1);
  7955. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7956. }
  7957. for( i=18; i<=37; i++)
  7958. {
  7959. StrRect=load.m_rcarray .ElementAt (++rcpos);
  7960. if(i>=19&&i<=21)
  7961. m_Print.DrawRect2(StrRect, 2);
  7962. /* else if(i==26)
  7963. {
  7964. CRect rc=StrRect;
  7965. CRect rc2=rc;
  7966. rc.right -=rc2.Width ()/2;
  7967. m_Print.DrawRect2(rc, 1);
  7968. rc2.left +=rc.Width ();
  7969. m_Print.DrawRect2(rc2, 1);
  7970. }*/
  7971. else
  7972. m_Print.DrawRect2(StrRect, 1);
  7973. if(i==18)
  7974. {
  7975. StrRect.left +=5;
  7976. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  7977. }
  7978. }
  7979. //////////////////////////////////////
  7980. rcpos=-1;
  7981. for( i=0; i<8; i++)
  7982. {
  7983. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  7984. m_Print.DrawRect2(StrRect, 1);
  7985. }
  7986. #ifdef CHILD_VERSION
  7987. CString title2[4]={"引导师:","摄影师:","数码设计师:","顾客设计签名:"};
  7988. #else
  7989. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客设计签名:"};
  7990. #endif
  7991. for( i=0; i<4; i++)
  7992. {
  7993. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  7994. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  7995. }
  7996. for( i=0; i<4; i++)
  7997. {
  7998. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  7999. m_Print.DrawRect2(StrRect, 2);
  8000. }
  8001. StrRect=load2.m_rcarray .ElementAt (11);
  8002. StrRect.top -=15;
  8003. StrRect.bottom -=15;
  8004. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客选片签名:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8005. StrRect=load2.m_rcarray .ElementAt (15);
  8006. StrRect.top -=15;
  8007. StrRect.bottom -=15;
  8008. m_Print.DrawRect2(StrRect, 2);
  8009. ///////////////////////////////////////////
  8010. for( i=19; i<=31; i++)
  8011. {
  8012. StrRect=load.m_rcarray .ElementAt (i-1);
  8013. StrRect.left +=4;
  8014. if(i==31)
  8015. {
  8016. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  8017. {
  8018. StrRect.top +=2;
  8019. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  8020. StrRect.top +=8;
  8021. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8022. }
  8023. else
  8024. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8025. }
  8026. /* else if((i-19)==7)
  8027. {
  8028. CRect rc=StrRect;
  8029. CRect rc2=rc;
  8030. rc.right -=rc2.Width ()/2;
  8031. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8032. rc2.left +=rc.Width ()+3;
  8033. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8034. }*/
  8035. else
  8036. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8037. }
  8038. strarray.RemoveAll ();
  8039. strarray.Add (m_waiter2);
  8040. strarray.Add (m_waiter1);
  8041. strarray.Add (m_waiter4);
  8042. for( i=13; i<=15; i++)
  8043. {
  8044. StrRect=load2.m_rcarray .ElementAt (i-1);
  8045. StrRect.left +=4;
  8046. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8047. }
  8048. ///////////spno
  8049. CRect sprc[14];
  8050. for(i=0; i<14; i++)
  8051. {
  8052. if(i<7)
  8053. {
  8054. if(i==0)
  8055. {
  8056. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  8057. }
  8058. else
  8059. {
  8060. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  8061. }
  8062. }
  8063. else
  8064. {
  8065. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  8066. }
  8067. sprc[i]=StrRect;
  8068. }
  8069. CString temp,tempspno,tempbz;
  8070. CSize size;
  8071. BOOL bRun=0;
  8072. int fontsize=12;
  8073. ll: tempspno=spno;
  8074. tempbz=m_bz;
  8075. m_Print.SetFontFace(fontsize, 1, "宋体");
  8076. for( i=0; i<14; i++)
  8077. {
  8078. if(!tempspno.IsEmpty ())
  8079. {
  8080. temp=tempspno;
  8081. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8082. int right=0;
  8083. CRect temprc=sprc[i];
  8084. while(size.cx>temprc.Width ())
  8085. {
  8086. right++;
  8087. temp=tempspno.Left (tempspno.GetLength ()-(right));
  8088. if(GIsHalfHZ(temp))
  8089. {
  8090. right++;
  8091. temp.Delete (temp.GetLength ()-1);
  8092. }
  8093. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8094. }
  8095. if(bRun)
  8096. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8097. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  8098. if(tempspno.IsEmpty ())i++;
  8099. }
  8100. else if(!tempbz.IsEmpty ())
  8101. {
  8102. temp=tempbz;
  8103. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8104. int right=0;
  8105. CRect temprc=sprc[i];
  8106. while(size.cx>temprc.Width ())
  8107. {
  8108. right++;
  8109. temp=tempbz.Left (tempbz.GetLength ()-(right));
  8110. if(GIsHalfHZ(temp))
  8111. {
  8112. right++;
  8113. temp.Delete (temp.GetLength ()-1);
  8114. }
  8115. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  8116. }
  8117. if(bRun)
  8118. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8119. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  8120. }
  8121. }
  8122. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  8123. {
  8124. fontsize--;
  8125. goto ll;
  8126. }
  8127. if(bRun==0)
  8128. {
  8129. bRun=1;
  8130. goto ll;
  8131. }
  8132. PrintPreview dlg;
  8133. dlg.m_mode=2;
  8134. dlg.m_name =name;
  8135. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  8136. dlg.m_pDC =m_Print.GetPDC() ;
  8137. if(aa==0)
  8138. {
  8139. if(dlg.DoModal ()!=IDOK)
  8140. return;
  8141. printcot=dlg.m_num;
  8142. }
  8143. //结束打印
  8144. m_Print.EndPage();
  8145. m_Print.EndPrint();
  8146. }
  8147. }
  8148. void CMainFrame::PrintFlowChart3LKAY(CString strOrderNumber)
  8149. {
  8150. int printcot=1;
  8151. for(int aa=0; aa<printcot; aa++)
  8152. {
  8153. CPrintRX m_Print;
  8154. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8155. {
  8156. m_Print.InitToPrint(NULL, 1);
  8157. }
  8158. else
  8159. {
  8160. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  8161. if(name.IsEmpty ())
  8162. m_Print.InitToPrint(NULL, 1);
  8163. else
  8164. {
  8165. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8166. if(nret==-1 && aa==0)
  8167. {
  8168. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8169. }
  8170. }
  8171. }
  8172. m_Print.StartPrint();
  8173. m_Print.StartPage();
  8174. LoadRect load;
  8175. load.SetLiaPath ("18.lia");
  8176. load.SetMargins(10,0);
  8177. if(!load.Load ())return;
  8178. CString str;
  8179. int rcpos=-1;
  8180. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  8181. m_Print.SetFontFace(25, 1, "宋体");
  8182. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8183. m_Print.SetFontFace(15, 1, "宋体");
  8184. StrRect=load.m_rcarray .ElementAt (++rcpos);
  8185. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8186. m_Print.SetFontFace(9, 1, "宋体");
  8187. //////////////////////////////////////////////////////////////
  8188. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2';id='"+strOrderNumber+"'";
  8189. g_sendhead.code[0]=54;
  8190. g_sendhead.code[1]=223;
  8191. g_sendhead.code[2]=52;
  8192. g_sendhead.tabcount=3;
  8193. g_sendhead.bsql=0;
  8194. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  8195. CArray<CStringArray, CStringArray>sparray;
  8196. CArray<CStringArray, CStringArray>clientarray;
  8197. DataToArray(&g_List1array,&sparray,&clientarray);
  8198. CString spno;
  8199. CStringArray sparray2;
  8200. int i = 0;
  8201. for(/*int*/ i=0; i<sparray.GetSize (); i++)
  8202. {
  8203. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8204. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  8205. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8206. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8207. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8208. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  8209. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8210. sparray2.Add (sparray.ElementAt (i).ElementAt (9));
  8211. sparray2.Add (sparray.ElementAt (i).ElementAt (10));
  8212. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8213. }
  8214. for( i=0; i<sparray.GetSize (); i++)
  8215. {
  8216. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  8217. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  8218. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  8219. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8220. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8221. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  8222. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8223. sparray2.Add (sparray.ElementAt (i).ElementAt (9));
  8224. sparray2.Add (sparray.ElementAt (i).ElementAt (10));
  8225. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8226. }
  8227. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  8228. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  8229. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  8230. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  8231. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  8232. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  8233. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  8234. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  8235. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  8236. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  8237. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  8238. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  8239. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  8240. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  8241. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  8242. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  8243. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  8244. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  8245. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  8246. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  8247. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  8248. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  8249. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  8250. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  8251. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  8252. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  8253. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  8254. CString m_sum3;
  8255. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  8256. ::ConvertToPrice (m_sum3);
  8257. if(m_money3.IsEmpty ())m_money3="0";
  8258. int dty=0;
  8259. CString name;
  8260. if(!m_name1.IsEmpty ())
  8261. name=m_name1+",";
  8262. name+=m_name2;
  8263. name.TrimRight (",");
  8264. CString phone;
  8265. if(!m_phone1.IsEmpty ())
  8266. phone=m_phone1+",";
  8267. phone+=m_phone2;phone.TrimRight (",");
  8268. if(IsHasRights2new(31)==0)
  8269. phone="***";
  8270. CStringArray strarray;
  8271. #ifdef CHILD_VERSION
  8272. if(m_birthday.IsEmpty ())
  8273. strarray.Add ("姓名/性别");
  8274. else
  8275. strarray.Add ("姓名/性别/年龄");
  8276. #else
  8277. strarray.Add ("客人姓名");
  8278. #endif
  8279. strarray.Add ("电话");
  8280. strarray.Add ("单号");
  8281. strarray.Add ("套系");
  8282. strarray.Add ("选样");
  8283. strarray.Add ("余款/加挑");
  8284. strarray.Add ("选片/日期");
  8285. #ifdef CHILD_VERSION
  8286. if(m_birthday.IsEmpty ())
  8287. strarray.Add (name+"/"+m_sex);
  8288. else
  8289. {
  8290. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  8291. m_birthday.Format ("%d", year+1);
  8292. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  8293. }
  8294. #else
  8295. strarray.Add (name);
  8296. #endif
  8297. strarray.Add (phone);
  8298. strarray.Add (strOrderNumber);
  8299. strarray.Add (m_taoxiname);
  8300. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8301. strarray.Add (str);
  8302. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  8303. strarray.Add (str);
  8304. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  8305. for( i=3; i<=16; i++)
  8306. {
  8307. StrRect=load.m_rcarray .ElementAt (i-1);
  8308. if(i<10)
  8309. {
  8310. m_Print.DrawRect2(StrRect, 1);
  8311. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8312. }
  8313. }
  8314. StrRect=load.m_rcarray .ElementAt (29);
  8315. m_Print.DrawRect2(StrRect, 1);
  8316. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8317. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8318. {
  8319. Image *pImg=NULL;
  8320. g_nSendCode=31;
  8321. int g_nYearposTemp=g_nYearpos;
  8322. g_nYearpos=-1;
  8323. g_pMainWnd->ProcessChatMessageRequest2(1);
  8324. g_nYearpos=g_nYearposTemp;
  8325. g_nSendCode=0;
  8326. if(g_bSendOK==0)return;
  8327. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  8328. if(pImg)
  8329. {
  8330. StrRect.left=485;
  8331. StrRect.top=12;
  8332. StrRect.right=StrRect.left+60;
  8333. StrRect.bottom=StrRect.top+60;
  8334. m_Print.DrawImage(pImg, StrRect);
  8335. delete pImg;pImg=NULL;
  8336. }
  8337. }
  8338. CArray<CRect,CRect>rcarray;
  8339. CStringArray strarray2;
  8340. for( i=10; i<=16; i++)
  8341. {
  8342. StrRect=load.m_rcarray .ElementAt (i-1);
  8343. StrRect.left +=2;
  8344. StrRect.right -=2;
  8345. StrRect.top +=2;
  8346. rcarray.Add (StrRect);
  8347. strarray2.Add (strarray.ElementAt (7+i-10));
  8348. }
  8349. if(1)
  8350. {
  8351. StrRect=load.m_rcarray .ElementAt (30);
  8352. StrRect.left +=2;
  8353. StrRect.right -=2;
  8354. StrRect.top +=2;
  8355. rcarray.Add (StrRect);
  8356. strarray2.Add (m_time6+"/"+m_time5);
  8357. }
  8358. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8359. for( i=10; i<=16; i++)
  8360. {
  8361. StrRect=load.m_rcarray .ElementAt (i-1);
  8362. if(i==10)
  8363. {
  8364. dty+=bottom-StrRect.bottom;
  8365. }
  8366. StrRect.bottom =bottom;
  8367. m_Print.DrawRect2(StrRect, 1);
  8368. }
  8369. if(1)
  8370. {
  8371. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  8372. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  8373. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  8374. }
  8375. m_Print.SetFontFace(15, 1, "宋体");
  8376. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  8377. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8378. m_Print.SetFontFace(9, 1, "宋体");
  8379. strarray.RemoveAll ();
  8380. strarray.Add ("产品名称");
  8381. strarray.Add ("数量");
  8382. strarray.Add ("P数");
  8383. strarray.Add ("张数");
  8384. strarray.Add ("照片编号");
  8385. CArray<CRect,CRect>rc2array;
  8386. int wid=25;
  8387. for( i=18; i<=22; i++)
  8388. {
  8389. StrRect=load.m_rcarray .ElementAt (i-1);
  8390. if(i==19)
  8391. {
  8392. StrRect.right =StrRect.left+wid;
  8393. }
  8394. if(i==20)
  8395. {
  8396. StrRect=load.m_rcarray .ElementAt (i-2);
  8397. StrRect.left +=wid;StrRect.right=StrRect.left;
  8398. StrRect.right +=wid;
  8399. }
  8400. if(i==21)
  8401. {
  8402. StrRect=load.m_rcarray .ElementAt (i-3);
  8403. StrRect.left +=wid*2;StrRect.right=StrRect.left;
  8404. StrRect.right +=wid;
  8405. wid=StrRect.right;
  8406. }
  8407. if(i==22)
  8408. {
  8409. StrRect=load.m_rcarray .ElementAt (i-3);
  8410. StrRect.left =wid;
  8411. }
  8412. StrRect.top +=dty;StrRect.bottom +=dty;
  8413. m_Print.DrawRect2(StrRect, 1);
  8414. StrRect.left +=2;
  8415. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8416. StrRect.left -=2;
  8417. StrRect.top =StrRect.bottom ;
  8418. StrRect.bottom +=18;
  8419. rc2array.Add (StrRect);
  8420. }
  8421. int curypos=0;
  8422. for(i=0; i<sparray2.GetSize (); i+=5)
  8423. {
  8424. rcarray.RemoveAll ();
  8425. strarray2.RemoveAll ();
  8426. int j = 0;
  8427. for(/*int*/ j=0; j<5; j++)
  8428. {
  8429. StrRect=rc2array.ElementAt (j);
  8430. StrRect.left +=2;
  8431. StrRect.right -=2;
  8432. StrRect.top +=2;
  8433. rcarray.Add (StrRect);
  8434. strarray2.Add (sparray2.ElementAt (i+j));
  8435. }
  8436. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8437. rcarray.RemoveAll ();
  8438. for( j=0; j<5; j++)
  8439. {
  8440. StrRect=rc2array.ElementAt (j);
  8441. if(j==0)
  8442. {
  8443. dty+=bottom-StrRect.bottom;
  8444. }
  8445. StrRect.bottom =bottom;
  8446. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8447. StrRect.top =StrRect.bottom ;
  8448. StrRect.bottom +=18;
  8449. rcarray.Add (StrRect);
  8450. }
  8451. rc2array.RemoveAll ();
  8452. rc2array.Copy(rcarray);
  8453. }
  8454. m_Print.SetFontFace(15, 1, "宋体");
  8455. StrRect=load.m_rcarray .ElementAt (20);
  8456. dty=curypos-StrRect.bottom+35;
  8457. StrRect.top +=dty;StrRect.bottom +=dty;
  8458. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8459. m_Print.SetFontFace(9, 1, "宋体");
  8460. rcarray.RemoveAll ();
  8461. strarray2.RemoveAll ();
  8462. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8463. StrRect.left +=2;
  8464. StrRect.right -=2;
  8465. StrRect.top +=2;
  8466. rcarray.Add (StrRect);
  8467. strarray2.Add (m_bz);
  8468. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8469. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8470. dty+=bottom-StrRect.bottom;
  8471. StrRect.bottom =bottom;
  8472. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8473. m_Print.SetFontFace(10, 1, "宋体");
  8474. StrRect=load.m_rcarray .ElementAt (22);
  8475. dty=curypos-StrRect.bottom+25;
  8476. StrRect.top +=dty;StrRect.bottom +=dty;
  8477. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  8478. if(m_edit9.IsEmpty())
  8479. {
  8480. m_edit9="\
  8481. 经确认后的照片均排入制作流程,\r\n\
  8482. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8483. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8484. }
  8485. CString info1,info2,info3;
  8486. int newlinepos=m_edit9.Find("\r\n");
  8487. if(newlinepos!=-1)
  8488. {
  8489. info1=m_edit9.Left(newlinepos);
  8490. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8491. }
  8492. newlinepos=m_edit9.Find("\r\n");
  8493. if(newlinepos!=-1)
  8494. {
  8495. info2=m_edit9.Left(newlinepos);
  8496. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8497. info3=m_edit9;
  8498. }
  8499. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8500. StrRect=load.m_rcarray .ElementAt (23);
  8501. StrRect.top +=dty;StrRect.bottom +=dty;
  8502. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8503. StrRect=load.m_rcarray .ElementAt (24);
  8504. StrRect.top +=dty;StrRect.bottom +=dty;
  8505. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8506. StrRect.top +=15;
  8507. StrRect.bottom +=15;
  8508. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8509. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  8510. StrRect=load.m_rcarray .ElementAt (25);
  8511. StrRect.top +=dty-dy;
  8512. StrRect.bottom +=dty-dy;
  8513. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8514. StrRect=load.m_rcarray .ElementAt (26);
  8515. StrRect.top +=dty-dy;
  8516. StrRect.bottom +=dty-dy;
  8517. m_Print.DrawRect2(StrRect, 2);
  8518. StrRect=load.m_rcarray .ElementAt (25);
  8519. StrRect.top +=dty+15-dy;
  8520. StrRect.bottom +=dty+15-dy;
  8521. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8522. StrRect=load.m_rcarray .ElementAt (26);
  8523. StrRect.top +=dty+15-dy;
  8524. StrRect.bottom +=dty+15-dy;
  8525. m_Print.DrawRect2(StrRect, 2);
  8526. StrRect=load.m_rcarray .ElementAt (25);
  8527. StrRect.top +=dty+15*2-dy;
  8528. StrRect.bottom +=dty+15*2-dy;
  8529. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8530. StrRect=load.m_rcarray .ElementAt (26);
  8531. StrRect.top +=dty+15*2-dy;
  8532. StrRect.bottom +=dty+15*2-dy;
  8533. m_Print.DrawRect2(StrRect, 2);
  8534. PrintPreview dlg;dlg.m_mode=2;
  8535. dlg.m_name =name;
  8536. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  8537. dlg.m_pDC =m_Print.GetPDC() ;
  8538. if(aa==0)
  8539. {
  8540. if(dlg.DoModal ()!=IDOK)
  8541. return;
  8542. printcot=dlg.m_num;
  8543. }
  8544. //结束打印
  8545. m_Print.EndPage();
  8546. m_Print.EndPrint();
  8547. }
  8548. }
  8549. void CMainFrame::PrintFlowChart3(CString strOrderNumber)
  8550. {
  8551. #ifdef LKAY_VERSION
  8552. PrintFlowChart3LKAY(strOrderNumber);
  8553. return;
  8554. #endif
  8555. int printcot=1;
  8556. for(int aa=0; aa<printcot; aa++)
  8557. {
  8558. BOOL bSecondPage=0;
  8559. int nPrintedPos=0;
  8560. for(int bb=0; bb<2; bb++)
  8561. {
  8562. if(bb && bSecondPage==0)break;
  8563. CPrintRX m_Print;
  8564. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  8565. {
  8566. m_Print.InitToPrint(NULL, 1);
  8567. }
  8568. else
  8569. {
  8570. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  8571. if(name.IsEmpty ())
  8572. m_Print.InitToPrint(NULL, 1);
  8573. else
  8574. {
  8575. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  8576. if(nret==-1 && aa==0)
  8577. {
  8578. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  8579. }
  8580. }
  8581. }
  8582. m_Print.StartPrint();
  8583. m_Print.StartPage();
  8584. LoadRect load;
  8585. load.SetLiaPath ("18.lia");
  8586. load.SetMargins(10,0);
  8587. if(!load.Load ())return;
  8588. CString str;
  8589. int rcpos=-1;
  8590. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  8591. if( (bb==0 && bSecondPage==0) )
  8592. {
  8593. m_Print.SetFontFace(25, 1, "宋体");
  8594. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8595. m_Print.SetFontFace(15, 1, "宋体");
  8596. StrRect=load.m_rcarray .ElementAt (++rcpos);
  8597. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8598. m_Print.SetFontFace(9, 1, "宋体");
  8599. }
  8600. //////////////////////////////////////////////////////////////
  8601. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"' and kind<>'2';id='"+strOrderNumber+"'";
  8602. g_sendhead.code[0]=54;
  8603. g_sendhead.code[1]=223;
  8604. g_sendhead.code[2]=52;
  8605. g_sendhead.tabcount=3;
  8606. g_sendhead.bsql=0;
  8607. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  8608. CArray<CStringArray, CStringArray>sparray;
  8609. CArray<CStringArray, CStringArray>clientarray;
  8610. DataToArray(&g_List1array,&sparray,&clientarray);
  8611. CString spno;
  8612. CStringArray sparray2;
  8613. int i = 0;
  8614. for(/*int*/ i=0; i<sparray.GetSize (); i++)
  8615. {
  8616. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8617. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  8618. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  8619. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8620. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8621. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  8622. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8623. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8624. }
  8625. for( i=0; i<sparray.GetSize (); i++)
  8626. {
  8627. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  8628. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  8629. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  8630. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  8631. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  8632. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  8633. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  8634. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  8635. }
  8636. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  8637. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  8638. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  8639. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  8640. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  8641. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  8642. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  8643. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  8644. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  8645. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  8646. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  8647. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  8648. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  8649. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  8650. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  8651. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  8652. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  8653. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  8654. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  8655. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  8656. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  8657. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  8658. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  8659. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  8660. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  8661. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  8662. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  8663. CString m_sum3;
  8664. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  8665. ::ConvertToPrice (m_sum3);
  8666. if(m_money3.IsEmpty ())m_money3="0";
  8667. int dty=0;
  8668. CString name;
  8669. if(!m_name1.IsEmpty ())
  8670. name=m_name1+",";
  8671. name+=m_name2;
  8672. name.TrimRight (",");
  8673. CString phone;
  8674. if(!m_phone1.IsEmpty ())
  8675. phone=m_phone1+",";
  8676. phone+=m_phone2;phone.TrimRight (",");
  8677. if(IsHasRights2new(31)==0)
  8678. phone="***";
  8679. CStringArray strarray;
  8680. CArray<CRect,CRect>rcarray;
  8681. CStringArray strarray2; CArray<CRect,CRect>rc2array;
  8682. int bottom;
  8683. if( (bb==0 && bSecondPage==0) )
  8684. {
  8685. #ifdef CHILD_VERSION
  8686. if(m_birthday.IsEmpty ())
  8687. strarray.Add ("姓名/性别");
  8688. else
  8689. strarray.Add ("姓名/性别/年龄");
  8690. #else
  8691. strarray.Add ("客人姓名");
  8692. #endif
  8693. strarray.Add ("电话");
  8694. strarray.Add ("单号");
  8695. strarray.Add ("套系");
  8696. strarray.Add ("选样");
  8697. strarray.Add ("余款/加挑");
  8698. strarray.Add ("选片/日期");
  8699. #ifdef CHILD_VERSION
  8700. if(m_birthday.IsEmpty ())
  8701. strarray.Add (name+"/"+m_sex);
  8702. else
  8703. {
  8704. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  8705. m_birthday.Format ("%d", year+1);
  8706. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  8707. }
  8708. #else
  8709. strarray.Add (name);
  8710. #endif
  8711. strarray.Add (phone);
  8712. strarray.Add (strOrderNumber);
  8713. strarray.Add (m_taoxiname);
  8714. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  8715. strarray.Add (str);
  8716. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  8717. strarray.Add (str);
  8718. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  8719. for( i=3; i<=16; i++)
  8720. {
  8721. StrRect=load.m_rcarray .ElementAt (i-1);
  8722. if(i<10)
  8723. {
  8724. m_Print.DrawRect2(StrRect, 1);
  8725. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8726. }
  8727. }
  8728. StrRect=load.m_rcarray .ElementAt (29);
  8729. m_Print.DrawRect2(StrRect, 1);
  8730. BOOL bPrintDate=1;
  8731. #ifdef DDF_VERSION
  8732. // bPrintDate=0;
  8733. #else
  8734. if(m_time5=="" && m_time6=="")
  8735. bPrintDate=0;
  8736. #endif
  8737. if(bPrintDate)
  8738. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8739. else
  8740. {
  8741. #ifdef CHILD_VERSION
  8742. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8743. #else
  8744. m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8745. #endif
  8746. }
  8747. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  8748. {
  8749. Image *pImg=NULL;
  8750. g_nSendCode=31;
  8751. int g_nYearposTemp=g_nYearpos;
  8752. g_nYearpos=-1;
  8753. g_pMainWnd->ProcessChatMessageRequest2(1);
  8754. g_nYearpos=g_nYearposTemp;
  8755. g_nSendCode=0;
  8756. if(g_bSendOK==0)return;
  8757. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  8758. if(pImg)
  8759. {
  8760. StrRect.left=485;
  8761. StrRect.top=12;
  8762. StrRect.right=StrRect.left+60;
  8763. StrRect.bottom=StrRect.top+60;
  8764. m_Print.DrawImage(pImg, StrRect);
  8765. delete pImg;pImg=NULL;
  8766. }
  8767. }
  8768. // CArray<CRect,CRect>rcarray;
  8769. // CStringArray strarray2;
  8770. for( i=10; i<=16; i++)
  8771. {
  8772. StrRect=load.m_rcarray .ElementAt (i-1);
  8773. StrRect.left +=2;
  8774. StrRect.right -=2;
  8775. StrRect.top +=2;
  8776. rcarray.Add (StrRect);
  8777. strarray2.Add (strarray.ElementAt (7+i-10));
  8778. }
  8779. if(1)
  8780. {
  8781. StrRect=load.m_rcarray .ElementAt (30);
  8782. StrRect.left +=2;
  8783. StrRect.right -=2;
  8784. StrRect.top +=2;
  8785. rcarray.Add (StrRect);
  8786. if(bPrintDate)
  8787. strarray2.Add (m_time6+"/"+m_time5);
  8788. else
  8789. {
  8790. strarray2.Add (m_waiter1+"/"+m_waiter2);
  8791. }
  8792. }
  8793. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  8794. for( i=10; i<=16; i++)
  8795. {
  8796. StrRect=load.m_rcarray.ElementAt (i-1);
  8797. if(i==10)
  8798. {
  8799. dty+=bottom-StrRect.bottom;
  8800. }
  8801. StrRect.bottom =bottom;
  8802. m_Print.DrawRect2(StrRect, 1);
  8803. }
  8804. if(1)
  8805. {
  8806. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  8807. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  8808. }
  8809. m_Print.SetFontFace(15, 1, "宋体");
  8810. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  8811. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8812. }
  8813. int curypos=0;
  8814. int oldpos=0;
  8815. if(bb==1)
  8816. {
  8817. dty=-100;
  8818. oldpos=nPrintedPos;
  8819. if(oldpos==0)oldpos=10000;
  8820. }
  8821. m_Print.SetFontFace(9, 1, "宋体");
  8822. strarray.RemoveAll ();
  8823. if((oldpos!=10000&&oldpos<sparray2.GetSize ()) || bb==0)
  8824. {
  8825. strarray.Add ("产品名称");
  8826. strarray.Add ("数量");
  8827. strarray.Add ("照片编号");
  8828. for( i=18; i<=20; i++)
  8829. {
  8830. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  8831. m_Print.DrawRect2(StrRect, 1);
  8832. StrRect.left +=2;
  8833. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8834. StrRect.left -=2;
  8835. StrRect.top =StrRect.bottom ;
  8836. StrRect.bottom +=18;
  8837. rc2array.Add (StrRect);
  8838. }
  8839. }
  8840. for(i=oldpos; i<sparray2.GetSize (); i+=3)
  8841. {
  8842. rcarray.RemoveAll ();
  8843. strarray2.RemoveAll ();
  8844. int j = 0;
  8845. for(/*int*/ j=0; j<3; j++)
  8846. {
  8847. StrRect=rc2array.ElementAt (j);
  8848. StrRect.left +=2;
  8849. StrRect.right -=2;
  8850. StrRect.top +=2;
  8851. rcarray.Add (StrRect);
  8852. strarray2.Add (sparray2.ElementAt (i+j));
  8853. }
  8854. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8855. rcarray.RemoveAll ();
  8856. for( j=0; j<3; j++)
  8857. {
  8858. StrRect=rc2array.ElementAt (j);
  8859. if(j==0)
  8860. {
  8861. dty+=bottom-StrRect.bottom;
  8862. }
  8863. StrRect.bottom =bottom;
  8864. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8865. StrRect.top =StrRect.bottom ;
  8866. StrRect.bottom +=18;
  8867. rcarray.Add (StrRect);
  8868. }
  8869. rc2array.RemoveAll ();
  8870. rc2array.Copy(rcarray);
  8871. if(bottom>750)
  8872. {
  8873. bSecondPage=1;
  8874. nPrintedPos=i+3;
  8875. break;
  8876. }
  8877. }
  8878. if( (bb==0 && bSecondPage==0) || (bb==1 && bSecondPage==1) )
  8879. {
  8880. m_Print.SetFontFace(15, 1, "宋体");
  8881. StrRect=load.m_rcarray .ElementAt (20);
  8882. dty=curypos-StrRect.bottom+35;
  8883. StrRect.top +=dty;StrRect.bottom +=dty;
  8884. if(StrRect.bottom>700 && bb==0)
  8885. {
  8886. bSecondPage=1;
  8887. }
  8888. else
  8889. {
  8890. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  8891. m_Print.SetFontFace(9, 1, "宋体");
  8892. rcarray.RemoveAll ();
  8893. strarray2.RemoveAll ();
  8894. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8895. StrRect.left +=2;
  8896. StrRect.right -=2;
  8897. StrRect.top +=2;
  8898. rcarray.Add (StrRect);
  8899. strarray2.Add (m_bz);
  8900. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  8901. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  8902. dty+=bottom-StrRect.bottom;
  8903. StrRect.bottom =bottom;
  8904. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  8905. m_Print.SetFontFace(10, 1, "宋体");
  8906. StrRect=load.m_rcarray .ElementAt (22);
  8907. dty=curypos-StrRect.bottom+25;
  8908. StrRect.top +=dty;StrRect.bottom +=dty;
  8909. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  8910. if(m_edit9.IsEmpty())
  8911. {
  8912. m_edit9="\
  8913. 经确认后的照片均排入制作流程,\r\n\
  8914. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  8915. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  8916. }
  8917. CString info1,info2,info3;
  8918. int newlinepos=m_edit9.Find("\r\n");
  8919. if(newlinepos!=-1)
  8920. {
  8921. info1=m_edit9.Left(newlinepos);
  8922. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8923. }
  8924. newlinepos=m_edit9.Find("\r\n");
  8925. if(newlinepos!=-1)
  8926. {
  8927. info2=m_edit9.Left(newlinepos);
  8928. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  8929. info3=m_edit9;
  8930. }
  8931. #ifdef QCH_VERSION
  8932. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8933. StrRect=load.m_rcarray .ElementAt (23);
  8934. StrRect.top +=dty;StrRect.bottom +=dty;
  8935. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8936. StrRect=load.m_rcarray .ElementAt (24);
  8937. StrRect.top +=dty;StrRect.bottom +=dty;
  8938. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8939. StrRect.top +=15;
  8940. StrRect.bottom +=15;
  8941. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8942. #else
  8943. if(1)
  8944. {
  8945. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8946. StrRect=load.m_rcarray .ElementAt (23);
  8947. StrRect.top +=dty;StrRect.bottom +=dty;
  8948. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8949. StrRect=load.m_rcarray .ElementAt (24);
  8950. StrRect.top +=dty;StrRect.bottom +=dty;
  8951. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8952. }
  8953. else
  8954. {
  8955. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8956. StrRect=load.m_rcarray .ElementAt (23);
  8957. StrRect.top +=dty;StrRect.bottom +=dty;
  8958. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8959. StrRect=load.m_rcarray .ElementAt (24);
  8960. StrRect.top +=dty;StrRect.bottom +=dty;
  8961. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8962. }
  8963. StrRect.top +=15;
  8964. StrRect.bottom +=15;
  8965. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  8966. #endif
  8967. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  8968. StrRect=load.m_rcarray .ElementAt (25);
  8969. StrRect.top +=dty-dy;
  8970. StrRect.bottom +=dty-dy;
  8971. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8972. StrRect=load.m_rcarray .ElementAt (26);
  8973. StrRect.top +=dty-dy;
  8974. StrRect.bottom +=dty-dy;
  8975. m_Print.DrawRect2(StrRect, 2);
  8976. StrRect=load.m_rcarray .ElementAt (25);
  8977. StrRect.top +=dty+15-dy;
  8978. StrRect.bottom +=dty+15-dy;
  8979. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8980. StrRect=load.m_rcarray .ElementAt (26);
  8981. StrRect.top +=dty+15-dy;
  8982. StrRect.bottom +=dty+15-dy;
  8983. m_Print.DrawRect2(StrRect, 2);
  8984. StrRect=load.m_rcarray .ElementAt (25);
  8985. StrRect.top +=dty+15*2-dy;
  8986. StrRect.bottom +=dty+15*2-dy;
  8987. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  8988. StrRect=load.m_rcarray .ElementAt (26);
  8989. StrRect.top +=dty+15*2-dy;
  8990. StrRect.bottom +=dty+15*2-dy;
  8991. m_Print.DrawRect2(StrRect, 2);
  8992. }
  8993. }
  8994. PrintPreview dlg;dlg.m_mode=2;
  8995. dlg.m_name =name;
  8996. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  8997. dlg.m_pDC =m_Print.GetPDC() ;
  8998. if(aa==0)
  8999. {
  9000. if(dlg.DoModal ()!=IDOK)
  9001. return;
  9002. printcot=dlg.m_num;
  9003. }
  9004. //结束打印
  9005. m_Print.EndPage();
  9006. m_Print.EndPrint();
  9007. }
  9008. }
  9009. }
  9010. /*
  9011. void CMainFrame::PrintFlowChart3(CString m_id)
  9012. {
  9013. #ifdef LKAY_VERSION
  9014. PrintFlowChart3LKAY(m_id);
  9015. return;
  9016. #endif
  9017. int printcot=1;
  9018. for(int aa=0; aa<printcot; aa++)
  9019. {
  9020. CPrintRX m_Print;
  9021. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9022. {
  9023. m_Print.InitToPrint(NULL, 1);
  9024. }
  9025. else
  9026. {
  9027. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  9028. if(name.IsEmpty ())
  9029. m_Print.InitToPrint(NULL, 1);
  9030. else
  9031. {
  9032. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9033. if(nret==-1 && aa==0)
  9034. {
  9035. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9036. }
  9037. }
  9038. }
  9039. m_Print.StartPrint();
  9040. m_Print.StartPage();
  9041. LoadRect load;
  9042. load.SetLiaPath ("18.lia");
  9043. load.SetMargins(10,0);
  9044. if(!load.Load ())return;
  9045. CString str;
  9046. int rcpos=-1;
  9047. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9048. m_Print.SetFontFace(25, 1, "宋体");
  9049. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9050. m_Print.SetFontFace(15, 1, "宋体");
  9051. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9052. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9053. m_Print.SetFontFace(9, 1, "宋体");
  9054. //////////////////////////////////////////////////////////////
  9055. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9056. g_sendhead.code[0]=54;
  9057. g_sendhead.code[1]=50;
  9058. g_sendhead.code[2]=52;
  9059. g_sendhead.tabcount=3;
  9060. g_sendhead.bsql=0;
  9061. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9062. CArray<CStringArray, CStringArray>sparray;
  9063. CArray<CStringArray, CStringArray>clientarray;
  9064. DataToArray(&g_List1array,&sparray,&clientarray);
  9065. CString spno;
  9066. CStringArray sparray2;
  9067. for(int i=0; i<sparray.GetSize (); i++)
  9068. {
  9069. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9070. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9071. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9072. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9073. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9074. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9075. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9076. }
  9077. for( i=0; i<sparray.GetSize (); i++)
  9078. {
  9079. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9080. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9081. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9082. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9083. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9084. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9085. sparray2.Add (sparray.ElementAt (i).ElementAt (6));
  9086. }
  9087. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9088. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9089. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9090. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9091. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9092. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9093. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9094. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9095. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9096. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9097. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9098. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9099. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9100. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9101. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9102. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9103. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9104. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9105. CString m_bz =g_List1array.ElementAt (0).ElementAt (17)+" "+g_List1array.ElementAt (0).ElementAt (29);
  9106. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (23);
  9107. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9108. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9109. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9110. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9111. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9112. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9113. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9114. CString m_sum3;
  9115. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9116. ::ConvertToPrice (m_sum3);
  9117. if(m_money3.IsEmpty ())m_money3="0";
  9118. int dty=0;
  9119. CString name;
  9120. if(!m_name1.IsEmpty ())
  9121. name=m_name1+",";
  9122. name+=m_name2;
  9123. name.TrimRight (",");
  9124. CString phone;
  9125. if(!m_phone1.IsEmpty ())
  9126. phone=m_phone1+",";
  9127. phone+=m_phone2;phone.TrimRight (",");
  9128. if(IsHasRights2new(31)==0)
  9129. phone="***";
  9130. CStringArray strarray;
  9131. #ifdef CHILD_VERSION
  9132. if(m_birthday.IsEmpty ())
  9133. strarray.Add ("姓名/性别");
  9134. else
  9135. strarray.Add ("姓名/性别/年龄");
  9136. #else
  9137. strarray.Add ("客人姓名");
  9138. #endif
  9139. strarray.Add ("电话");
  9140. strarray.Add ("单号");
  9141. strarray.Add ("套系");
  9142. strarray.Add ("选样");
  9143. strarray.Add ("余款/加挑");
  9144. strarray.Add ("选片/日期");
  9145. #ifdef CHILD_VERSION
  9146. if(m_birthday.IsEmpty ())
  9147. strarray.Add (name+"/"+m_sex);
  9148. else
  9149. {
  9150. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9151. m_birthday.Format ("%d", year+1);
  9152. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9153. }
  9154. #else
  9155. strarray.Add (name);
  9156. #endif
  9157. strarray.Add (phone);
  9158. strarray.Add (m_id);
  9159. strarray.Add (m_taoxiname);
  9160. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9161. strarray.Add (str);
  9162. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9163. strarray.Add (str);
  9164. strarray.Add (m_waiter3+"/"+m_time4);//m_time5
  9165. for( i=3; i<=16; i++)
  9166. {
  9167. StrRect=load.m_rcarray .ElementAt (i-1);
  9168. if(i<10)
  9169. {
  9170. m_Print.DrawRect2(StrRect, 1);
  9171. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9172. }
  9173. }
  9174. StrRect=load.m_rcarray .ElementAt (29);
  9175. m_Print.DrawRect2(StrRect, 1);
  9176. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9177. CArray<CRect,CRect>rcarray;
  9178. CStringArray strarray2;
  9179. for( i=10; i<=16; i++)
  9180. {
  9181. StrRect=load.m_rcarray .ElementAt (i-1);
  9182. StrRect.left +=2;
  9183. StrRect.right -=2;
  9184. StrRect.top +=2;
  9185. rcarray.Add (StrRect);
  9186. strarray2.Add (strarray.ElementAt (7+i-10));
  9187. }
  9188. if(1)
  9189. {
  9190. StrRect=load.m_rcarray .ElementAt (30);
  9191. StrRect.left +=2;
  9192. StrRect.right -=2;
  9193. StrRect.top +=2;
  9194. rcarray.Add (StrRect);
  9195. strarray2.Add (m_time6+"/"+m_time5);
  9196. }
  9197. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9198. for( i=10; i<=16; i++)
  9199. {
  9200. StrRect=load.m_rcarray .ElementAt (i-1);
  9201. if(i==10)
  9202. {
  9203. dty+=bottom-StrRect.bottom;
  9204. }
  9205. StrRect.bottom =bottom;
  9206. m_Print.DrawRect2(StrRect, 1);
  9207. }
  9208. if(1)
  9209. {
  9210. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9211. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9212. // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
  9213. }
  9214. m_Print.SetFontFace(15, 1, "宋体");
  9215. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9216. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9217. m_Print.SetFontFace(9, 1, "宋体");
  9218. strarray.RemoveAll ();
  9219. strarray.Add ("产品名称");
  9220. strarray.Add ("数量");
  9221. strarray.Add ("照片编号");
  9222. CArray<CRect,CRect>rc2array;
  9223. for( i=18; i<=20; i++)
  9224. {
  9225. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9226. m_Print.DrawRect2(StrRect, 1);
  9227. StrRect.left +=2;
  9228. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9229. StrRect.left -=2;
  9230. StrRect.top =StrRect.bottom ;
  9231. StrRect.bottom +=18;
  9232. rc2array.Add (StrRect);
  9233. }
  9234. int curypos=0;
  9235. for(i=0; i<sparray2.GetSize (); i+=3)
  9236. {
  9237. rcarray.RemoveAll ();
  9238. strarray2.RemoveAll ();
  9239. for(int j=0; j<3; j++)
  9240. {
  9241. StrRect=rc2array.ElementAt (j);
  9242. StrRect.left +=2;
  9243. StrRect.right -=2;
  9244. StrRect.top +=2;
  9245. rcarray.Add (StrRect);
  9246. strarray2.Add (sparray2.ElementAt (i+j));
  9247. }
  9248. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9249. rcarray.RemoveAll ();
  9250. for( j=0; j<3; j++)
  9251. {
  9252. StrRect=rc2array.ElementAt (j);
  9253. if(j==0)
  9254. {
  9255. dty+=bottom-StrRect.bottom;
  9256. }
  9257. StrRect.bottom =bottom;
  9258. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9259. StrRect.top =StrRect.bottom ;
  9260. StrRect.bottom +=18;
  9261. rcarray.Add (StrRect);
  9262. }
  9263. rc2array.RemoveAll ();
  9264. rc2array.Copy(rcarray);
  9265. }
  9266. m_Print.SetFontFace(15, 1, "宋体");
  9267. StrRect=load.m_rcarray .ElementAt (20);
  9268. dty=curypos-StrRect.bottom+35;
  9269. StrRect.top +=dty;StrRect.bottom +=dty;
  9270. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9271. m_Print.SetFontFace(9, 1, "宋体");
  9272. rcarray.RemoveAll ();
  9273. strarray2.RemoveAll ();
  9274. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9275. StrRect.left +=2;
  9276. StrRect.right -=2;
  9277. StrRect.top +=2;
  9278. rcarray.Add (StrRect);
  9279. strarray2.Add (m_bz);
  9280. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9281. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9282. dty+=bottom-StrRect.bottom;
  9283. StrRect.bottom =bottom;
  9284. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9285. m_Print.SetFontFace(10, 1, "宋体");
  9286. StrRect=load.m_rcarray .ElementAt (22);
  9287. dty=curypos-StrRect.bottom+25;
  9288. StrRect.top +=dty;StrRect.bottom +=dty;
  9289. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9290. if(m_edit9.IsEmpty())
  9291. {
  9292. m_edit9="\
  9293. 经确认后的照片均排入制作流程,\r\n\
  9294. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9295. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9296. }
  9297. CString info1,info2,info3;
  9298. int newlinepos=m_edit9.Find("\r\n");
  9299. if(newlinepos!=-1)
  9300. {
  9301. info1=m_edit9.Left(newlinepos);
  9302. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9303. }
  9304. newlinepos=m_edit9.Find("\r\n");
  9305. if(newlinepos!=-1)
  9306. {
  9307. info2=m_edit9.Left(newlinepos);
  9308. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9309. info3=m_edit9;
  9310. }
  9311. #ifdef QCH_VERSION
  9312. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9313. StrRect=load.m_rcarray .ElementAt (23);
  9314. StrRect.top +=dty;StrRect.bottom +=dty;
  9315. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9316. StrRect=load.m_rcarray .ElementAt (24);
  9317. StrRect.top +=dty;StrRect.bottom +=dty;
  9318. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9319. StrRect.top +=15;
  9320. StrRect.bottom +=15;
  9321. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9322. #else
  9323. if(1)
  9324. {
  9325. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9326. StrRect=load.m_rcarray .ElementAt (23);
  9327. StrRect.top +=dty;StrRect.bottom +=dty;
  9328. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9329. StrRect=load.m_rcarray .ElementAt (24);
  9330. StrRect.top +=dty;StrRect.bottom +=dty;
  9331. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9332. }
  9333. else
  9334. {
  9335. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9336. StrRect=load.m_rcarray .ElementAt (23);
  9337. StrRect.top +=dty;StrRect.bottom +=dty;
  9338. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9339. StrRect=load.m_rcarray .ElementAt (24);
  9340. StrRect.top +=dty;StrRect.bottom +=dty;
  9341. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9342. }
  9343. StrRect.top +=15;
  9344. StrRect.bottom +=15;
  9345. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)+" 电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9346. #endif
  9347. int dy=load.m_rcarray .ElementAt (25).top-load.m_rcarray .ElementAt (27).top;
  9348. StrRect=load.m_rcarray .ElementAt (25);
  9349. StrRect.top +=dty-dy;
  9350. StrRect.bottom +=dty-dy;
  9351. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9352. StrRect=load.m_rcarray .ElementAt (26);
  9353. StrRect.top +=dty-dy;
  9354. StrRect.bottom +=dty-dy;
  9355. m_Print.DrawRect2(StrRect, 2);
  9356. StrRect=load.m_rcarray .ElementAt (25);
  9357. StrRect.top +=dty+15-dy;
  9358. StrRect.bottom +=dty+15-dy;
  9359. m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9360. StrRect=load.m_rcarray .ElementAt (26);
  9361. StrRect.top +=dty+15-dy;
  9362. StrRect.bottom +=dty+15-dy;
  9363. m_Print.DrawRect2(StrRect, 2);
  9364. StrRect=load.m_rcarray .ElementAt (25);
  9365. StrRect.top +=dty+15*2-dy;
  9366. StrRect.bottom +=dty+15*2-dy;
  9367. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9368. StrRect=load.m_rcarray .ElementAt (26);
  9369. StrRect.top +=dty+15*2-dy;
  9370. StrRect.bottom +=dty+15*2-dy;
  9371. m_Print.DrawRect2(StrRect, 2);
  9372. PrintPreview dlg;dlg.m_mode=2;
  9373. dlg.m_name =name;
  9374. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9375. dlg.m_pDC =m_Print.GetPDC() ;
  9376. if(aa==0)
  9377. {
  9378. if(dlg.DoModal ()!=IDOK)
  9379. return;
  9380. printcot=dlg.m_num;
  9381. }
  9382. //结束打印
  9383. m_Print.EndPage();
  9384. m_Print.EndPrint();
  9385. }
  9386. }
  9387. */
  9388. void CMainFrame::PrintFlowChart4(CString m_id)
  9389. {
  9390. int printcot=1;
  9391. for(int aa=0; aa<printcot; aa++)
  9392. {
  9393. CPrintRX m_Print;
  9394. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  9395. {
  9396. m_Print.InitToPrint(NULL, 1);
  9397. }
  9398. else
  9399. {
  9400. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  9401. if(name.IsEmpty ())
  9402. m_Print.InitToPrint(NULL, 1);
  9403. else
  9404. {
  9405. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  9406. if(nret==-1 && aa==0)
  9407. {
  9408. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  9409. }
  9410. }
  9411. }
  9412. m_Print.StartPrint();
  9413. m_Print.StartPage();
  9414. LoadRect load;
  9415. load.SetLiaPath ("18.lia");
  9416. load.SetMargins(10,0);
  9417. if(!load.Load ())return;
  9418. CString str;
  9419. int rcpos=-1;
  9420. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9421. m_Print.SetFontFace(25, 1, "宋体");
  9422. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9423. m_Print.SetFontFace(15, 1, "宋体");
  9424. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9425. m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9426. m_Print.SetFontFace(9, 1, "宋体");
  9427. //////////////////////////////////////////////////////////////
  9428. CString filter="id='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
  9429. g_sendhead.code[0]=54;
  9430. g_sendhead.code[1]=223;
  9431. g_sendhead.code[2]=52;
  9432. g_sendhead.tabcount=3;
  9433. g_sendhead.bsql=0;
  9434. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9435. CArray<CStringArray, CStringArray>sparray;
  9436. CArray<CStringArray, CStringArray>clientarray;
  9437. DataToArray(&g_List1array,&sparray,&clientarray);
  9438. CString spno;
  9439. CStringArray sparray2;
  9440. int i = 0;
  9441. for(/*int*/ i=0; i<sparray.GetSize (); i++)
  9442. {
  9443. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  9444. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (8).IsEmpty ())continue;
  9445. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9446. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  9447. sparray2.Add (sparray.ElementAt (i).ElementAt (5));
  9448. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9449. sparray2.Add (sparray.ElementAt (i).ElementAt (8));
  9450. }
  9451. for( i=0; i<sparray.GetSize (); i++)
  9452. {
  9453. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9454. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9455. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  9456. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  9457. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  9458. sparray2.Add (sparray.ElementAt (i).ElementAt (5)+"+");
  9459. sparray2.Add (sparray.ElementAt (i).ElementAt (3));
  9460. sparray2.Add (sparray.ElementAt (i).ElementAt (8));
  9461. }
  9462. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  9463. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  9464. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9465. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9466. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9467. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9468. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9469. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9470. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9471. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9472. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9473. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9474. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9475. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9476. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9477. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9478. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9479. CString m_bz =g_List1array.ElementAt (0).ElementAt (17);
  9480. m_bz+=";"+g_List1array.ElementAt (0).ElementAt (25);
  9481. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9482. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9483. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9484. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9485. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9486. CString m_taoxiname = g_List1array.ElementAt (0).ElementAt (24);
  9487. CString m_time6 = g_List1array.ElementAt (0).ElementAt (26);
  9488. CString m_waiter8 = g_List1array.ElementAt (0).ElementAt (27);
  9489. CString m_replace=g_List1array.ElementAt (0).ElementAt (28);
  9490. if(!m_replace.IsEmpty ())
  9491. {
  9492. m_replace="设计替换照片:"+m_replace;
  9493. m_replace.Replace ("$", ";");
  9494. m_replace.TrimLeft (";");
  9495. m_bz+=";";
  9496. m_bz+=m_replace;
  9497. }
  9498. CString m_sum3;
  9499. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9500. ::ConvertToPrice (m_sum3);
  9501. if(m_money3.IsEmpty ())m_money3="0";
  9502. int dty=0;
  9503. CString name;
  9504. if(!m_name1.IsEmpty ())
  9505. name=m_name1+",";
  9506. name+=m_name2;
  9507. name.TrimRight (",");
  9508. CString phone;
  9509. if(!m_phone1.IsEmpty ())
  9510. phone=m_phone1+",";
  9511. phone+=m_phone2;phone.TrimRight (",");
  9512. if(IsHasRights2new(31)==0)
  9513. phone="***";
  9514. CStringArray strarray;
  9515. #ifdef CHILD_VERSION
  9516. if(m_birthday.IsEmpty ())
  9517. strarray.Add ("姓名/性别");
  9518. else
  9519. strarray.Add ("姓名/性别/年龄");
  9520. #else
  9521. strarray.Add ("客人姓名");
  9522. #endif
  9523. strarray.Add ("电话");
  9524. strarray.Add ("单号");
  9525. strarray.Add ("套系");
  9526. strarray.Add ("");
  9527. strarray.Add ("余款/加挑");
  9528. strarray.Add ("看设计/日期");
  9529. #ifdef CHILD_VERSION
  9530. if(m_birthday.IsEmpty ())
  9531. strarray.Add (name+"/"+m_sex);
  9532. else
  9533. {
  9534. int year=atoi(g_date.Left (4))-atoi(m_birthday.Left (4));
  9535. m_birthday.Format ("%d", year+1);
  9536. strarray.Add (name+"/"+m_sex+"/"+m_birthday);
  9537. }
  9538. #else
  9539. strarray.Add (name);
  9540. #endif
  9541. strarray.Add (phone);
  9542. strarray.Add (m_id);
  9543. strarray.Add (m_taoxiname);
  9544. str.Format ("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
  9545. strarray.Add ("");
  9546. str.Format ("%d/%d", atoi(m_sum3),atoi(m_money3));
  9547. strarray.Add (str);
  9548. strarray.Add (m_waiter8+"/"+m_time6);
  9549. //////////////////////////////////////////////
  9550. if(1)
  9551. {
  9552. StrRect=load.m_rcarray .ElementAt (6);
  9553. int addwid=StrRect.Width ()/6;
  9554. for( i=3; i<=6; i++)
  9555. {
  9556. StrRect=load.m_rcarray .ElementAt (i-1);
  9557. StrRect.left +=(i-3)*addwid;
  9558. StrRect.right +=(i-2)*addwid;
  9559. load.m_rcarray.SetAt (i-1, StrRect);
  9560. }
  9561. StrRect.left =StrRect.right =-1;
  9562. load.m_rcarray.SetAt (6, StrRect);
  9563. for( i=10; i<=13; i++)
  9564. {
  9565. StrRect=load.m_rcarray .ElementAt (i-1);
  9566. StrRect.left +=(i-10)*addwid;
  9567. StrRect.right +=(i-9)*addwid;
  9568. load.m_rcarray.SetAt (i-1, StrRect);
  9569. }
  9570. StrRect.left =StrRect.right =-1;
  9571. load.m_rcarray.SetAt (13, StrRect);
  9572. StrRect=load.m_rcarray .ElementAt (7);
  9573. int rcwid=StrRect.Width ();
  9574. StrRect.left =load.m_rcarray .ElementAt (5).right ;
  9575. StrRect.right =StrRect.left +rcwid+addwid;
  9576. load.m_rcarray.SetAt (7, StrRect);
  9577. StrRect=load.m_rcarray .ElementAt (8);
  9578. StrRect.left =load.m_rcarray .ElementAt (7).right ;
  9579. StrRect.right =load.m_rcarray .ElementAt (29).left ;
  9580. load.m_rcarray.SetAt (8, StrRect);
  9581. StrRect=load.m_rcarray .ElementAt (14);
  9582. rcwid=StrRect.Width ();
  9583. StrRect.left =load.m_rcarray .ElementAt (12).right ;
  9584. StrRect.right =StrRect.left +rcwid+addwid;
  9585. load.m_rcarray.SetAt (14, StrRect);
  9586. StrRect=load.m_rcarray .ElementAt (15);
  9587. StrRect.left =load.m_rcarray .ElementAt (14).right ;
  9588. StrRect.right =load.m_rcarray .ElementAt (29).left ;
  9589. load.m_rcarray.SetAt (15, StrRect);
  9590. }
  9591. ////////////////////////////////////////////////
  9592. for( i=3; i<=16; i++)
  9593. {
  9594. StrRect=load.m_rcarray .ElementAt (i-1);
  9595. if(i<10)
  9596. {
  9597. m_Print.DrawRect2(StrRect, 1);
  9598. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9599. }
  9600. }
  9601. StrRect=load.m_rcarray .ElementAt (29);
  9602. m_Print.DrawRect2(StrRect, 1);
  9603. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9604. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
  9605. {
  9606. Image *pImg=NULL;
  9607. g_nSendCode=31;
  9608. int g_nYearposTemp=g_nYearpos;
  9609. g_nYearpos=-1;
  9610. g_pMainWnd->ProcessChatMessageRequest2(1);
  9611. g_nYearpos=g_nYearposTemp;
  9612. g_nSendCode=0;
  9613. if(g_bSendOK==0)return;
  9614. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  9615. if(pImg)
  9616. {
  9617. StrRect.left=485;
  9618. StrRect.top=12;
  9619. StrRect.right=StrRect.left+60;
  9620. StrRect.bottom=StrRect.top+60;
  9621. m_Print.DrawImage(pImg, StrRect);
  9622. delete pImg;pImg=NULL;
  9623. }
  9624. }
  9625. CArray<CRect,CRect>rcarray;
  9626. CStringArray strarray2;
  9627. for( i=10; i<=16; i++)
  9628. {
  9629. StrRect=load.m_rcarray .ElementAt (i-1);
  9630. StrRect.left +=2;
  9631. StrRect.right -=2;
  9632. StrRect.top +=2;
  9633. rcarray.Add (StrRect);
  9634. strarray2.Add (strarray.ElementAt (7+i-10));
  9635. }
  9636. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_HCENTER);
  9637. for( i=10; i<=16; i++)
  9638. {
  9639. StrRect=load.m_rcarray .ElementAt (i-1);
  9640. if(i==10)
  9641. {
  9642. dty+=bottom-StrRect.bottom;
  9643. }
  9644. StrRect.bottom =bottom;
  9645. m_Print.DrawRect2(StrRect, 1);
  9646. }
  9647. StrRect=load.m_rcarray .ElementAt (30);StrRect.bottom =bottom;
  9648. m_Print.DrawRect2(StrRect, 1);StrRect.top +=2;
  9649. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP );
  9650. m_Print.SetFontFace(15, 1, "宋体");
  9651. StrRect=load.m_rcarray .ElementAt (16);StrRect.top +=dty;StrRect.bottom +=dty;
  9652. m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9653. m_Print.SetFontFace(9, 1, "宋体");
  9654. strarray.RemoveAll ();
  9655. strarray.Add ("产品名称");
  9656. strarray.Add ("数量");
  9657. strarray.Add ("照片编号");
  9658. CArray<CRect,CRect>rc2array;
  9659. for( i=18; i<=20; i++)
  9660. {
  9661. StrRect=load.m_rcarray .ElementAt (i-1);StrRect.top +=dty;StrRect.bottom +=dty;
  9662. m_Print.DrawRect2(StrRect, 1);
  9663. StrRect.left +=2;
  9664. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9665. StrRect.left -=2;
  9666. StrRect.top =StrRect.bottom ;
  9667. StrRect.bottom +=18;
  9668. rc2array.Add (StrRect);
  9669. }
  9670. int curypos=0;
  9671. for(i=0; i<sparray2.GetSize (); i+=3)
  9672. {
  9673. rcarray.RemoveAll ();
  9674. strarray2.RemoveAll ();
  9675. int j = 0;
  9676. for(/*int*/ j=0; j<3; j++)
  9677. {
  9678. StrRect=rc2array.ElementAt (j);
  9679. StrRect.left +=2;
  9680. StrRect.right -=2;
  9681. StrRect.top +=2;
  9682. rcarray.Add (StrRect);
  9683. strarray2.Add (sparray2.ElementAt (i+j));
  9684. }
  9685. int bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9686. rcarray.RemoveAll ();
  9687. for( j=0; j<3; j++)
  9688. {
  9689. StrRect=rc2array.ElementAt (j);
  9690. if(j==0)
  9691. {
  9692. dty+=bottom-StrRect.bottom;
  9693. }
  9694. StrRect.bottom =bottom;
  9695. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9696. StrRect.top =StrRect.bottom ;
  9697. StrRect.bottom +=18;
  9698. rcarray.Add (StrRect);
  9699. }
  9700. rc2array.RemoveAll ();
  9701. rc2array.Copy(rcarray);
  9702. }
  9703. m_Print.SetFontFace(15, 1, "宋体");
  9704. StrRect=load.m_rcarray .ElementAt (20);
  9705. dty=curypos-StrRect.bottom+35;
  9706. StrRect.top +=dty;StrRect.bottom +=dty;
  9707. m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9708. m_Print.SetFontFace(9, 1, "宋体");
  9709. rcarray.RemoveAll ();
  9710. strarray2.RemoveAll ();
  9711. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9712. StrRect.left +=2;
  9713. StrRect.right -=2;
  9714. StrRect.top +=2;
  9715. rcarray.Add (StrRect);
  9716. strarray2.Add (m_bz);
  9717. bottom=CalHeight(&rcarray, &strarray2, &m_Print, FORMAT_LEFT);
  9718. StrRect=load.m_rcarray .ElementAt (21);StrRect.top +=dty;StrRect.bottom +=dty;
  9719. dty+=bottom-StrRect.bottom;
  9720. StrRect.bottom =bottom;
  9721. m_Print.DrawRect2(StrRect, 1);curypos=StrRect.bottom;
  9722. m_Print.SetFontFace(10, 1, "宋体");
  9723. StrRect=load.m_rcarray .ElementAt (22);
  9724. dty=curypos-StrRect.bottom+25;
  9725. StrRect.top +=dty;StrRect.bottom +=dty;
  9726. CString m_edit9=(g_cominfoarray.ElementAt (0).ElementAt (135));
  9727. if(m_edit9.IsEmpty())
  9728. {
  9729. m_edit9="\
  9730. 经确认后的照片均排入制作流程,\r\n\
  9731. 恕不接受更改及退费。实际冲晒出来的相片\r\n\
  9732. 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
  9733. }
  9734. CString info1,info2,info3;
  9735. int newlinepos=m_edit9.Find("\r\n");
  9736. if(newlinepos!=-1)
  9737. {
  9738. info1=m_edit9.Left(newlinepos);
  9739. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9740. }
  9741. newlinepos=m_edit9.Find("\r\n");
  9742. if(newlinepos!=-1)
  9743. {
  9744. info2=m_edit9.Left(newlinepos);
  9745. m_edit9=m_edit9.Right(m_edit9.GetLength()-newlinepos-2);
  9746. info3=m_edit9;
  9747. }
  9748. if(1)
  9749. {
  9750. m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9751. StrRect=load.m_rcarray .ElementAt (23);
  9752. StrRect.top +=dty;StrRect.bottom +=dty;
  9753. m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9754. StrRect=load.m_rcarray .ElementAt (24);
  9755. StrRect.top +=dty;StrRect.bottom +=dty;
  9756. m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9757. }
  9758. else
  9759. {
  9760. m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9761. StrRect=load.m_rcarray .ElementAt (23);
  9762. StrRect.top +=dty;StrRect.bottom +=dty;
  9763. m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9764. StrRect=load.m_rcarray .ElementAt (24);
  9765. StrRect.top +=dty;StrRect.bottom +=dty;
  9766. m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9767. }
  9768. StrRect=load.m_rcarray .ElementAt (25);
  9769. StrRect.top +=dty;StrRect.bottom +=dty;
  9770. m_Print.DrawText((LPTSTR)(LPCTSTR)"贵宾签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9771. StrRect=load.m_rcarray .ElementAt (26);
  9772. StrRect.top +=dty;StrRect.bottom +=dty;
  9773. m_Print.DrawRect2(StrRect, 2);
  9774. m_Print.SetFontFace(9, 1, "宋体");
  9775. StrRect=load.m_rcarray .ElementAt (27);
  9776. StrRect.top +=dty;StrRect.bottom +=dty;
  9777. m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:"+g_cominfoarray.ElementAt (0).ElementAt (12)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9778. StrRect=load.m_rcarray .ElementAt (28);
  9779. StrRect.top +=dty;StrRect.bottom +=dty;
  9780. m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:"+g_cominfoarray.ElementAt (0).ElementAt (11)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  9781. PrintPreview dlg;//dlg.m_mode=2;
  9782. dlg.m_name =name;
  9783. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  9784. dlg.m_pDC =m_Print.GetPDC() ;
  9785. if(aa==0)
  9786. {
  9787. if(dlg.DoModal ()!=IDOK)
  9788. return;
  9789. printcot=dlg.m_num;
  9790. }
  9791. //结束打印
  9792. m_Print.EndPage();
  9793. m_Print.EndPrint();
  9794. }
  9795. }
  9796. /*
  9797. void CMainFrame::PrintFlowChart(CString m_id)
  9798. {
  9799. CPrintRX m_Print;
  9800. m_Print.InitToPrint(NULL, 1);
  9801. m_Print.StartPrint();
  9802. m_Print.StartPage();
  9803. // CRect StrRect(0,0,560,818);
  9804. LoadRect load;
  9805. load.SetLiaPath ("4.lia");
  9806. load.SetMargins(-14,-14);
  9807. if(!load.Load ())return;
  9808. LoadRect load2;
  9809. load2.SetMargins(-14,472+27-14);
  9810. load2.SetLiaPath ("5.lia");
  9811. if(!load2.Load ())return;
  9812. //////////////////////////////////////////////////////////////
  9813. CString filter="id='"+m_id+"';id='"+m_id+"'";
  9814. g_sendhead.code[0]=54;
  9815. g_sendhead.code[1]=50;
  9816. g_sendhead.tabcount=2;
  9817. g_sendhead.bsql=0;
  9818. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  9819. CArray<CStringArray, CStringArray>sparray;
  9820. DataToArray(&g_List1array,&sparray);
  9821. CString spno;
  9822. for(int i=0; i<sparray.GetSize (); i++)
  9823. {
  9824. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册")continue;
  9825. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  9826. spno+=sparray.ElementAt (i).ElementAt (5);
  9827. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  9828. spno+=";";
  9829. else
  9830. {
  9831. spno+=":";
  9832. spno+=sparray.ElementAt (i).ElementAt (6);
  9833. spno+=";";
  9834. }
  9835. }
  9836. spno+=" 加挑:";
  9837. for( i=0; i<sparray.GetSize (); i++)
  9838. {
  9839. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  9840. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  9841. spno+=sparray.ElementAt (i).ElementAt (5);
  9842. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  9843. spno+=";";
  9844. else
  9845. {
  9846. spno+=":";
  9847. spno+=sparray.ElementAt (i).ElementAt (6);
  9848. spno+=";";
  9849. }
  9850. }
  9851. if(spno.Right (6)==" 加挑:")
  9852. {
  9853. spno=spno.Left (spno.GetLength ()-6);
  9854. }
  9855. CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
  9856. CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
  9857. CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
  9858. CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
  9859. CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
  9860. if(m_urgent.IsEmpty ())m_urgent="否";
  9861. CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
  9862. CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
  9863. CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
  9864. CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
  9865. CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
  9866. CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
  9867. CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
  9868. CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
  9869. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
  9870. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
  9871. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
  9872. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17);
  9873. CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
  9874. CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
  9875. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
  9876. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
  9877. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
  9878. CString m_sum3;
  9879. m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
  9880. ::ConvertToPrice (m_sum3);
  9881. if(m_money3.IsEmpty ())m_money3="0";
  9882. // m_money3=m_money3+"/"+m_sum3;
  9883. CString name;
  9884. if(!m_name1.IsEmpty ())
  9885. name=m_name1+",";
  9886. name+=m_name2;
  9887. name.TrimRight (",");
  9888. CString phone;
  9889. if(!m_phone1.IsEmpty ())
  9890. phone=m_phone1+",";
  9891. phone+=m_phone2;phone.TrimRight (",");
  9892. CStringArray strarray;
  9893. strarray.Add (m_urgent);
  9894. strarray.Add (m_ren);
  9895. strarray.Add (m_waiter3);
  9896. strarray.Add (name);
  9897. strarray.Add (m_time2);
  9898. strarray.Add (m_time4);
  9899. strarray.Add (m_time5);
  9900. strarray.Add (m_money3);
  9901. strarray.Add (m_takezs);
  9902. strarray.Add (m_taoxizs);
  9903. strarray.Add (m_choosezs);
  9904. strarray.Add (m_id);
  9905. strarray.Add (phone);
  9906. ////////////////////////////////////////////////////////////////
  9907. int rcpos=-1;
  9908. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  9909. Image *pImg=NULL;
  9910. #ifdef MNLS_VERSION
  9911. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  9912. #else
  9913. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
  9914. #endif
  9915. m_Print.DrawImage(pImg, StrRect);
  9916. delete pImg;
  9917. m_Print.SetFontFace(15, 1, "宋体");
  9918. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9919. #ifdef MNLS_VERSION
  9920. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9921. #endif
  9922. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9923. #ifdef MNLS_VERSION
  9924. m_Print.DrawRect(StrRect);
  9925. #endif
  9926. m_Print.SetFontFace(7, 1, "黑体");
  9927. m_Print.SetColor(0xffffff);
  9928. #ifdef MNLS_VERSION
  9929. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9930. #endif
  9931. m_Print.SetColor(0);
  9932. m_Print.SetFontFace(25, 1, "黑体");
  9933. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9934. m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9935. CString title[13]={"是否加急:","接单门市:","选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","取件日期:","加挑/余款:","拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
  9936. m_Print.SetFontFace(12, 1, "宋体");
  9937. for( i=0; i<13; i++)
  9938. {
  9939. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9940. if(i<3)
  9941. m_Print.DrawRect2(StrRect, 0);
  9942. else
  9943. m_Print.DrawRect2(StrRect, 1);
  9944. m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9945. }
  9946. for( i=18; i<=37; i++)
  9947. {
  9948. StrRect=load.m_rcarray .ElementAt (++rcpos);
  9949. if(i>=19&&i<=21)
  9950. m_Print.DrawRect2(StrRect, 2);
  9951. else if(i==26)
  9952. {
  9953. CRect rc=StrRect;
  9954. CRect rc2=rc;
  9955. rc.right -=rc2.Width ()/2;
  9956. m_Print.DrawRect2(rc, 1);
  9957. rc2.left +=rc.Width ();
  9958. m_Print.DrawRect2(rc2, 1);
  9959. }
  9960. else
  9961. m_Print.DrawRect2(StrRect, 1);
  9962. if(i==18)
  9963. {
  9964. StrRect.left +=5;
  9965. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9966. }
  9967. }
  9968. //////////////////////////////////////
  9969. rcpos=-1;
  9970. for( i=0; i<8; i++)
  9971. {
  9972. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9973. m_Print.DrawRect2(StrRect, 1);
  9974. }
  9975. CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客签名:"};
  9976. for( i=0; i<4; i++)
  9977. {
  9978. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9979. m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  9980. }
  9981. for( i=0; i<4; i++)
  9982. {
  9983. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  9984. m_Print.DrawRect2(StrRect, 2);
  9985. }
  9986. ///////////////////////////////////////////
  9987. for( i=19; i<=31; i++)
  9988. {
  9989. StrRect=load.m_rcarray .ElementAt (i-1);
  9990. StrRect.left +=4;
  9991. if(i==31)
  9992. {
  9993. if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
  9994. {
  9995. StrRect.top +=2;
  9996. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  9997. StrRect.top +=8;
  9998. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  9999. }
  10000. else
  10001. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10002. }
  10003. else if((i-19)==7)
  10004. {
  10005. CRect rc=StrRect;
  10006. CRect rc2=rc;
  10007. rc.right -=rc2.Width ()/2;
  10008. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10009. rc2.left +=rc.Width ()+3;
  10010. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10011. }
  10012. else
  10013. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10014. }
  10015. strarray.RemoveAll ();
  10016. strarray.Add (m_waiter2);
  10017. strarray.Add (m_waiter1);
  10018. strarray.Add (m_waiter4);
  10019. for( i=13; i<=15; i++)
  10020. {
  10021. StrRect=load2.m_rcarray .ElementAt (i-1);
  10022. StrRect.left +=4;
  10023. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10024. }
  10025. ///////////spno
  10026. CRect sprc[14];
  10027. for(i=0; i<14; i++)
  10028. {
  10029. if(i<7)
  10030. {
  10031. if(i==0)
  10032. {
  10033. StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
  10034. }
  10035. else
  10036. {
  10037. StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
  10038. }
  10039. }
  10040. else
  10041. {
  10042. StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
  10043. }
  10044. sprc[i]=StrRect;
  10045. // m_Print.DrawText((LPTSTR)(LPCTSTR)"xxx", sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10046. }
  10047. CString temp,tempspno,tempbz;
  10048. CSize size;
  10049. BOOL bRun=0;
  10050. int fontsize=12;
  10051. ll: tempspno=spno;
  10052. tempbz=m_bz;
  10053. m_Print.SetFontFace(fontsize, 1, "宋体");
  10054. for( i=0; i<14; i++)
  10055. {
  10056. if(!tempspno.IsEmpty ())
  10057. {
  10058. temp=tempspno;
  10059. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10060. int right=0;
  10061. CRect temprc=sprc[i];
  10062. while(size.cx>temprc.Width ())
  10063. {
  10064. right++;
  10065. temp=tempspno.Left (tempspno.GetLength ()-(right));
  10066. if(GIsHalfHZ(temp))
  10067. {
  10068. right++;
  10069. temp.Delete (temp.GetLength ()-1);
  10070. }
  10071. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10072. }
  10073. if(bRun)
  10074. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10075. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  10076. if(tempspno.IsEmpty ())i++;
  10077. }
  10078. else if(!tempbz.IsEmpty ())
  10079. {
  10080. temp=tempbz;
  10081. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10082. int right=0;
  10083. CRect temprc=sprc[i];
  10084. while(size.cx>temprc.Width ())
  10085. {
  10086. right++;
  10087. temp=tempbz.Left (tempbz.GetLength ()-(right));
  10088. if(GIsHalfHZ(temp))
  10089. {
  10090. right++;
  10091. temp.Delete (temp.GetLength ()-1);
  10092. }
  10093. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  10094. }
  10095. if(bRun)
  10096. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10097. tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
  10098. }
  10099. }
  10100. if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
  10101. {
  10102. fontsize--;
  10103. goto ll;
  10104. }
  10105. if(bRun==0)
  10106. {
  10107. bRun=1;
  10108. goto ll;
  10109. }
  10110. PrintPreview dlg;
  10111. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  10112. dlg.m_pDC =m_Print.GetPDC() ;
  10113. if(dlg.DoModal ()!=IDOK)return;
  10114. //结束打印
  10115. m_Print.EndPage();
  10116. m_Print.EndPrint();
  10117. }
  10118. void CMainFrame::SetSelFolder(int pos)
  10119. {
  10120. m_wndToolBar2.SetSelFolder(pos);
  10121. }*/
  10122. void CMainFrame::ToPhotoPrint()
  10123. {
  10124. UINT nID=1;
  10125. LPSTR pName ;
  10126. pName = (LPSTR)(LPCSTR)"相片冲印资料";
  10127. OPEN_MENU(PhotoPrintFrom);
  10128. }
  10129. void CMainFrame::GetOcx()
  10130. {
  10131. char path[MAX_PATH];
  10132. ::GetSystemDirectory (path, MAX_PATH);
  10133. CString syspath=path;
  10134. try
  10135. {
  10136. if(!::PathFileExists (syspath+"\\MSCHRT20.OCX"))
  10137. {
  10138. g_sendhead.bsql=0;
  10139. g_sendhead.code[0]=103;
  10140. g_sendhead.tabcount=1;
  10141. g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
  10142. CFile fp;
  10143. if(fp.Open (syspath+"\\MSCHRT20.OCX", CFile::modeWrite|CFile::modeCreate))
  10144. {
  10145. fp.Write (g_pData, g_nLeng);
  10146. fp.Close ();
  10147. ::Sleep (1000);
  10148. }
  10149. }
  10150. CString temp;
  10151. temp.Format (_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10152. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10153. }
  10154. catch(...)
  10155. {
  10156. }
  10157. try
  10158. {
  10159. CString temp;
  10160. temp.Format (_T(" -s %s\\MSCHRT20.OCX"), syspath);
  10161. ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
  10162. }
  10163. catch(...)
  10164. {
  10165. }
  10166. }
  10167. void CMainFrame::OnServer()
  10168. {
  10169. // TODO: Add your command handler code here
  10170. DBConfig dlg;
  10171. dlg.DoModal ();
  10172. }
  10173. void CMainFrame::OnPath() // 远程访问设置;
  10174. {
  10175. // TODO: Add your command handler code here
  10176. if(g_user.bLongin==0)
  10177. {
  10178. if(g_bNoLoginLia)
  10179. {
  10180. Login dlg;
  10181. dlg.SetLiaPath ("5.lia");
  10182. dlg.DoModal();
  10183. }
  10184. else
  10185. {
  10186. Login3 dlg;
  10187. dlg.SetLiaPath ("5.lia");
  10188. dlg.DoModal();
  10189. }
  10190. if(g_user.bLongin==0)return;
  10191. }
  10192. if(IsHasRightsnew(49)==0)return;
  10193. SetPathDlg2 dlg;
  10194. dlg.DoModal ();
  10195. }
  10196. void CMainFrame::OnShowhis()
  10197. {
  10198. // TODO: Add your command handler code here
  10199. if(g_user.bLongin==0)
  10200. {
  10201. if(g_bNoLoginLia)
  10202. {
  10203. Login dlg;
  10204. dlg.SetLiaPath ("5.lia");
  10205. dlg.DoModal();
  10206. }
  10207. else
  10208. {
  10209. Login3 dlg;
  10210. dlg.SetLiaPath ("5.lia");
  10211. dlg.DoModal();
  10212. }
  10213. if(g_user.bLongin==0)return;
  10214. }
  10215. if(IsHasRightsnew(52)==0)return;
  10216. CMenu *pMenu=GetMenu();
  10217. CMenu* submenu = pMenu->GetSubMenu(2);
  10218. UINT status=submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND );
  10219. if(status&MF_CHECKED)
  10220. {
  10221. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_UNCHECKED);
  10222. g_bShowOK=1;
  10223. }
  10224. else
  10225. {
  10226. submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
  10227. g_bShowOK=0;
  10228. } m_Mdi.CloseAll();
  10229. }
  10230. void CMainFrame::AddHistoryMenu(CArray<CStringArray, CStringArray>*hisyeararray)
  10231. {
  10232. #ifdef NEW_SKIN
  10233. CMenu *m_menuXP=GetMenu();
  10234. CMenu* submenu = m_menuXP->GetSubMenu(2);
  10235. int i = 0;
  10236. for(/*int*/ i=0; i<100; i++)
  10237. {
  10238. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10239. }
  10240. for( i=0; i<hisyeararray->GetSize (); i++)
  10241. {
  10242. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10243. }
  10244. g_nYearpos=-1;
  10245. #else
  10246. HMENU hMenu=::GetMenu (m_hWnd);
  10247. m_menuXP.Attach (hMenu);
  10248. BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
  10249. int i = 0;
  10250. for(/*int*/ i=0; i<100; i++)
  10251. {
  10252. submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
  10253. }
  10254. for( i=0; i<hisyeararray->GetSize (); i++)
  10255. {
  10256. submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
  10257. }
  10258. m_menuXP.Detach ();
  10259. g_nYearpos=-1;
  10260. #endif
  10261. }
  10262. /************************************************************************/
  10263. /*
  10264. Jeff
  10265. 函数:AddBranchMenu()
  10266. 参数:CArray<CStringArray, CStringArray> *hisyeararray
  10267. 返回:void
  10268. 注意:
  10269. 调用关系:
  10270. */
  10271. /************************************************************************/
  10272. void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*hisyeararray)
  10273. {
  10274. //WriteClientLog("AddBranchMenu,添加集团版菜单");
  10275. #ifdef ENTERPRISE_VERSION
  10276. CMenu *m_menuXP=GetMenu();
  10277. CMenu* submenu = m_menuXP->GetSubMenu(0);
  10278. int i = 0;
  10279. for(/*int*/ i=0; i<100; i++)
  10280. {
  10281. submenu->DeleteMenu (2000+i, MF_BYCOMMAND);
  10282. }
  10283. g_menubranchname.RemoveAll ();
  10284. CString name;
  10285. int a=0;
  10286. #if 0 // Jeff.add for test
  10287. CString strCount;
  10288. strCount.Format("历史数据库个数=%d",hisyeararray->GetSize());
  10289. WriteClientLog(strCount);
  10290. #endif
  10291. for( i=0; i<hisyeararray->GetSize()-1; i++)
  10292. {
  10293. //WriteClientLog("111");
  10294. //WriteClientLog(hisyeararray->ElementAt(i).ElementAt(0));
  10295. //WriteClientLog(name);
  10296. if(name=="")
  10297. {
  10298. name=hisyeararray->ElementAt (i).ElementAt (0);
  10299. #ifndef SQLSERVER_VERSION
  10300. submenu->AppendMenu(MF_STRING, 2000+a, "查看分店数据:"+name+"(使用本机缓存,速度快)");
  10301. a++;
  10302. #endif
  10303. submenu->AppendMenu(MF_STRING, 2000+a, "操作分店数据:"+name+"(实时访问分店,需网络通畅)");
  10304. a++;
  10305. g_menubranchname.Add (name);
  10306. continue;
  10307. }
  10308. else if(hisyeararray->ElementAt (i).ElementAt (0).Find (name)!=-1 && ((hisyeararray->ElementAt (i).ElementAt (0).GetLength ()-name.GetLength ())==4) )
  10309. {
  10310. continue;
  10311. }
  10312. name=hisyeararray->ElementAt (i).ElementAt (0);
  10313. #ifndef SQLSERVER_VERSION
  10314. submenu->AppendMenu(MF_STRING, 2000+a, "查看分店数据:"+name+"(使用本机缓存,速度快)");
  10315. a++;
  10316. #endif
  10317. submenu->AppendMenu(MF_STRING, 2000+a, "操作分店数据:"+name+"(实时访问分店,需网络通畅)");
  10318. g_menubranchname.Add (name);
  10319. a++;
  10320. //WriteClientLog("222");
  10321. }
  10322. if((hisyeararray->GetSize()-1)>0)
  10323. {
  10324. if(hisyeararray->ElementAt (0).ElementAt (3)=="总店")
  10325. submenu->AppendMenu(MF_STRING, 2000+a, "多店数据汇总");
  10326. }
  10327. #endif
  10328. }
  10329. void CMainFrame::OnHistory(UINT nID)
  10330. {
  10331. CMenu *pMenu=GetMenu();
  10332. CMenu* submenu = pMenu->GetSubMenu(2);
  10333. UINT status=submenu->GetMenuState(nID, MF_BYCOMMAND );
  10334. if(g_user.bLongin==0)
  10335. {
  10336. if(g_bNoLoginLia)
  10337. {
  10338. Login dlg;
  10339. dlg.SetLiaPath ("5.lia");
  10340. dlg.DoModal();
  10341. }
  10342. else
  10343. {
  10344. Login3 dlg;
  10345. dlg.SetLiaPath ("5.lia");
  10346. dlg.DoModal();
  10347. }
  10348. if(g_user.bLongin==0)return;
  10349. }
  10350. if(IsHasRightsnew(52)==0)return;
  10351. m_Mdi.CloseAll();
  10352. for(int i=0; i<100; i++)
  10353. {
  10354. submenu-> CheckMenuItem(1000+i, MF_BYCOMMAND | MF_UNCHECKED);
  10355. }
  10356. if(status&MF_CHECKED)
  10357. {
  10358. g_nYearpos=-1;
  10359. status=submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND );
  10360. if(status&MF_CHECKED)
  10361. g_bShowOK=0;
  10362. else
  10363. g_bShowOK=1;
  10364. }
  10365. else
  10366. {
  10367. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10368. g_nYearpos=nID-1000;
  10369. g_bShowOK=1;
  10370. }
  10371. }
  10372. void CMainFrame::OnBranchData(UINT nID)
  10373. {
  10374. #ifdef ENTERPRISE_VERSION
  10375. #ifdef SQLSERVER_VERSION
  10376. OnBranchData2(nID);
  10377. return;
  10378. #endif
  10379. #endif
  10380. }
  10381. void CMainFrame::OnBranchData2(UINT nID)
  10382. {
  10383. #if 1
  10384. CString strMSG;
  10385. strMSG.Format("1登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10386. AfxMessageBox(strMSG);
  10387. #endif
  10388. #ifdef ENTERPRISE_VERSION
  10389. g_bAllBranch=0;
  10390. m_Mdi.CloseAll();
  10391. OnDisconnect();
  10392. CMenu *pMenu=GetMenu();
  10393. CMenu* submenu = pMenu->GetSubMenu(0);
  10394. UINT status=submenu->GetMenuState(nID, MF_BYCOMMAND );
  10395. for(int i=0; i<100; i++)
  10396. {
  10397. submenu-> CheckMenuItem(2000+i, MF_BYCOMMAND | MF_UNCHECKED);
  10398. }
  10399. if(status&MF_CHECKED) // 取消连接其他分店,回归本店连接;
  10400. {
  10401. AfxMessageBox("取消连接其他分店,回归本店连接");
  10402. g_branchname.Empty ();
  10403. g_branchip.Empty ();
  10404. g_bBranchModify=0;
  10405. g_user.bLongin=0;
  10406. if(g_bNoLoginLia)
  10407. {
  10408. Login dlg;
  10409. dlg.SetLiaPath ("5.lia");
  10410. dlg.DoModal();
  10411. }
  10412. else
  10413. {
  10414. Login3 dlg;
  10415. dlg.SetLiaPath ("5.lia");
  10416. dlg.DoModal();
  10417. }
  10418. g_pMainWnd2->RefreshOutlookBar();
  10419. g_pMainWnd2->DrawLogin();
  10420. g_path1=g_path1bak;
  10421. g_path2=g_path2bak;
  10422. g_path3=g_path3bak;
  10423. g_path4=g_path4bak;
  10424. g_path5=g_path5bak;
  10425. g_path6=g_path6bak;
  10426. g_path7=g_path7bak;
  10427. g_pMainWnd2->EnableBtns(1);
  10428. #if 1
  10429. strMSG.Format("2登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10430. AfxMessageBox(strMSG);
  10431. #endif
  10432. }
  10433. else // 连接其他分店;
  10434. {
  10435. AfxMessageBox("连接其他分店");
  10436. BOOL bNeedCheckRights=1;
  10437. if(g_user.bLongin && g_branchname=="")//无需登陆本店判断其访问分店权限
  10438. {
  10439. bNeedCheckRights=0;
  10440. }
  10441. #ifndef SQLSERVER_VERSION
  10442. if((g_menubranchname.GetSize()*2)==nID-2000)//多店数据汇总
  10443. #else
  10444. if((g_menubranchname.GetSize())==nID-2000)//多店数据汇总
  10445. #endif
  10446. {
  10447. AfxMessageBox("多店汇总");
  10448. g_branchname.Empty ();
  10449. g_branchip.Empty ();
  10450. g_bBranchModify=0;
  10451. if(bNeedCheckRights)
  10452. {
  10453. g_user.bLongin=0;
  10454. if(g_user.bLongin==0)
  10455. {
  10456. if(g_bNoLoginLia)
  10457. {
  10458. Login dlg;
  10459. dlg.SetLiaPath ("5.lia");
  10460. dlg.DoModal();
  10461. }
  10462. else
  10463. {
  10464. Login3 dlg;
  10465. dlg.SetLiaPath ("5.lia");
  10466. dlg.DoModal();
  10467. }
  10468. if(g_user.bLongin==0)return;
  10469. }
  10470. }
  10471. if(IsHasRightsnew(28)==0)
  10472. {
  10473. return;
  10474. }
  10475. g_bAllBranch=1; // 设置多店汇总标识为true;
  10476. g_pMainWnd2->ShowBar (0);
  10477. g_pMainWnd2->RefreshOutlookBar2();
  10478. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10479. g_branchname.Empty ();
  10480. g_branchip.Empty ();
  10481. g_bBranchModify=0;
  10482. g_pMainWnd2->DrawLogin();
  10483. g_pMainWnd2->EnableBtns(0);
  10484. g_path1=g_path1bak;
  10485. g_path2=g_path2bak;
  10486. g_path3=g_path3bak;
  10487. g_path4=g_path4bak;
  10488. g_path5=g_path5bak;
  10489. g_path6=g_path6bak;
  10490. g_path7=g_path7bak;
  10491. #if 1
  10492. strMSG.Format("3登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10493. AfxMessageBox(strMSG);
  10494. #endif
  10495. }
  10496. else
  10497. {
  10498. AfxMessageBox("非多店汇总");
  10499. if(bNeedCheckRights)
  10500. {
  10501. g_branchname.Empty ();
  10502. g_branchip.Empty ();
  10503. g_bBranchModify=0;
  10504. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
  10505. g_user.bLongin=0;
  10506. if(g_pMainWnd2)
  10507. {
  10508. g_pMainWnd2->DrawLogin();
  10509. g_pMainWnd2->ShowBar (0);
  10510. }
  10511. if(g_bNoLoginLia)
  10512. {
  10513. Login dlg;
  10514. dlg.SetLiaPath ("5.lia");
  10515. dlg.DoModal();
  10516. }
  10517. else
  10518. {
  10519. Login3 dlg;
  10520. dlg.SetLiaPath ("5.lia");
  10521. dlg.DoModal();
  10522. }
  10523. if(g_user.bLongin==0)return;
  10524. }
  10525. if(IsHasRightsnew(28)==0)
  10526. {
  10527. return;
  10528. }
  10529. submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
  10530. #ifndef SQLSERVER_VERSION
  10531. if(nID%2==0)
  10532. g_branchname = g_menubranchname.ElementAt ((nID-2000)/2);
  10533. else
  10534. g_branchname = g_menubranchname.ElementAt ((nID-2001)/2);
  10535. #else
  10536. g_branchname=g_menubranchname.ElementAt(nID-2000);
  10537. #endif
  10538. g_branchip.Empty ();
  10539. CString domainname="";
  10540. for(int i=0; i<g_brancharray.GetSize(); i++)
  10541. {
  10542. if(g_branchname==g_brancharray.ElementAt (i).ElementAt (0))
  10543. {
  10544. g_branchip=g_brancharray.ElementAt (i).ElementAt (1);
  10545. g_branchip2=g_brancharray.ElementAt (i).ElementAt (4);
  10546. domainname=g_brancharray.ElementAt (i).ElementAt (2);
  10547. }
  10548. }
  10549. g_path1=g_path1bak;
  10550. g_path2=g_path2bak;
  10551. g_path3=g_path3bak;
  10552. g_path4=g_path4bak;
  10553. g_path5=g_path5bak;
  10554. g_path6=g_path6bak;
  10555. g_path7=g_path7bak;
  10556. if(domainname.IsEmpty ())
  10557. {
  10558. g_path1=g_path2=g_path3=g_path4=g_path5=g_path6=g_path7="xxx";
  10559. }
  10560. else
  10561. {
  10562. g_path1+="\\"+domainname;
  10563. g_path2+="\\"+domainname;
  10564. g_path3+="\\"+domainname;
  10565. g_path4+="\\"+domainname;
  10566. g_path5+="\\"+domainname;
  10567. g_path6+="\\"+domainname;
  10568. g_path7+="\\"+domainname;
  10569. }
  10570. #if 1
  10571. strMSG.Format("2登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
  10572. AfxMessageBox(strMSG);
  10573. #endif
  10574. g_bBranchModify=1;
  10575. if(g_bBranchModify)OnDisconnect();
  10576. if(1)
  10577. {
  10578. g_user.bLongin=0;
  10579. g_user.name.Empty ();
  10580. g_user.rights.Empty ();
  10581. g_user.account.Empty ();
  10582. g_user.rights2="*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
  10583. g_pMainWnd2->RefreshOutlookBar();
  10584. m_Mdi.CloseAll();
  10585. if(g_pMainWnd2)
  10586. {
  10587. g_pMainWnd2->DrawLogin();
  10588. g_pMainWnd2->ShowBar (0);
  10589. }
  10590. if(g_bNoLoginLia)
  10591. {
  10592. Login dlg;
  10593. dlg.SetLiaPath ("5.lia");
  10594. dlg.DoModal();
  10595. }
  10596. else
  10597. {
  10598. Login3 dlg;
  10599. dlg.SetLiaPath ("5.lia");
  10600. dlg.DoModal();
  10601. }
  10602. if(g_user.bLongin==0)return;
  10603. if(g_pMainWnd2)g_pMainWnd2->ShowBar (1);
  10604. }
  10605. g_pMainWnd2->DrawLogin();
  10606. g_pMainWnd2->EnableBtns(1);
  10607. }
  10608. g_nYearpos=-1;
  10609. }
  10610. #endif
  10611. }
  10612. void CMainFrame::OnStaffAchievementShow() //Jeff:此机只用于员工看业绩;
  10613. {
  10614. // TODO: Add your command handler code here
  10615. if(g_user.bLongin==0) // 是否登陆系统;
  10616. {
  10617. if(g_bNoLoginLia)
  10618. {
  10619. Login dlg;
  10620. dlg.SetLiaPath ("5.lia");
  10621. dlg.DoModal();
  10622. }
  10623. else
  10624. {
  10625. Login3 dlg;
  10626. dlg.SetLiaPath ("5.lia");
  10627. dlg.DoModal();
  10628. }
  10629. if(g_user.bLongin==0)return;
  10630. }
  10631. if(IsHasRightsnew(49)==0)return;// 是否有权限进行设置;
  10632. CString version = _T ("Version 1.0");
  10633. CMenu *pMenu=GetMenu();
  10634. CMenu* submenu = pMenu->GetSubMenu(1);
  10635. UINT status=submenu->GetMenuState(IDM_StaffAchievementShow, MF_BYCOMMAND );
  10636. if(status&MF_CHECKED)
  10637. {
  10638. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_UNCHECKED);
  10639. AfxGetApp()->WriteProfileInt (version, "status2", 0);
  10640. g_bStaffAchievementShow=0;
  10641. TCHAR szKey[MAX_PATH];
  10642. TCHAR szDir[MAX_PATH];
  10643. ::GetModuleFileName (NULL, szDir, MAX_PATH);
  10644. HKEY hKey=0;
  10645. DWORD disp=0;
  10646. lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  10647. int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp);
  10648. if(lResult==ERROR_SUCCESS)
  10649. {
  10650. RegDeleteValue(hKey,"YLGLMAINAUTORUN");
  10651. RegDeleteKey (hKey,"YLGLMAINAUTORUN");
  10652. RegCloseKey(hKey);
  10653. }
  10654. }
  10655. else
  10656. {
  10657. submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
  10658. AfxGetApp()->WriteProfileInt (version, "status2", 1);
  10659. g_bStaffAchievementShow=1;
  10660. TCHAR szKey[MAX_PATH];
  10661. TCHAR szDir[MAX_PATH];
  10662. ::GetModuleFileName (NULL, szDir, MAX_PATH);
  10663. HKEY hKey=0;
  10664. DWORD disp=0;
  10665. lstrcpy(szKey,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
  10666. int lResult=RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey,0,NULL,REG_OPTION_VOLATILE, KEY_ALL_ACCESS,NULL,&hKey,&disp);
  10667. if(lResult==ERROR_SUCCESS)
  10668. {
  10669. lResult=RegSetValueEx(hKey,"YLGLMAINAUTORUN",0,REG_SZ,(const unsigned char*)szDir,lstrlen(szDir));
  10670. RegCloseKey(hKey);
  10671. }
  10672. StaffAchievementSet dlg;
  10673. dlg.DoModal ();
  10674. }
  10675. }
  10676. void CMainFrame::PrintDinDan2(CString m_id)
  10677. {
  10678. #ifdef MODERN_VERSION
  10679. SelContent seldlg;
  10680. if(seldlg.DoModal()!=IDOK)return;
  10681. CPrintRX m_Print;
  10682. m_Print.InitToPrint(NULL, 1);
  10683. m_Print.StartPrint();
  10684. m_Print.StartPage();
  10685. // CRect StrRect(0,0,560,818);
  10686. LoadRect load;
  10687. LoadRect load2;
  10688. LoadRect load3;
  10689. load.SetLiaPath ("9.lia");
  10690. load.SetMargins(-14,0);
  10691. if(!load.Load ())return;
  10692. int i;
  10693. //////////////////////////////////////////////////////////////
  10694. CStringArray txarray;
  10695. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  10696. g_sendhead.code[0]=11;
  10697. g_sendhead.code[1]=52;
  10698. g_sendhead.code[2]=50;
  10699. g_sendhead.code[3]=38;
  10700. g_sendhead.code[4]=27;
  10701. g_sendhead.tabcount=5;
  10702. g_sendhead.bsql=0;
  10703. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  10704. CArray<CStringArray, CStringArray>sparray;
  10705. CArray<CStringArray, CStringArray>clientarray;
  10706. CArray<CStringArray, CStringArray>phonearray;
  10707. CArray<CStringArray, CStringArray>bukuan2array;
  10708. CArray<CStringArray, CStringArray>bukuanarray;
  10709. DataToArray(&g_List1array, &clientarray, &sparray, &bukuan2array, &bukuanarray);
  10710. CTime tm=CTime::GetCurrentTime ();
  10711. CString str;
  10712. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  10713. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  10714. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  10715. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  10716. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  10717. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
  10718. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  10719. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  10720. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  10721. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  10722. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  10723. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  10724. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  10725. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  10726. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  10727. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  10728. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  10729. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  10730. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  10731. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  10732. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  10733. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  10734. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  10735. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  10736. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  10737. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  10738. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  10739. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  10740. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  10741. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  10742. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  10743. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  10744. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  10745. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  10746. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  10747. filter="name='"+m_ren+"'";
  10748. g_sendhead.code[0]=5;
  10749. g_sendhead.tabcount=1;
  10750. g_sendhead.bsql=0;
  10751. int g_nYearposTemp=g_nYearpos;
  10752. g_nYearpos=-1;
  10753. g_pMainWnd->ProcessChatMessageRequest2(filter);
  10754. g_nYearpos=g_nYearposTemp;
  10755. if(g_bSendOK==0)return;
  10756. DataToArray(&phonearray);
  10757. m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
  10758. m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
  10759. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  10760. ConvertToPrice(m_money1);
  10761. ConvertToPrice(m_money2);
  10762. ConvertToPrice(m_money3);
  10763. ////////////////////////////////////////////////////////////////
  10764. int rcpos=-1;
  10765. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  10766. Image *pImg=NULL;
  10767. ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo2.jpg");
  10768. if(seldlg.m_bFrame)
  10769. m_Print.DrawImage(pImg, StrRect);
  10770. delete pImg;
  10771. m_Print.SetFontFace(16, 1, "黑体");
  10772. StrRect=load.m_rcarray .ElementAt (++rcpos);
  10773. if(seldlg.m_bFrame)
  10774. ///////////////////////////////不用改
  10775. m_Print.DrawText((LPTSTR)(LPCTSTR)"摩登新娘工作流程单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  10776. m_Print.SetFontFace(10, 1, "宋体");
  10777. for( i=3; i<=6; i++)
  10778. {
  10779. StrRect=load.m_rcarray .ElementAt (i-1);
  10780. if(seldlg.m_bFrame)
  10781. m_Print.DrawRect2(StrRect, 1);
  10782. }
  10783. CStringArray strarray;
  10784. if(seldlg.m_bBooking==0)
  10785. {
  10786. m_name1.Empty ();
  10787. m_name2.Empty ();
  10788. m_phone1.Empty ();
  10789. m_phone2.Empty ();
  10790. m_addr1.Empty ();
  10791. m_addr2.Empty ();
  10792. m_taoxiname.Empty ();
  10793. m_taoxijiage.Empty ();
  10794. }
  10795. if(seldlg.m_bFrame )
  10796. {
  10797. strarray.Add("新郎:"+m_name1);
  10798. strarray.Add("H");
  10799. strarray.Add("O");
  10800. strarray.Add("手机:"+m_phone1);
  10801. strarray.Add("新娘:"+m_name2);
  10802. strarray.Add("H");
  10803. strarray.Add("O");
  10804. strarray.Add("手机:"+m_phone2);
  10805. }
  10806. else
  10807. {
  10808. strarray.Add(" "+m_name1);
  10809. strarray.Add("");
  10810. strarray.Add("");
  10811. strarray.Add(" "+m_phone1);
  10812. strarray.Add(" "+m_name2);
  10813. strarray.Add("");
  10814. strarray.Add("");
  10815. strarray.Add(" "+m_phone2);
  10816. }
  10817. for( i=7; i<=14; i++)
  10818. {
  10819. StrRect=load.m_rcarray .ElementAt (i-1);
  10820. StrRect.left +=2;
  10821. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10822. }
  10823. StrRect=load.m_rcarray .ElementAt (3);
  10824. StrRect.left +=2;
  10825. if(seldlg.m_bFrame)
  10826. str="地址:"+m_addr1;
  10827. else
  10828. str=" "+m_addr1;
  10829. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10830. StrRect=load.m_rcarray .ElementAt (5);
  10831. StrRect.left +=2;
  10832. if(seldlg.m_bFrame)
  10833. str="地址:"+m_addr2;
  10834. else
  10835. str=" "+m_addr2;
  10836. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10837. //////////////////////////////////////////////////////
  10838. StrRect=load.m_rcarray .ElementAt (14);
  10839. str="预\r\n约";
  10840. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10841. StrRect.top +=46;
  10842. StrRect.left +=2;
  10843. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10844. m_Print.SetFontFace(10, 1, "宋体");
  10845. StrRect=load.m_rcarray .ElementAt (15);
  10846. if(seldlg.m_bFrame)
  10847. str="套系名称:"+m_taoxiname;
  10848. else
  10849. str=" "+m_taoxiname;
  10850. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10851. StrRect.left +=4;
  10852. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10853. StrRect=load.m_rcarray .ElementAt (16);
  10854. if(seldlg.m_bFrame)
  10855. str="单价:"+m_taoxijiage;
  10856. else
  10857. str=" "+m_taoxijiage;
  10858. StrRect.left +=2;
  10859. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10860. StrRect=load.m_rcarray .ElementAt (21);
  10861. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10862. str="新人签名:";
  10863. StrRect.left +=2;
  10864. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10865. StrRect=load.m_rcarray .ElementAt (22);
  10866. if(seldlg.m_bBooking==0)
  10867. {
  10868. if(seldlg.m_bFrame)
  10869. str="未付款:";
  10870. else
  10871. str=" ";
  10872. }
  10873. else
  10874. {
  10875. if(seldlg.m_bFrame)
  10876. str="未付款:"+m_money3;
  10877. else
  10878. str=" "+m_money3;
  10879. }
  10880. StrRect.left +=2;
  10881. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10882. StrRect=load.m_rcarray .ElementAt (23);
  10883. str="结婚秘书:";
  10884. StrRect.left +=2;
  10885. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10886. StrRect=load.m_rcarray .ElementAt (24);
  10887. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10888. StrRect.left +=3;
  10889. StrRect.top +=3;
  10890. StrRect.right -=2;
  10891. StrRect.bottom -=2;
  10892. int realpos=0;str="";
  10893. for(i=0; i<sparray.GetSize (); i++)
  10894. {
  10895. if(atoi(sparray.ElementAt (i).ElementAt (4))!=1)continue;
  10896. str+=sparray.ElementAt (i).ElementAt (5);
  10897. str+=" 数量:";
  10898. str+=sparray.ElementAt (i).ElementAt (3);
  10899. if(realpos%2)
  10900. str+="\r\n";
  10901. else
  10902. str+=" ";
  10903. realpos++;
  10904. }
  10905. str.TrimRight ("\r\n");
  10906. str.TrimRight (" ");
  10907. if(seldlg.m_bBooking)AutoDraw(m_Print, StrRect, str, 1.4);
  10908. ///////////////////////////////////////////////////////////
  10909. StrRect=load.m_rcarray .ElementAt (14);
  10910. StrRect.top +=1*122;
  10911. StrRect.bottom +=1*122;
  10912. str="拍\r\n照";
  10913. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10914. StrRect.top +=46;
  10915. StrRect.left +=2;
  10916. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10917. m_Print.SetFontFace(10, 1, "宋体");
  10918. StrRect=load.m_rcarray .ElementAt (15);
  10919. StrRect.top +=1*122;
  10920. StrRect.bottom +=1*122;
  10921. str="拍照内容: 白 晚 特 便";
  10922. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10923. StrRect.left +=4;
  10924. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10925. StrRect=load.m_rcarray .ElementAt (21);
  10926. StrRect.top +=1*122;
  10927. StrRect.bottom +=1*122;
  10928. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10929. str=" 新人签名:";
  10930. StrRect.left +=2;
  10931. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10932. StrRect=load.m_rcarray .ElementAt (22);
  10933. StrRect.top +=1*122;
  10934. StrRect.bottom +=1*122;
  10935. if(seldlg.m_bTake)
  10936. {
  10937. if(seldlg.m_bFrame)
  10938. str="未付款:"+m_money3;
  10939. else
  10940. str=" "+m_money3;
  10941. }
  10942. else
  10943. {
  10944. if(seldlg.m_bFrame)
  10945. str="未付款:";
  10946. else
  10947. str=" ";
  10948. }
  10949. StrRect.left +=2;
  10950. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10951. StrRect=load.m_rcarray .ElementAt (23);
  10952. StrRect.top +=1*122;
  10953. StrRect.bottom +=1*122;
  10954. str="结婚秘书:";
  10955. StrRect.left +=2;
  10956. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10957. StrRect=load.m_rcarray .ElementAt (24);
  10958. StrRect.top +=1*122;
  10959. StrRect.bottom +=1*122;
  10960. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10961. StrRect.left +=3;
  10962. StrRect.top +=3;
  10963. StrRect.right -=2;
  10964. StrRect.bottom -=2;
  10965. if(seldlg.m_bTake)
  10966. {
  10967. str="";
  10968. for(i=0; i<bukuan2array.GetSize (); i++)
  10969. {
  10970. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=1)continue;
  10971. str+="加挑: ";
  10972. str+=bukuan2array.ElementAt (i).ElementAt (4);
  10973. str+="\r\n";
  10974. }
  10975. str.TrimRight ("\r\n");
  10976. str.TrimRight (" ");
  10977. AutoDraw(m_Print, StrRect, str, 1.4);
  10978. }
  10979. ///////////////////////////////////////////////////////////
  10980. StrRect=load.m_rcarray .ElementAt (14);
  10981. StrRect.top +=2*122;
  10982. StrRect.bottom +=2*122;
  10983. str="选\r\n样";
  10984. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10985. StrRect.top +=46;
  10986. StrRect.left +=2;
  10987. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  10988. m_Print.SetFontFace(10, 1, "宋体");
  10989. StrRect=load.m_rcarray .ElementAt (15);
  10990. StrRect.top +=2*122;
  10991. StrRect.bottom +=2*122;
  10992. str="选片内容:";
  10993. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  10994. StrRect.left +=4;
  10995. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  10996. StrRect=load.m_rcarray .ElementAt (21);
  10997. StrRect.top +=2*122;
  10998. StrRect.bottom +=2*122;
  10999. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11000. str=" 新人签名:";
  11001. StrRect.left +=2;
  11002. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11003. StrRect=load.m_rcarray .ElementAt (22);
  11004. StrRect.top +=2*122;
  11005. StrRect.bottom +=2*122;
  11006. if(seldlg.m_bChoose)
  11007. {
  11008. if(seldlg.m_bFrame)
  11009. str="未付款:"+m_money3;
  11010. else
  11011. str=" "+m_money3;
  11012. }
  11013. else
  11014. {
  11015. if(seldlg.m_bFrame)
  11016. str="未付款:";
  11017. else
  11018. str=" ";
  11019. }
  11020. StrRect.left +=2;
  11021. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11022. StrRect=load.m_rcarray .ElementAt (23);
  11023. StrRect.top +=2*122;
  11024. StrRect.bottom +=2*122;
  11025. str="结婚秘书:";
  11026. StrRect.left +=2;
  11027. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11028. StrRect=load.m_rcarray .ElementAt (24);
  11029. StrRect.top +=2*122;
  11030. StrRect.bottom +=2*122;
  11031. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11032. if(seldlg.m_bChoose)
  11033. {
  11034. StrRect.left +=3;
  11035. StrRect.top +=3;
  11036. StrRect.right -=2;
  11037. StrRect.bottom -=2;
  11038. str="";
  11039. for(i=0; i<bukuan2array.GetSize (); i++)
  11040. {
  11041. if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=2)continue;
  11042. str+="加挑: ";
  11043. str+=bukuan2array.ElementAt (i).ElementAt (4);
  11044. str+="\r\n";
  11045. }
  11046. str.TrimRight ("\r\n");
  11047. str.TrimRight (" ");
  11048. AutoDraw(m_Print, StrRect, str, 1.4);
  11049. }
  11050. ///////////////////////////////////////////////////////////
  11051. StrRect=load.m_rcarray .ElementAt (14);
  11052. StrRect.top +=3*122;
  11053. StrRect.bottom +=3*122;
  11054. str="结\r\n婚";
  11055. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11056. StrRect.top +=46;
  11057. StrRect.left +=2;
  11058. if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
  11059. m_Print.SetFontFace(10, 1, "宋体");
  11060. StrRect=load.m_rcarray .ElementAt (15);
  11061. StrRect.top +=3*122;
  11062. StrRect.bottom +=3*122;
  11063. str="结婚内容: 区 白 晚 押金:";
  11064. if(seldlg.m_bFrame) m_Print.DrawRect2(StrRect, 1);
  11065. StrRect.left +=4;
  11066. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11067. StrRect=load.m_rcarray .ElementAt (21);
  11068. StrRect.top +=3*122;
  11069. StrRect.bottom +=3*122;
  11070. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11071. str=" 新人签名:";
  11072. StrRect.left +=2;
  11073. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11074. StrRect=load.m_rcarray .ElementAt (22);
  11075. StrRect.top +=3*122;
  11076. StrRect.bottom +=3*122;
  11077. if(seldlg.m_bBooking)
  11078. {
  11079. if(seldlg.m_bFrame)
  11080. str="未付款:"+m_money3;
  11081. else
  11082. str=" "+m_money3;
  11083. }
  11084. else
  11085. {
  11086. if(seldlg.m_bFrame)
  11087. str="未付款:";
  11088. else
  11089. str=" ";
  11090. }
  11091. StrRect.left +=2;
  11092. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11093. StrRect=load.m_rcarray .ElementAt (23);
  11094. StrRect.top +=3*122;
  11095. StrRect.bottom +=3*122;
  11096. str="结婚秘书:";
  11097. StrRect.left +=2;
  11098. if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11099. StrRect=load.m_rcarray .ElementAt (24);
  11100. StrRect.top +=3*122;
  11101. StrRect.bottom +=3*122;
  11102. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11103. if(seldlg.m_bBooking)
  11104. {
  11105. StrRect.left +=3;
  11106. StrRect.top +=3;
  11107. StrRect.right -=2;
  11108. StrRect.bottom -=2;
  11109. realpos=0;str="";
  11110. for(i=0; i<sparray.GetSize (); i++)
  11111. {
  11112. if(atoi(sparray.ElementAt (i).ElementAt (4))!=2)continue;
  11113. str+=sparray.ElementAt (i).ElementAt (5);
  11114. str+=" 数量:";
  11115. str+=sparray.ElementAt (i).ElementAt (3);
  11116. if(realpos%2)
  11117. str+="\r\n";
  11118. else
  11119. str+=" ";
  11120. realpos++;
  11121. }
  11122. str.TrimRight ("\r\n");
  11123. str.TrimRight (" ");
  11124. AutoDraw(m_Print, StrRect, str, 1.4);
  11125. }
  11126. ///////////////////////////////////////
  11127. strarray.RemoveAll ();
  11128. if(seldlg.m_bFrame)
  11129. {
  11130. strarray.Add ("项目");
  11131. strarray.Add ("万");
  11132. strarray.Add ("千");
  11133. strarray.Add ("百");
  11134. strarray.Add ("十");
  11135. strarray.Add ("个");
  11136. strarray.Add ("收 银");
  11137. }
  11138. else
  11139. {
  11140. strarray.Add ("");
  11141. strarray.Add ("");
  11142. strarray.Add ("");
  11143. strarray.Add ("");
  11144. strarray.Add ("");
  11145. strarray.Add ("");
  11146. strarray.Add ("");
  11147. }
  11148. CStringArray strarray2;
  11149. float ftotal=0;
  11150. int realcount=0;
  11151. if(seldlg.m_bBooking)
  11152. {
  11153. for(i=0; i<bukuanarray.GetSize (); i++)
  11154. {
  11155. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=3 && atoi(bukuanarray.ElementAt (i).ElementAt (6))!=4)continue;
  11156. realcount++;
  11157. if(realcount>6)break;
  11158. str=bukuanarray.ElementAt (i).ElementAt (1);
  11159. ftotal+=atof(str);
  11160. strarray2.Add (GetW(str));
  11161. strarray2.Add (GetK(str));
  11162. strarray2.Add (GetB(str));
  11163. strarray2.Add (GetS(str));
  11164. strarray2.Add (GetG(str));
  11165. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11166. }
  11167. }
  11168. while(strarray2.GetSize ()<36)
  11169. strarray2.Add ("");
  11170. str.Format ("%f", ftotal);
  11171. strarray2.Add (GetW(str));
  11172. strarray2.Add (GetK(str));
  11173. strarray2.Add (GetB(str));
  11174. strarray2.Add (GetS(str));
  11175. strarray2.Add (GetG(str));
  11176. strarray2.Add ("");
  11177. //拍照
  11178. ftotal=0;
  11179. realcount=0;
  11180. if(seldlg.m_bTake)
  11181. {
  11182. for(i=0; i<bukuanarray.GetSize (); i++)
  11183. {
  11184. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=1)continue;
  11185. realcount++;
  11186. if(realcount>6)break;
  11187. str=bukuanarray.ElementAt (i).ElementAt (1);
  11188. ftotal+=atof(str);
  11189. strarray2.Add (GetW(str));
  11190. strarray2.Add (GetK(str));
  11191. strarray2.Add (GetB(str));
  11192. strarray2.Add (GetS(str));
  11193. strarray2.Add (GetG(str));
  11194. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11195. }
  11196. }
  11197. while(strarray2.GetSize ()<42+36)
  11198. strarray2.Add ("");
  11199. str.Format ("%f", ftotal);
  11200. strarray2.Add (GetW(str));
  11201. strarray2.Add (GetK(str));
  11202. strarray2.Add (GetB(str));
  11203. strarray2.Add (GetS(str));
  11204. strarray2.Add (GetG(str));
  11205. strarray2.Add ("");
  11206. //选片
  11207. ftotal=0;
  11208. realcount=0;
  11209. if(seldlg.m_bChoose)
  11210. {
  11211. for(i=0; i<bukuanarray.GetSize (); i++)
  11212. {
  11213. if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=2)continue;
  11214. realcount++;
  11215. if(realcount>6)break;
  11216. str=bukuanarray.ElementAt (i).ElementAt (1);
  11217. ftotal+=atof(str);
  11218. strarray2.Add (GetW(str));
  11219. strarray2.Add (GetK(str));
  11220. strarray2.Add (GetB(str));
  11221. strarray2.Add (GetS(str));
  11222. strarray2.Add (GetG(str));
  11223. strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
  11224. }
  11225. }
  11226. while(strarray2.GetSize ()<42*2+36)
  11227. strarray2.Add ("");
  11228. str.Format ("%f", ftotal);
  11229. strarray2.Add (GetW(str));
  11230. strarray2.Add (GetK(str));
  11231. strarray2.Add (GetB(str));
  11232. strarray2.Add (GetS(str));
  11233. strarray2.Add (GetG(str));
  11234. strarray2.Add ("");
  11235. /////////////////////////////
  11236. CRect temprc;
  11237. for(int n=0; n<4; n++)
  11238. {
  11239. StrRect=load.m_rcarray .ElementAt (17);
  11240. StrRect.top +=n*122;
  11241. StrRect.bottom +=n*122;
  11242. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11243. StrRect=load.m_rcarray .ElementAt (18);
  11244. if(n)
  11245. {
  11246. StrRect.left +=36;
  11247. StrRect.right +=36;
  11248. }
  11249. StrRect.top +=n*122;
  11250. StrRect.bottom +=n*122;
  11251. if(seldlg.m_bFrame)
  11252. str.Format("%d年", tm.GetYear ());
  11253. else
  11254. str.Format("%d ", tm.GetYear ());
  11255. 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))
  11256. {
  11257. if(seldlg.m_bFrame)
  11258. str=" 年";
  11259. else
  11260. str=" ";
  11261. }
  11262. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11263. StrRect=load.m_rcarray .ElementAt (19);
  11264. if(n)
  11265. {
  11266. StrRect.left +=38;
  11267. StrRect.right +=38;
  11268. }
  11269. StrRect.top +=n*122;
  11270. StrRect.bottom +=n*122;
  11271. if(seldlg.m_bFrame)
  11272. str.Format("%02d月", tm.GetMonth ());
  11273. else
  11274. str.Format("%02d ", tm.GetMonth ());
  11275. 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))
  11276. {
  11277. if(seldlg.m_bFrame)
  11278. str=" 月";
  11279. else
  11280. str=" ";
  11281. }
  11282. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11283. StrRect=load.m_rcarray .ElementAt (20);
  11284. if(n)
  11285. {
  11286. StrRect.left +=36;
  11287. StrRect.right +=36;
  11288. }
  11289. StrRect.top +=n*122;
  11290. StrRect.bottom +=n*122;
  11291. if(seldlg.m_bFrame)
  11292. str.Format("%02d日", tm.GetDay ());
  11293. else
  11294. str.Format("%02d ", tm.GetDay ());
  11295. 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))
  11296. {
  11297. if(seldlg.m_bFrame)
  11298. str=" 日";
  11299. else
  11300. str=" ";
  11301. }
  11302. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  11303. for(i=26; i<=32; i++)
  11304. {
  11305. StrRect=load.m_rcarray .ElementAt (i-1);
  11306. StrRect.bottom -=14;
  11307. for(int j=0; j<8; j++)
  11308. {
  11309. StrRect.top=StrRect.bottom;
  11310. if(j>2)
  11311. {
  11312. StrRect.bottom =StrRect.top+14;
  11313. }
  11314. else
  11315. {
  11316. StrRect.bottom =StrRect.top+13;
  11317. }
  11318. temprc=StrRect;
  11319. StrRect.top +=n*122;
  11320. StrRect.bottom +=n*122;
  11321. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11322. if(i==26 && j==4 && seldlg.m_bFrame)
  11323. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11324. else if(i==26 && j==5 && seldlg.m_bFrame)
  11325. m_Print.DrawText((LPTSTR)(LPCTSTR)"付款", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11326. else if(i==26 && j==7 && seldlg.m_bFrame)
  11327. m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11328. else if(j==0)
  11329. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-26), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11330. else if(j && i>26 && n<3)
  11331. {
  11332. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray2.ElementAt ((j-1)*6+(i-27)+n*42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11333. }
  11334. StrRect=temprc;
  11335. }
  11336. }
  11337. }
  11338. if(seldlg.m_bFrame)
  11339. {
  11340. StrRect=load.m_rcarray .ElementAt (32);
  11341. str="注\r\n意\r\n事\r\n项";
  11342. StrRect.top +=367;
  11343. StrRect.bottom +=367;
  11344. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11345. StrRect.top +=17;
  11346. StrRect.left +=2;
  11347. AutoDraw(m_Print, StrRect, str, 1.4);
  11348. StrRect=load.m_rcarray .ElementAt (33);
  11349. str="1: 本预约单自预定日期起一年内有效.定金在拍照套系金额中扣出.预定金一概不退\r\n\
  11350. 2: 多拍照片只供筛选.恕不奉送.版权所有.不得私自拷贝\r\n\
  11351. 3: 拍照款请于拍照时一次付清\r\n\
  11352. 4: 新娘装AM8:00前钟点费另计.婚纱礼服出租押金500-2000元\r\n\
  11353. 5: 本公司设有豪华VIP礼服区.及皇家御用礼服展区.但需另外加价.详情请咨本店人员\r\n\
  11354. 6: 安瓶, 美甲一次性化妆用具等均属增值服务部分,则需另外加价,详情咨询本店工作人员\r\n\
  11355. 7: 本电脑机械故障导致文件资料丢失.本公司只提供补拍服务\r\n\
  11356. 8: 每次前来请务必携带本单交给工作人员.本单是您在摩登新娘拍照的凭证.办理有关手续凭本单办理盖\r\n\
  11357. 章后方可生效";
  11358. StrRect.top +=367;
  11359. StrRect.bottom +=367;
  11360. if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
  11361. StrRect.top +=4;
  11362. StrRect.left +=2;
  11363. AutoDraw(m_Print, StrRect, str, 1.0);
  11364. StrRect=load.m_rcarray .ElementAt (34);
  11365. 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)";
  11366. AutoDraw(m_Print, StrRect, str, 1.0);
  11367. m_Print.SetFontFace(13, 1, "宋体");
  11368. StrRect=load.m_rcarray .ElementAt (35);
  11369. str="地 址: 汉口 . 解放大道 . 头道街东部购物公园C栋二,三层";
  11370. StrRect.top +=367;
  11371. StrRect.bottom +=367;
  11372. StrRect.left +=2;
  11373. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11374. StrRect=load.m_rcarray .ElementAt (36);
  11375. str="喜讯热线: 027-81888799 81888599 81888699";
  11376. StrRect.top +=367;
  11377. StrRect.bottom +=367;
  11378. StrRect.left +=2;
  11379. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11380. }
  11381. PrintPreview dlg;
  11382. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11383. dlg.m_pDC =m_Print.GetPDC() ;
  11384. if(dlg.DoModal ()!=IDOK)return;
  11385. //结束打印
  11386. m_Print.EndPage();
  11387. m_Print.EndPrint();
  11388. #endif
  11389. }
  11390. void CMainFrame::PrintReceipt3(CString strOrderNumber, CStringArray *pArray, float money)
  11391. {
  11392. int printcot=1;
  11393. for(int aa=0; aa<printcot; aa++)
  11394. {
  11395. g_sendhead.bsql=0;
  11396. g_sendhead.code[0]=24;
  11397. g_sendhead.tabcount=1;
  11398. int g_nYearposTemp=g_nYearpos;
  11399. g_nYearpos=-1;
  11400. g_pMainWnd->ProcessChatMessageRequest2(1);
  11401. g_nYearpos=g_nYearposTemp;
  11402. if(0==g_bSendOK)return;
  11403. DataToArray(&g_cominfoarray);
  11404. CString SerialNo;
  11405. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  11406. CPrintRX m_Print;
  11407. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11408. {
  11409. m_Print.InitToPrint(NULL, 1);
  11410. }
  11411. else
  11412. {
  11413. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  11414. if(name.IsEmpty ())
  11415. m_Print.InitToPrint(NULL, 1);
  11416. else
  11417. {
  11418. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11419. if(nret==-1 && aa==0)
  11420. {
  11421. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11422. }
  11423. }
  11424. }
  11425. m_Print.StartPrint();
  11426. m_Print.StartPage();
  11427. LoadRect load;
  11428. load.SetLiaPath ("15.lia");
  11429. load.SetMargins(0,0);
  11430. if(!load.Load ())return;
  11431. int i;
  11432. //////////////////////////////////////////////////////////////
  11433. CStringArray txarray;
  11434. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  11435. g_sendhead.code[0]=11;
  11436. g_sendhead.code[1]=52;
  11437. g_sendhead.tabcount=2;
  11438. g_sendhead.bsql=0;
  11439. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11440. CArray<CStringArray, CStringArray>sparray;
  11441. CArray<CStringArray, CStringArray>clientarray;
  11442. DataToArray(&g_List1array, &clientarray);
  11443. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11444. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11445. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11446. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11447. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11448. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11449. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11450. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11451. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11452. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11453. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11454. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11455. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11456. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11457. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11458. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11459. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11460. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11461. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11462. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11463. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11464. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11465. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11466. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11467. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11468. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11469. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11470. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11471. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11472. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11473. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11474. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  11475. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  11476. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11477. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11478. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  11479. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  11480. CString m_addr=m_addr1+";";
  11481. m_addr.TrimLeft (";");
  11482. m_addr+=m_addr2;
  11483. CString m_qq=m_qq1+";";
  11484. m_qq.TrimLeft (";");
  11485. m_qq+=m_qq2;
  11486. m_money1.Format ("%f", atof(m_taoxijiage));
  11487. m_money2.Format ("%f", atof(m_payed1));
  11488. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11489. ConvertToPrice(m_money1);
  11490. ConvertToPrice(m_money2);
  11491. ConvertToPrice(m_money3);
  11492. ////////////////////////////////////////////////////////////////
  11493. int rcpos=-1;
  11494. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11495. m_Print.SetFontFace(17, 1, "宋体");
  11496. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11497. StrRect.top -=0;
  11498. StrRect.bottom -=10;
  11499. StrRect.left -=140;
  11500. StrRect.right =StrRect.left+48;
  11501. m_Print.SetFontFace(15, 1, "宋体");
  11502. m_Print.SetColor(0xffffff);
  11503. m_Print.DrawRect(StrRect, 0);
  11504. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11505. StrRect.left =StrRect.right ;
  11506. StrRect.right =StrRect.left+48;
  11507. m_Print.DrawRect(StrRect, RGB(255,0,0));
  11508. m_Print.SetColor(0, RGB(255,0,0));
  11509. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11510. m_Print.SetColor(0);
  11511. m_Print.SetFontFace(12, 1, "宋体");
  11512. StrRect.left -=48;
  11513. int hei=StrRect.Height ();
  11514. StrRect.top =StrRect.bottom+2;
  11515. StrRect.bottom +=hei+2;
  11516. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11517. StrRect.top =StrRect.bottom-2;
  11518. StrRect.bottom +=hei-5;
  11519. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11520. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11521. m_Print.SetFontFace(12, 1, "宋体");
  11522. m_Print.DrawText((LPTSTR)(LPCTSTR)"收款单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11523. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11524. m_Print.SetFontFace(9, 1, "宋体");
  11525. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11526. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11527. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11528. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11529. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11530. m_Print.DrawRect2(StrRect, 2);
  11531. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11532. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11533. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11534. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11535. m_Print.DrawRect2(StrRect, 2);
  11536. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11537. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11538. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11539. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11540. m_Print.DrawRect2(StrRect, 2);
  11541. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11542. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11543. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11544. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11545. m_Print.DrawRect2(StrRect, 2);
  11546. ////////////
  11547. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11548. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11549. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11550. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11551. m_Print.DrawRect2(StrRect, 2);
  11552. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11553. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11554. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11555. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11556. m_Print.DrawRect2(StrRect, 2);
  11557. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11558. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11559. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11560. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11561. m_Print.DrawRect2(StrRect, 2);
  11562. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11563. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11564. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11565. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11566. m_Print.DrawRect2(StrRect, 2);
  11567. for( i=19; i<49; i++)
  11568. {
  11569. if(i>=44)
  11570. {
  11571. StrRect=load.m_rcarray .ElementAt (i-5);
  11572. int hei=StrRect.Height ();
  11573. StrRect.top +=hei;
  11574. StrRect.bottom +=hei;
  11575. }
  11576. else
  11577. StrRect=load.m_rcarray .ElementAt (i);
  11578. m_Print.DrawRect2(StrRect, 1);
  11579. }
  11580. float fmoney=0;
  11581. for( i=19; i<49; i++)
  11582. {
  11583. if(i>=44)
  11584. {
  11585. StrRect=load.m_rcarray .ElementAt (i-5);
  11586. int hei=StrRect.Height ();
  11587. StrRect.top +=hei;
  11588. StrRect.bottom +=hei;
  11589. }
  11590. else
  11591. StrRect=load.m_rcarray .ElementAt (i);
  11592. StrRect.left +=2;
  11593. /* if((i-19)%5==2)
  11594. {
  11595. fmoney+=atof(pArray->ElementAt (i-19));
  11596. }*/
  11597. m_Print.DrawText((LPTSTR)(LPCTSTR)(pArray->ElementAt (i-19)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11598. }
  11599. m_money2.Format ("%f", money);
  11600. ConvertToPrice(m_money2);
  11601. StrRect=load.m_rcarray .ElementAt (44);
  11602. CString str;
  11603. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 实收¥: %s 元 收银员: %s",\
  11604. GetHMoney(GetW(m_money2)),GetHMoney(GetK(m_money2)),GetHMoney(GetB(m_money2)),GetHMoney(GetS(m_money2)),GetHMoney(GetG(m_money2)),\
  11605. m_money2, g_user.name);
  11606. m_Print.DrawRect2(StrRect, 1);
  11607. StrRect.left +=3;
  11608. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11609. StrRect=load.m_rcarray .ElementAt (46);
  11610. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11611. StrRect=load.m_rcarray .ElementAt (47);
  11612. m_Print.DrawRect2(StrRect, 2);
  11613. StrRect=load.m_rcarray .ElementAt (48);
  11614. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11615. StrRect=load.m_rcarray .ElementAt (45);
  11616. str="\
  11617. 顾客须知\r\n\
  11618. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  11619. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  11620. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  11621. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  11622. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  11623. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  11624. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  11625. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  11626. AutoDraw(m_Print, StrRect, str, 1.8);
  11627. PrintPreview dlg;
  11628. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11629. dlg.m_pDC =m_Print.GetPDC() ;
  11630. if(aa==0)
  11631. {
  11632. if(dlg.DoModal ()!=IDOK)
  11633. return;
  11634. printcot=dlg.m_num;
  11635. }
  11636. //结束打印
  11637. m_Print.EndPage();
  11638. m_Print.EndPrint();
  11639. }
  11640. }
  11641. void CMainFrame::PrintReceipt2(CString strOrderNumber)
  11642. {
  11643. int printcot=1;
  11644. for(int aa=0; aa<printcot; aa++)
  11645. {
  11646. g_sendhead.bsql=0;
  11647. g_sendhead.code[0]=24;
  11648. g_sendhead.tabcount=1;
  11649. int g_nYearposTemp=g_nYearpos;
  11650. g_nYearpos=-1;
  11651. g_pMainWnd->ProcessChatMessageRequest2(1);
  11652. g_nYearpos=g_nYearposTemp;
  11653. if(0==g_bSendOK)return;
  11654. DataToArray(&g_cominfoarray);
  11655. CString SerialNo;
  11656. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
  11657. CPrintRX m_Print;
  11658. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  11659. {
  11660. m_Print.InitToPrint(NULL, 1);
  11661. }
  11662. else
  11663. {
  11664. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  11665. if(name.IsEmpty ())
  11666. m_Print.InitToPrint(NULL, 1);
  11667. else
  11668. {
  11669. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  11670. if(nret==-1 && aa==0)
  11671. {
  11672. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  11673. }
  11674. }
  11675. }
  11676. m_Print.StartPrint();
  11677. m_Print.StartPage();
  11678. LoadRect load;
  11679. load.SetLiaPath ("14.lia");
  11680. load.SetMargins(0,0);
  11681. if(!load.Load ())return;
  11682. int i;
  11683. //////////////////////////////////////////////////////////////
  11684. CStringArray txarray;
  11685. CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
  11686. g_sendhead.code[0]=11;
  11687. g_sendhead.code[1]=52;
  11688. g_sendhead.code[2]=93;
  11689. g_sendhead.tabcount=3;
  11690. g_sendhead.bsql=0;
  11691. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  11692. CArray<CStringArray, CStringArray>sparray;
  11693. CArray<CStringArray, CStringArray>clientarray;
  11694. CArray<CStringArray, CStringArray>moneyarray;
  11695. DataToArray(&g_List1array, &clientarray, &moneyarray);
  11696. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  11697. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  11698. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  11699. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  11700. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  11701. CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
  11702. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  11703. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  11704. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  11705. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  11706. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  11707. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  11708. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  11709. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  11710. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  11711. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  11712. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  11713. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  11714. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  11715. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  11716. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  11717. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  11718. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  11719. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  11720. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  11721. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  11722. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  11723. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  11724. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  11725. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  11726. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  11727. CString m_qq1=clientarray.ElementAt (0).ElementAt (5);
  11728. CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
  11729. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  11730. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  11731. CString m_birthday1=clientarray.ElementAt (0).ElementAt (11);
  11732. CString m_birthday2=clientarray.ElementAt (0).ElementAt (12);
  11733. CString m_addr=m_addr1+";";
  11734. m_addr.TrimLeft (";");
  11735. m_addr+=m_addr2;
  11736. CString m_qq=m_qq1+";";
  11737. m_qq.TrimLeft (";");
  11738. m_qq+=m_qq2;
  11739. m_money1.Format ("%f", atof(m_taoxijiage));
  11740. m_money2="0";
  11741. for( i=0; i<moneyarray.GetSize (); i++)
  11742. {
  11743. if(moneyarray.ElementAt (i).ElementAt (5)=="预约收款")
  11744. m_money2=moneyarray.ElementAt (i).ElementAt (1);
  11745. }
  11746. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  11747. ConvertToPrice(m_money1);
  11748. ConvertToPrice(m_money2);
  11749. ConvertToPrice(m_money3);
  11750. ////////////////////////////////////////////////////////////////
  11751. int rcpos=-1;
  11752. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  11753. m_Print.SetFontFace(17, 1, "宋体");
  11754. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11755. StrRect.top -=0;
  11756. StrRect.bottom -=10;
  11757. StrRect.left -=140;
  11758. StrRect.right =StrRect.left+48;
  11759. m_Print.SetFontFace(15, 1, "宋体");
  11760. m_Print.SetColor(0xffffff);
  11761. m_Print.DrawRect(StrRect, 0);
  11762. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11763. StrRect.left =StrRect.right ;
  11764. StrRect.right =StrRect.left+48;
  11765. m_Print.DrawRect(StrRect, RGB(255,0,0));
  11766. m_Print.SetColor(0, RGB(255,0,0));
  11767. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11768. m_Print.SetColor(0);
  11769. m_Print.SetFontFace(12, 1, "宋体");
  11770. StrRect.left -=48;
  11771. int hei=StrRect.Height ();
  11772. StrRect.top =StrRect.bottom+2;
  11773. StrRect.bottom +=hei+2;
  11774. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11775. StrRect.top =StrRect.bottom-2;
  11776. StrRect.bottom +=hei-5;
  11777. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  11778. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11779. m_Print.SetFontFace(12, 1, "宋体");
  11780. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约金单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11781. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11782. m_Print.SetFontFace(9, 1, "宋体");
  11783. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11784. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11785. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11786. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11787. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11788. m_Print.DrawRect2(StrRect, 2);
  11789. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11790. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11791. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11792. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11793. m_Print.DrawRect2(StrRect, 2);
  11794. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11795. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11796. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11797. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11798. m_Print.DrawRect2(StrRect, 2);
  11799. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11800. m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11801. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11802. m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11803. m_Print.DrawRect2(StrRect, 2);
  11804. ////////////
  11805. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11806. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11807. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11808. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11809. m_Print.DrawRect2(StrRect, 2);
  11810. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11811. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11812. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11813. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11814. m_Print.DrawRect2(StrRect, 2);
  11815. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11816. m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11817. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11818. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11819. m_Print.DrawRect2(StrRect, 2);
  11820. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11821. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11822. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11823. m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11824. m_Print.DrawRect2(StrRect, 2);
  11825. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11826. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11827. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11828. m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11829. m_Print.DrawRect2(StrRect, 2);
  11830. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11831. m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11832. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11833. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11834. m_Print.DrawRect2(StrRect, 2);
  11835. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11836. m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/MSN:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11837. StrRect=load.m_rcarray .ElementAt (++rcpos);
  11838. m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11839. m_Print.DrawRect2(StrRect, 2);
  11840. CStringArray strarray;
  11841. strarray.Add("套系名称");
  11842. strarray.Add("总 额");
  11843. strarray.Add("定 金");
  11844. strarray.Add("余 款");
  11845. strarray.Add("摄影日期");
  11846. strarray.Add(m_taoxiname);
  11847. strarray.Add(m_money1);
  11848. strarray.Add(m_money2);
  11849. strarray.Add(m_money3);
  11850. strarray.Add(m_time2);
  11851. for( i=25; i<37; i++)
  11852. {
  11853. StrRect=load.m_rcarray .ElementAt (i);
  11854. m_Print.DrawRect2(StrRect, 1);
  11855. }
  11856. for( i=25; i<35; i++)
  11857. {
  11858. StrRect=load.m_rcarray .ElementAt (i);
  11859. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-25), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  11860. }
  11861. StrRect=load.m_rcarray .ElementAt (35);
  11862. StrRect.left +=5;
  11863. StrRect.top +=5;
  11864. m_Print.DrawText((LPTSTR)(LPCTSTR)" 备 注:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
  11865. StrRect=load.m_rcarray .ElementAt (36);
  11866. CString str;
  11867. str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 ¥: %s 元 收银员: %s",\
  11868. GetHMoney(GetW(m_money2)),GetHMoney(GetK(m_money2)),GetHMoney(GetB(m_money2)),GetHMoney(GetS(m_money2)),GetHMoney(GetG(m_money2)),\
  11869. m_money2, g_user.name);
  11870. StrRect.left +=3;
  11871. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11872. StrRect=load.m_rcarray .ElementAt (38);
  11873. m_Print.DrawText((LPTSTR)(LPCTSTR)"营业员:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11874. StrRect=load.m_rcarray .ElementAt (39);
  11875. m_Print.DrawText((LPTSTR)(LPCTSTR)m_ren, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11876. m_Print.DrawRect2(StrRect, 2);
  11877. StrRect=load.m_rcarray .ElementAt (40);
  11878. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11879. StrRect=load.m_rcarray .ElementAt (41);
  11880. m_Print.DrawRect2(StrRect, 2);
  11881. StrRect=load.m_rcarray .ElementAt (42);
  11882. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  11883. StrRect=load.m_rcarray .ElementAt (37);
  11884. str="\
  11885. 顾客须知\r\n\
  11886. 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
  11887. 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
  11888. 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
  11889. 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
  11890. 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
  11891. 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
  11892. 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
  11893. 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  11894. AutoDraw(m_Print, StrRect, str, 1.8);
  11895. PrintPreview dlg;
  11896. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  11897. dlg.m_pDC =m_Print.GetPDC() ;
  11898. if(aa==0)
  11899. {
  11900. if(dlg.DoModal ()!=IDOK)
  11901. return;
  11902. printcot=dlg.m_num;
  11903. }
  11904. //结束打印
  11905. m_Print.EndPage();
  11906. m_Print.EndPrint();
  11907. }
  11908. }
  11909. void CMainFrame::OnAutodelphoto()
  11910. {
  11911. // TODO: Add your command handler code here
  11912. if(g_user.bLongin==0)
  11913. {
  11914. if(g_bNoLoginLia)
  11915. {
  11916. Login dlg;
  11917. dlg.SetLiaPath ("5.lia");
  11918. dlg.DoModal();
  11919. }
  11920. else
  11921. {
  11922. Login3 dlg;
  11923. dlg.SetLiaPath ("5.lia");
  11924. dlg.DoModal();
  11925. }
  11926. if(g_user.bLongin==0)return;
  11927. }
  11928. if(IsHasRightsnew(49)==0)return;
  11929. DelPhotoSet dlg;
  11930. dlg.DoModal ();
  11931. }
  11932. void CMainFrame::Onphotomanage()
  11933. {
  11934. // TODO: Add your command handler code here
  11935. if(g_user.bLongin==0)
  11936. {
  11937. if(g_bNoLoginLia)
  11938. {
  11939. Login dlg;
  11940. dlg.SetLiaPath ("5.lia");
  11941. dlg.DoModal();
  11942. }
  11943. else
  11944. {
  11945. Login3 dlg;
  11946. dlg.SetLiaPath ("5.lia");
  11947. dlg.DoModal();
  11948. }
  11949. if(g_user.bLongin==0)return;
  11950. }
  11951. if(IsHasRightsnew(49)==0)return;
  11952. ShowPic3 dlg;
  11953. dlg.DoModal ();
  11954. }
  11955. void CMainFrame::OnCompanyinfo()
  11956. {
  11957. // TODO: Add your command handler code here
  11958. if(g_user.bLongin==0)
  11959. {
  11960. if(g_bNoLoginLia)
  11961. {
  11962. Login dlg;
  11963. dlg.SetLiaPath ("5.lia");
  11964. dlg.DoModal();
  11965. }
  11966. else
  11967. {
  11968. Login3 dlg;
  11969. dlg.SetLiaPath ("5.lia");
  11970. dlg.DoModal();
  11971. }
  11972. if(g_user.bLongin==0)return;
  11973. }
  11974. if(IsHasRightsnew(49)==0)return;
  11975. CompanyInfo dlg;
  11976. dlg.DoModal ();
  11977. }
  11978. void CMainFrame::OnTaoxifg()
  11979. {
  11980. // TODO: Add your command handler code here
  11981. if(g_user.bLongin==0)
  11982. {
  11983. if(g_bNoLoginLia)
  11984. {
  11985. Login dlg;
  11986. dlg.SetLiaPath ("5.lia");
  11987. dlg.DoModal();
  11988. }
  11989. else
  11990. {
  11991. Login3 dlg;
  11992. dlg.SetLiaPath ("5.lia");
  11993. dlg.DoModal();
  11994. }
  11995. if(g_user.bLongin==0)return;
  11996. }
  11997. if(IsHasRightsnew(49)==0)return;
  11998. TXFG dlg;
  11999. dlg.DoModal ();
  12000. }
  12001. void CMainFrame::OnHelpfile()
  12002. {
  12003. // TODO: Add your command handler code here
  12004. // ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
  12005. // if(::PathFileExists (g_mainpath+"\\zx.dll"))
  12006. // ShellExecute(NULL, _T("open"), _T("www.zcsmkj.com"), "", NULL, SW_SHOWNORMAL);
  12007. // else
  12008. ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
  12009. }
  12010. void CMainFrame::OnPhotobak()
  12011. {
  12012. // TODO: Add your command handler code here
  12013. if(g_user.bLongin==0)
  12014. {
  12015. if(g_bNoLoginLia)
  12016. {
  12017. Login dlg;
  12018. dlg.SetLiaPath ("5.lia");
  12019. dlg.DoModal();
  12020. }
  12021. else
  12022. {
  12023. Login3 dlg;
  12024. dlg.SetLiaPath ("5.lia");
  12025. dlg.DoModal();
  12026. }
  12027. if(g_user.bLongin==0)return;
  12028. }
  12029. if(IsHasRightsnew(49)==0)return;
  12030. PhotoBak dlg;
  12031. dlg.DoModal ();
  12032. }
  12033. //客户报表
  12034. void CMainFrame::OnClose2()
  12035. { // TODO: Add your message handler code here and/or call default
  12036. if(AfxMessageBox("是否退出系统?", MB_YESNO|MB_ICONINFORMATION)!=IDYES)return;
  12037. WriteLog("退出系统");//Jeff.add
  12038. g_bShowBar=0;
  12039. if(m_Mdi.MainClose())
  12040. CMDIFrameWnd::OnClose();
  12041. }
  12042. //
  12043. void CMainFrame::ResetTimer()
  12044. {
  12045. }
  12046. void CMainFrame::LinkClick(CString str, int nParent)
  12047. {
  12048. g_pMainWnd2->m_bar.LinkClick(str);
  12049. }
  12050. void CMainFrame::PrintFlowChart2(CString m_id)
  12051. {
  12052. CPrintRX m_Print;
  12053. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12054. {
  12055. m_Print.InitToPrint(NULL, 1);
  12056. }
  12057. else
  12058. {
  12059. CString name=g_cominfoarray.ElementAt(0).ElementAt(64);
  12060. if(name.IsEmpty ())
  12061. m_Print.InitToPrint(NULL, 1);
  12062. else
  12063. {
  12064. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12065. if(nret==-1)
  12066. {
  12067. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12068. }
  12069. }
  12070. }
  12071. m_Print.StartPrint();
  12072. m_Print.StartPage();
  12073. LoadRect load;
  12074. load.SetLiaPath ("16.lia");
  12075. load.SetMargins(0,0);
  12076. if(!load.Load ())return;
  12077. LoadRect load2;
  12078. load2.SetLiaPath ("17.lia");
  12079. load2.SetMargins(0,660);
  12080. if(!load2.Load ())return;
  12081. int i;
  12082. //////////////////////////////////////////////////////////////
  12083. CStringArray txarray;
  12084. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and kind<>'2'";
  12085. g_sendhead.code[0]=11;
  12086. g_sendhead.code[1]=52;
  12087. g_sendhead.code[2]=223;
  12088. g_sendhead.tabcount=3;
  12089. g_sendhead.bsql=0;
  12090. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  12091. CArray<CStringArray, CStringArray>sparray;
  12092. CArray<CStringArray, CStringArray>clientarray;
  12093. DataToArray(&g_List1array, &clientarray, &sparray);
  12094. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  12095. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  12096. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  12097. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  12098. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  12099. CString m_photocount= g_List1array.ElementAt (0).ElementAt (9);
  12100. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  12101. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  12102. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  12103. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  12104. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  12105. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  12106. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  12107. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  12108. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  12109. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  12110. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  12111. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  12112. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  12113. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  12114. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  12115. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  12116. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  12117. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  12118. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  12119. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  12120. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  12121. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  12122. CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (39)+g_List1array.ElementAt (0).ElementAt (75);
  12123. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  12124. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  12125. CString spno;
  12126. for( i=0; i<sparray.GetSize (); i++)
  12127. {
  12128. // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12129. if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册" && sparray.ElementAt (i).ElementAt (5)!="入底")continue;
  12130. if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (5)=="入底"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
  12131. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  12132. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  12133. spno+=sparray.ElementAt (i).ElementAt (5);
  12134. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  12135. spno+="; ";
  12136. else
  12137. {
  12138. spno+=":";
  12139. spno+=sparray.ElementAt (i).ElementAt (6);
  12140. spno+="; ";
  12141. }
  12142. }
  12143. spno+=" 加挑:";
  12144. for( i=0; i<sparray.GetSize (); i++)
  12145. {
  12146. if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
  12147. if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
  12148. if(sparray.ElementAt (i).ElementAt (5)=="入底")continue;
  12149. if(sparray.ElementAt (i).ElementAt (5)=="底片光盘")continue;
  12150. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt (i).ElementAt (6)=="")continue;
  12151. spno+=sparray.ElementAt (i).ElementAt (5);
  12152. if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
  12153. spno+="; ";
  12154. else
  12155. {
  12156. spno+=":";
  12157. spno+=sparray.ElementAt (i).ElementAt (6);
  12158. spno+="; ";
  12159. }
  12160. }
  12161. if(spno.Right (6)==" 加挑:")
  12162. {
  12163. spno=spno.Left (spno.GetLength ()-6);
  12164. }
  12165. ////////////////////////////////////////////////////////////////
  12166. int rcpos=-1;
  12167. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12168. m_Print.SetFontFace(17, 1, "宋体");
  12169. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12170. StrRect.top -=0;
  12171. StrRect.bottom -=10;
  12172. StrRect.left -=140;
  12173. StrRect.right =StrRect.left+48;
  12174. m_Print.SetFontFace(15, 1, "宋体");
  12175. m_Print.SetColor(0xffffff);
  12176. m_Print.DrawRect(StrRect, 0);
  12177. m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12178. StrRect.left =StrRect.right ;
  12179. StrRect.right =StrRect.left+48;
  12180. m_Print.DrawRect(StrRect, RGB(255,0,0));
  12181. m_Print.SetColor(0, RGB(255,0,0));
  12182. m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12183. m_Print.SetColor(0);
  12184. m_Print.SetFontFace(12, 1, "宋体");
  12185. StrRect.left -=48;
  12186. int hei=StrRect.Height ();
  12187. StrRect.top =StrRect.bottom+2;
  12188. StrRect.bottom +=hei+2;
  12189. m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12190. StrRect.top =StrRect.bottom-2;
  12191. StrRect.bottom +=hei-5;
  12192. m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  12193. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12194. m_Print.SetFontFace(12, 1, "宋体");
  12195. m_Print.DrawText((LPTSTR)(LPCTSTR)"加做取件单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12196. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12197. m_Print.SetFontFace(11, 1, "宋体");
  12198. m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:"+m_id), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12199. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12200. m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12201. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12202. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12203. m_Print.DrawRect2(StrRect, 2);
  12204. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12205. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12206. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12207. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12208. m_Print.DrawRect2(StrRect, 2);
  12209. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12210. m_Print.DrawText((LPTSTR)(LPCTSTR)"选片日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12211. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12212. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time4, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12213. m_Print.DrawRect2(StrRect, 2);
  12214. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12215. m_Print.DrawText((LPTSTR)(LPCTSTR)"取件日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12216. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12217. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12218. m_Print.DrawRect2(StrRect, 2);
  12219. ////////////
  12220. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12221. m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12222. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12223. m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12224. m_Print.DrawRect2(StrRect, 2);
  12225. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12226. m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12227. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12228. m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12229. m_Print.DrawRect2(StrRect, 2);
  12230. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12231. m_Print.DrawText((LPTSTR)(LPCTSTR)"赠送张数:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12232. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12233. m_Print.DrawText((LPTSTR)(LPCTSTR)m_photocount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12234. m_Print.DrawRect2(StrRect, 2);
  12235. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12236. m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12237. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12238. m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12239. m_Print.DrawRect2(StrRect, 2);
  12240. ////////////
  12241. ///////////spno
  12242. CRect sprc[22];
  12243. StrRect=load.m_rcarray .ElementAt (19);
  12244. StrRect.left +=4;StrRect.right -=3;
  12245. hei=StrRect.Height ();
  12246. for(i=0; i<22; i++)
  12247. {
  12248. sprc[i]=StrRect;
  12249. m_Print.DrawRect2(StrRect, 1);
  12250. if(i==0)
  12251. {
  12252. StrRect.left +=5;
  12253. m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12254. StrRect.left -=5;
  12255. }
  12256. StrRect.top =StrRect.bottom ;
  12257. StrRect.bottom =StrRect.top +hei;
  12258. sprc[i].left +=4;sprc[i].right -=3;
  12259. }
  12260. StrRect.bottom =StrRect.top +60;
  12261. m_Print.DrawRect2(StrRect, 1);
  12262. StrRect.left +=3; StrRect.top +=3;
  12263. StrRect.right -=3; StrRect.bottom -=3;
  12264. AutoDraw(m_Print, StrRect, m_bz, 1.8);
  12265. CString temp,tempspno,tempbz;
  12266. CSize size;
  12267. BOOL bRun=0;
  12268. int fontsize=12;
  12269. ll: tempspno=spno;
  12270. m_Print.SetFontFace(fontsize, 1, "宋体");
  12271. for( i=1; i<22; i++)
  12272. {
  12273. if(!tempspno.IsEmpty ())
  12274. {
  12275. temp=tempspno;
  12276. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12277. int right=0;
  12278. CRect temprc=sprc[i];
  12279. while(size.cx>temprc.Width ())
  12280. {
  12281. right++;
  12282. temp=tempspno.Left (tempspno.GetLength ()-(right));
  12283. if(GIsHalfHZ(temp))
  12284. {
  12285. right++;
  12286. temp.Delete (temp.GetLength ()-1);
  12287. }
  12288. m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
  12289. }
  12290. if(bRun)
  12291. m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12292. tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
  12293. if(tempspno.IsEmpty ())i++;
  12294. }
  12295. }
  12296. if(tempspno.IsEmpty ()==0)//|| tempbz.IsEmpty ()==0)
  12297. {
  12298. fontsize--;
  12299. goto ll;
  12300. }
  12301. if(bRun==0)
  12302. {
  12303. bRun=1;
  12304. goto ll;
  12305. }
  12306. m_Print.SetFontFace(12, 1, "宋体");
  12307. StrRect=load2.m_rcarray .ElementAt (1);
  12308. m_Print.DrawText((LPTSTR)(LPCTSTR)"喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12309. StrRect=load2.m_rcarray .ElementAt (2);
  12310. m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12311. StrRect=load2.m_rcarray .ElementAt (3);
  12312. m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12313. StrRect=load2.m_rcarray .ElementAt (4);
  12314. m_Print.DrawRect2(StrRect, 2);
  12315. StrRect=load2.m_rcarray .ElementAt (0);
  12316. CString str="\
  12317. 爱心提示:如对制作有任何要求请清楚列出,所有制作内容一经确认将按要求制作。\r\n\
  12318. 选样文件从拍摄日期计算将保留二个月;套相成品按取件日期保留三个月,逾期不做保留。\r\n\
  12319. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
  12320. AutoDraw(m_Print, StrRect, str, 1.8);
  12321. PrintPreview dlg;dlg.m_mode=2;
  12322. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  12323. dlg.m_pDC =m_Print.GetPDC() ;
  12324. if(dlg.DoModal ()!=IDOK)return;
  12325. //结束打印
  12326. m_Print.EndPage();
  12327. m_Print.EndPrint();
  12328. }
  12329. //分店
  12330. CString CMainFrame::GetDanWei(CString name, CArray<CStringArray, CStringArray>*array)
  12331. {
  12332. for(int i=0; i<array->GetSize (); i++)
  12333. {
  12334. if(name==array->ElementAt (i).ElementAt (1) )
  12335. return array->ElementAt (i).ElementAt (2);
  12336. }
  12337. return "";
  12338. }
  12339. //g_sendhead
  12340. int CMainFrame::GetPort()
  12341. {
  12342. static int aaa=-1;
  12343. if(aaa==-1)
  12344. {
  12345. aaa=CTime::GetCurrentTime ().GetSecond ()%7;
  12346. }
  12347. aaa++;
  12348. if(aaa>=7)aaa=0;
  12349. return 8387+aaa;
  12350. }
  12351. void CMainFrame::OnShowBakState()
  12352. {
  12353. // TODO: Add your command handler code here
  12354. g_sendhead.bsql=0;
  12355. g_sendhead.code[0]=171;
  12356. g_sendhead.tabcount=1;
  12357. g_pMainWnd->ProcessChatMessageRequest2(1);
  12358. if(g_bSendOK==0)
  12359. {
  12360. return;
  12361. }
  12362. CArray<CStringArray, CStringArray>g_bakstatearray;
  12363. DataToArray(&g_bakstatearray);
  12364. while(g_bakstatearray.GetSize()>7)
  12365. {
  12366. g_bakstatearray.RemoveAt(0);
  12367. }
  12368. int photocount=0;
  12369. int infocount=0;
  12370. for(int i=0; i<g_bakstatearray.GetSize(); i++)
  12371. {
  12372. if(g_bakstatearray.ElementAt(i).ElementAt(1)!="1")photocount++;
  12373. if(g_bakstatearray.ElementAt(i).ElementAt(2)!="1")infocount++;
  12374. }
  12375. ShowBakState dlg;
  12376. dlg.m_pArray=&g_bakstatearray;
  12377. dlg.DoModal ();
  12378. }
  12379. void CMainFrame::PrintReceipt2(CStringArray *pArray)
  12380. {
  12381. int printcot=1;
  12382. for(int aa=0; aa<printcot; aa++)
  12383. {
  12384. g_sendhead.bsql=0;
  12385. g_sendhead.code[0]=24;
  12386. g_sendhead.tabcount=1;
  12387. int g_nYearposTemp=g_nYearpos;
  12388. g_nYearpos=-1;
  12389. g_pMainWnd->ProcessChatMessageRequest2(1);
  12390. g_nYearpos=g_nYearposTemp;
  12391. if(0==g_bSendOK)return;
  12392. DataToArray(&g_cominfoarray);
  12393. CString SerialNo;
  12394. SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127))+1);
  12395. CPrintRX m_Print;
  12396. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12397. {
  12398. m_Print.InitToPrint(NULL, 1);
  12399. }
  12400. else
  12401. {
  12402. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  12403. if(name.IsEmpty ())
  12404. m_Print.InitToPrint(NULL, 1);
  12405. else
  12406. {
  12407. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12408. if(nret==-1 && aa==0)
  12409. {
  12410. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12411. }
  12412. }
  12413. }
  12414. m_Print.StartPrint();
  12415. m_Print.StartPage();
  12416. LoadRect load;
  12417. BOOL bSmall=0;
  12418. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
  12419. {
  12420. bSmall=1;
  12421. load.SetLiaPath ("20.lia");
  12422. }
  12423. else
  12424. load.SetLiaPath ("10.lia");
  12425. if(bSmall)
  12426. load.SetMargins(-10,0);
  12427. else
  12428. load.SetMargins(10,0);
  12429. if(!load.Load ())return;
  12430. int rcpos=-1;
  12431. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12432. Image *pImg=NULL;
  12433. #ifdef MNLS_VERSION
  12434. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  12435. #else
  12436. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  12437. #endif
  12438. // m_Print.DrawImage(pImg, StrRect);
  12439. delete pImg;
  12440. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
  12441. {
  12442. Image *pImg=NULL;
  12443. g_nSendCode=31;
  12444. int g_nYearposTemp=g_nYearpos;
  12445. g_nYearpos=-1;
  12446. g_pMainWnd->ProcessChatMessageRequest2(1);
  12447. g_nYearpos=g_nYearposTemp;
  12448. g_nSendCode=0;
  12449. if(g_bSendOK==0)return;
  12450. ::LoadImageFromBuf (&pImg, g_pData, g_nLeng);
  12451. if(pImg)
  12452. {
  12453. StrRect.left=65;
  12454. if(bSmall)StrRect.left=55;
  12455. StrRect.top=10;
  12456. StrRect.right=StrRect.left+58;
  12457. StrRect.bottom=StrRect.top+58;
  12458. m_Print.DrawImage(pImg, StrRect);
  12459. delete pImg;pImg=NULL;
  12460. }
  12461. }
  12462. if(bSmall)
  12463. {
  12464. m_Print.SetFontFace(18, 1, "黑体");
  12465. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12466. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12467. m_Print.SetFontFace(9, 1, "宋体");
  12468. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12469. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12470. m_Print.SetFontFace(6, 1, "宋体");
  12471. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12472. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12473. m_Print.SetFontFace(9, 1, "宋体");
  12474. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12475. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12476. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12477. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12478. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12479. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12480. int hei=StrRect.Height ();
  12481. StrRect.bottom=StrRect.top;
  12482. StrRect.top -=8;
  12483. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12484. m_Print.SetFontFace(10, 1, "宋体");
  12485. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12486. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12487. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12488. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12489. m_Print.SetFontFace(9, 1, "宋体");
  12490. int i=7;
  12491. for(/*int*/ i=7; i<24; i++)
  12492. {
  12493. StrRect=load.m_rcarray .ElementAt (i);
  12494. m_Print.DrawRect2(StrRect, 1);
  12495. }
  12496. for( i=9; i<24; i++)
  12497. {
  12498. StrRect=load.m_rcarray .ElementAt (i);
  12499. StrRect.left +=2;
  12500. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12501. }
  12502. m_Print.SetFontFace(6, 1, "宋体");
  12503. for(i=24; i<26; i++)
  12504. {
  12505. StrRect=load.m_rcarray .ElementAt (i);
  12506. StrRect.left +=2;
  12507. if(i==24)
  12508. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12509. else
  12510. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12511. }
  12512. }
  12513. else//大单
  12514. {
  12515. m_Print.SetFontFace(20, 1, "黑体");
  12516. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12517. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12518. m_Print.SetFontFace(11, 1, "宋体");
  12519. // StrRect=load.m_rcarray .ElementAt (++rcpos);
  12520. // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12521. StrRect=load.m_rcarray .ElementAt (++rcpos);StrRect.right -=15;
  12522. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12523. int hei=StrRect.Height ();
  12524. StrRect.bottom=StrRect.top;
  12525. StrRect.top -=10;
  12526. m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
  12527. m_Print.SetFontFace(8, 1, "宋体");
  12528. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12529. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12530. m_Print.SetFontFace(11, 1, "宋体");
  12531. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12532. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12533. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12534. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12535. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12536. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12537. m_Print.SetFontFace(13, 1, "宋体");
  12538. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12539. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12540. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12541. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12542. m_Print.SetFontFace(11, 1, "宋体");
  12543. int i=7;
  12544. for(/*int*/ i=7; i<24; i++)
  12545. {
  12546. StrRect=load.m_rcarray .ElementAt (i);
  12547. m_Print.DrawRect2(StrRect, 1);
  12548. }
  12549. for( i=9; i<24; i++)
  12550. {
  12551. StrRect=load.m_rcarray .ElementAt (i);
  12552. StrRect.left +=2;
  12553. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12554. }
  12555. m_Print.SetFontFace(8, 1, "宋体");
  12556. for(i=24; i<27; i++)
  12557. {
  12558. StrRect=load.m_rcarray .ElementAt (i);
  12559. StrRect.left +=2;
  12560. m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12561. }
  12562. }
  12563. PrintPreview dlg;
  12564. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  12565. dlg.m_pDC =m_Print.GetPDC() ;
  12566. if(aa==0)
  12567. {
  12568. if(dlg.DoModal ()!=IDOK)
  12569. return;
  12570. printcot=dlg.m_num;
  12571. }
  12572. //结束打印
  12573. m_Print.EndPage();
  12574. m_Print.EndPrint();
  12575. SerialNo.Format ("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127))+1);
  12576. CString sql;
  12577. sql.Format("update version set [serialno2]='%s'", SerialNo);
  12578. g_sendhead.bsql=1;
  12579. g_nYearposTemp=g_nYearpos;
  12580. g_nYearpos=-1;
  12581. g_pMainWnd->ProcessChatMessageRequest2(sql);
  12582. g_nYearpos=g_nYearposTemp;
  12583. }
  12584. }
  12585. //出生年月
  12586. //第一联
  12587. void CMainFrame::OnLog()
  12588. {
  12589. // TODO: Add your command handler code here OnShowBakState
  12590. if(IsHasRightsnew(49)==0)return;
  12591. ShowLOg dlg;
  12592. dlg.DoModal ();
  12593. }
  12594. // www.lyfz.net 8888
  12595. void CMainFrame::PrintDinDan6(CString m_id)
  12596. {
  12597. // TODO: Add your control notification handler code here 预约订单
  12598. int printcot=1;
  12599. for(int aa=0; aa<printcot; aa++)
  12600. {
  12601. PrintPreview dlg;
  12602. CPrintRX m_Print;
  12603. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  12604. {
  12605. m_Print.InitToPrint(NULL, 1);
  12606. }
  12607. else
  12608. {
  12609. CString name=g_cominfoarray.ElementAt(0).ElementAt(63);
  12610. if(name.IsEmpty ())
  12611. m_Print.InitToPrint(NULL, 1);
  12612. else
  12613. {
  12614. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  12615. if(nret==-1 && aa==0)
  12616. {
  12617. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  12618. }
  12619. }
  12620. }
  12621. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(66))==3)
  12622. {
  12623. m_Print.StartPrint();
  12624. m_Print.StartPage();
  12625. LoadRect load;
  12626. load.SetLiaPath ("6.lia");
  12627. load.SetMargins(-14,15);
  12628. if(!load.Load ())return;
  12629. LoadRect load2;
  12630. load2.SetLiaPath ("7.lia");
  12631. load2.SetMargins(-14,216+15);
  12632. if(!load2.Load ())return;
  12633. LoadRect load3;
  12634. load3.SetLiaPath ("8.lia");
  12635. load3.SetMargins(-14,705+15);
  12636. if(!load3.Load ())return;
  12637. int i;
  12638. //////////////////////////////////////////////////////////////
  12639. CStringArray txarray;
  12640. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册' and name<>'入底';id='"+m_id+"';;";
  12641. g_sendhead.code[0]=11;
  12642. g_sendhead.code[1]=52;
  12643. g_sendhead.code[2]=50;
  12644. g_sendhead.code[3]=150;
  12645. g_sendhead.code[4]=77;
  12646. g_sendhead.code[5]=4;
  12647. g_sendhead.tabcount=6;
  12648. g_sendhead.bsql=0;
  12649. g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
  12650. CArray<CStringArray, CStringArray>sparray;
  12651. CArray<CStringArray, CStringArray>clientarray;
  12652. CArray<CStringArray, CStringArray>phonearray;
  12653. CArray<CStringArray, CStringArray>fgarray;
  12654. CArray<CStringArray, CStringArray>danweiarray;
  12655. CArray<CStringArray, CStringArray>jdarray;
  12656. DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
  12657. CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
  12658. CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
  12659. CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
  12660. CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
  12661. CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
  12662. CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
  12663. CString m_taoxiname;
  12664. if(m_zs.Find ("\\")!=-1)
  12665. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底\\入册:"+g_List1array.ElementAt (0).ElementAt (9);
  12666. else
  12667. m_taoxiname= g_List1array.ElementAt (0).ElementAt (7)+" 入底:"+g_List1array.ElementAt (0).ElementAt (9);
  12668. CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
  12669. CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
  12670. CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
  12671. CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
  12672. CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
  12673. CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
  12674. CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
  12675. CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
  12676. CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
  12677. CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
  12678. CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
  12679. CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
  12680. CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
  12681. CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
  12682. CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
  12683. CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
  12684. CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
  12685. CString m_style = g_List1array.ElementAt (0).ElementAt (30);
  12686. CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
  12687. CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
  12688. CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
  12689. CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
  12690. if(jdarray.GetSize ())
  12691. {
  12692. if(m_bz.IsEmpty ()==0)
  12693. m_bz="\r\n"+m_bz;
  12694. m_bz+="景点:";
  12695. }
  12696. for( i=0; i<jdarray.GetSize (); i++)
  12697. {
  12698. m_bz+=jdarray.ElementAt (i).ElementAt (1)+";";
  12699. }
  12700. m_bz.TrimRight (";");
  12701. CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
  12702. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  12703. if(IsHasRights2new(31)==0)
  12704. {
  12705. m_phone1="***";
  12706. m_phone2="***";
  12707. }
  12708. CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
  12709. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  12710. CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
  12711. CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
  12712. CString m_sex=clientarray.ElementAt (0).ElementAt (18);
  12713. CString m_birthday=clientarray.ElementAt (0).ElementAt (11);
  12714. filter="name='"+m_ren+"'";
  12715. g_sendhead.code[0]=5;
  12716. g_sendhead.tabcount=1;
  12717. g_sendhead.bsql=0;
  12718. int g_nYearposTemp=g_nYearpos;
  12719. g_nYearpos=-1;
  12720. g_pMainWnd->ProcessChatMessageRequest2(filter);
  12721. g_nYearpos=g_nYearposTemp;
  12722. if(g_bSendOK==0)return;
  12723. DataToArray(&phonearray);
  12724. m_money1.Format ("%f", atof(m_taoxijiage));
  12725. m_money2.Format ("%f", atof(m_payed1));
  12726. m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
  12727. ConvertToPrice(m_money1);
  12728. ConvertToPrice(m_money2);
  12729. ConvertToPrice(m_money3);
  12730. ////////////////////////////////////////////////////////////////
  12731. int rcpos=-1;
  12732. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  12733. StrRect.top -=15;StrRect.bottom -=15;
  12734. Image *pImg=NULL;
  12735. #ifdef MNLS_VERSION
  12736. LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
  12737. #else
  12738. ::LoadImageFromBuf (&pImg, g_mainpath+"\\图片\\logo.jpg");
  12739. #endif
  12740. m_Print.DrawImage(pImg, StrRect);
  12741. delete pImg;
  12742. m_Print.SetFontFace(11, 1, "宋体");
  12743. StrRect=load.m_rcarray .ElementAt (20);
  12744. StrRect.right=load.m_rcarray .ElementAt (23).right;
  12745. StrRect.top -=18;StrRect.bottom -=18;
  12746. CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
  12747. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12748. str="电话:"+g_cominfoarray.ElementAt (0).ElementAt (11);
  12749. m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12750. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12751. StrRect.top -=15;StrRect.bottom -=15;
  12752. #ifdef MNLS_VERSION
  12753. m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12754. #endif
  12755. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12756. StrRect.top -=15;StrRect.bottom -=15;
  12757. #ifdef MNLS_VERSION
  12758. m_Print.DrawRect(StrRect);
  12759. #endif
  12760. m_Print.SetFontFace(7, 1, "黑体");
  12761. m_Print.SetColor(0xffffff);
  12762. #ifdef MNLS_VERSION
  12763. m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12764. #endif
  12765. m_Print.SetColor(0);
  12766. m_Print.SetFontFace(15, 1, "宋体");
  12767. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12768. StrRect.top -=15;StrRect.bottom -=15;
  12769. m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同拍摄单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12770. CStringArray strarray;
  12771. strarray.Add("NO: "+m_id);
  12772. CString date;
  12773. date.Format ("%s年%s月%s日", g_date.Mid (0,4), g_date.Mid (5,2), g_date.Mid (8,2));
  12774. strarray.Add(date);
  12775. strarray.Add("喜爱");
  12776. strarray.Add("格调");
  12777. if(fgarray.GetSize ()==12)
  12778. {
  12779. for(int i=0; i<12; i++)
  12780. strarray.Add (fgarray.ElementAt (i).ElementAt (0));
  12781. }
  12782. else
  12783. {
  12784. strarray.Add("复古典雅");
  12785. strarray.Add("温文尔雅");
  12786. strarray.Add("豪华艳丽");
  12787. strarray.Add("传统大方");
  12788. strarray.Add("新潮个性");
  12789. strarray.Add("浪漫奔放");
  12790. strarray.Add("简单素雅");
  12791. strarray.Add("活泼俏丽");
  12792. strarray.Add("妩媚温馨");
  12793. strarray.Add("温柔贤惠");
  12794. strarray.Add("成熟感性");
  12795. strarray.Add("清纯可爱");
  12796. }
  12797. strarray.Add("姓名");
  12798. // strarray.Add("职业");
  12799. strarray.Add("");
  12800. strarray.Add("地址");
  12801. strarray.Add("电话");
  12802. #ifdef CHILD_VERSION
  12803. strarray.Add("家长");
  12804. strarray.Add("宝宝");
  12805. #else
  12806. strarray.Add("先生");
  12807. strarray.Add("女士");
  12808. #endif
  12809. m_Print.SetFontFace(11, 1, "宋体");
  12810. for( i=0; i<strarray.GetSize (); i++)
  12811. {
  12812. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12813. if(i<2)
  12814. {
  12815. StrRect.top -=15;StrRect.bottom -=15;
  12816. }
  12817. if(i>15)
  12818. m_Print.DrawRect2(StrRect, 1);
  12819. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12820. }
  12821. for( i=29; i<=40; i++)
  12822. {
  12823. if(m_style.GetLength ()<=(i-29))continue;
  12824. if(m_style.GetAt (i-29)!='1')continue;
  12825. StrRect=load.m_rcarray .ElementAt (i-1);
  12826. m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12827. }
  12828. for( i=27; i<=48; i++)
  12829. {
  12830. StrRect=load.m_rcarray .ElementAt (++rcpos);
  12831. m_Print.DrawRect2(StrRect, 1);
  12832. }
  12833. #ifdef CHILD_VERSION
  12834. StrRect=load.m_rcarray .ElementAt (45);
  12835. StrRect.right =StrRect.left +62;
  12836. m_Print.DrawRect2(StrRect, 1);
  12837. m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12838. StrRect.left =StrRect.right ;
  12839. StrRect.right =StrRect.left +62;
  12840. m_Print.DrawRect2(StrRect, 1);
  12841. m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12842. StrRect.left =StrRect.right ;
  12843. StrRect.right =StrRect.left +62;
  12844. m_Print.DrawRect2(StrRect, 1);
  12845. m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12846. StrRect.left =StrRect.right ;
  12847. StrRect.right =StrRect.left +62;
  12848. m_Print.DrawRect2(StrRect, 1);
  12849. m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12850. #endif
  12851. /////////////////////////
  12852. strarray.RemoveAll ();
  12853. CString temp;
  12854. temp.Format ("拍摄多款选 %d 款,其中影", atoi(m_outside)+atoi(m_outside2));
  12855. strarray.Add (temp);
  12856. temp.Format ("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
  12857. strarray.Add (temp);
  12858. strarray.Add ("化妆");
  12859. strarray.Add ("造型");
  12860. #ifdef CHILD_VERSION
  12861. strarray.Add ("");
  12862. #else
  12863. strarray.Add ("婚纱");
  12864. #endif
  12865. strarray.Add ("服饰");
  12866. strarray.Add ("配");
  12867. strarray.Add ("置");
  12868. strarray.Add ("其");
  12869. strarray.Add ("它");
  12870. strarray.Add ("套系名称");
  12871. strarray.Add ("镜款");
  12872. strarray.Add ("套系总价");
  12873. strarray.Add ("主摄影师");
  12874. strarray.Add ("拍摄日期");
  12875. strarray.Add ("预约金");
  12876. #ifdef CHILD_VERSION
  12877. strarray.Add ("主引导师");
  12878. #else
  12879. strarray.Add ("主化妆师");
  12880. #endif
  12881. strarray.Add ("看样日期");
  12882. strarray.Add ("补 余 款");
  12883. strarray.Add ("总监");
  12884. strarray.Add ("取件日期");
  12885. rcpos=-1;
  12886. for( i=0; i<strarray.GetSize (); i++)
  12887. {
  12888. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  12889. if(i>9)
  12890. m_Print.DrawRect2(StrRect, 1);
  12891. #ifdef CHILD_VERSION
  12892. if(i==5)
  12893. StrRect.top -=StrRect.Height ();
  12894. #endif
  12895. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  12896. }
  12897. for( i=22; i<=41; i++)
  12898. {
  12899. StrRect=load2.m_rcarray .ElementAt (++rcpos);
  12900. m_Print.DrawRect2(StrRect, 1);
  12901. }
  12902. /////////////////////////////
  12903. strarray.RemoveAll ();
  12904. #ifdef CHILD_VERSION
  12905. strarray.Add ("顾客方 家长:");
  12906. strarray.Add ("宝宝:");
  12907. #else
  12908. strarray.Add ("顾客方 先生:");
  12909. strarray.Add ("女士:");
  12910. #endif
  12911. strarray.Add ("电话:");
  12912. strarray.Add ("影楼方 店长:");
  12913. strarray.Add ("接单人:");
  12914. strarray.Add ("电话:");
  12915. rcpos=-1;
  12916. for( i=0; i<strarray.GetSize (); i++)
  12917. {
  12918. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  12919. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  12920. }
  12921. for( i=7; i<=12; i++)
  12922. {
  12923. StrRect=load3.m_rcarray .ElementAt (++rcpos);
  12924. // if(i!=10)
  12925. m_Print.DrawRect2(StrRect, 2);
  12926. }
  12927. //////////////////////////////////////
  12928. //开始打数据
  12929. strarray.RemoveAll ();
  12930. strarray.Add (m_name1);
  12931. strarray.Add (m_name2);
  12932. strarray.Add ("");
  12933. strarray.Add ("");
  12934. strarray.Add (m_addr1);
  12935. #ifdef CHILD_VERSION
  12936. strarray.Add ("");
  12937. #else
  12938. strarray.Add (m_addr2);
  12939. #endif
  12940. strarray.Add (m_phone1);
  12941. strarray.Add (m_phone2);
  12942. for( i=41; i<=48; i++)
  12943. {
  12944. StrRect=load.m_rcarray .ElementAt (i-1);
  12945. StrRect.left +=4;
  12946. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12947. }
  12948. ///////////////////////////////
  12949. strarray.RemoveAll ();
  12950. strarray.Add (m_money1);
  12951. strarray.Add (m_waiter1);
  12952. strarray.Add (m_time2);
  12953. strarray.Add (m_money2);
  12954. strarray.Add (m_waiter2);
  12955. strarray.Add (m_time4);
  12956. strarray.Add (m_money3);
  12957. strarray.Add ("");
  12958. strarray.Add (m_time5);
  12959. for( i=32; i<=40; i++)
  12960. {
  12961. StrRect=load2.m_rcarray .ElementAt (i-1);
  12962. StrRect.left +=4;
  12963. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12964. }
  12965. ///////////////////////////////
  12966. strarray.RemoveAll ();
  12967. strarray.Add ("");//m_name1);
  12968. strarray.Add ("");//m_name2);
  12969. CString phone;
  12970. if(m_phone1.IsEmpty ()==0)
  12971. phone=m_phone1+",";
  12972. phone+=m_phone2;
  12973. phone.TrimRight (",");
  12974. strarray.Add ("");//phone);
  12975. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (14));
  12976. strarray.Add (m_ren);
  12977. strarray.Add (g_cominfoarray.ElementAt (0).ElementAt (11));
  12978. for( i=7; i<=12; i++)
  12979. {
  12980. StrRect=load3.m_rcarray .ElementAt (i-1);
  12981. StrRect.left +=4;
  12982. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12983. }
  12984. StrRect=load2.m_rcarray .ElementAt (26);StrRect.left +=4;
  12985. m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12986. StrRect=load2.m_rcarray .ElementAt (27);StrRect.left +=4;
  12987. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12988. StrRect=load2.m_rcarray .ElementAt (28);StrRect.left +=4;
  12989. m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  12990. //////////////////////////////
  12991. //开始画文字
  12992. StrRect=load2.m_rcarray .ElementAt (30);
  12993. StrRect.left +=3;
  12994. StrRect.top +=3;
  12995. StrRect.right -=2;
  12996. StrRect.bottom -=2;
  12997. AutoDraw(m_Print, StrRect, m_bz, 1.4);
  12998. StrRect=load2.m_rcarray .ElementAt (29);
  12999. StrRect.left +=3;
  13000. StrRect.top +=3;
  13001. StrRect.right -=2;
  13002. StrRect.bottom -=2;
  13003. str="";
  13004. for(i=0; i<sparray.GetSize (); i++)
  13005. {
  13006. str+=sparray.ElementAt (i).ElementAt (5);
  13007. str+=" 数量:";
  13008. str+=sparray.ElementAt (i).ElementAt (3);
  13009. str+=GetDanWei(sparray.ElementAt (i).ElementAt (5), &danweiarray);
  13010. str+="\r\n";
  13011. }
  13012. str.TrimRight ("\r\n");
  13013. AutoDraw(m_Print, StrRect, str, 1.4);
  13014. StrRect=load2.m_rcarray .ElementAt (40);
  13015. StrRect.top +=8;
  13016. m_Print.SetFontFace(12, 1, "黑体");
  13017. m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
  13018. StrRect.left +=3;
  13019. StrRect.top +=30;
  13020. StrRect.right -=2;
  13021. StrRect.bottom -=2;
  13022. str=g_cominfoarray.ElementAt (0).ElementAt (37);
  13023. if(str.IsEmpty ())
  13024. {
  13025. str="\
  13026. 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
  13027. 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
  13028. 严谨的工作态度, 仔细阅读顾客须知.\r\n\
  13029. 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
  13030. 持良好的心境.\r\n\
  13031. 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
  13032. 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
  13033. 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
  13034. 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
  13035. 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
  13036. 勿进影室, 以免影响拍摄.\r\n\
  13037. 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
  13038. 师或店长沟通.\r\n\
  13039. 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
  13040. 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
  13041. 元. 其余照片和存底本影楼只保存__个月.\r\n\
  13042. 8. 配置内容应由所预约套系款数里挑选.\r\n\
  13043. 9. 本合同余额欠款须在拍照前付清.\r\n\
  13044. 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
  13045. 签名后视为有效合同. 预约__个月内有效, 预约金不退\
  13046. 还.";
  13047. }
  13048. AutoDraw(m_Print, StrRect, str, 1.8);
  13049. }
  13050. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13051. dlg.m_pDC =m_Print.GetPDC() ;
  13052. dlg.m_mode=1;
  13053. if(aa==0)
  13054. {
  13055. if(dlg.DoModal ()!=IDOK)
  13056. return;
  13057. printcot=dlg.m_num;
  13058. }
  13059. //结束打印
  13060. m_Print.EndPage();
  13061. m_Print.EndPrint();
  13062. }
  13063. }
  13064. void CMainFrame::InsideMsg()
  13065. {
  13066. ///内部消息
  13067. CString str;
  13068. g_sendhead.bsql=0;
  13069. g_sendhead.code[0]=126;
  13070. g_sendhead.tabcount=1;
  13071. g_bNoConnDlg=1;
  13072. g_pMainWnd->ProcessChatMessageRequest2(1);g_bNoConnDlg=0;
  13073. if(g_bSendOK==0)return;
  13074. CArray<CStringArray, CStringArray>m_List1array;
  13075. DataToArray(&g_List1array);//, &m_List1array);
  13076. int i = 0;
  13077. m_List1array.SetSize(g_List1array.GetSize ());
  13078. for(/*int*/ i=0; i<g_List1array.GetSize (); i++)
  13079. {
  13080. m_List1array.ElementAt (i).Copy (g_List1array.ElementAt (i));
  13081. }
  13082. str=","+g_user.name+",";
  13083. for( i=g_List1array.GetSize()-1; i>=0; i--)
  13084. {
  13085. CString receivers2=g_List1array.ElementAt (i).ElementAt (4);
  13086. receivers2.TrimLeft(",");
  13087. receivers2.TrimRight(",");
  13088. receivers2=","+receivers2+",";
  13089. CString receivers=g_List1array.ElementAt (i).ElementAt (3);
  13090. receivers.TrimLeft(",");
  13091. receivers.TrimRight(",");
  13092. receivers=","+receivers+",";
  13093. if(receivers.Find(str)==-1)
  13094. g_List1array.RemoveAt(i);
  13095. else if(receivers2.Find(str)!=-1)
  13096. g_List1array.RemoveAt(i);
  13097. }
  13098. if(g_List1array.GetSize())
  13099. {
  13100. ShowMsg dlg;
  13101. dlg.DoModal();
  13102. }
  13103. for( i=m_List1array.GetSize()-1; i>=0; i--)
  13104. {
  13105. CString receivers2=m_List1array.ElementAt (i).ElementAt (4);
  13106. receivers2.TrimLeft(",");
  13107. receivers2.TrimRight(",");
  13108. receivers2=","+receivers2+",";
  13109. CString receivers=m_List1array.ElementAt (i).ElementAt (3);
  13110. if(receivers!="")
  13111. m_List1array.RemoveAt(i);
  13112. else if(receivers2.Find(str)!=-1)
  13113. m_List1array.RemoveAt(i);
  13114. }
  13115. if(m_List1array.GetSize())
  13116. {
  13117. SendInsideMsg2 dlg;
  13118. dlg.m_bShow=1;
  13119. dlg.m_pArray=&m_List1array;
  13120. dlg.DoModal ();
  13121. }
  13122. }
  13123. //定金
  13124. void CMainFrame::PrintHireDress(CString m_id)
  13125. {
  13126. int printcot=1;
  13127. for(int aa=0; aa<printcot; aa++)
  13128. {
  13129. CPrintRX m_Print;
  13130. if(atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
  13131. {
  13132. m_Print.InitToPrint(NULL, 1);
  13133. }
  13134. else
  13135. {
  13136. CString name=g_cominfoarray.ElementAt(0).ElementAt(65);
  13137. if(name.IsEmpty ())
  13138. m_Print.InitToPrint(NULL, 1);
  13139. else
  13140. {
  13141. int nret=m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
  13142. if(nret==-1 && aa==0)
  13143. {
  13144. AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
  13145. }
  13146. }
  13147. }
  13148. m_Print.StartPrint();
  13149. m_Print.StartPage();
  13150. LoadRect load;
  13151. load.SetLiaPath ("21.lia");
  13152. load.SetMargins(0,0);
  13153. if(!load.Load ())return;
  13154. int i;
  13155. //////////////////////////////////////////////////////////////
  13156. CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
  13157. g_sendhead.bsql=0;
  13158. g_sendhead.code[0]=73;
  13159. g_sendhead.code[1]=74;
  13160. g_sendhead.code[2]=52;
  13161. g_sendhead.tabcount=3;
  13162. g_pMainWnd->ProcessChatMessageRequest2(filter);
  13163. if(g_bSendOK==0)
  13164. {
  13165. return ;
  13166. }
  13167. CArray<CStringArray, CStringArray>dresshirearray;
  13168. CArray<CStringArray, CStringArray>dresshiredataarray;
  13169. CArray<CStringArray, CStringArray>clientarray;
  13170. DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
  13171. if(dresshirearray.GetSize ()==0)return;
  13172. CString m_remark = dresshirearray.ElementAt (0).ElementAt (10);
  13173. CString m_date1 = dresshirearray.ElementAt (0).ElementAt (7);
  13174. CString m_date2 = dresshirearray.ElementAt (0).ElementAt (8);
  13175. CString m_inputdate = dresshirearray.ElementAt (0).ElementAt (6);
  13176. if(clientarray.GetSize ()==0)return ;
  13177. CString m_name2=clientarray.ElementAt (0).ElementAt (2);
  13178. CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
  13179. CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
  13180. CString m_time3=clientarray.ElementAt (0).ElementAt (20);
  13181. CString sItem;
  13182. for( i=0; i<dresshiredataarray.GetSize (); i++)
  13183. {
  13184. sItem+=dresshiredataarray.ElementAt (i).ElementAt (1);sItem+=" ";
  13185. sItem+=dresshiredataarray.ElementAt (i).ElementAt (2);
  13186. sItem+=" 数量:";
  13187. sItem+=dresshiredataarray.ElementAt (i).ElementAt (3)+"\r\n";
  13188. }
  13189. ////////////////////////////////////////////////////////////////
  13190. int rcpos=-1;
  13191. CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
  13192. m_Print.SetFontFace(17, 1, "宋体");
  13193. m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt (0).ElementAt (10)+"礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13194. StrRect=load.m_rcarray .ElementAt (++rcpos);
  13195. m_Print.SetFontFace(10, 1, "宋体");
  13196. m_Print.DrawText((LPTSTR)(LPCTSTR)(m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
  13197. CStringArray strarray;
  13198. strarray.Add("客户姓名");
  13199. strarray.Add("客户电话");
  13200. strarray.Add("预定日期");
  13201. strarray.Add("结婚日期");
  13202. strarray.Add("取件日期");
  13203. strarray.Add("归还日期");
  13204. strarray.Add("本店地址");
  13205. strarray.Add("电 话");
  13206. strarray.Add("客户地址");
  13207. strarray.Add("客户签名");
  13208. for( i=2; i<12; i++)
  13209. {
  13210. StrRect=load.m_rcarray .ElementAt (i);
  13211. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13212. }
  13213. strarray.RemoveAll();
  13214. strarray.Add(m_name2);
  13215. strarray.Add(m_phone2);
  13216. strarray.Add(m_inputdate);
  13217. strarray.Add(m_time3);
  13218. strarray.Add(m_date1);
  13219. strarray.Add(m_date2);
  13220. strarray.Add(g_cominfoarray.ElementAt (0).ElementAt (12));
  13221. strarray.Add(g_cominfoarray.ElementAt (0).ElementAt (11));
  13222. strarray.Add(m_addr2);
  13223. strarray.Add("");
  13224. for( i=12; i<22; i++)
  13225. {
  13226. StrRect=load.m_rcarray .ElementAt (i);
  13227. m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13228. m_Print.DrawRect2(StrRect, 2);
  13229. }
  13230. for( i=25; i<30; i++)
  13231. {
  13232. StrRect=load.m_rcarray .ElementAt (i);
  13233. m_Print.DrawRect2(StrRect, 1);
  13234. }
  13235. StrRect=load.m_rcarray .ElementAt (22);
  13236. StrRect.top +=7;
  13237. m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13238. StrRect=load.m_rcarray .ElementAt (23);
  13239. StrRect.top +=7;
  13240. m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13241. StrRect=load.m_rcarray .ElementAt (24);
  13242. StrRect.top +=7;
  13243. m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13244. StrRect=load.m_rcarray .ElementAt (25);StrRect.left +=75;StrRect.top +=5;
  13245. AutoDraw(m_Print, StrRect, sItem, 1.5);
  13246. StrRect=load.m_rcarray .ElementAt (26);StrRect.left +=75;StrRect.top +=5;
  13247. AutoDraw(m_Print, StrRect, m_remark, 1.5);
  13248. StrRect=load.m_rcarray .ElementAt (27);StrRect.left +=75;StrRect.top +=5;
  13249. CString str=(g_cominfoarray.ElementAt (0).ElementAt (132));
  13250. if(str.IsEmpty())
  13251. {
  13252. str="\
  13253. 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
  13254. 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
  13255. 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
  13256. 4. 如有破损酌情赔偿.";
  13257. }
  13258. AutoDraw(m_Print, StrRect, str, 1.5);
  13259. PrintPreview dlg;
  13260. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13261. dlg.m_pDC =m_Print.GetPDC() ;
  13262. if(aa==0)
  13263. {
  13264. if(dlg.DoModal ()!=IDOK)
  13265. return;
  13266. printcot=dlg.m_num;
  13267. }
  13268. //结束打印
  13269. m_Print.EndPage();
  13270. m_Print.EndPrint();
  13271. }
  13272. }
  13273. // ****************************************************************************
  13274. // Jeff:
  13275. // 函数:PrintHireDress2
  13276. // 无参;
  13277. // 调用者:DinDanFrom.cpp
  13278. // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
  13279. // 当订单数大于1000,设置连接公司服务器开关量为真;
  13280. // ****************************************************************************
  13281. void CMainFrame::PrintHireDress2()
  13282. {
  13283. if(g_ncot>1000)g_bSendLYFZ=1;
  13284. // g_pMainWnd->SetTimer (7, 3000, NULL);
  13285. }
  13286. void CMainFrame::PrintTakeForm2(CArray<CStringArray, CStringArray>*Listarray)
  13287. {
  13288. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"选片客人明细表";
  13289. int pages=Listarray->GetSize ()/46;
  13290. if(Listarray->GetSize ()%46)pages++;
  13291. for(int aa=0; aa<pages; aa++)
  13292. {
  13293. PrintPreview dlg;
  13294. CPrintRX m_Print;
  13295. m_Print.InitToPrint(NULL, 1);
  13296. m_Print.StartPrint();
  13297. m_Print.StartPage();
  13298. CRect mainrc(0,0,560,793);
  13299. float fscale;
  13300. {
  13301. int w,h;
  13302. m_Print.GetWidHei(w , h );
  13303. fscale=(float)w/(float)h;
  13304. }
  13305. mainrc.DeflateRect (25, 40, 10, 0);
  13306. CRect rc,rc2;
  13307. rc=mainrc;
  13308. rc.bottom =rc.top ;
  13309. rc.top -=20;
  13310. m_Print.SetFontFace(16, 1, "黑体");
  13311. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13312. m_Print.SetFontFace(9, 1, "宋体");
  13313. CString str;
  13314. int wid[5]={200,110,70,85,62};
  13315. int hei=16;
  13316. if(fscale>0.71)hei=15;
  13317. rc=mainrc;
  13318. rc.bottom =rc.top +hei;
  13319. for(int i=0; i<47; i++)
  13320. {
  13321. rc2.top =rc.top +i*hei;
  13322. rc2.bottom =rc.bottom +i*hei;
  13323. rc2.left =rc.left ;
  13324. rc2.right =rc.left +wid[0];
  13325. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13326. for(int j=0; j<5; j++)
  13327. {
  13328. m_Print.DrawRect2(rc2, 1);
  13329. if(Listarray->GetSize ()>aa*46+i)
  13330. {
  13331. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13332. rc2.left +=3;
  13333. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13334. rc2.left -=3;
  13335. }
  13336. rc2.left +=wid[j];
  13337. rc2.right =rc2.left+wid[j+1];
  13338. }
  13339. }
  13340. rc2.top +=2;
  13341. rc2.left +=2;rc2.right =mainrc.right+4;
  13342. m_Print.SetFontFace(8, 1, "宋体");
  13343. str.Format (" 页:%d/%d", aa+1, pages);
  13344. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13345. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13346. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13347. dlg.m_pDC =m_Print.GetPDC() ;
  13348. // dlg.m_mode=1;
  13349. if(aa==0)
  13350. {
  13351. if(dlg.DoModal ()!=IDOK)
  13352. return;
  13353. }
  13354. //结束打印
  13355. m_Print.EndPage();
  13356. m_Print.EndPrint();
  13357. }
  13358. }
  13359. void CMainFrame::PrintTakeForm3(CArray<CStringArray, CStringArray>*Listarray)
  13360. {
  13361. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"看设计客人明细表";
  13362. int pages=Listarray->GetSize ()/46;
  13363. if(Listarray->GetSize ()%46)pages++;
  13364. for(int aa=0; aa<pages; aa++)
  13365. {
  13366. PrintPreview dlg;
  13367. CPrintRX m_Print;
  13368. m_Print.InitToPrint(NULL, 1);
  13369. m_Print.StartPrint();
  13370. m_Print.StartPage();
  13371. CRect mainrc(0,0,560,793);
  13372. float fscale;
  13373. {
  13374. int w,h;
  13375. m_Print.GetWidHei(w , h );
  13376. fscale=(float)w/(float)h;
  13377. }
  13378. mainrc.DeflateRect (25, 40, 10, 0);
  13379. CRect rc,rc2;
  13380. rc=mainrc;
  13381. rc.bottom =rc.top ;
  13382. rc.top -=20;
  13383. m_Print.SetFontFace(16, 1, "黑体");
  13384. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13385. m_Print.SetFontFace(9, 1, "宋体");
  13386. CString str;
  13387. int wid[5]={200,110,70,85,62};
  13388. int hei=16;
  13389. if(fscale>0.71)hei=15;
  13390. rc=mainrc;
  13391. rc.bottom =rc.top +hei;
  13392. for(int i=0; i<47; i++)
  13393. {
  13394. rc2.top =rc.top +i*hei;
  13395. rc2.bottom =rc.bottom +i*hei;
  13396. rc2.left =rc.left ;
  13397. rc2.right =rc.left +wid[0];
  13398. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13399. for(int j=0; j<5; j++)
  13400. {
  13401. m_Print.DrawRect2(rc2, 1);
  13402. if(Listarray->GetSize ()>aa*46+i)
  13403. {
  13404. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13405. rc2.left +=3;
  13406. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13407. rc2.left -=3;
  13408. }
  13409. rc2.left +=wid[j];
  13410. rc2.right =rc2.left+wid[j+1];
  13411. }
  13412. }
  13413. rc2.top +=2;
  13414. rc2.left +=2;rc2.right =mainrc.right+4;
  13415. m_Print.SetFontFace(8, 1, "宋体");
  13416. str.Format (" 页:%d/%d", aa+1, pages);
  13417. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13418. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13419. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13420. dlg.m_pDC =m_Print.GetPDC() ;
  13421. // dlg.m_mode=1;
  13422. if(aa==0)
  13423. {
  13424. if(dlg.DoModal ()!=IDOK)
  13425. return;
  13426. }
  13427. //结束打印
  13428. m_Print.EndPage();
  13429. m_Print.EndPrint();
  13430. }
  13431. }
  13432. void CMainFrame::PrintTakeForm4(CArray<CStringArray, CStringArray>*Listarray)
  13433. {
  13434. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"取件客人明细表";
  13435. int pages=Listarray->GetSize ()/46;
  13436. if(Listarray->GetSize ()%46)pages++;
  13437. for(int aa=0; aa<pages; aa++)
  13438. {
  13439. PrintPreview dlg;
  13440. CPrintRX m_Print;
  13441. m_Print.InitToPrint(NULL, 1);
  13442. m_Print.StartPrint();
  13443. m_Print.StartPage();
  13444. CRect mainrc(0,0,560,793);
  13445. float fscale;
  13446. {
  13447. int w,h;
  13448. m_Print.GetWidHei(w , h );
  13449. fscale=(float)w/(float)h;
  13450. }
  13451. mainrc.DeflateRect (25, 40, 10, 0);
  13452. CRect rc,rc2;
  13453. rc=mainrc;
  13454. rc.bottom =rc.top ;
  13455. rc.top -=20;
  13456. m_Print.SetFontFace(16, 1, "黑体");
  13457. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13458. m_Print.SetFontFace(9, 1, "宋体");
  13459. CString str;
  13460. int wid[5]={200,110,70,85,62};
  13461. int hei=16;
  13462. if(fscale>0.71)hei=15;
  13463. rc=mainrc;
  13464. rc.bottom =rc.top +hei;
  13465. for(int i=0; i<47; i++)
  13466. {
  13467. rc2.top =rc.top +i*hei;
  13468. rc2.bottom =rc.bottom +i*hei;
  13469. rc2.left =rc.left ;
  13470. rc2.right =rc.left +wid[0];
  13471. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13472. for(int j=0; j<5; j++)
  13473. {
  13474. m_Print.DrawRect2(rc2, 1);
  13475. if(Listarray->GetSize ()>aa*46+i)
  13476. {
  13477. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13478. rc2.left +=3;
  13479. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13480. rc2.left -=3;
  13481. }
  13482. rc2.left +=wid[j];
  13483. rc2.right =rc2.left+wid[j+1];
  13484. }
  13485. }
  13486. rc2.top +=2;
  13487. rc2.left +=2;rc2.right =mainrc.right+4;
  13488. m_Print.SetFontFace(8, 1, "宋体");
  13489. str.Format (" 页:%d/%d", aa+1, pages);
  13490. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13491. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13492. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13493. dlg.m_pDC =m_Print.GetPDC() ;
  13494. // dlg.m_mode=1;
  13495. if(aa==0)
  13496. {
  13497. if(dlg.DoModal ()!=IDOK)
  13498. return;
  13499. }
  13500. //结束打印
  13501. m_Print.EndPage();
  13502. m_Print.EndPrint();
  13503. }
  13504. }
  13505. void CMainFrame::PrintTakeForm5(CArray<CStringArray, CStringArray>*Listarray)
  13506. {
  13507. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"婚庆客人明细表";
  13508. int pages=Listarray->GetSize ()/46;
  13509. if(Listarray->GetSize ()%46)pages++;
  13510. for(int aa=0; aa<pages; aa++)
  13511. {
  13512. PrintPreview dlg;
  13513. CPrintRX m_Print;
  13514. m_Print.InitToPrint(NULL, 1);
  13515. m_Print.StartPrint();
  13516. m_Print.StartPage();
  13517. CRect mainrc(0,0,560,793);
  13518. float fscale;
  13519. {
  13520. int w,h;
  13521. m_Print.GetWidHei(w , h );
  13522. fscale=(float)w/(float)h;
  13523. }
  13524. mainrc.DeflateRect (25, 40, 10, 0);
  13525. CRect rc,rc2;
  13526. rc=mainrc;
  13527. rc.bottom =rc.top ;
  13528. rc.top -=20;
  13529. m_Print.SetFontFace(16, 1, "黑体");
  13530. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13531. m_Print.SetFontFace(8, 1, "宋体");
  13532. CString str;
  13533. int wid[7]={165,90,90,45,45,60,35};
  13534. int hei=16;
  13535. if(fscale>0.71)hei=15;
  13536. rc=mainrc;
  13537. rc.bottom =rc.top +hei;
  13538. for(int i=0; i<47; i++)
  13539. {
  13540. rc2.top =rc.top +i*hei;
  13541. rc2.bottom =rc.bottom +i*hei;
  13542. rc2.left =rc.left ;
  13543. rc2.right =rc.left +wid[0];
  13544. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13545. for(int j=0; j<7; j++)
  13546. {
  13547. m_Print.DrawRect2(rc2, 1);
  13548. if(Listarray->GetSize ()>aa*46+i)
  13549. {
  13550. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13551. rc2.left +=3;
  13552. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13553. rc2.left -=3;
  13554. }
  13555. rc2.left +=wid[j];
  13556. rc2.right =rc2.left+wid[j+1];
  13557. }
  13558. }
  13559. rc2.top +=2;
  13560. rc2.left +=2;rc2.right =mainrc.right+4;
  13561. m_Print.SetFontFace(8, 1, "宋体");
  13562. str.Format (" 页:%d/%d", aa+1, pages);
  13563. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13564. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13565. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13566. dlg.m_pDC =m_Print.GetPDC() ;
  13567. // dlg.m_mode=1;
  13568. if(aa==0)
  13569. {
  13570. if(dlg.DoModal ()!=IDOK)
  13571. return;
  13572. }
  13573. //结束打印
  13574. m_Print.EndPage();
  13575. m_Print.EndPrint();
  13576. }
  13577. }
  13578. void CMainFrame::PrintTakeForm1(CArray<CStringArray, CStringArray>*Listarray)
  13579. {
  13580. CString title=g_cominfoarray.ElementAt (0).ElementAt (10)+"拍照客人明细表";
  13581. int pages=Listarray->GetSize ()/46;
  13582. if(Listarray->GetSize ()%46)pages++;
  13583. for(int aa=0; aa<pages; aa++)
  13584. {
  13585. PrintPreview dlg;
  13586. CPrintRX m_Print;
  13587. m_Print.InitToPrint(NULL, 1);
  13588. m_Print.StartPrint();
  13589. m_Print.StartPage();
  13590. CRect mainrc(0,0,560,793);
  13591. float fscale;
  13592. {
  13593. int w,h;
  13594. m_Print.GetWidHei(w , h );
  13595. fscale=(float)w/(float)h;
  13596. }
  13597. mainrc.DeflateRect (25, 40, 10, 0);
  13598. CRect rc,rc2;
  13599. rc=mainrc;
  13600. rc.bottom =rc.top ;
  13601. rc.top -=20;
  13602. m_Print.SetFontFace(16, 1, "黑体");
  13603. m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
  13604. m_Print.SetFontFace(8, 1, "宋体");
  13605. CString str;
  13606. int wid[7]={165,60,90,60,60,60,35};
  13607. int hei=16;
  13608. if(fscale>0.71)hei=15;
  13609. rc=mainrc;
  13610. rc.bottom =rc.top +hei;
  13611. for(int i=0; i<47; i++)
  13612. {
  13613. rc2.top =rc.top +i*hei;
  13614. rc2.bottom =rc.bottom +i*hei;
  13615. rc2.left =rc.left ;
  13616. rc2.right =rc.left +wid[0];
  13617. if( (!(Listarray->GetSize ()>aa*46+i)) || i==46)break;
  13618. for(int j=0; j<7; j++)
  13619. {
  13620. m_Print.DrawRect2(rc2, 1);
  13621. if(Listarray->GetSize ()>aa*46+i)
  13622. {
  13623. str=Listarray->ElementAt (aa*46+i).ElementAt (j);
  13624. rc2.left +=3;
  13625. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
  13626. rc2.left -=3;
  13627. }
  13628. rc2.left +=wid[j];
  13629. rc2.right =rc2.left+wid[j+1];
  13630. }
  13631. }
  13632. rc2.top +=2;
  13633. rc2.left +=2;rc2.right =mainrc.right+4;
  13634. m_Print.SetFontFace(8, 1, "宋体");
  13635. str.Format (" 页:%d/%d", aa+1, pages);
  13636. str="制表:"+g_user.name+" 日期:"+g_date+str;
  13637. m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
  13638. m_Print.GetWidHei(dlg.m_w , dlg.m_h );
  13639. dlg.m_pDC =m_Print.GetPDC() ;
  13640. // dlg.m_mode=1;
  13641. if(aa==0)
  13642. {
  13643. if(dlg.DoModal ()!=IDOK)
  13644. return;
  13645. }
  13646. //结束打印
  13647. m_Print.EndPage();
  13648. m_Print.EndPrint();
  13649. }
  13650. }
  13651. void CMainFrame::ShowMonthForm2()
  13652. {
  13653. }
  13654. // dlg;