123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549 |
- // MainFrm.cpp : implementation of the CMainFrame class 员工工作
- #include "stdafx.h"
- #include "YLGL.h"
- #include "resource.h"
- #include "MainFrm.h"
- #include <afxinet.h>
- #include "ConnectDlg.h"
- #include "SendDataDlg.h"
- #include "DinDanHistroy.h"
- #include "ShangPin.h"
- #include "SPLBDlg.h"
- #include "BuMenDlg.h"
- #include "Worker.h"
- #include "ShowPic3.h"
- #include "TXDlg.h"
- #include "TXSPDlg.h"
- #include "MsgReg2.h"
- #include "ProviderDlg.h"
- #include "Booking.h"
- #include "Booking2.h"
- #include "PayOutSet.h"
- #include "PayOutInput.h"
- #include "IncomeInput.h"
- #include "IncomeInput2.h"
- #include "IncomeInput3.h"
- #include "IncomeInput4.h"
- #include "DressEarlyWarning.h"
- #include "DailyForm.h"
- #include "MonthForm.h"
- #include "ProcessAlarm.h"
- #include "MonthForm2.h"
- #include "YearForm.h"
- #include "ClientForm.h"
- #include "ClientForm2.h"
- #include "ClientForm3.h"
- #include "DinDanFrom.h"
- #include "Satisfaction.h"
- //#include "SatisfactionForm.h"
- #include "SatisfactionReportForm.h"
- #include "TodayForm.h"
- #include "TodayForm2.h"
- #include "SendInsideMsg2.h"
- #include "StoreInfoChart.h"
- #include "FixedAssets.h"
- #include "SPForm.h"
- #include "ShowMsg.h"
- #include "Account.h"
- #include "Login.h"
- #include "Login3.h"
- #include "Psw.h"
- #include "AreaDlg.h"
- #include "TakeFrom.h"
- #include "ChoosePhotoForm.h"
- #include "BeautifySkinFrom.h"
- #include "DesignFrom.h"
- #include "outsourcing.h"
- #include "ChoosePhotoSkin.h"
- #include "SalarySet.h"
- #include "SalarySet2.h"
- #include "MySalary.h"
- #include "PrintRX.h"
- #include "LoadRect.h"
- #include "PrintPreview.h"
- #include "SearchClient.h"
- #include "BeautifySkinFrom2.h"
- #include "FinanceForm.h"
- #include "PhotoPrintFrom.h"
- //#include "SqlDlg.h"
- #include "YearForm2.h"
- #include "AreaClient.h"
- #include "DBConfig.h"
- #include "SetPathDlg2.h"
- #include "StaffAchievement.h"
- #include "BurnCD.h"
- #include "StaffAchievementSet.h"
- #include "StaffAchievementShowAll.h"
- #include "SelContent.h"
- #include "ClientMoney.h"
- #include "DelPhotoSet.h"
- #include "ompanyInfo.h"
- #include "ClientForm.h"
- #include "PhotoBak.h"
- #include "MsgReg.h"
- #include "SendMsg.h"
- #include "MsgSet.h"
- #include "ShowMember.h"
- #include "ShowMember2.h"
- #include "MemberSet.h"
- #include "DressManage.h"
- #include "ShowDress.h"
- #include "ShowPic.h"
- #include "ShowHireReg.h"
- #include "InputGoods.h"
- #include "ShowGoods.h"
- #include "CostCal.h"
- #include "Welcome.h"
- #include "EmployeeMsg.h"
- #include "TXFG.h"
- #include "EmployeeForm.h"
- #include "EmployeeForm2.h"
- #include "Client2Form.h"
- #include "Client2FormLYFZ.h"
- #include "OldClient.h"
- #include "ClientReasonChart.h"
- #include "ClientFromChart.h"
- #include "WorkMsg.h"
- #include "SetLoginTime.h"
- #include "SetLoginBan.h"
- #include "LoginReg.h"
- #include "LoginReg2.h"
- #include "PhoneRecord.h"
- #include "PhoneRecordOut.h"
- #include "MissCall.h"
- #include "InsideMsg.h"
- #include "Card2Reg.h"
- #include "Card2RegChart.h"
- #include "ShowMemberBlue.h"
- #include "Card2RegBlue.h"
- #include "Card2RegChartBlue.h"
- #include "DigitalWork.h"
- #include "HideWindow.h"
- #include "SalarySet3.h"
- #include "YearFormBranch.h"
- #include "YearFormBranch2.h"
- #include "Set.h"
- #include "DinDanFromBranch.h"
- #include "MemberChart.h"
- #include "ShowMemberMsg.h"
- #include "ShowBakState.h"
- #include "DinDanForm.h"
- #include "CalendarConvert.h"
- #include "ShowLOg.h"
- #include "HospitalClient.h"
- #include "HospitalClientAlarm.h"
- #include "HospitalInfoSet.h"
- #include "AddHospitalClient.h"
- #include "HospitalClientMsg.h"
- #ifndef VC60
- #include "msgId_def.h"
- #include "struct_def.h"
- #endif //#ifndef VC60
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- #ifndef WINVER
- #define WINVER 0x0400
- #endif
- #ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0400
- #endif
- #ifndef _WIN32_WINDOWS
- #define _WIN32_WINDOWS 0x0410
- #endif
- #ifndef _WIN32_IE
- #define _WIN32_IE 0x0400
- #endif
- #include "uxtheme.h "
- typedef HTHEME(__stdcall * POPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
- typedef HRESULT(__stdcall * PCLOSETHEMEDATA)(HTHEME hTheme);
- HHOOK g_hmouse = NULL; //g_sendhead zx.dll
- //extern void WriteTextLog(CString str); // Jeff写客户端日志;
- // Jeff.remark;
- // 函数:MouseProc
- // 参数:
- // nCode hook code
- // wParam message identifier
- // lParam mouse coordinates
- // 返回:
- //
- LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
- {
- if (g_pMainWnd)
- {
- if(g_cominfoarray.GetSize() > 0)
- {
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134)) > 0)
- {
- g_pMainWnd->KillTimer(5);
- g_pMainWnd->SetTimer(5, atoi(g_cominfoarray.ElementAt(0).ElementAt(134)) * 60 * 1000, NULL);
- }
- }
- if (g_bSendLYFZ)
- {
- g_pMainWnd->KillTimer(7);
- g_pMainWnd->SetTimer(7, 5 * 60 * 1000, NULL);
- }
- }
- return CallNextHookEx(g_hmouse, nCode, wParam, lParam);
- }
- CRect g_rc; // 屏幕坐标值,区域是放置对话框。
- CMainFrame *g_pMainWnd = NULL;
- extern HWND g_hSendWnd;
- extern HWND g_hConnectWnd;
- //extern CString newGUID();
- #ifdef USE_KERNEL_DLL
- /************************************************************************/
- /*
- 函数:kernelCallback
- 描述:kernel.dll的回调函数;
- 参数:
- lpStrBranchId: 域名;
- lpStrOrder: 订单号;
- dwImgType: 相片类型;
- dwImgNum: 重命名使用,返回的相片编号;
- lpStrImg: IncrementalBack表使用的content字段内容,指定备份文件名的相片;
- lpStrImgExt: IncrementalBack表使用的backupExt字段内容,指定要备份的扩展名相片;
- 返回:void
- */
- /************************************************************************/
- #include "ImportPhoto.h"
- // 导入原片、初修、精修、设计结束后的回调函数(三合一);
- void CALLBACK ImgImportMergeCallback(IN LPCTSTR lpStrBranchId, IN LPCTSTR lpStrOrderNum, IN CONST INT& dwImgType, IN CONST DWORD& dwImgNum, IN LPCTSTR lpStrImgs, IN LPCTSTR lpStrImgExt)
- {
- AfxSetResourceHandle(g_Instance);
- // 1.判断参数有效性;
- if (lpStrBranchId == NULL || !strstr(lpStrBranchId, _T(".ly.com")) || lpStrOrderNum == NULL || _tcscmp(lpStrOrderNum, _T("")) == 0)
- {
- OutputDebugString(_T("回调函数参数(域名、订单号)无效\n"));
- return;
- }
- // 2.是否需要备份分店相片;
- BOOL bIsNeedBranchImg = FALSE;
- switch (dwImgType)
- {
- case 1://是否备份分店原片;
- bIsNeedBranchImg = g_ThisShopVersion.bUpLoadCheck1;
- break;
- case 2://是否备份分店修片;
- bIsNeedBranchImg = g_ThisShopVersion.bUpLoadCheck2;
- break;
- case 3://是否备份分店精修;
- bIsNeedBranchImg = g_ThisShopVersion.bUpLoadCheck3;
- break;
- case 4://是否备份分店设计;
- bIsNeedBranchImg = g_ThisShopVersion.bUpLoadCheck4;
- break;
- default:
- OutputDebugString(_T("未知相片类型!\n"));
- break;
- }
- // 3.同时更新IncrementalBack表;
- CString strSQLInsert = _T("");
- strSQLInsert.Format(INSERT_INCREMENT, 0, lpStrBranchId, CTime::GetCurrentTime().Format("%Y-%m-%d %H:%M:%S"), lpStrOrderNum, dwImgType, lpStrImgs, g_user.account, g_user.name);
- // 4.连接服务器,更新dindan和IncrementalBackup;
- g_sendhead.bsql = 1;
- if (g_bAllBranch)
- {// 多店汇总时;
- g_branchip = GetBranchIPbyId(lpStrBranchId);
- g_pMainWnd->OnDisconnect();
- g_branchname = GetBranchNamebyId(lpStrBranchId);
- g_bBranchModify = 1;
- if (dwImgType == OImgtype)
- {// 如果导入的是原片;
- CString strSQL = _T("");
- strSQL.Format(_T("update dindan set curno = '%d' where id = '%s' ***%s"), dwImgNum, lpStrOrderNum, strSQLInsert);
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- }
- else
- {//导入的不是原片;
- g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
- }
- // 如果连接服务器失败,要记录下来;
- // if () .........
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- g_branchip = g_branchname = _T("");
- if (g_domain.CompareNoCase(lpStrBranchId) != 0 && bIsNeedBranchImg)
- {// 如果不是本店,且本店设置中需要备份分店相片,需要向本店添加导入相片记录;
- g_sendhead.bsql = 1;
- g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- }
- }
- else
- {// 连接本店或分店时;
- if (dwImgType == OImgtype)
- {// 如果导入的是原片;
- CString strSQL = _T("");
- strSQL.Format(_T("update dindan set curno = '%d' where id = '%s' ***%s"), dwImgNum, lpStrOrderNum, strSQLInsert);
- g_pMainWnd->ProcessChatMessageRequest2(strSQL);
- }
- else
- {//导入的不是原片;
- g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
- }
- if (g_domain.CompareNoCase(lpStrBranchId) != 0 && bIsNeedBranchImg)
- {// 如果不是本店,且本店设置中需要备份分店相片,需要向本店添加导入相片记录;
- #if 1
- ::SendMessage(g_pMainWnd->m_hWnd, MSG_KERNEL_SENDMSG, (WPARAM)lpStrBranchId, (LPARAM)&strSQLInsert);
- #else // 可能是VC6.0与VC9.0间DLL调用产生的问题,下面代码执行时会出错;
- // 如果连接的是分店,断开分店,回连本店;
- g_bBranchModify = FALSE;
- g_pMainWnd->OnDisconnect();
- g_branchname = g_branchip = _T("");
- g_sendhead.bsql = 1;
- g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
- g_pMainWnd->OnDisconnect();
- // 设置回分店连接;
- g_branchip = GetBranchIPbyId(lpStrBranchId);
- g_branchname = GetBranchNamebyId(lpStrBranchId);
- g_bBranchModify = TRUE;
- #endif
- }
- }
- if ( dwImgType == OImgtype )
- {// 最后一步,更新完了数据库,刷新TakFrom类所对应的对话框;
- HWND hWnd = ::FindWindowEx(g_pMainWnd->GetSafeHwnd(), NULL, _T("MDIClient"), NULL);
- if (hWnd)
- {
- hWnd = ::FindWindowEx(hWnd, NULL, NULL, _T("拍照"));
- if (hWnd)
- {
- hWnd = ::FindWindowEx(hWnd, NULL, _T("#32770"), NULL);
- if (hWnd)
- {
- ::SendMessage(hWnd, MSG_KERNEL_CALLBACK, 0, 0);
- }
- }
- }
- }
- }
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame客人付款
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- static void HandleClientNetEvent(IN SOCKET hSocket,
- IN ETransportEvent eEvent,
- IN void *pDataBuf,
- IN unsigned long nDataLen,
- IN int nError,
- IN void *pContext)
- {
- if (nError != TRANSPORT_OK)
- return;
- CMainFrame *pDlg = (CMainFrame *)pContext;
- if (NULL == pDlg)
- return;
- pDlg->ProcessNetEvent(eEvent, pDataBuf, nDataLen);
- }
- BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
- {
- CRect rtCtrl, rtWnd; // 子窗口,父窗口;
- if (hwnd)
- {
- ::GetWindowRect(hwnd, &rtCtrl); // 获取控件大小;
- ::GetWindowRect(GetParent(hwnd), &rtWnd); // 获取父窗口大小;
- // printf("Jeff:g_WidthScale=%d,g_HeightScale=%d,rtWnd.left=%d,rtWnd.top=%d\n\n",g_WidthScale,g_HeightScale,rtWnd.left,rtWnd.top);
- // 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);
- rtCtrl.OffsetRect(-rtWnd.left, -rtWnd.top);
- float temp;
- temp = (float)rtCtrl.left*g_WidthScale;
- rtCtrl.left = (int)temp + g_dx;
- temp = (float)rtCtrl.top*g_HeightScale;
- rtCtrl.top = (int)temp + g_dy;
- temp = (float)rtCtrl.right*g_WidthScale;
- rtCtrl.right = (int)temp + g_dx;
- temp = (float)rtCtrl.bottom*g_HeightScale;
- rtCtrl.bottom = (int)temp + g_dy;
- //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);
- ::MoveWindow(hwnd, rtCtrl.left, rtCtrl.top, rtCtrl.Width(), rtCtrl.Height(), TRUE);
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- IMPLEMENT_DYNCREATE(CMainFrame, CMDIFrameWnd)
- BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- ON_WM_CREATE()
- ON_WM_DESTROY()
- ON_WM_CLOSE()
- ON_WM_TIMER()
- ON_COMMAND(IDM_choosephotoskin, Onchoosephotoskin)
- ON_COMMAND(IDM_PATH, OnPath)
- ON_COMMAND(IDM_SERVER, OnServer)
- ON_COMMAND(IDM_SHOWHIS, OnShowhis)
- ON_COMMAND(IDM_StaffAchievementShow, OnStaffAchievementShow)
- ON_COMMAND(IDM_AUTODELPHOTO, OnAutodelphoto)
- ON_COMMAND(IDM_PHOTOMANAGE, Onphotomanage)
- ON_COMMAND(IDM_COMPANYINFO, OnCompanyinfo)
- ON_COMMAND(IDM_HELPFILE, OnHelpfile)
- ON_COMMAND(IDM_PHOTOBAK, OnPhotobak)
- ON_COMMAND(IDM_TAOXIFG, OnTaoxifg)
- ON_COMMAND(IDM_ShowBakState, OnShowBakState)
- ON_WM_NCLBUTTONDBLCLK()
- ON_WM_NCHITTEST()
- ON_COMMAND(IDM_LOG, OnLog)
- //}}AFX_MSG_MAP
- ON_COMMAND_RANGE(0, 50000, OnCommandMenu)
- ON_MESSAGE(MSG_KERNEL_SENDMSG, OnKernelSendMessaage)
- END_MESSAGE_MAP()
- static UINT indicators[] =
- {
- ID_SEPARATOR, // status line indicator
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
- #ifdef VC60
- UINT CMainFrame::OnNcHitTest(CPoint point)
- {
- if (CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
- return HTCLIENT;
- return CWnd::OnNcHitTest(point);
- }
- #else
- LRESULT CMainFrame::OnNcHitTest(CPoint point)
- {
- if (CWnd::OnNcHitTest(point) == HTRIGHT || CWnd::OnNcHitTest(point) == HTLEFT || CWnd::OnNcHitTest(point) == HTTOP || CWnd::OnNcHitTest(point) == HTBOTTOM)
- return HTCLIENT;
- return CWnd::OnNcHitTest(point);
- }
- #endif
- void CMainFrame::OnNcLButtonDblClk(UINT nFlags, CPoint point)
- {
- if (nFlags != HTCAPTION)
- CMDIFrameWnd::OnNcLButtonDblClk(nFlags, point);
- }
- // 回调使用;
- LRESULT CMainFrame::OnKernelSendMessaage(WPARAM wp, LPARAM lp)
- {
- CString strBranchId = (LPCTSTR)wp;
- CString strSQLInsert = *(CString*)lp;
-
- // 如果连接的是分店,断开分店,回连本店;
- g_bBranchModify = FALSE;
- g_pMainWnd->OnDisconnect();
- g_branchname = g_branchip = _T("");
- g_sendhead.bsql = 1;
- g_pMainWnd->ProcessChatMessageRequest2(strSQLInsert);
- g_pMainWnd->OnDisconnect();
- // 设置回分店连接;
- g_branchip = GetBranchIPbyId(strBranchId);
- g_branchname = GetBranchNamebyId(strBranchId);
- g_bBranchModify = TRUE;
- g_pMainWnd->OnConnect();
- return 0;
- }
- CMainFrame::CMainFrame()
- {
- // TODO: add member initialization code here
- SetConnectionID(INVALID_SOCKET);
- m_pMainFrimDlg2 = NULL;
- m_bCheckF2F3 = AfxGetApp()->GetProfileInt(LYFZVERSION, "f2f3", 0);
- if (0 == ::PathFileExists(g_mainpath + "\\skin\\5.lia"))
- {
- g_bNoLoginLia = 1;
- }
- }
- CMainFrame::~CMainFrame()
- {
- if (m_pMainFrimDlg2)
- {
- m_pMainFrimDlg2->DestroyWindow();
- delete m_pMainFrimDlg2;
- }
- }
- void InTheMe(HWND m_hWnd)
- {
- BOOL bXpVisualStyle = FALSE;
- OSVERSIONINFO osvi;
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- ::GetVersionEx(&osvi);
- if ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvi.dwMajorVersion >= 5) && (osvi.dwMinorVersion >= 1))
- {
- HMODULE hUxTheme = ::LoadLibrary(_T("UxTheme.dll"));
- POPENTHEMEDATA pOpenThemeData;
- PCLOSETHEMEDATA pCloseThemeData;
- if (hUxTheme != NULL)
- {
- pOpenThemeData = (POPENTHEMEDATA)::GetProcAddress(hUxTheme, "OpenThemeData");
- pCloseThemeData = (PCLOSETHEMEDATA)::GetProcAddress(hUxTheme, "CloseThemeData");
- HTHEME hButtonTheme = (*pOpenThemeData)(m_hWnd, L"BUTTON");
- if (hButtonTheme != NULL)
- bXpVisualStyle = TRUE;
- (*pCloseThemeData)(hButtonTheme);
- }
- ::FreeLibrary(hUxTheme);
- }
- if (bXpVisualStyle)
- AfxMessageBox(_T("正在使用视觉主题 "));
- else
- AfxMessageBox(_T("没有使用视觉主题 "));
- }
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
- {
- // Jeff.创建失败的可能性小,加日志输出;
- return -1;
- }
- if (::PathFileExists(g_mainpath + "\\logo.ico"))
- {
- Bitmap *bmp = NULL;
- LoadImageFromFile((Image**)&bmp, g_mainpath + "\\logo.ico");
- // m_hIcon = AfxGetApp()->LoadIcon(g_mainpath+"\\logo.ico");
- bmp->GetHICON(&m_hIcon);
- delete bmp;
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
- }
- if (!m_wndClient.SubclassWindow(m_hWndMDIClient))
- {
- return -1;
- }
- if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
- | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
- !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
- {
- TRACE0("Failed to create toolbar\n");
- return -1; // fail to create
- }
- m_wndToolBar.LoadTrueColorToolBar(90, IDB_NORMAL, 0, IDB_DISABLE);
- // second toolbar must have different ID
- if (!m_wndToolBar2.Create(this, WS_CHILD | WS_VISIBLE | CBRS_LEFT | CBRS_NOALIGN,
- AFX_IDW_CONTROLBAR_FIRST + 32) ||
- !m_wndToolBar2.LoadToolBar(IDR_TOOLBAR1))
- {
- TRACE0("Failed to create toolbar\n");
- return -1; // fail to create
- }
- #ifndef NEW_SKIN
- if (!m_wndStatusBar.Create(this) ||
- !m_wndStatusBar.SetIndicators(indicators,
- sizeof(indicators)/sizeof(UINT)))
- {
- // Jeff.创建失败的可能性小,加日志输出;
- TRACE0("Failed to create status bar\n");
- return -1; // fail to create
- }
- m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_USER,SBPS_NORMAL,200);
- m_wndStatusBar.SetPaneText(1,"未登录",TRUE);
- #endif
- // TODO: Delete these three lines if you don't want the toolbar to
- // be dockable
- NewMenu2();
- ::GetWindowRect(this->m_hWndMDIClient, g_rc);
- g_pMainWnd = this;
- m_wndToolBar2.Init();
- g_rc.top += 38;
- g_rc.left += 160;
- /* m_WidthScale = (float)g_rc.Width ()/722;
- m_HeightScale = (float)g_rc.Height ()/533;*/
- g_user.bLongin = 0;
- SetTimer(1, 100, NULL);
- #ifdef USE_KERNEL_DLL
- if ( g_pIMGProcess )
- g_pIMGProcess->SetCallBack(ImgImportMergeCallback);
- #endif
- return 0;
- }
- BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
- {
- if (!CMDIFrameWnd::PreCreateWindow(cs))
- return FALSE;
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- cs.style &= ~WS_MAXIMIZEBOX;
- cs.style &= ~WS_THICKFRAME;
- cs.lpszName = g_title + "影楼管理系统";
- cs.style &= ~FWS_ADDTOTITLE;
- RECT rect;
- HWND hWnd = ::FindWindow("Shell_TrayWnd", 0);
- ::GetWindowRect(hWnd, &rect);
- cs.x = 0;
- cs.y = 0;
- cs.cx = GetSystemMetrics(SM_CXSCREEN);
- cs.cy = GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top) + 3;
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame diagnostics
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- CMDIFrameWnd::AssertValid();
- }
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CMDIFrameWnd::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame message handlers
- void CMainFrame::OnDestroy()
- {
- OnDisconnect();
- #ifdef VC60
- Transport_UnInit();
- #else
- CClientTunnel::Transport_UnInit();
- #endif //#ifdef VC60
- m_Mdi.DeleteAll();
- if (g_hmouse)UnhookWindowsHookEx(g_hmouse);
- CMDIFrameWnd::OnDestroy();
- }
- void CMainFrame::OnClose()
- {
- g_bShowBar = 0;
- if (m_Mdi.MainClose())
- CMDIFrameWnd::OnClose();
- }//连接
- void CMainFrame::NewMenu2()
- {
- CMenu *pMemu = GetMenu();
- #ifdef BASIC_VERSION
- CMenu* submenu = pMemu->GetSubMenu(1);
- //submenu->RemoveMenu (IDM_StaffAchievementShow, MF_BYCOMMAND );//Jeff del 2014.06.16
- submenu->RemoveMenu (IDM_salaryset, MF_BYCOMMAND );
- #endif
- #if 0 // 此机用选片菜单项,去掉不用;
- {
- BOOL checked=AfxGetApp()->GetProfileInt (LYFZVERSION, "status", 0);
- if(checked)
- {
- CMenu* submenu = pMemu->GetSubMenu(1);
- submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
- }
- }
- #endif
- #ifndef BASIC_VERSION
- {
- BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status2", 0);
- if (checked)
- {
- #if 0 // Jeff:去掉菜单,此机用于员工业绩查看的菜单选项;
- CMenu* submenu = pMemu->GetSubMenu(1);
- submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
- #endif
- g_bStaffAchievementShow = 1;
- SetTimer(3, 100, NULL);
- }
- }
- #endif
- if (g_bShowOK == 0)
- {
- CMenu* submenu = pMemu->GetSubMenu(2);
- submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
- }
- }
- HMENU CMainFrame::NewMenu()
- {
- //设置菜单为XP风格 IDM_SHOWHIS
- BCMenu::SetMenuDrawMode(1);
- //若取消下面这句注释,则可看到菜单的图标栏和文字栏背景颜色为白色,
- //文字颜色为蓝色,选中项的前景色为紫红色
- //m_menuXP.SetMenuXPItemColor(0x00FFFFFF,0x00FFFFFF,0x00FF0000,0x00FF00FF);
- // 设置菜单中图标大小为32×32
- // m_menuXP.SetIconSize(32,32);
- // 加载菜单资源
- m_menuXP.LoadMenu(IDR_MAINFRAME);
- // 加载菜单对应的工具栏资源
- // m_menuXP.LoadToolbar(IDR_MAINFRAME);
- /*由于菜单左边栏中默认的图标大小为16×16,而与之对应的Toolbar中图标大小为32×32,
- 因此菜单中图标不能正确显示,只显示出工具栏中图标的左上角部分,所以修改菜单中各
- 项对应的图标为24b色位图资源IDB_***,或者在LoadMenu之前调用SetIconSize,设置菜单
- 中图标大小为32×32*/
- // m_menuXP.SetIconSize(24,24);
- // m_menuXP.ModifyODMenu(NULL,IDM_YWBU,IDB_YW); //
- /* m_menuXP.ModifyODMenu(NULL,ID_FILE_OPEN,IDB_BITMAP5);
- m_menuXP.ModifyODMenu(NULL,ID_FILE_SAVE,IDB_BITMAP7);
- m_menuXP.ModifyODMenu(NULL,ID_FILE_PRINT,IDB_BITMAP6);
- m_menuXP.ModifyODMenu(NULL,ID_APP_ABOUT,IDB_BITMAP3);
- m_menuXP.ModifyODMenu(NULL,ID_APP_EXIT,IDB_BITMAP2);*/
- // m_menuXP.EnableMenuItem (0, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
- // m_menuXP.EnableMenuItem (2, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
- // m_menuXP.EnableMenuItem (3, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
- // m_menuXP.EnableMenuItem (4, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
- // m_menuXP.EnableMenuItem (5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
- // m_menuXP.EnableMenuItem (8, MF_BYPOSITION | MF_GRAYED | MF_DISABLED );
- #if 0 // Jeff此机用选片菜单项不用;
- {
- BOOL checked=AfxGetApp()->GetProfileInt (LYFZVERSION, "status", 0);
- if(checked)
- {
- CMenu* submenu = m_menuXP.GetSubMenu(1);
- submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
- }
- }
- #endif
- {
- BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status2", 0);
- if (checked)
- {
- #if 0 // Jeff:去掉此机用于员工业绩查看的菜单选项;
- CMenu* submenu = m_menuXP.GetSubMenu(1);
- submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
- #endif
- g_bStaffAchievementShow = 1;
- SetTimer(3, 100, NULL);
- }
- }
- if (g_bShowOK == 0)
- {
- CMenu* submenu = m_menuXP.GetSubMenu(2);
- submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
- }
- return(m_menuXP.Detach());
- }
- ///////////////////////////////////////////////////////
- //减少代码
- #define OPEN_MENU(x) m_Mdi.Append(pName, RUNTIME_CLASS(x), IDR_MAINFRAME, this, nID)
- //响应菜单命令
- void CMainFrame::OnCommandMenu(UINT nID) // 所有菜单命令都在这里处理;
- {
- if (nID >= 2000 && nID <= 2100)
- {
- OnBranchData(nID);
- return;
- }
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- return;
- if (g_user.bLongin == 0)return;
- }
- else
- {
- InsideMsg();
- }
- ResetTimer();
- if (nID >= 1000 && nID <= 1100)
- {
- OnHistory(nID);
- return;
- }
- LPSTR pName;
- //打开窗口
- switch (nID)
- {
- case IDM_PayOutSet:
- {
- if (IsHasRights(16) == 0)return;
- PayOutSet dlg;
- dlg.DoModal();
- return;
- }
- case IDM_SPLB:
- {
- if (IsHasRightsnew(29) == 0)return;
- SPLBDlg dlg;
- dlg.DoModal();
- return;
- }
- case IDM_JD:
- {
- if (IsHasRightsnew(49) == 0)return;
- SPLBDlg dlg;
- dlg.m_mode = 1;
- dlg.DoModal();
- return;
- }
- case IDM_AREA:
- {
- if (IsHasRightsnew(47) == 0)return;
- AreaDlg dlg;
- dlg.DoModal();
- return;
- }
- case IDM_Psw:
- {
- Psw dlg;
- dlg.DoModal();
- return;
- }
- case IDM_Set:
- {
- if (IsHasRightsnew(49) == 0)return;
- Set dlg;
- dlg.DoModal();
- return;
- }
- case IDM_HIDEWINDOW:
- {
- HideWindow dlg;
- dlg.DoModal();
- return;
- }
- case IDM_Logout:// Jeff.注销;
- {
- if(g_user.bLongin)
- WriteLog("退出系统!", "退出系统!");
-
- g_user.bLongin = 0;
- g_user.name.Empty();
- g_user.rights.Empty();
- g_user.account.Empty();
- g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
- g_pMainWnd2->RefreshOutlookBar();
- #ifndef NEW_SKIN
- m_wndStatusBar.SetPaneText(1, "未登录", TRUE);
- #endif
- m_Mdi.CloseAll();
- #ifdef ENTERPRISE_VERSION
- g_branchname.Empty();
- g_branchip.Empty();
- g_pMainWnd->OnDisconnect();
- g_bBranchModify = 0;
- #endif
- if (g_pMainWnd2)
- {
- g_pMainWnd2->DrawLogin();
- g_pMainWnd2->ShowBar(0);
- }
- g_hisyeararray.RemoveAll();
- g_pMainWnd->AddHistoryMenu(&g_hisyeararray);
- g_brancharray.RemoveAll();
- g_pMainWnd->AddBranchMenu(&g_brancharray);
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 1)
- {
- if (g_pMainWnd2)
- {
- g_pMainWnd2->ShowBar(TRUE,TRUE);
- }
- }
- return;
- }
- case IDM_TODAY:
- pName = (LPSTR)(LPCSTR)"历史订单";
- // OPEN_MENU(SalarySet3);
- OPEN_MENU(DinDanHistroy);
- break;
- case IDM_TAKECONTROL:
- pName = (LPSTR)(LPCSTR)"摄控表";
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(117)))
- OPEN_MENU(TodayForm2);
- else
- OPEN_MENU(TodayForm);
- break;
- case IDM_CLIENTMONEY:
- pName = (LPSTR)(LPCSTR)"客人付款";
- OPEN_MENU(ClientMoney);
- break;
- case IDM_TAKEAWAYBOOK:
- pName = (LPSTR)(LPCSTR)"发片/取件";
- OPEN_MENU(outsourcing);
- break;
- case IDM_CODE:
- pName = (LPSTR)(LPCSTR)"商品报表";
- OPEN_MENU(SPForm);
- break;
- case IDM_Daily:
- // if(IsHasRightsnew(22)==0)return;
- // pName = (LPSTR)(LPCSTR)"日财务表";
- // OPEN_MENU(DailyForm);
- pName = (LPSTR)(LPCSTR)"沟通助手";
- OPEN_MENU(InsideMsg);
- break;
- case IDM_ProcessAlarm:
- pName = (LPSTR)(LPCSTR)"流程监控";
- OPEN_MENU(ProcessAlarm);
- break;
- case IDM_DINDAN:
- // if(IsHasRights(7)==0)return;
- pName = (LPSTR)(LPCSTR)"订单报表";
- OPEN_MENU(DinDanFrom);
- break;
- case IDM_CLIENT:
- //if(IsHasRights(8)==0)return;
- pName = (LPSTR)(LPCSTR)"客户报表";
- OPEN_MENU(CClientForm);
- break;
- case IDM_PayOutInput:
- if (IsHasRightsnew(20) == 0)return;
- pName = (LPSTR)(LPCSTR)"现金支出";
- OPEN_MENU(PayOutInput);
- break;
- case IDM_salaryset:
- if (IsHasRightsnew(25) == 0)return;
- pName = (LPSTR)(LPCSTR)"工资设置";
- OPEN_MENU(SalarySet);
- break;
- case IDM_mysalary:
- if (IsHasRights(16) == 0)return;
- pName = (LPSTR)(LPCSTR)"我的工资";
- OPEN_MENU(MySalary);
- break;
- case IDM_SP:
- // if(IsHasRightsnew(29)==0)return;
- pName = (LPSTR)(LPCSTR)"商品设置";
- OPEN_MENU(ShangPin);
- break;
- case IDM_WORKER:
- if (IsHasRightsnew(27) == 0)return;
- pName = (LPSTR)(LPCSTR)"员工设置";
- OPEN_MENU(Worker);
- break;
- case IDM_TAOXI:
- if (IsHasRightsnew(30) == 0)return;
- pName = (LPSTR)(LPCSTR)"套系设置";
- OPEN_MENU(TXDlg);
- break;
- case IDM_TAOXISP:
- if (IsHasRightsnew(30) == 0)return;
- pName = (LPSTR)(LPCSTR)"套系赠送商品设置";
- OPEN_MENU(TXSPDlg);
- break;
- case IDM_Provider:
- if (IsHasRightsnew(32) == 0)return;
- pName = (LPSTR)(LPCSTR)"供应商设置";
- OPEN_MENU(ProviderDlg);
- break;
- case IDM_BUMEN:
- {
- if (IsHasRightsnew(49) == 0)return;
- BuMenDlg dlg;
- dlg.DoModal();
- return;
- }
- case IDM_Account:
- if (IsHasRightsnew(49) == 0)return;
- pName = (LPSTR)(LPCSTR)"账号管理";
- OPEN_MENU(Account);
- break;
- case IDM_YLCD:
- {
- //AfxMessageBox("IDM_YLCD");
- ::CopyFile(_T(g_path7 + "\\接单系统\\Regsvr32.exe"), _T(g_mainpath + "\\Regsvr32.exe"), 0);
- ::CopyFile(_T(g_path7 + "\\接单系统\\Flash9f.ocx"), _T(g_mainpath + "\\Flash9f.ocx"), 0);
- CString temp;
- temp.Format("%s\\regsvr32.exe /s %s\\Flash9f.OCX", g_mainpath, g_mainpath);
- WinExec(temp, SW_HIDE);
- ::CopyFile(_T(g_path7 + "\\接单系统\\接单系统.exe"), _T(g_mainpath + "\\接单系统.exe"), 0);
- ::CopyFile(_T(g_path7 + "\\接单系统\\my32.dll"), _T(g_mainpath + "\\my32.dll"), 0);
- ::CopyFile(_T(g_path7 + "\\接单系统\\server.dat"), _T(g_mainpath + "\\server.dat"), 0);
- ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\接单系统.exe"), g_server, NULL, SW_SHOWNORMAL);
- }
- break;
- case IDM_YLCDMANAGE:
- ::CopyFile(_T(g_path7 + "\\接单系统\\资源管理器.exe"), _T(g_mainpath + "\\资源管理器.exe"), 0);
- ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\资源管理器.exe"), g_server, NULL, SW_SHOWNORMAL);
- break;
- }
- }
- //减少代码
- ///////////////////////////////////////////////////////////////////////////////
- void CMainFrame::OnDisconnect()
- {
- printf("断开TCP连接\n");
- m_tClientTunnel.net_CloseSocket();
- SetConnectionID(INVALID_SOCKET);
- }
- void CMainFrame::ProcessLoginResponse(void *pLoginResult)
- {
- if (NULL == pLoginResult) return;
- LOGIN_RESULT_STRU *ptLoginResult = (LOGIN_RESULT_STRU *)pLoginResult;
- DWORD dwConnectionID = ptLoginResult->tCommonMsg.dwConnectionID;
- SetConnectionID(dwConnectionID);
- BYTE byResult = ptLoginResult->byResult;
- if (LOGIN_RESULT_SUC == byResult)
- {
- //AfxMessageBox("登录成功"); // Jeff test;
- }
- else
- {
- OnDisconnect();
- }
- }
- /************************************************************************/
- /* 函数:ProcessLoginRequest[3/3/2016 IT];
- /* 描述:登陆服务器;
- /* 参数:;
- /* [IN] :;
- /* [OUT] :;
- /* [IN/OUT] :;
- /* 返回:登陆成功返回TRUE;
- /* 注意:;
- /* 示例:;
- /*
- /* 修改:;
- /* 日期:;
- /* 内容:;
- /************************************************************************/
- BOOL CMainFrame::ProcessLoginRequest()
- {
- // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
- WORD wMessageId = 0;
- if (g_conntype == 0 && !g_bConnLYFZ)
- wMessageId = (MSG_LOGIN_REQ + 0X1FFF);
- else// if (g_bConnLYFZ )
- wMessageId = MSG_LOGIN_REQ;
- // 2.填充发送数据;
- TLOGIN_STRU tLogonInfo = { 0 };
- tLogonInfo.tCommonMsg.dwConnectionID = GetConnectionID();//此时m_dwConnectionID为INVALIDE_SOCKET;
- tLogonInfo.tCommonMsg.wMessageId = wMessageId;
- CString strUserName = newGUID();// 以随机数作为登陆时的用户名称;
- strUserName.TrimLeft();
- strUserName.TrimRight();
- #ifdef VC60
- strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
- #else
- strcpy_s(tLogonInfo.tUserInfo.szUserName, 31, strUserName);
- #endif
- DWORD dwDataLen = sizeof(TLOGIN_STRU);
- // 3.填充数据头;
- TMessageHeader tHeader = { 0 };
- tHeader.wMessageId = wMessageId;
- tHeader.dwDataLen = dwDataLen;
- // 4.发送数据;
- unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)&tLogonInfo, dwDataLen);
- if (ulSendLen == SOCKET_ERROR)
- {
- return 0;
- }
- return 1;
- }
- DWORD CMainFrame::GetConnectionID()
- {
- return m_dwConnectionID;
- }
- void CMainFrame::SetConnectionID(DWORD dwConnection)
- {
- m_dwConnectionID = dwConnection;
- }
- /************************************************************************/
- /* 函数:ProcessChatMessageRequest2[3/3/2016 IT];
- /* 描述:;
- /* 参数:;
- /* [IN] code:;
- /* 返回:void;
- /* 注意:
- OnConnect() -> ProcessChatMessageRequest()
- 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
- 2.SendDataDlg计时器里调用CConnectDlg对话框
- 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
- 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
- 5.关闭对话框和断开连接;;
- /* 示例:;
- /*
- /* 修改:;
- /* 日期:;
- /* 内容:;
- /************************************************************************/
- void CMainFrame::ProcessChatMessageRequest2(BYTE code)
- {
- SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
- SendDataDlg dlg;
- dlg.m_bycode = code;
- dlg.DoModal();
- }
- //*********************************************//
- /*
- 函数:ProcessChatMessageRequest2
- 参数:CString sql [IN]
- 返回:无
- 过程:OnConnect() -> ProcessChatMessageRequest()
- 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
- 2.SendDataDlg计时器里调用CConnectDlg对话框
- 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
- 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
- 5.关闭对话框和断开连接;
- */
- //*********************************************//
- void CMainFrame::ProcessChatMessageRequest2(CString sql)
- {
- if ((sql.Find("insert") != -1 || sql.Find("update") != -1 || sql.Find("delete") != -1) && g_branchname != "" && g_bBranchModify == 0)
- {
- AfxMessageBox("当前为分店数据查看状态,不能更改分店数据!", MB_ICONSTOP);
- g_bSendOK = 0;
- return;
- }
- SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
- SendDataDlg dlg;
- dlg.m_strSQL = sql;
- dlg.DoModal();
- }
- //*********************************************//
- /*
- 函数:ProcessChatMessageRequest2
- 参数:BYTE *pData [IN], int length [IN]
- 返回:无
- 过程:OnConnect() -> ProcessChatMessageRequest()
- 1.SetTimer(2)作用:调用计时器,指定超时后关闭SendDataDlg和CConnectDlg对话框,并断开连接;
- 2.SendDataDlg计时器里调用CConnectDlg对话框
- 3.CConnectDlg计时器调用主框架函数BOOL CMainFrame::OnConnect()进行服务连接工作;
- 4.最后SendDataDlg调用主框架函数BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)发送数据;
- 5.关闭对话框和断开连接;
- */
- //*********************************************//
- void CMainFrame::ProcessChatMessageRequest2(BYTE *pData, int length)
- {
- SetTimer(2, g_ntimeout, NULL); // Jeff.限定通信时间为g_ntimeout,超时后关闭连接;
- SendDataDlg dlg;
- dlg.m_pData = pData;
- dlg.m_nlength = length;
- dlg.DoModal(); // DoModal未执行完时,就被其他函数销毁,导致局部函数dlg无效;
- }
- /************************************************************************/
- /*
- 函数:ProcessChatMessageRequest
- 描述:对服务发送数据;
- 参数:void *szDataBuf[IN], int nDataLen[IN]
- 返回:发送成功与否;
- */
- /************************************************************************/
- BOOL CMainFrame::ProcessChatMessageRequest(void *szDataBuf, int nDataLen)
- {
- // 1.获取当前与服务器连接的id;
- DWORD dwFromUserID = GetConnectionID();
- // 2.设置通信类型为MSG_CHATMESSAGE_REQ;
- WORD wMessageId = 0;
- if (g_conntype == 0 && !g_bConnLYFZ)
- wMessageId = (MSG_CHATMESSAGE_REQ + 0X3FFF);
- else
- wMessageId = MSG_CHATMESSAGE_REQ;
- // 3.计算出欲发送的数据的长度 dwDataLen;
- DWORD dwDataLen = sizeof(TCHAT_MESSAGE_STRU) + nDataLen;
- BYTE *pSendData = new BYTE[dwDataLen];
- TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU*)pSendData;
- memset(pChatMessage, 0x00, dwDataLen);
- // 3.1.g_nYearpos==-1,表示连接是当前主数据库,其他值表示历史数据库;
- if (g_nYearpos == -1)
- g_sendhead.length[99] = g_nYearpos;
- else
- g_sendhead.length[99] = g_nYearpos * 32142953 + 10966236;
- g_sendhead.length[98] = 987123768;
- memcpy(pSendData, &g_sendhead, sizeof(g_sendhead));
- #ifdef ENTERPRISE_VERSION
- if (g_bBranchModify == 0)
- #ifdef VC60
- strcpy(pChatMessage->szFromUserName, g_branchname);
- #else
- strcpy_s(pChatMessage->szFromUserName, 30, g_branchname);
- #endif
- #endif
- // 4.填充发送的数据结构;
- pChatMessage->tCommonMsg.dwConnectionID = GetConnectionID();
- pChatMessage->tCommonMsg.wMessageId = wMessageId;
- pChatMessage->dwFromUserID = dwFromUserID;
- pChatMessage->dwToUserID = g_nSendCode;//▲▲g_nSendCode在服务端同为dwToUserID;
- pChatMessage->wMessageLen = nDataLen;
- memcpy(pChatMessage->byFileContent, szDataBuf, nDataLen);
- // 5.填充数据头;
- TMessageHeader tHeader = { 0 };
- tHeader.wMessageId = wMessageId;
- tHeader.dwDataLen = dwDataLen;
- // 6.发送数据;
- BOOL bRet = 0;
- unsigned long ulSendLen = m_tClientTunnel.net_Send(&tHeader, (void *)pChatMessage, dwDataLen);
- if (ulSendLen != SOCKET_ERROR)
- {
- bRet = 1;
- }
- // 7.发送完毕,释放内存;
- delete[] pSendData;
- return bRet;
- }
- /************************************************************************/
- /*
- 函数:ProcessChatMessageResponse
- 描述:接收服务返回的数据;
- 参数:void *pResponse[IN]
- 返回:无;
- 调用关系:
- 1.由 void CMainFrame::ProcessNetEvent(...)调用
- */
- /************************************************************************/
- void CMainFrame::ProcessChatMessageResponse(void *pResponse)
- {
- // 1.数据空,直接返回;
- if (NULL == pResponse)
- return;
- // 2.数据解析过程;
- TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pResponse;
- int nMessageLen = pChatMessage->wMessageLen;
- int nMessageLen2 = pChatMessage->dwToUserID; // 在服务器中被处理了,一般使dwToUserID=wMessageLen;
- // Jeff.dwFromUserID==8888表示的内容是更新客户端skin界面数据,只有两处dwToUserID==211和dwToUserID==21;
- // Jeff.其余的大多数都是 dwFromUserID = wMessageLen = dwToUserID 三者相等;
- if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID != 8888)
- {
- // 2.1.清除全局变量g_pData数据,用于保存接收的实际数据;
- if (g_pData)
- delete[]g_pData;
- g_pData = NULL;
- g_pData = new BYTE[nMessageLen];
- memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
- memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
- g_nLeng = nMessageLen;
- if (nMessageLen <= sizeof(DWORD))
- {
- memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
- }
- KillTimer(2);
- if (g_hSendWnd)
- {
- ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);//关闭发送对话框;
- }
- }
- else if (nMessageLen == nMessageLen2 && pChatMessage->dwFromUserID == 8888)
- {
- if (g_pData2)
- delete[]g_pData2;
- g_pData2 = NULL;
- g_pData2 = new BYTE[nMessageLen2];
- memcpy(g_pData2, pChatMessage->byFileContent, nMessageLen2);
- g_nLeng2 = nMessageLen2;
- KillTimer(2);
- if (g_hSendWnd)
- {
- ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);
- }
- }
- else // 登陆返回;
- {
- if (g_bConnLYFZ)
- {
- if (g_pData)
- delete[]g_pData;
- g_pData = NULL;
- g_pData = new BYTE[nMessageLen];
- memcpy(g_pData, pChatMessage->byFileContent, nMessageLen);
- memcpy(&g_sendhead, pChatMessage, sizeof(g_sendhead));
- g_nLeng = nMessageLen;
- if (nMessageLen <= sizeof(DWORD))
- {
- memcpy(&g_ncount, pChatMessage->byFileContent, sizeof(DWORD));
- }
- KillTimer(2);
- if (g_hSendWnd)
- {
- ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);
- }
- return;
- }
- if (g_conntype) // Jeff.g_conntype == 1,表示连接公司服务器的返回,用于集团版解析*.ly.com的IP地址;
- {
- // KillTimer(2);
- char *szChatMessage = new char[nMessageLen + 1];
- memset(szChatMessage, 0x00, nMessageLen + 1);
- memcpy(szChatMessage, pChatMessage->byFileContent, nMessageLen);
- g_server = szChatMessage;
- delete[]szChatMessage;
- CStdioFile fp;
- CString path = g_mainpath + "\\ip.txt";
- ::DeleteFile(path); // 删除ip.txt;
- fp.Open(path, CFile::modeCreate | CFile::modeWrite);
- fp.WriteString(g_server);
- fp.Close();
- g_conntype = 0;
- // g_serverip=g_server;
- return;
- }
- if (g_pData2 == NULL)
- {
- g_pData2 = new BYTE[nMessageLen2];
- g_nLeng2 = 0;
- }
- memcpy(g_pData2 + g_nLeng2, pChatMessage->byFileContent, nMessageLen);
- g_nLeng2 += nMessageLen;
- if (g_nLeng2 == nMessageLen2)//已收完
- {
- KillTimer(2);
- if (g_hSendWnd)
- {
- ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);
- }
- }
- else
- {
- KillTimer(2);
- SetTimer(2, g_ntimeout, NULL);
- }
- }
- }
- #if USE_SHARE_FLORD
- /************************************************************************/
- /*
- Date: 2015-04-11
- Author: Jeff
- 函数:GetSharePathInfo
- 描述:获取共享目录表的所有信息;
- 参数:
- 返回:成功返回TRUE;
- 注意:获取的表记录存储在全局变量g_aryOfSharePathInfo中;
- 调用约定:在登陆软件时调用,且必须连接的服务器是本店的;
- */
- /************************************************************************/
- BOOL CMainFrame::GetSharePathInfo()
- {
- // 1.连接的数据库必须是本局域网的服务器;
- if ( g_bAllBranch || !g_branchname.IsEmpty() || !g_branchip.IsEmpty() )
- {
- // 非当前局域网服务器;
- return FALSE;
- }
- // 2.获取当前连接的分店域名是否与g_domain一致;
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 29;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(23);
- if ( !g_bSendOK )
- {
- // 连接服务器失败;
- return FALSE;
- }
- CArray<CStringArray,CStringArray> strArray;
- DataToArray(&strArray);
- CString strCurBranchDomain = _T("");
- if ( strArray.GetSize() )
- {
- strCurBranchDomain = strArray.ElementAt(0).ElementAt(0);
- if ( strCurBranchDomain.Find(_T(".ly.com")) == -1)
- {
- // 当前获取的域名有错;
- return FALSE;
- }
- }
- if ( g_domain.CompareNoCase(strCurBranchDomain) != 0)
- {
- // 当前连接的分店域名与局域网服务器域名不一致;
- return FALSE;
- }
- // 3.获取可用的共享信息;//select * from NetShareInfo where enable = 1;
- CString strFilter = _T("");
- strFilter.Format(_T("enable = 1"));
- int g_nYearposTemp=g_nYearpos;
- g_nYearpos=-1;
- g_bSendOK = 0;
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 236;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(strFilter);
- g_nYearpos = g_nYearposTemp;
- if ( !g_bSendOK )
- {
- // 获取共享信息失败;
- return FALSE;
- }
- g_aryOfSharePathInfo.RemoveAll();
- DataToArray(&g_aryOfSharePathInfo);
- return g_aryOfSharePathInfo.GetSize() ? TRUE : FALSE;
- }
- #endif
- BOOL CMainFrame::OnConnectBranch()
- {
- if (g_branchip == "")
- {
- return 0;
- }
- g_conntype = 0;
- CString strServerAddress = g_branchip;
- char *szServerAddress = strServerAddress.GetBuffer(0);
- strServerAddress.ReleaseBuffer();
- /*for Client, IP and Port can be 0,
- and for Server, IP is LocalIP, and Port is Listening Port*/
- int nResult = m_tClientTunnel.net_OpenSocket(
- Transport_Client,
- 0,
- HandleClientNetEvent,
- this);
- if (TRANSPORT_OK != nResult)
- {
- // AfxMessageBox("网络初始化失败!");
- return 0;
- }
- GetSysIniInfo(g_szModulePath, g_branchname + _T(".ini"));
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- DWORD wPort = g_dwCSPort;
- #ifdef VC60
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if (TRANSPORT_OK != nResult)
- #else
- nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
- if (!nResult)
- #endif
-
- {
- m_tClientTunnel.net_CloseSocket();
- return OnConnectBranch2();
- }
- return ProcessLoginRequest();
- }
- BOOL CMainFrame::OnConnectBranch2()
- {
- if (g_branchip2 == "")
- {
- return 0;
- }
- g_conntype = 0;
- CString strServerAddress = g_branchip2;
- char *szServerAddress = strServerAddress.GetBuffer(0);
- strServerAddress.ReleaseBuffer();
- /*for Client, IP and Port can be 0,
- and for Server, IP is LocalIP, and Port is Listening Port*/
- int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
- 0,
- HandleClientNetEvent,
- this);
- if (TRANSPORT_OK != nResult)
- {
- // AfxMessageBox("网络初始化失败!");
- return 0;
- }
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- DWORD wPort = SERVER_PORT; // 5678
- #ifdef VC60
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if (TRANSPORT_OK != nResult)
- #else
- nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
- if (!nResult)
- #endif
- {
- m_tClientTunnel.net_CloseSocket();
- return 0;
- }
- return ProcessLoginRequest();
- }
- BOOL CMainFrame::OnConnectIP()
- {
- CString strServerAddress = g_server;
- char *szServerAddress = strServerAddress.GetBuffer(0);
- strServerAddress.ReleaseBuffer();
- /*for Client, IP and Port can be 0,
- and for Server, IP is LocalIP, and Port is Listening Port*/
- int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
- 0,
- HandleClientNetEvent,
- this);
- if (TRANSPORT_OK != nResult)
- {
- // AfxMessageBox("网络初始化失败!");
- return 0;
- }
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- DWORD wPort = SERVER_PORT; // 5678
- #ifdef VC60
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if (TRANSPORT_OK != nResult)
- #else
- nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
- if (!nResult)
- #endif
- {
- m_tClientTunnel.net_CloseSocket();
- return 0;
- }
- return ProcessLoginRequest();
- }
- //ip.txt
- BOOL CMainFrame::OnConnectLYFZ()
- {
- CString strBranchIP = "lijiafz.vicp.net";
- MyGetIPByName2(strBranchIP);
- if (strBranchIP == "")
- {
- return 0;
- }
- g_conntype = 0; // Jeff.Delete at 2014.10.18
- //g_conntype = 1;
- CString strServerAddress = strBranchIP;
- char *szServerAddress = strServerAddress.GetBuffer(0);
- strServerAddress.ReleaseBuffer();
- /*for Client, IP and Port can be 0,
- and for Server, IP is LocalIP, and Port is Listening Port*/
- int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
- 0,
- HandleClientNetEvent,
- this);
- if (TRANSPORT_OK != nResult)
- {
- return 0;
- }
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- DWORD wPort = GetPort();
- #ifdef VC60
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if (TRANSPORT_OK != nResult)
- #else
- nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
- if (!nResult)
- #endif
- {
- m_tClientTunnel.net_CloseSocket();
- return 0;
- }
- return ProcessLoginRequest();
- }
- BOOL CMainFrame::OnConnect()
- {
- // 1.Jeff 断开(如果有在在未关的连接)之前的连接;
- OnDisconnect();
- // 2.根据需要连接指定的服务器;
- if (g_bBranchModify)
- {
- // Jeff.g_bBranchModify在g_bGenBranchData=1时,在welcome::OnTimer里被设置为1;
- return OnConnectBranch();// 连接集团版分店;
- }
- if (g_bConnLYFZ)
- {
- return OnConnectLYFZ();// 连接公司服务端程序;
- }
- g_conntype = 0;
- CString strServerAddress = g_server;
- // 3.如果dbconfig.dat里保存的是*.ly.com的信息,就要读取ip.txt里的IP地址;
- if (g_serverbak.Find(".ly.com") != -1)
- {
- strServerAddress = g_serverbak;
- CStdioFile fp;
- CString path = g_mainpath + "\\ip.txt";
- if (::PathFileExists(path))
- {
- fp.Open(path, CFile::modeRead);
- fp.ReadString(g_server);
- fp.Close();
- if (OnConnectIP())
- {
- // g_serverip=g_server;
- return 1;
- }
- g_server = strServerAddress;
- OnDisconnect();//MessageBox("ip失败");
- }
- g_conntype = 1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
- strServerAddress = "lijiafz.vicp.net";
- MyGetIPByName2(strServerAddress);
- if (strServerAddress.IsEmpty())
- {
- return 0;//OnConnect2();
- }
- }
- else if (g_ntimeout == 29000)//非远程 30000
- {
- strServerAddress = g_serverarray.ElementAt(g_conpos);
- }
- // 4.如果没有IP.txt或dbconfig.dat里的不是ly.com信息,而是一般的计算机名称;
- char *szServerAddress = strServerAddress.GetBuffer(0);
- strServerAddress.ReleaseBuffer();
- // AfxMessageBox("连接:"+strServerAddress);
- /*for Client, IP and Port can be 0,
- and for Server, IP is LocalIP, and Port is Listening Port*/
-
- // 5.创建通信对象连接;
- int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
- 0,
- HandleClientNetEvent,
- this);
- if (TRANSPORT_OK != nResult)
- {
- return 0;
- }
- GetSysIniInfo();
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- DWORD wPort = g_dwCSPort;
- if (g_conntype) wPort = GetPort();
- // 6.连接公司服务器或影楼服务器;
- #ifdef VC60
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if (TRANSPORT_OK != nResult)
- #else
- nResult = m_tClientTunnel.net_Connect(szServerAddress,wPort);
- if (!nResult)
- #endif
- {
- m_tClientTunnel.net_CloseSocket();
- if (g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
- {
- return 0;//OnConnect2();
- }
- if (g_serverarray.GetSize() > 1)
- {
- if (g_conpos < (g_serverarray.GetSize() - 1))
- {
- g_conpos++;
- return OnConnect();
- }
- else
- {
- g_conpos = 0;
- return 0;
- }
- }
- return 0;
- }
- return ProcessLoginRequest();
- }
- BOOL CMainFrame::OnConnect2()
- {
- g_conntype = 2;
- CString server = "http://www.lyfz.net/download/ip.txt";
- char buf[MAX_PATH];
- ::GetTempPath(sizeof(buf), buf);
- CString m_strTempDir = buf;
- DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
- INTERNET_PORT m_dwPort;
- DWORD dwType;
- CInternetSession m_cis;
- CHttpConnection *m_pHttp;
- CString m_strServer;
- CString m_strIniPath;
- AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
- if (dwType != AFX_INET_SERVICE_HTTP)
- {
- return 0;//OnConnect3();
- }
- m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
- m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
- try
- {
- m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
- }
- catch (CInternetException* pEx)
- {
- return 0;//OnConnect3();
- }
- CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
- m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
- try
- {
- pFile->SendRequest();
- }
- catch (CInternetException* pEx)
- {
- pFile->Close();
- return 0;//OnConnect3();
- }
- if (pFile)
- {
- CStdioFile csf;
- csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
- char buf[2048];
- int n;
- while ((n = pFile->Read(buf, 2048)) > 0)
- csf.Write(buf, n);
- csf.Close();
- pFile->Close();
- }
- CString strServerAddress;
- CStdioFile fp;
- fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
- fp.ReadString(strServerAddress);
- fp.Close();
- char *szServerAddress = strServerAddress.GetBuffer(0);
- strServerAddress.ReleaseBuffer();
- /*for Client, IP and Port can be 0,
- and for Server, IP is LocalIP, and Port is Listening Port*/
- int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
- 0,
- HandleClientNetEvent,
- this);
- if (TRANSPORT_OK != nResult)
- {
- return 0;
- }
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- DWORD wPort = SERVER_PORT; // 5678
- if (g_conntype)wPort = GetPort();
- #ifdef VC60
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if (TRANSPORT_OK != nResult)
- #else
- nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
- if (!nResult)
- #endif
- {
- m_tClientTunnel.net_CloseSocket();
- return 0;//OnConnect3();
- }
- return ProcessLoginRequest();
- }
- BOOL CMainFrame::OnConnect3()
- {
- g_conntype = 3;
- CString server = "http://photo.bjlyfz.com/download/ip.txt";
- char buf[MAX_PATH];
- ::GetTempPath(sizeof(buf), buf);
- CString m_strTempDir = buf;
- DWORD m_dwHttpRequestFlags = HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_NO_AUTO_REDIRECT;
- INTERNET_PORT m_dwPort;
- DWORD dwType;
- CInternetSession m_cis;
- CHttpConnection *m_pHttp;
- CString m_strServer;
- CString m_strIniPath;
- AfxParseURL(server, dwType, m_strServer, m_strIniPath, m_dwPort);
- if (dwType != AFX_INET_SERVICE_HTTP)
- {
- return FALSE;
- }
- m_cis.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 5);
- m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
- try
- {
- m_pHttp = m_cis.GetHttpConnection(m_strServer, m_dwPort);
- }
- catch (CInternetException* pEx)
- {
- return false;
- }
- CHttpFile *pFile = m_pHttp->OpenRequest(CHttpConnection::HTTP_VERB_GET,
- m_strIniPath, NULL, 1, NULL, NULL, m_dwHttpRequestFlags);
- try
- {
- pFile->SendRequest();
- }
- catch (CInternetException* pEx)
- {
- pFile->Close();
- return false;
- }
- if (pFile)
- {
- CStdioFile csf;
- csf.Open(m_strTempDir + "\\ip.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
- char buf[2048];
- int n;
- while ((n = pFile->Read(buf, 2048)) > 0)
- csf.Write(buf, n);
- csf.Close();
- pFile->Close();
- }
- CString strServerAddress;
- CStdioFile fp;
- fp.Open(m_strTempDir + "\\ip.txt", CFile::modeRead);
- fp.ReadString(strServerAddress);
- fp.Close();
- char *szServerAddress = strServerAddress.GetBuffer(0);
- strServerAddress.ReleaseBuffer();
- /*for Client, IP and Port can be 0,
- and for Server, IP is LocalIP, and Port is Listening Port*/
- int nResult = m_tClientTunnel.net_OpenSocket(Transport_Client,
- 0,
- HandleClientNetEvent,
- this);
- if (TRANSPORT_OK != nResult)
- {
- return 0;
- }
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- DWORD wPort = SERVER_PORT; // 5678
- if (g_conntype)wPort = GetPort();
- #ifdef VC60
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if (TRANSPORT_OK != nResult)
- #else
- nResult = m_tClientTunnel.net_Connect(szServerAddress, wPort);
- if (!nResult)
- #endif
- {
- m_tClientTunnel.net_CloseSocket();
- return 0;
- }
- return ProcessLoginRequest();
- }
- void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
- {
- //printf("Jeff:ProcessNetEvent\n\n");//Jeff Printf;
- if (Transport_ReadEv == nEventType)
- {
- if (NULL == pRecvMsg) return;
- TMessageHeader* pHeader = (TMessageHeader *)pRecvMsg;
- char *pDataBuf = (char *)pRecvMsg + MESSAGE_HEADER_LEN;
- WORD dwMessageID = pHeader->wMessageId;
- switch (dwMessageID)
- {
- case MSG_LOGIN_RESP:
- case (MSG_LOGIN_RESP + 0X2FFF) :
- {
- LOGIN_RESULT_STRU tLoginResult = { 0 };
- memcpy(&tLoginResult, pDataBuf, sizeof(LOGIN_RESULT_STRU));
- ProcessLoginResponse(&tLoginResult);
- break;
- }
- case MSG_USERINFO_RESP:
- {
- break;
- }
- case MSG_LOGOUT_RESP:
- {
- break;
- }
- case MSG_CHATMESSAGE_RESP:
- case (MSG_CHATMESSAGE_RESP + 0X4FFF) :
- {
- static int i = 0;
- TCHAT_MESSAGE_STRU *pChatMessage = (TCHAT_MESSAGE_STRU *)pDataBuf;
- ProcessChatMessageResponse((void *)pChatMessage);
- break;
- }
- default:
- {
- break;
- }
- }
- }
- else if (Transport_CloseEv == nEventType)
- {
- OnDisconnect();
- }
- }
- //extern BOOL g_bNeedCoon;
- extern BOOL EncryptFile2(BYTE *buffer, DWORD leng, PCHAR szPassword);
- void CMainFrame::OnTimer(UINT nIDEvent)
- {
- // TODO: Add your message handler code here and/or call default
- if (1 == nIDEvent)
- {
- KillTimer(nIDEvent);
- BOOL checked = AfxGetApp()->GetProfileInt(LYFZVERSION, "status", 0);//status:此机用选片菜单项
- // checked==1:此机用选片菜单项
- // g_bStaffAchievementShow==1:此机用于员工业绩查看
- if (checked && g_bStaffAchievementShow == 0) // .此机用选片菜单项;
- {
- KillTimer(3);
- #ifdef NEW_SKIN
- Welcome weldlg;
- weldlg.DoModal();
- #endif
- ChoosePhotoSkin dlg;
- dlg.SetLiaPath("1.lia");
- if (dlg.DoModal() != IDOK)
- {
- PostMessage(WM_QUIT);
- return;
- }
- if (dlg.m_exitcode == 3)
- {
- keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
- keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
- }
- else
- {
- ShowWindow(SW_SHOW);
- #ifdef NEW_SKIN
- if (m_pMainFrimDlg2 == NULL)
- {
- m_pMainFrimDlg2 = new MainFrimDlg2;
- m_pMainFrimDlg2->SetLiaPath("10.lia");
- m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
- }
- m_pMainFrimDlg2->ShowWindow(SW_SHOW);
- #endif
- }
- }
- else if (g_bStaffAchievementShow == 0) // .非选片、非查看员工业绩;
- {
- #ifdef NEW_SKIN
- g_bNoConnDlg = 1;
- Welcome weldlg;
- weldlg.DoModal();
- m_pMainFrimDlg2->ShowWindow(SW_SHOW);
- ShowWindow(SW_SHOW);
- g_bNoConnDlg = 0;
- if (g_bNoLoginLia) // Jeff.OnCreate里判断skin文件有5.lia, g_bNoLoginLia = 0, 无 g_bNoLoginLia = 1;
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia"); // Login3的父类为MyDlg,在BOOL MyDlg::OnInitDialog()里调用了纯虚函数Init();
- dlg.DoModal();
- // 数据库完整性提醒;
- if ( 1 == atoi(g_cominfoarray.ElementAt(0).ElementAt(159)) )
- {
- MessageBox(_T("贵店数据库可能已损坏,请尽快联系售后人员进行确认或维护,联系电话:0752-2398865 或 4006-067-068!"), _T("重要提示:"), MB_OK | MB_TOPMOST /*| MB_SETFOREGROUND*/ | MB_ICONWARNING);
- if ( !g_bRunOnCorruptdb )
- exit(0);
- }
- }
- if (g_user.bLongin && g_pMainWnd2)
- {
- g_pMainWnd2->ShowBar(TRUE,TRUE);
- InsideMsg();
- }
- #else
- ShowWindow(SW_SHOW);
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath ("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath ("5.lia");
- dlg.DoModal();
- }
- #endif
- }
- if (g_hmouse == NULL)
- {
- g_hmouse = SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId());
- }
- }
- else if (2 == nIDEvent) //29秒后,若连接和发送未完成,将关闭连接和发送框;
- {
- KillTimer(2);
- if (g_hConnectWnd)
- ::PostMessage(g_hConnectWnd, WM_CLOSE, 0, 0);
- if (g_hSendWnd)
- ::PostMessage(g_hSendWnd, WM_CLOSE, 0, 0);
- if (g_bStaffAchievementShow == 0 && g_bConnLYFZ == 0)
- {
- if (g_bGenBranchData == 0)
- {
- if (g_branchip != "")
- AfxMessageBox("连接分店:" + g_branchname + "失败!", MB_ICONINFORMATION);
- else
- AfxMessageBox("连接服务器失败!", MB_ICONINFORMATION);
- }
- OnDisconnect();
- }
- g_bSendOK = 0;
- g_bNeedCoon = 1;
- }
- else if (3 == nIDEvent)
- {
- KillTimer(3);
- #ifdef NEW_SKIN
- Welcome weldlg;
- weldlg.DoModal();
- #endif
- ShowWindow(SW_SHOW);
- m_pMainFrimDlg2->ShowWindow(SW_SHOW);
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 24;
- g_sendhead.code[1] = 1;
- g_sendhead.tabcount = 2;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if (g_bSendOK == 0)
- {
- return;
- }
- CArray<CStringArray, CStringArray>patharray;
- CArray<CStringArray, CStringArray>userarray;
- DataToArray(&g_cominfoarray, &g_hisyeararray);
- g_userarray.SetSize(userarray.GetSize(), 1);
- int count = 0;
- for (int ii = 0; ii < userarray.GetSize(); ii++)
- {
- if (userarray.ElementAt(ii).ElementAt(10) == "在职")
- g_userarray.ElementAt(count++).Copy(userarray.ElementAt(ii));
- }
- g_userarray.SetSize(count, 1);
- StaffAchievementShowAll dlg;
- g_pMainWnd->GetOcx();
- dlg.DoModal();
- }
- else if (5 == nIDEvent)
- {
- if (g_bInSkin)
- {
- OutputDebugString("使用皮肤\n");
- return;
- }
- if (g_nAutoShowStaffAchievement == 1){
- OutputDebugString("用于选片\n");
- return;
- }
- if (g_bAllBranch){
- OutputDebugString("多店汇总当中\n");
- return;
- }
- if (g_user.bLongin)
- {
- // m_Mdi.CloseAll();
- g_pMainWnd->OnCommandMenu(IDM_Logout);
- }
- /* g_nAutoShowStaffAchievement=1;
- KillTimer(5);
- StaffAchievementShowAll dlg;
- g_pMainWnd->GetOcx();
- dlg.DoModal ();*/
- }
- else if (6 == nIDEvent)
- {
- static BOOL bDouble = 0;
- bDouble = !bDouble;
- if (bDouble)
- g_pMainWnd->OnCommandMenu(IDM_TAKEAWAYBOOK);
- else
- g_pMainWnd->OnCommandMenu(IDM_CLIENTMONEY);
- }
- else if (7 == nIDEvent)
- {
- // Jeff,当g_bSendLYFZ==TRUE时;
- // 向lijiafz.vicp.net发送影楼信息,防止有盗版用户;
- KillTimer(7);
- if (g_bInSkin)return;
- if (g_nAutoShowStaffAchievement == 1)return;
- if (g_bAllBranch)return;
- CString str = g_sInfo;
- g_bConnLYFZ = 1; // Jeff指示连接的服务器为lijiafz.vicp.net
- // 断开当前连接;
- OnDisconnect();
- BYTE *pData = new BYTE[str.GetLength()];
- memcpy(pData, str.GetBuffer(0), str.GetLength());
- str.ReleaseBuffer();
- EncryptFile2(pData, str.GetLength(), "888666333");
- g_nSendCode = 16;
- g_pMainWnd->ProcessChatMessageRequest2(pData, str.GetLength());
- g_nSendCode = 0;
- delete[]pData;
- OnDisconnect();
- g_bSendLYFZ = 0;
- g_bConnLYFZ = 0;
- if (g_bSendOK)
- {
- char *pStr = new char[g_nLeng + 1];
- memset(pStr, 0, g_nLeng + 1);
- memcpy(pStr, g_pData, g_nLeng);
- CString str = pStr;
- delete[]pStr;
- if (str == "g_bInSkin")
- {
- g_sendhead.bsql = 1;
- g_pMainWnd->ProcessChatMessageRequest2("update version set [setcheck1]='ok'");
- }
- }
- }
- }
- void CMainFrame::OnOutbarNotify(CString strMsg)
- {
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- return;
- if (g_user.bLongin == 0)return;
- }
- else
- {
- InsideMsg();
- }
- ResetTimer();
- if (strMsg == "开单")
- {
- if (IsHasRights(0) == 0)return;
- Booking2 dlg;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "拍照")
- {
- if (IsHasRights(1) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"拍照";
- OPEN_MENU(TakeFrom);
- return;
- }
- else if (strMsg == "修片")
- {
- if (IsHasRights(1) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"修片";
- OPEN_MENU(BeautifySkinFrom);
- return;
- }
- else if (strMsg == "选片")
- {
- if (IsHasRights(2) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"选片";
- OPEN_MENU(ChoosePhotoForm);
- return;
- }
- else if (strMsg == "精修")
- {
- if (IsHasRights(2) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"精修";
- OPEN_MENU(BeautifySkinFrom2);
- return;
- }
- else if (strMsg == "设计")
- {
- if (IsHasRights(2) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"设计";
- OPEN_MENU(DesignFrom);
- return;
- }
- else if (strMsg == "数码安排")
- {
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"数码安排";
- OPEN_MENU(DigitalWork);
- return;
- }
- else if (strMsg == "刻盘")
- {
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"刻盘";
- OPEN_MENU(BurnCD);
- return;
- }
- else if (strMsg == "相片冲印")
- {
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"相片冲印资料";
- OPEN_MENU(PhotoPrintFrom);
- return;
- }
- else if (strMsg == "发片/取件")
- {
- if (IsHasRights(3) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"发片/取件";
- OPEN_MENU(outsourcing);
- return;
- }
- else if (strMsg == "满意度")
- {
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"满意度";
- OPEN_MENU(Satisfaction);
- return;
- }
- else if (strMsg == "满意度汇总")
- {
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"满意度汇总";
- OPEN_MENU(SatisfactionReportForm);
- return;
- }
- #if JEFF_DELETE_ON // 2014.11.14-PM 16:20
- else if (strMsg == "回复统计")
- {
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"回复统计";
- OPEN_MENU(MsgReg2);
- return;
- }
- #endif
- /* else if(strMsg=="取件")
- {
- if(IsHasRights(3)==0)return;
- UINT nID=1;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"取件";
- OPEN_MENU(TakeAwayFrom);
- return;
- }*/
- else if (strMsg == "其它收入")
- {
- if (IsHasRightsnew(16) == 0)return;
- // if(IsHasRightsnew(48)==0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"其它收入";
- OPEN_MENU(IncomeInput);
- return;
- }
- else if (strMsg == "其它二销")
- {
- if (IsHasRightsnew(16) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"其它二销";
- OPEN_MENU(IncomeInput2);
- return;
- }
- else if (strMsg == "员工奖罚")
- {
- if (IsHasRightsnew(16) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"员工奖罚";
- OPEN_MENU(IncomeInput3);
- return;
- }
- else if (strMsg == "员工奖惩")
- {
- if (IsHasRightsnew(16) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"员工奖惩";
- OPEN_MENU(IncomeInput4);
- return;
- }
- else if (strMsg == "订单收款")
- {
- if (IsHasRights(17) == 0)return;
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"订单收款";
- OPEN_MENU(FinanceForm);
- return;
- }
- else if (strMsg == "日财务表")
- {
- if (IsHasRightsnew(22) == 0)return;
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"日财务表";
- OPEN_MENU(DailyForm);
- return;
- }
- else if (strMsg == "提成比例")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"提成比例";
- OPEN_MENU(SalarySet2);
- return;
- }
- //else if(strMsg=="员工工作")
- else if (strMsg == "计件提成")
- {
- UINT nID = 2;
- LPSTR pName;
- //pName = (LPSTR)(LPCSTR)"员工工作";
- pName = (LPSTR)(LPCSTR)"计件提成";
- OPEN_MENU(SalarySet3);
- return;
- }
- else if (strMsg == "工资管理")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"工资管理";
- OPEN_MENU(MySalary);
- return;
- }
- else if (strMsg == "客人付款")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"客人付款";
- OPEN_MENU(ClientMoney);
- return;
- }
- else if (strMsg == "工资报表")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- if (IsHasRightsnew(25) == 0)return;
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"工资报表";
- g_ncount = 100;
- OPEN_MENU(MySalary);
- return;
- }
- else if (strMsg == "员工业绩")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- if (IsHasRightsnew(33) == 0)return;
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"员工业绩";
- OPEN_MENU(StaffAchievement);
- return;
- }
- else if (strMsg == "订单客户")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"订单客户";
- g_dx += 10000;
- OPEN_MENU(CClientForm);
- if (g_dx >= 10000)g_dx -= 10000;
- return;
- }
- else if (strMsg == "意向客户")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"意向客户";
- OPEN_MENU(Client2Form);
- return;
- }
- else if (strMsg == "老客户")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"老客户";
- OPEN_MENU(OldClient);
- return;
- }
- else if (strMsg == "客户来电")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"客户来电";
- OPEN_MENU(PhoneRecord);
- return;
- }
- else if (strMsg == "拨出电话")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"拨出电话";
- OPEN_MENU(PhoneRecordOut);
- return;
- }
- else if (strMsg == "未接来电")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"未接来电";
- OPEN_MENU(MissCall);
- return;
- }
- else if (strMsg == "客户流失")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"客户流失";
- OPEN_MENU(ClientReasonChart);
- return;
- }
- else if (strMsg == "客户来源")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"客户来源";
- OPEN_MENU(ClientFromChart);
- return;
- }
- else if (strMsg == "月财务表")
- {
- if (IsHasRightsnew(23) == 0)return;
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"月财务表";
- OPEN_MENU(MonthForm);
- return;
- }
- else if (strMsg == "支出报表")
- {
- if (IsHasRightsnew(23) == 0)return;
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"支出报表";
- OPEN_MENU(MonthForm2);
- return;
- }
- else if (strMsg == "年财务表")
- {
- if (IsHasRightsnew(24) == 0)return;
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"年财务表";
- OPEN_MENU(YearForm);
- return;
- }
- else if (strMsg == "年财务图表")
- {
- if (IsHasRightsnew(24) == 0)return;
- GetOcx();
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"年财务图表";
- OPEN_MENU(YearForm2);
- return;
- }
- else if (strMsg == "订单图表")
- {
- GetOcx();
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"订单图表";
- OPEN_MENU(DinDanForm);
- return;
- }
- #ifdef ENTERPRISE_VERSION
- else if (strMsg == "订单报表")
- {
- GetOcx();
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"订单报表2";
- OPEN_MENU(DinDanFromBranch);
- return;
- }
- else if (strMsg == "财务图表")
- {
- GetOcx();
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"财务图表";
- OPEN_MENU(YearFormBranch);
- return;
- }
- else if (strMsg == "订单图表")
- {
- GetOcx();
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"订单图表";
- OPEN_MENU(YearFormBranch2);
- return;
- }
- else if (strMsg == "摄控安排")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"摄控安排";
- g_bookingtype = 0;
- OPEN_MENU(TodayForm);
- return;
- }
- else if (strMsg == "选片预约")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"选片预约";
- g_bookingtype = 1;
- OPEN_MENU(TodayForm);
- return;
- }
- else if (strMsg == "看样预约")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"看样预约";
- g_bookingtype = 2;
- OPEN_MENU(TodayForm);
- return;
- }
- else if (strMsg == "取件预约")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"取件预约";
- g_bookingtype = 3;
- OPEN_MENU(TodayForm);
- return;
- }
- else if (strMsg == "婚庆安排")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"婚庆安排";
- g_bookingtype = 4;
- OPEN_MENU(TodayForm);
- return;
- }
- #endif
- else if (strMsg == "员工资料")
- {
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"员工资料";
- if (g_bAllBranch)
- OPEN_MENU(EmployeeForm2);
- else
- OPEN_MENU(EmployeeForm);
- return;
- }
- else if (strMsg == "客户区域")
- {
- // if(IsHasRightsnew(48)==0)return;
- GetOcx();
- UINT nID = 2;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"客户区域";
- OPEN_MENU(AreaClient);
- return;
- }
- else if (strMsg == "客户报表")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"客户报表";
- OPEN_MENU(CClientForm);
- return;
- }
- else if (strMsg == "现金支出")
- {
- if (IsHasRightsnew(16) == 0)return;
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"现金支出";
- OPEN_MENU(PayOutInput);
- return;
- }
- else if (strMsg == "短信群发")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"短信群发";
- OPEN_MENU(SendMsg);
- return;
- }
- else if (strMsg == "短信发送")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"客户报表";
- OPEN_MENU(CClientForm);
- return;
- }
- else if (strMsg == "流程短信")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"流程短信";
- OPEN_MENU(WorkMsg);
- return;
- }
- else if (strMsg == "员工短信")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"员工短信";
- OPEN_MENU(EmployeeMsg);
- return;
- }
- else if (strMsg == "发送记录")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"发送记录";
- OPEN_MENU(MsgReg);
- return;
- }
- else if (strMsg == "短信设置")
- {
- if (IsHasRightsnew(49) == 0)return;
- MsgSet dlg;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "金卡会员")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"金卡会员";
- OPEN_MENU(ShowMember);
- return;
- }
- else if (strMsg == "现金子卡")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"现金子卡";
- OPEN_MENU(ShowMember2);
- return;
- }
- else if (strMsg == "蓝钻会员")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"蓝钻会员";
- OPEN_MENU(ShowMemberBlue);
- return;
- }
- else if (strMsg == "转介绍积分")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"转介绍积分";
- OPEN_MENU(Card2Reg);
- return;
- }
- /* else if(strMsg=="转介绍图表")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #endif
- #endif
- UINT nID=3;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"转介绍图表";
- OPEN_MENU(Card2RegChart);
- return;
- }*/
- else if (strMsg == "金卡图表")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"金卡图表";
- OPEN_MENU(MemberChart);
- return;
- }
- else if (strMsg == "积分短信")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"积分短信";
- OPEN_MENU(ShowMemberMsg);
- return;
- }
- else if (strMsg == "转介绍返现")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"转介绍返现";
- OPEN_MENU(Card2RegBlue);
- return;
- }
- else if (strMsg == "转介绍图表")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"转介绍图表";
- OPEN_MENU(Card2RegChartBlue);
- return;
- }
- else if (strMsg == "积分设置")
- {
- if (IsHasRightsnew(49) == 0)return;
- MemberSet dlg;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "礼服录入")
- {
- if (IsHasRightsnew(39) == 0)return;
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"礼服录入";
- OPEN_MENU(DressManage);
- return;
- }
- else if (strMsg == "礼服查看")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- if (IsHasRightsnew(40) == 0)return;
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"礼服查看";
- OPEN_MENU(ShowDress);
- return;
- }
- else if (strMsg == "撞期预警")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"撞期预警";
- OPEN_MENU(DressEarlyWarning);
- return;
- }
- else if (strMsg == "礼服出租")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"礼服出租";
- OPEN_MENU(ShowHireReg);
- return;
- }
- else if (strMsg == "礼服图片")
- {
- ShowPic dlg;
- dlg.m_mode = 4;
- //dlg.m_path = g_path5 + "\\";
- dlg.m_id = g_path5 + "\\";
- dlg.DoModal();
- return;
- }
- else if (strMsg == "商品类别设置")
- {
- if (IsHasRightsnew(29) == 0)return;
- SPLBDlg dlg;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "商品名称设置")
- {
- if (IsHasRightsnew(29) == 0)return;
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"商品设置";
- OPEN_MENU(ShangPin);
- return;
- }
- else if (strMsg == "固定资产管理")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"固定资产管理";
- OPEN_MENU(FixedAssets);
- return;
- }
- else if (strMsg == "入库单")
- {
- if (IsHasRightsnew(44) == 0)return;
- InputGoods dlg;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "出库单")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- if (IsHasRightsnew(45) == 0)return;
- InputGoods dlg;
- dlg.m_mode = 1;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "库存查询")
- {
- #ifndef ENTERPRISE_VERSION
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "0")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if(g_cominfoarray.ElementAt(0).ElementAt(46)!="1")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="2")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "3")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #else
- #ifndef CHILD_VERSION
- #ifdef BASIC_VERSION
- if(g_cominfoarray.ElementAt(0).ElementAt( 46)!="4")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "5")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #else
- #ifdef BASIC_VERSION
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "6")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0);return;
- }
- #else
- if (g_cominfoarray.ElementAt(0).ElementAt(46) != "7")
- {
- AfxMessageBox("您的软件可能为盗版, 请与4006-067068,18665281860,QQ:4006067068联系!", MB_ICONSTOP);
- exit(0); return;
- }
- #endif
- #endif
- #endif
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"库存查询";
- OPEN_MENU(ShowGoods);
- return;
- }
- else if (strMsg == "商品图表")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"商品图表";
- OPEN_MENU(StoreInfoChart);
- return;
- }
- else if (strMsg == "成本核算")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"成本核算";
- OPEN_MENU(CostCal);
- return;
- }
- else if (strMsg == "考勤记录")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"考勤记录";
- OPEN_MENU(LoginReg);
- return;
- }
- else if (strMsg == "月统计")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"月统计";
- OPEN_MENU(LoginReg2);
- return;
- }
- else if (strMsg == "时间设置")
- {
- if (IsHasRightsnew(21) == 0)return;
- SetLoginTime dlg;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "排班设置")
- {
- if (IsHasRightsnew(21) == 0)return;
- SetLoginBan dlg;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "意向查询")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"意向查询";
- OPEN_MENU(HospitalClient);
- return;
- }
- else if (strMsg == "今日提醒")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"今日提醒";
- OPEN_MENU(HospitalClientAlarm);
- return;
- }
- else if (strMsg == "跟踪短信")
- {
- UINT nID = 3;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"跟踪短信";
- OPEN_MENU(HospitalClientMsg);
- return;
- }
- else if (strMsg == "意向单录入")
- {
- AddHospitalClient dlg;
- dlg.DoModal();
- return;
- }
- else if (strMsg == "资料设置")
- {
- HospitalInfoSet dlg;
- dlg.DoModal();
- return;
- }
- else if ( strMsg == _T("公众号设置"))
- {
- if (IsHasRightsnew(62) == 0)return;
- if ( lyfzLibrary::LoadWeiXinLibaray() )
- {
- lyfzLibrary::g_PtrShowWeiXinDialog(g_rc, g_bkcol);
- lyfzLibrary::FreeWeiXinLibaray();
- }
- return;
- }
- else if ( strMsg == _T("模板消息设置"))
- {
- if (IsHasRightsnew(63) == 0)return;
- if ( lyfzLibrary::LoadWeiXinLibaray() )
- {
- lyfzLibrary::g_PtrShowWXMsgconfigDialog(g_rc, g_bkcol);
- lyfzLibrary::FreeWeiXinLibaray();
- }
- return;
- }
- else if ( strMsg == _T("推送记录") )
- {
- if (IsHasRightsnew(64) == 0)return;
- if ( lyfzLibrary::LoadWeiXinLibaray() )
- {
- lyfzLibrary::g_PtrShowWXMsgRcordDialog(g_rc, g_bkcol);
- lyfzLibrary::FreeWeiXinLibaray();
- }
- return;
- }
- AfxMessageBox(strMsg + ",开发中...");
- }
- // Jeff.当版本号不一致时,调用AutoUpdate.exe来升级YLGL.exe
- void CMainFrame::AutoUpdate()
- {
- if (g_bBranchModify)
- {
- AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
- return;
- }
- else if (g_branchname != "")
- {
- AfxMessageBox("此店与分店" + g_branchname + "软件版本不同,请同时升级! ");
- return;
- }
- g_ntimeout = 30000;
- if (!::PathFileExists(g_mainpath + "\\AutoUpdate.exe"))
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 99;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(99);
- if (g_bSendOK == 0)
- goto failed;
- CFile fp;
- fp.Open(g_mainpath + "\\AutoUpdate.exe", CFile::modeWrite | CFile::modeCreate);
- fp.Write(g_pData, g_nLeng);
- fp.Close();
- }
- {
- ::DeleteFile(g_mainpath + "\\YLGL2.exe"); // 删除ylgl.exe;
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 98;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(99); if (g_bSendOK == 0)goto failed;
- CFile fp;
- fp.Open(g_mainpath + "\\YLGL2.exe", CFile::modeWrite | CFile::modeCreate);
- fp.Write(g_pData, g_nLeng);
- fp.Close();
- }
- AfxMessageBox("自动升级成功!", MB_ICONINFORMATION);
- ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\AutoUpdate.exe"), "12345", NULL, SW_SHOWNORMAL);
- g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
- exit(0);
- return;
- failed:
- AfxMessageBox("自动升级失败!", MB_ICONINFORMATION);
- if (g_ntimeout == 30000)//非远程
- {
- AfxMessageBox("提醒:升级过程中需要传输较多的数据,如果网速慢可能导致远程升级失败!\r\n\
- 可拷贝店内客户端用QQ传过来覆盖除dbconfig.dat的文件即可。", MB_ICONINFORMATION);
- }
- g_pMainWnd->SendMessage(WM_CLOSE, 0, 0);
- }
- void CMainFrame::Onchoosephotoskin() //Jeff:此机用于选片菜单项;不在使用2014.06.16
- {
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- // TODO: Add your command handler code here
- CMenu *pMenu = GetMenu();
- CMenu* submenu = pMenu->GetSubMenu(1);
- UINT status = submenu->GetMenuState(IDM_choosephotoskin, MF_BYCOMMAND);
- if (status&MF_CHECKED)
- {
- submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_UNCHECKED);
- AfxGetApp()->WriteProfileInt(LYFZVERSION, "status", 0);
- }
- else
- {
- submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
- AfxGetApp()->WriteProfileInt(LYFZVERSION, "status", 1);
- }
- }
- /*BOOL g_bInSkin = 0;*/
- BOOL CMainFrame::IsCtrlDown()
- {
- short state = GetKeyState(VK_LCONTROL);
- BYTE sta = (BYTE)(state >> 8);
- state = GetKeyState(VK_RCONTROL);
- BYTE sta2 = (BYTE)(state >> 8);
- if (sta || sta2)
- return 1;
- else
- return 0;
- }//IsShiftDown
- BOOL CMainFrame::IsShiftDown()
- {
- short state = GetKeyState(VK_LSHIFT);
- BYTE sta = (BYTE)(state >> 8);
- state = GetKeyState(VK_RSHIFT);
- BYTE sta2 = (BYTE)(state >> 8);
- if (sta || sta2)
- return 1;
- else
- return 0;
- }
- BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class IDM_Logout
- if (pMsg->message == WM_KEYDOWN)
- {
- switch (pMsg->wParam)
- {
- case VK_F12:
- g_pMainWnd->OnCommandMenu(IDM_Logout);
- return 1;
- case VK_F1:
- ShellExecute(NULL, _T("open"), _T(g_mainpath + "\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
- return 1;
- case VK_F2: // 此机用于选片和选设计;
- {
- if (g_pMainWnd->m_bCheckF2F3 && (IsShiftDown() == 0 || IsCtrlDown() == 0))return 1;
- m_Mdi.MainClose();
- if (g_user.bLongin)
- {
- SearchClient dlg;
- dlg.SetLiaPath("2.lia");
- if (dlg.DoModal() != IDOK)
- {
- if (dlg.m_bLogout)
- {
- g_user.bLongin = 0;
- g_user.name.Empty();
- g_user.rights.Empty();
- g_user.account.Empty();
- goto ll;
- }
- PostMessage(WM_QUIT);
- return 1;
- }
- if (dlg.m_exitcode == 3)
- {
- keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
- keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
- }
- else
- {
- ShowWindow(SW_SHOW);
- #ifdef NEW_SKIN
- if (m_pMainFrimDlg2 == NULL)
- {
- m_pMainFrimDlg2 = new MainFrimDlg2;
- m_pMainFrimDlg2->SetLiaPath("10.lia");
- m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
- }
- m_pMainFrimDlg2->ShowWindow(SW_SHOW);
- g_bInSkin = 0;
- #endif
- }
- }
- else
- {
- ll:
- ChoosePhotoSkin dlg;
- dlg.SetLiaPath("1.lia");
- if (dlg.DoModal() != IDOK)
- {
- PostMessage(WM_QUIT);
- return 1;
- }
- if (dlg.m_exitcode == 3)
- {
- keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
- keybd_event(VK_F3, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
- }
- else
- {
- ShowWindow(SW_SHOW);
- #ifdef NEW_SKIN
- if (m_pMainFrimDlg2 == NULL)
- {
- m_pMainFrimDlg2 = new MainFrimDlg2;
- m_pMainFrimDlg2->SetLiaPath("10.lia");
- m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
- }
- m_pMainFrimDlg2->ShowWindow(SW_SHOW);
- g_bInSkin = 0;
- #endif
- }
- }
- }
- return 1;
- case VK_F3: // 此机用于选片和选设计;
- {
- if (g_pMainWnd->m_bCheckF2F3 && (g_pMainWnd->IsShiftDown() == 0 || g_pMainWnd->IsCtrlDown() == 0))return 1;
- m_Mdi.MainClose();
- if (g_user.bLongin)
- {
- SearchClient dlg;
- dlg.m_mode = 1;
- dlg.SetLiaPath("2.lia");
- if (dlg.DoModal() != IDOK)
- {
- if (dlg.m_bLogout)
- {
- g_user.bLongin = 0;
- g_user.name.Empty();
- g_user.rights.Empty();
- g_user.account.Empty();
- goto mm;
- }
- PostMessage(WM_QUIT);
- return 1;
- }
- if (dlg.m_exitcode == 2)
- {
- keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
- keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
- }
- else
- {
- ShowWindow(SW_SHOW);
- #ifdef NEW_SKIN
- if (m_pMainFrimDlg2 == NULL)
- {
- m_pMainFrimDlg2 = new MainFrimDlg2;
- m_pMainFrimDlg2->SetLiaPath("10.lia");
- m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
- }
- m_pMainFrimDlg2->ShowWindow(SW_SHOW);
- g_bInSkin = 0;
- #endif
- }
- }
- else
- {
- mm:
- ChoosePhotoSkin dlg;
- dlg.m_mode = 1;
- dlg.SetLiaPath("1.lia");
- if (dlg.DoModal() != IDOK)
- {
- PostMessage(WM_QUIT);
- return 1;
- }
- if (dlg.m_exitcode == 2)
- {
- keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
- keybd_event(VK_F2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP | 0, 0);
- }
- else
- {
- ShowWindow(SW_SHOW);
- #ifdef NEW_SKIN
- if (m_pMainFrimDlg2 == NULL)
- {
- m_pMainFrimDlg2 = new MainFrimDlg2;
- m_pMainFrimDlg2->SetLiaPath("10.lia");
- m_pMainFrimDlg2->Create(IDD_DLGmydlg, this);
- }
- m_pMainFrimDlg2->ShowWindow(SW_SHOW);
- g_bInSkin = 0;
- #endif
- }
- }
- }
- return 1;
- //#if 0 // 2015-05-30 禁用F11功能;
- // case VK_F11:
- // if (g_bInSkin)return 1;
- // if (g_user.bLongin)
- // {
- // SqlDlg dlg;
- // dlg.DoModal();
- // }
- // break;
- //#endif
- }
- }
- return CMDIFrameWnd::PreTranslateMessage(pMsg);
- }
- void CMainFrame::GetSkin()
- {
- return;
- #ifdef MNLS_VERSION
- if (::PathFileExists(g_mainpath + "\\skin\\4.lia"))
- {
- CFile fp;
- fp.Open(g_mainpath + "\\skin\\4.lia", CFile::modeRead);
- DWORD leng=fp.GetLength ();
- fp.Close ();
- if(leng!=194987)
- ::DeleteFile (g_mainpath+"\\skin\\4.lia"); // 删除4.lia
- }
- if(!::PathFileExists (g_mainpath+"\\skin\\4.lia"))
- {
- ::CreateDirectory (g_mainpath+"\\skin", NULL);
- g_sendhead.bsql=0;
- g_sendhead.code[0]=100;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return;
- CFile fp;
- fp.Open (g_mainpath+"\\skin\\4.lia", CFile::modeWrite|CFile::modeCreate);
- fp.Write (g_pData, g_nLeng);
- fp.Close ();
- }
- #endif
- }
- void AutoDraw(CPrintRX &m_Print, CRect &StrRect, CString &str, float fscale)
- {
- CString tempbz =_T(""), temp = _T("");
- BOOL bRun = 0;
- CSize size;
- int fontsize = 12;
- int i = 0;
- ll: tempbz = str;
- i = 0;
- m_Print.SetFontFace(fontsize, 1, "宋体");
- while (1)
- {
- if (!tempbz.IsEmpty())
- {
- temp = tempbz;
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- int right = 0;
- CRect temprc = StrRect;
- temprc.top += i*(fontsize*fscale); i++;
- temprc.bottom = temprc.top + fontsize;
- if (temprc.bottom > StrRect.bottom)break;
- while (size.cx > temprc.Width())
- {
- right++;
- temp = tempbz.Left(tempbz.GetLength() - (right));
- if (GIsHalfHZ(temp))
- {
- right++;
- temp.Delete(temp.GetLength() - 1);
- }
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- }
- // 判断最后的字符是否还含有半个汉字;
- if ( GIsHalfHZ(temp) )
- {
- right++;
- temp.Delete(temp.GetLength() -1);
- temp = tempbz.Left(tempbz.GetLength() - (right));
- }
- if (temp.Find("\r\n") != -1)
- {
- temp = temp.Left(temp.Find("\r\n"));//i++;
- tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength() - 2);
- }
- else
- tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
- if (bRun)
- m_Print.DrawText((LPTSTR)(LPCTSTR)temp, temprc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else
- break;
- }
- if (tempbz.IsEmpty() == 0)
- {
- fontsize--;
- goto ll;
- }
- if (bRun == 0)
- {
- bRun = 1;
- goto ll;
- }
- }
- void CMainFrame::PrintDinDan3(CString strOrderNumber)
- {
- // TODO: Add your control notification handler code here
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("11.lia");
- load.SetMargins(0, 0);
- if (!load.Load())return;
- LoadRect load2;
- load2.SetLiaPath("12.lia");
- load2.SetMargins(0, 0);
- if (!load2.Load())return;
- LoadRect load3;
- load3.SetLiaPath("13.lia");
- load3.SetMargins(-6, 520);
- if (!load3.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "'";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.code[2] = 50;
- g_sendhead.code[3] = 150;
- g_sendhead.tabcount = 4;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- CArray<CStringArray, CStringArray>jdarray;
- DataToArray(&g_List1array, &clientarray, &sparray, &jdarray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = "其它要求: " + g_List1array.ElementAt(0).ElementAt(38);
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- if (IsHasRights2new(31) == 0)
- {
- m_phone1 = "***";
- m_phone2 = "***";
- }
- CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
- CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
- CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
- CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
- CString m_addr = m_addr1 + ";";
- m_addr.TrimLeft(";");
- m_addr += m_addr2;
- CString m_qq = m_qq1 + ";";
- m_qq.TrimLeft(";");
- m_qq += m_qq2;
- CString m_jd;
- for (i = 0; i < jdarray.GetSize(); i++)
- {
- m_jd += jdarray.ElementAt(i).ElementAt(1);
- m_jd += ";";
- }
- m_jd.TrimRight(";");
- m_money1.Format("%f", atof(m_taoxijiage));
- m_money2.Format("%f", atof(m_payed1));
- m_money3.Format("%f", atof(m_money1) - atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(17, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top -= 0;
- StrRect.bottom -= 10;
- StrRect.left -= 140;
- StrRect.right = StrRect.left + 48;
- m_Print.SetFontFace(15, 1, "宋体");
- m_Print.SetColor(0xffffff);
- m_Print.DrawRect(StrRect, 0);
- m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 48;
- m_Print.DrawRect(StrRect, RGB(255, 0, 0));
- m_Print.SetColor(0, RGB(255, 0, 0));
- m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetColor(0);
- m_Print.SetFontFace(12, 1, "宋体");
- StrRect.left -= 48;
- int hei = StrRect.Height();
- StrRect.top = StrRect.bottom + 2;
- StrRect.bottom += hei + 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top = StrRect.bottom - 2;
- StrRect.bottom += hei - 5;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(12, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"约单时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- ////////////
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/邮箱:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"套系金额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_money1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"定金:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_money2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"余额:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_money3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"预约点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"拍摄景点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_jd, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内容提供: 男士服装:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"女士:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"套", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内提供拍摄区服装/头饰造型", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)" ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"专业数码拍摄:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"张", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"(JPG格式数据)", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"套系内赠送:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_List1array.ElementAt(0).ElementAt(9)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"张设计排版精修入册", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //////////////////////load2
- rcpos = -1;
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"原始数据套系内张数JPG格式光盘壹只", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"其它:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- // m_Print.DrawText((LPTSTR)(LPCTSTR)"", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- // AutoDraw(m_Print, StrRect, m_bz, 1.4);
- m_Print.DrawRect2(StrRect, 2);
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"客人产品:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- int rowcount = sparray.GetSize() / 8;
- int needaddrow = 0;
- while (sparray.GetSize() > rowcount * 8 + needaddrow)
- needaddrow++;
- int pos = 0;
- CString str = "";
- int addcount = 0;
- if (needaddrow > 0)
- addcount = 1;
- else
- addcount = 0;
- needaddrow--;
- str.Empty();
- for (i = 0; i < rowcount + addcount; i++)
- {
- str += sparray.ElementAt(pos).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(pos).ElementAt(3);
- str += ";";
- pos++;
- }
- StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
- AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);//6
- if (needaddrow > 0)
- addcount = 1;
- else
- addcount = 0;
- needaddrow--;
- str.Empty();
- for (i = 0; i < rowcount + addcount; i++)
- {
- str += sparray.ElementAt(pos).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(pos).ElementAt(3);
- str += ";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4); m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);//7
- if (needaddrow > 0)
- addcount = 1;
- else
- addcount = 0;
- needaddrow--;
- str.Empty();
- for (i = 0; i < rowcount + addcount; i++)
- {
- str += sparray.ElementAt(pos).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(pos).ElementAt(3);
- str += ";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);//8
- if (needaddrow > 0)
- addcount = 1;
- else
- addcount = 0;
- needaddrow--;
- str.Empty();
- for (i = 0; i < rowcount + addcount; i++)
- {
- str += sparray.ElementAt(pos).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(pos).ElementAt(3);
- str += ";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);//9
- if (needaddrow > 0)
- addcount = 1;
- else
- addcount = 0;
- needaddrow--;
- str.Empty();
- for (i = 0; i < rowcount + addcount; i++)
- {
- str += sparray.ElementAt(pos).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(pos).ElementAt(3);
- str += ";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);//10
- if (needaddrow > 0)
- addcount = 1;
- else
- addcount = 0;
- needaddrow--;
- str.Empty();
- for (i = 0; i < rowcount + addcount; i++)
- {
- str += sparray.ElementAt(pos).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(pos).ElementAt(3);
- str += ";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);//11
- if (needaddrow > 0)
- addcount = 1;
- else
- addcount = 0;
- needaddrow--;
- str.Empty();
- for (i = 0; i < rowcount + addcount; i++)
- {
- str += sparray.ElementAt(pos).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(pos).ElementAt(3);
- str += ";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load2.m_rcarray.ElementAt(++rcpos);//12
- if (needaddrow > 0)
- addcount = 1;
- else
- addcount = 0;
- needaddrow--;
- str.Empty();
- for (i = 0; i < rowcount + addcount; i++)
- {
- str += sparray.ElementAt(pos).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(pos).ElementAt(3);
- str += ";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4f); m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- /* StrRect=load2.m_rcarray .ElementAt (++rcpos);//12
- if(needaddrow>0)
- addcount=1;
- else
- addcount=0;
- needaddrow--;
- str.Empty ();
- for( i=0; i<rowcount+addcount; i++)
- {
- str+=sparray.ElementAt (pos).ElementAt (5);
- str+=" 数量:";
- str+=sparray.ElementAt (pos).ElementAt (3);
- str+=";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- StrRect=load2.m_rcarray .ElementAt (++rcpos);//14
- if(needaddrow>0)
- addcount=1;
- else
- addcount=0;
- needaddrow--;
- str.Empty ();
- for( i=0; i<rowcount+addcount; i++)
- {
- str+=sparray.ElementAt (pos).ElementAt (5);
- str+=" 数量:";
- str+=sparray.ElementAt (pos).ElementAt (3);
- str+=";";
- pos++;
- }
- AutoDraw(m_Print, StrRect, str, 1.4);m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);*/
- CRect sprc[2];
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- // AutoDraw(m_Print, StrRect, m_bz.Left (leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- sprc[0] = StrRect;
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- // AutoDraw(m_Print, StrRect, m_bz.Right (leng-leng/2), 1.4);m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawRect2(StrRect, 2);
- sprc[1] = StrRect;
- //AutoDraw(m_Print, StrRect, m_bz, 1.4);
- {
- CString temp, tempspno, tempbz;
- CSize size;
- BOOL bRun = 0;
- int fontsize = 12;
- ll: tempspno = m_bz;
- m_Print.SetFontFace(fontsize, 1, "宋体");
- for (i = 0; i<2; i++)
- {
- if (!tempspno.IsEmpty())
- {
- temp = tempspno;
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- int right = 0;
- CRect temprc = sprc[i];
- while (size.cx>temprc.Width())
- {
- right++;
- temp = tempspno.Left(tempspno.GetLength() - (right));
- if (GIsHalfHZ(temp))
- {
- right++;
- temp.Delete(temp.GetLength() - 1);
- }
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- }
- if (bRun)
- m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
- if (tempspno.IsEmpty())i++;
- }
- }
- if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
- {
- fontsize--;
- goto ll;
- }
- if (bRun == 0)
- {
- bRun = 1;
- goto ll;
- }
- }
- m_Print.SetFontFace(11, 1, "宋体");
- //////////////////////load3
- rcpos = -1;
- for (i = 0; i < 24; i++)
- {
- StrRect = load3.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- CStringArray strarray;
- strarray.Add("营业员");
- strarray.Add("前台接待");
- strarray.Add("化妆师");
- strarray.Add("礼服师");
- strarray.Add("摄影师");
- strarray.Add("摄影助理");
- strarray.Add("美工师");
- strarray.Add("设计师");
- for (i = 0; i < 8; i++)
- {
- StrRect = load3.m_rcarray.ElementAt(i);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- strarray.RemoveAll();
- strarray.Add(m_ren);
- strarray.Add(g_List1array.ElementAt(0).ElementAt(49));
- strarray.Add(m_waiter2);
- strarray.Add(g_List1array.ElementAt(0).ElementAt(51));
- strarray.Add(m_waiter1);
- strarray.Add(g_List1array.ElementAt(0).ElementAt(50));
- strarray.Add("");
- strarray.Add(m_waiter4);
- for (i = 8; i < 16; i++)
- {
- StrRect = load3.m_rcarray.ElementAt(i);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 8), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- StrRect = load3.m_rcarray.ElementAt(27);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"客户电话: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load3.m_rcarray.ElementAt(28);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(13, 1, "宋体");
- StrRect = load3.m_rcarray.ElementAt(25);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load3.m_rcarray.ElementAt(26);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load3.m_rcarray.ElementAt(24);
- str = "\
- 顾客须知\r\n\
- 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
- 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
- 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
- 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
- 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
- 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
- 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
- 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
- AutoDraw(m_Print, StrRect, str, 1.8f);
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (dlg.DoModal() != IDOK)return;
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- void CMainFrame::PrintDailyForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
- {
- // TODO: Add your control notification handler code here
- int pages = Listarray->GetSize() / 46;
- if (Listarray->GetSize() % 46)pages++;
- for (int aa = 0; aa < pages; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- float fscale;
- {
- int w, h;
- m_Print.GetWidHei(w, h);
- fscale = (float)w / (float)h;
- }
- mainrc.DeflateRect(25, 40, 10, 0);
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- m_Print.SetFontFace(16, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- CString str;
- int wid[4] = { 320, 60, 60, 90 };
- int hei = 16;
- if (fscale > 0.71)hei = 15;
- rc = mainrc;
- rc.bottom = rc.top + hei;
- for (int i = 0; i < 47; i++)
- {
- rc2.top = rc.top + i*hei;
- rc2.bottom = rc.bottom + i*hei;
- rc2.left = rc.left;
- rc2.right = rc.left + wid[0];
- if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
- for (int j = 0; j<4; j++)
- {
- m_Print.DrawRect2(rc2, 1);
- if (Listarray->GetSize()>aa * 46 + i)
- {
- str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- rc2.left += wid[j];
- rc2.right = rc2.left + wid[j + 1];
- }
- }
- rc2.top += 2;
- rc2.left += 2; rc2.right = mainrc.right + 4;
- m_Print.SetFontFace(8, 1, "宋体");
- int infopos = info.Find("***");
- if (infopos != -1)
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)info.Left(infopos), rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
- CRect rc3 = rc2;
- rc3.top = rc2.bottom - 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info.Right(info.GetLength() - infopos - 3), rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
- }
- else
- m_Print.DrawText((LPTSTR)(LPCTSTR)info, rc2, 0, 0, FORMAT_LEFT | FORMAT_UP);
- str.Format(" 页:%d/%d", aa + 1, pages);
- str = "制表:" + g_user.name + " 日期:" + g_date + str;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- // dlg.m_mode=1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintLoginForm(CArray<CStringArray, CStringArray>*Listarray, CString title, CString info)
- {
- // TODO: Add your control notification handler code here
- int sinlecount = 33 * 6;
- int pages = Listarray->GetSize() / sinlecount;
- if (Listarray->GetSize() % sinlecount)pages++;
- for (int aa = 0; aa < pages; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- float fscale;
- {
- int w, h;
- m_Print.GetWidHei(w, h);
- fscale = (float)w / (float)h;
- }
- mainrc.DeflateRect(25, 40, 10, 0);
- CString str;
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- rc.left -= 20;
- m_Print.SetFontFace(12, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(6, 1, "宋体");
- str.Format(" 页:%d/%d", aa + 1, pages);
- str = "制表:" + g_user.name + " 日期:" + g_date + str;
- rc.right = mainrc.right + 20;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- int wid[2] = { 50, 110 };
- int hei = 11;
- rc = mainrc;
- rc.bottom = rc.top + hei;
- rc.top += 10;
- rc.bottom += 10;
- int dtx = rc.Width() / 3 + 18;
- int dty = 380;
- for (int j = 0; j < 6; j++)
- {
- if (Listarray->GetSize() < aa*sinlecount + 33 * (j + 1))continue;
- for (int i = 0; i < 33; i++)
- {
- rc2.top = rc.top + i*hei;
- rc2.bottom = rc.bottom + i*hei;
- rc2.left = rc.left;
- rc2.right = rc.left + wid[0];
- if (i == 0)
- {
- // rc2.left +=wid[1];
- rc2.right += wid[1];
- }
- if (j == 1 || j == 4)
- {
- rc2.left += dtx;
- rc2.right += dtx;
- }
- if (j == 2 || j == 5)
- {
- rc2.left += dtx * 2;
- rc2.right += dtx * 2;
- }
- if (j == 3 || j == 4 || j == 5)
- {
- rc2.top += dty;
- rc2.bottom += dty;
- }
- m_Print.DrawRect2(rc2, 1);
- if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
- {
- str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(0);
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- if (i == 0)continue;
- rc2.left = rc2.right;
- rc2.right += wid[1];
- m_Print.DrawRect2(rc2, 1);
- if (Listarray->GetSize() > aa*sinlecount + 33 * j + i)
- {
- if (Listarray->ElementAt(aa*sinlecount + 33 * j + i).GetSize() > 1)
- {
- str = Listarray->ElementAt(aa*sinlecount + 33 * j + i).ElementAt(1);
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- }
- /* if(Listarray->GetSize ()>aa*46+i)
- {
- str=Listarray->ElementAt (aa*46+i).ElementAt (j);
- rc2.left +=3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -=3;
- }
- rc2.left +=wid[j];
- rc2.right =rc2.left+wid[j+1];*/
- }
- }
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintTakeForm(CArray<CStringArray, CStringArray>*Listarray)
- {
- CString title;
- CString info;
- // TODO: Add your control notification handler code here
- int sinlecount = 4;
- int pages = Listarray->GetSize() / sinlecount;
- if (Listarray->GetSize() % sinlecount)pages++;
- for (int aa = 0; aa < pages; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- float fscale;
- {
- int w, h;
- m_Print.GetWidHei(w, h);
- fscale = (float)w / (float)h;
- }
- mainrc.DeflateRect(25, 40, 10, 0);
- CString str;
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- rc.left -= 20;
- m_Print.SetFontFace(6, 1, "宋体");
- str.Format(" 页:%d/%d", aa + 1, pages);
- str = "制表:" + g_user.name + " 日期:" + g_date + str;
- rc.right = mainrc.right + 10;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- m_Print.SetFontFace(12, 1, "宋体");
- int wid[2] = { 70, 190 };
- int hei = 22;
- rc = mainrc;
- rc.bottom = rc.top + hei;
- rc.top += 10;
- rc.bottom += 10;
- int dtx = rc.Width() / 2 + 18;
- int dty = 380;
- int arraysize = Listarray->ElementAt(0).GetSize();
- for (int j = 0; j < 4; j++)
- {
- if (Listarray->GetSize() <= aa*sinlecount + j)continue;
- for (int i = 0; i < arraysize; i++)
- {
- rc2.top = rc.top + i / 2 * hei;
- rc2.bottom = rc.bottom + i / 2 * hei;
- rc2.left = rc.left;
- rc2.right = rc.left + wid[0];
- if (i % 2)
- {
- rc2.left = rc2.right;
- rc2.right += wid[1];
- }
- if (j == 1 || j == 3)
- {
- rc2.left += dtx;
- rc2.right += dtx;
- }
- if (j == 2 || j == 3)
- {
- rc2.top += dty;
- rc2.bottom += dty;
- }
- if (i == arraysize - 1 || i == arraysize - 2)
- {
- rc2.bottom += hei * 2;
- }
- m_Print.DrawRect2(rc2, 1);
- {
- str = Listarray->ElementAt(aa*sinlecount + j).ElementAt(i);
- if (i == arraysize - 1)
- {
- CRect rc3 = rc2;
- rc3.left += 3;
- rc3.top += 3;
- AutoDraw(m_Print, rc3, str, 1.4f);
- }
- else if (i == arraysize - 2)
- {
- CRect rc3 = rc2;
- rc3.left += 3;
- rc3.top += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc3, 0, 0, FORMAT_LEFT | FORMAT_UP);
- }
- else
- {
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- }
- }
- }
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintThumbNail(CStringArray *array, CString client, BOOL bDir, CString m_size)
- {
- // TODO: Add your control notification handler code here
- CStringArray titlearray;
- CStringArray namearray;
- CStringArray noarray;
- CArray<CRect, CRect>rcarray;
- CArray<CRect, CRect>widtharray;
- if (m_size != "")
- {
- int pos = m_size.Find(";");
- while (pos != -1)
- {
- CString size = m_size.Left(pos);
- int pos2 = size.Find(":");
- if (pos2 != -1)
- {
- CString str;
- CRect rc;
- str = size.Left(pos2);
- noarray.Add(str);
- str = size.Right(size.GetLength() - pos2 - 1);
- pos2 = str.Find(",");
- namearray.Add(str.Left(pos2)); str.Delete(0, pos2 + 1);
- pos2 = str.Find(",");
- rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
- pos2 = str.Find(",");
- rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
- widtharray.Add(rc);
- pos2 = str.Find(",");
- rc.left = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
- pos2 = str.Find(",");
- rc.top = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
- pos2 = str.Find(",");
- rc.right = atoi(str.Left(pos2)); str.Delete(0, pos2 + 1);
- rc.bottom = atoi(str);
- rcarray.Add(rc);
- }
- m_size = m_size.Right(m_size.GetLength() - pos - 1);
- pos = m_size.Find(";");
- }
- }
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- mainrc.DeflateRect(25, 50, 10, 0);
- m_Print.SetFontFace(10, 1, "宋体");
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- m_Print.DrawText((LPTSTR)(LPCTSTR)client, rc, 0, 0, FORMAT_LEFT | FORMAT_UP);
- rc.bottom -= 5;
- m_Print.DrawRect2(rc, 2);
- if (array->GetSize() > 130)m_Print.SetFontFace(8, 1, "宋体");
- if (bDir)m_Print.SetFontFace(6, 1, "宋体");
- ////////////////////////////////////////////////////////////////
- int imgcount = array->GetSize();
- int dtx = 5;
- int dty = 15;
- int cx, cy;
- int countx = 5;
- int county = 1;
- while (1)
- {
- if (countx*county >= imgcount)
- {
- cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
- cy = cx * 4 / 3;
- break;
- }
- else
- {
- cx = (mainrc.Width() - (countx - 1)*dtx) / countx;
- cy = cx * 4 / 3;
- if (cy*(county + 1) + dty*county < mainrc.Height())//Y方向可以增加一个
- {
- county++;
- }
- else//Y方向不能加,X方向加
- {
- countx++;
- county = 1;
- }
- }
- }
- int imgpos = 0;
- CString stemp;
- CPen pen(PS_SOLID, 1, RGB(255, 0, 0));
- CPen *oldpen = m_Print.m_DC.SelectObject(&pen);
- CPen *oldpen2 = m_Print.m_memdc.SelectObject(&pen);
- for (int i = 0; i < county; i++)
- {
- for (int j = 0; j < countx; j++)
- {
- rc = mainrc;
- rc.top += i*(cy + dty);
- rc.left += j*(cx + dtx);
- rc.right = rc.left + cx;
- rc.bottom = rc.top + cy;
- Image *pImg = NULL;
- if (imgpos >= array->GetSize())break;
- CString str = array->ElementAt(imgpos);
- CString spath = str.Left(str.ReverseFind('\\') + 1);
- spath += "m";
- spath += str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
- if (PathFileExists(spath))
- ::LoadImageFromBuf(&pImg, spath);
- else
- {
- ::LoadImageFromBuf(&pImg, str);
- if (pImg == NULL)continue;
- int orientation = GetOrientation(pImg);
- if (orientation == 8)
- pImg->RotateFlip(Rotate270FlipNone);
- else if (orientation == 6)
- pImg->RotateFlip(Rotate90FlipNone);
- }
- if (pImg == NULL)continue;
- rc2 = rc;
- RectFitDes(pImg->GetWidth(), pImg->GetHeight(), rc);
- imgpos++;
- m_Print.DrawImage(pImg, rc);
- int imgwidth = pImg->GetWidth();
- delete pImg;
- rc2.top = rc2.bottom + 3;
- rc2.bottom += 10;
- if (bDir == 0)
- str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
- else
- {
- stemp = str.Left(str.ReverseFind('\\'));
- str = str.Right(str.GetLength() - str.ReverseFind('\\') - 1);
- if (stemp.ReverseFind('\\') != -1)
- {
- stemp = stemp.Right(stemp.GetLength() - stemp.ReverseFind('\\') - 1);
- str = stemp + "\\" + str;
- }
- }
- if (str.Find(".") != -1)
- str = str.Left(str.Find("."));
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- if (noarray.GetSize())
- {
- rc2 = rc;
- for (int aa = 0; aa < noarray.GetSize(); aa++)
- {
- float scale = (float)rc2.Width() / (float)imgwidth;
- if (noarray.ElementAt(aa) == str)
- {
- int nIndex = aa;
- CRect rc = rcarray.ElementAt(nIndex);
- int wid = widtharray.ElementAt(nIndex).left;
- int hei = widtharray.ElementAt(nIndex).top;
- scale *= (float)imgwidth / (float)wid;
- rc.left *= scale;
- rc.right *= scale;
- rc.top *= scale;
- rc.bottom *= scale;
- rc.left += rc2.left;
- rc.right += rc2.left;
- rc.top += rc2.top;
- rc.bottom += rc2.top;
- if (rc.left < rc2.left)rc.left = rc2.left;
- if (rc.right > rc2.right)rc.right = rc2.right;
- if (rc.top < rc2.top)rc.top = rc2.top;
- if (rc.bottom > rc2.bottom)rc.bottom = rc2.bottom;
- m_Print.DrawRect2(rc, 1);
- }
- }
- }
- }
- }
- m_Print.m_DC.SelectObject(oldpen);
- m_Print.m_memdc.SelectObject(oldpen2);
- /* CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
- StrRect.top -=15;StrRect.bottom -=15;
- Image *pImg=NULL;
- ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
- m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect=load.m_rcarray .ElementAt (20);
- StrRect.right=load.m_rcarray .ElementAt (23).right;
- StrRect.top -=18;StrRect.bottom -=18;
- CString str="地址:"+g_cominfoarray.ElementAt (0).ElementAt (12);
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- */
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (dlg.DoModal() != IDOK)
- return;
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- // remark by Jeff
- // 函数:PrintDinDan
- // 参数:
- // strOrderNumber:订单单号;(Order number)
- // 返回:void
- // 注意:#
- void CMainFrame::PrintDinDan(CString strOrderNumber)//打印订单报表;
- {
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 0)
- {
- #ifdef ZHIAI_VERSION
- PrintDinDan3(strOrderNumber);
- return;
- #endif
- #ifdef SZBLCT_VERSION
- PrintDinDan4(strOrderNumber);
- return;
- #endif
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("6.lia");
- load.SetMargins(-14, 15);
- if (!load.Load())return;
- LoadRect load2;
- load2.SetLiaPath("7.lia");
- load2.SetMargins(-14, 216 + 15);
- if (!load2.Load())return;
- LoadRect load3;
- load3.SetLiaPath("8.lia");
- load3.SetMargins(-14, 705 + 15);
- if (!load3.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.code[2] = 50;
- g_sendhead.code[3] = 150;
- g_sendhead.code[4] = 77;
- g_sendhead.code[5] = 4;
- g_sendhead.tabcount = 6;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- CArray<CStringArray, CStringArray>phonearray;
- CArray<CStringArray, CStringArray>fgarray;
- CArray<CStringArray, CStringArray>danweiarray;
- CArray<CStringArray, CStringArray>jdarray;
- DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxiname;
- if (m_zs.Find("\\") != -1)
- m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
- else
- m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
- if (jdarray.GetSize())
- {
- if (m_bz.IsEmpty() == 0)
- m_bz = "\r\n" + m_bz;
- m_bz += "景点:";
- }
- #ifdef DDF_VERSION
- m_bz += "219店:219路馨园小区对面\r\n";
- m_bz += "金色店:万科金色家园小区东门南走20米荣光社区一楼\r\n";
- m_bz += "万泰店:万泰锦绣华城小区正门\r\n";
- #else
- for (i = 0; i < jdarray.GetSize(); i++)
- {
- m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
- }
- m_bz.TrimRight(";");
- #endif
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- if (IsHasRights2new(31) == 0)
- {
- m_phone1 = "***";
- m_phone2 = "***";
- }
- CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
- CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
- CString m_sex = clientarray.ElementAt(0).ElementAt(18);
- CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
- filter = "name='" + m_ren + "'";
- g_sendhead.code[0] = 5;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- g_nYearpos = g_nYearposTemp;
- if (g_bSendOK == 0)return;
- DataToArray(&phonearray);
- m_money1.Format("%f", atof(m_taoxijiage));
- m_money2.Format("%f", atof(m_payed1));
- m_money3.Format("%f", atof(m_money1) - atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- StrRect.top -= 15; StrRect.bottom -= 15;
- Image *pImg = NULL;
- #ifdef MNLS_VERSION
- LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
- #else
- ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
- #endif
- m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 30;
- StrRect.top = 12;
- StrRect.right = StrRect.left + 60;
- StrRect.bottom = StrRect.top + 60;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg; pImg = NULL;
- }
- }
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(20);
- StrRect.right = load.m_rcarray.ElementAt(23).right;
- StrRect.top -= 18; StrRect.bottom -= 18;
- CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- StrRect.top -= 15; StrRect.bottom -= 15;
- #ifdef MNLS_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- StrRect.top -= 15; StrRect.bottom -= 15;
- #ifdef MNLS_VERSION
- m_Print.DrawRect(StrRect);
- #endif
- m_Print.SetFontFace(7, 1, "黑体");
- m_Print.SetColor(0xffffff);
- #ifdef MNLS_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- m_Print.SetColor(0);
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- StrRect.top -= 15; StrRect.bottom -= 15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同预约订单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- CStringArray strarray;
- strarray.Add("NO: " + strOrderNumber);
- CString date;
- date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
- strarray.Add(date);
- strarray.Add("喜爱");
- strarray.Add("格调");
- if (fgarray.GetSize() == 12)
- {
- for (int i = 0; i < 12; i++)
- strarray.Add(fgarray.ElementAt(i).ElementAt(0));
- }
- else
- {
- strarray.Add("复古典雅");
- strarray.Add("温文尔雅");
- strarray.Add("豪华艳丽");
- strarray.Add("传统大方");
- strarray.Add("新潮个性");
- strarray.Add("浪漫奔放");
- strarray.Add("简单素雅");
- strarray.Add("活泼俏丽");
- strarray.Add("妩媚温馨");
- strarray.Add("温柔贤惠");
- strarray.Add("成熟感性");
- strarray.Add("清纯可爱");
- }
- strarray.Add("姓名");
- // strarray.Add("职业");
- strarray.Add("");
- strarray.Add("地址");
- strarray.Add("电话");
- #ifdef CHILD_VERSION
- strarray.Add("家长");
- strarray.Add("宝宝");
- #else
- strarray.Add("先生");
- strarray.Add("女士");
- #endif
- m_Print.SetFontFace(11, 1, "宋体");
- for (i = 0; i < strarray.GetSize(); i++)
- {
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- if (i < 2)
- {
- StrRect.top -= 15; StrRect.bottom -= 15;
- }
- if (i>15)
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for (i = 29; i <= 40; i++)
- {
- if (m_style.GetLength() <= (i - 29))continue;
- if (m_style.GetAt(i - 29) != '1')continue;
- StrRect = load.m_rcarray.ElementAt(i - 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for (i = 27; i <= 48; i++)
- {
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawRect2(StrRect, 1);
- }
- #ifdef CHILD_VERSION
- StrRect = load.m_rcarray.ElementAt(45);
- StrRect.right = StrRect.left + 62;
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 62;
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 62;
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 62;
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- /////////////////////////
- strarray.RemoveAll();
- CString temp;
- temp.Format("拍摄多款选 %d 款,其中影", atoi(m_outside) + atoi(m_outside2));
- strarray.Add(temp);
- temp.Format("棚景 %d 款,景点 %d 款.", atoi(m_outside2), atoi(m_outside));
- strarray.Add(temp);
- strarray.Add("化妆");
- strarray.Add("造型");
- #ifdef CHILD_VERSION
- strarray.Add("");
- #else
- strarray.Add("婚纱");
- #endif
- strarray.Add("服饰");
- strarray.Add("配");
- strarray.Add("置");
- strarray.Add("其");
- strarray.Add("它");
- strarray.Add("套系名称");
- strarray.Add("镜款");
- strarray.Add("套系总价");
- strarray.Add("主摄影师");
- strarray.Add("拍摄日期");
- strarray.Add("定金");
- #ifdef CHILD_VERSION
- strarray.Add("主引导师");
- #else
- strarray.Add("主化妆师");
- #endif
- strarray.Add("看样日期");
- strarray.Add("欠款余额");
- strarray.Add("总监");
- strarray.Add("取件日期");
- rcpos = -1;
- for (i = 0; i < strarray.GetSize(); i++)
- {
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- if (i>9)
- m_Print.DrawRect2(StrRect, 1);
- #ifdef CHILD_VERSION
- if (i == 5)
- StrRect.top -= StrRect.Height();
- #endif
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for (i = 22; i <= 41; i++)
- {
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawRect2(StrRect, 1);
- }
- /////////////////////////////
- strarray.RemoveAll();
- #ifdef CHILD_VERSION
- strarray.Add("顾客方 家长:");
- strarray.Add("宝宝:");
- #else
- strarray.Add("顾客方 先生:");
- strarray.Add("女士:");
- #endif
- strarray.Add("电话:");
- strarray.Add("影楼方 店长:");
- strarray.Add("接单人:");
- strarray.Add("电话:");
- rcpos = -1;
- for (i = 0; i < strarray.GetSize(); i++)
- {
- StrRect = load3.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- }
- for (i = 7; i <= 12; i++)
- {
- StrRect = load3.m_rcarray.ElementAt(++rcpos);
- // if(i!=10)
- m_Print.DrawRect2(StrRect, 2);
- }
- //////////////////////////////////////
- //开始打数据
- strarray.RemoveAll();
- strarray.Add(m_name1);
- strarray.Add(m_name2);
- /// strarray.Add (m_occupation1);
- // strarray.Add (m_occupation2);
- strarray.Add("");
- strarray.Add("");
- strarray.Add(m_addr1);
- #ifdef CHILD_VERSION
- strarray.Add("");
- #else
- strarray.Add(m_addr2);
- #endif
- strarray.Add(m_phone1);
- strarray.Add(m_phone2);
- for (i = 41; i <= 48; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- ///////////////////////////////
- strarray.RemoveAll();
- strarray.Add(m_money1);
- strarray.Add(m_waiter1);
- strarray.Add(m_time2);
- strarray.Add(m_money2);
- strarray.Add(m_waiter2);
- strarray.Add(m_time4);
- strarray.Add(m_money3);
- strarray.Add("");
- strarray.Add(m_time5);
- for (i = 32; i <= 40; i++)
- {
- StrRect = load2.m_rcarray.ElementAt(i - 1);
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- ///////////////////////////////
- strarray.RemoveAll();
- strarray.Add(m_name1);
- strarray.Add(m_name2);
- CString phone;
- if (m_phone1.IsEmpty() == 0)
- phone = m_phone1 + ",";
- phone += m_phone2;
- phone.TrimRight(",");
- strarray.Add(phone);
- strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
- strarray.Add(m_ren);
- strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
- for (i = 7; i <= 12; i++)
- {
- StrRect = load3.m_rcarray.ElementAt(i - 1);
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //////////////////////////////
- //开始画文字
- StrRect = load2.m_rcarray.ElementAt(30);
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- AutoDraw(m_Print, StrRect, m_bz, 1.4f);
- StrRect = load2.m_rcarray.ElementAt(29);
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = "";
- for (i = 0; i < sparray.GetSize(); i++)
- {
- str += sparray.ElementAt(i).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(i).ElementAt(3);
- str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
- str += "\r\n";
- }
- str.TrimRight("\r\n");
- AutoDraw(m_Print, StrRect, str, 1.4);
- StrRect = load2.m_rcarray.ElementAt(40);
- StrRect.top += 8;
- m_Print.SetFontFace(12, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- StrRect.left += 3;
- StrRect.top += 30;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = g_cominfoarray.ElementAt(0).ElementAt(37);
- if (str.IsEmpty())
- {
- str = "\
- 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
- 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
- 严谨的工作态度, 仔细阅读顾客须知.\r\n\
- 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
- 持良好的心境.\r\n\
- 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
- 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
- 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
- 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
- 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
- 勿进影室, 以免影响拍摄.\r\n\
- 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
- 师或店长沟通.\r\n\
- 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
- 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
- 元. 其余照片和存底本影楼只保存__个月.\r\n\
- 8. 配置内容应由所预约套系款数里挑选.\r\n\
- 9. 本合同余额欠款须在拍照前付清.\r\n\
- 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
- 签名后视为有效合同. 预约__个月内有效, 预约金不退\
- 还.";
- }
- AutoDraw(m_Print, StrRect, str, 1.8);
- }
- else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 1)
- {//AfxMessageBox("yyy");
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("6-2.lia");
- load.SetMargins(0, 0);
- if (!load.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "' and name<>'入册' and name<>'入底';id='" + strOrderNumber + "';;";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.code[2] = 50;
- g_sendhead.code[3] = 150;
- g_sendhead.code[4] = 77;
- g_sendhead.code[5] = 4;
- g_sendhead.tabcount = 6;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- CArray<CStringArray, CStringArray>phonearray;
- CArray<CStringArray, CStringArray>fgarray;
- CArray<CStringArray, CStringArray>danweiarray;
- CArray<CStringArray, CStringArray>jdarray;
- DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
- if (jdarray.GetSize())
- {
- if (m_bz.IsEmpty() == 0)
- m_bz = "\r\n" + m_bz;
- m_bz += "景点:";
- }
- for (i = 0; i < jdarray.GetSize(); i++)
- {
- m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
- }
- m_bz.TrimRight(";");
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- if (IsHasRights2new(31) == 0)
- {
- m_phone1 = "***";
- m_phone2 = "***";
- }
- CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
- CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
- CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
- CString str;
- filter = "name='" + m_ren + "'";
- g_sendhead.code[0] = 5;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- g_nYearpos = g_nYearposTemp;
- if (g_bSendOK == 0)return;
- DataToArray(&phonearray);
- m_money1.Format("%f", atof(m_taoxijiage));
- m_money2.Format("%f", atof(m_payed1));
- m_money3.Format("%f", atof(m_money1) - atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(0);
- m_Print.SetFontFace(25, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "预约单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(1);
- if (m_time1.GetLength() == 10)
- str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
- else
- str = "开单日期:";
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(2);
- m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + strOrderNumber), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- CStringArray strarray;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(137)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 47;
- StrRect.top = 12;
- StrRect.right = StrRect.left + 60;
- StrRect.bottom = StrRect.top + 60;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg; pImg = NULL;
- }
- }
- #ifdef CHILD_VERSION
- strarray.Add("家长姓名");
- strarray.Add("宝宝姓名");
- #else
- strarray.Add("先生姓名");
- strarray.Add("女士姓名");
- #endif
- strarray.Add("服装套数");
- // strarray.Add ("拍摄张数");
- #ifdef CHILD_VERSION
- strarray.Add("出生日期");
- #else
- strarray.Add("结婚日期");
- #endif
- strarray.Add("拍摄日期");
- strarray.Add("联系电话");
- strarray.Add("联系电话");
- strarray.Add("造型套数");
- if (m_zs.Find("\\") != -1)
- strarray.Add("入底\\入册");
- else
- strarray.Add("入底张数");
- strarray.Add("选片日期");
- strarray.Add("QQ/邮箱");
- strarray.Add("套系总额");
- strarray.Add("定金");
- strarray.Add("余款金额");
- strarray.Add("取件日期");
- strarray.Add(m_name1);
- strarray.Add(m_name2);
- strarray.Add(m_clothescount);
- // str.Format("%d", atoi(m_zs)*3);
- // strarray.Add (str);
- #ifdef CHILD_VERSION
- strarray.Add(m_birthday1);
- #else
- strarray.Add(m_time3);
- #endif
- strarray.Add(m_time2);
- strarray.Add(m_phone1);
- strarray.Add(m_phone2);
- strarray.Add(m_clothescount2);
- strarray.Add(m_zs);
- strarray.Add(m_time4);
- strarray.Add(m_qq1);
- strarray.Add(m_money1);
- strarray.Add(m_money2);
- strarray.Add(m_money3);
- strarray.Add(m_time5);
- for (i = 4; i <= 33; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- m_Print.DrawRect2(StrRect, 1);
- if (strarray.GetSize() > (i - 4))
- {
- if (i <= 18)
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- else
- {
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- }
- }
- int dt = 413;
- StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
- StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
- StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("网址:" + g_cominfoarray.ElementAt(0).ElementAt(13)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //////////////////////////////
- //开始画文字
- StrRect = load.m_rcarray.ElementAt(7);
- int hei = StrRect.Height();
- StrRect.top += hei;
- StrRect.bottom += hei;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top += dt;
- StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(17);
- StrRect.top += hei;
- StrRect.bottom += hei;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(33);
- StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
- StrRect.top += hei;
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = "";
- for (i = 0; i < sparray.GetSize(); i++)
- {
- str += sparray.ElementAt(i).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(i).ElementAt(3);
- str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
- str += "\r\n";
- }
- str.TrimRight("\r\n");
- AutoDraw(m_Print, StrRect, str, 1.4);
- StrRect = load.m_rcarray.ElementAt(33);
- StrRect.top += dt;
- StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
- StrRect.top += hei;
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- AutoDraw(m_Print, StrRect, m_bz, 1.4);
- StrRect = load.m_rcarray.ElementAt(34);
- StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
- StrRect.top += hei;
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = g_cominfoarray.ElementAt(0).ElementAt(37);
- if (str.IsEmpty())
- {
- str = "\
- 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
- 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
- 严谨的工作态度, 仔细阅读顾客须知.\r\n\
- 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
- 持良好的心境.\r\n\
- 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
- 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
- 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
- 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
- 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
- 勿进影室, 以免影响拍摄.\r\n\
- 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
- 师或店长沟通.\r\n\
- 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
- 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
- 元. 其余照片和存底本影楼只保存__个月.\r\n\
- 8. 配置内容应由所预约套系款数里挑选.\r\n\
- 9. 本合同余额欠款须在拍照前付清.\r\n\
- 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
- 签名后视为有效合同. 预约__个月内有效, 预约金不退\
- 还.";
- }
- AutoDraw(m_Print, StrRect, str, 1.8);
- StrRect = load.m_rcarray.ElementAt(35);
- StrRect.bottom += 100;
- // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
- 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∨";
- // AutoDraw(m_Print, StrRect, str, 1.4);
- }
- else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 2)
- {
- PrintDinDan5(strOrderNumber);
- return;
- }
- else if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
- {
- PrintDinDan6(strOrderNumber);
- return;
- }
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- dlg.m_mode = 1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CovertDate2(CString date, CString &date2)
- {
- try
- {
- if (date == "2013-04-09")
- {
- date2 = "2013-02-29";
- return;
- }
- ///////////////////////////////////
- date2 = date;
- GongToLong(date2);
- ////////////////////////////////////
- return;
- CCalendarConvert m_CalendarConvert;
- SYSTEMTIME src = { 0 };
- SYSTEMTIME dst = { 0 };
- COleDateTime m_timeLunar(atoi(date.Mid(0, 4)), atoi(date.Mid(5, 2)), atoi(date.Mid(8, 2)), 0, 0, 0);
- COleDateTime m_timeGregorian;
- m_timeLunar.GetAsSystemTime(src);
- BOOL bEmbolism = 0;
- if (m_CalendarConvert.Gregorian2Lunar(&src, &dst, &bEmbolism))
- {
- m_timeGregorian = m_CalendarConvert.ConvertSysTime2OleDateTime(&dst);
- date2.Format("%04d-%02d-%02d", m_timeGregorian.GetYear(), m_timeGregorian.GetMonth(), m_timeGregorian.GetDay());
- if (m_timeGregorian.GetYear() == -1)date2 = "2000-13-32";
- }
- else
- {
- date2.Empty();
- }
- }
- catch (...)
- {
- }
- }
- void CMainFrame::PrintDinDan5(CString m_id)
- {
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- {
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("19.lia");
- load.SetMargins(0, -20);
- if (!load.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.code[2] = 50;
- g_sendhead.code[3] = 150;
- g_sendhead.code[4] = 77;
- g_sendhead.code[5] = 4;
- g_sendhead.tabcount = 6;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- CArray<CStringArray, CStringArray>phonearray;
- CArray<CStringArray, CStringArray>fgarray;
- CArray<CStringArray, CStringArray>danweiarray;
- CArray<CStringArray, CStringArray>jdarray;
- DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 张数:" + g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(36);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
- CString m_txtype = g_List1array.ElementAt(0).ElementAt(52);
- CString m_memberno = g_List1array.ElementAt(0).ElementAt(47);
- CString str;
- if (jdarray.GetSize())
- {
- if (m_bz.IsEmpty() == 0)
- m_bz = "\r\n" + m_bz;
- m_bz += "景点:";
- }
- for (i = 0; i < jdarray.GetSize(); i++)
- {
- m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
- }
- m_bz.TrimRight(";");
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- if (IsHasRights2new(31) == 0)
- {
- m_phone1 = "***";
- m_phone2 = "***";
- }
- CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
- CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
- CString m_sex = clientarray.ElementAt(0).ElementAt(18);
- CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
- BOOL check1 = atoi(clientarray.ElementAt(0).ElementAt(15));
- filter = "name='" + m_ren + "'";
- g_sendhead.code[0] = 5;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- g_nYearpos = g_nYearposTemp;
- if (g_bSendOK == 0)return;
- DataToArray(&phonearray);
- m_money1.Format("%f", atof(m_taoxijiage));
- m_money2.Format("%f", atof(m_payed1));
- m_money3.Format("%f", atof(m_money1) - atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- //Image *pImg=NULL;
- // ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
- // m_Print.DrawImage(pImg, StrRect);
- // delete pImg;
- m_Print.SetFontFace(20, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "定单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(12, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(2);
- m_Print.DrawText((LPTSTR)(LPCTSTR)("NO." + m_id), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(3);
- str.Format("%s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(4);
- m_Print.DrawText((LPTSTR)(LPCTSTR)("联系人:" + m_name1), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- CStringArray strarray;
- strarray.Add("姓名");
- strarray.Add("性别");
- strarray.Add("年龄");
- strarray.Add("出生年月");
- strarray.Add("套系价格");
- strarray.Add("定金");
- strarray.Add("欠款");
- strarray.Add("拍摄类型");
- strarray.Add("会员卡号");
- strarray.Add("定单人");
- strarray.Add("入底\\入册");
- strarray.Add("联系电话");
- for (i = 6; i <= 17; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 6), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- strarray.RemoveAll();
- strarray.Add(m_name2);
- strarray.Add(m_sex);
- if (m_birthday.GetLength() != 10)
- strarray.Add("");
- else
- {
- int year = 0;
- if (check1)
- {
- CString date2;
- CovertDate2(g_date, date2);
- year = atoi(date2.Left(4)) - atoi(m_birthday.Left(4));
- if (date2.Right(5) >= m_birthday.Right(5))
- year++;
- }
- else
- {
- year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
- if (g_date.Right(5) >= m_birthday.Right(5))
- year++;
- }
- str.Format("%d", year);
- strarray.Add(str);
- }
- strarray.Add(m_birthday);
- strarray.Add(m_money1);
- strarray.Add(m_money2);
- strarray.Add(m_money3);
- strarray.Add(m_txtype);
- strarray.Add(m_memberno);
- strarray.Add(m_ren);
- strarray.Add(m_zs);
- if (!m_phone1.IsEmpty())
- strarray.Add(m_phone1);
- else
- strarray.Add(m_phone2);
- for (i = 18; i <= 29; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- strarray.RemoveAll();
- strarray.Add("摄影师");
- strarray.Add("拍照时间");
- strarray.Add("选片人");
- strarray.Add("选片时间");
- strarray.Add("引导师");
- strarray.Add("设计师");
- strarray.Add("取件时间");
- strarray.Add("顾客签字");
- for (i = 34; i <= 41; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 34), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- strarray.RemoveAll();
- strarray.Add(m_waiter1);
- strarray.Add(m_time2);
- strarray.Add(m_waiter3);
- strarray.Add(m_time4);
- strarray.Add(m_waiter2);
- strarray.Add(m_waiter4);
- strarray.Add(m_time5);
- strarray.Add("");
- for (i = 42; i <= 49; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(29);
- m_Print.DrawRect2(StrRect, 1);
- StrRect.top += 45;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"拍", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"摄", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"内", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"容", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(30);
- m_Print.DrawRect2(StrRect, 1);
- StrRect.top += 45;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"友", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"情", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"提", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP); StrRect.top += 20;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(37); StrRect.top = StrRect.bottom + 2;
- str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
- str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
- StrRect = load.m_rcarray.ElementAt(48); StrRect.top = StrRect.bottom + 2; StrRect.left -= 200;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- //开始画文字
- StrRect = load.m_rcarray.ElementAt(31);
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = "";
- for (i = 0; i < sparray.GetSize(); i++)
- {
- str += sparray.ElementAt(i).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(i).ElementAt(3);
- str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
- str += "\r\n";
- }
- str.TrimRight("\r\n");
- m_bz = g_List1array.ElementAt(0).ElementAt(38);
- m_bz.TrimLeft();
- if (m_bz != "")
- {
- str += "\r\n"; str += "\r\n";
- str += "备注:" + m_bz;
- }
- AutoDraw(m_Print, StrRect, str, 1.4);
- StrRect = load.m_rcarray.ElementAt(32); m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = g_cominfoarray.ElementAt(0).ElementAt(37);
- if (str.IsEmpty())
- {
- str = "\
- 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
- 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
- 严谨的工作态度, 仔细阅读顾客须知.\r\n\
- 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
- 持良好的心境.\r\n\
- 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
- 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
- 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
- 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
- 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
- 勿进影室, 以免影响拍摄.\r\n\
- 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
- 师或店长沟通.\r\n\
- 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
- 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
- 元. 其余照片和存底本影楼只保存__个月.\r\n\
- 8. 配置内容应由所预约套系款数里挑选.\r\n\
- 9. 本合同余额欠款须在拍照前付清.\r\n\
- 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
- 签名后视为有效合同. 预约__个月内有效, 预约金不退\
- 还.";
- }
- AutoDraw(m_Print, StrRect, str, 1.8);
- }
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- dlg.m_mode = 1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintDinDan4(CString m_id)
- {
- // TODO: Add your control notification handler code here
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("6-2.lia");
- load.SetMargins(0, 0);
- if (!load.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.code[2] = 50;
- g_sendhead.code[3] = 150;
- g_sendhead.code[4] = 77;
- g_sendhead.code[5] = 4;
- g_sendhead.tabcount = 6;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- CArray<CStringArray, CStringArray>phonearray;
- CArray<CStringArray, CStringArray>fgarray;
- CArray<CStringArray, CStringArray>danweiarray;
- CArray<CStringArray, CStringArray>jdarray;
- DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
- if (jdarray.GetSize())
- {
- if (m_bz.IsEmpty() == 0)
- m_bz = "\r\n" + m_bz;
- m_bz += "景点:";
- }
- for (i = 0; i < jdarray.GetSize(); i++)
- {
- m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
- }
- m_bz.TrimRight(";");
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- if (IsHasRights2new(31) == 0)
- {
- m_phone1 = "***";
- m_phone2 = "***";
- }
- CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
- CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
- CString str;
- filter = "name='" + m_ren + "'";
- g_sendhead.code[0] = 5;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- g_nYearpos = g_nYearposTemp;
- if (g_bSendOK == 0)return;
- DataToArray(&phonearray);
- m_money1.Format("%f", atof(m_taoxijiage));
- m_money2.Format("%f", atof(m_payed1));
- m_money3.Format("%f", atof(m_money1) - atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(0);
- m_Print.SetFontFace(25, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"巴黎春天婚纱摄影预约单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(1);
- if (m_time1.GetLength() == 10)
- str.Format("开单日期: %s 年 %s 月 %s 日", m_time1.Left(4), m_time1.Mid(5, 2), m_time1.Mid(8, 2));
- else
- str = "开单日期:";
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(2);
- m_Print.DrawText((LPTSTR)(LPCTSTR)("No." + m_id), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- CStringArray strarray;
- strarray.Add("先生姓名");
- strarray.Add("女士姓名");
- strarray.Add("服装套数");
- strarray.Add("拍摄张数");
- strarray.Add("拍摄日期");
- strarray.Add("联系电话");
- strarray.Add("联系电话");
- strarray.Add("造型套数");
- strarray.Add("入册张数");
- strarray.Add("选片日期");
- strarray.Add("QQ/邮箱");
- strarray.Add("套系总额");
- strarray.Add("定金");
- strarray.Add("余款金额");
- strarray.Add("取件日期");
- strarray.Add(m_name1);
- strarray.Add(m_name2);
- strarray.Add(m_clothescount);
- str.Format("%d", atoi(m_zs) * 3);
- strarray.Add(str);
- strarray.Add(m_time2);
- strarray.Add(m_phone1);
- strarray.Add(m_phone2);
- strarray.Add(m_clothescount2);
- strarray.Add(m_zs);
- strarray.Add(m_time4);
- strarray.Add(m_qq1);
- strarray.Add(m_money1);
- strarray.Add(m_money2);
- strarray.Add(m_money3);
- strarray.Add(m_time5);
- for (i = 4; i <= 33; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- m_Print.DrawRect2(StrRect, 1);
- if (strarray.GetSize() > (i - 4))
- {
- if (i <= 18)
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- else
- {
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 4), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- }
- }
- int dt = 413;
- StrRect = load.m_rcarray.ElementAt(36); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"门市签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(37); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
- StrRect = load.m_rcarray.ElementAt(38); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客签名", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(39); StrRect.top += dt; StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1); StrRect.left += 4;
- StrRect = load.m_rcarray.ElementAt(40); StrRect.top += dt; StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"地址:深圳市红岭中路中深国际大厦首层,二十二层", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(41); StrRect.top += dt; StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:0755-61308198 61308199 25860696 25860697", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(42); StrRect.top += dt; StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"网址:www.paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(43); StrRect.top += dt; StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"邮箱:blct@paris-spring.cn", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //////////////////////////////
- //开始画文字
- StrRect = load.m_rcarray.ElementAt(7);
- int hei = StrRect.Height();
- StrRect.top += hei;
- StrRect.bottom += hei;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"详细内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top += dt;
- StrRect.bottom += dt;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"备注内容:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(17);
- StrRect.top += hei;
- StrRect.bottom += hei;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(33);
- StrRect.bottom = StrRect.top + dt; m_Print.DrawRect2(StrRect, 1);
- StrRect.top += hei;
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = "";
- for (i = 0; i < sparray.GetSize(); i++)
- {
- str += sparray.ElementAt(i).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(i).ElementAt(3);
- str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
- str += "\r\n";
- }
- str.TrimRight("\r\n");
- AutoDraw(m_Print, StrRect, str, 1.4);
- StrRect = load.m_rcarray.ElementAt(33);
- StrRect.top += dt;
- StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
- StrRect.top += hei;
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- AutoDraw(m_Print, StrRect, m_bz, 1.4);
- StrRect = load.m_rcarray.ElementAt(34);
- StrRect.bottom += dt; m_Print.DrawRect2(StrRect, 1);
- StrRect.top += hei;
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = g_cominfoarray.ElementAt(0).ElementAt(37);
- if (str.IsEmpty())
- {
- str = "\
- 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
- 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
- 严谨的工作态度, 仔细阅读顾客须知.\r\n\
- 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
- 持良好的心境.\r\n\
- 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
- 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
- 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
- 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
- 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
- 勿进影室, 以免影响拍摄.\r\n\
- 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
- 师或店长沟通.\r\n\
- 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
- 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
- 元. 其余照片和存底本影楼只保存__个月.\r\n\
- 8. 配置内容应由所预约套系款数里挑选.\r\n\
- 9. 本合同余额欠款须在拍照前付清.\r\n\
- 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
- 签名后视为有效合同. 预约__个月内有效, 预约金不退\
- 还.";
- }
- AutoDraw(m_Print, StrRect, str, 1.8);
- StrRect = load.m_rcarray.ElementAt(35);
- StrRect.bottom += 100;
- // str="第一联:存根<白> 第二联:客户<红> 第三联:流程<黄> ";
- 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∨";
- AutoDraw(m_Print, StrRect, str, 1.4);
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (dlg.DoModal() != IDOK)return;
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- int CalHeight_01(CRect &rc, CStringArray *saContent, CPrintRX *Print, int FORMAT)
- {
- CSize size;
- int nMaxheight = 0;
- CString strTemp;
- CString strContent;
- int nSize = saContent->GetSize();
- int nRow = 0; // 行数;
- for (int i = 0; i < nSize; i++)
- {
- strTemp = "";
- strContent = saContent->ElementAt(i);
- while (FALSE == strContent.IsEmpty())
- {
- strContent = strContent.Mid(strTemp.GetLength());
- if (strContent.IsEmpty())
- break;
- Print->GetStrSize((LPTSTR)(LPCTSTR)strContent, size);
- if (size.cx <= rc.Width())
- {
- CRect rc2 = rc;
- rc2.top += nRow*(size.cy + 1);
- rc2.bottom = rc2.top + (size.cy + 1);
- Print->DrawText((LPTSTR)(LPCTSTR)strContent, rc2, 0, 0, FORMAT | FORMAT_UP);
- nMaxheight = max(nMaxheight, rc2.bottom);
- nRow++;
- break;
- }
- int right = 0;
- while (size.cx > rc.Width())
- {
- right++;
- strTemp = strContent.Left(strContent.GetLength() - (right));
- if (GIsHalfHZ(strTemp))
- {
- right++;
- strTemp.Delete(strTemp.GetLength() - 1);
- }
- Print->GetStrSize((LPTSTR)(LPCTSTR)strTemp, size);
- }
- CRect rc2 = rc;
- rc2.top += nRow*(size.cy + 1);
- rc2.bottom = rc2.top + (size.cy + 1);
- Print->DrawText((LPTSTR)(LPCTSTR)strTemp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
- nRow++;
- nMaxheight = max(nMaxheight, rc2.bottom);
- }
- }
- return (nMaxheight == 0) ? (rc.bottom + 1) : (nMaxheight + 1);
- }
- /************************************************************************/
- /*
- 多字节字符编码下的CaleHeight函数;
- 函数:CaleHeight
- 描述:计算出一行高度可变,宽度特定的表格(CArray<CRect,CRect>),在输入指定内容时(CStringArray),表格高度变化最大的值。
- 参数:
- aRowRect: 一行表格,CArray::GetSize()表示表格列数;
- aRowStr: 与表格对应的一行字符,CStringArray::GetSize()大小与CArray::GetSize()一致。
- pPrinter: 打印机实例指针;
- nFormat: 字符串的显示格式。
- 返回:返回最大的表格高度;
- 注意:只能多字节下使用,因为函数GIsHalfHZ。
- */
- /************************************************************************/
- INT CalcHeight( IN CArray<CRect, CRect> &aRowRect, IN CStringArray &aRowStr, IN CPrintRX *pPrinter, IN CONST INT& nFormat)
- {
- // 参数有效性;
- if( aRowRect.GetSize() != aRowStr.GetSize() )
- {
- OutputDebugString(_T("表格列数与字符列数不等!\n"));
- return -1;
- }
- if( pPrinter == NULL )
- {
- OutputDebugString(_T("打印机句柄指针无效\n"));
- return -1;
- }
- // 表格字串长度;
- CSize size;
- // 当前表格字体高度;
- INT nGridFontHeight = 0;
- // 当前表格区域;
- CRect curGrid;
- // 当前表格字符串;
- CString strGridContent;
- // 最大值高底;
- INT nMaxHeigth = 0;
- // 当前换行数;
- INT nWrapRows = 0;
- // 当前换行字串;
- CString strWrapRow = _T("");
- // 表格列数;
- INT nColumns = aRowRect.GetSize();
- // 临时表格;
- CRect rcGrid;
- // 循环计算每个表格的高度;
- for( INT i = 0; i < nColumns; i++ )
- {
- nWrapRows = 0;
- strWrapRow.Empty();
- curGrid = aRowRect.ElementAt(i);
- strGridContent = aRowStr.ElementAt(i);
- nMaxHeigth = max(nMaxHeigth, curGrid.bottom);
- while( !strGridContent.IsEmpty() )
- {
- strGridContent = strGridContent.Right(strGridContent.GetLength() - strWrapRow.GetLength());
- if ( strGridContent.IsEmpty() )
- {
- OutputDebugString(_T("表格字符已空\n"));
- break;
- }
- pPrinter->GetStrSize((LPTSTR)(LPCTSTR)strGridContent, size);
- nGridFontHeight = size.cy + 1;
- // 字串长度 <= 表格宽度;
- if( size.cx <= curGrid.Width() )
- {
- rcGrid = curGrid;
- rcGrid.top += nWrapRows*nGridFontHeight;
- rcGrid.bottom = rcGrid.top + nGridFontHeight;
- nMaxHeigth = max(nMaxHeigth, rcGrid.bottom);
- pPrinter->DrawText((LPTSTR)(LPCTSTR)strGridContent, rcGrid, 0, 0, nFormat|FORMAT_UP);
- break;
- }
- else
- {// 字串长度 >= 表格宽度;
- INT nRight = 0; // 字串右位置;
- // 从右边开始逐个字符取出,直到左边字串小于表格宽度;
- while( size.cx > curGrid.Width() )
- {
- nRight++;
- strWrapRow = strGridContent.Left(strGridContent.GetLength() - nRight);
- if( GIsHalfHZ(strWrapRow) )
- {// 判断字串最后一个字符是否是汉字;
- nRight++;
- strWrapRow.Delete(strWrapRow.GetLength() - 1);
- }
- pPrinter->GetStrSize((LPTSTR)(LPCTSTR)strWrapRow, size);
- }
- rcGrid = curGrid;
- rcGrid.top += nWrapRows*nGridFontHeight;
- rcGrid.bottom = rcGrid.top + nGridFontHeight;
- nMaxHeigth = max(nMaxHeigth, rcGrid.bottom);
- pPrinter->DrawText((LPTSTR)(LPCTSTR)strWrapRow, rcGrid, 0, 0, nFormat|FORMAT_UP);
- // 换行加+1;
- nWrapRows++;
- }
- }
- }
- return nMaxHeigth + 1;
- }
- void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
- {
- //AfxMessageBox("abce");
- int i = 0;
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 24;
- g_sendhead.tabcount = 1;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- if (0 == g_bSendOK)return;
- DataToArray(&g_cominfoarray);
- CString SerialNo;
- SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
- SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- CString sql;
- sql.Format("update version set [serialno]='%s'", SerialNo);
- g_sendhead.bsql=1;
- g_nYearposTemp=g_nYearpos;
- g_nYearpos=-1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_nYearpos=g_nYearposTemp;
- #endif
- // 1.创建打印对象
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- // 2.开始打印
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- BOOL bSmall = 0;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
- {
- bSmall = 1;
- load.SetLiaPath("20.lia");
- }
- else
- load.SetLiaPath("10.lia");
- if (bSmall)
- load.SetMargins(0, 0);
- else
- load.SetMargins(10, 0);
- if (!load.Load())return;
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 65;
- if (bSmall) StrRect.left = 55;
- StrRect.top = 10;
- StrRect.right = StrRect.left + 58;
- StrRect.bottom = StrRect.top + 58;
- // 3.打印2维码图像;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- pImg = NULL;
- }
- }
- //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
- if (bSmall)
- {
- m_Print.SetFontFace(18, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(6, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- int hei = StrRect.Height();
- StrRect.bottom = StrRect.top;
- StrRect.top -= 8;
- m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(8, 1, "宋体");
- for (i = 7; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- for (i = 9; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- m_Print.SetFontFace(6, 1, "宋体");
- for (i = 24; i < 26; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- if (i == 24)
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- else
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- }
- // StrRect=load.m_rcarray .ElementAt (27);
- // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
- }
- else//大单
- {
- // 1.打印表头(蒙娜丽莎收款单)
- m_Print.SetFontFace(20, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- // 2.打印订单号(NO.20140608-001)
- StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- // 3.打印SerialNo(SerialNo.01062)
- int hei = StrRect.Height();
- StrRect.bottom = StrRect.top;
- StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
- // 4.打印影楼地址信息、电话;
- m_Print.SetFontFace(8, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- // 5.打印客户姓名
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- // 6.打印客户联系电话
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- // 7.打印开单日期
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- // 8.打印列字段:收款项目
- m_Print.SetFontFace(13, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- // 9.打印列字段:金额
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- // 10.打印列字段:开单人
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- // 11.画表格-画3列;
- m_Print.SetFontFace(11, 1, "宋体");
- for (i = 7; i < 10; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- }
- // 12.打印详细内容
- int dty = 0;
- int dtytemp = 0;
- // for( i=10; i<14; i+=3)
- for (i = 10; i<22; i += 3) // 循环4次,再画
- {
- /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
- CArray<CRect, CRect>rcarray;
- CStringArray strarray2;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.top += dty;
- StrRect.bottom += dty;
- dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
- break;
- }
- // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 4;
- rcarray.Add(StrRect);
- strarray2.Add(pArray->ElementAt(i));
- // 指定格子宽度,计算字符串占几行(高度).
- INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- dtytemp = bottom - StrRect.bottom;
- /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
- // 重新获取表格大小,并画出表格;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.bottom += dtytemp;
- StrRect.top += dty;
- StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- // 获取下一表格大小,并画出表格;
- StrRect = load.m_rcarray.ElementAt(i + 1);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.bottom += dtytemp;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- // 打印出金额字段内容
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n",i+1,pArray->ElementAt(i+1));//Jeff Printf;
- StrRect = load.m_rcarray.ElementAt(i + 2);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.bottom += dtytemp;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- // 打印开单人字段内容
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n",i+2,pArray->ElementAt(i+2));//Jeff Printf;
- dty += dtytemp;
- }
- //.打印->付款情况 应付 实付 欠款.
- i = 22;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
- //.打印->合计人民币(大写):.......
- i = 23;
- StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
- m_Print.SetFontFace(7, 1, "宋体");
- for (i = 24; i < 27; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i); StrRect.top += dty; StrRect.bottom += dty;
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect = load.m_rcarray.ElementAt(24); StrRect.top += dty; StrRect.bottom += dty;
- hei = StrRect.Height();
- StrRect.top += hei;
- StrRect.bottom += hei;
- StrRect.right += 100;
- StrRect.left += 2;
- StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
- AutoDraw(m_Print, StrRect, pArray->ElementAt(27), 1.0);
- }
- PrintPreview dlg;
- dlg.m_mode = 3;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
- SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- CString sql;
- sql.Format("update version set [serialno]='%s'", SerialNo);
- g_sendhead.bsql = 1;
- g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_nYearpos = g_nYearposTemp;
- #endif
- }
- }
- /************************************************************************/
- /*
- 函数:PrintRechargeRecord
- 描述:打印会员卡充值记录;
- 参数:
- pArryRechargeRecod[IN]:要打印的数据;
- 返回:
- 注意:
- 示例:
- */
- /************************************************************************/
- void CMainFrame::PrintRechargeRecord(CStringArray *pArryRechargeRecod)
- {
-
- }
- void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
- {
- //AfxMessageBox("abce");
- int i = 0;
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++) // Jeff, printcot=1....
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 24;
- g_sendhead.tabcount = 1;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- if (0 == g_bSendOK)return;
- DataToArray(&g_cominfoarray);
- CString SerialNo;
- SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- #if 0 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
- SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- CString sql;
- sql.Format("update version set [serialno]='%s'", SerialNo);
- g_sendhead.bsql=1;
- g_nYearposTemp=g_nYearpos;
- g_nYearpos=-1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_nYearpos=g_nYearposTemp;
- #endif
- // 1.创建打印对象
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
- m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- // 2.开始打印
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- BOOL bSmall = 0;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
- {
- bSmall = 1;
- load.SetLiaPath("20.lia");
- }
- else
- load.SetLiaPath("10.lia");
- if (bSmall)
- load.SetMargins(0, 0);
- else
- load.SetMargins(10, 0);
- if (!load.Load())return;
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 65;
- if (bSmall) StrRect.left = 55;
- StrRect.top = 10;
- StrRect.right = StrRect.left + 58;
- StrRect.bottom = StrRect.top + 58;
- // 3.打印2维码图像;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- pImg = NULL;
- }
- }
- //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
- if (bSmall)
- {
- m_Print.SetFontFace(18, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(6, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- int hei = StrRect.Height();
- StrRect.bottom = StrRect.top;
- StrRect.top -= 8;
- m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(8, 1, "宋体");
- for ( i = 7; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- for (i = 9; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- m_Print.SetFontFace(6, 1, "宋体");
- for (i = 24; i < 26; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- if (i == 24)
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- else
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- }
- // StrRect=load.m_rcarray .ElementAt (27);
- // AutoDraw(m_Print, StrRect, pArray->ElementAt (27), 1.0);
- }
- else//大单
- {
- // 1.打印表头(蒙娜丽莎收款单)
- m_Print.SetFontFace(20, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- // 2.打印订单号(NO.20140608-001)
- StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- // 3.打印SerialNo(SerialNo.01062)
- int hei = StrRect.Height();
- StrRect.bottom = StrRect.top;
- StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
- // 4.打印影楼地址信息、电话;
- m_Print.SetFontFace(8, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- // 5.打印客户姓名
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- // 6.打印客户联系电话
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- // 7.打印开单日期
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- #if 0 // Original Edition
- // 8.打印列字段:收款项目
- m_Print.SetFontFace(13, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- // 9.打印列字段:金额
- StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- // 10.打印列字段:开单人
- StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- #else
- // 8.打印列字段:收款项目
- m_Print.SetFontFace(13, 1, "宋体");
- //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- StrRect = CRect(66, 85, 280, 105);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
- // 8.1 Jeff add:支付方式
- //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- StrRect = CRect(280, 85, 350, 105);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
- // 9.打印列字段:金额
- //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- StrRect = CRect(350, 85, 442, 105);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
- // 10.打印列字段:开单人
- //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- StrRect = CRect(442, 85, 535, 105);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
- //rcpos += 3;
- #endif
- // 11.画表格-画3列;old
- // 11.draw 4 column
- m_Print.SetFontFace(11, 1, "宋体");
- //for( i=7; i<10; i++)
- //{
- // StrRect=load.m_rcarray.ElementAt(i);
- // m_Print.DrawRect2(StrRect, 1);
- //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- //}
- m_Print.DrawRect2(CRect(66, 85, 280, 105), 1);
- m_Print.DrawRect2(CRect(280, 85, 350, 105), 1);
- m_Print.DrawRect2(CRect(350, 85, 442, 105), 1);
- m_Print.DrawRect2(CRect(442, 85, 535, 105), 1);
- // 12.打印详细内容
- int dty = 0;
- int dtytemp = 0;
- // for( i=10; i<14; i+=3)
- //for( i=10; i<22; i+=3) // 循环4次,再画
- int j = 0;
- for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
- {
- /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
- CArray<CRect, CRect>rcarray;
- CStringArray strarray2;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.right -= 70; // Jeff add
- //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;
- /*
- 4次的CRect
- 66,105,350,125
- 66,126,350,146
- 66,147,350,167
- 66,168,350,188
- */
- if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.top += dty;
- StrRect.bottom += dty;
- dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
- break;
- }
- // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 4;
- rcarray.Add(StrRect);
- //strarray2.Add(pArray->ElementAt(i+1));
- strarray2.Add(pArray->ElementAt(j));
- //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
- // 指定格子宽度,计算字符串占几行(高度).
- INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- dtytemp = bottom - StrRect.bottom;
- /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
- // 重新获取表格大小,并画出表格;
- /*
- CRect(66,85,280,105),
- CRect(280,85,350,105)
- CRect(350,85,442,105)
- CRect(442,85,535,105)
- CRect(66,105,350,125),
- CRect(66,126,350,146)
- CRect(66,147,350,167)
- CRect(66,168,350,188)
- */
- // 画收款项目框及打印内容;
- StrRect = load.m_rcarray.ElementAt(i);
- //StrRect=CRect(66,85,280,105);
- StrRect.bottom += dtytemp;
- StrRect.top += dty;
- StrRect.bottom += dty;
- //StrRect.left -= 70; // Jeff add
- StrRect.right -= 70; // Jeff add
- //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;
- m_Print.DrawRect2(StrRect, 1);
- // 画支付方式框及打印内容;
- StrRect = load.m_rcarray.ElementAt(i);
- //StrRect=CRect(280,85,350,105);
- StrRect.bottom += dtytemp;
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.left += StrRect.Width() - 70;
- //StrRect.right += 70; // Jeff add
- //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;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
- // 画金额框及打印内容;
- StrRect = load.m_rcarray.ElementAt(i + 1);
- //StrRect=CRect(350,85,442,105);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.bottom += dtytemp;
- //StrRect.right -= 70; // Jeff add
- //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;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- // 打印出金额字段内容
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
- // 画开单人框及打印内容;
- StrRect = load.m_rcarray.ElementAt(i + 2);
- //StrRect=CRect(442,85,535,105);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.bottom += dtytemp;
- //StrRect.right -= 70; // Jeff add
- //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;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- // 打印开单人字段内容
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
- dty += dtytemp;
- }
- //.打印->付款情况 应付 实付 欠款.
- i = 22;
- j = 27;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
- //.打印->合计人民币(大写):.......
- i = 23;
- j = 28;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
- // 打印总金额;
- m_Print.SetFontFace(7, 1, "宋体");
- for (i = 24, j = 29; i < 27; i++, j++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty;
- StrRect.bottom += dty;
- hei = StrRect.Height();
- StrRect.top += hei;
- StrRect.bottom += hei;
- StrRect.right += 100;
- StrRect.left += 2;
- StrRect = load.m_rcarray.ElementAt(27); StrRect.top += dty; StrRect.bottom += dty;
- AutoDraw(m_Print, StrRect, pArray->ElementAt(32), 1.0);
- }
- PrintPreview dlg;
- dlg.m_mode = 3;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- {
- return;
- }
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
- SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- CString sql;
- sql.Format("update version set [serialno]='%s'", SerialNo);
- g_sendhead.bsql = 1;
- g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_nYearpos = g_nYearposTemp;
- #endif
- }
- }
- void CMainFrame::PrintReceipt_02(CStringArray *pArray, CPrintRX *pPrinter, const int &nCount, const BOOL bPrintImmediately) // 打印订单*预约收款、预约补款*
- {
- //AfxMessageBox("abce");
- int printcot = 1;
- // for(int aa=0; aa<printcot; aa++) // Jeff, printcot=1....
- // {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 24;
- g_sendhead.tabcount = 1;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- if (0 == g_bSendOK)return;
- DataToArray(&g_cominfoarray);
- CString SerialNo;
- SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- CPrintRX *tagPrinter = NULL;
- if (pPrinter == NULL)
- {
- // 1.创建打印对象
- tagPrinter = new CPrintRX;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- tagPrinter->InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
- if (name.IsEmpty())
- {
- tagPrinter->InitToPrint(NULL, 1);
- }
- else
- {
- int nret = tagPrinter->InitToPrint((char*)(LPCTSTR)name, 1);
- ///if(nret==-1 && aa==0)
- if (nret == -1)
- {
- if (bPrintImmediately == FALSE)
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
- tagPrinter->InitToPrint(NULL, 1);
- }
- }
- }
- // 2.开始打印
- tagPrinter->StartPrint();
- tagPrinter->StartPage();
- }
- else
- {
- //SerialNo.Format ("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126))+1);
- tagPrinter = pPrinter;
- }
- LoadRect load;
- BOOL bSmall = 0;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
- {
- bSmall = 1;
- load.SetLiaPath("20.lia");
- }
- else
- load.SetLiaPath("10.lia");
- if (bSmall)
- load.SetMargins(0, 0);
- else
- load.SetMargins(10, 0);
- if (!load.Load())return;
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 65;
- if (bSmall) StrRect.left = 55;
- StrRect.top = 10;
- StrRect.right = StrRect.left + 58;
- StrRect.bottom = StrRect.top + 58;
- // 3.打印2维码图像;
- tagPrinter->DrawImage(pImg, StrRect);
- delete pImg;
- pImg = NULL;
- }
- }
- //printf("Jeff:bSmall=%d\n\n",bSmall);//Jeff Printf;
- if (bSmall)
- {
- tagPrinter->SetFontFace(18, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- tagPrinter->SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- tagPrinter->SetFontFace(6, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- tagPrinter->SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- int hei = StrRect.Height();
- StrRect.bottom = StrRect.top;
- StrRect.top -= 8;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
- tagPrinter->SetFontFace(11, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- tagPrinter->SetFontFace(8, 1, "宋体");
- int i = 0;
- for (i = 7; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- tagPrinter->DrawRect2(StrRect, 1);
- }
- for (i = 9; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- tagPrinter->SetFontFace(6, 1, "宋体");
- for (i = 24; i < 26; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect = load.m_rcarray.ElementAt(22);
- int nH = StrRect.Height();
- int nW = StrRect.Width();
- int nlen = load.m_rcarray.GetSize();
- int nLeft = StrRect.left;
- int j = 0;
- for (i = 27; i<32; i++)
- {
- CRect rct = StrRect;
- if(i == 31)
- {
- rct.top = rct.top + (nH*(j - 1));
- rct.bottom = rct.top + nH;
- rct.left = rct.left + 200;
- rct.right = rct.left + 200;
- }
- else
- {
- rct.top = rct.top + (nH*j);
- rct.bottom = rct.top + nH;
- rct.left = rct.left + 2;
- rct.right = rct.left + 200;
- }
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), rct, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- j++;
- }
- }
- else//大单
- {
- // 1.打印表头(蒙娜丽莎收款单)
- tagPrinter->SetFontFace(20, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- tagPrinter->SetFontFace(11, 1, "宋体");
- // 2.打印订单号(NO.20140608-001)
- StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- // 3.打印SerialNo(SerialNo.01062)
- int hei = StrRect.Height();
- StrRect.bottom = StrRect.top;
- StrRect.top -= 10; //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
- // 4.打印影楼地址信息、电话;
- tagPrinter->SetFontFace(8, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- tagPrinter->SetFontFace(11, 1, "宋体");
- // 5.打印客户姓名
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- // 6.打印客户联系电话
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- // 7.打印开单日期
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- #if 0 // Original Edition
- // 8.打印列字段:收款项目
- tagPrinter->SetFontFace(13, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- printf("Jeff:收款项目:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- // 9.打印列字段:金额
- StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- printf("Jeff:金额:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- // 10.打印列字段:开单人
- StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- printf("Jeff:开单人:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- #else
- // 8.打印列字段:收款项目
- tagPrinter->SetFontFace(13, 1, "宋体");
- //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- StrRect = CRect(66, 85, 280, 105);
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //m_Print.DrawText("收款项目",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
- // 8.1 Jeff add:支付方式
- //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- StrRect = CRect(280, 85, 350, 105);
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //m_Print.DrawText("支付方式",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
- // 9.打印列字段:金额
- //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- StrRect = CRect(350, 85, 442, 105);
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //m_Print.DrawText("金额",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
- // 10.打印列字段:开单人
- //StrRect=load.m_rcarray .ElementAt (++rcpos); //printf("Jeff:%d:%s\n\n",rcpos,pArray->ElementAt(rcpos));//Jeff Printf;
- StrRect = CRect(442, 85, 535, 105);
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(++rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //m_Print.DrawText("开单人",StrRect,0,0,FORMAT_LEFT | FORMAT_VCENTER);
- //rcpos += 3;
- #endif
- // 11.画表格-画3列;old
- // 11.draw 4 column
- tagPrinter->SetFontFace(11, 1, "宋体");
- int i;
- //for( i=7; i<10; i++)
- //{
- // StrRect=load.m_rcarray.ElementAt(i);
- // m_Print.DrawRect2(StrRect, 1);
- //printf("Jeff:left=%d,top=%d,right=%d,bottom=%d.\n\n",StrRect.left,StrRect.top,StrRect.right,StrRect.bottom); // Jeff Printf;
- //}
- tagPrinter->DrawRect2(CRect(66, 85, 280, 105), 1);
- tagPrinter->DrawRect2(CRect(280, 85, 350, 105), 1);
- tagPrinter->DrawRect2(CRect(350, 85, 442, 105), 1);
- tagPrinter->DrawRect2(CRect(442, 85, 535, 105), 1);
- // 12.打印详细内容
- int dty = 0;
- int dtytemp = 0;
- // for( i=10; i<14; i+=3)
- //for( i=10; i<22; i+=3) // 循环4次,再画
- int j = 0;
- for (i = 10, j = 11; i<22; i += 3, j += 4) // 循环4次,再画
- {
- /***************+计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)+***************************/
- CArray<CRect, CRect>rcarray;
- CStringArray strarray2;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.right -= 70; // Jeff add
- //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;
- /*
- 4次的CRect
- 66,105,350,125
- 66,126,350,146
- 66,147,350,167
- 66,168,350,188
- */
- if (StrRect.bottom > load.m_rcarray.ElementAt(22).top + 5)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.top += dty;
- StrRect.bottom += dty;
- dty = StrRect.bottom - load.m_rcarray.ElementAt(22).top;
- break;
- }
- // 文字rect要左缩进2像素,右缩进2像素,上缩进4像素;
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 4;
- rcarray.Add(StrRect);
- //strarray2.Add(pArray->ElementAt(i+1));
- strarray2.Add(pArray->ElementAt(j));
- //printf("Jeff:%d:%s\n\n",j,pArray->ElementAt(j));//Jeff Printf;
- // 指定格子宽度,计算字符串占几行(高度).
- INT bottom = CalcHeight(rcarray, strarray2, tagPrinter, FORMAT_LEFT);
- dtytemp = bottom - StrRect.bottom;
- /***************-计算表格内文字将占用多少高度(几行),并打印(收款项目列字段内容)-***************************/
- // 重新获取表格大小,并画出表格;
- /*
- CRect(66,85,280,105),
- CRect(280,85,350,105)
- CRect(350,85,442,105)
- CRect(442,85,535,105)
- CRect(66,105,350,125),
- CRect(66,126,350,146)
- CRect(66,147,350,167)
- CRect(66,168,350,188)
- */
- // 画收款项目框及打印内容;
- StrRect = load.m_rcarray.ElementAt(i);
- //StrRect=CRect(66,85,280,105);
- StrRect.bottom += dtytemp;
- StrRect.top += dty;
- StrRect.bottom += dty;
- //StrRect.left -= 70; // Jeff add
- StrRect.right -= 70; // Jeff add
- //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;
- tagPrinter->DrawRect2(StrRect, 1);
- // 画支付方式框及打印内容;
- StrRect = load.m_rcarray.ElementAt(i);
- //StrRect=CRect(280,85,350,105);
- StrRect.bottom += dtytemp;
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.left += StrRect.Width() - 70;
- //StrRect.right += 70; // Jeff add
- //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;
- tagPrinter->DrawRect2(StrRect, 1);
- StrRect.left += 2;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 1), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n",j+1,pArray->ElementAt(j+1));//Jeff Printf;
- // 画金额框及打印内容;
- StrRect = load.m_rcarray.ElementAt(i + 1);
- //StrRect=CRect(350,85,442,105);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.bottom += dtytemp;
- //StrRect.right -= 70; // Jeff add
- //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;
- tagPrinter->DrawRect2(StrRect, 1);
- StrRect.left += 2;
- // 打印出金额字段内容
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 2), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n",j+2,pArray->ElementAt(j+2));//Jeff Printf;
- // 画开单人框及打印内容;
- StrRect = load.m_rcarray.ElementAt(i + 2);
- //StrRect=CRect(442,85,535,105);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.bottom += dtytemp;
- //StrRect.right -= 70; // Jeff add
- //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;
- tagPrinter->DrawRect2(StrRect, 1);
- StrRect.left += 2;
- // 打印开单人字段内容
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j + 3), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n",j+3,pArray->ElementAt(j+3));//Jeff Printf;
- dty += dtytemp;
- }
- //.打印->付款情况 应付 实付 欠款.
- i = 22;
- j = 27;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- tagPrinter->DrawRect2(StrRect, 1);
- StrRect.left += 2;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
- //.打印->合计人民币(大写):.......
- i = 23;
- j = 28;
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- tagPrinter->DrawRect2(StrRect, 1);
- StrRect.left += 2;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //printf("Jeff:%d:%s\n\n\n\n",i,pArray->ElementAt(i));//Jeff Printf;
- // 打印总金额;
- tagPrinter->SetFontFace(7, 1, "宋体");
- for (i = 24, j = 29; i < 27; i++, j++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.left += 2;
- tagPrinter->DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(j), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty;
- StrRect.bottom += dty;
- hei = StrRect.Height();
- StrRect.top += hei;
- StrRect.bottom += hei;
- StrRect.right += 100;
- StrRect.left += 2;
- StrRect = load.m_rcarray.ElementAt(27);
- StrRect.top += dty;
- StrRect.bottom += dty;
- AutoDraw(*tagPrinter, StrRect, pArray->ElementAt(32), 1.0);
- }
- if (bPrintImmediately == TRUE)
- {
- printcot = nCount;
- ////结束打印
- tagPrinter->EndPage();
- tagPrinter->EndPrint();
- #if 1 // Jeff.将Serialno的值变化放在获取Serialno后立即改变,以降低Serialno在获取时值保持不变的情况;//2014.09.01
- SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- CString sql;
- sql.Format("update version set [serialno]='%s'", SerialNo);
- g_sendhead.bsql = 1;
- g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_nYearpos = g_nYearposTemp;
- #endif
- }
- else
- {
- PrintPreview dlg;
- dlg.m_mode = 3;
- tagPrinter->GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = tagPrinter->GetPDC();
- //if(aa==0)
- //{
- if (dlg.DoModal() != IDOK)
- {
- return;
- }
- else
- {
- printcot = dlg.m_num;
- //m_Print.deletePrinter();
- for (int i = 0; i < printcot; i++)
- {
- //tagPrinter->EndPage();
- //tagPrinter->m_DC.AbortDoc(); // 结束清空由StartDoc写入的内容;2014-09-15;
- //tagPrinter->m_DC.EndDoc();
- //Sleep(10000);
- //tagPrinter->StartPrint();
- //tagPrinter->NewPage();
- //PrintReceipt_02(pArray,/*tagPrinter*/NULL,printcot,TRUE);
- PrintReceipt_02(pArray, tagPrinter, printcot, TRUE);
- }
- }
- if (tagPrinter) delete tagPrinter;
- //}
- }
- //}
- }
- void CMainFrame::PrintFlowChart(CString strOrderNumber) // 选片打单;
- {
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
- {
- // Jeff 使用风格2打印;
- //PrintFlowChart3_20151116(strOrderNumber);
- PrintFlowChart3(strOrderNumber);
- return;
- }
- #ifdef ZHIAI_VERSION
- PrintFlowChart2(strOrderNumber);
- return;
- #endif
- int i = 0;
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- // CRect StrRect(0,0,560,818);
- LoadRect load;
- load.SetLiaPath("4.lia");
- load.SetMargins(-14, -14);
- if (!load.Load())return;
- LoadRect load2;
- load2.SetMargins(-14, 472 + 27 - 14);
- load2.SetLiaPath("5.lia");
- if (!load2.Load())return;
- //////////////////////////////////////////////////////////////
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2'";
- g_sendhead.code[0] = 54;
- g_sendhead.code[1] = 223;
- g_sendhead.tabcount = 2;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- DataToArray(&g_List1array, &sparray);
- CString spno;
- for ( i = 0; i < sparray.GetSize(); i++)
- {
- if (sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
- if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册" && sparray.ElementAt(i).ElementAt(5) == "入底" && sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- spno += sparray.ElementAt(i).ElementAt(5);
- if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
- spno += "; ";
- else
- {
- spno += ":";
- spno += sparray.ElementAt(i).ElementAt(6);
- spno += "; ";
- }
- }
- spno += " 加挑:";
- for (i = 0; i < sparray.GetSize(); i++)
- {
- if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- spno += sparray.ElementAt(i).ElementAt(5);
- if (0)//sparray.ElementAt (i).ElementAt (6).IsEmpty ())
- spno += "; ";
- else
- {
- spno += ":";
- spno += sparray.ElementAt(i).ElementAt(6);
- spno += "; ";
- }
- }
- if (spno.Right(6) == " 加挑:")
- {
- spno = spno.Left(spno.GetLength() - 6);
- }
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
- if (m_urgent.IsEmpty())m_urgent = "否";
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
- // CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
- CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
- CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
- CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(17) + g_List1array.ElementAt(0).ElementAt(29);
- m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_sum3;
- m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
- ::ConvertToPrice(m_sum3);
- if (m_money3.IsEmpty())m_money3 = "0";
- // m_money3=m_money3+"/"+m_sum3;
- CString name;
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- CString phone;
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- if (IsHasRights2new(31) == 0)
- phone = "***";
- CStringArray strarray;
- strarray.Add(m_urgent);
- strarray.Add(m_ren);
- strarray.Add(m_waiter3);
- strarray.Add(name);
- strarray.Add(m_time2);
- strarray.Add(m_time4);
- strarray.Add(m_money3);
- strarray.Add(m_sum3);
- strarray.Add(m_takezs);
- strarray.Add(m_taoxizs);
- strarray.Add(m_choosezs);
- strarray.Add(strOrderNumber);
- strarray.Add(phone);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- Image *pImg = NULL;
- #ifdef MNLS_VERSION
- LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
- #else
- ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
- #endif
- m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load2.m_rcarray.ElementAt(7);
- StrRect.top = load2.m_rcarray.ElementAt(15).top - 15;
- StrRect.bottom = load2.m_rcarray.ElementAt(15).bottom - 15;
- CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.top += 15;
- StrRect.bottom += 15;
- str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- #ifdef MNLS_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- #ifdef MNLS_VERSION
- m_Print.DrawRect(StrRect);
- #endif
- m_Print.SetFontFace(7, 1, "黑体");
- m_Print.SetColor(0xffffff);
- #ifdef MNLS_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- m_Print.SetColor(0);
- m_Print.SetFontFace(25, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 450;
- StrRect.top = 22;
- StrRect.right = StrRect.left + 60;
- StrRect.bottom = StrRect.top + 60;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg; pImg = NULL;
- }
- }
- #ifdef CHILD_VERSION
- CString title[13] = { "是否加急:", "接单门市:", \
- "选样人员:", "客人姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
- "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:"
- };
- #else
- CString title[13] = { "是否加急:", "接单门市:", \
- "选样人员:", "新郎新娘姓名:", "拍照日期:", "选片日期:", "加挑:", "余款:", \
- "拍摄总张数:", "应挑选张数:", "额外加挑张数:", "票号:", "客户联系电话:" };
- #endif
- m_Print.SetFontFace(12, 1, "宋体");
- for (i = 0; i < 13; i++)
- {
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- if (i < 3)
- m_Print.DrawRect2(StrRect, 0);
- else
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for (i = 18; i <= 37; i++)
- {
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- if (i >= 19 && i <= 21)
- m_Print.DrawRect2(StrRect, 2);
- /* else if(i==26)
- {
- CRect rc=StrRect;
- CRect rc2=rc;
- rc.right -=rc2.Width ()/2;
- m_Print.DrawRect2(rc, 1);
- rc2.left +=rc.Width ();
- m_Print.DrawRect2(rc2, 1);
- }*/
- else
- m_Print.DrawRect2(StrRect, 1);
- if (i == 18)
- {
- StrRect.left += 5;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- }
- //////////////////////////////////////
- rcpos = -1;
- for (i = 0; i < 8; i++)
- {
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawRect2(StrRect, 1);
- }
- #ifdef CHILD_VERSION
- CString title2[4] = { "引导师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
- #else
- CString title2[4] = { "化妆师:", "摄影师:", "数码设计师:", "顾客设计签名:" };
- #endif
- for (i = 0; i < 4; i++)
- {
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for (i = 0; i < 4; i++)
- {
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawRect2(StrRect, 2);
- }
- StrRect = load2.m_rcarray.ElementAt(11);
- StrRect.top -= 15;
- StrRect.bottom -= 15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客选片签名:", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(15);
- StrRect.top -= 15;
- StrRect.bottom -= 15;
- m_Print.DrawRect2(StrRect, 2);
- ///////////////////////////////////////////
- for (i = 19; i <= 31; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += 4;
- if (i == 31)
- {
- if (m_phone1.IsEmpty() == 0 && m_phone2.IsEmpty() == 0)
- {
- StrRect.top += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
- StrRect.top += 8;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- /* else if((i-19)==7)
- {
- CRect rc=StrRect;
- CRect rc2=rc;
- rc.right -=rc2.Width ()/2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left +=rc.Width ()+3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }*/
- else
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- strarray.RemoveAll();
- strarray.Add(m_waiter2);
- strarray.Add(m_waiter1);
- strarray.Add(m_waiter4);
- for (i = 13; i <= 15; i++)
- {
- StrRect = load2.m_rcarray.ElementAt(i - 1);
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- ///////////spno
- CRect sprc[14];
- for (i = 0; i < 14; i++)
- {
- if (i < 7)
- {
- if (i == 0)
- {
- StrRect = load.m_rcarray.ElementAt(17); StrRect.left += 94; StrRect.right -= 3;
- }
- else
- {
- StrRect = load.m_rcarray.ElementAt(30 + i); StrRect.left += 4; StrRect.right -= 3;
- }
- }
- else
- {
- StrRect = load2.m_rcarray.ElementAt(i - 7); StrRect.left += 4; StrRect.right -= 3;
- }
- sprc[i] = StrRect;
- }
- CString temp, tempspno, tempbz;
- CSize size;
- BOOL bRun = 0;
- int fontsize = 12;
- ll: tempspno = spno;
- tempbz = m_bz;
- m_Print.SetFontFace(fontsize, 1, "宋体");
- for (i = 0; i<14; i++)
- {
- if (!tempspno.IsEmpty())
- {
- temp = tempspno;
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- int right = 0;
- CRect temprc = sprc[i];
- while (size.cx>temprc.Width())
- {
- right++;
- temp = tempspno.Left(tempspno.GetLength() - (right));
- if (GIsHalfHZ(temp))
- {
- right++;
- temp.Delete(temp.GetLength() - 1);
- }
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- }
- if (bRun)
- m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
- if (tempspno.IsEmpty())i++;
- }
- else if (!tempbz.IsEmpty())
- {
- temp = tempbz;
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- int right = 0;
- CRect temprc = sprc[i];
- while (size.cx > temprc.Width())
- {
- right++;
- temp = tempbz.Left(tempbz.GetLength() - (right));
- if (GIsHalfHZ(temp))
- {
- right++;
- temp.Delete(temp.GetLength() - 1);
- }
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- }
- if (bRun)
- m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- tempbz = tempbz.Right(tempbz.GetLength() - temp.GetLength());
- }
- }
- if (tempspno.IsEmpty() == 0 || tempbz.IsEmpty() == 0)
- {
- fontsize--;
- goto ll;
- }
- if (bRun == 0)
- {
- bRun = 1;
- goto ll;
- }
- PrintPreview dlg;
- dlg.m_mode = 2;
- dlg.m_name = name;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintFlowChart3LKAY(CString strOrderNumber)
- {
- int i = 0;
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("18.lia");
- load.SetMargins(10, 0);
- if (!load.Load())return;
- CString str;
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(25, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- //////////////////////////////////////////////////////////////
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
- g_sendhead.code[0] = 54;
- g_sendhead.code[1] = 223;
- g_sendhead.code[2] = 52;
- g_sendhead.tabcount = 3;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- DataToArray(&g_List1array, &sparray, &clientarray);
- CString spno;
- CStringArray sparray2;
- for ( i = 0; i < sparray.GetSize(); i++)
- {
- // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
- if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- sparray2.Add(sparray.ElementAt(i).ElementAt(5));
- sparray2.Add(sparray.ElementAt(i).ElementAt(3));
- sparray2.Add(sparray.ElementAt(i).ElementAt(9));
- sparray2.Add(sparray.ElementAt(i).ElementAt(10));
- sparray2.Add(sparray.ElementAt(i).ElementAt(6));
- }
- for (i = 0; i < sparray.GetSize(); i++)
- {
- if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
- sparray2.Add(sparray.ElementAt(i).ElementAt(3));
- sparray2.Add(sparray.ElementAt(i).ElementAt(9));
- sparray2.Add(sparray.ElementAt(i).ElementAt(10));
- sparray2.Add(sparray.ElementAt(i).ElementAt(6));
- }
- CString m_sex = clientarray.ElementAt(0).ElementAt(18);
- CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
- CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
- CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
- CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
- m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
- CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
- CString m_sum3;
- m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
- ::ConvertToPrice(m_sum3);
- if (m_money3.IsEmpty())m_money3 = "0";
- int dty = 0;
- CString name;
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- CString phone;
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- if (IsHasRights2new(31) == 0)
- phone = "***";
- CStringArray strarray;
- #ifdef CHILD_VERSION
- if (m_birthday.IsEmpty())
- strarray.Add("姓名/性别");
- else
- strarray.Add("姓名/性别/年龄");
- #else
- strarray.Add("客人姓名");
- #endif
- strarray.Add("电话");
- strarray.Add("单号");
- strarray.Add("套系");
- strarray.Add("选样");
- strarray.Add("余款/加挑");
- strarray.Add("选片/日期");
- #ifdef CHILD_VERSION
- if (m_birthday.IsEmpty())
- strarray.Add(name + "/" + m_sex);
- else
- {
- int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
- m_birthday.Format("%d", year + 1);
- strarray.Add(name + "/" + m_sex + "/" + m_birthday);
- }
- #else
- strarray.Add(name);
- #endif
- strarray.Add(phone);
- strarray.Add(strOrderNumber);
- strarray.Add(m_taoxiname);
- str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
- strarray.Add(str);
- str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
- strarray.Add(str);
- strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
- for (i = 3; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i < 10)
- {
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- }
- StrRect = load.m_rcarray.ElementAt(29);
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 485;
- StrRect.top = 12;
- StrRect.right = StrRect.left + 60;
- StrRect.bottom = StrRect.top + 60;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg; pImg = NULL;
- }
- }
- CArray<CRect, CRect>rcarray;
- CStringArray strarray2;
- for (i = 10; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- strarray2.Add(strarray.ElementAt(7 + i - 10));
- }
- if (1)
- {
- StrRect = load.m_rcarray.ElementAt(30);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- strarray2.Add(m_time6 + "/" + m_time5);
- }
- INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- for (i = 10; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i == 10)
- {
- dty += bottom - StrRect.bottom;
- }
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1);
- }
- if (1)
- {
- StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
- // m_Print.DrawText((LPTSTR)(LPCTSTR)(m_time6+"/"+m_time5), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER );
- }
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- strarray.RemoveAll();
- strarray.Add("产品名称");
- strarray.Add("数量");
- strarray.Add("P数");
- strarray.Add("张数");
- strarray.Add("照片编号");
- CArray<CRect, CRect>rc2array;
- int wid = 25;
- for (i = 18; i <= 22; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i == 19)
- {
- StrRect.right = StrRect.left + wid;
- }
- if (i == 20)
- {
- StrRect = load.m_rcarray.ElementAt(i - 2);
- StrRect.left += wid; StrRect.right = StrRect.left;
- StrRect.right += wid;
- }
- if (i == 21)
- {
- StrRect = load.m_rcarray.ElementAt(i - 3);
- StrRect.left += wid * 2; StrRect.right = StrRect.left;
- StrRect.right += wid;
- wid = StrRect.right;
- }
- if (i == 22)
- {
- StrRect = load.m_rcarray.ElementAt(i - 3);
- StrRect.left = wid;
- }
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left -= 2;
- StrRect.top = StrRect.bottom;
- StrRect.bottom += 18;
- rc2array.Add(StrRect);
- }
- int curypos = 0;
- for (i = 0; i < sparray2.GetSize(); i += 5)
- {
- rcarray.RemoveAll();
- strarray2.RemoveAll();
- int j = 0;
- for ( j = 0; j < 5; j++)
- {
- StrRect = rc2array.ElementAt(j);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- strarray2.Add(sparray2.ElementAt(i + j));
- }
- INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- rcarray.RemoveAll();
- for (j = 0; j < 5; j++)
- {
- StrRect = rc2array.ElementAt(j);
- if (j == 0)
- {
- dty += bottom - StrRect.bottom;
- }
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
- StrRect.top = StrRect.bottom;
- StrRect.bottom += 18;
- rcarray.Add(StrRect);
- }
- rc2array.RemoveAll();
- rc2array.Copy(rcarray);
- }
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(20);
- dty = curypos - StrRect.bottom + 35;
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- rcarray.RemoveAll();
- strarray2.RemoveAll();
- StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- strarray2.Add(m_bz);
- bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
- dty += bottom - StrRect.bottom;
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(22);
- dty = curypos - StrRect.bottom + 25;
- StrRect.top += dty; StrRect.bottom += dty;
- CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
- if (m_edit9.IsEmpty())
- {
- m_edit9 = "\
- 经确认后的照片均排入制作流程,\r\n\
- 恕不接受更改及退费。实际冲晒出来的相片\r\n\
- 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
- }
- CString info1, info2, info3;
- int newlinepos = m_edit9.Find("\r\n");
- if (newlinepos != -1)
- {
- info1 = m_edit9.Left(newlinepos);
- m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
- }
- newlinepos = m_edit9.Find("\r\n");
- if (newlinepos != -1)
- {
- info2 = m_edit9.Left(newlinepos);
- m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
- info3 = m_edit9;
- }
- m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.top += 15;
- StrRect.bottom += 15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty - dy;
- StrRect.bottom += dty - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty - dy;
- StrRect.bottom += dty - dy;
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty + 15 - dy;
- StrRect.bottom += dty + 15 - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty + 15 - dy;
- StrRect.bottom += dty + 15 - dy;
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty + 15 * 2 - dy;
- StrRect.bottom += dty + 15 * 2 - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty + 15 * 2 - dy;
- StrRect.bottom += dty + 15 * 2 - dy;
- m_Print.DrawRect2(StrRect, 2);
- PrintPreview dlg; dlg.m_mode = 2;
- dlg.m_name = name;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintFlowChart3(CString strOrderNumber) // 选片打单 风格2;
- {
- #ifdef LKAY_VERSION
- PrintFlowChart3LKAY(strOrderNumber);
- return;
- #endif
- int i = 0;
- int j = 0;
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- BOOL bSecondPage = 0;
- int nPrintedPos = 0;
- for (int bb = 0; bb < 2; bb++)
- {
- if (bb && bSecondPage == 0)break;
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58))) // 58-[version].[setcheck1] ==1,使用默认打印机;
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else // 否则使用指定的打印机;
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(64); // 64-[version].[printer2] 制作单打印机;
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("18.lia");
- load.SetMargins(10, 0);
- if (!load.Load())return;
- CString str;
- int rcpos = -1;
- // ■■■■■■从18.lia获取到第一个区域大小 - 1.显示店名;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- if ((bb == 0 && bSecondPage == 0))
- {
- m_Print.SetFontFace(25, 1, "宋体");
- // 10-[version].[info1] 店名;
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(15, 1, "宋体");
- // ■■■■■■从18.lia获取第二个区域大小 - 2.显示"基本资料";
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- }
- //////////////////////////////////////////////////////////////
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
- g_sendhead.code[0] = 54; // dindan;
- g_sendhead.code[1] = 223; // dindanspview2; shangpin+dindansp;
- g_sendhead.code[2] = 52; // client;
- g_sendhead.tabcount = 3;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- DataToArray(&g_List1array, &sparray, &clientarray);
- CString spno;
- CStringArray sparray2;
- for ( i = 0; i < sparray.GetSize(); i++)
- {
- // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
- if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- // 136 - [version].[reverse1] // 6 - [dindansp].[no]
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- sparray2.Add(sparray.ElementAt(i).ElementAt(5));
- sparray2.Add(sparray.ElementAt(i).ElementAt(3));
- sparray2.Add(sparray.ElementAt(i).ElementAt(6));
- }
- for (i = 0; i < sparray.GetSize(); i++)
- {
- if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- // 136 - [version].[reverse1] // 6 - [dindansp].[no]
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
- sparray2.Add(sparray.ElementAt(i).ElementAt(3));
- sparray2.Add(sparray.ElementAt(i).ElementAt(6));
- }
- CString m_sex = clientarray.ElementAt(0).ElementAt(18);
- CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
- CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
- CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
- CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
- // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
- CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
- m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
- CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
- CString m_sum3;
- m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
- ::ConvertToPrice(m_sum3);
- if (m_money3.IsEmpty())m_money3 = "0";
- int dty = 0;
- CString name;
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- CString phone;
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- if (IsHasRights2new(31) == 0)
- phone = "***";
- CStringArray strarray;
- CArray<CRect, CRect>rcarray;
- CStringArray strarray2; CArray<CRect, CRect>rc2array;
- int bottom;
- if ((bb == 0 && bSecondPage == 0))
- {
- #ifdef CHILD_VERSION
- if (m_birthday.IsEmpty())
- strarray.Add("姓名/性别");
- else
- strarray.Add("姓名/性别/年龄");
- #else
- strarray.Add("客人姓名"); // 第3.1区域 -3.显示客人姓名;
- #endif
- strarray.Add("电话");
- strarray.Add("单号");
- strarray.Add("套系");
- strarray.Add("选样");
- strarray.Add("余款/加挑");
- strarray.Add("选片/日期");
- #ifdef CHILD_VERSION
- if (m_birthday.IsEmpty())
- strarray.Add(name + "/" + m_sex);
- else
- {
- int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
- m_birthday.Format("%d", year + 1);
- strarray.Add(name + "/" + m_sex + "/" + m_birthday);
- }
- #else
- strarray.Add(name); // 第4.1区域 -3.显示客人姓名;
- #endif
- strarray.Add(phone);
- strarray.Add(strOrderNumber);
- strarray.Add(m_taoxiname);
- str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
- strarray.Add(str);
- str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
- strarray.Add(str);
- strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
- for (i = 3; i <= 16; i++)
- {
- // ■■■■■■从18.lia中获取第3~16的区域大小;
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i < 10)
- {
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- }
- // ■■■■■■从18.lia中获取第30的区域大小;
- StrRect = load.m_rcarray.ElementAt(29);
- m_Print.DrawRect2(StrRect, 1);
- BOOL bPrintDate = 1;
- #ifdef DDF_VERSION
- // bPrintDate=0;
- #else
- if (m_time5 == "" && m_time6 == "")
- bPrintDate = 0;
- #endif
- if (bPrintDate)
- m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- else
- {
- #ifdef CHILD_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #else
- m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- }
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138))) // [version].[reverse3]
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- // Jeff二维码的区域不是从18.lia里获取的,是固定在右上角指定区域;
- if (pImg)
- {
- StrRect.left = 485;
- StrRect.top = 12;
- StrRect.right = StrRect.left + 60;
- StrRect.bottom = StrRect.top + 60;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg; pImg = NULL;
- }
- }
- // CArray<CRect,CRect>rcarray;
- // CStringArray strarray2;
- // ■■■■■■从18.lia中获取第10的区域大小;
- for (i = 10; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- strarray2.Add(strarray.ElementAt(7 + i - 10));
- }
- if (1)
- {
- // ■■■■■■从18.lia中获取第31的区域大小;
- StrRect = load.m_rcarray.ElementAt(30);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- if (bPrintDate)
- strarray2.Add(m_time6 + "/" + m_time5);
- else
- {
- strarray2.Add(m_waiter1 + "/" + m_waiter2);
- }
- }
- INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_HCENTER);
- for (i = 10; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i == 10)
- {
- dty += bottom - StrRect.bottom;
- }
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1);
- }
- if (1)
- {
- StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
- }
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- int curypos = 0;
- int oldpos = 0;
- if (bb == 1)
- {
- dty = -100;
- oldpos = nPrintedPos;
- if (oldpos == 0)oldpos = 10000;
- }
- m_Print.SetFontFace(9, 1, "宋体");
- strarray.RemoveAll();
- if ((oldpos != 10000 && oldpos < sparray2.GetSize()) || bb == 0)
- {
- strarray.Add("产品名称");
- strarray.Add("数量");
- strarray.Add("照片编号");
- for (i = 18; i <= 20; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.top += dty;
- StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left -= 2;
- StrRect.top = StrRect.bottom;
- StrRect.bottom += 18;
- rc2array.Add(StrRect);
- }
- }
- for (i = oldpos; i < sparray2.GetSize(); i += 3)
- {
- rcarray.RemoveAll();
- strarray2.RemoveAll();
- for ( j = 0; j < 3; j++)
- {
- StrRect = rc2array.ElementAt(j);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- #if JEFF_TEST_ON
- if (2 == j)
- {
- CString strImg = sparray2.ElementAt(i + 2);
- int nImgCount = strImg.Replace(SEPS_VEB, SEPS_VEB);
- if (nImgCount != 0)
- strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
- else if (!strImg.IsEmpty())
- strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
- strarray2.Add(strImg);
- }
- else
- strarray2.Add(sparray2.ElementAt(i + j));
- #else
- strarray2.Add(sparray2.ElementAt(i + j));
- #endif
- }
- bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- rcarray.RemoveAll();
- for (j = 0; j < 3; j++)
- {
- StrRect = rc2array.ElementAt(j);
- if (j == 0)
- {
- dty += bottom - StrRect.bottom;
- }
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1);
- curypos = StrRect.bottom;
- StrRect.top = StrRect.bottom;
- StrRect.bottom += 18;
- rcarray.Add(StrRect);
- }
- rc2array.RemoveAll();
- rc2array.Copy(rcarray);
- if (bottom > 750)
- {
- bSecondPage = 1;
- nPrintedPos = i + 3;
- break;
- }
- }
- if ((bb == 0 && bSecondPage == 0) || (bb == 1 && bSecondPage == 1))
- {
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(20);
- dty = curypos - StrRect.bottom + 35;
- StrRect.top += dty;
- StrRect.bottom += dty;
- if (StrRect.bottom > 700 && bb == 0)
- {
- bSecondPage = 1;
- }
- else
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- rcarray.RemoveAll();
- strarray2.RemoveAll();
- StrRect = load.m_rcarray.ElementAt(21);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- #if JEFF_TEST_ON
- // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
- strarray2.RemoveAll();
- CString strFind = "要求:";
- CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
- do
- {
- int nIndex = strbz3.Find(strFind, 1);
- if (nIndex != -1)
- {
- CString strbz = strbz3.Left(nIndex);
- strbz3 = strbz3.Mid(nIndex);
- strarray2.Add(strbz);
- }
- else
- {
- strarray2.Add(strbz3);
- strbz3 = "";
- }
- } while (strbz3.Find(strFind) != -1);
- strarray2.Add(g_List1array.ElementAt(0).ElementAt(29));
- strarray2.Add(g_List1array.ElementAt(0).ElementAt(23));
- bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
- #else
- strarray2.Add(m_bz);
- bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- #endif
- StrRect = load.m_rcarray.ElementAt(21);
- StrRect.top += dty;
- StrRect.bottom += dty;
- dty += bottom - StrRect.bottom;
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1);
- curypos = StrRect.bottom;
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(22);
- dty = curypos - StrRect.bottom + 25;
- StrRect.top += dty;
- StrRect.bottom += dty;
- CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
- if (m_edit9.IsEmpty())
- {
- m_edit9 = "\
- 经确认后的照片均排入制作流程,\r\n\
- 恕不接受更改及退费。实际冲晒出来的相片\r\n\
- 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
- }
- CString info1, info2, info3;
- int newlinepos = m_edit9.Find("\r\n");
- if (newlinepos != -1)
- {
- info1 = m_edit9.Left(newlinepos);
- m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
- }
- newlinepos = m_edit9.Find("\r\n");
- if (newlinepos != -1)
- {
- info2 = m_edit9.Left(newlinepos);
- m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
- info3 = m_edit9;
- }
- #ifdef QCH_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (24);
- StrRect.top +=dty;StrRect.bottom +=dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.top +=15;
- StrRect.bottom +=15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- #else
- if (1)
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect.top += 15;
- StrRect.bottom += 15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- #endif
- int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty - dy;
- StrRect.bottom += dty - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty - dy;
- StrRect.bottom += dty - dy;
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty + 15 - dy;
- StrRect.bottom += dty + 15 - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty + 15 - dy;
- StrRect.bottom += dty + 15 - dy;
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty + 15 * 2 - dy;
- StrRect.bottom += dty + 15 * 2 - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty + 15 * 2 - dy;
- StrRect.bottom += dty + 15 * 2 - dy;
- m_Print.DrawRect2(StrRect, 2);
- }
- }
- PrintPreview dlg; dlg.m_mode = 2;
- dlg.m_name = name;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- }
- void CMainFrame::PrintFlowChart3_20151116(CString strOrderNumber) // 选片打单 风格2;
- {
- #ifdef LKAY_VERSION
- PrintFlowChart3LKAY(strOrderNumber);
- return;
- #endif
- int i = 0;
- int j = 0;
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- BOOL bSecondPage = 0;
- int nPrintedPos = 0;
- for (int bb = 0; bb < 3; bb++)
- {
- if (bb && bSecondPage == 0)break;
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58))) // 58-[version].[setcheck1] ==1,使用默认打印机;
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else // 否则使用指定的打印机;
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(64); // 64-[version].[printer2] 制作单打印机;
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("18.lia");
- load.SetMargins(10, 0);
- if (!load.Load())return;
- CString str;
- int rcpos = -1;
- // ■■■■■■从18.lia获取到第一个区域大小 - 1.显示店名;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- if ((bb == 0 && bSecondPage == 0))
- {
- m_Print.SetFontFace(25, 1, "宋体");
- // 10-[version].[info1] 店名;
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(15, 1, "宋体");
- // ■■■■■■从18.lia获取第二个区域大小 - 2.显示"基本资料";
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- }
- //////////////////////////////////////////////////////////////////////////
- // 获取打印所需要的数据,并布局好;
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
- g_sendhead.code[0] = 54; // dindan;
- g_sendhead.code[1] = 223; // dindanspview2; shangpin+dindansp;
- g_sendhead.code[2] = 52; // client;
- g_sendhead.tabcount = 3;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- DataToArray(&g_List1array, &sparray, &clientarray);
- CString spno;
- CStringArray sparray2;
- for ( i = 0; i < sparray.GetSize(); i++)
- {
- // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
- if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- // 136 - [version].[reverse1] // 6 - [dindansp].[no]
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- sparray2.Add(sparray.ElementAt(i).ElementAt(5)); // 商品名称;
- sparray2.Add(sparray.ElementAt(i).ElementAt(3)); // 商品数量;
- sparray2.Add(sparray.ElementAt(i).ElementAt(6)); // 选中的相片串;
- sparray2.Add(sparray.ElementAt(i).ElementAt(10)); // 商品备注;
- }
- for (i = 0; i < sparray.GetSize(); i++)
- {
- if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- // 136 - [version].[reverse1] // 6 - [dindansp].[no]
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+"); // 商品名称;
- sparray2.Add(sparray.ElementAt(i).ElementAt(3)); // 商品数量;
- sparray2.Add(sparray.ElementAt(i).ElementAt(6)); // 选中的相片串;
- sparray2.Add(sparray.ElementAt(i).ElementAt(10)); // 商品备注;
- }
- CString m_sex = clientarray.ElementAt(0).ElementAt(18);
- CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(7);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
- CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
- CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
- CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
- // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
- CString m_bz = g_List1array.ElementAt(0).ElementAt(17) + " " + g_List1array.ElementAt(0).ElementAt(29);
- m_bz += ";" + g_List1array.ElementAt(0).ElementAt(23);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
- CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
- CString m_sum3;
- m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
- ::ConvertToPrice(m_sum3);
- if (m_money3.IsEmpty())m_money3 = "0";
- int dty = 0;
- CString name;
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- CString phone;
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- if (IsHasRights2new(31) == 0)
- phone = "***";
- CStringArray strarray;
- CArray<CRect, CRect>rcarray;
- CStringArray strarray2; CArray<CRect, CRect>rc2array;
- int bottom;
- //////////////////////////////////////////////////////////////////////////
- // 开始画打印DC;
- if ((bb == 0 && bSecondPage == 0))
- {
- #ifdef CHILD_VERSION
- if (m_birthday.IsEmpty())
- strarray.Add("姓名/性别");
- else
- strarray.Add("姓名/性别/年龄");
- #else
- strarray.Add("客人姓名"); // 第3.1区域 -3.显示客人姓名;
- #endif
- strarray.Add("电话");
- strarray.Add("单号");
- strarray.Add("套系");
- strarray.Add("选样");
- strarray.Add("余款/加挑");
- strarray.Add("选片/日期");
- #ifdef CHILD_VERSION
- if (m_birthday.IsEmpty())
- strarray.Add(name + "/" + m_sex);
- else
- {
- int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
- m_birthday.Format("%d", year + 1);
- strarray.Add(name + "/" + m_sex + "/" + m_birthday);
- }
- #else
- strarray.Add(name); // 第4.1区域 -3.显示客人姓名;
- #endif
- strarray.Add(phone);
- strarray.Add(strOrderNumber);
- strarray.Add(m_taoxiname);
- str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
- strarray.Add(str);
- str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
- strarray.Add(str);
- strarray.Add(m_waiter3 + "/" + m_time4);//m_time5
- for (i = 3; i <= 16; i++)
- {
- // ■■■■■■从18.lia中获取第3~16的区域大小;
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i < 10)
- {
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- }
- // ■■■■■■从18.lia中获取第30的区域大小;
- StrRect = load.m_rcarray.ElementAt(29);
- m_Print.DrawRect2(StrRect, 1);
- BOOL bPrintDate = 1;
- #ifdef DDF_VERSION
- // bPrintDate=0;
- #else
- if (m_time5 == "" && m_time6 == "")
- bPrintDate = 0;
- #endif
- if (bPrintDate)
- m_Print.DrawText((LPTSTR)(LPCTSTR)"看样/取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- else
- {
- #ifdef CHILD_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/引导", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #else
- m_Print.DrawText((LPTSTR)(LPCTSTR)"摄影/化妆", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- }
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138))) // [version].[reverse3]
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- // Jeff二维码的区域不是从18.lia里获取的,是固定在右上角指定区域;
- if (pImg)
- {
- StrRect.left = 485;
- StrRect.top = 12;
- StrRect.right = StrRect.left + 60;
- StrRect.bottom = StrRect.top + 60;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg; pImg = NULL;
- }
- }
- // CArray<CRect,CRect>rcarray;
- // CStringArray strarray2;
- // ■■■■■■从18.lia中获取第10的区域大小;
- for (i = 10; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- strarray2.Add(strarray.ElementAt(7 + i - 10));
- }
- if (1)
- {
- // ■■■■■■从18.lia中获取第31的区域大小;
- StrRect = load.m_rcarray.ElementAt(30);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- if (bPrintDate)
- strarray2.Add(m_time6 + "/" + m_time5);
- else
- {
- strarray2.Add(m_waiter1 + "/" + m_waiter2);
- }
- }
- int bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_HCENTER);
- for (i = 10; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i == 10)
- {
- dty += bottom - StrRect.bottom;
- }
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1);
- }
- if (1)
- {
- StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
- }
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- int curypos = 0;
- int oldpos = 0;
- if (bb == 1)
- {
- dty = -100;
- oldpos = nPrintedPos;
- if (oldpos == 0)oldpos = 10000;
- }
- m_Print.SetFontFace(9, 1, "宋体");
- strarray.RemoveAll();
- if ((oldpos != 10000 && oldpos < sparray2.GetSize()) || bb == 0)
- {
- strarray.Add("产品名称");
- strarray.Add("数量");
- strarray.Add("照片编号");
- strarray.Add(_T("备注"));
- CRect mycr[4] = {
- CRect(39,172,130,189), // 产品名称;
- CRect(130,172,157,189), // 产品数量;
- CRect(157,172,407,189), // 相片;
- CRect(407,172,546,189) // 备注;
- };
- for (i = 0; i <= 3; i++)
- {
- StrRect = mycr[i];
- StrRect.top += dty;
- StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left -= 2;
- StrRect.top = StrRect.bottom;
- StrRect.bottom += 18;
- rc2array.Add(StrRect);
- }
- }
- for (i = oldpos; i < sparray2.GetSize(); i += 4)
- {
- rcarray.RemoveAll();
- strarray2.RemoveAll();
- for ( j = 0; j < 4; j++)
- {
- StrRect = rc2array.ElementAt(j);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- #if JEFF_TEST_ON
- if (2 == j)
- {
- CString strImg = sparray2.ElementAt(i + 2);
- //int nImgCount = strImg.Replace(",", ",");
- int nImgCount = strImg.Replace(SEPS_VEB, SEPS_VEB);
- if (nImgCount != 0)
- strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
- else if (!strImg.IsEmpty())
- strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
- strarray2.Add(strImg);
- }
- else
- strarray2.Add(sparray2.ElementAt(i + j));
- #else
- strarray2.Add(sparray2.ElementAt(i + j));
- #endif
- }
- bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- rcarray.RemoveAll();
- for (j = 0; j < 4; j++)
- {
- StrRect = rc2array.ElementAt(j);
- if (j == 0)
- {
- dty += bottom - StrRect.bottom;
- }
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1);
- curypos = StrRect.bottom;
- StrRect.top = StrRect.bottom;
- StrRect.bottom += 18;
- rcarray.Add(StrRect);
- }
- rc2array.RemoveAll();
- rc2array.Copy(rcarray);
- if (bottom > 750)
- {
- bSecondPage = 1;
- nPrintedPos = i + 3;
- break;
- }
- }
- if ((bb == 0 && bSecondPage == 0) || (bb == 1 && bSecondPage == 1))
- {
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(20);
- dty = curypos - StrRect.bottom + 35;
- StrRect.top += dty;
- StrRect.bottom += dty;
- if (StrRect.bottom > 700 && bb == 0)
- {
- bSecondPage = 1;
- }
- else
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- rcarray.RemoveAll();
- strarray2.RemoveAll();
- StrRect = load.m_rcarray.ElementAt(21);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- #if JEFF_TEST_ON
- // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
- strarray2.RemoveAll();
- CString strFind = "要求:";
- CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
- do
- {
- int nIndex = strbz3.Find(strFind, 1);
- if (nIndex != -1)
- {
- CString strbz = strbz3.Left(nIndex);
- strbz3 = strbz3.Mid(nIndex);
- strarray2.Add(strbz);
- }
- else
- {
- strarray2.Add(strbz3);
- strbz3 = "";
- }
- } while (strbz3.Find(strFind) != -1);
- strarray2.Add(g_List1array.ElementAt(0).ElementAt(29));
- strarray2.Add(g_List1array.ElementAt(0).ElementAt(23));
- bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
- #else
- strarray2.Add(m_bz);
- bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- #endif
- StrRect = load.m_rcarray.ElementAt(21);
- StrRect.top += dty;
- StrRect.bottom += dty;
- dty += bottom - StrRect.bottom;
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1);
- curypos = StrRect.bottom;
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(22);
- dty = curypos - StrRect.bottom + 25;
- StrRect.top += dty;
- StrRect.bottom += dty;
- CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
- if (m_edit9.IsEmpty())
- {
- m_edit9 = "\
- 经确认后的照片均排入制作流程,\r\n\
- 恕不接受更改及退费。实际冲晒出来的相片\r\n\
- 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
- }
- CString info1, info2, info3;
- int newlinepos = m_edit9.Find("\r\n");
- if (newlinepos != -1)
- {
- info1 = m_edit9.Left(newlinepos);
- m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
- }
- newlinepos = m_edit9.Find("\r\n");
- if (newlinepos != -1)
- {
- info2 = m_edit9.Left(newlinepos);
- m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
- info3 = m_edit9;
- }
- #ifdef QCH_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (24);
- StrRect.top +=dty;StrRect.bottom +=dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.top +=15;
- StrRect.bottom +=15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- #else
- if (1)
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect.top += 15;
- StrRect.bottom += 15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12) + " 电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- #endif
- int dy = load.m_rcarray.ElementAt(25).top - load.m_rcarray.ElementAt(27).top;
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty - dy;
- StrRect.bottom += dty - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"选片签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty - dy;
- StrRect.bottom += dty - dy;
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty + 15 - dy;
- StrRect.bottom += dty + 15 - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"看样签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty + 15 - dy;
- StrRect.bottom += dty + 15 - dy;
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty + 15 * 2 - dy;
- StrRect.bottom += dty + 15 * 2 - dy;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"取件签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty + 15 * 2 - dy;
- StrRect.bottom += dty + 15 * 2 - dy;
- m_Print.DrawRect2(StrRect, 2);
- }
- }
- PrintPreview dlg; dlg.m_mode = 2;
- dlg.m_name = name;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- }
- //void CMainFrame::PrintFlowChart4(CString m_id) // 选设计打单函数;
- void CMainFrame::PrintFlowChart4(CString strOrderNumber) // 选设计打单函数,使用18.lia文件;
- {
- int i = 0;
- int j = 0;
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("18.lia");
- load.SetMargins(10, 0);
- if (!load.Load())return;
- CString str;
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(25, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "制作单明细"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"基本资料", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- //////////////////////////////////////////////////////////////
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "' and kind<>'2';id='" + strOrderNumber + "'";
- g_sendhead.code[0] = 54;
- g_sendhead.code[1] = 223;
- g_sendhead.code[2] = 52;
- g_sendhead.tabcount = 3;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- DataToArray(&g_List1array, &sparray, &clientarray);
- CString spno;
- CStringArray sparray2;
- for ( i = 0; i < sparray.GetSize(); i++)
- {
- if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(8).IsEmpty())continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- sparray2.Add(sparray.ElementAt(i).ElementAt(5));
- sparray2.Add(sparray.ElementAt(i).ElementAt(3));
- sparray2.Add(sparray.ElementAt(i).ElementAt(8));
- }
- for (i = 0; i < sparray.GetSize(); i++)
- {
- if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- sparray2.Add(sparray.ElementAt(i).ElementAt(5) + "+");
- sparray2.Add(sparray.ElementAt(i).ElementAt(3));
- sparray2.Add(sparray.ElementAt(i).ElementAt(8));
- }
- CString m_sex = clientarray.ElementAt(0).ElementAt(18);
- CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_phone1 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_phone2 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_urgent = g_List1array.ElementAt(0).ElementAt(5);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(6);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(8);
- CString m_takezs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxizs = g_List1array.ElementAt(0).ElementAt(10);
- CString m_choosezs = g_List1array.ElementAt(0).ElementAt(11);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(12);
- CString m_waiter3 = g_List1array.ElementAt(0).ElementAt(13);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(14);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(15);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(17);
- m_bz += ";" + g_List1array.ElementAt(0).ElementAt(25);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(20);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(24);
- CString m_time6 = g_List1array.ElementAt(0).ElementAt(26);
- CString m_waiter8 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_replace = g_List1array.ElementAt(0).ElementAt(28);
- if (!m_replace.IsEmpty())
- {
- m_replace = "设计替换照片:" + m_replace;
- m_replace.Replace("$", ";");
- m_replace.TrimLeft(";");
- m_bz += ";";
- m_bz += m_replace;
- }
- CString m_sum3;
- m_sum3.Format("%0.2f", atof(m_taoxijiage) + atof(m_payed4) - (atof(m_payed5) + atof(m_money1)));
- ::ConvertToPrice(m_sum3);
- if (m_money3.IsEmpty())m_money3 = "0";
- int dty = 0;
- CString name;
- if (!m_name1.IsEmpty())
- name = m_name1 + ",";
- name += m_name2;
- name.TrimRight(",");
- CString phone;
- if (!m_phone1.IsEmpty())
- phone = m_phone1 + ",";
- phone += m_phone2; phone.TrimRight(",");
- if (IsHasRights2new(31) == 0)
- phone = "***";
- CStringArray strarray;
- #ifdef CHILD_VERSION
- if (m_birthday.IsEmpty())
- strarray.Add("姓名/性别");
- else
- strarray.Add("姓名/性别/年龄");
- #else
- strarray.Add("客人姓名");
- #endif
- strarray.Add("电话");
- strarray.Add("单号");
- strarray.Add("套系");
- strarray.Add("");
- strarray.Add("余款/加挑");
- strarray.Add("看设计/日期");
- #ifdef CHILD_VERSION
- if (m_birthday.IsEmpty())
- strarray.Add(name + "/" + m_sex);
- else
- {
- int year = atoi(g_date.Left(4)) - atoi(m_birthday.Left(4));
- m_birthday.Format("%d", year + 1);
- strarray.Add(name + "/" + m_sex + "/" + m_birthday);
- }
- #else
- strarray.Add(name);
- #endif
- strarray.Add(phone);
- strarray.Add(strOrderNumber);
- strarray.Add(m_taoxiname);
- str.Format("应选:%d,加挑:%d", atoi(m_taoxizs), atoi(m_choosezs));
- strarray.Add("");
- str.Format("%d/%d", atoi(m_sum3), atoi(m_money3));
- strarray.Add(str);
- strarray.Add(m_waiter8 + "/" + m_time6);
- //////////////////////////////////////////////
- if (1)
- {
- StrRect = load.m_rcarray.ElementAt(6);
- int addwid = StrRect.Width() / 6;
- for (i = 3; i <= 6; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += (i - 3)*addwid;
- StrRect.right += (i - 2)*addwid;
- load.m_rcarray.SetAt(i - 1, StrRect);
- }
- StrRect.left = StrRect.right = -1;
- load.m_rcarray.SetAt(6, StrRect);
- for (i = 10; i <= 13; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += (i - 10)*addwid;
- StrRect.right += (i - 9)*addwid;
- load.m_rcarray.SetAt(i - 1, StrRect);
- }
- StrRect.left = StrRect.right = -1;
- load.m_rcarray.SetAt(13, StrRect);
- StrRect = load.m_rcarray.ElementAt(7);
- int rcwid = StrRect.Width();
- StrRect.left = load.m_rcarray.ElementAt(5).right;
- StrRect.right = StrRect.left + rcwid + addwid;
- load.m_rcarray.SetAt(7, StrRect);
- StrRect = load.m_rcarray.ElementAt(8);
- StrRect.left = load.m_rcarray.ElementAt(7).right;
- StrRect.right = load.m_rcarray.ElementAt(29).left;
- load.m_rcarray.SetAt(8, StrRect);
- StrRect = load.m_rcarray.ElementAt(14);
- rcwid = StrRect.Width();
- StrRect.left = load.m_rcarray.ElementAt(12).right;
- StrRect.right = StrRect.left + rcwid + addwid;
- load.m_rcarray.SetAt(14, StrRect);
- StrRect = load.m_rcarray.ElementAt(15);
- StrRect.left = load.m_rcarray.ElementAt(14).right;
- StrRect.right = load.m_rcarray.ElementAt(29).left;
- load.m_rcarray.SetAt(15, StrRect);
- }
- ////////////////////////////////////////////////
- for (i = 3; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i < 10)
- {
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 3), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- }
- StrRect = load.m_rcarray.ElementAt(29);
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"取件", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(138)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 485;
- StrRect.top = 12;
- StrRect.right = StrRect.left + 60;
- StrRect.bottom = StrRect.top + 60;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg; pImg = NULL;
- }
- }
- CArray<CRect, CRect>rcarray;
- CStringArray strarray2;
- for (i = 10; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- strarray2.Add(strarray.ElementAt(7 + i - 10));
- }
- INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_HCENTER);
- for (i = 10; i <= 16; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- if (i == 10)
- {
- dty += bottom - StrRect.bottom;
- }
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1);
- }
- StrRect = load.m_rcarray.ElementAt(30); StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1); StrRect.top += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(16); StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"指定制作", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- strarray.RemoveAll();
- strarray.Add("产品名称");
- strarray.Add("数量");
- strarray.Add("照片编号");
- CArray<CRect, CRect>rc2array;
- for (i = 18; i <= 20; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1); StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 18), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left -= 2;
- StrRect.top = StrRect.bottom;
- StrRect.bottom += 18;
- rc2array.Add(StrRect);
- }
- int curypos = 0;
- for (i = 0; i < sparray2.GetSize(); i += 3)
- {
- rcarray.RemoveAll();
- strarray2.RemoveAll();
- for ( j = 0; j < 3; j++)
- {
- StrRect = rc2array.ElementAt(j);
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- #if JEFF_TEST_ON
- if (2 == j)
- {
- CString strImg = sparray2.ElementAt(i + 2);
- //int nImgCount = strImg.Replace(",", ",");
- int nImgCount = strImg.Replace(SEPS_VEB, SEPS_VEB);
- if (nImgCount != 0)
- strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), nImgCount + 1);
- else if (!strImg.IsEmpty())
- strImg.Format("%s; 共 %d 张", sparray2.ElementAt(i + 2), 1);
- strarray2.Add(strImg);
- }
- else
- strarray2.Add(sparray2.ElementAt(i + j));
- #else
- strarray2.Add(sparray2.ElementAt(i + j));
- #endif
- }
- INT bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- rcarray.RemoveAll();
- for (j = 0; j < 3; j++)
- {
- StrRect = rc2array.ElementAt(j);
- if (j == 0)
- {
- dty += bottom - StrRect.bottom;
- }
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
- StrRect.top = StrRect.bottom;
- StrRect.bottom += 18;
- rcarray.Add(StrRect);
- }
- rc2array.RemoveAll();
- rc2array.Copy(rcarray);
- }
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(20);
- dty = curypos - StrRect.bottom + 35;
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"调修要求", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- rcarray.RemoveAll();
- strarray2.RemoveAll();
- StrRect = load.m_rcarray.ElementAt(21);
- StrRect.top += dty;
- StrRect.bottom += dty;
- StrRect.left += 2;
- StrRect.right -= 2;
- StrRect.top += 2;
- rcarray.Add(StrRect);
- #if JEFF_TEST_ON
- // 17=客人备注bz3; 29=bz4单张相片备注,以空格分隔; 23=bz;
- strarray2.RemoveAll();
- CString strFind = "要求:";
- CString strbz3 = g_List1array.ElementAt(0).ElementAt(17);
- do
- {
- int nIndex = strbz3.Find(strFind, 1);
- if (nIndex != -1)
- {
- CString strbz = strbz3.Left(nIndex);
- strbz3 = strbz3.Mid(nIndex);
- strarray2.Add(strbz);
- }
- else
- {
- strarray2.Add(strbz3);
- strbz3 = "";
- }
- } while (strbz3.Find(strFind) != -1);
- strarray2.Add(g_List1array.ElementAt(0).ElementAt(25));
- if (!m_replace.IsEmpty())
- {
- m_replace = "设计替换照片:" + m_replace;
- m_replace.Replace("$", ";");
- m_replace.TrimLeft(";");
- }
- strarray2.Add(m_replace);
- bottom = CalHeight_01(StrRect, &strarray2, &m_Print, FORMAT_LEFT);
- #else
- strarray2.Add(m_bz);
- bottom = CalcHeight(rcarray, strarray2, &m_Print, FORMAT_LEFT);
- #endif
- StrRect = load.m_rcarray.ElementAt(21); StrRect.top += dty; StrRect.bottom += dty;
- dty += bottom - StrRect.bottom;
- StrRect.bottom = bottom;
- m_Print.DrawRect2(StrRect, 1); curypos = StrRect.bottom;
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(22);
- dty = curypos - StrRect.bottom + 25;
- StrRect.top += dty; StrRect.bottom += dty;
- CString m_edit9 = (g_cominfoarray.ElementAt(0).ElementAt(135));
- if (m_edit9.IsEmpty())
- {
- m_edit9 = "\
- 经确认后的照片均排入制作流程,\r\n\
- 恕不接受更改及退费。实际冲晒出来的相片\r\n\
- 与电脑显示会有少许差异,如颜色较深或亮度偏暗等。";
- }
- CString info1, info2, info3;
- int newlinepos = m_edit9.Find("\r\n");
- if (newlinepos != -1)
- {
- info1 = m_edit9.Left(newlinepos);
- m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
- }
- newlinepos = m_edit9.Find("\r\n");
- if (newlinepos != -1)
- {
- info2 = m_edit9.Left(newlinepos);
- m_edit9 = m_edit9.Right(m_edit9.GetLength() - newlinepos - 2);
- info3 = m_edit9;
- }
- if (1)
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)info1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)info3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)"经确认后的照片均排入制作流程,", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"恕不接受更改及退费。实际冲晒出来的相片", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"与电脑显示会有少许差异,如颜色较深或亮度偏暗等。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect = load.m_rcarray.ElementAt(25);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"贵宾签名:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(26);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawRect2(StrRect, 2);
- m_Print.SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(27);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("地址:" + g_cominfoarray.ElementAt(0).ElementAt(12)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(28);
- StrRect.top += dty; StrRect.bottom += dty;
- m_Print.DrawText((LPTSTR)(LPCTSTR)("电话:" + g_cominfoarray.ElementAt(0).ElementAt(11)), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- PrintPreview dlg;//dlg.m_mode=2;
- dlg.m_name = name;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- /*
- void CMainFrame::PrintFlowChart(CString m_id)
- {
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- // CRect StrRect(0,0,560,818);
- LoadRect load;
- load.SetLiaPath ("4.lia");
- load.SetMargins(-14,-14);
- if(!load.Load ())return;
- LoadRect load2;
- load2.SetMargins(-14,472+27-14);
- load2.SetLiaPath ("5.lia");
- if(!load2.Load ())return;
- //////////////////////////////////////////////////////////////
- CString filter="id='"+m_id+"';id='"+m_id+"'";
- g_sendhead.code[0]=54;
- g_sendhead.code[1]=50;
- g_sendhead.tabcount=2;
- g_sendhead.bsql=0;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>sparray;
- DataToArray(&g_List1array,&sparray);
- CString spno;
- for(int i=0; i<sparray.GetSize (); i++)
- {
- if(sparray.ElementAt (i).ElementAt (4)=="4" && sparray.ElementAt (i).ElementAt (5)!="入册")continue;
- if(sparray.ElementAt (i).ElementAt (5)=="入册"&&sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
- spno+=sparray.ElementAt (i).ElementAt (5);
- if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
- spno+=";";
- else
- {
- spno+=":";
- spno+=sparray.ElementAt (i).ElementAt (6);
- spno+=";";
- }
- }
- spno+=" 加挑:";
- for( i=0; i<sparray.GetSize (); i++)
- {
- if(sparray.ElementAt (i).ElementAt (4)!="4")continue;
- if(sparray.ElementAt (i).ElementAt (5)=="入册")continue;
- spno+=sparray.ElementAt (i).ElementAt (5);
- if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())
- spno+=";";
- else
- {
- spno+=":";
- spno+=sparray.ElementAt (i).ElementAt (6);
- spno+=";";
- }
- }
- if(spno.Right (6)==" 加挑:")
- {
- spno=spno.Left (spno.GetLength ()-6);
- }
- CString m_name1 = g_List1array.ElementAt (0).ElementAt (1);
- CString m_name2 = g_List1array.ElementAt (0).ElementAt (2);
- CString m_phone1=g_List1array.ElementAt (0).ElementAt (3);
- CString m_phone2=g_List1array.ElementAt (0).ElementAt (4);
- CString m_urgent=g_List1array.ElementAt (0).ElementAt (5);
- if(m_urgent.IsEmpty ())m_urgent="否";
- CString m_time2 = g_List1array.ElementAt (0).ElementAt (6);
- CString m_time4 = g_List1array.ElementAt (0).ElementAt (7);
- CString m_time5 = g_List1array.ElementAt (0).ElementAt (8);
- CString m_takezs = g_List1array.ElementAt (0).ElementAt (9);
- CString m_taoxizs = g_List1array.ElementAt (0).ElementAt (10);
- CString m_choosezs = g_List1array.ElementAt (0).ElementAt (11);
- CString m_ren = g_List1array.ElementAt (0).ElementAt (12);
- CString m_waiter3 = g_List1array.ElementAt (0).ElementAt (13);
- CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (14);
- CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (15);
- CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (16);
- CString m_bz = "客人要求: "+g_List1array.ElementAt (0).ElementAt (17);
- CString m_money3 = g_List1array.ElementAt (0).ElementAt (18);
- CString m_money1 = g_List1array.ElementAt (0).ElementAt (19);
- CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (20);
- CString m_payed4 = g_List1array.ElementAt (0).ElementAt (21);
- CString m_payed5 = g_List1array.ElementAt (0).ElementAt (22);
- CString m_sum3;
- m_sum3.Format ("%0.2f", atof(m_taoxijiage)+atof(m_payed4)-(atof(m_payed5)+atof(m_money1)));
- ::ConvertToPrice (m_sum3);
- if(m_money3.IsEmpty ())m_money3="0";
- // m_money3=m_money3+"/"+m_sum3;
- CString name;
- if(!m_name1.IsEmpty ())
- name=m_name1+",";
- name+=m_name2;
- name.TrimRight (",");
- CString phone;
- if(!m_phone1.IsEmpty ())
- phone=m_phone1+",";
- phone+=m_phone2;phone.TrimRight (",");
- CStringArray strarray;
- strarray.Add (m_urgent);
- strarray.Add (m_ren);
- strarray.Add (m_waiter3);
- strarray.Add (name);
- strarray.Add (m_time2);
- strarray.Add (m_time4);
- strarray.Add (m_time5);
- strarray.Add (m_money3);
- strarray.Add (m_takezs);
- strarray.Add (m_taoxizs);
- strarray.Add (m_choosezs);
- strarray.Add (m_id);
- strarray.Add (phone);
- ////////////////////////////////////////////////////////////////
- int rcpos=-1;
- CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
- Image *pImg=NULL;
- #ifdef MNLS_VERSION
- LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG") );
- #else
- ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo.jpg");
- #endif
- m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect=load.m_rcarray .ElementAt (++rcpos);
- #ifdef MNLS_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- StrRect=load.m_rcarray .ElementAt (++rcpos);
- #ifdef MNLS_VERSION
- m_Print.DrawRect(StrRect);
- #endif
- m_Print.SetFontFace(7, 1, "黑体");
- m_Print.SetColor(0xffffff);
- #ifdef MNLS_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- m_Print.SetColor(0);
- m_Print.SetFontFace(25, 1, "黑体");
- StrRect=load.m_rcarray .ElementAt (++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"数码制作一览表", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- CString title[13]={"是否加急:","接单门市:","选样人员:","新郎新娘姓名:","拍照日期:","选片日期:","取件日期:","加挑/余款:","拍摄总张数:","应挑选张数:","额外加挑张数:","票号:","客户联系电话:"};
- m_Print.SetFontFace(12, 1, "宋体");
- for( i=0; i<13; i++)
- {
- StrRect=load.m_rcarray .ElementAt (++rcpos);
- if(i<3)
- m_Print.DrawRect2(StrRect, 0);
- else
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)title[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for( i=18; i<=37; i++)
- {
- StrRect=load.m_rcarray .ElementAt (++rcpos);
- if(i>=19&&i<=21)
- m_Print.DrawRect2(StrRect, 2);
- else if(i==26)
- {
- CRect rc=StrRect;
- CRect rc2=rc;
- rc.right -=rc2.Width ()/2;
- m_Print.DrawRect2(rc, 1);
- rc2.left +=rc.Width ();
- m_Print.DrawRect2(rc2, 1);
- }
- else
- m_Print.DrawRect2(StrRect, 1);
- if(i==18)
- {
- StrRect.left +=5;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- }
- //////////////////////////////////////
- rcpos=-1;
- for( i=0; i<8; i++)
- {
- StrRect=load2.m_rcarray .ElementAt (++rcpos);
- m_Print.DrawRect2(StrRect, 1);
- }
- CString title2[4]={"化妆师:","摄影师:","数码设计师:","顾客签名:"};
- for( i=0; i<4; i++)
- {
- StrRect=load2.m_rcarray .ElementAt (++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)title2[i], StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for( i=0; i<4; i++)
- {
- StrRect=load2.m_rcarray .ElementAt (++rcpos);
- m_Print.DrawRect2(StrRect, 2);
- }
- ///////////////////////////////////////////
- for( i=19; i<=31; i++)
- {
- StrRect=load.m_rcarray .ElementAt (i-1);
- StrRect.left +=4;
- if(i==31)
- {
- if(m_phone1.IsEmpty ()==0 && m_phone2.IsEmpty ()==0)
- {
- StrRect.top +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
- StrRect.top +=8;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else if((i-19)==7)
- {
- CRect rc=StrRect;
- CRect rc2=rc;
- rc.right -=rc2.Width ()/2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), rc, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left +=rc.Width ()+3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_sum3, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-19), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- strarray.RemoveAll ();
- strarray.Add (m_waiter2);
- strarray.Add (m_waiter1);
- strarray.Add (m_waiter4);
- for( i=13; i<=15; i++)
- {
- StrRect=load2.m_rcarray .ElementAt (i-1);
- StrRect.left +=4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-13), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- ///////////spno
- CRect sprc[14];
- for(i=0; i<14; i++)
- {
- if(i<7)
- {
- if(i==0)
- {
- StrRect=load.m_rcarray .ElementAt (17);StrRect.left +=94;StrRect.right -=3;
- }
- else
- {
- StrRect=load.m_rcarray .ElementAt (30+i);StrRect.left +=4;StrRect.right -=3;
- }
- }
- else
- {
- StrRect=load2.m_rcarray .ElementAt (i-7);StrRect.left +=4;StrRect.right -=3;
- }
- sprc[i]=StrRect;
- // m_Print.DrawText((LPTSTR)(LPCTSTR)"xxx", sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- CString temp,tempspno,tempbz;
- CSize size;
- BOOL bRun=0;
- int fontsize=12;
- ll: tempspno=spno;
- tempbz=m_bz;
- m_Print.SetFontFace(fontsize, 1, "宋体");
- for( i=0; i<14; i++)
- {
- if(!tempspno.IsEmpty ())
- {
- temp=tempspno;
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- int right=0;
- CRect temprc=sprc[i];
- while(size.cx>temprc.Width ())
- {
- right++;
- temp=tempspno.Left (tempspno.GetLength ()-(right));
- if(GIsHalfHZ(temp))
- {
- right++;
- temp.Delete (temp.GetLength ()-1);
- }
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- }
- if(bRun)
- m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- tempspno=tempspno.Right (tempspno.GetLength ()-temp.GetLength ());
- if(tempspno.IsEmpty ())i++;
- }
- else if(!tempbz.IsEmpty ())
- {
- temp=tempbz;
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- int right=0;
- CRect temprc=sprc[i];
- while(size.cx>temprc.Width ())
- {
- right++;
- temp=tempbz.Left (tempbz.GetLength ()-(right));
- if(GIsHalfHZ(temp))
- {
- right++;
- temp.Delete (temp.GetLength ()-1);
- }
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- }
- if(bRun)
- m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- tempbz=tempbz.Right (tempbz.GetLength ()-temp.GetLength ());
- }
- }
- if(tempspno.IsEmpty ()==0 || tempbz.IsEmpty ()==0)
- {
- fontsize--;
- goto ll;
- }
- if(bRun==0)
- {
- bRun=1;
- goto ll;
- }
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w , dlg.m_h );
- dlg.m_pDC =m_Print.GetPDC() ;
- if(dlg.DoModal ()!=IDOK)return;
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- void CMainFrame::SetSelFolder(int pos)
- {
- m_wndToolBar2.SetSelFolder(pos);
- }*/
- void CMainFrame::ToPhotoPrint()
- {
- UINT nID = 1;
- LPSTR pName;
- pName = (LPSTR)(LPCSTR)"相片冲印资料";
- OPEN_MENU(PhotoPrintFrom);
- }
- void CMainFrame::GetOcx()
- {
- char path[MAX_PATH];
- ::GetSystemDirectory(path, MAX_PATH);
- CString syspath = path;
- try
- {
- if (!::PathFileExists(syspath + "\\MSCHRT20.OCX"))
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 103;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(1); if (g_bSendOK == 0)return;
- CFile fp;
- if (fp.Open(syspath + "\\MSCHRT20.OCX", CFile::modeWrite | CFile::modeCreate))
- {
- fp.Write(g_pData, g_nLeng);
- fp.Close();
- ::Sleep(1000);
- }
- }
- CString temp;
- temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
- ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
- }
- catch (...)
- {
- }
- try
- {
- CString temp;
- temp.Format(_T(" -s %s\\MSCHRT20.OCX"), syspath);
- ShellExecute(NULL, _T("Open"), _T("Regsvr32"), temp, NULL, SW_HIDE);
- }
- catch (...)
- {
- }
- }
- void CMainFrame::OnServer()
- {
- // TODO: Add your command handler code here
- DBConfig dlg;
- dlg.DoModal();
- }
- void CMainFrame::OnPath()
- {
- // TODO: Add your command handler code here
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(49) == 0)return;
- SetPathDlg2 dlg;
- dlg.DoModal();
- }
- void CMainFrame::OnShowhis()
- {
- // TODO: Add your command handler code here
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(52) == 0)return;
- CMenu *pMenu = GetMenu();
- CMenu* submenu = pMenu->GetSubMenu(2);
- UINT status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
- if (status&MF_CHECKED)
- {
- submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_UNCHECKED);
- g_bShowOK = 1;
- }
- else
- {
- submenu->CheckMenuItem(IDM_SHOWHIS, MF_BYCOMMAND | MF_CHECKED);
- g_bShowOK = 0;
- } m_Mdi.CloseAll();
- }
- void CMainFrame::AddHistoryMenu(CArray<CStringArray, CStringArray>*hisyeararray) // 添加历史数据库菜单;
- {
- #ifdef NEW_SKIN
- CMenu* m_menuXP = GetMenu();
- CMenu* submenu = m_menuXP->GetSubMenu(2);
-
- // 删除原有菜单;
- int i = 0;
- for ( i = 0; i < 100; i++)
- {
- submenu->DeleteMenu(1000 + i, MF_BYCOMMAND);
- }
-
- // 重创菜单,从资源ID1000开始;
- for (i = 0; i < hisyeararray->GetSize(); i++)
- {
- submenu->AppendMenu(MF_STRING, 1000 + i, "查看历史数据:" + hisyeararray->ElementAt(i).ElementAt(0)); // 第一项菜单项;
- }
- g_nYearpos = -1;
- #else
- HMENU hMenu = ::GetMenu(m_hWnd);
- m_menuXP.Attach(hMenu);
- BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
- for (int i = 0; i < 100; i++)
- {
- submenu->DeleteMenu (1000+i, MF_BYCOMMAND);
- }
- for( i=0; i<hisyeararray->GetSize (); i++)
- {
- submenu->AppendMenu(MF_STRING, 1000+i, "查看历史数据:"+hisyeararray->ElementAt (i).ElementAt (0)); // 第一项菜单项
- }
- m_menuXP.Detach ();
- g_nYearpos = -1;
- #endif
- }
- /************************************************************************/
- /*
- Jeff
- 函数:AddBranchMenu()
- 参数:CArray<CStringArray, CStringArray> *branchArray
- 返回:void
- 注意:
- 调用关系:
- */
- /************************************************************************/
- void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*branchArray)
- {
- //WriteTextLog("AddBranchMenu,添加集团版菜单");
- #ifdef ENTERPRISE_VERSION
- CMenu *m_menuXP = GetMenu();
- CMenu* submenu = m_menuXP->GetSubMenu(0);
- int i = 0;
- for ( i = 0; i < 100; i++)
- {
- submenu->DeleteMenu(2000 + i, MF_BYCOMMAND);
- }
- g_menubranchname.RemoveAll();
- CString name;
- int a = 0;
- #if 0 // Jeff.add for test
- CString strCount;
- strCount.Format("历史数据库个数=%d", branchArray->GetSize());
- WriteTextLog(strCount);
- #endif
- for (i = 0; i < branchArray->GetSize() - 1; i++)
- {
- //WriteTextLog("111");
- //WriteTextLog(hisyeararray->ElementAt(i).ElementAt(0));
- //WriteTextLog(name);
- if (name == "")
- {
- name = branchArray->ElementAt(i).ElementAt(0);
- #ifndef SQLSERVER_VERSION
- submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
- a++;
- #endif
- submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
- a++;
- g_menubranchname.Add(name);
- continue;
- }
- else if (branchArray->ElementAt(i).ElementAt(0).Find(name) != -1 && ((branchArray->ElementAt(i).ElementAt(0).GetLength() - name.GetLength()) == 4))
- {
- continue;
- }
- name = branchArray->ElementAt(i).ElementAt(0);
- #ifndef SQLSERVER_VERSION
- submenu->AppendMenu(MF_STRING, 2000 + a, "查看分店数据:" + name + "(使用本机缓存,速度快)");
- a++;
- #endif
- submenu->AppendMenu(MF_STRING, 2000 + a, "操作分店数据:" + name + "(实时访问分店,需网络通畅)");
- g_menubranchname.Add(name);
- a++;
- //WriteTextLog("222");
- }
- if ((branchArray->GetSize() - 1) > 0)
- {
- if (branchArray->ElementAt(0).ElementAt(3) == "总店")
- submenu->AppendMenu(MF_STRING, 2000 + a, "多店数据汇总");
- }
- #endif
- }
- // Jeff:如果选择了历史数据库,则开单的数据会录入到该历史数据库中,而非当前数据库;
- // g_nYearpos==-1,表示当前主数据库,其他>=0的值表示历史数据库在g_historydb中的索引值;
- void CMainFrame::OnHistory(UINT nID) // 选择历史数据库菜单响应;
- {
- CMenu* pMenu = GetMenu();
- CMenu* submenu = pMenu->GetSubMenu(2);
- UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(52) == 0)return;
- m_Mdi.CloseAll();
- for (int i = 0; i < 100; i++)
- {
- submenu->CheckMenuItem(1000 + i, MF_BYCOMMAND | MF_UNCHECKED);
- }
- if (status&MF_CHECKED)
- {
- g_nYearpos = -1;
- status = submenu->GetMenuState(IDM_SHOWHIS, MF_BYCOMMAND);
- if (status&MF_CHECKED)
- g_bShowOK = 0;
- else
- g_bShowOK = 1;
- }
- else
- {
- submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
- g_nYearpos = nID - 1000;
- g_bShowOK = 1;
- }
- }
- void CMainFrame::OnBranchData(UINT nID)
- {
- #ifdef ENTERPRISE_VERSION
- #ifdef SQLSERVER_VERSION
- OnBranchData2(nID);
- return;
- #endif
- #endif
- }
- void CMainFrame::OnBranchData2(UINT nID)
- {
- #ifdef ENTERPRISE_VERSION
- g_bAllBranch = 0;
- m_Mdi.CloseAll();
- OnDisconnect();
- CMenu *pMenu = GetMenu();
- CMenu* submenu = pMenu->GetSubMenu(0);
- UINT status = submenu->GetMenuState(nID, MF_BYCOMMAND);
- for (int i = 0; i < 100; i++)
- {
- submenu->CheckMenuItem(2000 + i, MF_BYCOMMAND | MF_UNCHECKED);
- }
- if (status&MF_CHECKED)
- {
- g_branchname.Empty();
- g_branchip.Empty();
- g_bBranchModify = 0;
- g_user.bLongin = 0;
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- g_pMainWnd2->RefreshOutlookBar();
- g_pMainWnd2->DrawLogin();
- g_path1 = g_path1bak;
- g_path2 = g_path2bak;
- g_path3 = g_path3bak;
- g_path4 = g_path4bak;
- g_path5 = g_path5bak;
- g_path6 = g_path6bak;
- g_path7 = g_path7bak;
- g_pMainWnd2->EnableBtns(1);
- }
- else
- {
- BOOL bNeedCheckRights = 1;
- if (g_user.bLongin && g_branchname == "")//无需登陆本店判断其访问分店权限
- {
- bNeedCheckRights = 0;
- }
- #ifndef SQLSERVER_VERSION
- if ((g_menubranchname.GetSize() * 2) == nID - 2000)//多店数据汇总
- #else
- if ((g_menubranchname.GetSize()) == nID - 2000)//多店数据汇总
- #endif
- {
- g_branchname.Empty();
- g_branchip.Empty();
- g_bBranchModify = 0;
- if (bNeedCheckRights)
- {
- g_user.bLongin = 0;
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- }
- if (IsHasRightsnew(28) == 0)
- {
- return;
- }
- g_bAllBranch = 1; g_pMainWnd2->ShowBar(0);
- g_pMainWnd2->RefreshOutlookBar2();
- submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
- g_branchname.Empty();
- g_branchip.Empty();
- g_bBranchModify = 0;
- g_pMainWnd2->DrawLogin();
- g_pMainWnd2->EnableBtns(0);
- g_path1 = g_path1bak;
- g_path2 = g_path2bak;
- g_path3 = g_path3bak;
- g_path4 = g_path4bak;
- g_path5 = g_path5bak;
- g_path6 = g_path6bak;
- g_path7 = g_path7bak;
- }
- else
- {
- if (bNeedCheckRights)
- {
- g_branchname.Empty();
- g_branchip.Empty();
- g_bBranchModify = 0;
- submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_UNCHECKED);
- g_user.bLongin = 0;
- if (g_pMainWnd2)
- {
- g_pMainWnd2->DrawLogin();
- g_pMainWnd2->ShowBar(0);
- }
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(28) == 0)
- {
- return;
- }
- submenu->CheckMenuItem(nID, MF_BYCOMMAND | MF_CHECKED);
- #ifndef SQLSERVER_VERSION
- if (nID % 2 == 0)
- g_branchname = g_menubranchname.ElementAt((nID - 2000) / 2);
- else
- g_branchname = g_menubranchname.ElementAt((nID - 2001) / 2);
- #else
- g_branchname = g_menubranchname.ElementAt(nID - 2000);
- #endif
- //printf("选择分店:%s\n", g_branchname);
- g_branchip.Empty();
- CString domainname = "";
- for (int i = 0; i < g_brancharray.GetSize(); i++)
- {
- /*
- for(int j=0; j<g_brancharray.GetSize(); j++)
- printf("%s\n", g_brancharray.ElementAt(i).ElementAt(j));
- */
- if (g_branchname == g_brancharray.ElementAt(i).ElementAt(0))
- {
- g_branchip = g_brancharray.ElementAt(i).ElementAt(1);
- g_branchip2 = g_brancharray.ElementAt(i).ElementAt(4);
- domainname = g_brancharray.ElementAt(i).ElementAt(2);
- }
- }
- g_path1 = g_path1bak;
- g_path2 = g_path2bak;
- g_path3 = g_path3bak;
- g_path4 = g_path4bak;
- g_path5 = g_path5bak;
- g_path6 = g_path6bak;
- g_path7 = g_path7bak;
- if (domainname.IsEmpty())
- {
- g_path1 = g_path2 = g_path3 = g_path4 = g_path5 = g_path6 = g_path7 = "xxx";
- }
- else
- {
- g_path1 += "\\" + domainname;
- g_path2 += "\\" + domainname;
- g_path3 += "\\" + domainname;
- g_path4 += "\\" + domainname;
- g_path5 += "\\" + domainname;
- g_path6 += "\\" + domainname;
- g_path7 += "\\" + domainname;
- }
- g_bBranchModify = 1;
- /* CArray<CStringArray, CStringArray>yeararray;
- for( i=0; i<g_brancharray.GetSize (); i++)
- {
- if(g_brancharray.ElementAt (i).ElementAt (0).Find (g_branchname)!=-1 && g_branchname!=g_brancharray.ElementAt (i).ElementAt (0))
- {
- int size=yeararray.GetSize ();
- yeararray.SetSize(size+1,1);
- CString str=g_brancharray.ElementAt (i).ElementAt (0);
- str.Delete (0, g_branchname.GetLength ());
- yeararray.ElementAt (size).Add (str);
- }
- }
- AddHistoryMenu(&yeararray);*/
- if (g_bBranchModify)OnDisconnect();
- if (1)
- {
- g_user.bLongin = 0;
- g_user.name.Empty();
- g_user.rights.Empty();
- g_user.account.Empty();
- g_user.rights2 = "*门市流程;1;拍照;修片;选片;精修;设计;发片/取件;*财务管理;0;*统计查询;0;* 短信群发 ;0;*会员管理;0;*礼服管理;0;*库存管理;0;*客户管理;0;*来电精灵;0;*员工考勤;0;";
- g_pMainWnd2->RefreshOutlookBar();
- m_Mdi.CloseAll();
- if (g_pMainWnd2)
- {
- g_pMainWnd2->DrawLogin();
- g_pMainWnd2->ShowBar(0);
- }
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- if (g_pMainWnd2)g_pMainWnd2->ShowBar(1);
- }
- g_pMainWnd2->DrawLogin();
- g_pMainWnd2->EnableBtns(1);
- }
- g_nYearpos = -1;
- }
- #endif
- }
- void CMainFrame::OnStaffAchievementShow() //Jeff:此机只用于员工看业绩;
- {
- // TODO: Add your command handler code here
- if (g_user.bLongin == 0) // 是否登陆系统;
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(49) == 0)return;// 是否有权限进行设置;
- CMenu *pMenu = GetMenu();
- CMenu* submenu = pMenu->GetSubMenu(1);
- UINT status = submenu->GetMenuState(IDM_StaffAchievementShow, MF_BYCOMMAND);
- if (status&MF_CHECKED)
- {
- submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_UNCHECKED);
- AfxGetApp()->WriteProfileInt(LYFZVERSION, "status2", 0);
- g_bStaffAchievementShow = 0;
- TCHAR szKey[MAX_PATH];
- TCHAR szDir[MAX_PATH];
- ::GetModuleFileName(NULL, szDir, MAX_PATH);
- HKEY hKey = 0;
- DWORD disp = 0;
- lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
- int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
- if (lResult == ERROR_SUCCESS)
- {
- RegDeleteValue(hKey, "YLGLMAINAUTORUN");
- RegDeleteKey(hKey, "YLGLMAINAUTORUN");
- RegCloseKey(hKey);
- }
- }
- else
- {
- submenu->CheckMenuItem(IDM_StaffAchievementShow, MF_BYCOMMAND | MF_CHECKED);
- AfxGetApp()->WriteProfileInt(LYFZVERSION, "status2", 1);
- g_bStaffAchievementShow = 1;
- TCHAR szKey[MAX_PATH];
- TCHAR szDir[MAX_PATH];
- ::GetModuleFileName(NULL, szDir, MAX_PATH);
- HKEY hKey = 0;
- DWORD disp = 0;
- lstrcpy(szKey, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
- int lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
- if (lResult == ERROR_SUCCESS)
- {
- lResult = RegSetValueEx(hKey, "YLGLMAINAUTORUN", 0, REG_SZ, (const unsigned char*)szDir, lstrlen(szDir));
- RegCloseKey(hKey);
- }
- StaffAchievementSet dlg;
- dlg.DoModal();
- }
- }
- void CMainFrame::PrintDinDan2(CString m_id)
- {
- #ifdef MODERN_VERSION
- SelContent seldlg;
- if (seldlg.DoModal() != IDOK)return;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- // CRect StrRect(0,0,560,818);
- LoadRect load;
- LoadRect load2;
- LoadRect load3;
- load.SetLiaPath ("9.lia");
- load.SetMargins(-14,0);
- if(!load.Load ())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
- g_sendhead.code[0]=11;
- g_sendhead.code[1]=52;
- g_sendhead.code[2]=50;
- g_sendhead.code[3]=38;
- g_sendhead.code[4]=27;
- g_sendhead.tabcount=5;
- g_sendhead.bsql=0;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- CArray<CStringArray, CStringArray>phonearray;
- CArray<CStringArray, CStringArray>bukuan2array;
- CArray<CStringArray, CStringArray>bukuanarray;
- DataToArray(&g_List1array, &clientarray, &sparray, &bukuan2array, &bukuanarray);
- CTime tm=CTime::GetCurrentTime ();
- CString str;
- CString m_money1 = g_List1array.ElementAt (0).ElementAt (1);
- CString m_money2 = g_List1array.ElementAt (0).ElementAt (2);
- CString m_money3 = g_List1array.ElementAt (0).ElementAt (3);
- CString m_name1 = g_List1array.ElementAt (0).ElementAt (4);
- CString m_name2 = g_List1array.ElementAt (0).ElementAt (5);
- CString m_taoxiname= g_List1array.ElementAt (0).ElementAt (7);
- CString m_taoxijiage = g_List1array.ElementAt (0).ElementAt (8);
- CString m_zs = g_List1array.ElementAt (0).ElementAt (9);
- CString m_time1 = g_List1array.ElementAt (0).ElementAt (10);
- CString m_time2 = g_List1array.ElementAt (0).ElementAt (11);
- CString m_time3 = g_List1array.ElementAt (0).ElementAt (12);
- CString m_ren = g_List1array.ElementAt (0).ElementAt (14);
- CString m_discount = g_List1array.ElementAt (0).ElementAt (15);
- CString m_payed1 = g_List1array.ElementAt (0).ElementAt (16);
- CString m_payed2 = g_List1array.ElementAt (0).ElementAt (17);
- CString m_payed3 = g_List1array.ElementAt (0).ElementAt (18);
- CString m_payed4 = g_List1array.ElementAt (0).ElementAt (19);
- CString m_payed5 = g_List1array.ElementAt (0).ElementAt (20);
- CString m_time4 = g_List1array.ElementAt (0).ElementAt (21);
- CString m_time5 = g_List1array.ElementAt (0).ElementAt (22);
- CString m_clothescount = g_List1array.ElementAt (0).ElementAt (26);
- CString m_clothescount2 = g_List1array.ElementAt (0).ElementAt (27);
- CString m_outside = g_List1array.ElementAt (0).ElementAt (28);
- CString m_outside2 = g_List1array.ElementAt (0).ElementAt (29);
- CString m_style = g_List1array.ElementAt (0).ElementAt (30);
- CString m_waiter1 = g_List1array.ElementAt (0).ElementAt (34);
- CString m_waiter2 = g_List1array.ElementAt (0).ElementAt (35);
- CString m_waiter4 = g_List1array.ElementAt (0).ElementAt (37);
- CString m_bz = g_List1array.ElementAt (0).ElementAt (38);
- CString m_phone1=clientarray.ElementAt (0).ElementAt (3);
- CString m_phone2=clientarray.ElementAt (0).ElementAt (4);
- CString m_addr1=clientarray.ElementAt (0).ElementAt (7);
- CString m_addr2=clientarray.ElementAt (0).ElementAt (8);
- CString m_occupation1=clientarray.ElementAt (0).ElementAt (9);
- CString m_occupation2=clientarray.ElementAt (0).ElementAt (10);
- filter="name='"+m_ren+"'";
- g_sendhead.code[0]=5;
- g_sendhead.tabcount=1;
- g_sendhead.bsql=0;
- int g_nYearposTemp=g_nYearpos;
- g_nYearpos=-1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- g_nYearpos=g_nYearposTemp;
- if(g_bSendOK==0)return;
- DataToArray(&phonearray);
- m_money2.Format ("%f", atof(m_payed5)+atof(m_money1));
- m_money1.Format ("%f", atof(m_taoxijiage)+atof(m_payed4));
- m_money3.Format ("%f", atof(m_money1)-atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos=-1;
- CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
- Image *pImg=NULL;
- ::LoadImageFromBuf (&pImg, g_mainpath+"\\skin\\logo2.jpg");
- if(seldlg.m_bFrame)
- m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- m_Print.SetFontFace(16, 1, "黑体");
- StrRect=load.m_rcarray .ElementAt (++rcpos);
- if(seldlg.m_bFrame)
- ///////////////////////////////不用改
- m_Print.DrawText((LPTSTR)(LPCTSTR)"摩登新娘工作流程单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(10, 1, "宋体");
- for( i=3; i<=6; i++)
- {
- StrRect=load.m_rcarray .ElementAt (i-1);
- if(seldlg.m_bFrame)
- m_Print.DrawRect2(StrRect, 1);
- }
- CStringArray strarray;
- if(seldlg.m_bBooking==0)
- {
- m_name1.Empty ();
- m_name2.Empty ();
- m_phone1.Empty ();
- m_phone2.Empty ();
- m_addr1.Empty ();
- m_addr2.Empty ();
- m_taoxiname.Empty ();
- m_taoxijiage.Empty ();
- }
- if(seldlg.m_bFrame )
- {
- strarray.Add("新郎:"+m_name1);
- strarray.Add("H");
- strarray.Add("O");
- strarray.Add("手机:"+m_phone1);
- strarray.Add("新娘:"+m_name2);
- strarray.Add("H");
- strarray.Add("O");
- strarray.Add("手机:"+m_phone2);
- }
- else
- {
- strarray.Add(" "+m_name1);
- strarray.Add("");
- strarray.Add("");
- strarray.Add(" "+m_phone1);
- strarray.Add(" "+m_name2);
- strarray.Add("");
- strarray.Add("");
- strarray.Add(" "+m_phone2);
- }
- for( i=7; i<=14; i++)
- {
- StrRect=load.m_rcarray .ElementAt (i-1);
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect=load.m_rcarray .ElementAt (3);
- StrRect.left +=2;
- if(seldlg.m_bFrame)
- str="地址:"+m_addr1;
- else
- str=" "+m_addr1;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (5);
- StrRect.left +=2;
- if(seldlg.m_bFrame)
- str="地址:"+m_addr2;
- else
- str=" "+m_addr2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //////////////////////////////////////////////////////
- StrRect=load.m_rcarray .ElementAt (14);
- str="预\r\n约";
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.top +=46;
- StrRect.left +=2;
- if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect=load.m_rcarray .ElementAt (15);
- if(seldlg.m_bFrame)
- str="套系名称:"+m_taoxiname;
- else
- str=" "+m_taoxiname;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.left +=4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (16);
- if(seldlg.m_bFrame)
- str="单价:"+m_taoxijiage;
- else
- str=" "+m_taoxijiage;
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (21);
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- str="新人签名:";
- StrRect.left +=2;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (22);
- if(seldlg.m_bBooking==0)
- {
- if(seldlg.m_bFrame)
- str="未付款:";
- else
- str=" ";
- }
- else
- {
- if(seldlg.m_bFrame)
- str="未付款:"+m_money3;
- else
- str=" "+m_money3;
- }
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (23);
- str="结婚秘书:";
- StrRect.left +=2;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (24);
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.left +=3;
- StrRect.top +=3;
- StrRect.right -=2;
- StrRect.bottom -=2;
- int realpos=0;str="";
- for(i=0; i<sparray.GetSize (); i++)
- {
- if(atoi(sparray.ElementAt (i).ElementAt (4))!=1)continue;
- str+=sparray.ElementAt (i).ElementAt (5);
- str+=" 数量:";
- str+=sparray.ElementAt (i).ElementAt (3);
- if(realpos%2)
- str+="\r\n";
- else
- str+=" ";
- realpos++;
- }
- str.TrimRight ("\r\n");
- str.TrimRight (" ");
- if(seldlg.m_bBooking)AutoDraw(m_Print, StrRect, str, 1.4);
- ///////////////////////////////////////////////////////////
- StrRect=load.m_rcarray .ElementAt (14);
- StrRect.top +=1*122;
- StrRect.bottom +=1*122;
- str="拍\r\n照";
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.top +=46;
- StrRect.left +=2;
- if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect=load.m_rcarray .ElementAt (15);
- StrRect.top +=1*122;
- StrRect.bottom +=1*122;
- str="拍照内容: 白 晚 特 便";
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.left +=4;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (21);
- StrRect.top +=1*122;
- StrRect.bottom +=1*122;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- str=" 新人签名:";
- StrRect.left +=2;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (22);
- StrRect.top +=1*122;
- StrRect.bottom +=1*122;
- if(seldlg.m_bTake)
- {
- if(seldlg.m_bFrame)
- str="未付款:"+m_money3;
- else
- str=" "+m_money3;
- }
- else
- {
- if(seldlg.m_bFrame)
- str="未付款:";
- else
- str=" ";
- }
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (23);
- StrRect.top +=1*122;
- StrRect.bottom +=1*122;
- str="结婚秘书:";
- StrRect.left +=2;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (24);
- StrRect.top +=1*122;
- StrRect.bottom +=1*122;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.left +=3;
- StrRect.top +=3;
- StrRect.right -=2;
- StrRect.bottom -=2;
- if(seldlg.m_bTake)
- {
- str="";
- for(i=0; i<bukuan2array.GetSize (); i++)
- {
- if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=1)continue;
- str+="加挑: ";
- str+=bukuan2array.ElementAt (i).ElementAt (4);
- str+="\r\n";
- }
- str.TrimRight ("\r\n");
- str.TrimRight (" ");
- AutoDraw(m_Print, StrRect, str, 1.4);
- }
- ///////////////////////////////////////////////////////////
- StrRect=load.m_rcarray .ElementAt (14);
- StrRect.top +=2*122;
- StrRect.bottom +=2*122;
- str="选\r\n样";
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.top +=46;
- StrRect.left +=2;
- if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect=load.m_rcarray .ElementAt (15);
- StrRect.top +=2*122;
- StrRect.bottom +=2*122;
- str="选片内容:";
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.left +=4;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (21);
- StrRect.top +=2*122;
- StrRect.bottom +=2*122;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- str=" 新人签名:";
- StrRect.left +=2;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (22);
- StrRect.top +=2*122;
- StrRect.bottom +=2*122;
- if(seldlg.m_bChoose)
- {
- if(seldlg.m_bFrame)
- str="未付款:"+m_money3;
- else
- str=" "+m_money3;
- }
- else
- {
- if(seldlg.m_bFrame)
- str="未付款:";
- else
- str=" ";
- }
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (23);
- StrRect.top +=2*122;
- StrRect.bottom +=2*122;
- str="结婚秘书:";
- StrRect.left +=2;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (24);
- StrRect.top +=2*122;
- StrRect.bottom +=2*122;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- if(seldlg.m_bChoose)
- {
- StrRect.left +=3;
- StrRect.top +=3;
- StrRect.right -=2;
- StrRect.bottom -=2;
- str="";
- for(i=0; i<bukuan2array.GetSize (); i++)
- {
- if(atoi(bukuan2array.ElementAt (i).ElementAt (5))!=2)continue;
- str+="加挑: ";
- str+=bukuan2array.ElementAt (i).ElementAt (4);
- str+="\r\n";
- }
- str.TrimRight ("\r\n");
- str.TrimRight (" ");
- AutoDraw(m_Print, StrRect, str, 1.4);
- }
- ///////////////////////////////////////////////////////////
- StrRect=load.m_rcarray .ElementAt (14);
- StrRect.top +=3*122;
- StrRect.bottom +=3*122;
- str="结\r\n婚";
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.top +=46;
- StrRect.left +=2;
- if(seldlg.m_bFrame)AutoDraw(m_Print, StrRect, str, 1.4);
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect=load.m_rcarray .ElementAt (15);
- StrRect.top +=3*122;
- StrRect.bottom +=3*122;
- str="结婚内容: 区 白 晚 押金:";
- if(seldlg.m_bFrame) m_Print.DrawRect2(StrRect, 1);
- StrRect.left +=4;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (21);
- StrRect.top +=3*122;
- StrRect.bottom +=3*122;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- str=" 新人签名:";
- StrRect.left +=2;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (22);
- StrRect.top +=3*122;
- StrRect.bottom +=3*122;
- if(seldlg.m_bBooking)
- {
- if(seldlg.m_bFrame)
- str="未付款:"+m_money3;
- else
- str=" "+m_money3;
- }
- else
- {
- if(seldlg.m_bFrame)
- str="未付款:";
- else
- str=" ";
- }
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (23);
- StrRect.top +=3*122;
- StrRect.bottom +=3*122;
- str="结婚秘书:";
- StrRect.left +=2;
- if(seldlg.m_bFrame)m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (24);
- StrRect.top +=3*122;
- StrRect.bottom +=3*122;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- if(seldlg.m_bBooking)
- {
- StrRect.left +=3;
- StrRect.top +=3;
- StrRect.right -=2;
- StrRect.bottom -=2;
- realpos=0;str="";
- for(i=0; i<sparray.GetSize (); i++)
- {
- if(atoi(sparray.ElementAt (i).ElementAt (4))!=2)continue;
- str+=sparray.ElementAt (i).ElementAt (5);
- str+=" 数量:";
- str+=sparray.ElementAt (i).ElementAt (3);
- if(realpos%2)
- str+="\r\n";
- else
- str+=" ";
- realpos++;
- }
- str.TrimRight ("\r\n");
- str.TrimRight (" ");
- AutoDraw(m_Print, StrRect, str, 1.4);
- }
- ///////////////////////////////////////
- strarray.RemoveAll ();
- if(seldlg.m_bFrame)
- {
- strarray.Add ("项目");
- strarray.Add ("万");
- strarray.Add ("千");
- strarray.Add ("百");
- strarray.Add ("十");
- strarray.Add ("个");
- strarray.Add ("收 银");
- }
- else
- {
- strarray.Add ("");
- strarray.Add ("");
- strarray.Add ("");
- strarray.Add ("");
- strarray.Add ("");
- strarray.Add ("");
- strarray.Add ("");
- }
- CStringArray strarray2;
- float ftotal=0;
- int realcount=0;
- if(seldlg.m_bBooking)
- {
- for(i=0; i<bukuanarray.GetSize (); i++)
- {
- if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=3 && atoi(bukuanarray.ElementAt (i).ElementAt (6))!=4)continue;
- realcount++;
- if(realcount>6)break;
- str=bukuanarray.ElementAt (i).ElementAt (1);
- ftotal+=atof(str);
- strarray2.Add (GetW(str));
- strarray2.Add (GetK(str));
- strarray2.Add (GetB(str));
- strarray2.Add (GetS(str));
- strarray2.Add (GetG(str));
- strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
- }
- }
- while(strarray2.GetSize ()<36)
- strarray2.Add ("");
- str.Format ("%f", ftotal);
- strarray2.Add (GetW(str));
- strarray2.Add (GetK(str));
- strarray2.Add (GetB(str));
- strarray2.Add (GetS(str));
- strarray2.Add (GetG(str));
- strarray2.Add ("");
- //拍照
- ftotal=0;
- realcount=0;
- if(seldlg.m_bTake)
- {
- for(i=0; i<bukuanarray.GetSize (); i++)
- {
- if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=1)continue;
- realcount++;
- if(realcount>6)break;
- str=bukuanarray.ElementAt (i).ElementAt (1);
- ftotal+=atof(str);
- strarray2.Add (GetW(str));
- strarray2.Add (GetK(str));
- strarray2.Add (GetB(str));
- strarray2.Add (GetS(str));
- strarray2.Add (GetG(str));
- strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
- }
- }
- while(strarray2.GetSize ()<42+36)
- strarray2.Add ("");
- str.Format ("%f", ftotal);
- strarray2.Add (GetW(str));
- strarray2.Add (GetK(str));
- strarray2.Add (GetB(str));
- strarray2.Add (GetS(str));
- strarray2.Add (GetG(str));
- strarray2.Add ("");
- //选片
- ftotal=0;
- realcount=0;
- if(seldlg.m_bChoose)
- {
- for(i=0; i<bukuanarray.GetSize (); i++)
- {
- if(atoi(bukuanarray.ElementAt (i).ElementAt (6))!=2)continue;
- realcount++;
- if(realcount>6)break;
- str=bukuanarray.ElementAt (i).ElementAt (1);
- ftotal+=atof(str);
- strarray2.Add (GetW(str));
- strarray2.Add (GetK(str));
- strarray2.Add (GetB(str));
- strarray2.Add (GetS(str));
- strarray2.Add (GetG(str));
- strarray2.Add (bukuanarray.ElementAt (i).ElementAt (4));
- }
- }
- while(strarray2.GetSize ()<42*2+36)
- strarray2.Add ("");
- str.Format ("%f", ftotal);
- strarray2.Add (GetW(str));
- strarray2.Add (GetK(str));
- strarray2.Add (GetB(str));
- strarray2.Add (GetS(str));
- strarray2.Add (GetG(str));
- strarray2.Add ("");
- /////////////////////////////
- CRect temprc;
- for(int n=0; n<4; n++)
- {
- StrRect=load.m_rcarray .ElementAt (17);
- StrRect.top +=n*122;
- StrRect.bottom +=n*122;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect=load.m_rcarray .ElementAt (18);
- if(n)
- {
- StrRect.left +=36;
- StrRect.right +=36;
- }
- StrRect.top +=n*122;
- StrRect.bottom +=n*122;
- if(seldlg.m_bFrame)
- str.Format("%d年", tm.GetYear ());
- else
- str.Format("%d ", tm.GetYear ());
- 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))
- {
- if(seldlg.m_bFrame)
- str=" 年";
- else
- str=" ";
- }
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (19);
- if(n)
- {
- StrRect.left +=38;
- StrRect.right +=38;
- }
- StrRect.top +=n*122;
- StrRect.bottom +=n*122;
- if(seldlg.m_bFrame)
- str.Format("%02d月", tm.GetMonth ());
- else
- str.Format("%02d ", tm.GetMonth ());
- 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))
- {
- if(seldlg.m_bFrame)
- str=" 月";
- else
- str=" ";
- }
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (20);
- if(n)
- {
- StrRect.left +=36;
- StrRect.right +=36;
- }
- StrRect.top +=n*122;
- StrRect.bottom +=n*122;
- if(seldlg.m_bFrame)
- str.Format("%02d日", tm.GetDay ());
- else
- str.Format("%02d ", tm.GetDay ());
- 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))
- {
- if(seldlg.m_bFrame)
- str=" 日";
- else
- str=" ";
- }
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- for(i=26; i<=32; i++)
- {
- StrRect=load.m_rcarray .ElementAt (i-1);
- StrRect.bottom -=14;
- for(int j=0; j<8; j++)
- {
- StrRect.top=StrRect.bottom;
- if(j>2)
- {
- StrRect.bottom =StrRect.top+14;
- }
- else
- {
- StrRect.bottom =StrRect.top+13;
- }
- temprc=StrRect;
- StrRect.top +=n*122;
- StrRect.bottom +=n*122;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- if(i==26 && j==4 && seldlg.m_bFrame)
- m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- else if(i==26 && j==5 && seldlg.m_bFrame)
- m_Print.DrawText((LPTSTR)(LPCTSTR)"付款", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- else if(i==26 && j==7 && seldlg.m_bFrame)
- m_Print.DrawText((LPTSTR)(LPCTSTR)"合计", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- else if(j==0)
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-26), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- else if(j && i>26 && n<3)
- {
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray2.ElementAt ((j-1)*6+(i-27)+n*42), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- StrRect=temprc;
- }
- }
- }
- if(seldlg.m_bFrame)
- {
- StrRect=load.m_rcarray .ElementAt (32);
- str="注\r\n意\r\n事\r\n项";
- StrRect.top +=367;
- StrRect.bottom +=367;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.top +=17;
- StrRect.left +=2;
- AutoDraw(m_Print, StrRect, str, 1.4);
- StrRect=load.m_rcarray .ElementAt (33);
- str="1: 本预约单自预定日期起一年内有效.定金在拍照套系金额中扣出.预定金一概不退\r\n\
- 2: 多拍照片只供筛选.恕不奉送.版权所有.不得私自拷贝\r\n\
- 3: 拍照款请于拍照时一次付清\r\n\
- 4: 新娘装AM8:00前钟点费另计.婚纱礼服出租押金500-2000元\r\n\
- 5: 本公司设有豪华VIP礼服区.及皇家御用礼服展区.但需另外加价.详情请咨本店人员\r\n\
- 6: 安瓶, 美甲一次性化妆用具等均属增值服务部分,则需另外加价,详情咨询本店工作人员\r\n\
- 7: 本电脑机械故障导致文件资料丢失.本公司只提供补拍服务\r\n\
- 8: 每次前来请务必携带本单交给工作人员.本单是您在摩登新娘拍照的凭证.办理有关手续凭本单办理盖\r\n\
- 章后方可生效";
- StrRect.top +=367;
- StrRect.bottom +=367;
- if(seldlg.m_bFrame)m_Print.DrawRect2(StrRect, 1);
- StrRect.top +=4;
- StrRect.left +=2;
- AutoDraw(m_Print, StrRect, str, 1.0);
- StrRect=load.m_rcarray .ElementAt (34);
- 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)";
- AutoDraw(m_Print, StrRect, str, 1.0);
- m_Print.SetFontFace(13, 1, "宋体");
- StrRect=load.m_rcarray .ElementAt (35);
- str="地 址: 汉口 . 解放大道 . 头道街东部购物公园C栋二,三层";
- StrRect.top +=367;
- StrRect.bottom +=367;
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect=load.m_rcarray .ElementAt (36);
- str="喜讯热线: 027-81888799 81888599 81888699";
- StrRect.top +=367;
- StrRect.bottom +=367;
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w , dlg.m_h );
- dlg.m_pDC =m_Print.GetPDC() ;
- if(dlg.DoModal ()!=IDOK)return;
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- #endif
- }
- extern CString GetHMoney(CString str);
- void CMainFrame::PrintReceipt3(CString strOrderNumber, CStringArray *pArray, float money)
- {
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 24;
- g_sendhead.tabcount = 1;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- if (0 == g_bSendOK)return;
- DataToArray(&g_cominfoarray);
- CString SerialNo;
- SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("15.lia");
- load.SetMargins(0, 0);
- if (!load.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.tabcount = 2;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- DataToArray(&g_List1array, &clientarray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
- CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
- CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
- CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
- CString m_addr = m_addr1 + ";";
- m_addr.TrimLeft(";");
- m_addr += m_addr2;
- CString m_qq = m_qq1 + ";";
- m_qq.TrimLeft(";");
- m_qq += m_qq2;
- m_money1.Format("%f", atof(m_taoxijiage));
- m_money2.Format("%f", atof(m_payed1));
- m_money3.Format("%f", atof(m_money1) - atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(17, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top -= 0;
- StrRect.bottom -= 10;
- StrRect.left -= 140;
- StrRect.right = StrRect.left + 48;
- m_Print.SetFontFace(15, 1, "宋体");
- m_Print.SetColor(0xffffff);
- m_Print.DrawRect(StrRect, 0);
- m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 48;
- m_Print.DrawRect(StrRect, RGB(255, 0, 0));
- m_Print.SetColor(0, RGB(255, 0, 0));
- m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetColor(0);
- m_Print.SetFontFace(12, 1, "宋体");
- StrRect.left -= 48;
- int hei = StrRect.Height();
- StrRect.top = StrRect.bottom + 2;
- StrRect.bottom += hei + 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top = StrRect.bottom - 2;
- StrRect.bottom += hei - 5;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(12, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"收款单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(9, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- ////////////
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- for (i = 19; i < 49; i++)
- {
- if (i >= 44)
- {
- StrRect = load.m_rcarray.ElementAt(i - 5);
- int hei = StrRect.Height();
- StrRect.top += hei;
- StrRect.bottom += hei;
- }
- else
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- float fmoney = 0;
- for (i = 19; i < 49; i++)
- {
- if (i >= 44)
- {
- StrRect = load.m_rcarray.ElementAt(i - 5);
- int hei = StrRect.Height();
- StrRect.top += hei;
- StrRect.bottom += hei;
- }
- else
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- /* if((i-19)%5==2)
- {
- fmoney+=atof(pArray->ElementAt (i-19));
- }*/
- m_Print.DrawText((LPTSTR)(LPCTSTR)(pArray->ElementAt(i - 19)), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- m_money2.Format("%f", money);
- ConvertToPrice(m_money2);
- StrRect = load.m_rcarray.ElementAt(44);
- CString str;
- str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 实收¥: %s 元 收银员: %s", \
- GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
- m_money2, g_user.name);
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(46);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(47);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(48);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(45);
- str = "\
- 顾客须知\r\n\
- 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
- 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
- 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
- 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
- 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
- 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
- 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
- 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
- AutoDraw(m_Print, StrRect, str, 1.8);
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintReceipt2(CString strOrderNumber)
- {
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 24;
- g_sendhead.tabcount = 1;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- if (0 == g_bSendOK)return;
- DataToArray(&g_cominfoarray);
- CString SerialNo;
- SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(126)) + 1);
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("14.lia");
- load.SetMargins(0, 0);
- if (!load.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.code[2] = 93;
- g_sendhead.tabcount = 3;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- CArray<CStringArray, CStringArray>moneyarray;
- DataToArray(&g_List1array, &clientarray, &moneyarray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_taoxiname = g_List1array.ElementAt(0).ElementAt(7);//+" 张数:"+g_List1array.ElementAt (0).ElementAt (9);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- CString m_qq1 = clientarray.ElementAt(0).ElementAt(5);
- CString m_qq2 = clientarray.ElementAt(0).ElementAt(6);
- CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_birthday1 = clientarray.ElementAt(0).ElementAt(11);
- CString m_birthday2 = clientarray.ElementAt(0).ElementAt(12);
- CString m_addr = m_addr1 + ";";
- m_addr.TrimLeft(";");
- m_addr += m_addr2;
- CString m_qq = m_qq1 + ";";
- m_qq.TrimLeft(";");
- m_qq += m_qq2;
- m_money1.Format("%f", atof(m_taoxijiage));
- m_money2 = "0";
- for (i = 0; i < moneyarray.GetSize(); i++)
- {
- if (moneyarray.ElementAt(i).ElementAt(5) == "预约收款")
- m_money2 = moneyarray.ElementAt(i).ElementAt(1);
- }
- m_money3.Format("%f", atof(m_money1) - atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(17, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top -= 0;
- StrRect.bottom -= 10;
- StrRect.left -= 140;
- StrRect.right = StrRect.left + 48;
- m_Print.SetFontFace(15, 1, "宋体");
- m_Print.SetColor(0xffffff);
- m_Print.DrawRect(StrRect, 0);
- m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 48;
- m_Print.DrawRect(StrRect, RGB(255, 0, 0));
- m_Print.SetColor(0, RGB(255, 0, 0));
- m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetColor(0);
- m_Print.SetFontFace(12, 1, "宋体");
- StrRect.left -= 48;
- int hei = StrRect.Height();
- StrRect.top = StrRect.bottom + 2;
- StrRect.bottom += hei + 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top = StrRect.bottom - 2;
- StrRect.bottom += hei - 5;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(12, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"定金单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(9, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + strOrderNumber), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"预约地点:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_outside, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- ////////////
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"生日:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)g_date, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客地址:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_addr, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"大婚时间:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_time3, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"QQ/MSN:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_qq, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- CStringArray strarray;
- strarray.Add("套系名称");
- strarray.Add("总 额");
- strarray.Add("定 金");
- strarray.Add("余 款");
- strarray.Add("摄影日期");
- strarray.Add(m_taoxiname);
- strarray.Add(m_money1);
- strarray.Add(m_money2);
- strarray.Add(m_money3);
- strarray.Add(m_time2);
- for (i = 25; i < 37; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- for (i = 25; i < 35; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 25), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- StrRect = load.m_rcarray.ElementAt(35);
- StrRect.left += 5;
- StrRect.top += 5;
- m_Print.DrawText((LPTSTR)(LPCTSTR)" 备 注:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(36);
- CString str;
- str.Format("金额(大写): %s 萬 %s 仟 %s 佰 %s 拾 %s 元整 ¥: %s 元 收银员: %s", \
- GetHMoney(GetW(m_money2)), GetHMoney(GetK(m_money2)), GetHMoney(GetB(m_money2)), GetHMoney(GetS(m_money2)), GetHMoney(GetG(m_money2)), \
- m_money2, g_user.name);
- StrRect.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(38);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"营业员:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(39);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_ren, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(40);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(41);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(42);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(37);
- str = "\
- 顾客须知\r\n\
- 首先感谢您选择挚爱婚纱摄影,进入本公司场所,请勿带摄影器材(面斥不雅)为了更好的服务更愉快的流程,请仔细阅读以下事项\r\n\
- 1. 核对清楚套系内容,有任何特殊要求请与工作人员沟通,以文字注明生效.\r\n\
- 2. 拍摄前请付清套系全款,另购买其它产品款项购买当天付清。\r\n\
- 3. 拍摄完毕后15天内公司专人电话通知选相片,为了更好更专业的选出您要制作的产品,请不要带陪同(意见不一不便照顾)。\r\n\
- 4. 选样文件因空间有限保留时间为60天删除(拍摄日起)成品以取件日后保管30天,30天后未来取件需收第天5天保管费,\
- 为了对您负责请本人持单据取件,委托他人取件需带单据和委托人身份证。\r\n\
- 5. 认真对待合同意义确认套系内容与制作内容一致,超出内容的自愿消费项目签名确认消费,恕不退还。\r\n\
- 6. 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
- AutoDraw(m_Print, StrRect, str, 1.8);
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::OnAutodelphoto()
- {
- // TODO: Add your command handler code here
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(49) == 0)return;
- DelPhotoSet dlg;
- dlg.DoModal();
- }
- void CMainFrame::Onphotomanage() // 客照管理中心;
- {
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(49) == 0)return;
- ShowPic3 dlg;
- dlg.DoModal();
- }
- void CMainFrame::OnCompanyinfo()
- {
- // TODO: Add your command handler code here
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(49) == 0)return;
- CompanyInfo dlg;
- dlg.DoModal();
- }
- void CMainFrame::OnTaoxifg()
- {
- // TODO: Add your command handler code here
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(49) == 0)return;
- TXFG dlg;
- dlg.DoModal();
- }
- void CMainFrame::OnHelpfile()
- {
- // TODO: Add your command handler code here
- // ShellExecute(NULL, _T("open"), _T(g_mainpath+"\\帮助文档.chm"), "", NULL, SW_SHOWNORMAL);
- // if(::PathFileExists (g_mainpath+"\\zx.dll"))
- // ShellExecute(NULL, _T("open"), _T("www.zcsmkj.com"), "", NULL, SW_SHOWNORMAL);
- // else
- ShellExecute(NULL, _T("open"), _T("www.lyfz.net"), "", NULL, SW_SHOWNORMAL);
- }
- void CMainFrame::OnPhotobak()
- {
- // TODO: Add your command handler code here
- if (g_user.bLongin == 0)
- {
- if (g_bNoLoginLia)
- {
- Login dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- else
- {
- Login3 dlg;
- dlg.SetLiaPath("5.lia");
- dlg.DoModal();
- }
- if (g_user.bLongin == 0)return;
- }
- if (IsHasRightsnew(49) == 0)return;
- PhotoBak dlg;
- dlg.DoModal();
- }
- //客户报表
- void CMainFrame::OnClose2()
- { // TODO: Add your message handler code here and/or call default
- if (AfxMessageBox("是否退出系统?", MB_YESNO | MB_ICONINFORMATION) != IDYES)return;
- if(g_user.bLongin)
- WriteLog("退出系统!", "退出系统!");
- g_bShowBar = 0;
- if (m_Mdi.MainClose())
- CMDIFrameWnd::OnClose();
- }
- //
- void CMainFrame::ResetTimer()
- {
- }
- void CMainFrame::LinkClick(CString str, int nParent)
- {
- g_pMainWnd2->m_bar.LinkClick(str);
- }
- void CMainFrame::PrintFlowChart2(CString m_id)
- {
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(64);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("16.lia");
- load.SetMargins(0, 0);
- if (!load.Load())return;
- LoadRect load2;
- load2.SetLiaPath("17.lia");
- load2.SetMargins(0, 660);
- if (!load2.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and kind<>'2'";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.code[2] = 223;
- g_sendhead.tabcount = 3;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- DataToArray(&g_List1array, &clientarray, &sparray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_photocount = g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = "客人要求: " + g_List1array.ElementAt(0).ElementAt(39) + g_List1array.ElementAt(0).ElementAt(75);
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- CString spno;
- for (i = 0; i < sparray.GetSize(); i++)
- {
- // if(sparray.ElementAt (i).ElementAt (6).IsEmpty ())continue;
- if (sparray.ElementAt(i).ElementAt(4) == "4" && sparray.ElementAt(i).ElementAt(5) != "入册" && sparray.ElementAt(i).ElementAt(5) != "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册"&&sparray.ElementAt(i).ElementAt(5) == "入底"&&sparray.ElementAt(i).ElementAt(6).IsEmpty())continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- spno += sparray.ElementAt(i).ElementAt(5);
- if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
- spno += "; ";
- else
- {
- spno += ":";
- spno += sparray.ElementAt(i).ElementAt(6);
- spno += "; ";
- }
- }
- spno += " 加挑:";
- for (i = 0; i < sparray.GetSize(); i++)
- {
- if (sparray.ElementAt(i).ElementAt(4) != "4")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入册")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "入底")continue;
- if (sparray.ElementAt(i).ElementAt(5) == "底片光盘")continue;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(136)) && sparray.ElementAt(i).ElementAt(6) == "")continue;
- spno += sparray.ElementAt(i).ElementAt(5);
- if (sparray.ElementAt(i).ElementAt(6).IsEmpty())
- spno += "; ";
- else
- {
- spno += ":";
- spno += sparray.ElementAt(i).ElementAt(6);
- spno += "; ";
- }
- }
- if (spno.Right(6) == " 加挑:")
- {
- spno = spno.Left(spno.GetLength() - 6);
- }
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(17, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top -= 0;
- StrRect.bottom -= 10;
- StrRect.left -= 140;
- StrRect.right = StrRect.left + 48;
- m_Print.SetFontFace(15, 1, "宋体");
- m_Print.SetColor(0xffffff);
- m_Print.DrawRect(StrRect, 0);
- m_Print.DrawText((LPTSTR)(LPCTSTR)" Honey", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 48;
- m_Print.DrawRect(StrRect, RGB(255, 0, 0));
- m_Print.SetColor(0, RGB(255, 0, 0));
- m_Print.DrawText((LPTSTR)(LPCTSTR)" 挚 爱 ", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetColor(0);
- m_Print.SetFontFace(12, 1, "宋体");
- StrRect.left -= 48;
- int hei = StrRect.Height();
- StrRect.top = StrRect.bottom + 2;
- StrRect.bottom += hei + 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"挚爱婚纱精品摄影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.top = StrRect.bottom - 2;
- StrRect.bottom += hei - 5;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"www.gzhoney.com", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(12, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"加做取件单", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(11, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)("客户编号:" + m_id), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"先生姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_name1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"选片日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_time4, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"取件日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_time5, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- ////////////
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"女士姓名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_name2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"电话:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_phone2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"赠送张数:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_photocount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"开单日期:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_time1, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- ////////////
- ///////////spno
- CRect sprc[22];
- StrRect = load.m_rcarray.ElementAt(19);
- StrRect.left += 4; StrRect.right -= 3;
- hei = StrRect.Height();
- for (i = 0; i < 22; i++)
- {
- sprc[i] = StrRect;
- m_Print.DrawRect2(StrRect, 1);
- if (i == 0)
- {
- StrRect.left += 5;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"全部套系内容:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect.left -= 5;
- }
- StrRect.top = StrRect.bottom;
- StrRect.bottom = StrRect.top + hei;
- sprc[i].left += 4; sprc[i].right -= 3;
- }
- StrRect.bottom = StrRect.top + 60;
- m_Print.DrawRect2(StrRect, 1);
- StrRect.left += 3; StrRect.top += 3;
- StrRect.right -= 3; StrRect.bottom -= 3;
- AutoDraw(m_Print, StrRect, m_bz, 1.8);
- CString temp, tempspno, tempbz;
- CSize size;
- BOOL bRun = 0;
- int fontsize = 12;
- ll: tempspno = spno;
- m_Print.SetFontFace(fontsize, 1, "宋体");
- for (i = 1; i<22; i++)
- {
- if (!tempspno.IsEmpty())
- {
- temp = tempspno;
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- int right = 0;
- CRect temprc = sprc[i];
- while (size.cx>temprc.Width())
- {
- right++;
- temp = tempspno.Left(tempspno.GetLength() - (right));
- if (GIsHalfHZ(temp))
- {
- right++;
- temp.Delete(temp.GetLength() - 1);
- }
- m_Print.GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- }
- if (bRun)
- m_Print.DrawText((LPTSTR)(LPCTSTR)temp, sprc[i], 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- tempspno = tempspno.Right(tempspno.GetLength() - temp.GetLength());
- if (tempspno.IsEmpty())i++;
- }
- }
- if (tempspno.IsEmpty() == 0)//|| tempbz.IsEmpty ()==0)
- {
- fontsize--;
- goto ll;
- }
- if (bRun == 0)
- {
- bRun = 1;
- goto ll;
- }
- m_Print.SetFontFace(12, 1, "宋体");
- StrRect = load2.m_rcarray.ElementAt(1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"喜事热线: 020-8666 8233 020-8667 8166", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(2);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"地址: 广州市越秀区流花路120号东方宾馆一号楼首层 www.gzhoney.com", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(3);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"顾客确认签名:", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(4);
- m_Print.DrawRect2(StrRect, 2);
- StrRect = load2.m_rcarray.ElementAt(0);
- CString str = "\
- 爱心提示:如对制作有任何要求请清楚列出,所有制作内容一经确认将按要求制作。\r\n\
- 选样文件从拍摄日期计算将保留二个月;套相成品按取件日期保留三个月,逾期不做保留。\r\n\
- 产品取件日期为45天(选相片那天算起)如要提前属急件,提前30天内需收10%的加急费。";
- AutoDraw(m_Print, StrRect, str, 1.8);
- PrintPreview dlg; dlg.m_mode = 2;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (dlg.DoModal() != IDOK)return;
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- //分店
- CString CMainFrame::GetDanWei(CString name, CArray<CStringArray, CStringArray>*array)
- {
- for (int i = 0; i < array->GetSize(); i++)
- {
- if (name == array->ElementAt(i).ElementAt(1))
- return array->ElementAt(i).ElementAt(2);
- }
- return "";
- }
- //g_sendhead
- int CMainFrame::GetPort()
- {
- static int aaa = -1;
- if (aaa == -1)
- {
- aaa = CTime::GetCurrentTime().GetSecond() % 7;
- }
- aaa++;
- if (aaa >= 7)aaa = 0;
- return 8387 + aaa;
- }
- void CMainFrame::OnShowBakState()
- {
- // TODO: Add your command handler code here
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 171;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- if (g_bSendOK == 0)
- {
- return;
- }
- CArray<CStringArray, CStringArray>g_bakstatearray;
- DataToArray(&g_bakstatearray);
- while (g_bakstatearray.GetSize() > 7)
- {
- g_bakstatearray.RemoveAt(0);
- }
- int photocount = 0;
- int infocount = 0;
- for (int i = 0; i < g_bakstatearray.GetSize(); i++)
- {
- if (g_bakstatearray.ElementAt(i).ElementAt(1) != "1")photocount++;
- if (g_bakstatearray.ElementAt(i).ElementAt(2) != "1")infocount++;
- }
- ShowBakState dlg;
- dlg.m_pArray = &g_bakstatearray;
- dlg.DoModal();
- }
- void CMainFrame::PrintReceipt2(CStringArray *pArray)
- {
- int i = 0;
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 24;
- g_sendhead.tabcount = 1;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- if (0 == g_bSendOK)return;
- DataToArray(&g_cominfoarray);
- CString SerialNo;
- SerialNo.Format("SerialNo.%05d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- BOOL bSmall = 0;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(87)))//小单
- {
- bSmall = 1;
- load.SetLiaPath("20.lia");
- }
- else
- load.SetLiaPath("10.lia");
- if (bSmall)
- load.SetMargins(-10, 0);
- else
- load.SetMargins(10, 0);
- if (!load.Load())return;
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- Image *pImg = NULL;
- #ifdef MNLS_VERSION
- LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
- #else
- ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
- #endif
- // m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(139)))
- {
- Image *pImg = NULL;
- g_nSendCode = 31;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos = g_nYearposTemp;
- g_nSendCode = 0;
- if (g_bSendOK == 0)return;
- ::LoadImageFromBuf(&pImg, g_pData, g_nLeng);
- if (pImg)
- {
- StrRect.left = 65;
- if (bSmall)StrRect.left = 55;
- StrRect.top = 10;
- StrRect.right = StrRect.left + 58;
- StrRect.bottom = StrRect.top + 58;
- m_Print.DrawImage(pImg, StrRect);
- delete pImg; pImg = NULL;
- }
- }
- if (bSmall)
- {
- m_Print.SetFontFace(18, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(6, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- int hei = StrRect.Height();
- StrRect.bottom = StrRect.top;
- StrRect.top -= 8;
- m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
- m_Print.SetFontFace(10, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- for ( i = 7; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- for (i = 9; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- m_Print.SetFontFace(6, 1, "宋体");
- for (i = 24; i < 26; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- if (i == 24)
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- else
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- }
- }
- else//大单
- {
- m_Print.SetFontFace(20, 1, "黑体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- // StrRect=load.m_rcarray .ElementAt (++rcpos);
- // m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt (rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos); StrRect.right -= 15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- int hei = StrRect.Height();
- StrRect.bottom = StrRect.top;
- StrRect.top -= 10;
- m_Print.DrawText((LPTSTR)(LPCTSTR)SerialNo, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_BOTTOM);
- m_Print.SetFontFace(8, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- m_Print.SetFontFace(13, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(rcpos), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.SetFontFace(11, 1, "宋体");
- for ( i = 7; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- for (i = 9; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- m_Print.SetFontFace(8, 1, "宋体");
- for (i = 24; i < 27; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- StrRect.left += 2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)pArray->ElementAt(i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- }
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- SerialNo.Format("%d", atoi(g_cominfoarray.ElementAt(0).ElementAt(127)) + 1);
- CString sql;
- sql.Format("update version set [serialno2]='%s'", SerialNo);
- g_sendhead.bsql = 1;
- g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(sql);
- g_nYearpos = g_nYearposTemp;
- }
- }
- //出生年月
- //第一联
- void CMainFrame::OnLog()
- {
- // TODO: Add your command handler code here OnShowBakState
- if (IsHasRightsnew(49) == 0)return;
- ShowLOg dlg;
- dlg.DoModal();
- }
- // www.lyfz.net 8888
- void CMainFrame::PrintDinDan6(CString m_id)
- {
- // TODO: Add your control notification handler code here 预约订单
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(63);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(66)) == 3)
- {
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("6.lia");
- load.SetMargins(-14, 15);
- if (!load.Load())return;
- LoadRect load2;
- load2.SetLiaPath("7.lia");
- load2.SetMargins(-14, 216 + 15);
- if (!load2.Load())return;
- LoadRect load3;
- load3.SetLiaPath("8.lia");
- load3.SetMargins(-14, 705 + 15);
- if (!load3.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter = "id='" + m_id + "';id='" + m_id + "';id='" + m_id + "' and name<>'入册' and name<>'入底';id='" + m_id + "';;";
- g_sendhead.code[0] = 11;
- g_sendhead.code[1] = 52;
- g_sendhead.code[2] = 50;
- g_sendhead.code[3] = 150;
- g_sendhead.code[4] = 77;
- g_sendhead.code[5] = 4;
- g_sendhead.tabcount = 6;
- g_sendhead.bsql = 0;
- g_pMainWnd->ProcessChatMessageRequest2(filter); if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>sparray;
- CArray<CStringArray, CStringArray>clientarray;
- CArray<CStringArray, CStringArray>phonearray;
- CArray<CStringArray, CStringArray>fgarray;
- CArray<CStringArray, CStringArray>danweiarray;
- CArray<CStringArray, CStringArray>jdarray;
- DataToArray(&g_List1array, &clientarray, &sparray, &jdarray, &fgarray, &danweiarray);
- CString m_money1 = g_List1array.ElementAt(0).ElementAt(1);
- CString m_money2 = g_List1array.ElementAt(0).ElementAt(2);
- CString m_money3 = g_List1array.ElementAt(0).ElementAt(3);
- CString m_name1 = g_List1array.ElementAt(0).ElementAt(4);
- CString m_name2 = g_List1array.ElementAt(0).ElementAt(5);
- CString m_zs = g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxiname;
- if (m_zs.Find("\\") != -1)
- m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底\\入册:" + g_List1array.ElementAt(0).ElementAt(9);
- else
- m_taoxiname = g_List1array.ElementAt(0).ElementAt(7) + " 入底:" + g_List1array.ElementAt(0).ElementAt(9);
- CString m_taoxijiage = g_List1array.ElementAt(0).ElementAt(8);
- CString m_time1 = g_List1array.ElementAt(0).ElementAt(10);
- CString m_time2 = g_List1array.ElementAt(0).ElementAt(11);
- CString m_time3 = g_List1array.ElementAt(0).ElementAt(12);
- CString m_ren = g_List1array.ElementAt(0).ElementAt(14);
- CString m_discount = g_List1array.ElementAt(0).ElementAt(15);
- CString m_payed1 = g_List1array.ElementAt(0).ElementAt(16);
- CString m_payed2 = g_List1array.ElementAt(0).ElementAt(17);
- CString m_payed3 = g_List1array.ElementAt(0).ElementAt(18);
- CString m_payed4 = g_List1array.ElementAt(0).ElementAt(19);
- CString m_payed5 = g_List1array.ElementAt(0).ElementAt(20);
- CString m_time4 = g_List1array.ElementAt(0).ElementAt(21);
- CString m_time5 = g_List1array.ElementAt(0).ElementAt(22);
- CString m_clothescount = g_List1array.ElementAt(0).ElementAt(26);
- CString m_clothescount2 = g_List1array.ElementAt(0).ElementAt(27);
- CString m_outside = g_List1array.ElementAt(0).ElementAt(28);
- CString m_outside2 = g_List1array.ElementAt(0).ElementAt(29);
- CString m_style = g_List1array.ElementAt(0).ElementAt(30);
- CString m_waiter1 = g_List1array.ElementAt(0).ElementAt(34);
- CString m_waiter2 = g_List1array.ElementAt(0).ElementAt(35);
- CString m_waiter4 = g_List1array.ElementAt(0).ElementAt(37);
- CString m_bz = g_List1array.ElementAt(0).ElementAt(38);
- if (jdarray.GetSize())
- {
- if (m_bz.IsEmpty() == 0)
- m_bz = "\r\n" + m_bz;
- m_bz += "景点:";
- }
- for (i = 0; i < jdarray.GetSize(); i++)
- {
- m_bz += jdarray.ElementAt(i).ElementAt(1) + ";";
- }
- m_bz.TrimRight(";");
- CString m_phone1 = clientarray.ElementAt(0).ElementAt(3);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- if (IsHasRights2new(31) == 0)
- {
- m_phone1 = "***";
- m_phone2 = "***";
- }
- CString m_addr1 = clientarray.ElementAt(0).ElementAt(7);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_occupation1 = clientarray.ElementAt(0).ElementAt(9);
- CString m_occupation2 = clientarray.ElementAt(0).ElementAt(10);
- CString m_sex = clientarray.ElementAt(0).ElementAt(18);
- CString m_birthday = clientarray.ElementAt(0).ElementAt(11);
- filter = "name='" + m_ren + "'";
- g_sendhead.code[0] = 5;
- g_sendhead.tabcount = 1;
- g_sendhead.bsql = 0;
- int g_nYearposTemp = g_nYearpos;
- g_nYearpos = -1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- g_nYearpos = g_nYearposTemp;
- if (g_bSendOK == 0)return;
- DataToArray(&phonearray);
- m_money1.Format("%f", atof(m_taoxijiage));
- m_money2.Format("%f", atof(m_payed1));
- m_money3.Format("%f", atof(m_money1) - atof(m_money2));
- ConvertToPrice(m_money1);
- ConvertToPrice(m_money2);
- ConvertToPrice(m_money3);
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- StrRect.top -= 15; StrRect.bottom -= 15;
- Image *pImg = NULL;
- #ifdef MNLS_VERSION
- LoadImageFromRes(&pImg, MAKEINTRESOURCE(IDR_JPG1), _T("JPG"));
- #else
- ::LoadImageFromBuf(&pImg, g_mainpath + "\\图片\\logo.jpg");
- #endif
- m_Print.DrawImage(pImg, StrRect);
- delete pImg;
- m_Print.SetFontFace(11, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(20);
- StrRect.right = load.m_rcarray.ElementAt(23).right;
- StrRect.top -= 18; StrRect.bottom -= 18;
- CString str = "地址:" + g_cominfoarray.ElementAt(0).ElementAt(12);
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- str = "电话:" + g_cominfoarray.ElementAt(0).ElementAt(11);
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- StrRect.top -= 15; StrRect.bottom -= 15;
- #ifdef MNLS_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"婚 纱 摄 影", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- StrRect.top -= 15; StrRect.bottom -= 15;
- #ifdef MNLS_VERSION
- m_Print.DrawRect(StrRect);
- #endif
- m_Print.SetFontFace(7, 1, "黑体");
- m_Print.SetColor(0xffffff);
- #ifdef MNLS_VERSION
- m_Print.DrawText((LPTSTR)(LPCTSTR)"佳 美 女 人 坊 艺 术 摄 影 机 构", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- m_Print.SetColor(0);
- m_Print.SetFontFace(15, 1, "宋体");
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- StrRect.top -= 15; StrRect.bottom -= 15;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"(套系合同拍摄单)", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- CStringArray strarray;
- strarray.Add("NO: " + m_id);
- CString date;
- date.Format("%s年%s月%s日", g_date.Mid(0, 4), g_date.Mid(5, 2), g_date.Mid(8, 2));
- strarray.Add(date);
- strarray.Add("喜爱");
- strarray.Add("格调");
- if (fgarray.GetSize() == 12)
- {
- for (int i = 0; i < 12; i++)
- strarray.Add(fgarray.ElementAt(i).ElementAt(0));
- }
- else
- {
- strarray.Add("复古典雅");
- strarray.Add("温文尔雅");
- strarray.Add("豪华艳丽");
- strarray.Add("传统大方");
- strarray.Add("新潮个性");
- strarray.Add("浪漫奔放");
- strarray.Add("简单素雅");
- strarray.Add("活泼俏丽");
- strarray.Add("妩媚温馨");
- strarray.Add("温柔贤惠");
- strarray.Add("成熟感性");
- strarray.Add("清纯可爱");
- }
- strarray.Add("姓名");
- // strarray.Add("职业");
- strarray.Add("");
- strarray.Add("地址");
- strarray.Add("电话");
- #ifdef CHILD_VERSION
- strarray.Add("家长");
- strarray.Add("宝宝");
- #else
- strarray.Add("先生");
- strarray.Add("女士");
- #endif
- m_Print.SetFontFace(11, 1, "宋体");
- for (i = 0; i < strarray.GetSize(); i++)
- {
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- if (i < 2)
- {
- StrRect.top -= 15; StrRect.bottom -= 15;
- }
- if (i>15)
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for (i = 29; i <= 40; i++)
- {
- if (m_style.GetLength() <= (i - 29))continue;
- if (m_style.GetAt(i - 29) != '1')continue;
- StrRect = load.m_rcarray.ElementAt(i - 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"√", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for (i = 27; i <= 48; i++)
- {
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawRect2(StrRect, 1);
- }
- #ifdef CHILD_VERSION
- StrRect = load.m_rcarray.ElementAt(45);
- StrRect.right = StrRect.left + 62;
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"性别", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 62;
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_sex, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 62;
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)"出生日期", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect.left = StrRect.right;
- StrRect.right = StrRect.left + 62;
- m_Print.DrawRect2(StrRect, 1);
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_birthday, StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- #endif
- /////////////////////////
- strarray.RemoveAll();
- CString temp;
- temp.Format("拍摄 选 %d 款,其中", atoi(m_outside) + atoi(m_outside2));
- strarray.Add(temp);
- temp.Format("内景 %d 款,外景 %d 款.", atoi(m_outside2), atoi(m_outside));
- strarray.Add(temp);
- strarray.Add("化妆");
- strarray.Add("造型");
- #ifdef CHILD_VERSION
- strarray.Add("");
- #else
- strarray.Add("婚纱");
- #endif
- strarray.Add("服饰");
- strarray.Add("配");
- strarray.Add("置");
- strarray.Add("其");
- strarray.Add("它");
- strarray.Add("套系名称");
- strarray.Add("镜款");
- strarray.Add("套系总价");
- strarray.Add("主摄影师");
- strarray.Add("拍摄日期");
- strarray.Add("定金");
- #ifdef CHILD_VERSION
- strarray.Add("主引导师");
- #else
- strarray.Add("主化妆师");
- #endif
- strarray.Add("看样日期");
- strarray.Add("补 余 款");
- strarray.Add("总监");
- strarray.Add("取件日期");
- rcpos = -1;
- for (i = 0; i < strarray.GetSize(); i++)
- {
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- if (i>9)
- m_Print.DrawRect2(StrRect, 1);
- #ifdef CHILD_VERSION
- if (i == 5)
- StrRect.top -= StrRect.Height();
- #endif
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- for (i = 22; i <= 41; i++)
- {
- StrRect = load2.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawRect2(StrRect, 1);
- }
- /////////////////////////////
- strarray.RemoveAll();
- #ifdef CHILD_VERSION
- strarray.Add("顾客方 家长:");
- strarray.Add("宝宝:");
- #else
- strarray.Add("顾客方 先生:");
- strarray.Add("女士:");
- #endif
- strarray.Add("电话:");
- strarray.Add("影楼方 店长:");
- strarray.Add("接单人:");
- strarray.Add("电话:");
- rcpos = -1;
- for (i = 0; i < strarray.GetSize(); i++)
- {
- StrRect = load3.m_rcarray.ElementAt(++rcpos);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- }
- for (i = 7; i <= 12; i++)
- {
- StrRect = load3.m_rcarray.ElementAt(++rcpos);
- // if(i!=10)
- m_Print.DrawRect2(StrRect, 2);
- }
- //////////////////////////////////////
- //开始打数据
- strarray.RemoveAll();
- strarray.Add(m_name1);
- strarray.Add(m_name2);
- strarray.Add("");
- strarray.Add("");
- strarray.Add(m_addr1);
- #ifdef CHILD_VERSION
- strarray.Add("");
- #else
- strarray.Add(m_addr2);
- #endif
- strarray.Add(m_phone1);
- strarray.Add(m_phone2);
- for (i = 41; i <= 48; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i - 1);
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- ///////////////////////////////
- strarray.RemoveAll();
- strarray.Add(m_money1);
- strarray.Add(m_waiter1);
- strarray.Add(m_time2);
- strarray.Add(m_money2);
- strarray.Add(m_waiter2);
- strarray.Add(m_time4);
- strarray.Add(m_money3);
- strarray.Add("");
- strarray.Add(m_time5);
- for (i = 32; i <= 40; i++)
- {
- StrRect = load2.m_rcarray.ElementAt(i - 1);
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 32), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- ///////////////////////////////
- strarray.RemoveAll();
- strarray.Add("");//m_name1);
- strarray.Add("");//m_name2);
- CString phone;
- if (m_phone1.IsEmpty() == 0)
- phone = m_phone1 + ",";
- phone += m_phone2;
- phone.TrimRight(",");
- strarray.Add("");//phone);
- strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(14));
- strarray.Add(m_ren);
- strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
- for (i = 7; i <= 12; i++)
- {
- StrRect = load3.m_rcarray.ElementAt(i - 1);
- StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 7), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- StrRect = load2.m_rcarray.ElementAt(26); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_taoxiname, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(27); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount2, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- StrRect = load2.m_rcarray.ElementAt(28); StrRect.left += 4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)m_clothescount, StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- //////////////////////////////
- //开始画文字
- StrRect = load2.m_rcarray.ElementAt(30);
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- AutoDraw(m_Print, StrRect, m_bz, 1.4);
- StrRect = load2.m_rcarray.ElementAt(29);
- StrRect.left += 3;
- StrRect.top += 3;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = "";
- for (i = 0; i < sparray.GetSize(); i++)
- {
- str += sparray.ElementAt(i).ElementAt(5);
- str += " 数量:";
- str += sparray.ElementAt(i).ElementAt(3);
- str += GetDanWei(sparray.ElementAt(i).ElementAt(5), &danweiarray);
- str += "\r\n";
- }
- str.TrimRight("\r\n");
- AutoDraw(m_Print, StrRect, str, 1.4);
- StrRect = load2.m_rcarray.ElementAt(40);
- StrRect.top += 8;
- m_Print.SetFontFace(12, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)"温馨提示", StrRect, 0, 0, FORMAT_HCENTER | FORMAT_UP);
- StrRect.left += 3;
- StrRect.top += 30;
- StrRect.right -= 2;
- StrRect.bottom -= 2;
- str = g_cominfoarray.ElementAt(0).ElementAt(37);
- if (str.IsEmpty())
- {
- str = "\
- 1. 感谢您俩对我影楼的信任与青睐, 为了给您俩设\
- 计好整体形象, 保证您俩拍摄效果的完善, 请配合我们\
- 严谨的工作态度, 仔细阅读顾客须知.\r\n\
- 2. 接近拍照日期请勿多晒太阳, 不要劳累, 尽量保\
- 持良好的心境.\r\n\
- 3. 拍照前一晚请少喝水, 睡眠一定要充足, 洗干净\
- 头发, 勿使用任何发胶, 发膏. 先生请刮胡子.\r\n\
- 4. 拍照当天请勿化妆, 女士应穿前开口上衣, 勿穿\
- 套头上衣, 以免换婚纱时影响化好的妆与做好的发型.\r\n\
- 5. 拍照时请勿带贵重物品, 以免丢失, 随行人员请\
- 勿进影室, 以免影响拍摄.\r\n\
- 6. 拍照时如有特殊要求或有异议时, 请当面与摄影\
- 师或店长沟通.\r\n\
- 7. 为了您俩有更大的选择款式, 本影楼所拍片该套\
- 系所定数量多出一倍左右, 多片您俩若也要, 每款__\
- 元. 其余照片和存底本影楼只保存__个月.\r\n\
- 8. 配置内容应由所预约套系款数里挑选.\r\n\
- 9. 本合同余额欠款须在拍照前付清.\r\n\
- 10. 本合同预约单加盖本影楼公章方有效, 顾客方\
- 签名后视为有效合同. 预约__个月内有效, 预约金不退\
- 还.";
- }
- AutoDraw(m_Print, StrRect, str, 1.8);
- }
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- dlg.m_mode = 1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::InsideMsg()
- {
- ///内部消息
- CString str;
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 126;
- g_sendhead.tabcount = 1;
- g_bNoConnDlg = 1;
- g_pMainWnd->ProcessChatMessageRequest2(1); g_bNoConnDlg = 0;
- if (g_bSendOK == 0)return;
- CArray<CStringArray, CStringArray>m_List1array;
- DataToArray(&g_List1array);//, &m_List1array);
- int i = 0;
- m_List1array.SetSize(g_List1array.GetSize());
- for ( i = 0; i < g_List1array.GetSize(); i++)
- {
- m_List1array.ElementAt(i).Copy(g_List1array.ElementAt(i));
- }
- str = "," + g_user.name + ",";
- for (i = g_List1array.GetSize() - 1; i >= 0; i--)
- {
- CString receivers2 = g_List1array.ElementAt(i).ElementAt(4);
- receivers2.TrimLeft(",");
- receivers2.TrimRight(",");
- receivers2 = "," + receivers2 + ",";
- CString receivers = g_List1array.ElementAt(i).ElementAt(3);
- receivers.TrimLeft(",");
- receivers.TrimRight(",");
- receivers = "," + receivers + ",";
- if (receivers.Find(str) == -1)
- g_List1array.RemoveAt(i);
- else if (receivers2.Find(str) != -1)
- g_List1array.RemoveAt(i);
- }
- if (g_List1array.GetSize())
- {
- ShowMsg dlg;
- dlg.DoModal();
- }
- for (i = m_List1array.GetSize() - 1; i >= 0; i--)
- {
- CString receivers2 = m_List1array.ElementAt(i).ElementAt(4);
- receivers2.TrimLeft(",");
- receivers2.TrimRight(",");
- receivers2 = "," + receivers2 + ",";
- CString receivers = m_List1array.ElementAt(i).ElementAt(3);
- if (receivers != "")
- m_List1array.RemoveAt(i);
- else if (receivers2.Find(str) != -1)
- m_List1array.RemoveAt(i);
- }
- if (m_List1array.GetSize())
- {
- SendInsideMsg2 dlg;
- dlg.m_bShow = 1;
- dlg.m_pArray = &m_List1array;
- dlg.DoModal();
- }
- }
- //定金
- /************************************************************************/
- /*
- 函数:PrintHireDress
- 描述:打印礼服出租单;
- 参数:
- strOrderNumber 礼服订单号;
- 注意:
- */
- /************************************************************************/
- void CMainFrame::PrintHireDress(CString strOrderNumber) // 打印礼服出租单;
- {
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!"); m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("21.lia");
- load.SetMargins(0, 0);
- if (!load.Load())
- {
- return;
- }
- int i;
- //////////////////////////////////////////////////////////////
- //CString filter="id='"+strOrderNumber+"';id='"+strOrderNumber+"';id='"+strOrderNumber+"'";
- CString strFilter;
- strFilter.Format("id='%s';id='%s';id='%s'", strOrderNumber, strOrderNumber, strOrderNumber);
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 73;
- g_sendhead.code[1] = 74;
- g_sendhead.code[2] = 52;
- g_sendhead.tabcount = 3;
- g_pMainWnd->ProcessChatMessageRequest2(strFilter);
- if (g_bSendOK == 0)
- {
- return;
- }
- CArray<CStringArray, CStringArray>dresshirearray;
- CArray<CStringArray, CStringArray>dresshiredataarray;
- CArray<CStringArray, CStringArray>clientarray;
- DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
- if (dresshirearray.GetSize() == 0)
- {
- return;
- }
- CString m_remark = dresshirearray.ElementAt(0).ElementAt(10);
- CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7);
- CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8);
- CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6);
- if (clientarray.GetSize() == 0)
- {
- return;
- }
- //AfxMessageBox("打印礼服出租单-()");
- CString m_name2 = clientarray.ElementAt(0).ElementAt(2);
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4);
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8);
- CString m_time3 = clientarray.ElementAt(0).ElementAt(20);
- //#if JEFF_TEST
- // if ( dresshiredataarray.GetSize() == 0 )
- // {
- // AfxMessageBox("没衣服");
- // }
- //#endif
- CString sItem;
- for (i = 0; i < dresshiredataarray.GetSize(); i++)
- {
- sItem += "编号:";
- sItem += dresshiredataarray.ElementAt(i).ElementAt(1);
- sItem += " ";
- sItem += " 名称:";
- sItem += dresshiredataarray.ElementAt(i).ElementAt(2);
- sItem += " 数量:";
- sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n";
- }
- sItem += "金额:";
- sItem += dresshirearray.ElementAt(0).ElementAt(1);
- sItem += " ";
- sItem += " 押金:";
- sItem += dresshirearray.ElementAt(0).ElementAt(2) + "\r\n";
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(17, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(10, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- CStringArray strarray;
- strarray.Add("客户姓名");
- strarray.Add("客户电话");
- strarray.Add("预定日期");
- strarray.Add("结婚日期");
- strarray.Add("取件日期");
- strarray.Add("归还日期");
- strarray.Add("本店地址");
- strarray.Add("电 话");
- strarray.Add("客户地址");
- strarray.Add("客户签名");
- for (i = 2; i < 12; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- strarray.RemoveAll();
- strarray.Add(m_name2);
- strarray.Add(m_phone2);
- strarray.Add(m_inputdate);
- strarray.Add(m_time3);
- strarray.Add(m_date1);
- strarray.Add(m_date2);
- strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
- strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
- strarray.Add(m_addr2);
- strarray.Add("");
- for (i = 12; i < 22; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- }
- for (i = 25; i < 30; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- StrRect = load.m_rcarray.ElementAt(22);
- StrRect.top += 7;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += 7;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += 7;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
- AutoDraw(m_Print, StrRect, sItem, 1.5);
- StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
- AutoDraw(m_Print, StrRect, m_remark, 1.5);
- StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
- CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
- if (str.IsEmpty())
- {
- str = "\
- 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
- 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
- 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
- 4. 如有破损酌情赔偿.";
- }
- AutoDraw(m_Print, StrRect, str, 1.5);
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintHireDress_01(CString strOrderNumber) // 打印礼服出租单,无法改变结构,需要修改21.lia才能改变打印的布局;
- {
- int printcot = 1;
- for (int aa = 0; aa < printcot; aa++)
- {
- CPrintRX m_Print;
- if (atoi(g_cominfoarray.ElementAt(0).ElementAt(58)))
- {
- m_Print.InitToPrint(NULL, 1);
- }
- else
- {
- CString name = g_cominfoarray.ElementAt(0).ElementAt(65);
- if (name.IsEmpty())
- m_Print.InitToPrint(NULL, 1);
- else
- {
- int nret = m_Print.InitToPrint((char*)(LPCTSTR)name, 1);
- if (nret == -1 && aa == 0)
- {
- AfxMessageBox("没有此找到打印机, 将使用默认打印机!");
- m_Print.InitToPrint(NULL, 1);
- }
- }
- }
- m_Print.StartPrint();
- m_Print.StartPage();
- LoadRect load;
- load.SetLiaPath("21.lia");
- load.SetMargins(0, 0);
- if (!load.Load())return;
- int i;
- //////////////////////////////////////////////////////////////
- CString filter = "id='" + strOrderNumber + "';id='" + strOrderNumber + "';id='" + strOrderNumber + "'";
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 73; // dresshire表;
- g_sendhead.code[1] = 74; // dresshiredata表;
- g_sendhead.code[2] = 52; // client表;
- g_sendhead.tabcount = 3;
- g_pMainWnd->ProcessChatMessageRequest2(filter);
- if (g_bSendOK == 0)
- {
- return;
- }
- CArray<CStringArray, CStringArray>dresshirearray;
- CArray<CStringArray, CStringArray>dresshiredataarray;
- CArray<CStringArray, CStringArray>clientarray;
- DataToArray(&dresshirearray, &dresshiredataarray, &clientarray);
- if (dresshirearray.GetSize() == 0)return;
- // dresshire;
- CString m_remark = dresshirearray.ElementAt(0).ElementAt(10); // 备注;
- CString m_date1 = dresshirearray.ElementAt(0).ElementAt(7); // 取衣日期;
- CString m_date2 = dresshirearray.ElementAt(0).ElementAt(8); // 还衣日期;
- CString m_inputdate = dresshirearray.ElementAt(0).ElementAt(6); // 记录日期;
- CString strPrice = dresshirearray.ElementAt(0).ElementAt(1); // 金额;
- CString strDeposit = dresshirearray.ElementAt(0).ElementAt(2); // 押金;
- // client表;
- if (clientarray.GetSize() == 0)return;
- CString m_name2 = clientarray.ElementAt(0).ElementAt(2); // 女宾姓名;
- CString m_phone2 = clientarray.ElementAt(0).ElementAt(4); // 女宾手机;
- CString m_addr2 = clientarray.ElementAt(0).ElementAt(8); // 女宾地址;
- CString m_time3 = clientarray.ElementAt(0).ElementAt(20); // 婚期;
- // dresshiredata表;
- CString sItem;
- for (i = 0; i < dresshiredataarray.GetSize(); i++)
- {
- sItem += dresshiredataarray.ElementAt(i).ElementAt(1); // 礼服编号;
- sItem += " ";
- sItem += dresshiredataarray.ElementAt(i).ElementAt(2); // 礼服名称;
- sItem += " 数量:";
- sItem += dresshiredataarray.ElementAt(i).ElementAt(3) + "\r\n"; // 礼服数量;
- }
- sItem += " 金额:";
- sItem += dresshirearray.ElementAt(0).ElementAt(1); // 出租金额;
- sItem += " 押金:";
- sItem += dresshirearray.ElementAt(0).ElementAt(2) + "\r\n"; // 押金;
- ////////////////////////////////////////////////////////////////
- int rcpos = -1;
- CRect StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(17, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)(g_cominfoarray.ElementAt(0).ElementAt(10) + "礼服单"), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- StrRect = load.m_rcarray.ElementAt(++rcpos);
- m_Print.SetFontFace(10, 1, "宋体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)(strOrderNumber), StrRect, 0, 0, FORMAT_RIGHT | FORMAT_VCENTER);
- CStringArray strarray;
- strarray.Add("客户姓名"); // 1.
- strarray.Add("客户电话");
- strarray.Add("预定日期");
- strarray.Add("结婚日期");
- strarray.Add("取件日期"); // 5.
- strarray.Add("归还日期");
- strarray.Add("本店地址");
- strarray.Add("电 话");
- strarray.Add("客户地址");
- strarray.Add("客户签名"); // 10.
- //strarray.Add("金额");
- //strarray.Add("押金");
- for( i=2; i<12; i++)
- //for (i = 2; i < 14; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 2), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- strarray.RemoveAll();
- strarray.Add(m_name2);
- strarray.Add(m_phone2);
- strarray.Add(m_inputdate);
- strarray.Add(m_time3);
- strarray.Add(m_date1);
- strarray.Add(m_date2);
- strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(12));
- strarray.Add(g_cominfoarray.ElementAt(0).ElementAt(11));
- strarray.Add(m_addr2);
- strarray.Add("");
- strarray.Add(strPrice); // 金额;
- strarray.Add(strDeposit); // 押金;
- for( i=12; i<22; i++)
- //for (i = 14; i < 24; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- //m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i-12), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt(i - 14), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- m_Print.DrawRect2(StrRect, 2);
- }
- for (i = 25; i < 30; i++)
- {
- StrRect = load.m_rcarray.ElementAt(i);
- m_Print.DrawRect2(StrRect, 1);
- }
- StrRect = load.m_rcarray.ElementAt(22);
- StrRect.top += 7;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"服务项目:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(23);
- StrRect.top += 7;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"备 注:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(24);
- StrRect.top += 7;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"注意事项:", StrRect, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- StrRect = load.m_rcarray.ElementAt(25); StrRect.left += 75; StrRect.top += 5;
- AutoDraw(m_Print, StrRect, sItem, 1.5);
- StrRect = load.m_rcarray.ElementAt(26); StrRect.left += 75; StrRect.top += 5;
- AutoDraw(m_Print, StrRect, m_remark, 1.5);
- StrRect = load.m_rcarray.ElementAt(27); StrRect.left += 75; StrRect.top += 5;
- CString str = (g_cominfoarray.ElementAt(0).ElementAt(132));
- if (str.IsEmpty())
- {
- str = "\
- 1. 承租者必须持本人身份证,另交押金伍佰-壹仟元整.\r\n\
- 2. 承租时间从结婚日上午八点到下午九点,超时费每小时贰拾圆.\r\n\
- 3. 本店婚纱礼服及其它项目一经定出不可退换.\r\n\
- 4. 如有破损酌情赔偿.";
- }
- AutoDraw(m_Print, StrRect, str, 1.5);
- PrintPreview dlg;
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- printcot = dlg.m_num;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- // ****************************************************************************
- // Jeff:
- // 函数:PrintHireDress2
- // 无参;
- // 调用者:DinDanFrom.cpp
- // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
- // 当订单数大于1000,设置连接公司服务器开关量为真;
- // -----------------------------------------------------------------------------
- // 修改:Jeff
- // 时间:2014.10.18
- // 内容:将 g_ncot 比较值改为100;
- // ****************************************************************************
- void CMainFrame::PrintHireDress2()
- {
- if (g_ncot > 100) g_bSendLYFZ = 1;
- // g_pMainWnd->SetTimer (7, 3000, NULL);
- }
- void CMainFrame::PrintTakeForm2(CArray<CStringArray, CStringArray>*Listarray)
- {
- CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "选片客人明细表";
- int pages = Listarray->GetSize() / 46;
- if (Listarray->GetSize() % 46)pages++;
- for (int aa = 0; aa < pages; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- float fscale;
- {
- int w, h;
- m_Print.GetWidHei(w, h);
- fscale = (float)w / (float)h;
- }
- mainrc.DeflateRect(25, 40, 10, 0);
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- m_Print.SetFontFace(16, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- CString str;
- int wid[5] = { 200, 110, 70, 85, 62 };
- int hei = 16;
- if (fscale > 0.71)hei = 15;
- rc = mainrc;
- rc.bottom = rc.top + hei;
- for (int i = 0; i < 47; i++)
- {
- rc2.top = rc.top + i*hei;
- rc2.bottom = rc.bottom + i*hei;
- rc2.left = rc.left;
- rc2.right = rc.left + wid[0];
- if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
- for (int j = 0; j<5; j++)
- {
- m_Print.DrawRect2(rc2, 1);
- if (Listarray->GetSize()>aa * 46 + i)
- {
- str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- rc2.left += wid[j];
- rc2.right = rc2.left + wid[j + 1];
- }
- }
- rc2.top += 2;
- rc2.left += 2; rc2.right = mainrc.right + 4;
- m_Print.SetFontFace(8, 1, "宋体");
- str.Format(" 页:%d/%d", aa + 1, pages);
- str = "制表:" + g_user.name + " 日期:" + g_date + str;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- // dlg.m_mode=1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintTakeForm3(CArray<CStringArray, CStringArray>*Listarray)
- {
- CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "看设计客人明细表";
- int pages = Listarray->GetSize() / 46;
- if (Listarray->GetSize() % 46)pages++;
- for (int aa = 0; aa < pages; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- float fscale;
- {
- int w, h;
- m_Print.GetWidHei(w, h);
- fscale = (float)w / (float)h;
- }
- mainrc.DeflateRect(25, 40, 10, 0);
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- m_Print.SetFontFace(16, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- CString str;
- int wid[5] = { 200, 110, 70, 85, 62 };
- int hei = 16;
- if (fscale > 0.71)hei = 15;
- rc = mainrc;
- rc.bottom = rc.top + hei;
- for (int i = 0; i < 47; i++)
- {
- rc2.top = rc.top + i*hei;
- rc2.bottom = rc.bottom + i*hei;
- rc2.left = rc.left;
- rc2.right = rc.left + wid[0];
- if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
- for (int j = 0; j<5; j++)
- {
- m_Print.DrawRect2(rc2, 1);
- if (Listarray->GetSize()>aa * 46 + i)
- {
- str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- rc2.left += wid[j];
- rc2.right = rc2.left + wid[j + 1];
- }
- }
- rc2.top += 2;
- rc2.left += 2; rc2.right = mainrc.right + 4;
- m_Print.SetFontFace(8, 1, "宋体");
- str.Format(" 页:%d/%d", aa + 1, pages);
- str = "制表:" + g_user.name + " 日期:" + g_date + str;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- // dlg.m_mode=1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintTakeForm4(CArray<CStringArray, CStringArray>*Listarray)
- {
- CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "取件客人明细表";
- int pages = Listarray->GetSize() / 46;
- if (Listarray->GetSize() % 46)pages++;
- for (int aa = 0; aa < pages; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- float fscale;
- {
- int w, h;
- m_Print.GetWidHei(w, h);
- fscale = (float)w / (float)h;
- }
- mainrc.DeflateRect(25, 40, 10, 0);
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- m_Print.SetFontFace(16, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(9, 1, "宋体");
- CString str;
- int wid[5] = { 200, 110, 70, 85, 62 };
- int hei = 16;
- if (fscale > 0.71)hei = 15;
- rc = mainrc;
- rc.bottom = rc.top + hei;
- for (int i = 0; i < 47; i++)
- {
- rc2.top = rc.top + i*hei;
- rc2.bottom = rc.bottom + i*hei;
- rc2.left = rc.left;
- rc2.right = rc.left + wid[0];
- if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
- for (int j = 0; j<5; j++)
- {
- m_Print.DrawRect2(rc2, 1);
- if (Listarray->GetSize()>aa * 46 + i)
- {
- str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- rc2.left += wid[j];
- rc2.right = rc2.left + wid[j + 1];
- }
- }
- rc2.top += 2;
- rc2.left += 2; rc2.right = mainrc.right + 4;
- m_Print.SetFontFace(8, 1, "宋体");
- str.Format(" 页:%d/%d", aa + 1, pages);
- str = "制表:" + g_user.name + " 日期:" + g_date + str;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- // dlg.m_mode=1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintTakeForm5(CArray<CStringArray, CStringArray>*Listarray)
- {
- CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "婚庆客人明细表";
- int pages = Listarray->GetSize() / 46;
- if (Listarray->GetSize() % 46)pages++;
- for (int aa = 0; aa < pages; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- float fscale;
- {
- int w, h;
- m_Print.GetWidHei(w, h);
- fscale = (float)w / (float)h;
- }
- mainrc.DeflateRect(25, 40, 10, 0);
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- m_Print.SetFontFace(16, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(8, 1, "宋体");
- CString str;
- int wid[7] = { 165, 90, 90, 45, 45, 60, 35 };
- int hei = 16;
- if (fscale > 0.71)hei = 15;
- rc = mainrc;
- rc.bottom = rc.top + hei;
- for (int i = 0; i < 47; i++)
- {
- rc2.top = rc.top + i*hei;
- rc2.bottom = rc.bottom + i*hei;
- rc2.left = rc.left;
- rc2.right = rc.left + wid[0];
- if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
- for (int j = 0; j<7; j++)
- {
- m_Print.DrawRect2(rc2, 1);
- if (Listarray->GetSize()>aa * 46 + i)
- {
- str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- rc2.left += wid[j];
- rc2.right = rc2.left + wid[j + 1];
- }
- }
- rc2.top += 2;
- rc2.left += 2; rc2.right = mainrc.right + 4;
- m_Print.SetFontFace(8, 1, "宋体");
- str.Format(" 页:%d/%d", aa + 1, pages);
- str = "制表:" + g_user.name + " 日期:" + g_date + str;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- // dlg.m_mode=1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::PrintTakeForm1(CArray<CStringArray, CStringArray>*Listarray)
- {
- CString title = g_cominfoarray.ElementAt(0).ElementAt(10) + "拍照客人明细表";
- int pages = Listarray->GetSize() / 46;
- if (Listarray->GetSize() % 46)pages++;
- for (int aa = 0; aa < pages; aa++)
- {
- PrintPreview dlg;
- CPrintRX m_Print;
- m_Print.InitToPrint(NULL, 1);
- m_Print.StartPrint();
- m_Print.StartPage();
- CRect mainrc(0, 0, 560, 793);
- float fscale;
- {
- int w, h;
- m_Print.GetWidHei(w, h);
- fscale = (float)w / (float)h;
- }
- mainrc.DeflateRect(25, 40, 10, 0);
- CRect rc, rc2;
- rc = mainrc;
- rc.bottom = rc.top;
- rc.top -= 20;
- m_Print.SetFontFace(16, 1, "黑体");
- m_Print.DrawText((LPTSTR)(LPCTSTR)title, rc, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- m_Print.SetFontFace(8, 1, "宋体");
- CString str;
- int wid[7] = { 165, 60, 90, 60, 60, 60, 35 };
- int hei = 16;
- if (fscale > 0.71)hei = 15;
- rc = mainrc;
- rc.bottom = rc.top + hei;
- for (int i = 0; i < 47; i++)
- {
- rc2.top = rc.top + i*hei;
- rc2.bottom = rc.bottom + i*hei;
- rc2.left = rc.left;
- rc2.right = rc.left + wid[0];
- if ((!(Listarray->GetSize() > aa * 46 + i)) || i == 46)break;
- for (int j = 0; j<7; j++)
- {
- m_Print.DrawRect2(rc2, 1);
- if (Listarray->GetSize()>aa * 46 + i)
- {
- str = Listarray->ElementAt(aa * 46 + i).ElementAt(j);
- rc2.left += 3;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- rc2.left -= 3;
- }
- rc2.left += wid[j];
- rc2.right = rc2.left + wid[j + 1];
- }
- }
- rc2.top += 2;
- rc2.left += 2; rc2.right = mainrc.right + 4;
- m_Print.SetFontFace(8, 1, "宋体");
- str.Format(" 页:%d/%d", aa + 1, pages);
- str = "制表:" + g_user.name + " 日期:" + g_date + str;
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT_RIGHT | FORMAT_UP);
- m_Print.GetWidHei(dlg.m_w, dlg.m_h);
- dlg.m_pDC = m_Print.GetPDC();
- // dlg.m_mode=1;
- if (aa == 0)
- {
- if (dlg.DoModal() != IDOK)
- return;
- }
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
- }
- }
- void CMainFrame::ShowMonthForm2()
- {
- }
- // dlg;
|