1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912 |
- // 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 "annualfee.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 "TodayForm.h"
- #include "WorkerReport.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"
- #if 1
- #include "FileManage.h"
- #endif
- #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);
- /************************************************************************/
- /*
- Jeff:g_conntype
- g_conntype == 0 :表示正常连接?(或是连接普通服务器?)
- g_conntype == 1 :表示连接公司服务器
- g_conntype == 2 :http://www.lyfz.net/download/ip.txt
- g_conntype == 3 :http://photo.bjlyfz.com/download/ip.txt
- g_conntype == 4 :
- */
- /************************************************************************/
- HHOOK g_hmouse=NULL; //g_sendhead zx.dll
- //extern void WriteClientLog(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( atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
- {
- 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;
- /////////////////////////////////////////////////////////////////////////////
- // 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)
- END_MESSAGE_MAP()
- static UINT indicators[] =
- {
- ID_SEPARATOR, // status line indicator
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
- 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);
- }
- void CMainFrame::OnNcLButtonDblClk(UINT nFlags, CPoint point)
- {
- if(nFlags != HTCAPTION)
- CMDIFrameWnd::OnNcLButtonDblClk(nFlags, point);
- }
- CMainFrame::CMainFrame()
- {
- // TODO: add member initialization code here
- SetConnectionID(INVALID_SOCKET);
-
- m_pMainFrimDlg2=NULL;
-
- CString version = _T ("Version 1.0");
- m_bCheckF2F3=AfxGetApp()->GetProfileInt (version, "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(g_server.Find (".ly.com")!=-1)
- {
- g_ntimeout=30000;
- }
-
- if(::PathFileExists (g_mainpath+"\\logo.ico"))
- {
- Bitmap *bmp=NULL;
- LoadImageFromFile (&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))
- {
- // Jeff.创建失败的可能性小,加日志输出;
- 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))
- {
- // Jeff.创建失败的可能性小,加日志输出;
- 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))
- {
- // Jeff.创建失败的可能性小,加日志输出;
- 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);
-
- /* CString ss;
- ss.Format ("%d,%d,%d,%d", g_rc.left , g_rc.top , g_rc.right , g_rc.bottom );
- AfxMessageBox(ss);*/
-
- 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);
- 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()
- {
- //WriteLog("退出系统");//Jeff.add
- OnDisconnect();
- Transport_UnInit();
- 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 // 此机用选片菜单项,去掉不用;
- {
- CString version = _T ("Version 1.0");
- BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
- if(checked)
- {
- CMenu* submenu = pMemu->GetSubMenu(1);
- submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
- }
- }
- #endif
- #ifndef BASIC_VERSION
- {
- CString version = _T ("Version 1.0");
- BOOL checked=AfxGetApp()->GetProfileInt (version, "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此机用选片菜单项不用;
- {
- CString version = _T ("Version 1.0");
- BOOL checked=AfxGetApp()->GetProfileInt (version, "status", 0);
- if(checked)
- {
- CMenu* submenu = m_menuXP.GetSubMenu(1);
- submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
- }
- }
- #endif
- {
- CString version = _T ("Version 1.0");
- BOOL checked=AfxGetApp()->GetProfileInt (version, "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;
- /* if(g_bBranchModify)
- {
- AfxMessageBox("系统设置不支持远程访问,请直接访问该分店!", MB_ICONINFORMATION);
- return;
- }*/
- Set dlg;
- dlg.DoModal();
- //if(dlg.DoModal() != IDOK)
- //{
- //AfxMessageBox("789");
- //Set::SetCancle();
- //}
- return;
- }
- case IDM_HIDEWINDOW:
- {
- HideWindow dlg;
- dlg.DoModal ();
- return;
- }
- case IDM_Logout:// Jeff.注销;
- {
- WriteLog("退出系统");//Jeff.add;
- 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==0)
- if(g_pMainWnd2)g_pMainWnd2->ShowBar(1);
-
-
- 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()
- {
- 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)
- {
- }
- else
- {
- OnDisconnect();
- }
- }
- BOOL CMainFrame::ProcessLoginRequest()
- {
- // 1.设置通信类型MSG_LOGIN_REQ,为登陆请求;
- WORD 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();
- strcpy(tLogonInfo.tUserInfo.szUserName, strUserName);
- 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;
- }
- /************************************************************************/
- /*
- 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"));
- g_sendhead.bsql = 0;
- g_sendhead.code[0] = 300;
- g_sendhead.tabcount = 1;
- g_pMainWnd->ProcessChatMessageRequest2(strFilter);
- if ( !g_bSendOK )
- {
- // 获取共享信息失败;
- return FALSE;
- }
- g_aryOfSharePathInfo.RemoveAll();
- DataToArray(&g_aryOfSharePathInfo);
- return g_aryOfSharePathInfo.GetSize() ? TRUE : FALSE;
- }
- //*********************************************//
- /*
- 函数:ProcessChatMessageRequest2
- 参数:BYTE code [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 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 ();
- }
- /************************************************************************/
- /*
- 函数: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 = 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)
- strcpy(pChatMessage->szFromUserName, g_branchname);
- #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)
- {
- ::SendMessage(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 )
- {
- ::SendMessage (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 )
- {
- ::SendMessage (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);
- 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 )
- {
- ::SendMessage (g_hSendWnd, WM_CLOSE, 0, 0);
- }
- }
- else
- {
- KillTimer(2);
- SetTimer(2, g_ntimeout, NULL);
- }
- }
- }
- 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;
- }
-
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- WORD wPort = SERVER_PORT;
-
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if( TRANSPORT_OK != nResult )
- {
- m_tClientTunnel.net_CloseSocket();
- return OnConnectBranch2();
- return 0;
- }
- 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);
- WORD wPort = SERVER_PORT;
-
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if( TRANSPORT_OK != nResult )
- {
- 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);
- WORD wPort = SERVER_PORT;
-
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if( TRANSPORT_OK != nResult )
- {
- 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;
- 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 )
- {
- // AfxMessageBox("网络初始化失败!");
- return 0;
- }
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- WORD wPort = GetPort();
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if( TRANSPORT_OK != nResult )
- {
- 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())
- {
- //MessageBox("ip成功");
- // g_serverip=g_server;
- //LOG4C((LOG_NOTICE,"OnConnectIP == 1,return 1"));
- return 1;
- }
- g_server=strServerAddress ;
- OnDisconnect();//MessageBox("ip失败");
- }
- g_conntype=1; // Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
- strServerAddress="lijiafz.vicp.net";
- MyGetIPByName2(strServerAddress);
- if(strServerAddress.IsEmpty())
- {
- //LOG4C((LOG_NOTICE,"strServerAddress == 0,return 0"));
- 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 )
- {
- // AfxMessageBox("网络初始化失败!");
- // LOG4C((LOG_NOTICE,"网络初始化失败!,return 0"));
- return 0;
- }
-
- DWORD dwRemoteIPValue = inet_addr(szServerAddress);
- WORD wPort = SERVER_PORT;
- if(g_conntype) wPort=GetPort();
- // 6.连接公司服务器或影楼服务器;
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if( TRANSPORT_OK != nResult )
- {
- // AfxMessageBox("连接失败");
- m_tClientTunnel.net_CloseSocket();
- if(g_conntype)// Jeff.连接公司服务器,用于获取集团版*.ly.com的解析IP结果;
- {
- // LOG4C((LOG_NOTICE,"连接失败,return 0"));
- 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;
- }
- // LOG4C((LOG_NOTICE,"ok send"));
- 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);
- WORD wPort = SERVER_PORT;
- if(g_conntype)wPort=GetPort();
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if( TRANSPORT_OK != nResult )
- {
- 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);
- WORD wPort = SERVER_PORT;
- if(g_conntype)wPort=GetPort();
- nResult = m_tClientTunnel.net_Connect(dwRemoteIPValue, wPort);
- if( TRANSPORT_OK != nResult )
- {
- m_tClientTunnel.net_CloseSocket();
- return 0;
- }
- return ProcessLoginRequest();
- }
- void CMainFrame::ProcessNetEvent(int nEventType, void *pRecvMsg, DWORD dwDataLen)
- {
- 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:
- {
- 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:
- {
- //AfxMessageBox("登陆成功");
- 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 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);
-
- CString version = _T ("Version 1.0");
- BOOL checked=AfxGetApp()->GetProfileInt (version, "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");
- dlg.DoModal();
- }
- if(g_user.bLongin && g_pMainWnd2)
- {
- g_pMainWnd2->ShowBar (1);
- 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 )//&& atoi(g_cominfoarray.ElementAt(0).ElementAt(133)) && atoi(g_cominfoarray.ElementAt(0).ElementAt(134))>1)
- {
- g_hmouse=SetWindowsHookEx(WH_MOUSE, MouseProc, 0, ::GetCurrentThreadId ());
- }
-
- }
- else if( 2 == nIDEvent ) //29秒后,若连接和发送未完成,将关闭连接和发送框;
- {
- KillTimer(2);
- if(g_hConnectWnd )
- ::SendMessage (g_hConnectWnd, WM_CLOSE, 0, 0);
- if(g_hSendWnd )
- ::SendMessage (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)return;
- if(g_nAutoShowStaffAchievement==1)return;
- if(g_bAllBranch)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 )
- {
- KillTimer(7);
- if(g_bInSkin)return;
- if(g_nAutoShowStaffAchievement==1)return;
- if(g_bAllBranch)return;
- CString str=g_sInfo;
- g_bConnLYFZ=1;
- 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;
- /* UINT nID=0;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"开单";
- OPEN_MENU(Booking);*/
- 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(SatisfactionForm);
- return;
- }
- else if(strMsg=="回复统计")
- {
- UINT nID=1;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"回复统计";
- OPEN_MENU(MsgReg2);
- return;
- }
- /* 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(CClientForm2);
- return;
- }
- else if(strMsg=="服务统计")
- {
- UINT nID=2;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"服务统计";
- OPEN_MENU(CClientForm3);
- return;
- }
- else if(strMsg=="意向客户")
- {
- UINT nID=2;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"意向客户";
- #ifdef LYFZ_VERSION
- OPEN_MENU(Client2FormLYFZ);
- #else
- OPEN_MENU(Client2Form);
- #endif
- 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=="每日签到")
- {
- UINT nID=3;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"每日签到";
- OPEN_MENU(WorkerReport);
- return;
- }
- else if(strMsg=="服务费")
- {
- UINT nID=3;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"服务费";
- OPEN_MENU(annualfee);
- 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.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;
- }
- #if 1 // Jeff.add.2014.07.08.多多福文件柜功能;
- else if ( strMsg == "文件柜")
- {
- //FileManage dlg;
- UINT nID=3;
- LPSTR pName ;
- pName = (LPSTR)(LPCSTR)"文件柜";
- OPEN_MENU(FileManage);
- return;
- }
- #endif
- AfxMessageBox(strMsg+",开发中...");
- }
- 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");
- 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
- CString version = _T ("Version 1.0");
- 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 (version, "status", 0);
- }
- else
- {
- submenu->CheckMenuItem(IDM_choosephotoskin, MF_BYCOMMAND | MF_CHECKED);
- AfxGetApp()->WriteProfileInt (version, "status", 1);
- }
- }
- 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;
- case VK_F11:
- if(g_bInSkin)return 1;
- if(g_user.bLongin)
- {
- SqlDlg dlg;
- dlg.DoModal ();
- }
- break;
- #ifdef LYFZ_VERSION
- case VK_F4:
- if(g_user.bLongin)
- {
-
- g_sendhead.bsql=0;
- g_sendhead.code[0]=199;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(1);if(g_bSendOK==0)return 0;
- DataToArray(&g_List1array);
-
- CStdioFile fp;
- CString path=g_mainpath+"\\NullBalance.txt";
- ::DeleteFile (path);
- fp.Open (path, CFile::modeCreate|CFile::modeWrite);
- CString str;
- for(int i=0; i<g_List1array.GetSize (); i++)
- {
- for(int j=0; j<g_List1array.ElementAt (0).GetSize (); j++)
- {
- str=g_List1array.ElementAt (0).ElementAt (j)+"\n";
- str.TrimLeft ();
- fp.WriteString (str);
- }
- }
- fp.Close ();
- ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOWMAXIMIZED);
- }
- 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");
- }
- 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,temp;
- 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(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);
- 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.4);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.4);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.4);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.4);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.4);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);//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.8);
-
- 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.4);
- }
- 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(::CheckFileExist (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)//打印订单报表;
- {
- // 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))==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())
- m_bz += "\r\n景点:\r\n";
- else
- m_bz = "景点:\r\n";
- }
- #ifdef DDF_VERSION
- m_bz+="□219片场:219路馨园小区对面\r\n";
- m_bz+="□金色样片片场:万科金色家园小区东门南走20米荣光社区一楼\r\n";
- m_bz+="□孟泰片场:立山孟泰公园北门对面沛芝堂二楼\r\n";
- m_bz+="□开发区样片片场:铁西去永宁街兴盛南路27号\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.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);
- }
- 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(CArray<CRect,CRect>*rcarray, CStringArray *strarray2, CPrintRX *Print, int FORMAT)
- {
- CSize size;
- CString str,temp;
- CRect rc;
- int maxhei=1;
- int fonthei;
- for(int i=0; i < rcarray->GetSize (); i++)
- {
- rc=rcarray->ElementAt (i);
- maxhei=max(maxhei, rc.bottom );
- str=strarray2->ElementAt (i);
- temp.Empty ();
- int hei=0;
- while(str.IsEmpty()==0)
- {
- str=str.Right (str.GetLength ()-temp.GetLength ());
- if(str.IsEmpty ())break;
- Print->GetStrSize((LPTSTR)(LPCTSTR)str, size);
- fonthei=size.cy+1;
- if(size.cx<=rc.Width())
- {
- CRect rc2=rc;
- rc2.top +=hei*fonthei;
- rc2.bottom =rc2.top+fonthei;
- Print->DrawText((LPTSTR)(LPCTSTR)str, rc2, 0, 0, FORMAT | FORMAT_UP);
- //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
- maxhei=max(maxhei, rc2.bottom );
- break;
- }
- int right=0;
- while(size.cx>rc.Width ())
- {
- right++;
- temp=str.Left (str.GetLength ()-(right));
- if(GIsHalfHZ(temp))
- {
- right++;
- temp.Delete (temp.GetLength ()-1);
- }
- Print->GetStrSize((LPTSTR)(LPCTSTR)temp, size);
- }
- CRect rc2=rc;
- rc2.top +=hei*fonthei;
- rc2.bottom =rc2.top+fonthei;
- Print->DrawText((LPTSTR)(LPCTSTR)temp, rc2, 0, 0, FORMAT | FORMAT_UP); //printf("Jeff:str=%s\n\n",str);// Jeff Printf;
- hei++;
- maxhei=max(maxhei, rc2.bottom );
- }
- }
- return maxhei+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(63);
- 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.lia");
- load.SetMargins(-14,35);
- if(!load.Load ())return;
-
- LoadRect load2;
- load2.SetLiaPath ("7.lia");
- load2.SetMargins(-14,216+35);
- if(!load2.Load ())return;
-
- LoadRect load3;
- load3.SetLiaPath ("8.lia");
- load3.SetMargins(-14,705+35);
- if(!load3.Load ())return;
- int i;
-
- //////////////////////////////////////////////////////////////
- CStringArray txarray;
- CString filter="id='"+m_id+"';id='"+m_id+"';id='"+m_id+"' and name<>'入册';";
- g_sendhead.code[0]=11;
- g_sendhead.code[1]=52;
- g_sendhead.code[2]=50;
- g_sendhead.code[3]=77;
- 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>phonearray;
- CArray<CStringArray, CStringArray>fgarray;
- DataToArray(&g_List1array, &clientarray, &sparray, &fgarray);
-
-
- 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_qq1=clientarray.ElementAt (0).ElementAt (5);
- CString m_qq2=clientarray.ElementAt (0).ElementAt (6);
-
- 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+"\\skin\\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("QQ/邮箱");
- #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)
- {
- if(i==18)
- StrRect.right-=80;
- else if(i==19)
- StrRect.left-=80;
- 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);
- if(i==45 || i==46)
- StrRect.right-=80;
- else if(i==47 || i==48)
- StrRect.left-=80;
- m_Print.DrawRect2(StrRect, 1);
- }
- /////////////////////////
- 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 ("服饰");
-
- 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 ("");
- rcpos=-1;
- for( i=0; i<strarray.GetSize (); i++)
- {
- StrRect=load2.m_rcarray .ElementAt (++rcpos);
- if(i>9)
- m_Print.DrawRect2(StrRect, 1);
- if(i==1)
- {
- StrRect=load2.m_rcarray .ElementAt (21);StrRect.left +=4;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- else if(i==6 || i==7)
- {
- StrRect.top -=25;
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i), StrRect, 0, 0, FORMAT_HCENTER | FORMAT_VCENTER);
- }
- else
- 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);
- if(rcpos==23 || rcpos==28)continue;
- if(rcpos==24 || rcpos==29)
- StrRect.top-=39;
-
- m_Print.DrawRect2(StrRect, 1);
- }
- /////////////////////////////
- strarray.RemoveAll ();
- strarray.Add ("顾客签字:");
- strarray.Add ("");
- strarray.Add ("");
- strarray.Add ("门市签字:");
- strarray.Add ("");
- strarray.Add ("");
- rcpos=-1;
- for( i=0; i<strarray.GetSize (); i++)
- {
- StrRect=load3.m_rcarray .ElementAt (++rcpos);
- if(i==0 || i==3)
- {
- StrRect.bottom+=20;
- 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==7 || i==10)
- {
- StrRect.bottom+=12;
- m_Print.DrawRect2(StrRect, 2);
- }
- }
- //////////////////////////////////////
- //开始打数据
- strarray.RemoveAll ();
- strarray.Add (m_name1);
- strarray.Add (m_name2);
-
- strarray.Add ("");
- strarray.Add ("");
-
- strarray.Add (m_phone1);
- #ifdef CHILD_VERSION
- strarray.Add ("");
- #else
- strarray.Add (m_phone2);
- #endif
- strarray.Add (m_qq1);
- strarray.Add (m_qq2);
-
- for( i=41; i<=48; i++)
- {
- StrRect=load.m_rcarray .ElementAt (i-1);
- StrRect.left +=4;
- if(i==45 || i==46)
- StrRect.right-=80;
- else if(i==47 || i==48)
- StrRect.left-=80;
-
-
- m_Print.DrawText((LPTSTR)(LPCTSTR)strarray.ElementAt (i-41), StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- ///////////////////////////////
- strarray.RemoveAll ();
- strarray.Add (m_money1);
- str.Format("%d", atoi(m_zs)*2);
- strarray.Add (str);
- strarray.Add (m_time4);
- strarray.Add (m_money2);
- strarray.Add (m_zs);
- strarray.Add ("");
- strarray.Add (m_money3);
- strarray.Add (m_time2);
- strarray.Add ("");
-
- 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;
- str.Format("造型 %d 款,服装 %d 套", atoi(m_clothescount2), atoi(m_clothescount));
- m_Print.DrawText((LPTSTR)(LPCTSTR)str, 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.top -=39;
- 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+="\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);
-
- 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::PrintReceipt(CStringArray *pArray)
- {
- 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)
- {
- 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(0,0);
- else
- load.SetMargins(10,0);
- if(!load.Load ())return;
- int rcpos=-1;
- CRect StrRect=load.m_rcarray .ElementAt (++rcpos);
-
- 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(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(int 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//大单
- {
- 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);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);
-
- #ifdef LYFZ_VERSION
- m_Print.SetFontFace(9, 1, "宋体");
- #else
- m_Print.SetFontFace(11, 1, "宋体");
- #endif
- 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);
-
- #ifdef LYFZ_VERSION
- StrRect.left +=30;
- StrRect.right +=30;
- #endif
- 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(int 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);
- }
-
- #ifdef LYFZ_VERSION
- m_Print.SetFontFace(7, 1, "宋体");
- for(i=24; i<25; i++)
- {
- StrRect=load.m_rcarray .ElementAt (i);
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- #else
- m_Print.SetFontFace(7, 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);
- }
- #endif
- StrRect=load.m_rcarray .ElementAt (24);
-
- hei=StrRect.Height ();
- StrRect.top +=hei;
- StrRect.bottom +=hei;
- StrRect.right +=100;
- StrRect.left +=2;
- StrRect=load.m_rcarray .ElementAt (27);
- 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(dlg.DoModal ()!=IDOK)return;
-
- //结束打印
- m_Print.EndPage();
- m_Print.EndPrint();
-
-
-
- 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;
- }
- */
- void CMainFrame::PrintReceipt(CStringArray *pArray) // 打印订单*预约收款、预约补款*
- {
- //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);
-
- // 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);
-
- int i=7;
- m_Print.SetFontFace(8, 1, "宋体");
- for(/*int*/ 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);
-
- #ifdef LYFZ_VERSION
- m_Print.SetFontFace(9, 1, "宋体");
- #else
- m_Print.SetFontFace(11, 1, "宋体");
- #endif
- // 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);
- #ifdef LYFZ_VERSION
- StrRect.left +=30;
- StrRect.right +=30;
- #endif
- //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, "宋体");
- 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;
- }
-
- // 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=CalHeight(&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;
- #ifdef LYFZ_VERSION
- m_Print.SetFontFace(7, 1, "宋体");
- for(i=24; i<25; i++)
- {
- StrRect=load.m_rcarray .ElementAt (i);StrRect.top +=dty;StrRect.bottom +=dty;
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- #else
- 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);
- }
- #endif
- 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();
-
- 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;
- }
- }
- void CMainFrame::PrintReceipt_01(CStringArray *pArray) // 打印订单*预约收款、预约补款*
- {
- //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);
-
- // 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);
-
- int i=7;
- m_Print.SetFontFace(8, 1, "宋体");
- for(/*int*/ 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);
-
- #ifdef LYFZ_VERSION
- m_Print.SetFontFace(9, 1, "宋体");
- #else
- m_Print.SetFontFace(11, 1, "宋体");
- #endif
- // 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);
- #ifdef LYFZ_VERSION
- StrRect.left +=30;
- StrRect.right +=30;
- #endif
- //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, "宋体");
- 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;
- //}
- 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=CalHeight(&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;
- // 打印总金额;
- #ifdef LYFZ_VERSION
- m_Print.SetFontFace(7, 1, "宋体");
- for(i=24; i<25; i++)
- {
- StrRect=load.m_rcarray.ElementAt(i);
- StrRect.top +=dty;
- StrRect.bottom +=dty;
- StrRect.left +=2;
- m_Print.DrawText((LPTSTR)(LPCTSTR)"声明:1.此单作为收据凭证。2.软件免费升级一年服务。3.以上无正当理由定金不退。4.软件加密锁为核心技术,请妥善保管,遗失不补。", StrRect, 0, 0, FORMAT_LEFT | FORMAT_VCENTER);
- }
- #else
- 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);
- }
- #endif
- 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();
-
- 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;
- }
- }
- void CMainFrame::PrintFlowChart(CString strOrderNumber)
- {
- if(atoi(g_cominfoarray.ElementAt(0).ElementAt(75)))
- {
- PrintFlowChart3(strOrderNumber);return;
- }
- #ifdef ZHIAI_VERSION
- PrintFlowChart2(strOrderNumber);
- return;
- #endif
-
- 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;
- int i = 0;
- for(/*int*/ 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 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;
- int i = 0;
- for(/*int*/ 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=CalHeight(&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.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(/*int*/ 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=CalHeight(&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=CalHeight(&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)
- {
- #ifdef LKAY_VERSION
- PrintFlowChart3LKAY(strOrderNumber);
- return;
- #endif
- 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)))
- {
- 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);
-
-
- if( (bb==0 && bSecondPage==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(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;
- int i = 0;
- for(/*int*/ 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 (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 (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;
- 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 ("客人姓名");
- #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);
-
-
- 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)))
- {
- 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);
-
-
- if(bPrintDate)
- strarray2.Add (m_time6+"/"+m_time5);
- else
- {
- strarray2.Add (m_waiter1+"/"+m_waiter2);
- }
- }
- int bottom=CalHeight(&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 ();
- int j = 0;
- for(/*int*/ j=0; j<3; j++)
- {
- StrRect=rc2array.ElementAt (j);
- StrRect.left +=2;
- StrRect.right -=2;
- StrRect.top +=2;
- rcarray.Add (StrRect);
- strarray2.Add (sparray2.ElementAt (i+j));
- }
-
- bottom=CalHeight(&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);
- strarray2.Add (m_bz);
-
- bottom=CalHeight(&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;
- }
-
- #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(CString m_id)
- {
- #ifdef LKAY_VERSION
- PrintFlowChart3LKAY(m_id);
- return;
- #endif
- 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='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
- g_sendhead.code[0]=54;
- g_sendhead.code[1]=50;
- 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(int 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;
- 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;
- 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);
- 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 (m_id);
- 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);
-
-
-
-
- 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=CalHeight(&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.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 ("照片编号");
-
- 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(int j=0; j<3; 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=CalHeight(&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);
- strarray2.Add (m_bz);
-
-
- bottom=CalHeight(&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;
- }
-
- #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)
- {
- 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='"+m_id+"';id='"+m_id+"' and kind<>'2';id='"+m_id+"'";
- 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;
- int i = 0;
- for(/*int*/ 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 (m_id);
- 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=CalHeight(&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 ();
- int j = 0;
- for(/*int*/ j=0; j<3; 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=CalHeight(&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);
- strarray2.Add (m_bz);
-
-
- bottom=CalHeight(&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;
- }
-
- 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(/*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)); // 第一项菜单项
- }
- g_nYearpos=-1;
- #else
- HMENU hMenu=::GetMenu (m_hWnd);
- m_menuXP.Attach (hMenu);
- BCMenu* submenu = (BCMenu*)m_menuXP.GetSubMenu(2);
- int i = 0;
- 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> *hisyeararray
- 返回:void
- 注意:
- 调用关系:
- */
- /************************************************************************/
- void CMainFrame::AddBranchMenu(CArray<CStringArray, CStringArray>*hisyeararray)
- {
- //WriteClientLog("AddBranchMenu,添加集团版菜单");
- #ifdef ENTERPRISE_VERSION
- CMenu *m_menuXP=GetMenu();
- CMenu* submenu = m_menuXP->GetSubMenu(0);
- int i = 0;
- for(/*int*/ 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",hisyeararray->GetSize());
- WriteClientLog(strCount);
- #endif
- for( i=0; i<hisyeararray->GetSize()-1; i++)
- {
- //WriteClientLog("111");
- //WriteClientLog(hisyeararray->ElementAt(i).ElementAt(0));
- //WriteClientLog(name);
- if(name=="")
- {
- name=hisyeararray->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(hisyeararray->ElementAt (i).ElementAt (0).Find (name)!=-1 && ((hisyeararray->ElementAt (i).ElementAt (0).GetLength ()-name.GetLength ())==4) )
- {
- continue;
- }
- name=hisyeararray->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++;
- //WriteClientLog("222");
- }
-
- if((hisyeararray->GetSize()-1)>0)
- {
- if(hisyeararray->ElementAt (0).ElementAt (3)=="总店")
- submenu->AppendMenu(MF_STRING, 2000+a, "多店数据汇总");
- }
- #endif
- }
- 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)
- {
- #if 1
- CString strMSG;
- strMSG.Format("1登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
- AfxMessageBox(strMSG);
- #endif
- #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) // 取消连接其他分店,回归本店连接;
- {
- AfxMessageBox("取消连接其他分店,回归本店连接");
- 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);
- #if 1
- strMSG.Format("2登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
- AfxMessageBox(strMSG);
- #endif
- }
- else // 连接其他分店;
- {
- AfxMessageBox("连接其他分店");
- 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
- {
- AfxMessageBox("多店汇总");
- 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; // 设置多店汇总标识为true;
- 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;
- #if 1
- strMSG.Format("3登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
- AfxMessageBox(strMSG);
- #endif
- }
- else
- {
- AfxMessageBox("非多店汇总");
- 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
-
- g_branchip.Empty ();
- CString domainname="";
- for(int i=0; i<g_brancharray.GetSize(); i++)
- {
- 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;
- }
- #if 1
- strMSG.Format("2登陆信息:%d,%d,%s,%s,%s",g_bAllBranch,g_bBranchModify,g_branchname,g_branchip,g_domain);
- AfxMessageBox(strMSG);
- #endif
-
- g_bBranchModify=1;
- 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;// 是否有权限进行设置;
-
-
- CString version = _T ("Version 1.0");
- 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 (version, "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 (version, "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
- }
- 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()
- {
- // 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;
- 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;
- WriteLog("退出系统");//Jeff.add
- 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 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, "宋体");
- int i=7;
- for(/*int*/ 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, "宋体");
- int i=7;
- for(/*int*/ 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(/*int*/ 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 ();
- }
- }
- //定金
- void CMainFrame::PrintHireDress(CString m_id)
- {
- 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='"+m_id+"';id='"+m_id+"';id='"+m_id+"'";
- 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(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;
- 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 ;
-
- 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);
-
- 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";
- }
- ////////////////////////////////////////////////////////////////
- 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)(m_id), 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();
-
- }
- }
-
- // ****************************************************************************
- // Jeff:
- // 函数:PrintHireDress2
- // 无参;
- // 调用者:DinDanFrom.cpp
- // void DinDanFrom::GetData(),订单报表调用时,判断订单数是否大于1000
- // 当订单数大于1000,设置连接公司服务器开关量为真;
- // ****************************************************************************
- void CMainFrame::PrintHireDress2()
- {
- if(g_ncot>1000)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;
|