123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- using System.Collections;
- using System.Windows.Forms;
- using System.Drawing;
- using System.Drawing.Printing;
- using LYFZ.ComponentLibrary;
- using System.IO;
- using System.ComponentModel;
- using System.Text.RegularExpressions;
- namespace LYFZ.Software.MainBusiness.ReportPrint
- {
- /// <summary>
- /// 报表打印数据处理类
- /// </summary>
- public class ReportPrintDataClass
- {
- /// <summary>
- /// 获取订单报表相关数据
- /// </summary>
- /// <param name="OrderNumber">订单号</param>
- /// <param name="VersionEnglishName">打印版本</param>
- /// <returns></returns>
- public string GetOrderReportData( string OrderNumber, string VersionEnglishName )
- {
- Hashtable htData = new Hashtable();
- #region 查询条件
- Dictionary<string, string> DictDataArray = new Dictionary<string, string>();
- DictDataArray["Ord_Number"] = OrderNumber;
- DataTable tbl = new BLL.BLL_ErpOrder().GetView_Custom( "View_OrderReportPrintData", StrWhere: "Ord_ShowNumber ='" + OrderNumber + "'" ).Tables[0];
- #endregion
- htData["Ord_Number"] = tbl.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tbl.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tbl.Rows[0]["Ord_Number"].ToString().Trim();//自定认编号不为空,则显示自定义编号
- htData["Ord_CustomerName1"] = tbl.Rows[0]["Ord_CustomerName1"].ToString().Trim();//客户姓名1
- htData["Ord_CustomerName2"] = tbl.Rows[0]["Ord_CustomerName2"].ToString().Trim();//客户姓名2
- htData["Ord_CustomerTelephone1"] = tbl.Rows[0]["Ord_CustomerTelephone1"].ToString().Trim();//客户电话1
- htData["Ord_CustomerTelephone2"] = tbl.Rows[0]["Ord_CustomerTelephone2"].ToString().Trim();//客户电话2
- htData["Ord_CustomerBirthday1"] = tbl.Rows[0]["Ord_CustomerBirthday1"].ToString().Trim();//客户生日1
- htData["Ord_CustomerBirthday2"] = tbl.Rows[0]["Ord_CustomerBirthday2"].ToString().Trim();//客户生日2
- htData["Ord_CustomerSex1"] = tbl.Rows[0]["Ord_CustomerSex1"].ToString().Trim() == "0" ? "男" : "女";//客户性别1
- htData["Ord_CustomerSex2"] = tbl.Rows[0]["Ord_CustomerSex2"].ToString().Trim() == "0" ? "男" : "女";//客户性别2
- htData["Ord_Mc_Number"] = tbl.Rows[0]["Ord_Mc_Number"].ToString().Trim();//客户会员卡号
- htData["Ord_Price"] = tbl.Rows[0]["Ord_Price"].ToString().Trim();//套系价格
- htData["Ord_OrderArrears"] = tbl.Rows[0]["Ord_OrderArrears"].ToString().Trim();//欠款
- string IntoBottom = tbl.Rows[0]["Ord_IntoBottom"].ToString().Trim() == "0" ? "全部" : tbl.Rows[0]["Ord_IntoBottom"].ToString().Trim();
- htData["Ord_InBottomInBook"] = IntoBottom + "/" + tbl.Rows[0]["Ord_IntoRegister"].ToString().Trim();//入底/入册
- htData["Ord_BootDivision"] = tbl.Rows[0]["Ord_BootDivision"].ToString().Trim();//引导师
- htData["Ord_TakenStages"] = tbl.Rows[0]["Ord_TakenStages"].ToString().Trim();
- htData["Ord_PhotographyCategory"] = tbl.Rows[0]["Ord_PhotographyCategory"].ToString().Trim();//类别
- htData["Ord_CustomerSource"] = tbl.Rows[0]["Ord_CustomerSource"].ToString().Trim();//客户来源
- htData["Ord_OrdersPerson"] = tbl.Rows[0]["Ord_OrdersPerson"].ToString().Trim();//订单人员
- htData["Ord_SeriesName"] = tbl.Rows[0]["Ord_SeriesName"].ToString().Trim();//套系名称
- htData["Ord_SeriesPrice"] = tbl.Rows[0]["Ord_SeriesPrice"].ToString().Trim();//套系价格
- htData["Ord_Discount"] = tbl.Rows[0]["Ord_Discount"].ToString().Trim();//折扣
- htData["Ord_Authorize"] = tbl.Rows[0]["Ord_Authorize"].ToString().Trim();//授权
- htData["Ord_AfterDiscount"] = tbl.Rows[0]["Ord_AfterDiscount"].ToString().Trim();//折扣后
- htData["Ord_AfterAuthorize"] = tbl.Rows[0]["Ord_AfterAuthorize"].ToString().Trim();//授权后
- htData["Ord_EntryClerkName"] = tbl.Rows[0]["Ord_EntryClerkName"].ToString().Trim();//录单
- htData["Ord_Remark"] = tbl.Rows[0]["Ord_Remark"].ToString().Trim();//订单备注
- htData["Ord_NowDatetime"] = LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" );//订单日期
- htData["Ord_DetailsName"] = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;//打单人
- DataTable tbl_Product = new LYFZ.BLL.BLL_ErpOrderProductList().GetList( "OPlist_OrderNumber='" + OrderNumber + "'" ).Tables[0];
- if ( VersionEnglishName == "OrderReport_Children" )
- {
- #region 儿童版
- htData["Ord_TakenStages"] = "";
- ArrayList ary = new ArrayList();
- for ( int j = 0; j < tbl_Product.Rows.Count; j++ )
- {
- bool Isbol = true;
- for ( int k = 0; k < ary.Count; k++ )
- {
- string arys = ary[k].ToString().Trim();
- if ( arys.Substring( 0, arys.IndexOf( "数量:" ) ).Trim() == (tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim()) )
- {
- ary[k] = tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim() + Convert.ToInt32( arys.Substring( arys.IndexOf( ":" ) + 1, arys.Length - (arys.IndexOf( ":" ) + 1) ) ) + Convert.ToInt32( tbl_Product.Rows[j]["OPlist_ProdQuantity"].ToString().Trim() );
- Isbol = false; break;
- }
- }
- if ( Isbol )
- {
- ary.Add( tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim() + " 数量:" + tbl_Product.Rows[j]["OPlist_ProdQuantity"].ToString().Trim() );
- }
- }
- for ( int k = 0; k < ary.Count; k++ )
- {
- if ( k > 0 )
- {
- htData["Ord_TakenStages"] += "\r\n" + ary[k].ToString();
- }
- else { htData["Ord_TakenStages"] = ary[k].ToString(); }
- }
- #region 循环塞数据
- string Ord_TakenStages = "";
- string Ord_ClothingName = "";
- string Ord_PhotographyStatus = "";
- string Ord_EarlyRepairStatus = "";
- string Ord_FilmSelectionStatus = "";
- string Ord_RefinementStatus = "";
- string Ord_DesignerStatus = "";
- string Ord_LookDesignStatus = "";
- string Ord_TakePiecesStatus = "";
- string Ord_AppointmentTime = "";
- string Ord_PhotographyTime = "";
- string Ord_FilmSelectionTime = "";
- string Ord_LookDesignTime = "";
- string OPlist_PickupDate = "";
- string Ord_Photographer = "";
- string Ord_MakeupArtist = "";
- string Ord_EarlyRepairName = "";
- string Ord_FilmSelectionName = "";
- string Ord_RefinementName = "";
- string Ord_DesignerName = "";
- string Ord_LookDesignName = "";
- for ( int k = 0; k < tbl.Rows.Count; k++ )
- {
- string Ord_TakenStagesA = tbl.Rows[k]["Ord_TakenStages"].ToString().Trim();//成长套系
- if ( Ord_TakenStages.IndexOf( Ord_TakenStagesA ) == -1 )
- {
- Ord_TakenStages += Ord_TakenStagesA;
- }
- string Ord_PhotographyStatusA = tbl.Rows[k]["Ord_PhotographyStatus"].ToString().Trim() == "0" ? "未拍" : tbl.Rows[k]["Ord_PhotographyStatus"].ToString().Trim() == "2" ? "拍摄中" : "OK";//拍照
- if ( Ord_PhotographyStatus.IndexOf( Ord_PhotographyStatusA ) == -1 )
- {
- Ord_PhotographyStatus += Ord_PhotographyStatusA;
- }
- string Ord_ClothingNameA = tbl.Rows[k]["Ord_ClothingName"].ToString().Trim();//服装师
- if ( Ord_ClothingName.IndexOf( Ord_ClothingNameA ) == -1 )
- {
- Ord_ClothingName += Ord_ClothingNameA;
- }
- string Ord_EarlyRepairStatusA = tbl.Rows[k]["Ord_EarlyRepairStatus"].ToString().Trim() == "0" ? "未修" : tbl.Rows[k]["Ord_EarlyRepairStatus"].ToString().Trim() == "1" ? "修片中" : "OK";//初修
- if ( Ord_EarlyRepairStatus.IndexOf( Ord_EarlyRepairStatusA ) == -1 )
- {
- Ord_EarlyRepairStatus += Ord_EarlyRepairStatusA;
- }
- string Ord_FilmSelectionStatusA = tbl.Rows[k]["Ord_FilmSelectionStatus"].ToString().Trim() == "0" ? "未选" : "OK";//选片
- if ( Ord_FilmSelectionStatus.IndexOf( Ord_FilmSelectionStatusA ) == -1 )
- {
- Ord_FilmSelectionStatus += Ord_FilmSelectionStatusA;
- }
- string Ord_RefinementStatusA = tbl.Rows[k]["Ord_RefinementStatus"].ToString().Trim() == "0" ? "未修" : tbl.Rows[k]["Ord_RefinementStatus"].ToString().Trim() == "0" ? "修片中" : "OK";//精修
- if ( Ord_RefinementStatus.IndexOf( Ord_RefinementStatusA ) == -1 )
- {
- Ord_RefinementStatus += Ord_RefinementStatusA;
- }
- string Ord_DesignerStatusA = tbl.Rows[k]["Ord_DesignerStatus"].ToString().Trim() == "0" ? "未设计" : tbl.Rows[k]["Ord_DesignerStatus"].ToString().Trim() == "1" ? "设计中" : "OK";//设计
- if ( Ord_DesignerStatus.IndexOf( Ord_DesignerStatusA ) == -1 )
- {
- Ord_DesignerStatus += Ord_DesignerStatusA;
- }
- string Ord_LookDesignStatusA = tbl.Rows[k]["Ord_LookDesignStatus"].ToString().Trim() == "0" ? "未看" : "OK";//看设计
- if ( Ord_LookDesignStatus.IndexOf( Ord_LookDesignStatusA ) == -1 )
- {
- Ord_LookDesignStatus += Ord_LookDesignStatusA;
- }
- string Ord_TakePiecesStatusA = tbl.Rows[k]["Ord_TakePiecesStatus"].ToString().Trim();//取件
- if ( Ord_TakePiecesStatus.IndexOf( Ord_TakePiecesStatusA ) == -1 )
- {
- Ord_TakePiecesStatus += Ord_TakePiecesStatusA;
- }
- string Ord_AppointmentTimeA = tbl.Rows[k]["Ord_AppointmentTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_AppointmentTime"] ).ToString( "yyyy-MM-dd" );//预约时间
- if ( Ord_AppointmentTime.IndexOf( Ord_AppointmentTimeA ) == -1 )
- {
- Ord_AppointmentTime += Ord_AppointmentTimeA;
- }
- string Ord_PhotographyTimeA = tbl.Rows[k]["Ord_PhotographyTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_PhotographyTime"] ).ToString( "yyyy-MM-dd" );//拍照时间
- if ( Ord_PhotographyTime.IndexOf( Ord_PhotographyTimeA ) == -1 )
- {
- Ord_PhotographyTime += Ord_PhotographyTimeA;
- }
- string Ord_FilmSelectionTimeA = tbl.Rows[k]["Ord_FilmSelectionTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_FilmSelectionTime"] ).ToString( "yyyy-MM-dd" );//选片时间
- if ( Ord_FilmSelectionTime.IndexOf( Ord_FilmSelectionTimeA ) == -1 )
- {
- Ord_FilmSelectionTime += Ord_FilmSelectionTimeA;
- }
- string Ord_LookDesignTimeA = tbl.Rows[k]["Ord_LookDesignTime"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_LookDesignTime"] ).ToString( "yyyy-MM-dd" );//看设计时间
- if ( Ord_LookDesignTime.IndexOf( Ord_LookDesignTimeA ) == -1 )
- {
- Ord_LookDesignTime += Ord_LookDesignTimeA;
- }
- string OPlist_PickupDateA = tbl.Rows[k]["Ord_PickupDate"].ToString().Trim() == "" ? "" : Convert.ToDateTime( tbl.Rows[k]["Ord_PickupDate"] ).ToString( "yyyy-MM-dd" );//取件时间
- if ( OPlist_PickupDate.IndexOf( OPlist_PickupDateA ) == -1 )
- {
- OPlist_PickupDate += OPlist_PickupDateA;
- }
- string Ord_PhotographerA = tbl.Rows[k]["Ord_Photographer"].ToString().Trim();//拍摄师
- if ( Ord_Photographer.IndexOf( Ord_PhotographerA ) == -1 )
- {
- Ord_Photographer += Ord_PhotographerA;
- }
- string Ord_MakeupArtistA = tbl.Rows[k]["Ord_MakeupArtist"].ToString().Trim();//化妆师
- if ( Ord_MakeupArtist.IndexOf( Ord_MakeupArtistA ) == -1 )
- {
- Ord_MakeupArtist += Ord_MakeupArtistA;
- }
- string Ord_EarlyRepairNameA = tbl.Rows[k]["Ord_EarlyRepairName"].ToString().Trim();//初修师
- if ( Ord_EarlyRepairName.IndexOf( Ord_EarlyRepairNameA ) == -1 )
- {
- Ord_EarlyRepairName += Ord_EarlyRepairNameA;
- }
- string Ord_FilmSelectionNameA = tbl.Rows[k]["Ord_FilmSelectionName"].ToString().Trim();//选片师
- if ( Ord_FilmSelectionName.IndexOf( Ord_FilmSelectionNameA ) == -1 )
- {
- Ord_FilmSelectionName += Ord_FilmSelectionNameA;
- }
- string Ord_RefinementNameA = tbl.Rows[k]["Ord_RefinementName"].ToString().Trim();//精修师
- if ( Ord_RefinementName.IndexOf( Ord_RefinementNameA ) == -1 )
- {
- Ord_RefinementName += Ord_RefinementNameA;
- }
- string Ord_DesignerNameA = tbl.Rows[k]["Ord_DesignerName"].ToString().Trim();//设计师
- if ( Ord_DesignerName.IndexOf( Ord_DesignerNameA ) == -1 )
- {
- Ord_DesignerName += Ord_DesignerNameA;
- }
- string Ord_LookDesignNameA = tbl.Rows[k]["Ord_LookDesignName"].ToString().Trim();//看设计师
- if ( Ord_LookDesignName.IndexOf( Ord_LookDesignNameA ) == -1 )
- {
- Ord_LookDesignName += Ord_LookDesignNameA;
- }
- }
- htData["Ord_TakenStages"] = Ord_TakenStages;
- htData["Ord_ClothingName"] = Ord_ClothingName;
- htData["Ord_PhotographyStatus"] = Ord_PhotographyStatus;
- htData["Ord_EarlyRepairStatus"] = Ord_EarlyRepairStatus;
- htData["Ord_FilmSelectionStatus"] = Ord_FilmSelectionStatus;
- htData["Ord_RefinementStatus"] = Ord_RefinementStatus;
- htData["Ord_DesignerStatus"] = Ord_DesignerStatus;
- htData["Ord_LookDesignStatus"] = Ord_LookDesignStatus;
- htData["Ord_TakePiecesStatus"] = Ord_TakePiecesStatus;
- htData["Ord_AppointmentTime"] = Ord_AppointmentTime;
- htData["Ord_PhotographyTime"] = Ord_PhotographyTime;
- htData["Ord_FilmSelectionTime"] = Ord_FilmSelectionTime;
- htData["Ord_LookDesignTime"] = Ord_LookDesignTime;
- htData["OPlist_PickupDate"] = OPlist_PickupDate;
- htData["Ord_Photographer"] = Ord_Photographer;
- htData["Ord_MakeupArtist"] = Ord_MakeupArtist;
- htData["Ord_EarlyRepairName"] = Ord_EarlyRepairName;
- htData["Ord_FilmSelectionName"] = Ord_FilmSelectionName;
- htData["Ord_RefinementName"] = Ord_RefinementName;
- htData["Ord_DesignerName"] = Ord_DesignerName;
- htData["Ord_LookDesignName"] = Ord_LookDesignName;
- #endregion
- #endregion
- }
- else if ( VersionEnglishName == "OrderReport_Wedding" )
- {
- #region 婚纱
- for ( int j = 0; j < tbl_Product.Rows.Count; j++ )
- {
- if ( j > 0 )
- {
- htData["Ord_TakenStages"] = tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim() + " 数量:" + tbl_Product.Rows[j]["OPlist_ProdQuantity"].ToString().Trim();
- }
- else { htData["Ord_TakenStages"] += "\r\n" + tbl_Product.Rows[j]["OPlist_ProdName"].ToString().Trim() + " 数量:" + tbl_Product.Rows[j]["OPlist_ProdQuantity"].ToString().Trim(); }
- }
- #endregion
- }
- #region 影楼信息
- tbl = new LYFZ.BLL.BLL_ErpCompanyInfo().GetList( "Company_DividedShop='" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID() + "'" ).Tables[0];
- for ( int i = 0; i < tbl.Columns.Count; i++ )
- {
- htData[tbl.Columns[i].ToString().Trim()] = tbl.Columns[i].ColumnName.Trim();
- }
- for ( int k = 0; k < tbl.Rows.Count; k++ )
- {
- for ( int i = 0; i < tbl.Columns.Count; i++ )
- {
- htData[tbl.Columns[i].ToString().Trim()] = tbl.Rows[k][tbl.Columns[i].ToString().Trim()].ToString().Trim();
- }
- }
- #endregion
- return DrawingPrintModelBoard( VersionEnglishName, htData );
- }
- /// <summary>
- /// 绘画出要打印模板
- /// </summary>
- /// <param name="EnglishName"></param>
- /// <param name="htData"></param>
- /// <returns>NotExistModel:模板不存在 NotSetModel:模板未设置</returns>
- public string DrawingPrintModelBoard( string EnglishName, Hashtable htData )
- {
- try
- {
- DataTable tbl = new LYFZ.BLL.BLL_ErpReportModel().GetList( "Rmd_EnglishName='" + EnglishName + "'" ).Tables[0];
- if ( tbl.Rows.Count > 0 )
- {
- if ( tbl.Rows[0]["Rmd_StrJion"].ToString().Trim() != "" )
- {
- Json.JsontoDataTable jdt = new Json.JsontoDataTable();
- DataTable tbl_ModelJion = jdt.toObject( tbl.Rows[0]["Rmd_ModelJion"].ToString().Trim() );
- Panel newpanel = new Panel();
- newpanel.Name = tbl_ModelJion.Rows[0]["Name"].ToString().Trim();
- newpanel.Size = new Size( Convert.ToInt32( tbl_ModelJion.Rows[0]["SizeWidth"].ToString().Trim() ), Convert.ToInt32( tbl_ModelJion.Rows[0]["SizeHigh"].ToString().Trim() ) );
- newpanel.Location = new Point( 0, 0 );
- if ( tbl_ModelJion.Rows[0]["IsPrint"].ToString().Trim() == "true" )
- {
- try
- {
- System.IO.FileStream fs = new System.IO.FileStream( tbl.Rows[0]["Rmd_PhotoPath"].ToString().Trim(), System.IO.FileMode.Open, System.IO.FileAccess.Read );
- Image image = System.Drawing.Image.FromStream( fs );
- newpanel.BackgroundImageLayout = ImageLayout.Zoom;
- newpanel.BackgroundImage = image;
- fs.Close();
- }
- catch { return "模板图片不存在"; }
- }
- DataTable tbl_Jion = jdt.toObject( tbl.Rows[0]["Rmd_StrJion"].ToString().Trim() );
- for ( int i = 0; i < tbl_Jion.Rows.Count; i++ )
- {
- Label lbl = new Label();
- lbl.Name = tbl_Jion.Rows[i]["Name"].ToString().Trim();//Name
- lbl.Location = new Point( Convert.ToInt32( tbl_Jion.Rows[i]["LocationWidth"].ToString().Trim() ), Convert.ToInt32( tbl_Jion.Rows[i]["LocationHigh"].ToString().Trim() ) );//坐标
- //lbl.Tag = tbl_Jion.Rows[i]["Column"].ToString().Trim();//
- string StrText = "";
- if ( htData.ContainsKey( tbl_Jion.Rows[i]["Column"].ToString().Trim() ) && htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim().Length > 0 )
- {
- switch ( tbl_Jion.Rows[i]["Type"].ToString().Trim() )
- {
- case "NvarChar": StrText = htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim(); break;
- case "DateTime":
- if ( htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim() != "" )
- {
- StrText = Convert.ToDateTime( htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim() ).ToString( tbl_Jion.Rows[i]["DateFormat"].ToString().Trim() );
- }
- else { StrText = ""; }
- break;
- case "Decimal":
- if ( tbl_Jion.Rows[i]["ToUpper"].ToString().Trim() == "True" )
- {
- StrText = ConversionAmount( htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim() );
- }
- else
- {
- StrText = Convert.ToDecimal( htData[tbl_Jion.Rows[i]["Column"].ToString().Trim()].ToString().Trim() ).ToString( tbl_Jion.Rows[i]["MoneyFormat"].ToString().Trim() );
- }
- break;
- //case "Image":
- }
- }
- lbl.Text = StrText;
- if ( tbl_Jion.Rows[i]["Align"].ToString().Trim() == "Left" )
- {
- lbl.TextAlign = ContentAlignment.MiddleLeft;
- }
- else if ( tbl_Jion.Rows[i]["Align"].ToString().Trim() == "Right" )
- {
- lbl.TextAlign = ContentAlignment.MiddleRight;
- }
- lbl.Size = new Size( Convert.ToInt32( tbl_Jion.Rows[i]["SizeWidth"].ToString().Trim() ), Convert.ToInt32( tbl_Jion.Rows[i]["SizeHigh"].ToString().Trim() ) );
- lbl.Font = new Font( "微软雅黑", float.Parse( tbl_Jion.Rows[i]["FontSize"].ToString().Trim() ) );
- newpanel.Controls.Add( lbl );
- }
- //LYFZ.Software.MainBusiness.ReportPrint.SetSmallForm.PrintPreviewSmallForm PrintPreview = new ReportPrint.SetSmallForm.PrintPreviewSmallForm();
- //PrintPreview.setPrintPreviewControl(newpanel);
- //PrintPreview.ShowDialog();
- #region 打印
- Nowpanel = newpanel;
- PrintDocument ptDocument = new PrintDocument();
- ptDocument.PrintPage += ptDocument_PrintPage;
- PrintPreviewDialog MyPrintPreviewDialog = new PrintPreviewDialog();
- MyPrintPreviewDialog.Document = ptDocument;
- MyPrintPreviewDialog.ShowDialog();
- #endregion
- return "";
- }
- else { return "报表模板格式未设置"; }
- }
- return "报表模板不存在";
- }
- catch { return "生成模板时错误"; }
- }
- private Panel Nowpanel = new Panel();
- private void ptDocument_PrintPage( object sender, PrintPageEventArgs e )
- {
- Bitmap _NewBitmap = new Bitmap( Nowpanel.Width, Nowpanel.Height );
- Nowpanel.DrawToBitmap( _NewBitmap, new Rectangle( 0, 0, _NewBitmap.Width, _NewBitmap.Height ) );
- e.Graphics.DrawImage( _NewBitmap, 0, 0, _NewBitmap.Width, _NewBitmap.Height );
- }
- #region 金额转大写
- private static String[] Ls_ShZ = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖", "拾" };
- private static String[] Ls_DW_Zh = { "元", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "万" };
- private static String[] Num_DW = { "", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "万" };
- private static String[] Ls_DW_X = { "角", "分" };
- /// <summary>
- /// 接收文本框传来的值
- /// </summary>
- /// <param name="txt_Num"></param>
- /// <returns></returns>
- public static string ConversionAmount( string txt_Num )
- {
- Double iNum = 0.0;
- if ( Double.TryParse( txt_Num, out iNum ) == false )
- {
- return "非法的金额数字";
- }
- return NumGetStr( iNum );
- }
- /// <summary>
- /// 金额小写转中文大写。
- /// 整数支持到万亿;小数部分支持到分(超过两位将进行Banker舍入法处理)
- /// </summary>
- /// <param name="Num">需要转换的双精度浮点数</param>
- /// <returns>转换后的字符串</returns>
- private static String NumGetStr( Double Num )
- {
- Boolean iXSh_bool = false;//是否含有小数,默认没有(0则视为没有)
- Boolean iZhSh_bool = true;//是否含有整数,默认有(0则视为没有)
- string NumStr;//整个数字字符串
- string NumStr_Zh;//整数部分
- string NumSr_X = "";//小数部分
- string NumStr_DQ;//当前的数字字符
- string NumStr_R = "";//返回的字符串
- Num = Math.Round( Num, 2 );//四舍五入取两位
- //各种非正常情况处理
- if ( Num < 0 )
- return "不转换欠条";
- if ( Num > 9999999999999.99 )
- return "很难想象谁会有这么多钱!";
- if ( Num == 0 )
- return Ls_ShZ[0];
- //判断是否有整数
- if ( Num < 1.00 )
- iZhSh_bool = false;
- NumStr = Num.ToString();
- //默认只有整数部分
- NumStr_Zh = NumStr;
- //分开整数与小数处理
- if ( NumStr_Zh.Contains( "." ) )
- {
- NumStr_Zh = NumStr.Substring( 0, NumStr.IndexOf( "." ) );
- NumSr_X = NumStr.Substring( (NumStr.IndexOf( "." ) + 1), (NumStr.Length - NumStr.IndexOf( "." ) - 1) );
- iXSh_bool = true;
- }
- //判断是否含有小数部分
- if ( NumSr_X == "" || int.Parse( NumSr_X ) <= 0 )
- {
- iXSh_bool = false;
- }
- //整数部分处理
- if ( iZhSh_bool )
- {
- NumStr_Zh = Reversion_Str( NumStr_Zh );//反转字符串
- for ( int a = 0; a < NumStr_Zh.Length; a++ )
- {//整数部分转换
- NumStr_DQ = NumStr_Zh.Substring( a, 1 );
- if ( int.Parse( NumStr_DQ ) != 0 )
- NumStr_R = Ls_ShZ[int.Parse( NumStr_DQ )] + Ls_DW_Zh[a] + NumStr_R;
- else if ( a == 0 || a == 4 || a == 8 )
- {
- if ( NumStr_Zh.Length > 8 && a == 4 )
- continue;
- NumStr_R = Ls_DW_Zh[a] + NumStr_R;
- }
- else if ( int.Parse( NumStr_Zh.Substring( a - 1, 1 ) ) != 0 )
- NumStr_R = Ls_ShZ[int.Parse( NumStr_DQ )] + NumStr_R;
- }
- if ( !iXSh_bool )
- return NumStr_R + "整";
- //NumStr_R += "零";
- }
- //小数部分转换
- for ( int b = 0; b < NumSr_X.Length; b++ )
- {
- NumStr_DQ = NumSr_X.Substring( b, 1 );
- if ( int.Parse( NumStr_DQ ) != 0 )
- NumStr_R += Ls_ShZ[int.Parse( NumStr_DQ )] + Ls_DW_X[b];
- else if ( b != 1 && iZhSh_bool )
- NumStr_R += Ls_ShZ[int.Parse( NumStr_DQ )];
- }
- return NumStr_R;
- }
- /// <summary>
- /// 提供一个数字直接转大写(即不带单位)
- /// </summary>
- /// <param name="NumStr">需要转换的数字字符串</param>
- /// <param name="Dw">是否带单位</param>
- /// <returns>转换后的字符串</returns>
- public static String LowercaseGetCap( String NumStr, Boolean Dw )
- {
- String CapStr = "";
- String NumStr_LS;
- if ( NumStr == String.Empty )
- return String.Empty;
- if ( Dw )
- NumStr = Reversion_Str( NumStr );
- try
- {
- for ( Int32 c = 0; c < NumStr.Length; c++ )
- {
- NumStr_LS = NumStr.Substring( c, 1 );
- if ( Dw )
- {
- if ( int.Parse( NumStr_LS ) != 0 )
- CapStr = Ls_ShZ[int.Parse( NumStr_LS )] + Num_DW[c] + CapStr;
- else if ( c == 0 || c == 4 || c == 8 )
- {
- if ( NumStr_LS.Length > 8 && c == 4 )
- continue;
- CapStr = Num_DW[c] + CapStr;
- }
- else if ( int.Parse( NumStr.Substring( c - 1, 1 ) ) != 0 )
- CapStr = Ls_ShZ[int.Parse( NumStr_LS )] + CapStr;
- }
- else
- CapStr += Ls_ShZ[int.Parse( NumStr_LS )];
- }
- return CapStr;
- }
- catch ( Exception Err )
- {
- return "转换错误!" + Err.Message;
- }
- }
- /// <summary>
- /// 反转字符串
- /// </summary>
- /// <param name="Rstr">需要反转的字符串</param>
- /// <returns>反转后的字符串</returns>
- private static String Reversion_Str( String Rstr )
- {
- Char[] LS_Str = Rstr.ToCharArray();
- Array.Reverse( LS_Str );
- String ReturnSte = "";
- ReturnSte = new String( LS_Str );//反转字符串
- return ReturnSte;
- }
- #endregion
- }
- /// <summary>
- /// 报表列生成类
- /// </summary>
- public class ReportGenerationColumnClass
- {
- /// <summary>
- /// 列数据
- /// </summary>
- /// <param name="treeview"></param>
- /// <param name="Version"></param>
- /// <param name="ReportName"></param>
- public void Order_GenerationColumn( LYFZ.ComponentLibrary.TreeViewEx treeview, string Version, string ReportName )
- {
- string StrColumnText = "";
- string StrColumnName = "";
- string StrColumnType = "";
- if ( ReportName == "OrderReport" )
- {
- if ( Version == "Children" )
- {
- StrColumnText = "订单报表|订单号|家长姓名|宝贝姓名|家长电话|家长生日|宝贝生日|拍摄内容|引导师|家长性别|宝贝性别";//11列
- StrColumnName = "OrderReport|Ord_Number|Ord_CustomerName1|Ord_CustomerName2|Ord_CustomerTelephone1|Ord_CustomerBirthday1|Ord_CustomerBirthday2|Ord_TakenStages|Ord_BootDivision|Ord_CustomerSex1|Ord_CustomerSex2";
- StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar";
- }
- else if ( Version == "Wedding" )
- {
- StrColumnText = "订单报表|订单号|男宾姓名|女宾姓名|男宾电话|女宾电话|男宾生日|女宾生日|拍摄内容|男宾性别|女宾性别";//11列
- StrColumnName = "OrderReport|Ord_Number|Ord_CustomerName1|Ord_CustomerName2|Ord_CustomerTelephone1|Ord_CustomerTelephone2|Ord_CustomerBirthday1|Ord_CustomerBirthday2|Ord_TakenStages|Ord_CustomerSex1|Ord_CustomerSex2";
- StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar";
- }
- StrColumnText += "|会员卡号|定金|入底/入册|欠款|类别|来源|拍照|初修|选片|精修|设计|看设计|取件|预约时间|拍照时间|选片时间|看设计时间|取件时间|拍摄师|摄影助理|化妆师|化妆助理|初修师|选片师|精修师|设计师|看设计师|服装师|接单人|套系名称|套系价格|录单|折扣|授权|折扣后|授权后|订单备注|当前日期|打单人";//39
- StrColumnName += "|Ord_Mc_Number|Ord_Price|Ord_InBottomInBook|Ord_OrderArrears|Ord_PhotographyCategory|Ord_CustomerSource|Ord_PhotographyStatus|Ord_EarlyRepairStatus|Ord_FilmSelectionStatus|Ord_RefinementStatus|Ord_DesignerStatus|Ord_LookDesignStatus|Ord_TakePiecesStatus|Ord_AppointmentTime|Ord_PhotographyTime|Ord_FilmSelectionTime|Ord_DesignerTime|Ord_PickupDate|Ord_Photographer|Ord_PhotographyAssistant|Ord_MakeupArtist|Ord_MakeupAssistant|Ord_EarlyRepairName|Ord_FilmSelectionName|Ord_RefinementName|Ord_DesignerName|Ord_LookDesignName|Ord_ClothingName|Ord_OrdersPerson|Ord_SeriesName|Ord_SeriesPrice|Ord_EntryClerkName|Ord_Discount|Ord_Authorize|Ord_AfterDiscount|Ord_AfterAuthorize|Ord_Remark|Ord_NowDatetime|Ord_DetailsName";
- StrColumnType += "|NvarChar|Decimal|NvarChar|Decimal|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|DateTime|DateTime|DateTime|DateTime|DateTime|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|Decimal|NvarChar|Decimal|Decimal|Decimal|Decimal|NvarChar|DateTime|NvarChar";
- GenerationColumn( StrColumnText, StrColumnName, StrColumnType, treeview );
- }
- else if ( ReportName == "FinancePayment" )
- {
- if ( Version == "Children" )
- {
- StrColumnText = "收款凭据|订单号|家长姓名|宝贝姓名|家长电话|欠款|门市|";//11列
- StrColumnName = "OrderReport|Ord_Number|Ord_CustomerName1|Ord_CustomerName2|Ord_CustomerTelephone1|Ord_OrderArrears|Ord_OrdersPerson";
- StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|Decimal|NvarChar";
- }
- else if ( Version == "Wedding" )
- {
- StrColumnText = "收款凭据|订单号|男宾姓名|女宾姓名|男宾电话|女宾电话|欠款|门市";//11列
- StrColumnName = "OrderReport|Ord_Number|Ord_CustomerName1|Ord_CustomerName2|Ord_CustomerTelephone1|Ord_CustomerTelephone2|Ord_OrderArrears|Ord_OrdersPerson";
- StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|Decimal|NvarChar";
- }
- StrColumnText += "|开单人|收款人|收款金额|付款方式|收款项目|收款时间|收款类别";//39
- StrColumnName += "|Pay_OpenSingle|Pay_ThePayee|Pay_AmountOf|Pay_PaymentMethod|Pay_ReceivableProject|Pay_CreateDatetime|Pay_Category";
- StrColumnType += "|NvarChar|NvarChar|Decimal|NvarChar|NvarChar|DateTime|NvarChar";
- GenerationColumn( StrColumnText, StrColumnName, StrColumnType, treeview );
- }
- else if ( ReportName == "" )
- {
- }
- StrColumnText = "影楼信息|影楼名称|影楼店长|影楼电话|影楼传真|影楼网址|影楼地址|收款单标题|收款单说明|预约单说明|制作单说明|礼服单说明|二维码|影楼简介|影楼相册缩略图|影楼相册展示|景楼详情";
- StrColumnName = "PhotoStudio|Company_Name|Company_Manager|Company_Telephone|Company_Fax|Company_URL|Company_Address|Company_SingleTitle|Company_SingleExplanation|Company_ReservationExplanation|Company_ProductionNotes|Company_DressDescription|Company_DimensionalCode|Company_About|Company_PhotoThumbnail|Company_PhotoAlbum|Company_Detail";
- StrColumnType = "NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|NvarChar|Image|NvarChar|NvarChar|NvarChar|NvarChar";
- GenerationColumn( StrColumnText, StrColumnName, StrColumnType, treeview );
- }
- /// <summary>
- /// 写入列
- /// </summary>
- /// <param name="StrColumnText"></param>
- /// <param name="StrColumnName"></param>
- /// <param name="StrColumnType"></param>
- /// <param name="treeview"></param>
- private void GenerationColumn( string StrColumnText, string StrColumnName, string StrColumnType, LYFZ.ComponentLibrary.TreeViewEx treeview )
- {
- #region 创建列
- string[] ColumnText = StrColumnText.Split( '|' );
- string[] ColumnName = StrColumnName.Split( '|' );
- string[] ColumnType = StrColumnType.Split( '|' );
- int A = ColumnText.Length;
- int B = ColumnName.Length;
- int C = ColumnType.Length;
- System.Windows.Forms.TreeNode root = new System.Windows.Forms.TreeNode();
- root.Text = ColumnText[0].Trim();
- root.Tag = ColumnType[0].Trim();
- root.Name = ColumnName[0].Trim();
- for ( int i = 1; i < ColumnText.Length; i++ )
- {
- System.Windows.Forms.TreeNode node = new System.Windows.Forms.TreeNode();
- node.Text = ColumnText[i].Trim();
- node.Tag = ColumnType[i].Trim();
- node.Name = ColumnName[i].Trim();
- root.Nodes.Add( node );
- }
- treeview.Nodes.Add( root );
- #endregion
- }
- }
- /// <summary>
- /// 固定格式类
- /// </summary>
- public class ReportFixedFormat
- {
- static LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- static LYFZ.BLL.BLL_ErpPrinterSetNow pstnbll = new BLL.BLL_ErpPrinterSetNow();
- static LYFZ.BLL.BLL_ErpPrinterTemplateSet ptstbll = new BLL.BLL_ErpPrinterTemplateSet();
- public ReportFixedFormat()
- {
- }
- #region 调用事件
- /// <summary>
- /// 调用事件
- /// </summary>
- /// <param name="EnumType">打印类型</param>
- /// <param name="ObjValue">Obj值</param>
- /// <param name="EnumPrintType">打印机类型</param>
- public static void PrintFixedFormat( LYFZ.EnumPublic.PrintTypeEnum EnumType, object ObjValue, List<SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot = null, bool IsYuYueDan = true )
- {
- if (EnumType == EnumPublic.PrintTypeEnum.制作单明细)
- {
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintProductionList)
- {
-
- CameraControlBook.frmSelectProductionList frmSelectList = new CameraControlBook.frmSelectProductionList();
- frmSelectList.SelectPhoto= ((PhotoSelectSystem.EventSelectPhotoPrint)ObjValue);
- if (frmSelectList.SelectPhoto != null)
- {
- frmSelectList.OrderType = (LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), frmSelectList.SelectPhoto.CurrentModel.Ord_Type);
- if (frmSelectList.OrderType == EnumPublic.OrderType.儿童订单)
- {
- if (frmSelectList.ShowDialog() != DialogResult.OK)
- {
- return;
- }
- }
- }
- else {
- MessageBoxCustom.Show("传入参数不正确");
- return;
- }
- }
- }
- try
- {
- LYFZ.Software.MainBusiness.ReportPrint.SetSmallForm.PrintPreviewSmallForm frm = new ReportPrint.SetSmallForm.PrintPreviewSmallForm();
- frm.EnumType = EnumType;
- frm.ObjValue = ObjValue;
- frm.listScenicSpot = listScenicSpot;
- frm.IsYuYueDan = IsYuYueDan;
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- }
- catch (Exception ex){
- MessageBoxCustom.Show("打印预览时出错:"+ex.Message);
- }
- }
- /// <summary>
- /// 打印机设置匹配设置
- /// </summary>
- public static bool PrintInitialSetting()
- {
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpPrinterTemplateSet", StrWhere: "", ShowColumnName: "Count(ID) AS CountID" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpPrinterSetNow", StrWhere: "PrintSet_DividedShopNumber = '" + StrDividedShop + "'", ShowColumnName: "Count(ID) AS CountID" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];
- DataTable tbl1 = dtSet.Tables["ds1"];
- if ( Convert.ToInt32( tbl.Rows[0]["CountID"] ) > Convert.ToInt32( tbl1.Rows[0]["CountID"] ) )
- {
- List<LYFZ.Model.Model_ErpPrinterTemplateSet> mlistSet = ptstbll.GetModelList( "" );
- List<LYFZ.Model.Model_ErpPrinterSetNow> mlistNow = pstnbll.GetModelList( "PrintSet_DividedShopNumber = '" + StrDividedShop + "'" );
- DateTime StrTime = SDateTime.Now;
- LYFZ.Model.Model_ErpPrinterSetNow model = null;
- List<LYFZ.Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
- for ( int i = 0; i < mlistSet.Count; i++ )
- {
- bool isFind = false;
- for ( int j = 0; j < mlistNow.Count; j++ )
- {
- if ( mlistSet[i].TptSet_TemplateName == mlistNow[j].PrintSet_TemplateName )
- {
- isFind = true; break;
- }
- }
- if ( !isFind )
- {
- model = new Model.Model_ErpPrinterSetNow();
- model.PrintSet_DividedShopNumber = StrDividedShop;
- model.PrintSet_TemplateName = mlistSet[i].TptSet_TemplateName;
- model.PrintSet_PrintDefault = 0;
- model.PrintSet_MachineType = mlistSet[i].TptSet_MachineType;
- model.PrintSet_TemplateParentNumber = mlistSet[i].TptSet_TemplateParentNumber;
- model.PrintSet_PrintPath = "";
- model.PrintSet_PrintPathName = "";
- model.PrintSet_PrintSingleTitle = "";
- model.PrintSet_PrintSingleLOG = "";
- model.PrintSet_PrintOtherDataJson = "";
- model.PrintSet_CreateDatetime = StrTime;
- model.PrintSet_CreateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- clist.Add( pstnbll.GetAddCommandInfo( model ) );
- }
- }
- if ( clist.Count > 0 )
- {
- if ( LYFZ.BLL.BaseBllOperate.ExecuteSqlTran( clist ) <= 0 )
- {
- MessageBoxCustom.Show( "更新风格出错!" ); return false;
- }
- }
- }
- return true;
- }
- /// <summary>
- /// 产生随机数
- /// </summary>
- /// <returns></returns>
- private static string StrRandom( string OrdNumber )
- {
- bool IsAddRandom = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderNoSuffix;
- if ( IsAddRandom )
- {
- return OrdNumber + new Random().Next( 0, 9 ).ToString();
- }
- else { return OrdNumber; }
- }
- /// <summary>
- /// 判断是否为针式打印机
- /// </summary>
- /// <returns></returns>
- public static bool IsStylusPrinter( LYFZ.EnumPublic.PrinterPaperType PrinterType )
- {
- if ( PrinterType == LYFZ.EnumPublic.PrinterPaperType.针式纸 )
- {
- return true;
- }
- return false;
- }
- /// <summary>
- /// 是否横向打印
- /// </summary>
- /// <returns></returns>
- public static bool IsLandscapePrinter( string StrValue )
- {
- if ( StrValue == LYFZ.EnumPublic.PrintTypeEnum.库存采购单.ToString().Trim() ||
- StrValue == LYFZ.EnumPublic.PrintTypeEnum.库存采购验收单.ToString().Trim() )
- {
- return true;
- }
- return false;
- }
- /// <summary>
- /// 是否是小票打印
- /// </summary>
- /// <param name="StrName"></param>
- /// <returns></returns>
- public static bool IsSmallTicketPrinter( LYFZ.EnumPublic.PrinterPaperType PrinterType )
- {
- if ( PrinterType == LYFZ.EnumPublic.PrinterPaperType.小票纸 )
- return true;
- else
- return false;
- }
- /// <summary>
- /// 是否是A4打印
- /// </summary>
- /// <param name="StrName"></param>
- /// <returns></returns>
- public static bool IsA4Printer( LYFZ.EnumPublic.PrinterPaperType PrinterType )
- {
- if ( PrinterType == LYFZ.EnumPublic.PrinterPaperType.A4纸 )
- return true;
- else
- return false;
- }
- /// <summary>
- /// 是否是针式打印
- /// </summary>
- /// <param name="StrName"></param>
- /// <returns></returns>
- public static bool IsDotMatrixPrinter( LYFZ.EnumPublic.PrinterPaperType PrinterType )
- {
- if ( PrinterType == LYFZ.EnumPublic.PrinterPaperType.针式纸 )
- return true;
- else
- return false;
- }
- /// <summary>
- /// 打印时获取流水单号
- /// </summary>
- /// <returns></returns>
- static string PrintReceiptSerial()
- {
- DataTable dt = orbll.GetView_Custom( "tb_ErpSystemConfigure", StrWhere: "Sconfig_Code = 'PrintReceiptSerial'", ShowColumnName: "*" ).Tables[0];
- if ( dt.Rows.Count > 0 )
- {
- string SerialNo = (Convert.ToInt32( dt.Rows[0]["Sconfig_Value"] ) + 1).ToString( "d7" );
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.Model.Model_ErpSystemConfigure model = sgbll.DataRowToModel( dt.Rows[0] );
- model.Sconfig_Value = SerialNo;
- if ( sgbll.Update( model ) )
- {
- LYFZ.BLL.BLL_CurrentShopSetting cspsBll = new BLL.BLL_CurrentShopSetting( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- return (string.IsNullOrEmpty( cspsBll.Model.PrintOrdersPaymentPrefixName.PrintOrderPaymentPrefix ) ? "" : cspsBll.Model.PrintOrdersPaymentPrefixName.PrintOrderPaymentPrefix) + SerialNo;
- }
- else
- {
- MessageBoxCustom.Show( "修改票据序号失败,打印失败!" ); return "";
- }
- }
- else
- {
- MessageBoxCustom.Show( "获取票据序号错误,打印失败!" ); return "";
- }
- }
- /// <summary>
- /// 打印时获取流水单号
- /// </summary>
- /// <returns></returns>
- static string PrintReceiptSerial( string companyCode )
- {
- DataTable dt = orbll.GetView_Custom( "tb_ErpSystemConfigure", StrWhere: "Sconfig_Code = 'PrintReceiptSerial_" + companyCode + "'", ShowColumnName: "*" ).Tables[0];
- if ( dt.Rows.Count > 0 )
- {
- LYFZ.BLL.BLL_CurrentShopSetting cspsBll = new BLL.BLL_CurrentShopSetting( companyCode );
- string SerialNo = string.Format( "{0:0000000}", Convert.ToInt32( dt.Rows[0]["Sconfig_Value"] ) + 1 );
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.Model.Model_ErpSystemConfigure model = sgbll.DataRowToModel( dt.Rows[0] );
- model.Sconfig_Value = SerialNo;
- if ( sgbll.Update( model ) )
- {
- return (string.IsNullOrEmpty( cspsBll.Model.PrintOrdersPaymentPrefixName.PrintOrderPaymentPrefix ) ? "" : cspsBll.Model.PrintOrdersPaymentPrefixName.PrintOrderPaymentPrefix) + SerialNo;
- }
- else
- {
- MessageBoxCustom.Show( "修改票据序号失败,打印失败!" ); return "";
- }
- }
- else
- {
- MessageBoxCustom.Show( "获取票据序号错误,打印失败!" ); return "";
- }
- }
- /// <summary>
- /// 获取画笔粗细度_针式纸
- /// </summary>
- static Pen GetPen
- {
- get
- {
- return new Pen( Brushes.Black, 1 );
- }
- }
- /// <summary>
- /// 当前本地接单点ID
- /// </summary>
- static string StrDividedShop
- {
- get
- {
- return LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID();
- }
- }
- /// <summary>
- /// 小票打印时要打印几份
- /// </summary>
- public static int PrintPageCount
- {
- get
- {
- int PageCount = LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.TicketPrintingNumber;
- if ( PageCount < 1 )
- {
- PageCount = 1;
- }
- else if ( PageCount > 3 )
- {
- PageCount = 3;
- }
- return PageCount;
- }
- }
- private static string _defaultPrintTitle = "";
- /// <summary>
- /// 默认打印标题
- /// </summary>
- public static string DefaultPrintTitle
- {
- set
- {
- _defaultPrintTitle = value;
- }
- get
- {
- return _defaultPrintTitle;
- }
- }
- private static Hashtable _printOtherData = new Hashtable();
- /// <summary>
- /// 打印设置的其他数据
- /// 参数所有Key分别有:预约单注意事项说明、制作单说明、礼服单说明、收款单说明、预约LOG
- /// </summary>
- public static Hashtable PrintOtherData
- {
- set
- {
- _printOtherData = value;
- }
- get
- {
- return _printOtherData;
- }
- }
- private static int _printForCount = 0;
- /// <summary>
- /// 打印分多页里,记录循环到的行数
- /// </summary>
- public static int PrintForCount
- {
- set
- {
- _printForCount = value;
- }
- get
- {
- return _printForCount;
- }
- }
- private static int _printCurrentIndexPage = 1;
- /// <summary>
- /// 当前打印到第几页
- /// </summary>
- public static int PrintCurrentIndexPage
- {
- set
- {
- _printCurrentIndexPage = value;
- }
- get
- {
- return _printCurrentIndexPage;
- }
- }
- private static bool _isHasMorePages = false;
- /// <summary>
- /// 打印时,是否要附加下一页(意指是否要打下一页)
- /// </summary>
- public static bool IsHasMorePages
- {
- set
- {
- _isHasMorePages = value;
- }
- get
- {
- return _isHasMorePages;
- }
- }
- /// <summary>
- /// 遍历打印其他设置的Value
- /// </summary>
- /// <param name="StrPrintOtherDataJson">其他设置Json串</param>
- /// <param name="StrPrintOtherDataJson">要查找的Key</param>
- /// <returns></returns>
- public static string StrPrintOtherDataJson_Traverse_ArrayList( string StrPrintOtherDataJson, string StrKey )
- {
- string StrReturnValue = "";
- if ( StrPrintOtherDataJson != "" )
- {
- if ( StrPrintOtherDataJson.Trim().IndexOf( StrKey ) != -1 )
- {
- string[] strArray = StrPrintOtherDataJson.Trim().Split( '∥' );
- for ( int i = 0; i < strArray.Length; i++ )
- {
- if ( strArray[i].Trim() != "" )
- {
- if ( strArray[i].Trim().Split( '‖' )[0].Trim() == StrKey )
- {
- StrReturnValue = strArray[i].Trim().Split( '‖' )[1].Trim();
- }
- }
- }
- }
- }
- return StrReturnValue;
- }
- #endregion
- #region 收款打印
- #region 订单收款
- /// <summary>
- /// 订单收款
- /// </summary>
- /// <param name="panl"></param>
- public static void FixedFormat_OrderPayment_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string strNumber = htData["strNumber"].ToString().Trim();
- BLL.BLL_ErpMemberCard bllMember = new BLL.BLL_ErpMemberCard();
- List<string> usNumber = new List<string>();
- for ( int i = 0; i < dgvData.SelectedRows.Count; i++ )
- {
- DataRow dr = dgvData.SelectedRows[i].Tag as DataRow;
- if ( dr != null )
- {
- if ( !string.IsNullOrEmpty( Convert.ToString( dr["Pay_McNumber"] ) ) )
- {
- usNumber.Add( Convert.ToString( dr["Pay_McNumber"] ) );
- }
- }
- }
- string memberDisInfo = "";
- DataTable tableMember = bllMember.GetList( " Mc_Number in ('" + string.Join( "','", usNumber.ToArray() ) + "') " ).Tables[0];
- for ( int i = 0; i < tableMember.Rows.Count; i++ )
- {
- if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberBalance )
- {
- memberDisInfo += "[会员卡" + tableMember.Rows[i]["MC_CradNumber"] + " 的余额:" + tableMember.Rows[i]["mc_money"] + "]";
- }
- }
- List<Image> imglist = new List<Image>();
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
- string StrColumnName = "Ord_Type,CASE Ord_SinceOrderNumber WHEN '' THEN Ord_Number ELSE Ord_SinceOrderNumber END AS 订单号,Ord_SeriesPrice AS 套系名称,Cus_Name AS 客户姓名,Cus_Telephone AS 客户电话,M_Cus_Name AS 主客户姓名,M_Cus_Telephone AS 主客户电话," +
- "(select top 1 OrdPe_OrdersPerson from tb_ErpOrdersPerson where OrdPe_OrderNumber = Ord_Number And OrdPe_Type = 0) AS 门市编号";
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpOrder left join tempTB_AggregationCustomer on tb_ErpOrder.Ord_Number = GP_OrderNumber", StrWhere: "Ord_Number = '" + strNumber + "'", ShowColumnName: StrColumnName );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpPrinterSetNow", StrWhere: "PrintSet_TemplateParentNumber = '" + Convert.ToInt32( LYFZ.EnumPublic.PrintTypeEnum.订单收款 ) + "' And PrintSet_MachineType = '" + Convert.ToInt32( LYFZ.EnumPublic.PrinterPaperType.针式纸 ) + "'", ShowColumnName: "PrintSet_PrintOtherDataJson" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tbl2 = dtSet.Tables["ds1"];//订单
- DataTable tbl3 = dtSet.Tables["ds2"];//打印设置
- DataTable dt = new DataTable();
- if ( !string.IsNullOrEmpty( tbl2.Rows[0]["门市编号"].ToString().Trim() ) )
- {
- dt = orbll.GetView_Custom( "tb_ErpUser", StrWhere: "User_EmployeeID = '" + tbl2.Rows[0]["门市编号"].ToString().Trim() + "'", ShowColumnName: "User_Name,User_Telephone,User_PhonePrint" ).Tables[0];
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = "NO." + StrRandom( tbl2.Rows[0]["订单号"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
-
- //g.DrawString("白\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账", ft11, b, new Rectangle(TableWidth, rec2.Y + 35, 20, 300));
- if (IsPrintSerialNo)
- {
- string strPrintNumber = "";
- for (int i = 0; i < dgvData.SelectedRows.Count; i++)
- {
- if (string.IsNullOrEmpty(strPrintNumber))
- {
- strPrintNumber += ",";
- }
- strPrintNumber += dgvData.SelectedRows[i].Cells[0].Value.ToString_s();
- }
- strPrintNumber = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID + strNumber + strPrintNumber;
- #region 记录打印流水号
- BLL.BLL_ErpSystemConfigure _ErpSystemConfigure = new BLL.BLL_ErpSystemConfigure();
- Model.Model_ErpSystemConfigure model_ErpConfigure = new Model.Model_ErpSystemConfigure();
- if (_ErpSystemConfigure.Exists("Sconfig_Code", "PrintSerialNoLogs"))
- {
- model_ErpConfigure = _ErpSystemConfigure.GetModel("PrintSerialNoLogs");
- }
- string allText = model_ErpConfigure.Sconfig_Value;
- bool bCheck = false;
- string SerialNo = "";
- try
- {
- string[] tempStrs = allText.Split('\t');
- if (tempStrs.Length == 2)
- {
- if (tempStrs[0].ToLower() == strPrintNumber.ToLower())
- {
- if (tempStrs[1].IndexOf("\r") == -1&& tempStrs[1].IndexOf("\n") == -1)
- {
- SerialNo = tempStrs[1];
- if (!string.IsNullOrEmpty(SerialNo))
- {
- bCheck = true;
- }
- }
- }
- }
- }
- catch { }
-
- #endregion
- if ( !bCheck )
- {
- SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- strPrintNumber = strPrintNumber + "\t" + SerialNo;
- if ( !_ErpSystemConfigure.Exists( "Sconfig_Code", "PrintSerialNoLogs" ) )
- {
- Model.Model_ErpSystemConfigure model_ErpSystem = new Model.Model_ErpSystemConfigure()
- {
- Sconfig_Code = "PrintSerialNoLogs",
- Sconfig_Name = "订单打印流水记录",
- Sconfig_CreateDatetime = DateTime.Now
- };
- _ErpSystemConfigure.Add( model_ErpSystem );
- }
- model_ErpConfigure = _ErpSystemConfigure.GetModel( "PrintSerialNoLogs" );
- model_ErpConfigure.Sconfig_Value = strPrintNumber; //+ "\r\n" + model_ErpConfigure.Sconfig_Value;
- _ErpSystemConfigure.Update( model_ErpConfigure );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- g.DrawString("白\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账", new Font("宋体",7), b, new Rectangle(TableWidth+60, rec4.Y + 28, 20, 300));
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- if ( dt.Rows.Count > 0 )
- {
- if ( !Convert.ToBoolean( dt.Rows[0]["User_PhonePrint"].ToString() ) )
- StrTelephone += " 门市:" + dt.Rows[0]["User_Name"].ToString().Trim() + "[" + tbl.Rows[0]["Company_Telephone"].ToString().Trim() + "]";
- else
- StrTelephone += " 门市:" + dt.Rows[0]["User_Name"].ToString().Trim() + "[" + dt.Rows[0]["User_Telephone"].ToString().Trim() + "]";
- }
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = tbl2.Rows[0]["主客户姓名"].ToString().Trim();
- string StrPhone = tbl2.Rows[0]["主客户电话"].ToString().Trim();
- if ( tbl2.Rows[0]["Ord_Type"].ToString().Trim() != "2" )
- {
- StrName = tbl2.Rows[0]["客户姓名"].ToString().Trim();
- StrPhone = tbl2.Rows[0]["客户电话"].ToString().Trim();
- }
- StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + StrName + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 16;
- int ColumnWidth2 = 90;
- int ColumnWidth3 = 70;
- int ColumnWidth4 = 90;
- int ColumnWidth5 = 60;
- int ColumnWidth6 = 75;
- int ColumnWidth1 = TableWidth - ColumnWidth5 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth6;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 支付方式
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 接单人
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
- #endregion
- #region 收 银
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
- Point p5_1 = new Point( p4_1.X + ColumnWidth5, rec9.Y );
- Point p5_2 = new Point( p4_1.X + ColumnWidth5, rec9.Y + rec9.Height );
- g.DrawLine( p, p5_1, p5_2 );//画第四表与第五列的界线
- #endregion
- #region 收款日期
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "付款日期" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_6 = new Rectangle( p5_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_6 );//画第五列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal ActualAmount = 0;//实付金额
- decimal ActualOrd_Amount = 0;//实付订单金额
- decimal Actualsale_Amount = 0;//实付二销金额
- #region 画列表每行
- int ForCount = 0;
- string strRemark = "";
- int PageRows = 3;//每页多少行
- decimal DiscountAmount = 0;
- for ( int i = 0; i < PageRows; i++ )
- {
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- string recfor_5Value = "";
- string recfor_6Value = "";
- if ( ForCount < dgvData.SelectedRows.Count )
- {
- if ( !string.IsNullOrEmpty( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value.ToString().Trim() ) )
- {
- if ( Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value ) > 0 )
- {
- DiscountAmount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value );
- }
- }
- recfor_1Value = dgvData.SelectedRows[ForCount].Cells["Pay_ReceivableProject"].Value.ToString().Trim() != "" ? dgvData.SelectedRows[ForCount].Cells["Pay_ReceivableProject"].Value.ToString().Trim() : dgvData.SelectedRows[ForCount].Cells["Pay_Category"].Value.ToString().Trim();//收款项目
- if ( recfor_1Value == "预约收款" )
- {
- string StrTextValue = StrPrintOtherDataJson_Traverse_ArrayList( tbl3.Rows[0]["PrintSet_PrintOtherDataJson"].ToString().Trim(), "预约收款显示名称" );
- if ( !string.IsNullOrEmpty( StrTextValue ) )
- {
- recfor_1Value = StrTextValue;
- }
- }
- recfor_2Value = dgvData.SelectedRows[ForCount].Cells["Pay_PaymentMethod"].Value.ToString().Trim();
- recfor_3Value = dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value.ToString().Trim();
- recfor_4Value = dgvData.SelectedRows[ForCount].Cells["Pay_OpenSingle"].Value.ToString().Trim();
- recfor_5Value = dgvData.SelectedRows[ForCount].Cells["Pay_ThePayee"].Value.ToString().Trim();
- recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[ForCount].Cells["Pay_CreateDatetime"].Value );
- if ( dgvData.SelectedRows[ForCount].Cells["Pay_Remark"].Value != null )
- {
- strRemark += dgvData.SelectedRows[ForCount].Cells["Pay_Remark"].Value.ToString().Trim() + ";";
- }
- if ( recfor_1Value.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.全款.ToString() || recfor_1Value.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.后期收款.ToString() ||
- recfor_1Value.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.预约补款.ToString() || recfor_1Value.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.预约收款.ToString() )
- {
- ActualOrd_Amount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value );
- }
- else
- {
- Actualsale_Amount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value );
- }
- ForCount++;
- }
- int forHeightCount = RowHeight;
- if ( Convert.ToInt32( g.MeasureString( recfor_1Value, ft10, ColumnWidth1 ).Height ) > Convert.ToInt32( g.MeasureString( "项目", ft10, ColumnWidth1 ).Height ) )
- {
- if ( i < PageRows )
- {
- forHeightCount = RowContentHeight * 2 + 7;
- i++;
- }
- }
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, forHeightCount );
- g.DrawRectangle( p, recfor );//画标题矩形
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, recfor.Height - AddTop * 2 );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, recfor_1.Y, ColumnWidth2, recfor_1.Height );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, recfor_1.Y, ColumnWidth3, recfor_1.Height );
- g.DrawString( StrValue, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, recfor_1.Y, ColumnWidth4, recfor_1.Height );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
- Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, recfor_1.Y, ColumnWidth5, recfor_1.Height );
- g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
- Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
- Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor5_1, pfor5_2 );//画第四表与第五列的界线
- Rectangle recfor_6 = new Rectangle( pfor5_1.X + AddLeft, recfor_1.Y, ColumnWidth6, recfor_1.Height );
- g.DrawString( recfor_6Value, ft10, b, recfor_6 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- ActualAmount = (ActualOrd_Amount + Actualsale_Amount);
- Rectangle rec9_A = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9_A );//画标题矩形
- sizef = g.MeasureString( "说 明:", ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_A1 = new Rectangle( rec9.X + AddLeft, rec9_A.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "说 明:" ), ft11, b, rec9_A1 );//画第三列的列标题
- Rectangle rec9_A2 = new Rectangle( rec9_A1.Location.X + FtWidth, rec9_A1.Location.Y, rec9_A1.Width - FtWidth, rec9_A1.Height );
- g.DrawString( strRemark.TrimEnd( ';' ) + memberDisInfo, ft10, b, rec9_A2 );//画第三列的列标题
- Rectangle rec10 = new Rectangle( rec9.X, rec9_A.Y + rec9_A.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- #endregion
- #region 应付
- int FocCount = 4;
- if ( DiscountAmount > 0 )
- {
- FocCount = 5;
- }
- Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + htData["CopeAmount"].ToString().Trim(), ft11, b, rec10_2 );//应付
- #endregion
- #region 实付
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + (ActualAmount - DiscountAmount).ToString(), ft11, b, rec10_3 );//实付
- #endregion
- #region 欠款
- Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + htData["Arrear"].ToString().Trim(), ft11, b, rec10_4 );//欠款
- #endregion
- #region 优惠
- if ( DiscountAmount > 0 )
- {
- Rectangle rec10_5 = new Rectangle( rec10_4.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "优惠:" ) + DiscountAmount, ft11, b, rec10_5 );//欠款
- }
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- }
- #endregion
- #region 散客消费
- /// <summary>
- /// 其他二销
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_OtherConsumption_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string strText = htData["strText"].ToString().Trim();
- string[] ObjStr = strText.Split( '|' );
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpTwoSalesOrder", StrWhere: "Tsorder_Number = '" + ObjStr[0].Trim() + "'" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- //获取订单信息
- DataTable tbl2 = dtSet.Tables["ds1"];
- if ( tbl2.Rows.Count == 0 )
- {
- MessageBoxCustom.Show( "订单不存在" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- // 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- int TableWidth = size.Width - rec1.X * 2 - 14;
- // 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width );
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- // NO.
- string rec3Value = "NO." + StrRandom( tbl2.Rows[0]["Tsorder_Number"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 3;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- // 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- // 客户姓名
- string StrName = "";
- // 联系电话
- string StrPhone = "";
- if ( tbl2.Rows[0]["Tsorder_CustomerName"].ToString().Trim() != "" )
- {
- StrName = tbl2.Rows[0]["Tsorder_CustomerName"].ToString().Trim();
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- if ( tbl2.Rows[0]["Tsorder_Telephone"].ToString().Trim() != "" )
- {
- StrPhone = tbl2.Rows[0]["Tsorder_Telephone"].ToString().Trim();
- }
- }
- else
- {
- DataTable tblClient = orbll.GetView_Custom( "tb_ErpCustomer", StrWhere: "Cus_CustomerNumber = '" + tbl2.Rows[0]["Tsorder_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Cus_Name,Cus_Telephone" ).Tables[0];
- if ( tblClient.Rows.Count > 0 )
- {
- StrName = tblClient.Rows[0]["Cus_Name"].ToString().Trim();
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- StrPhone = tblClient.Rows[0]["Cus_Telephone"].ToString().Trim();
- }
- }
- StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + StrName + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- // 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth2 = 90;
- int ColumnWidth3 = 70;
- int ColumnWidth4 = 90;
- int ColumnWidth5 = 60;
- int ColumnWidth6 = 75;
- int ColumnWidth1 = TableWidth - ColumnWidth5 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth6;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- // 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- // 支付方式
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- // 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- // 接单人
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
- // 收 银
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
- Point p5_1 = new Point( p4_1.X + ColumnWidth5, rec9.Y );
- Point p5_2 = new Point( p4_1.X + ColumnWidth5, rec9.Y + rec9.Height );
- g.DrawLine( p, p5_1, p5_2 );//画第四表与第五列的界线
- // 收款日期
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "付款日期" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_6 = new Rectangle( p5_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_6 );//画第五列的列标题
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal Uppercase = 0;
- int ForCount = 0;
- int PageRows = 3;//每页多少行
- decimal DiscountAmount = 0;
- string strRemark = "";
- #region 画列表每行
- for ( int i = 0; i < PageRows; i++ )
- {
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- string recfor_5Value = "";
- string recfor_6Value = "";
- if ( ForCount < dgvData.SelectedRows.Count )
- {
- if ( !string.IsNullOrEmpty( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value.ToString().Trim() ) )
- {
- if ( Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value ) > 0 )
- {
- DiscountAmount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["DiscountAmount"].Value );
- }
- }
- recfor_1Value = dgvData.SelectedRows[ForCount].Cells["Pay_ReceivableProject"].Value.ToString().Trim() != "" ? dgvData.SelectedRows[ForCount].Cells["Pay_ReceivableProject"].Value.ToString().Trim() : dgvData.SelectedRows[ForCount].Cells["Pay_Category"].Value.ToString().Trim();//收款项目
- recfor_2Value = dgvData.SelectedRows[ForCount].Cells["Pay_PaymentMethod"].Value.ToString().Trim();
- recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value ).ToString( "0.00" ).Trim();
- recfor_4Value = dgvData.SelectedRows[ForCount].Cells["Pay_OpenSingle"].Value.ToString().Trim();
- recfor_5Value = dgvData.SelectedRows[ForCount].Cells["Pay_ThePayee"].Value.ToString().Trim();
- recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[ForCount].Cells["Pay_CreateDatetime"].Value );
- Uppercase += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["Pay_AmountOf"].Value );
- strRemark += dgvData.SelectedRows[ForCount].Cells["Pay_Remark"].Value.ToString().Trim() + ";";
- ForCount++;
- }
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
- Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
- g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
- Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
- Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor5_1, pfor5_2 );//画第四表与第五列的界线
- Rectangle recfor_6 = new Rectangle( pfor5_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth6, RowContentHeight );
- g.DrawString( recfor_6Value, ft10, b, recfor_6 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec9_A = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9_A );//画标题矩形
- sizef = g.MeasureString( "说 明:", ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_A1 = new Rectangle( rec9.X + AddLeft, rec9_A.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "说 明:" ), ft11, b, rec9_A1 );//画第三列的列标题
- Rectangle rec9_A2 = new Rectangle( rec9_A1.Location.X + FtWidth, rec9_A1.Location.Y, rec9_A1.Width - FtWidth, rec9_A1.Height );
- g.DrawString( strRemark.TrimEnd( ';' ), ft10, b, rec9_A2 );//画第三列的列标题
- Rectangle rec10 = new Rectangle( rec9_A.X, rec9_A.Y + rec9_A.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- // 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- // 应付
- int FocCount = 4;
- if ( DiscountAmount > 0 )
- {
- FocCount = 5;
- }
- Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + ObjStr[1].Trim(), ft11, b, rec10_2 );//应付
- // 实付
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + Convert.ToDecimal( Uppercase ).ToString( "0.00" ), ft11, b, rec10_3 );//实付//ObjStr[2].Trim()
- // 欠款
- Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + ObjStr[3].Trim(), ft11, b, rec10_4 );//欠款
- // 优惠
- if ( DiscountAmount > 0 )
- {
- Rectangle rec10_5 = new Rectangle( rec10_4.X + (TableWidth / FocCount), rec10.Y + AddTop2, TableWidth / FocCount, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "优惠:" ) + DiscountAmount, ft11, b, rec10_5 );//欠款
- }
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- // 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( Uppercase.ToString() ), ft11, b, rec11_1 );//合计人民币
- // 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- // 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- }
- #endregion
- #region 店面、现金支出
- /// <summary>
- /// 店面、现金支出
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_CashOutlay_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- List<Image> imglist = new List<Image>();
- //获取影楼信息
- DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" ).Tables[0];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年支出单
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 30;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = "";
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec1.Y + rec1.Height + FtHeight - 47, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 支付人
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "支付人:" ) + dgvData.SelectedRows[0].Cells["取款人"].Value.ToString().Trim();
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth2 = 120;
- int ColumnWidth3 = 90;
- int ColumnWidth5 = 80;
- int ColumnWidth6 = 120;
- int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth5 - ColumnWidth6;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 支出项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "支出项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 支付方式
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_2 );//画第三列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第三表与第四列的界线
- #endregion
- #region 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 经手人
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "经手人" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_5 = new Rectangle( p3_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth5, rec9.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth5, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第三表与第四列的界线
- #endregion
- #region 支出日期
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "支出日期" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_6 = new Rectangle( p4_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_6 );//画第五列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal ActualAmount = 0;//实付金额
- #region 画列表每行
- int ForCount = 0;
- int PageRows = 4;//每页多少行
- for ( int i = 0; i < PageRows; i++ )
- {
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_5Value = "";
- string recfor_6Value = "";
- if ( ForCount < dgvData.SelectedRows.Count )
- {
- recfor_1Value = dgvData.SelectedRows[ForCount].Cells["费用项目"].Value.ToString().Trim() +
- (dgvData.SelectedRows[ForCount].Cells["支出说明"].Value.ToString().Trim() == "" ? "" : "(" + dgvData.SelectedRows[ForCount].Cells["支出说明"].Value.ToString().Trim() + ")");//收款项目
- recfor_2Value = dgvData.SelectedRows[ForCount].Cells["支出方式"].Value.ToString().Trim();//收款项目
- recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["费用金额"].Value ).ToString( "0.00" ).Trim();
- recfor_5Value = dgvData.SelectedRows[ForCount].Cells["录单人"].Value.ToString().Trim();
- recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString2( dgvData.SelectedRows[ForCount].Cells["支出日期"].Value );
- ActualAmount += Convert.ToDecimal( dgvData.SelectedRows[ForCount].Cells["费用金额"].Value );
- ForCount++;
- }
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + ColumnWidth2 - FtWidth - AddLeft * 2, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第三列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第三表与第四列的界线
- sizef = g.MeasureString( recfor_3Value, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_5 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth5, RowContentHeight );
- g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth5, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth5, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第三表与第四列的界线
- Rectangle recfor_6 = new Rectangle( pfor4_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth6, RowContentHeight );
- g.DrawString( recfor_6Value, ft10, b, recfor_6 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- decimal CopeAmount = ActualAmount;//总额
- Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "支出情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- #endregion
- #region 应付
- Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总额:" ) + CopeAmount.ToString(), ft11, b, rec10_2 );//应付
- #endregion
- #region 实付
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + ActualAmount.ToString(), ft11, b, rec10_3 );//实付
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支款人签字:" ), ft11, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- }
- #endregion
- #region 其它收入
- /// <summary>
- /// 其它收入
- /// </summary>
- /// <param name="panl"></param>
- #if IGNORE
- public static void PaymentPrint_OtherIncome_Print(object objValue, Graphics g, Size size, bool IsPrintSerialNo)
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- //获取影楼信息
- DataTable tbl = orbll.GetView_Custom("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime").Tables[0];
- if (tbl.Rows.Count <= 0)
- { MessageBoxCustom.Show("未设置影楼信息"); return; }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font("宋体", 16);
- Font ft11 = new Font("宋体", 10);
- Font ft10 = new Font("宋体", 9);
- Font ft9 = new Font("宋体", 9);
- #region LOG
- // 二维码
- Image img = CachePhoto(PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"]);
- Rectangle rec1 = new Rectangle(50, 25, 90, 90);
- if (img != null)
- { g.DrawImage(img, rec1); }
- int TableWidth = size.Width - rec1.X * 2 - 14;
- // 金色童年收据凭据
- SizeF sizef = g.MeasureString(DefaultPrintTitle, ft16);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2 = new Rectangle((size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight);
- g.DrawString(DefaultPrintTitle, ft16, b, rec2);
- #region NO.
- string rec3Value = "";
- if (IsPrintSerialNo)
- {
- string SerialNo = PrintReceiptSerial();
- if (LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition)
- {
- SerialNo = PrintReceiptSerial(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID);
- }
- if (string.IsNullOrEmpty(SerialNo))
- { MessageBoxCustom.Show("获取流水单号失败!"); return; }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString(rec3Value, ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec3A = new Rectangle(size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight);
- g.DrawString(rec3Value, ft11, b, rec3A);
- }
- #endregion
- // 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString(StrAddress, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec4 = new Rectangle(rec1.X + rec1.Width - 5, rec1.Y + rec1.Height + FtHeight - 47, TableWidth - rec1.Width + 14, FtHeight);
- g.DrawString(StrAddress, ft10, b, rec4);
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle(rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight);
- g.DrawString(StrTelephone, ft10, b, rec4A);
- // 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名:") + dgvData.CurrentRow.Cells["付款人"].Value.ToString().Trim();
- sizef = g.MeasureString(StrName, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec6 = new Rectangle(rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight);
- g.DrawString(StrName, ft10, b, rec6);
- // 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印日期:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy年MM月dd日");
- sizef = g.MeasureString(StrDate, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec8 = new Rectangle(TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight);
- g.DrawString(StrDate, ft10, b, rec8);
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth3 = 120;
- int ColumnWidth5 = 120;
- int ColumnWidth6 = 100;
- int ColumnWidth1 = TableWidth - ColumnWidth3 - ColumnWidth5 - ColumnWidth6;
- Rectangle rec9 = new Rectangle(rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight);
- g.DrawRectangle(p, rec9);//画标题矩形
- #region 标题
- // 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion("收款项目");
- sizef = g.MeasureString(StrValue, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec9_1 = new Rectangle(rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight);
- g.DrawString(StrValue, ft11, b, rec9_1);//画第一列的列标题
- Point p1_1 = new Point(rec9.X + ColumnWidth1, rec9.Y);
- Point p1_2 = new Point(rec9.X + ColumnWidth1, rec9.Y + rec9.Height);
- g.DrawLine(p, p1_1, p1_2);//画第一表与第二列的界线
- // 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion("金 额");
- sizef = g.MeasureString(StrValue, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec9_3 = new Rectangle(p1_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight);
- g.DrawString(StrValue, ft11, b, rec9_3);//画第三列的列标题
- Point p3_1 = new Point(p1_1.X + ColumnWidth3, rec9.Y);
- Point p3_2 = new Point(p1_1.X + ColumnWidth3, rec9.Y + rec9.Height);
- g.DrawLine(p, p3_1, p3_2);//画第三表与第四列的界线
- // 收 银
- Rectangle rec9_5 = new Rectangle(p3_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收 银"), ft11, b, rec9_5);//画第五列的列标题
- Point p4_1 = new Point(p3_1.X + ColumnWidth5, rec9.Y);
- Point p4_2 = new Point(p3_1.X + ColumnWidth5, rec9.Y + rec9.Height);
- g.DrawLine(p, p4_1, p4_2);//画第三表与第四列的界线
- // 收款日期
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion("付款日期");
- sizef = g.MeasureString(StrValue, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec9_6 = new Rectangle(p4_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight);
- g.DrawString(StrValue, ft11, b, rec9_6);//画第五列的列标题
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal CopeAmount = 0;//应付金额
- decimal ActualAmount = 0;//实付金额
- #endregion
- #region 画内容
- int ForCount = 0;
- int PageRows = 4;//每页多少行
- // 画列表每行
- for (int i = 0; i < PageRows; i++)
- {
- string recfor_1Value = "";
- string recfor_3Value = "";
- string recfor_5Value = "";
- string recfor_6Value = "";
- if (ForCount < dgvData.SelectedRows.Count)
- {
- recfor_1Value = dgvData.SelectedRows[i].Cells["项目名称"].Value.ToString().Trim();//收款项目
- recfor_3Value = Convert.ToDecimal(dgvData.SelectedRows[i].Cells["项目金额"].Value).ToString("0.00").Trim();
- recfor_5Value = dgvData.SelectedRows[i].Cells["录单人"].Value.ToString().Trim();
- recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString(dgvData.SelectedRows[i].Cells["收入时间"].Value);
- ActualAmount += Convert.ToDecimal(dgvData.SelectedRows[i].Cells["项目金额"].Value);
- ForCount++;
- }
- int forHeightCount = RowHeight;
- int Height1 = Convert.ToInt32(g.MeasureString(recfor_1Value, ft10, ColumnWidth1).Height);
- int Height2 = Convert.ToInt32(g.MeasureString("项目", ft10, ColumnWidth1).Height);
- int HeightCount = Height1 / Height2;
- if ((Height1 % Height2) > 0)
- { HeightCount++; }
- if (HeightCount > 1)
- {
- if (i < PageRows)
- {
- forHeightCount = Height1 + AddTop + 3;
- i = i + (HeightCount - 1);
- }
- }
- Rectangle recfor = new Rectangle(IntPoint_X, IntPoint_Y, TableWidth, forHeightCount);
- g.DrawRectangle(p, recfor);//画标题矩形
- Rectangle recfor_1 = new Rectangle(recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, Height1);
- g.DrawString(recfor_1Value, ft10, b, recfor_1);//画第一列的列标题
- Point pfor1_1 = new Point(recfor_1.X + ColumnWidth1 - 3, recfor.Y);
- Point pfor1_2 = new Point(recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height);
- g.DrawLine(p, pfor1_1, pfor1_2);//画第一表与第二列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString(StrValue, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle recfor_3 = new Rectangle(pfor1_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor1_1.Y + AddTop, ColumnWidth3, recfor_1.Height);
- g.DrawString(recfor_3Value, ft10, b, recfor_3);//画第三列的列标题
- Point pfor3_1 = new Point(pfor1_1.X + ColumnWidth3, recfor.Y);
- Point pfor3_2 = new Point(pfor1_1.X + ColumnWidth3, recfor.Y + recfor.Height);
- g.DrawLine(p, pfor3_1, pfor3_2);//画第三表与第四列的界线
- Rectangle recfor_5 = new Rectangle(pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth5, recfor_1.Height);
- g.DrawString(recfor_5Value, ft10, b, recfor_5);//画第五列的列标题
- Point pfor4_1 = new Point(pfor3_1.X + ColumnWidth5, recfor.Y);
- Point pfor4_2 = new Point(pfor3_1.X + ColumnWidth5, recfor.Y + recfor.Height);
- g.DrawLine(p, pfor4_1, pfor4_2);//画第三表与第四列的界线
- Rectangle recfor_6 = new Rectangle(pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, recfor_1.Height);
- g.DrawString(recfor_6Value, ft10, b, recfor_6);//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- #region 尾
- CopeAmount = ActualAmount;
- Rectangle rec10 = new Rectangle(IntPoint_X, IntPoint_Y, TableWidth, RowHeight);
- g.DrawRectangle(p, rec10);//画标题矩形
- // 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion("付款情况");
- sizef = g.MeasureString(rec10_1Value, ft11);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec10_1 = new Rectangle(rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight);
- g.DrawString(rec10_1Value, ft11, b, rec10_1);//付款情况
- // 应付
- Rectangle rec10_2 = new Rectangle(rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("应付:") + CopeAmount.ToString(), ft11, b, rec10_2);//应付
- // 实付
- Rectangle rec10_3 = new Rectangle(rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("实付:") + ActualAmount.ToString(), ft11, b, rec10_3);//实付
- // 欠款
- Rectangle rec10_4 = new Rectangle(rec10_3.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款:") + "0", ft11, b, rec10_4);//欠款
- Rectangle rec11 = new Rectangle(rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight);
- g.DrawRectangle(p, rec11);//画标题矩形
- // 合计
- Rectangle rec11_1 = new Rectangle(rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("合计人民币(大写):") + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount(ActualAmount.ToString()), ft11, b, rec11_1);//合计人民币
- // 顾客签字
- Rectangle rec11_2 = new Rectangle(rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字:"), ft11, b, rec11_2);//画消费法规
- // 说明
- Rectangle rec12 = new Rectangle(rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32(g.MeasureString("说明", ft9).Height) + 1);
- string PaymentExplain = "";
- if (PrintOtherData.ContainsKey("收款单说明") && PrintOtherData["收款单说明"].ToString().Trim().Length > 0)
- { PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim(); }
- g.DrawString(PaymentExplain, ft9, b, rec12);//画消费法规
- #endregion
- }
- #else
- public static void PaymentPrint_OtherIncome_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- //获取影楼信息
- DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" ).Tables[0];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" );
- return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region LOG
- // 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- int TableWidth = size.Width - rec1.X * 2 - 14;
- // 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #region NO.
- string rec3Value = "";
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" );
- return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- // 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec1.Y + rec1.Height + FtHeight - 47, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- // 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + dgvData.CurrentRow.Cells["付款人"].Value.ToString().Trim();
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- // 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth3 = 120;
- int ColumnWidth5 = 120;
- int ColumnWidth6 = 100;
- int ColumnWidth1 = TableWidth - ColumnWidth3 - ColumnWidth5 - ColumnWidth6;
- int nUnitColumnWidth = (TableWidth + 10) / 15;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, nUnitColumnWidth * 15, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 标题
- // 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X, rec9.Y + AddTop2, nUnitColumnWidth * 7, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9_1.Right, rec9.Y );
- Point p1_2 = new Point( rec9_1.Right, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- // 支付方式;
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "进帐方式" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_2 = new Rectangle( rec9_1.Right, rec9.Y + AddTop2, nUnitColumnWidth * 2, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_2 );//画第一列的列标题
- Point p2_1 = new Point( rec9_2.Right, rec9.Y );
- Point p2_2 = new Point( rec9_2.Right, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
- // 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( rec9_2.Right, rec9.Y + AddTop2, nUnitColumnWidth * 2, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( rec9_3.Right, rec9.Y );
- Point p3_2 = new Point( rec9_3.Right, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- // 收 银
- Rectangle rec9_5 = new Rectangle( rec9_3.Right, rec9.Y + AddTop2, nUnitColumnWidth * 2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" ), ft11, b, rec9_5 );//画第五列的列标题
- Point p4_1 = new Point( rec9_5.Right, rec9.Y );
- Point p4_2 = new Point( rec9_5.Right, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第三表与第四列的界线
- // 收款日期
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "付款日期" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_6 = new Rectangle( rec9_5.Right, rec9.Y + AddTop2, nUnitColumnWidth * 2, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_6 );//画第五列的列标题
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal CopeAmount = 0;//应付金额
- decimal ActualAmount = 0;//实付金额
- #endregion
- #region 画内容
- int ForCount = 0;
- int PageRows = 4;//每页多少行
- // 画列表每行
- for ( int i = 0; i < PageRows; i++ )
- {
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_5Value = "";
- string recfor_6Value = "";
- if ( ForCount < dgvData.SelectedRows.Count )
- {
- recfor_1Value = dgvData.SelectedRows[i].Cells["项目名称"].Value.ToString().Trim();//收款项目
- recfor_2Value = dgvData.SelectedRows[i].Cells["进帐方式"].Value.ToString().Trim();//进账方式
- recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[i].Cells["项目金额"].Value ).ToString( "0.00" ).Trim();
- recfor_5Value = dgvData.SelectedRows[i].Cells["录单人"].Value.ToString().Trim();
- recfor_6Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["收入时间"].Value );
- ActualAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["项目金额"].Value );
- ForCount++;
- }
- int forHeightCount = RowHeight;
- int Height1 = Convert.ToInt32( g.MeasureString( recfor_1Value, ft10, rec9_1.Width ).Height );
- int Height2 = Convert.ToInt32( g.MeasureString( "项目", ft10, rec9_1.Width ).Height );
- int HeightCount = Height1 / Height2;
- if ( (Height1 % Height2) > 0 )
- {
- HeightCount++;
- }
- if ( HeightCount > 1 )
- {
- if ( i < PageRows )
- {
- forHeightCount = Height1 + AddTop + 3;
- i = i + (HeightCount - 1);
- }
- }
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, nUnitColumnWidth * 15, forHeightCount );
- g.DrawRectangle( p, recfor );//画标题矩形
- rec9_1.Y += RowHeight;
- g.DrawString( recfor_1Value, ft10, b, rec9_1 );//画第一列的列标题
- p1_1.Y += RowHeight;
- p1_2.Y += RowHeight;
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- //StrValue = recfor_2Value;
- sizef = g.MeasureString( recfor_2Value, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- rec9_2.Y += RowHeight;
- g.DrawString( recfor_2Value, ft10, b, rec9_2 );//画第三列的列标题
- p2_1.Y += RowHeight;
- p2_2.Y += RowHeight;
- g.DrawLine( p, p2_1, p2_2 );//画第三表与第四列的界线
- //StrValue = recfor_3Value;
- sizef = g.MeasureString( recfor_3Value, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- rec9_3.Y += RowHeight;
- g.DrawString( recfor_3Value, ft10, b, rec9_3 );//画第三列的列标题
- p3_1.Y += RowHeight;
- p3_2.Y += RowHeight;
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- rec9_5.Y += RowHeight;
- g.DrawString( recfor_5Value, ft10, b, rec9_5 );//画第五列的列标题
- p4_1.Y += RowHeight;
- p4_2.Y += RowHeight;
- g.DrawLine( p, p4_1, p4_2 );//画第三表与第四列的界线
- rec9_6.Y += RowHeight;
- g.DrawString( recfor_6Value, ft10, b, rec9_6 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- #region 尾
- CopeAmount = ActualAmount;
- Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, nUnitColumnWidth * 15, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- // 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- // 应付
- Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + CopeAmount.ToString(), ft11, b, rec10_2 );//应付
- // 实付
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + ActualAmount.ToString(), ft11, b, rec10_3 );//实付
- // 欠款
- Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + "0", ft11, b, rec10_4 );//欠款
- // 合计
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, nUnitColumnWidth * 15, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
- // 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- // 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- }
- #endif
- #endregion
- #region 会员充值收款
- /// <summary>
- /// 会员充值收款
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_MemberRecharge_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htDataObj = (Hashtable)objData;
- List<dynamic> dyObjList = htDataObj["PrintDataList"] as List<dynamic>;
- //
- List<Image> imglist = new List<Image>();
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + htDataObj["McNumber"] + "'" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- DataTable tbl2 = dtSet.Tables["ds1"];//会员卡
- #region 每页循环
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width );
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = LYFZ.BLL.OtherCommonModel.FontConversion( "卡号." ) + StrRandom( tbl2.Rows[0]["会员卡号"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tbl2.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth2 = 110;
- int ColumnWidth3 = 90;
- int ColumnWidth4 = 80;
- int ColumnWidth5 = 90;
- int ColumnWidth6 = 100;
- int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 支付方式
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 收 银
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" ), ft11, b, rec9_4 );//画第四列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第三表与第四列的界线
- #endregion
- #region 充值日期
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "充值日期" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
- Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_5 );//画第四列的列标题
- Point p5_1 = new Point( p4_1.X + ColumnWidth5, rec9.Y );
- Point p5_2 = new Point( p4_1.X + ColumnWidth5, rec9.Y + rec9.Height );
- g.DrawLine( p, p5_1, p5_2 );//画第三表与第四列的界线
- #endregion
- #region 接单人
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
- Rectangle rec9_6 = new Rectangle( p5_1.X + (ColumnWidth6 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth6, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_6 );//画第四列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal totalValue = 0;
- decimal totalSerAmoun =0;
- decimal totalPaymentAmount = 0;
- string RechargeType = "";
- #region 画列表每行
- int PageRows = 4;//每页多少行
- for ( int i = 0; i < PageRows; i++ )
- {
- IDictionary<string ,object> htData = null;
- if(dyObjList.Count>i)
- {
- htData = dyObjList[i];
- RechargeType = htData["RechargeType"].ToString_s();
- }
-
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string Values1 = "";
- string Values2 = "";
- string Values3 = "";
- string Values4 = "";
- string Values5 = "";
- string Values6 = "";
- if (htData != null)
- {
- Values1 = htData["PaymentItem"].ToString().Trim().Split('(')[0];
- Values2 = htData["PaymentMethod"].ToString().Trim();
- Values3 = Convert.ToDecimal(htData["PaymentAmount"]).ToString("0.00").Trim();
- Values4 = htData["PaymentPeople"].ToString().Trim();
- Values5 = LYFZ.Command.Command_Validate.DateTimeToString(htData["PaymentDate"].ToString().Trim());
- Values6 = htData["SinglePerson"].ToString().Trim();
- //totalPaymentAmount += Convert.ToDecimal(htData["PaymentAmount"]);
- if (RechargeType.Equals("会员充值定金"))
- {
- totalSerAmoun += Convert.ToDecimal(htData["TotalSerAmoun"]);
- }
- else
- {
- totalPaymentAmount += Convert.ToDecimal(htData["PaymentAmount"]);
- }
- }
- if (RechargeType.Equals( "会员充值定金" ) && i == 1 )
- {
- totalValue = (decimal)htData["TotalRechargeAmoun"];
- if ( (totalValue - Convert.ToDecimal( htData["PaymentAmount"] )) > 0 )
- {
- Values1 = "已缴纳金额(定金)";
- Values2 = "";
- Values3 = (totalValue - Convert.ToDecimal( htData["PaymentAmount"] )).ToString( "0.00" ).Trim();
- Values4 = "";
- Values5 = "";
- Values6 = "";
- }
- }
- //收款项目
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( Values1, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- //支付方式
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( Values2, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- //金额
- StrValue = Values3;
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor1_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( Values3, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- //收银
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( Values4, ft10, b, recfor_4 );//画第四列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第三表与第四列的界线
- //充值日期
- Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth5, RowContentHeight );
- g.DrawString( Values5, ft10, b, recfor_5 );//画第四列的列标题
- Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
- Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor5_1, pfor5_2 );//画第三表与第四列的界线
- //接单人
- Rectangle recfor_6 = new Rectangle( pfor5_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth6, RowContentHeight );
- g.DrawString( Values6, ft10, b, recfor_6 );//画第四列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况:" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- #endregion
- #region 应付
- Rectangle rec10_2 = new Rectangle( rec10_1.X + FtWidth + 10, rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- if (RechargeType.Equals( "会员充值定金" ) )
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + totalSerAmoun.ToString().Trim(), ft11, b, rec10_2 );//应付
- }
- else
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + totalPaymentAmount.ToString().Trim(), ft11, b, rec10_2 );//应付
- }
- #endregion
- #region 实付
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 3), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- if ( RechargeType.Equals( "会员充值定金" ) )
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + totalValue.ToString().Trim(), ft11, b, rec10_3 );//实付
- }
- else
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + totalPaymentAmount.ToString().Trim(), ft11, b, rec10_3 );//实付
- }
- #endregion
- #region 余额;
- Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 3), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "余额:" ) + tbl2.Rows[0]["金额"].ToString().Trim(), ft11, b, rec10_4 );//实付
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- if (RechargeType.Equals( "会员充值定金" ) )
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( (totalValue).ToString().Trim() ), ft11, b, rec11_1 );//合计人民币
- }
- else
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount(totalPaymentAmount.ToString().Trim() ), ft11, b, rec11_1 );//合计人民币
- }
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- #endregion
- }
- #endregion
- #region 会员充值A4纸打印
- /// <summary>
- /// 会员充值收款
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_MemberRechargeA4_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
- {
- //Hashtable htData = (Hashtable)objData;
- Hashtable htDataObj = (Hashtable)objData;
- List<dynamic> dyObjList = htDataObj["PrintDataList"] as List<dynamic>;
- string McNumber = htDataObj["McNumber"].ToString_s();
- List<Image> imglist = new List<Image>();
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + McNumber + "'" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- DataTable tbl2 = dtSet.Tables["ds1"];//会员卡
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11b = new Font( "宋体", 10, FontStyle.Bold );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- int AddTop = 8;
- int AddLeft = 5;
- int RowHeight = 30;
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 - 14;
- int ColumnWidth2 = 120;
- int ColumnWidth3 = 100;
- int ColumnWidth4 = 100;
- int ColumnWidth5 = 100;
- int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- #region 标题
- string StrValue = DefaultPrintTitle;
- SizeF sizef = g.MeasureString( StrValue, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width );
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec = new Rectangle( (size.Width - FtWidth) / 2, 30, FtWidth, FtHeight );
- g.DrawString( StrValue, ft16, b, rec );
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡:" ) + StrRandom( tbl2.Rows[0]["会员卡号"].ToString().Trim() );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1A = new Rectangle( LeftWidth, rec.Location.Y + rec.Height, FtWidth, FtHeight );
- g.DrawString( StrValue, ft10, b, rec1A );
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + SDateTime.Now.ToString( "yyyy-MM-dd HH:mm" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1B = new Rectangle( size.Width - FtWidth - LeftWidth - 10, rec1A.Location.Y, FtWidth, FtHeight );
- g.DrawString( StrValue, ft10, b, rec1B );
- #endregion
- #region 姓名、电话
- Rectangle rec2 = new Rectangle( rec1A.X, rec1A.Y + rec1A.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "姓名:" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2A = new Rectangle( rec2.X + AddLeft, rec2.Y + AddTop, FtWidth, FtHeight );
- g.DrawString( StrValue, ft11, b, rec2A );//画第一列的列标题
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( tbl2.Rows[0]["姓名"].ToString().Trim() );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2B = new Rectangle( rec2A.X + rec2A.Width, rec2A.Y, FtWidth, FtHeight );
- g.DrawString( StrValue, ft10, b, rec2B );//画第一列的列标题
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2C = new Rectangle( rec1A.X + (TableWidth / 2), rec2A.Y, FtWidth, FtHeight );
- g.DrawString( StrValue, ft11, b, rec2C );//画第一列的列标题
- StrValue = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2D = new Rectangle( rec2C.X + rec2C.Width, rec2A.Y, FtWidth, FtHeight );
- g.DrawString( StrValue, ft10, b, rec2D );//画第一列的列标题
- #endregion
- #region 列表标题
- Rectangle rec3 = new Rectangle( rec1A.X, rec2.Y + rec2.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec3 );//画标题矩形
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( rec3.X + (ColumnWidth1 / 2 - FtWidth / 2), rec3.Y + AddTop, ColumnWidth1, FtHeight );
- g.DrawString( StrValue, ft11, b, rec3A );//画第一列的列标题
- Point rec3A_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
- Point rec3A_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
- g.DrawLine( p, rec3A_1, rec3A_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3B = new Rectangle( rec3A_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec3A.Y, ColumnWidth2, FtHeight );
- g.DrawString( StrValue, ft11, b, rec3B );//画第二列的列标题
- Point rec3B_1 = new Point( rec3A_1.X + ColumnWidth2, rec3.Y );
- Point rec3B_2 = new Point( rec3A_1.X + ColumnWidth2, rec3.Y + rec3.Height );
- g.DrawLine( p, rec3B_1, rec3B_2 );//画第二表与第三列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3C = new Rectangle( rec3B_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec3A.Y, ColumnWidth3, FtHeight );
- g.DrawString( StrValue, ft11, b, rec3C );//画第三列的列标题
- Point rec3C_1 = new Point( rec3B_1.X + ColumnWidth3, rec3.Y );
- Point rec3C_2 = new Point( rec3B_1.X + ColumnWidth3, rec3.Y + rec3.Height );
- g.DrawLine( p, rec3C_1, rec3C_2 );//画第三表与第四列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3D = new Rectangle( rec3C_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec3A.Y, ColumnWidth4, FtHeight );
- g.DrawString( StrValue, ft11, b, rec3D );//画第四列的列标题
- Point rec3D_1 = new Point( rec3C_1.X + ColumnWidth3, rec3.Y );
- Point rec3D_2 = new Point( rec3C_1.X + ColumnWidth3, rec3.Y + rec3.Height );
- g.DrawLine( p, rec3D_1, rec3D_2 );//画第三表与第四列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "充值日期" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft11 ).Width ) + 1;
- Rectangle rec3E = new Rectangle( rec3D_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec3A.Y, ColumnWidth5, FtHeight );
- g.DrawString( StrValue, ft11, b, rec3E );//画第四列的列标题
- #endregion
- decimal totalValue = 0;
- decimal totalSerAmoun = 0;
- decimal paymentAmount = 0;
- string RechargeType = "";
- IDictionary<string, object> htData = null;
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, TableWidth, RowHeight);
- foreach (dynamic dyObj in dyObjList)
- {
- htData = dyObj;
- RechargeType = htData["RechargeType"].ToString_s();
- #region 充值记录
- g.DrawRectangle(p, rec4);//画标题矩形
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(htData["PaymentItem"].ToString().Trim().Split('(')[0]);
- FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width);
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec4A = new Rectangle(rec4.X + AddLeft, rec4.Y + AddTop, ColumnWidth1, FtHeight);
- g.DrawString(StrValue, ft10, b, rec4A);//画第一列的列标题
- Point rec4A_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point rec4A_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, rec4A_1, rec4A_2);//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(htData["PaymentMethod"].ToString().Trim());
- FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width);
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec4B = new Rectangle(rec4A_1.X + AddLeft, rec4A.Y, ColumnWidth2, FtHeight);
- g.DrawString(StrValue, ft10, b, rec4B);//画第二列的列标题
- Point rec4B_1 = new Point(rec4A_1.X + ColumnWidth2, rec4.Y);
- Point rec4B_2 = new Point(rec4A_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, rec4B_1, rec4B_2);//画第二表与第三列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(Convert.ToDecimal(htData["PaymentAmount"]).ToString("0.00").Trim());
- FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width);
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec4C = new Rectangle(rec4B_1.X + AddLeft, rec4A.Y, ColumnWidth3, FtHeight);
- g.DrawString(StrValue, ft10, b, rec4C);//画第三列的列标题
- Point rec4C_1 = new Point(rec4B_1.X + ColumnWidth3, rec4.Y);
- Point rec4C_2 = new Point(rec4B_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, rec4C_1, rec4C_2);//画第三表与第四列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(htData["PaymentPeople"].ToString().Trim());
- FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width);
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec4D = new Rectangle(rec4C_1.X + AddLeft, rec4A.Y, ColumnWidth4, FtHeight);
- g.DrawString(StrValue, ft10, b, rec4D);//画第四列的列标题
- Point rec4D_1 = new Point(rec4C_1.X + ColumnWidth3, rec4.Y);
- Point rec4D_2 = new Point(rec4C_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, rec4D_1, rec4D_2);//画第三表与第四列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion(LYFZ.Command.Command_Validate.DateTimeToString(htData["PaymentDate"].ToString().Trim()));
- FtWidth = Convert.ToInt32(g.MeasureString(StrValue, ft10).Width) + 1;
- Rectangle rec4E = new Rectangle(rec4D_1.X + AddLeft, rec4A.Y, ColumnWidth5, FtHeight);
- g.DrawString(StrValue, ft10, b, rec4E);//画第四列的列标题
- #endregion
- paymentAmount += Convert.ToDecimal(htData["PaymentAmount"]);
- if (RechargeType.Equals("会员充值定金"))
- {
- totalValue += (decimal)htData["TotalRechargeAmoun"];
- totalSerAmoun += Convert.ToDecimal(htData["TotalSerAmoun"]);
- }
- if(dyObjList.IndexOf(dyObj)!= dyObjList.Count-1)
- {
- rec4 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, rec4.Height);
- }
- }
- #region 空行
- /*
- Values1 = "已缴纳定金";
- Values2 = "定金";
- Values3 = (totalValue - Convert.ToDecimal(htData["PaymentAmount"])).ToString("0.00").Trim();
- */
- //if (RechargeType.Equals("会员充值定金"))
- //{
- // totalValue = (decimal)htData["TotalRechargeAmoun"];
- // totalSerAmoun = Convert.ToDecimal(htData["TotalSerAmoun"]);
- //}
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec5 );//画标题矩形
- StrValue = "";
- if (RechargeType.Equals( "会员充值定金" ) && (totalValue - paymentAmount) > 0 )
- {
- StrValue = "已缴纳金额(定金)";
- }
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec5A = new Rectangle( rec5.X + AddLeft, rec5.Y + AddTop, ColumnWidth1, FtHeight );
- g.DrawString( StrValue, ft10, b, rec5A );//画第一列的列标题
- Point rec5A_1 = new Point( rec5.X + ColumnWidth1, rec5.Y );
- Point rec5A_2 = new Point( rec5.X + ColumnWidth1, rec5.Y + rec5.Height );
- g.DrawLine( p, rec5A_1, rec5A_2 );//画第一表与第二列的界线
- if (RechargeType.Equals( "会员充值定金" ) && (totalValue - paymentAmount) > 0 )
- {
- StrValue = "";//LYFZ.BLL.OtherCommonModel.FontConversion( "定金" );
- }
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec5B = new Rectangle( rec5A_1.X + AddLeft, rec5A.Y, ColumnWidth2, FtHeight );
- g.DrawString( StrValue, ft10, b, rec5B );//画第二列的列标题
- Point rec5B_1 = new Point( rec5A_1.X + ColumnWidth2, rec5.Y );
- Point rec5B_2 = new Point( rec5A_1.X + ColumnWidth2, rec5.Y + rec5.Height );
- g.DrawLine( p, rec5B_1, rec5B_2 );//画第二表与第三列的界线
- if (RechargeType.Equals( "会员充值定金" ) && (totalValue - paymentAmount) > 0 )
- {
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( (totalValue - paymentAmount).ToString( "0.00" ).Trim() );
- }
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec5C = new Rectangle( rec5B_1.X + AddLeft, rec5B.Y, ColumnWidth2, FtHeight );
- g.DrawString( StrValue, ft10, b, rec5C );//画第二列的列标题
- Point rec5C_1 = new Point( rec5B_1.X + ColumnWidth3, rec5.Y );
- Point rec5C_2 = new Point( rec5B_1.X + ColumnWidth3, rec5.Y + rec5.Height );
- g.DrawLine( p, rec5C_1, rec5C_2 );//画第三表与第四列的界线
- Point rec5D_1 = new Point( rec5C_1.X + ColumnWidth3, rec5.Y );
- Point rec5D_2 = new Point( rec5C_1.X + ColumnWidth3, rec5.Y + rec5.Height );
- g.DrawLine( p, rec5D_1, rec5D_2 );//画第三表与第四列的界线
- #endregion
- #region 付款详情
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec6 );//画标题矩形
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
- sizef = g.MeasureString( StrValue, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6A = new Rectangle( rec6.X + AddLeft, rec6.Y + AddTop, FtWidth, FtHeight );
- g.DrawString( StrValue, ft11, b, rec6A );//付款情况
- Rectangle rec6B = new Rectangle( rec6A.X + (TableWidth / 3), rec6A.Y, TableWidth / 4, FtHeight );
- if (RechargeType.Equals( "会员充值定金" ) )
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + totalSerAmoun.ToString().Trim(), ft11, b, rec6B );//应付
- }
- else
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + paymentAmount.ToString().Trim(), ft11, b, rec6B );//应付
- }
- Rectangle rec6C = new Rectangle( rec6B.X + (TableWidth / 3), rec6A.Y, TableWidth / 4, FtHeight );
- if (RechargeType.Equals( "会员充值定金" ) )
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + totalValue.ToString().Trim(), ft11, b, rec6C );//实付
- }
- else
- {
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + paymentAmount.ToString().Trim(), ft11, b, rec6C );//实付
- }
- #endregion
- #region 合计、大写
- Rectangle rec7 = new Rectangle( rec6.X, rec6.Y + rec6.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec7 );
- if (RechargeType.Equals( "会员充值定金" ) )
- {
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( (totalValue).ToString().Trim() );
- }
- else
- {
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount(paymentAmount.ToString().Trim() );
- }
- sizef = g.MeasureString( StrValue, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec7A = new Rectangle( rec7.X + AddLeft, rec7.Y + AddTop, TableWidth, FtHeight );
- g.DrawString( StrValue, ft11, b, rec7A );
- #endregion
- #region 法律申明
- StrValue = "法律申明:\r\n";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- StrValue += PrintOtherData["收款单说明"].ToString().Trim();
- }
- else
- {
- StrValue += "一、以上内容为充值优惠内容,超出此内容的,如需增加产品及各项服务等,请依照公司规定支付相关费用 \r\n" +
- "二、本充值金额自充值之日起生效,所交金额均为定金,恕不退还。本次充值合约双方认可,已经确认进入设计生产流程,不能更改,如需更改违约方需承担相应损失及费用,并扣除20%违约金,以维护正常商业秩序。\r\n" +
- "三、如因顾客单方原因导致合约不能履行,巧克力森林儿童影像有限公司有权从充值金额中扣除以上优惠金额。\r\n" +
- "四、由于产品不断更新换代或升级,为保证您的权益,原定产品更新为最新等值产品。\r\n" +
- "五、充值金额可转赠他人使用,充值优惠权限仅限本人使用。\r\n" +
- "六、请妥善保管充值卡,并熟记密码,充值卡遗失补办需付20元工本费。\r\n" +
- "七、本协议一式三份,顾客一份,存根一份,财务一份,自确认签字之日起生效。\r\n";
- }
- sizef = g.MeasureString( StrValue, ft11, TableWidth - AddLeft * 2 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( rec7.X, rec7.Y + rec7.Height, TableWidth, FtHeight + AddTop );
- g.DrawRectangle( p, rec8 );//画标题矩形
- Rectangle rec8A = new Rectangle( rec8.X + AddLeft, rec8.Y + AddTop, TableWidth, FtHeight );
- g.DrawString( StrValue, ft11, b, rec8A );//付款情况
- #endregion
- #region 本人签字
- Rectangle rec9 = new Rectangle( rec8.X, rec8A.Y + rec8A.Height, TableWidth, RowHeight * 3 );
- g.DrawRectangle( p, rec9 );//画标题矩形
- StrValue = "本人证实上述资料属实,并已阅读及认同本充值金额及充值合约。";
- sizef = g.MeasureString( StrValue, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec9A = new Rectangle( rec9.X + AddLeft, rec9.Y + RowHeight, TableWidth, RowHeight );
- g.DrawString( StrValue, ft11, b, rec9A );//付款情况
- StrValue = "本人确认签字生效:";
- sizef = g.MeasureString( StrValue, ft11b );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec9B = new Rectangle( LeftWidth + TableWidth - FtWidth * 2, rec9A.Y + rec9A.Height + AddTop, FtWidth, FtHeight );
- g.DrawString( StrValue, ft11b, b, rec9B );//付款情况
- #endregion
- #region 本店信息
- StrValue = "本店地址:" + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrValue, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10A = new Rectangle( rec2.X + AddLeft, rec9.Y + rec9.Height + 4, FtWidth, FtHeight );
- g.DrawString( StrValue, ft9, b, rec10A );//付款情况
- StrValue = "联系电话:" + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- sizef = g.MeasureString( StrValue, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10B = new Rectangle( LeftWidth + TableWidth - FtWidth, rec10A.Y, FtWidth, FtHeight );
- g.DrawString( StrValue, ft9, b, rec10B );//付款情况
- #endregion
- }
- #endregion
- #region 新摄会收款单据
- /// <summary>
- /// 新摄会收款单据
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_PhotographerPayment_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string strNumber = htData["strNumber"].ToString().Trim();
- string strMyNumber = htData["strMyNumber"].ToString().Trim();
- string ExecuteSql = "select Company_Address,Company_Telephone,Company_UpdateDatetime from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
- ExecuteSql += "select 会员卡号,姓名,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + strNumber + "' ;";
- ExecuteSql += "select Mcpm_GradeName,Mcpm_UpgradeAoumnt,dbo.fn_CheckUserIDGetUserName(Mcpm_CreateName) AS Mcpm_CreateName,dbo.fn_CheckUserIDGetUserName(Mcpm_PaymentName) AS Mcpm_PaymentName,(select Sc_ClassName from tb_ErpSystemCategory where Sc_ClassCode = Mcpm_PaymentMethod) AS Mcpm_PaymentMethod from tb_ErpMemberCardPhotographerMain where Mcpm_MyNumber = '" + strMyNumber + "';";
- ExecuteSql += "select Mcpv_GiftName from tb_ErpMemberCardPhotographerVice where Mcpv_MyNumber = '" + strMyNumber + "';";
- DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
- DataTable tbl = dsData.Tables["ds"];
- DataTable tbl2 = dsData.Tables["ds1"];
- DataTable tbl3 = dsData.Tables["ds2"];
- DataTable tbl4 = dsData.Tables["ds3"];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息!" ); return;
- }
- if ( tbl2.Rows.Count == 0 )
- {
- MessageBoxCustom.Show( "会员卡号不存在!" ); return;
- }
- #region
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = "NO." + StrRandom( tbl2.Rows[0]["会员卡号"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tbl2.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 7;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth1 = TableWidth / 5;
- int ColumnWidth2 = TableWidth / 5;
- int ColumnWidth3 = TableWidth / 5;
- int ColumnWidth5 = TableWidth / 5;
- int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 支付方式
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 接单人
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "办理人" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
- Point p4_2 = new Point( p3_2.X + ColumnWidth4, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
- #endregion
- #region 收 银
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal CopeAmount = 0;//应付金额
- decimal ActualAmount = 0;//实付金额
- #region 画列表每行
- int PageRows = 1;//每页多少行
- for ( int i = 0; i < PageRows; i++ )
- {
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- string recfor_5Value = "";
- if ( i == 0 )
- {
- recfor_1Value = tbl3.Rows[0]["Mcpm_GradeName"].ToString().Trim();
- recfor_2Value = tbl3.Rows[0]["Mcpm_PaymentMethod"].ToString().Trim();
- recfor_3Value = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] ).ToString( "0.00" ).Trim();
- recfor_4Value = tbl3.Rows[0]["Mcpm_CreateName"].ToString().Trim();
- recfor_5Value = tbl3.Rows[0]["Mcpm_PaymentName"].ToString().Trim();
- CopeAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] );
- ActualAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] );
- }
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
- Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
- g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- string strReamt = "";
- for ( int i = 0; i < tbl4.Rows.Count; i++ )
- {
- strReamt += (i + 1) + "." + tbl4.Rows[i]["Mcpv_GiftName"].ToString().Trim() + " ";
- }
- Rectangle rec9_A = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight * 3 );
- g.DrawRectangle( p, rec9_A );//画标题矩形
- Rectangle rec9_A1 = new Rectangle( rec9.X + AddLeft, rec9_A.Y + AddTop2, TableWidth - (AddLeft * 2), rec9_A.Height - (AddTop * 2) );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "赠品详情:" ) + strReamt, ft10, b, rec9_A1 );//画第三列的列标题
- Rectangle rec10 = new Rectangle( rec9.X, rec9_A.Y + rec9_A.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- #endregion
- #region 应付
- Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + CopeAmount.ToString(), ft11, b, rec10_2 );//应付
- #endregion
- #region 实付
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + ActualAmount.ToString(), ft11, b, rec10_3 );//实付
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- #endregion
- }
- #endregion
- #region 新摄会退款单据
- /// <summary>
- /// 新摄会退款单据
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_PhotographerRefund_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string strNumber = htData["strNumber"].ToString().Trim();
- string strMyNumber = htData["strMyNumber"].ToString().Trim();
- string ExecuteSql = "select Company_Address,Company_Telephone,Company_UpdateDatetime from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
- ExecuteSql += "select 会员卡号,姓名,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + strNumber + "' ;";
- ExecuteSql += "select Mcpm_GradeName,Mcpm_OKBackAoumnt,dbo.fn_CheckUserIDGetUserName(Mcpm_JingShouRen) AS Mcpm_JingShouRen,Mcpm_BackAoumnt from tb_ErpMemberCardPhotographerMain where Mcpm_MyNumber = '" + strMyNumber + "';";
- DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
- DataTable tbl = dsData.Tables["ds"];
- DataTable tbl2 = dsData.Tables["ds1"];
- DataTable tbl3 = dsData.Tables["ds2"];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tbl2.Rows.Count == 0 )
- {
- MessageBoxCustom.Show( "会员卡号不存在" ); return;
- }
- #region
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员号." ) + StrRandom( tbl2.Rows[0]["会员卡号"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tbl2.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 7;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth1 = TableWidth / 4;
- int ColumnWidth2 = TableWidth / 4;
- int ColumnWidth3 = TableWidth / 4;
- int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 支付方式
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "返还方式" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 金 额
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "返还金额" ), ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 返还人
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "返还经手人" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- #region 画列表每行
- int PageRows = 4;//每页多少行
- for ( int i = 0; i < PageRows; i++ )
- {
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- if ( i == 0 )
- {
- recfor_1Value = tbl3.Rows[0]["Mcpm_GradeName"].ToString().Trim();
- recfor_2Value = "现金";
- recfor_3Value = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_OKBackAoumnt"] ).ToString( "0.00" ).Trim();
- recfor_4Value = tbl3.Rows[0]["Mcpm_JingShouRen"].ToString().Trim();
- }
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "返还情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- #endregion
- #region 应退
- Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应还:" ) + tbl3.Rows[0]["Mcpm_BackAoumnt"].ToString().Trim(), ft11, b, rec10_2 );//应付
- #endregion
- #region 实退
- decimal ActualAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_OKBackAoumnt"] );//实付金额
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实还:" ) + ActualAmount.ToString(), ft11, b, rec10_3 );//实付
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( ActualAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- #endregion
- }
- #endregion
- #region 会员服务收款
- /// <summary>
- /// 会员服务收款
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_MemberService_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + htData["strMcNumber"] + "'", ShowColumnName: "姓名,电话,会员卡号" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpMemberCardPayment", StrWhere: "Mcpt_PaymentNumber = '" + htData["strNumber"] + "'", ShowColumnName: "Mcpt_PaymentNumber,Mcpt_Number,Mcpt_PaymentType,Mcpt_PaymentAmount,Mcpt_DiscountAmount,(select Sc_ClassName from tb_ErpSystemCategory where Sc_ClassCode = Mcpt_PaymentMethod) AS Mcpt_PaymentMethod,Mcpt_PaymentBank,Mcpt_PackageClass,Mcpt_PaymentRemark,Mcpt_PackagePrice,Mcpt_Discount,Mcpt_CreateDatetime,dbo.fn_CheckUserIDGetUserName(Mcpt_CreateName) AS Mcpt_CreateName", filedOrder: "ID desc" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpMemberCardPaymentContentDetail", StrWhere: "Mcpcd_PaymentNumber = '" + htData["strNumber"] + "'", ShowColumnName: "Mcpcd_PaymentNumber,Mcpcd_ServiceNumber,Mcpcd_ServiceContent,Mcpcd_Count,Mcpcd_SalePrice" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblA = dtSet.Tables["ds1"];
- DataTable tblB = dtSet.Tables["ds2"];
- DataTable tblC = dtSet.Tables["ds3"];
- DataTable tblD = LYFZ.BLL.BLL_ErpOrderView.GetData_MemberMainServiceArrears( "应付,已付,欠款", StrQueryCondition: " Where Mcpo_OrderNumber = '" + htData["strNumber"] + "'", StrQueryCondition2: "" );
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tblA.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "此服务没有会员卡" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = "NO." + StrRandom( tblA.Rows[0]["会员卡号"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tblA.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblA.Rows[0]["电话"] );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "付款日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( htData["strDate"] );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 7;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth4 = TableWidth / 6;
- int ColumnWidth2 = TableWidth / 6;
- int ColumnWidth3 = TableWidth / 6;
- int ColumnWidth5 = TableWidth / 6;
- int ColumnWidth1 = TableWidth - ColumnWidth4 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- FtWidth = Convert.ToInt32( g.MeasureString( StrValue, ft10 ).Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 支付方式
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 次 数
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "次 数" ), ft11, b, rec9_4 );//画第四列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
- #endregion
- #region 收 银
- Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" ), ft11, b, rec9_5 );//画第五列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- #region 画列表每行
- int ForCount = 0;
- int PageRows = 4;//每页多少行
- for ( int i = 0; i < PageRows; i++ )
- {
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- string recfor_5Value = "";
- if ( ForCount < tblC.Rows.Count )
- {
- recfor_1Value = tblC.Rows[ForCount]["Mcpcd_ServiceContent"].ToString().Trim();
- recfor_2Value = tblB.Rows[0]["Mcpt_PaymentMethod"].ToString().Trim();
- recfor_3Value = Convert.ToDecimal( tblC.Rows[ForCount]["Mcpcd_SalePrice"] ).ToString( "0.00" ).Trim();
- recfor_4Value = tblC.Rows[ForCount]["Mcpcd_Count"].ToString().Trim();
- recfor_5Value = tblB.Rows[0]["Mcpt_CreateName"].ToString().Trim();
- ForCount++;
- }
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
- Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
- g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
- sizef = g.MeasureString( rec10_1Value, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft10, b, rec10_1 );//付款情况
- #endregion
- #region 应付
- decimal CopeAmount = Convert.ToDecimal( tblD.Rows[0]["应付"] ); //应付金额
- Rectangle rec10_2 = new Rectangle( rec10_1.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + Convert.ToDecimal( tblD.Rows[0]["应付"] ).ToString( "0.00" ), ft10, b, rec10_2 );//应付
- #endregion
- #region 实付
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4) - 50, rec10.Y + AddTop2, TableWidth / 4 + 70, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + (Convert.ToDecimal( tblB.Rows[0]["Mcpt_PaymentAmount"] )
- + Convert.ToDecimal( tblB.Rows[0]["Mcpt_DiscountAmount"] )).ToString( "0.00" )
- + LYFZ.BLL.OtherCommonModel.FontConversion( " 总付款:" )
- + tblD.Rows[0]["已付"].ToString(), ft10, b, rec10_3 );//实付
- #endregion
- #region 欠款
- Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 4) + 70, rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + Convert.ToDecimal( tblD.Rows[0]["欠款"] ).ToString( "0.00" ), ft10, b, rec10_4 );//欠款
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( Convert.ToDecimal( tblD.Rows[0]["已付"] ).ToString() ), ft10, b, rec11_1 );//合计人民币
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft10, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- }
- #endregion
- #region 会员服务消费
- /// <summary>
- /// 会员服务消费
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_MemberServiceUse_Print( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- List<Hashtable> hlist = (List<Hashtable>)htData["hlist"];
- List<Image> imglist = new List<Image>();
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + htData["strNumber"] + "'", ShowColumnName: "姓名,电话,会员卡号" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblA = dtSet.Tables["ds1"];//订单
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tblA.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "此服务没有会员卡" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = "NO." + StrRandom( tblA.Rows[0]["会员卡号"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tblA.Rows[0]["姓名"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblA.Rows[0]["电话"] );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 7;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth4 = 120;
- int ColumnWidth2 = 120;
- int ColumnWidth3 = 120;
- int ColumnWidth5 = 120;
- int ColumnWidth1 = TableWidth - ColumnWidth4 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 消费次数
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "消费次数" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 消费后剩余次数
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "消费后剩余次数" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 消费时间
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "消费时间" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
- Point p4_2 = new Point( p3_2.X + ColumnWidth4, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
- #endregion
- #region 经手人
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "经手人" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- #region 画列表每行
- int ForCount = 0;
- int PageRows = 6;//每页多少行
- for ( int i = 0; i < PageRows; i++ )
- {
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- string recfor_5Value = "";
- if ( ForCount < hlist.Count )
- {
- Hashtable htData2 = (Hashtable)hlist[ForCount];
- recfor_1Value = htData2["ItemName"].ToString().Trim();
- recfor_2Value = htData2["UseCount"].ToString().Trim();
- recfor_3Value = htData2["UseAfterCount"].ToString().Trim();
- recfor_4Value = htData2["UseTime"].ToString().Trim();
- recfor_5Value = htData2["JingShouRen"].ToString().Trim();
- ForCount++;
- }
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + AddLeft, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
- Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
- g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( IntPoint_X + TableWidth - 130, IntPoint_Y + AddTop2, 130, RowContentHeight + 10 );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft10, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec9.X, rec11_2.Y, rec9.Width - rec11_2.Width - 10, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- }
- #endregion
- #region 礼服出租收款
- /// <summary>
- /// 礼服出租收款
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_GownsPayment_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objData;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpPayment", StrWhere: "Pay_OrdNumber = '" + htData["ordNumber"].ToString().Trim() + "' and Pay_Type = '2'", ShowColumnName: "sum(Pay_AmountOf) AS Pay_AmountOf" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblPayment = dtSet.Tables["ds1"];//出租单
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 15 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = "NO." + StrRandom( htData["ordNumber"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + htData["CustomerName"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htData["Telephone"] );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth4 = 120;
- int ColumnWidth2 = 150;
- int ColumnWidth3 = 120;
- int ColumnWidth5 = 120;
- int ColumnWidth1_1 = 120; // 2017-03-30 刘工添加 新增一列 接单人
- int ColumnWidth1 = TableWidth - ColumnWidth4 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5 - ColumnWidth1_1;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 2017-03-30 刘工添加 新增一列 接单人
- string SinglePersonValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
- sizef = g.MeasureString( SinglePersonValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1_1 = new Rectangle( p1_1.X + (ColumnWidth1_1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1_1, RowContentHeight );
- g.DrawString( SinglePersonValue, ft11, b, rec9_1_1 );//画第一列的列标题
- Point p1_1_1 = new Point( p1_1.X + ColumnWidth1_1, rec9.Y );
- Point p1_2_1 = new Point( p1_1.X + ColumnWidth1_1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1_1, p1_2_1 );//画第一表与第二列的界线
- p1_1 = p1_1_1;
- p1_2 = p1_2_1;
- #endregion
- #region 支付方式
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 接单人 //此处为 收款时间
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款时间" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
- Point p4_2 = new Point( p3_2.X + ColumnWidth4, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
- #endregion
- #region 收 银
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal MortgageAmount = 0;//押金
- decimal CopeAmount = 0;//租金
- #region 画列表每行
- for ( int i = 0; i < 4; i++ )
- {
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- string recfor_5Value = "";
- string SinglePerson = "";
- if ( i < dgvData.SelectedRows.Count )
- {
- recfor_1Value = dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim();//收款项目
- recfor_2Value = dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim();
- recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value ).ToString( "0.00" );
- recfor_4Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["Pay_CreateDatetime"].Value, "yyyy-MM-dd HH:mm" );
- recfor_5Value = dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim();
- if ( dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim() == "押金" )
- {
- MortgageAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
- }
- else if ( dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim() == "租金" )
- {
- CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
- }
- SinglePerson = dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim();
- }
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- #region 2017-03-30 刘工添加 接单人
- Rectangle recfor_1_1 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth1_1, RowContentHeight );
- g.DrawString( SinglePerson, ft10, b, recfor_1_1 );
- Point pfor1_1_1 = new Point( pfor1_1.X + ColumnWidth1_1, pfor1_1.Y );
- Point pfor1_2_1 = new Point( pfor1_1.X + ColumnWidth1_1, pfor1_1.Y + recfor.Height );
- g.DrawLine( p, pfor1_1_1, pfor1_2_1 );
- pfor1_1 = pfor1_1_1;
- pfor1_2 = pfor1_2_1;
- #endregion
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
- Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
- g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- #endregion
- #region 应付
- string StrPaymentAmount = "0";
- if ( tblPayment.Rows.Count > 0 )
- {
- if ( !string.IsNullOrEmpty( tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim() ) )
- {
- StrPaymentAmount = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- }
- StrValue = " " + LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + (Convert.ToDecimal( htData["StrCope"] )) + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + (MortgageAmount + CopeAmount).ToString( "0.00" ) + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + (Convert.ToDecimal( htData["StrCope"] ) - Convert.ToDecimal( StrPaymentAmount )).ToString( "0.00" ) + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "租金:" ) + CopeAmount.ToString( "0.00" ) + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "押金:" ) + MortgageAmount.ToString( "0.00" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec10_2 = new Rectangle( rec10_1.X + rec10_1.Width, rec10.Y + AddTop2, TableWidth - rec10_1.Width, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec10_2 );//应付
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( (MortgageAmount + CopeAmount).ToString() ), ft11, b, rec11_1 );//合计人民币
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- }
- #endregion
- #region 礼服出租退款
- /// <summary>
- /// 礼服出租退款
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_SoldRefund_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objData;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- if ( dgvData.SelectedRows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未选择打印数据" ); return;
- }
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpCustomer", StrWhere: "Cus_CustomerNumber = '" + htData["CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Cus_Name,Cus_Telephone" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- DataTable tblClient = dtSet.Tables["ds1"];//客户
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 15 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width );
- int FtHeight = Convert.ToInt32( sizef.Height ) + 1;
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = "NO." + StrRandom( htData["DressOrderNumber"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 3;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + tblClient.Rows[0]["Cus_Name"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblClient.Rows[0]["Cus_Telephone"] );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth1 = TableWidth / 4;
- int ColumnWidth2 = TableWidth / 4;
- int ColumnWidth3 = TableWidth / 4;
- int ColumnWidth4 = TableWidth / 4;
- int ColumnWidth5 = TableWidth / 5;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 金额
- StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec9_1 = new Rectangle( rec9.X + ((ColumnWidth1 / 2) - (FtWidth / 2)), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrName, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 类型
- StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "类 型" );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec9_2 = new Rectangle( p1_1.X + ((ColumnWidth2 / 2) - (FtWidth / 2)), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( StrName, ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 交易时间
- StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "交易时间" );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec9_3 = new Rectangle( p2_1.X + ((ColumnWidth3 / 2) - (FtWidth / 2)), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrName, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 经手人
- StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "经手人" );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec9_4 = new Rectangle( p3_1.X + ((ColumnWidth4 / 2) - (FtWidth / 2)), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrName, ft11, b, rec9_4 );//画第三列的列标题
- #endregion
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal CopeAmount = 0;//退款金额
- string strRemark = "";
- #region 画列表每行
- for ( int i = 0; i < 2; i++ )
- {
- Rectangle recfor = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- if ( i < dgvData.SelectedRows.Count )
- {
- recfor_1Value = dgvData.SelectedRows[i].Cells["金额"].Value.ToString().Trim();//收款项目
- recfor_2Value = dgvData.SelectedRows[i].Cells["退款类型"].Value.ToString().Trim();
- recfor_3Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["录入时间"].Value, "yyyy-MM-dd HH:mm" );
- recfor_4Value = dgvData.SelectedRows[i].Cells["退款人"].Value.ToString().Trim();// htData["UserName"].ToString().Trim();
- strRemark += dgvData.SelectedRows[i].Cells["退款备注"].Value.ToString().Trim();
- CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["金额"].Value );
- }
- string StrValue = recfor_1Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第三列的列标题
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec9_A = new Rectangle( rec9.X, IntPoint_Y, TableWidth, RowHeight * 2 );
- g.DrawRectangle( p, rec9_A );//画标题矩形
- Rectangle rec9_A1 = new Rectangle( rec9.X + AddLeft, rec9_A.Y + AddTop, TableWidth - (AddLeft * 2), rec9_A.Height - (AddTop * 2) );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "说 明:" ) + strRemark, ft10, b, rec9_A1 );//画第三列的列标题
- Rectangle rec10 = new Rectangle( rec9.X, rec9_A.Y + rec9_A.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 押金情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "押金情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- #endregion
- #region 原押金
- Rectangle rec10_2 = new Rectangle( (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "原押金:" ) + Convert.ToDecimal( htData["DepositAmount"] ).ToString( "0.00" ), ft10, b, rec10_2 );//应付
- #endregion
- #region 已退
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "已退:" ) + CopeAmount.ToString( "0.00" ), ft10, b, rec10_3 );//实付
- #endregion
- #region 未退
- Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "未退:" ) + Convert.ToDecimal( htData["NotRefundAmount"] ).ToString( "0.00" ), ft10, b, rec10_4 );//实付Convert.ToDecimal(htData["DepositAmount"]) - CopeAmount
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( CopeAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- }
- #endregion
- #region 礼服出售收款
- /// <summary>
- /// 礼服出租收款
- /// </summary>
- /// <param name="panl"></param>
- public static void PaymentPrint_SoldPayment_Print( object objData, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objData;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- //获取影楼信息
- DataTable tbl = new BLL.BLL_ErpOrder().GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone,Company_UpdateDatetime" ).Tables[0];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 15 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- #region 二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rec1 = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rec1 );
- }
- #endregion
- int TableWidth = size.Width - rec1.X * 2 - 14;
- #region 金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( (size.Width / 2) - (FtWidth / 2), 30, FtWidth + 5, FtHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec2 );
- #endregion
- #region NO.
- string rec3Value = "NO." + StrRandom( htData["ordNumber"].ToString().Trim() );
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3 = new Rectangle( size.Width - rec1.X - FtWidth, rec2.Y + 35, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3 );
- if ( IsPrintSerialNo )
- {
- string SerialNo = PrintReceiptSerial();
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- SerialNo = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- if ( string.IsNullOrEmpty( SerialNo ) )
- {
- MessageBoxCustom.Show( "获取流水单号失败!" ); return;
- }
- rec3Value = "SerialNo." + SerialNo;
- sizef = g.MeasureString( rec3Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3A = new Rectangle( size.Width - rec1.X - FtWidth, rec3.Y - FtHeight + 2, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft11, b, rec3A );
- }
- #endregion
- #region 地址
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( StrAddress, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec4 = new Rectangle( rec1.X + rec1.Width - 5, rec3.Y + rec3.Height + FtHeight - 15, TableWidth - rec1.Width + 14, FtHeight );
- g.DrawString( StrAddress, ft10, b, rec4 );
- string StrTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- Rectangle rec4A = new Rectangle( rec4.X, rec4.Y + rec4.Height - FtHeight * 2 + 2, TableWidth - rec1.Width - 10, FtHeight );
- g.DrawString( StrTelephone, ft10, b, rec4A );
- #endregion
- #region 客户姓名
- string StrName = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ) + htData["CustomerName"].ToString().Trim() + " " + LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htData["Telephone"] );
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height - 2, FtWidth, FtHeight );
- g.DrawString( StrName, ft10, b, rec6 );
- #endregion
- #region 日期
- string StrDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- sizef = g.MeasureString( StrDate, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec8 = new Rectangle( TableWidth + rec1.X - FtWidth + 14, rec6.Y, FtWidth, FtHeight );
- g.DrawString( StrDate, ft10, b, rec8 );
- #endregion
- int AddLeft = 3;
- int AddTop2 = 6;
- int AddTop = 6;
- int RowHeight = 26;
- int RowContentHeight = 18;
- int ColumnWidth4 = 120;
- int ColumnWidth2 = 150;
- int ColumnWidth3 = 120;
- int ColumnWidth5 = 120;
- int ColumnWidth1_1 = 120; // 2017-03-30 刘工添加 新增一列 接单人
- int ColumnWidth1 = TableWidth - ColumnWidth4 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5 - ColumnWidth1_1;
- Rectangle rec9 = new Rectangle( rec1.X + 7, rec6.Y + rec6.Height + 1, TableWidth, RowHeight );
- g.DrawRectangle( p, rec9 );//画标题矩形
- #region 收款项目
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1 = new Rectangle( rec9.X + (ColumnWidth1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_1 );//画第一列的列标题
- Point p1_1 = new Point( rec9.X + ColumnWidth1, rec9.Y );
- Point p1_2 = new Point( rec9.X + ColumnWidth1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- #endregion
- #region 2017-03-30 刘工添加 新增一列 接单人
- string SinglePersonValue = LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" );
- sizef = g.MeasureString( SinglePersonValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_1_1 = new Rectangle( p1_1.X + (ColumnWidth1_1 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth1_1, RowContentHeight );
- g.DrawString( SinglePersonValue, ft11, b, rec9_1_1 );//画第一列的列标题
- Point p1_1_1 = new Point( p1_1.X + ColumnWidth1_1, rec9.Y );
- Point p1_2_1 = new Point( p1_1.X + ColumnWidth1_1, rec9.Y + rec9.Height );
- g.DrawLine( p, p1_1_1, p1_2_1 );//画第一表与第二列的界线
- p1_1 = p1_1_1;
- p1_2 = p1_2_1;
- #endregion
- #region 支付方式
- Rectangle rec9_2 = new Rectangle( p1_1.X + (ColumnWidth2 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式" ), ft11, b, rec9_2 );//画第二列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec9.Y );
- Point p2_2 = new Point( p1_2.X + ColumnWidth2, rec9.Y + rec9.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第二表与第三列的界线
- #endregion
- #region 金 额
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_3 = new Rectangle( p2_1.X + (ColumnWidth3 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_3 );//画第三列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec9.Y );
- Point p3_2 = new Point( p2_2.X + ColumnWidth3, rec9.Y + rec9.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第三表与第四列的界线
- #endregion
- #region 接单人 //收款时间
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收款时间" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_4 = new Rectangle( p3_1.X + (ColumnWidth4 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_4 );//画第四列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec9.Y );
- Point p4_2 = new Point( p3_2.X + ColumnWidth4, rec9.Y + rec9.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第四表与第五列的界线
- #endregion
- #region 收 银
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "收 银" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec9_5 = new Rectangle( p4_1.X + (ColumnWidth5 / 2 - FtWidth / 2), rec9.Y + AddTop2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft11, b, rec9_5 );//画第五列的列标题
- #endregion
- int IntPoint_X = rec9.X;
- int IntPoint_Y = rec9.Y + rec9.Height;
- decimal CopeAmount = 0;//租金
- #region 画列表每行
- for ( int i = 0; i < 4; i++ )
- {
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- string recfor_1Value = "";
- string recfor_2Value = "";
- string recfor_3Value = "";
- string recfor_4Value = "";
- string recfor_5Value = "";
- string SinglePerson = "";
- if ( i < dgvData.SelectedRows.Count )
- {
- recfor_1Value = dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim();//收款项目
- recfor_2Value = dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim();
- recfor_3Value = Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value ).ToString( "0.00" );
- recfor_4Value = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["Pay_CreateDatetime"].Value, "yyyy-MM-dd HH:mm" );
- recfor_5Value = dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim();
- CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
- SinglePerson = dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim();
- }
- Rectangle recfor_1 = new Rectangle( recfor.X + AddLeft, recfor.Y + AddTop, ColumnWidth1, RowContentHeight );
- g.DrawString( recfor_1Value, ft10, b, recfor_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y );
- Point pfor1_2 = new Point( recfor_1.X + ColumnWidth1 - 3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- #region 2017-03-30 刘工添加 接单人
- Rectangle recfor_1_1 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth1_1, RowContentHeight );
- g.DrawString( SinglePerson, ft10, b, recfor_1_1 );
- Point pfor1_1_1 = new Point( pfor1_1.X + ColumnWidth1_1, pfor1_1.Y );
- Point pfor1_2_1 = new Point( pfor1_1.X + ColumnWidth1_1, pfor1_1.Y + recfor.Height );
- g.DrawLine( p, pfor1_1_1, pfor1_2_1 );
- pfor1_1 = pfor1_1_1;
- pfor1_2 = pfor1_2_1;
- #endregion
- Rectangle recfor_2 = new Rectangle( pfor1_1.X + AddLeft, pfor1_1.Y + AddTop, ColumnWidth2, RowContentHeight );
- g.DrawString( recfor_2Value, ft10, b, recfor_2 );//画第二列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_2.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第二表与第三列的界线
- StrValue = recfor_3Value;
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor_3 = new Rectangle( pfor2_1.X + ColumnWidth3 - FtWidth - AddLeft * 2, pfor2_1.Y + AddTop, ColumnWidth3, RowContentHeight );
- g.DrawString( recfor_3Value, ft10, b, recfor_3 );//画第三列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_2.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第三表与第四列的界线
- Rectangle recfor_4 = new Rectangle( pfor3_1.X + AddLeft, pfor3_1.Y + AddTop, ColumnWidth4, RowContentHeight );
- g.DrawString( recfor_4Value, ft10, b, recfor_4 );//画第四列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_2.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第四表与第五列的界线
- Rectangle recfor_5 = new Rectangle( pfor4_1.X + AddLeft, pfor4_1.Y + AddTop, ColumnWidth5, RowContentHeight );
- g.DrawString( recfor_5Value, ft10, b, recfor_5 );//画第五列的列标题
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec10 = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec10 );//画标题矩形
- #region 付款情况
- string rec10_1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "付款情况" );
- sizef = g.MeasureString( rec10_1Value, ft11 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec10_1 = new Rectangle( rec10.X + AddLeft, rec10.Y + AddTop2, FtWidth, RowContentHeight );
- g.DrawString( rec10_1Value, ft11, b, rec10_1 );//付款情况
- #endregion
- #region 应付
- Rectangle rec10_2 = new Rectangle( (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付:" ) + (Convert.ToDecimal( htData["StrCope"] ) + Convert.ToDecimal( htData["StrDetain"] )), ft10, b, rec10_2 );//应付
- #endregion
- #region 实付
- Rectangle rec10_3 = new Rectangle( rec10_2.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付:" ) + CopeAmount.ToString( "0.00" ), ft10, b, rec10_3 );//实付
- #endregion
- #region 欠款
- Rectangle rec10_4 = new Rectangle( rec10_3.X + (TableWidth / 4), rec10.Y + AddTop2, TableWidth / 4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款:" ) + Convert.ToDecimal( htData["StrArrears"] ).ToString( "0.00" ), ft10, b, rec10_4 );//实付
- #endregion
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec11 );//画标题矩形
- #region 合计
- Rectangle rec11_1 = new Rectangle( rec11.X + AddLeft, rec11.Y + AddTop2, TableWidth - 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "合计人民币(大写):" ) + " " + LYFZ.Software.MainBusiness.ReportPrint.ReportPrintDataClass.ConversionAmount( CopeAmount.ToString() ), ft11, b, rec11_1 );//合计人民币
- #endregion
- #region 顾客签字
- Rectangle rec11_2 = new Rectangle( rec11_1.X + rec11_1.Width + 100, rec11_1.Y, 300, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字:" ), ft11, b, rec11_2 );//画消费法规
- #endregion
- #region 说明
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + 3, rec9.Width, Convert.ToInt32( g.MeasureString( "说明", ft9 ).Height ) + 1 );
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- g.DrawString( PaymentExplain, ft9, b, rec12 );//画消费法规
- #endregion
- }
- #endregion
- #region 员工奖罚打印
- public enum TextAlignType
- {
- LeftAlignment = 0, // 左对齐;
- HorizontalCenter = 1, // 水平居中;
- VerticalCenter = 2, // 垂直居中;
- RightAlignment = 3 // 右对齐;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="grahpics"></param>
- /// <param name="strText">要输出的文本</param>
- /// <param name="rcText">文本显示的区域</param>
- /// <param name="fText">文本输出时的字体信息</param>
- /// <param name="brush">输出文本时的画刷</param>
- /// <param name="AlignType">文本在区域的对齐方式</param>
- /// <param name="bDrawCell">是否绘制出文本区域单元格</param>
- /// <returns></returns>
- public static bool DrawText( Graphics grahpics, string strText, Rectangle rcText, Font fText, Brush brush, TextAlignType AlignType, bool bDrawCell = false )
- {
- // 页边距;
- int nPageMargine = 1;
- // 参数有效性;
- if ( string.IsNullOrEmpty( strText ) || grahpics == null )
- return false;
- // 计算字体大小;
- SizeF TextSize = grahpics.MeasureString( strText, fText );
- if ( TextSize.Width > rcText.Width )
- return false;
- // 字体高度大于区域高时;
- if ( TextSize.Height > rcText.Height )
- return false;
- // 是否绘制表格;
- if ( bDrawCell )
- grahpics.DrawRectangle( new Pen( Brushes.Black, 1 ), rcText );
- switch ( AlignType )
- {
- case TextAlignType.LeftAlignment: // 左对齐,默认
- {
- rcText.X += nPageMargine; // 左边距;
- if ( bDrawCell ) rcText.Y += 5; // 上边距;
- }
- break;
- case TextAlignType.HorizontalCenter: // 水平居中;
- rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
- break;
- case TextAlignType.VerticalCenter: // 垂直居中;
- rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
- rcText.Y += (rcText.Height - (int)TextSize.Height) / 2;
- break;
- case TextAlignType.RightAlignment: // 右对齐;
- {
- rcText.X += rcText.Width - (int)TextSize.Width - 2;
- if ( bDrawCell ) rcText.Y += 5; // 上边距;
- }
- break;
- default:
- break;
- }
- // 输出文本;
- grahpics.DrawString( strText, fText, brush, rcText );
- return true;
- }
- public static bool DrawText( out SizeF TextSize, Graphics grahpics, string strText, Rectangle rcText, Font fText, Brush brush, TextAlignType AlignType, bool bDrawCell = false )
- {
- TextSize = new SizeF( 0.0f, 0.0f );
- // 参数有效性;
- if ( string.IsNullOrEmpty( strText ) || grahpics == null )
- return false;
- // 计算字体大小;
- TextSize = grahpics.MeasureString( strText, fText );
- if ( TextSize.Width > rcText.Width )
- return false;
- // 字体高度大于区域高时;//换行时会产生;
- if ( TextSize.Height > rcText.Height )
- return false;
- // 是否绘制表格;
- if ( bDrawCell )
- grahpics.DrawRectangle( new Pen( Brushes.Black, 1 ), rcText );
- switch ( AlignType )
- {
- case TextAlignType.LeftAlignment: // 左对齐,默认;
- break;
- case TextAlignType.HorizontalCenter: // 水平居中;
- rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
- break;
- case TextAlignType.VerticalCenter: // 垂直居中;
- rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
- rcText.Y += (rcText.Height - (int)TextSize.Height) / 2;
- break;
- case TextAlignType.RightAlignment: // 右对齐;
- rcText.X += rcText.Width - (int)TextSize.Width;
- break;
- default:
- break;
- }
- // 输出文本;
- grahpics.DrawString( strText, fText, brush, rcText );
- return true;
- }
- public static bool DrawText( out Rectangle rcResult, Graphics grahpics, string strText, Rectangle rcText, Font fText, Brush brush, TextAlignType AlignType, bool bDrawCell = false )
- {
- rcResult = rcText;
- // 参数有效性;
- if ( string.IsNullOrEmpty( strText ) || grahpics == null )
- return false;
- // 计算字体大小;
- SizeF TextSize = grahpics.MeasureString( strText, fText );
- if ( TextSize.Width > rcText.Width )
- return false;
- // 字体高度大于区域高时;
- if ( TextSize.Height > rcText.Height )
- rcText.Height = (int)TextSize.Height;
- // 是否绘制表格;
- if ( bDrawCell )
- grahpics.DrawRectangle( new Pen( Brushes.Black, 1 ), rcText );
- switch ( AlignType )
- {
- case TextAlignType.LeftAlignment: // 左对齐,默认;
- break;
- case TextAlignType.HorizontalCenter: // 水平居中;
- rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
- break;
- case TextAlignType.VerticalCenter: // 垂直居中;
- rcText.X += (rcText.Width - (int)TextSize.Width) / 2;
- rcText.Y += (rcText.Height - (int)TextSize.Height) / 2;
- break;
- case TextAlignType.RightAlignment: // 右对齐;
- rcText.X += rcText.Width - (int)TextSize.Width;
- break;
- default:
- break;
- }
- // 输出文本;
- grahpics.DrawString( strText, fText, brush, rcText );
- // 返回结果区域;
- rcResult.Location = rcText.Location;
- rcResult.Width = rcText.Width;
- rcResult.Height = rcText.Height;
- return true;
- }
- public static void StaffRewardAndPunishment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- int lastY = -1;
- // 解析要打印的数据;
- Hashtable hashtable = (Hashtable)objValue;
- DataGridViewRow dgvr = (DataGridViewRow)hashtable["CurrentRow"];
- // 画刷;
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 10 );
- Font ft10 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- // 获取影楼店信息;
- string strQuery = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo",
- StrWhere: "Company_DividedShop = '" + StrDividedShop + "'",
- ShowColumnName: "Company_Address, Company_Telephone, Company_UpdateDatetime" );
- DataSet dtCompany = orbll.GetView_Custom( strQuery );
- DataTable tbl = dtCompany.Tables["ds"];
- #region 打印二维码
- Image img = CachePhoto( PhotoLogType.DimensionalCode, tbl.Rows[0]["Company_UpdateDatetime"] );
- Rectangle rcQRCode = new Rectangle( 50, 25, 90, 90 );
- if ( img != null )
- {
- g.DrawImage( img, rcQRCode );
- }
- #endregion
- int TableWidth = size.Width - rcQRCode.X * 2;
- #region 打印票据标题
- SizeF TextSize;
- Rectangle rcConfig = new Rectangle( size.Width / 4, 30, size.Width / 2, 30 );
- DrawText( g, DefaultPrintTitle, rcConfig, ft16, b, TextAlignType.VerticalCenter );
- #endregion
- #region 打印影楼地址;
- string strStudioAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "地址: " ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- rcConfig = new Rectangle( rcQRCode.X + rcQRCode.Width + 5, rcQRCode.Y + rcQRCode.Height / 2, size.Width / 2, 30 );
- DrawText( out TextSize, g, strStudioAddress, rcConfig, ft10, b, TextAlignType.LeftAlignment );
- #endregion
- #region 打印影楼电话;
- string strStudioTelephone = LYFZ.BLL.OtherCommonModel.FontConversion( "电话: " ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + (int)TextSize.Height + 2, size.Width / 2, 30 );
- DrawText( out TextSize, g, strStudioTelephone, rcConfig, ft10, b, TextAlignType.LeftAlignment );
- #endregion
- #region 打印日期;
- string strPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期: " ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, size.Width - rcConfig.X - rcConfig.Width - 50, 30 );
- DrawText( out TextSize, g, strPrintDate, rcConfig, ft10, b, TextAlignType.RightAlignment );
- #endregion
- int RowHeight = 26;
- int ColumnWidth = TableWidth / 6;
- // 在二维码下方7个像素开始画;
- Rectangle rec9 = new Rectangle( rcQRCode.X + 7, rcQRCode.Y + rcQRCode.Height + 2, ColumnWidth * 6, RowHeight );
- g.DrawRectangle( p, rec9 );
- #region 奖罚类型;
- string strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "奖罚类型" );
- rcConfig = new Rectangle( rec9.X, rec9.Y, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- strValue = dgvr.Cells["奖罚类型"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- #endregion
- #region 执行方式;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "执行方式" );
- rcConfig = new Rectangle( rec9.X + ColumnWidth, rec9.Y, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- strValue = dgvr.Cells["是否执行"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- #endregion
- #region 金额;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金额" );
- rcConfig = new Rectangle( rec9.X + ColumnWidth * 2, rec9.Y, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- strValue = dgvr.Cells["奖罚金额"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- #endregion
- #region 相关人员;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "相关人员" );
- rcConfig = new Rectangle( rec9.X + ColumnWidth * 3, rec9.Y, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- strValue = dgvr.Cells["相关人员"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- #endregion
- #region 录单人员;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "录单人员" );
- rcConfig = new Rectangle( rec9.X + ColumnWidth * 4, rec9.Y, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- strValue = dgvr.Cells["录单人"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- #endregion
- #region 执行日期;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "执行日期" );
- rcConfig = new Rectangle( rec9.X + ColumnWidth * 5, rec9.Y, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- strValue = dgvr.Cells["执行日期"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X, rcConfig.Y + rcConfig.Height, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- #endregion
- #region 备注;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备注:" );
- rcConfig = new Rectangle( rec9.X, rec9.Y + RowHeight * 2, ColumnWidth * 6, RowHeight * 5 );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.LeftAlignment, true );
- // 备注内容;
- strValue = dgvr.Cells["备注"].Value.ToString();
- rcConfig = new Rectangle( rec9.X + 30, rec9.Y + RowHeight * 3, ColumnWidth * 6, RowHeight * 5 );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.LeftAlignment );
- #endregion
- #region 领导审批;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "领导审批:" );
- rcConfig = new Rectangle( rec9.X, rec9.Y + RowHeight * 7, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- rcConfig = new Rectangle( rec9.X + ColumnWidth, rec9.Y + RowHeight * 7, ColumnWidth * 2, RowHeight );
- g.DrawRectangle( p, rcConfig );
- #endregion
- #region 相关人员签字;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "相关人员签字:" );
- rcConfig = new Rectangle( rec9.X + ColumnWidth * 3, rec9.Y + RowHeight * 7, ColumnWidth, RowHeight );
- DrawText( g, strValue, rcConfig, ft10, b, TextAlignType.VerticalCenter, true );
- rcConfig = new Rectangle( rec9.X + ColumnWidth * 4, rec9.Y + RowHeight * 7, ColumnWidth * 2, RowHeight );
- g.DrawRectangle( p, rcConfig );
- #endregion
- }
- #endregion
- #endregion
- #region 财务报表
- #region 日报表
- /// <summary>
- /// 日财务报表
- /// </summary>
- /// <param name="dgv">数据列表</param>
- /// <param name="StrOrd_Number">数据总汇:</param>
- public static void FinanceReportDays( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- string StrText = htData["StrText"].ToString().Trim();
- string StrDateWeek = htData["StrDateWeek"].ToString().Trim();
- DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Name" ).Tables[0];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 15 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 25;
- int RowContentHeight = 15;
- int ColumnWidth2 = 90;
- int ColumnWidth3 = 90;
- int ColumnWidth4 = 120;
- int ColumnWidth5 = 140;
- int ColumnWidth6 = 70;
- int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6;
- //金色童年收据凭据
- string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + StrDateWeek.Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( "账务报表" ) + htData["StrTilte"].ToString().Trim();
- SizeF sizef = g.MeasureString( rec2Value, ft16 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
- g.DrawString( rec2Value, ft16, b, rec1 );
- int PageRows = 48;//每页多少行
- int PageCount = dgvData.Rows.Count / PageRows;
- if ( dgvData.Rows.Count % PageRows > 0 )
- {
- PageCount++;
- }
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + PrintCurrentIndexPage + "/" + PageCount;
- sizef = g.MeasureString( StrValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1_1 = new Rectangle( LeftWidth + TableWidth - StrWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
- g.DrawString( StrValue, ft9, b, rec1_1 );//画消费法规
- #region 画列标题
- Rectangle rec2 = new Rectangle( LeftWidth, rec1_1.Y + rec1_1.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "项目名称" );
- sizef = g.MeasureString( StrValue, ft10 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_1 = new Rectangle( rec2.X + (ColumnWidth1 / 2 - FtWidth / 2), rec2.Y + TopAdd + 2, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_1 );//画第一列的列标题
- Point p21_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
- Point p21_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
- g.DrawLine( p, p21_1, p21_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金额" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_2 = new Rectangle( p21_1.X + (ColumnWidth2 / 2 - FtWidth / 2), p21_1.Y + TopAdd + 2, ColumnWidth2, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_2 );//画第一列的列标题
- Point p22_1 = new Point( p21_1.X + ColumnWidth2, rec2.Y );
- Point p22_2 = new Point( p21_1.X + ColumnWidth2, rec2.Y + rec2.Height );
- g.DrawLine( p, p22_1, p22_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "项目类别" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_3 = new Rectangle( p22_1.X + (ColumnWidth3 / 2 - FtWidth / 2), p22_1.Y + TopAdd + 2, ColumnWidth3, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_3 );//画第一列的列标题
- Point p23_1 = new Point( p22_1.X + ColumnWidth3, rec2.Y );
- Point p23_2 = new Point( p22_1.X + ColumnWidth3, rec2.Y + rec2.Height );
- g.DrawLine( p, p23_1, p23_2 );//画第一表与第二列的界线
- if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
- {
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "类型/支付方式" );
- }
- else
- {
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "开单人" );
- }
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_4 = new Rectangle( p23_1.X + (ColumnWidth4 / 2 - FtWidth / 2), p23_1.Y + TopAdd + 2, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_4 );//画第一列的列标题
- Point p24_1 = new Point( p23_1.X + ColumnWidth4, rec2.Y );
- Point p24_2 = new Point( p23_1.X + ColumnWidth4, rec2.Y + rec2.Height );
- g.DrawLine( p, p24_1, p24_2 );//画第一表与第二列的界线
- if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
- {
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户/备注" );
- }
- else
- {
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名" );
- }
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_5 = new Rectangle( p24_1.X + (ColumnWidth5 / 2 - FtWidth / 2), p24_1.Y + TopAdd + 2, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_5 );//画第一列的列标题
- if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
- {
- Point p25_1 = new Point( p24_1.X + ColumnWidth5, rec2.Y );
- Point p25_2 = new Point( p24_1.X + ColumnWidth5, rec2.Y + rec2.Height );
- g.DrawLine( p, p25_1, p25_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "门市" );
- sizef = g.MeasureString( StrValue, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_6 = new Rectangle( p25_1.X + (ColumnWidth6 / 2 - FtWidth / 2), p25_1.Y + TopAdd + 2, ColumnWidth6, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_6 );//画第一列的列标题
- Point p26_1 = new Point( p25_1.X + ColumnWidth6, rec2.Y );
- Point p26_2 = new Point( p25_1.X + ColumnWidth6, rec2.Y + rec2.Height );
- g.DrawLine( p, p26_1, p26_2 );//画第一表与第二列的界线
- }
- #endregion
- #region 画行
- int RowHeight2 = 20;
- int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
- int IntPoint_Y = rec2.Y + rec2.Height;
- int ForCount = 0;
- bool IsNextPage = false;
- for ( int i = PrintForCount; i < dgvData.Rows.Count; i++ )
- {
- if ( i == dgvData.Rows.Count )
- {
- break;
- }
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
- g.DrawRectangle( p, recfor );//画标题矩形
- string StrName = "";
- if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
- {
- if ( dgvData.Rows[PrintForCount].Cells["项目名称"].Value != null )
- {
- StrName = dgvData.Rows[PrintForCount].Cells["项目名称"].Value.ToString().Trim();
- }
- if ( !string.IsNullOrEmpty( dgvData.Rows[PrintForCount].Cells["项目备注"].Value.ToString().Trim() ) && !string.IsNullOrEmpty( StrName ) )
- {
- StrName += "/" + dgvData.Rows[PrintForCount].Cells["项目备注"].Value.ToString().Trim();
- }
- }
- else
- {
- StrName = dgvData.Rows[PrintForCount].Cells["项目名称"].Value.ToString().Trim();
- }
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrName, ft9, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- string StrPhone = dgvData.Rows[PrintForCount].Cells["金额"].Value.ToString().Trim();
- sizef = g.MeasureString( StrPhone, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrPhone, ft9, b, recfor2_2 );//画第一列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
- Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( dgvData.Rows[PrintForCount].Cells["项目类别"].Value.ToString().Trim(), ft9, b, recfor2_3 );//画第一列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
- Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4 - (LeftAdd * 2), RowContentHeight2 );
- if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
- {
- g.DrawString( dgvData.Rows[PrintForCount].Cells["收入/支出"].Value.ToString().Trim() + "/" + dgvData.Rows[PrintForCount].Cells["支付方式"].Value.ToString().Trim(), ft9, b, recfor2_4 );
- }
- else
- {
- g.DrawString( dgvData.Rows[PrintForCount].Cells["开单人"].Value.ToString().Trim(), ft9, b, recfor2_4 );
- }
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
- Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( dgvData.Rows[PrintForCount].Cells["客户姓名"].Value.ToString().Trim(), ft9, b, recfor2_5 );//画第一列的列标题
- if ( string.IsNullOrEmpty( htData["IsPrintType"].ToString().Trim() ) )
- {
- Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
- Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor5_1, pfor5_2 );//画第一表与第二列的界线
- Rectangle recfor2_6 = new Rectangle( pfor5_1.X + LeftAdd, pfor5_1.Y + TopAdd, ColumnWidth6 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( dgvData.Rows[PrintForCount].Cells["开单人"].Value.ToString().Trim(), ft9, b, recfor2_6 );//画第一列的列标题
- Point pfor6_1 = new Point( pfor5_1.X + ColumnWidth6, recfor.Y );
- Point pfor6_2 = new Point( pfor5_1.X + ColumnWidth6, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor6_1, pfor6_2 );//画第一表与第二列的界线
- }
- PrintForCount++;
- ForCount++;
- IntPoint_Y = recfor.Y + recfor.Height;
- if ( ForCount == PageRows )
- {
- break;
- }
- }
- #endregion
- if ( PrintForCount < dgvData.Rows.Count )
- {
- PrintCurrentIndexPage++;
- IsNextPage = true;
- IsHasMorePages = true;
- return;
- }
- if ( (dgvData.Rows.Count - ((PrintCurrentIndexPage - 1) * PrintForCount)) == 48 || (dgvData.Rows.Count - ((PrintCurrentIndexPage - 1) * PrintForCount)) == 47 )
- {
- PrintCurrentIndexPage++;
- IsNextPage = true;
- IsHasMorePages = true;
- return;
- }
- if ( !IsNextPage )
- {
- sizef = g.MeasureString( StrText.Trim(), ft9, TableWidth );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3 = new Rectangle( rec2.X, IntPoint_Y, TableWidth, Convert.ToInt32( sizef.Height ) + 5 );
- g.DrawRectangle( p, rec3 );//画标题矩形
- Rectangle rec3_1 = new Rectangle( rec3.X, rec3.Y + 5, TableWidth, Convert.ToInt32( sizef.Height ) );
- g.DrawString( StrText.Trim(), ft9, b, rec3_1 );//画第一列的列标题
- IsHasMorePages = false;
- }
- }
- #endregion
- #region 月报表
- /// <summary>
- /// 月财务报表
- /// </summary>
- /// <param name="dgv">数据列表</param>
- /// <param name="StrOrd_Number">数据总汇:</param>
- public static void FinanceReportMonth( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- string StrText = htData["StrText"].ToString().Trim();
- string StrDateWeek = htData["StrDateWeek"].ToString().Trim();
- DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Name" ).Tables[0];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 2;
- int TopAdd = 7;
- int RowHeight = 45;
- int RowContentHeight = 45;
- int ColumnWidth1 = 45;
- int ColumnWidth2 = (TableWidth - ColumnWidth1) / 11;
- //金色童年收据凭据
- string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + StrDateWeek + "账务报表";
- SizeF sizef = g.MeasureString( rec2Value, ft16 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
- g.DrawString( rec2Value, ft16, b, rec1 );
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( StrValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1_1 = new Rectangle( LeftWidth + TableWidth - StrWidth, rec1.Y + rec1.Height + 5, StrWidth, StrHeigth );
- g.DrawString( StrValue, ft9, b, rec1_1 );//画消费法规
- #region 画列标题
- Rectangle rec2 = new Rectangle( LeftWidth, rec1_1.Y + rec1_1.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- Rectangle rec2_1 = new Rectangle( rec2.X + LeftAdd, rec2.Y + TopAdd + 10, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "日期" ), ft10, b, rec2_1 );//画第一列的列标题
- Point p21_1 = new Point( rec2.X + rec2_1.Width, rec2.Y );
- Point p21_2 = new Point( rec2.X + rec2_1.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p21_1, p21_2 );//画第一表与第二列的界线
- Rectangle rec2_2 = new Rectangle( p21_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总收入" ), ft10, b, rec2_2 );//画第一列的列标题
- Point p22_1 = new Point( p21_1.X + rec2_2.Width, rec2.Y );
- Point p22_2 = new Point( p21_1.X + rec2_2.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p22_1, p22_2 );//画第一表与第二列的界线
- Rectangle rec2_3 = new Rectangle( p22_1.X + LeftAdd, rec2.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 订单\r\n 收入" ), ft10, b, rec2_3 );//画第一列的列标题
- Point p23_1 = new Point( p22_1.X + rec2_3.Width, rec2.Y );
- Point p23_2 = new Point( p22_1.X + rec2_3.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p23_1, p23_2 );//画第一表与第二列的界线
- Rectangle rec2_4 = new Rectangle( p23_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 补款\r\n 收入" ), ft10, b, rec2_4 );//画第一列的列标题
- Point p24_1 = new Point( p23_1.X + rec2_4.Width, rec2.Y );
- Point p24_2 = new Point( p23_1.X + rec2_4.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p24_1, p24_2 );//画第一表与第二列的界线
- Rectangle rec2_5 = new Rectangle( p24_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 后期\r\n 收入" ), ft10, b, rec2_5 );//画第一列的列标题
- Point p25_1 = new Point( p24_1.X + rec2_5.Width, rec2.Y );
- Point p25_2 = new Point( p24_1.X + rec2_5.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p25_1, p25_2 );//画第一表与第二列的界线
- Rectangle rec2_6 = new Rectangle( p25_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 其他\r\n 收入" ), ft10, b, rec2_6 );//画第一列的列标题
- Point p26_1 = new Point( p25_1.X + rec2_6.Width, rec2.Y );
- Point p26_2 = new Point( p25_1.X + rec2_6.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p26_1, p26_2 );//画第一表与第二列的界线
- Rectangle rec2_7 = new Rectangle( p26_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 会员\r\n 充值" ), ft10, b, rec2_7 );//画第一列的列标题
- Point p27_1 = new Point( p26_1.X + rec2_7.Width, rec2.Y );
- Point p27_2 = new Point( p26_1.X + rec2_7.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p27_1, p27_2 );//画第一表与第二列的界线
- Rectangle rec2_8 = new Rectangle( p27_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 服务卡\r\n 充值" ), ft10, b, rec2_8 );//画第一列的列标题
- Point p28_1 = new Point( p27_1.X + rec2_8.Width, rec2.Y );
- Point p28_2 = new Point( p27_1.X + rec2_8.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p28_1, p28_2 );//画第一表与第二列的界线
- Rectangle rec2_9 = new Rectangle( p28_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 前期\r\n 业绩" ), ft10, b, rec2_9 );//画第一列的列标题
- Point p29_1 = new Point( p28_1.X + rec2_9.Width, rec2.Y );
- Point p29_2 = new Point( p28_1.X + rec2_9.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p29_1, p29_2 );//画第一表与第二列的界线
- Rectangle rec2_10 = new Rectangle( p29_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 后期\r\n 业绩" ), ft10, b, rec2_10 );//画第一列的列标题
- Point p210_1 = new Point( p29_1.X + rec2_10.Width, rec2.Y );
- Point p210_2 = new Point( p29_1.X + rec2_10.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p210_1, p210_2 );//画第一表与第二列的界线
- Rectangle rec2_11 = new Rectangle( p210_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总业绩" ), ft10, b, rec2_11 );//画第一列的列标题
- Point p211_1 = new Point( p210_1.X + rec2_11.Width, rec2.Y );
- Point p211_2 = new Point( p210_1.X + rec2_11.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p211_1, p211_2 );//画第一表与第二列的界线
- Rectangle rec2_12 = new Rectangle( p211_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总支出" ), ft10, b, rec2_12 );//画第一列的列标题
- #endregion
- #region 画行
- int RowHeight2 = 25;
- int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
- int IntPoint_Y = rec2.Y + rec2.Height;
- for ( int i = 0; i < dgvData.Rows.Count; i++ )
- {
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
- g.DrawRectangle( p, recfor );//画标题矩形
- string StrName = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.Rows[i].Cells["日期"].Value, "MM-dd" );
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrName, ft9, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- string StrValue1 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总收入"].Value );
- sizef = g.MeasureString( StrValue1, ft9 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue1, ft9, b, recfor2_2 );//画第一列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
- string StrValue2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["订单定金"].Value );
- sizef = g.MeasureString( StrValue2, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_3 = new Rectangle( pfor2_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue2, ft9, b, recfor2_3 );//画第一列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth2, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
- string StrValue3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["订单补款"].Value );
- sizef = g.MeasureString( StrValue3, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_4 = new Rectangle( pfor3_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue3, ft9, b, recfor2_4 );//画第一列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth2, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
- string StrValue4 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["后期收入"].Value );
- sizef = g.MeasureString( StrValue4, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_5 = new Rectangle( pfor4_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue4, ft9, b, recfor2_5 );//画第一列的列标题
- Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth2, recfor.Y );
- Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor5_1, pfor5_2 );//画第一表与第二列的界线
- string StrValue5 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["其它收入"].Value );
- sizef = g.MeasureString( StrValue5, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_6 = new Rectangle( pfor5_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor5_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue5, ft9, b, recfor2_6 );//画第一列的列标题
- Point pfor6_1 = new Point( pfor5_1.X + ColumnWidth2, recfor.Y );
- Point pfor6_2 = new Point( pfor5_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor6_1, pfor6_2 );//画第一表与第二列的界线
- string StrValue6 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["会员充值"].Value );
- sizef = g.MeasureString( StrValue6, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_7 = new Rectangle( pfor6_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor6_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue6, ft9, b, recfor2_7 );//画第一列的列标题
- Point pfor7_1 = new Point( pfor6_1.X + ColumnWidth2, recfor.Y );
- Point pfor7_2 = new Point( pfor6_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor7_1, pfor7_2 );//画第一表与第二列的界线
- string StrValue7 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["服务卡充值"].Value );
- sizef = g.MeasureString( StrValue7, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_8 = new Rectangle( pfor7_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor7_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue7, ft9, b, recfor2_8 );//画第一列的列标题
- Point pfor8_1 = new Point( pfor7_1.X + ColumnWidth2, recfor.Y );
- Point pfor8_2 = new Point( pfor7_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor8_1, pfor8_2 );//画第一表与第二列的界线
- string StrValue8 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["前期业绩"].Value );
- sizef = g.MeasureString( StrValue8, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_9 = new Rectangle( pfor8_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor8_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue8, ft9, b, recfor2_9 );//画第一列的列标题
- Point pfor9_1 = new Point( pfor8_1.X + ColumnWidth2, recfor.Y );
- Point pfor9_2 = new Point( pfor8_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor9_1, pfor9_2 );//画第一表与第二列的界线
- string StrValue9 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["后期业绩"].Value );
- sizef = g.MeasureString( StrValue9, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_10 = new Rectangle( pfor9_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor9_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue9, ft9, b, recfor2_10 );//画第一列的列标题
- Point pfor10_1 = new Point( pfor9_1.X + ColumnWidth2, recfor.Y );
- Point pfor10_2 = new Point( pfor9_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor10_1, pfor10_2 );//画第一表与第二列的界线
- string StrValue10 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总业绩"].Value );
- sizef = g.MeasureString( StrValue10, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_11 = new Rectangle( pfor10_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor10_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue10, ft9, b, recfor2_11 );//画第一列的列标题
- Point pfor11_1 = new Point( pfor10_1.X + ColumnWidth2, recfor.Y );
- Point pfor11_2 = new Point( pfor10_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor11_1, pfor11_2 );//画第一表与第二列的界线
- string StrValue11 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总支出"].Value );
- sizef = g.MeasureString( StrValue11, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_12 = new Rectangle( pfor11_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor11_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue11, ft9, b, recfor2_12 );//画第一列的列标题
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec3 = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight * 2 );
- g.DrawRectangle( p, rec2 );//画标题矩形
- Rectangle rec3_1 = new Rectangle( rec3.X, rec3.Y + 5, TableWidth, rec3.Height - TopAdd * 2 );
- g.DrawString( StrText.Trim(), ft9, b, rec3_1 );//画第一列的列标题
- }
- #endregion
- #region 年报表
- /// <summary>
- /// 年财务报表
- /// </summary>
- /// <param name="dgvData">数据列表</param>
- /// <param name="StrOrd_Number">数据总汇:</param>
- public static void FinanceReportYear( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- string StrText = htData["StrText"].ToString().Trim();
- string StrDateWeek = htData["StrDateWeek"].ToString().Trim();
- DataTable tbl = orbll.GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Name" ).Tables[0];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft18 = new Font( "宋体", 18 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 7.5f );
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2 + 31;
- int LeftAdd = 2;
- int TopAdd = 7;
- int RowHeight = 45;
- int RowContentHeight = 45;
- int ColumnWidth1 = 50;
- int ColumnWidth2 = (TableWidth - ColumnWidth1) / 11;
- //金色童年收据凭据
- string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + StrDateWeek + "账务报表";
- SizeF sizef = g.MeasureString( rec2Value, ft18 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
- g.DrawString( rec2Value, ft18, b, rec1 );
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + SDateTime.Now.ToString( "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( StrValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1_1 = new Rectangle( LeftWidth + TableWidth - StrWidth, rec1.Y + rec1.Height + 5, StrWidth, StrHeigth );
- g.DrawString( StrValue, ft9, b, rec1_1 );//画消费法规
- #region 画列标题
- Rectangle rec2 = new Rectangle( LeftWidth, rec1_1.Y + rec1_1.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- Rectangle rec2_1 = new Rectangle( rec2.X + LeftAdd, rec2.Y + 10 + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "月份" ), ft10, b, rec2_1 );//画第一列的列标题
- Point p21_1 = new Point( rec2.X + rec2_1.Width, rec2.Y );
- Point p21_2 = new Point( rec2.X + rec2_1.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p21_1, p21_2 );//画第一表与第二列的界线
- Rectangle rec2_2 = new Rectangle( p21_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总收入" ), ft10, b, rec2_2 );//画第一列的列标题
- Point p22_1 = new Point( p21_1.X + rec2_2.Width, rec2.Y );
- Point p22_2 = new Point( p21_1.X + rec2_2.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p22_1, p22_2 );//画第一表与第二列的界线
- Rectangle rec2_3 = new Rectangle( p22_1.X + LeftAdd, p22_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 订单\r\n 收入" ), ft10, b, rec2_3 );//画第一列的列标题
- Point p23_1 = new Point( p22_1.X + rec2_3.Width, rec2.Y );
- Point p23_2 = new Point( p22_1.X + rec2_3.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p23_1, p23_2 );//画第一表与第二列的界线
- Rectangle rec2_4 = new Rectangle( p23_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 补款\r\n 收入" ), ft10, b, rec2_4 );//画第一列的列标题
- Point p24_1 = new Point( p23_1.X + rec2_4.Width, rec2.Y );
- Point p24_2 = new Point( p23_1.X + rec2_4.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p24_1, p24_2 );//画第一表与第二列的界线
- Rectangle rec2_5 = new Rectangle( p24_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 后期\r\n 收入" ), ft10, b, rec2_5 );//画第一列的列标题
- Point p25_1 = new Point( p24_1.X + rec2_5.Width, rec2.Y );
- Point p25_2 = new Point( p24_1.X + rec2_5.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p25_1, p25_2 );//画第一表与第二列的界线
- Rectangle rec2_6 = new Rectangle( p25_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 其他\r\n 收入" ), ft10, b, rec2_6 );//画第一列的列标题
- Point p26_1 = new Point( p25_1.X + rec2_6.Width, rec2.Y );
- Point p26_2 = new Point( p25_1.X + rec2_6.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p26_1, p26_2 );//画第一表与第二列的界线
- Rectangle rec2_7 = new Rectangle( p26_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 会员\r\n 充值" ), ft10, b, rec2_7 );//画第一列的列标题
- Point p27_1 = new Point( p26_1.X + rec2_7.Width, rec2.Y );
- Point p27_2 = new Point( p26_1.X + rec2_7.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p27_1, p27_2 );//画第一表与第二列的界线
- Rectangle rec2_8 = new Rectangle( p27_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 服务卡\r\n 充值" ), ft10, b, rec2_8 );//画第一列的列标题
- Point p28_1 = new Point( p27_1.X + rec2_8.Width, rec2.Y );
- Point p28_2 = new Point( p27_1.X + rec2_8.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p28_1, p28_2 );//画第一表与第二列的界线
- Rectangle rec2_9 = new Rectangle( p28_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 前期\r\n 业绩" ), ft10, b, rec2_9 );//画第一列的列标题
- Point p29_1 = new Point( p28_1.X + rec2_9.Width, rec2.Y );
- Point p29_2 = new Point( p28_1.X + rec2_9.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p29_1, p29_2 );//画第一表与第二列的界线
- Rectangle rec2_10 = new Rectangle( p29_1.X + LeftAdd, rec2_3.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 后期\r\n 业绩" ), ft10, b, rec2_10 );//画第一列的列标题
- Point p210_1 = new Point( p29_1.X + rec2_10.Width, rec2.Y );
- Point p210_2 = new Point( p29_1.X + rec2_10.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p210_1, p210_2 );//画第一表与第二列的界线
- Rectangle rec2_11 = new Rectangle( p210_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总业绩" ), ft10, b, rec2_11 );//画第一列的列标题
- Point p211_1 = new Point( p210_1.X + rec2_11.Width, rec2.Y );
- Point p211_2 = new Point( p210_1.X + rec2_11.Width, rec2.Y + rec2.Height );
- g.DrawLine( p, p211_1, p211_2 );//画第一表与第二列的界线
- Rectangle rec2_12 = new Rectangle( p211_1.X + LeftAdd, rec2_1.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "总支出" ), ft10, b, rec2_12 );//画第一列的列标题
- #endregion
- #region 画行
- int RowHeight2 = 25;
- int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
- int IntPoint_Y = rec2.Y + rec2.Height;
- for ( int i = 0; i < dgvData.Rows.Count; i++ )
- {
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
- g.DrawRectangle( p, recfor );//画标题矩形
- string StrName = LYFZ.Command.Command_Validate.DateTimeToString( dgvData.Rows[i].Cells["月份"].Value, "yyyy-MM" );
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrName, ft9, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- string StrValue1 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总收入"].Value );
- sizef = g.MeasureString( StrValue1, ft9 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue1, ft9, b, recfor2_2 );//画第一列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
- string StrValue2 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["订单定金"].Value );
- sizef = g.MeasureString( StrValue2, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_3 = new Rectangle( pfor2_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue2, ft9, b, recfor2_3 );//画第一列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth2, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
- string StrValue3 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["订单补款"].Value );
- sizef = g.MeasureString( StrValue3, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_4 = new Rectangle( pfor3_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue3, ft9, b, recfor2_4 );//画第一列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth2, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
- string StrValue4 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["后期收入"].Value );
- sizef = g.MeasureString( StrValue4, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_5 = new Rectangle( pfor4_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue4, ft9, b, recfor2_5 );//画第一列的列标题
- Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth2, recfor.Y );
- Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor5_1, pfor5_2 );//画第一表与第二列的界线
- string StrValue5 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["其它收入"].Value );
- sizef = g.MeasureString( StrValue5, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_6 = new Rectangle( pfor5_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor5_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue5, ft9, b, recfor2_6 );//画第一列的列标题
- Point pfor6_1 = new Point( pfor5_1.X + ColumnWidth2, recfor.Y );
- Point pfor6_2 = new Point( pfor5_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor6_1, pfor6_2 );//画第一表与第二列的界线
- string StrValue6 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["会员充值"].Value );
- sizef = g.MeasureString( StrValue6, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_7 = new Rectangle( pfor6_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor6_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue6, ft9, b, recfor2_7 );//画第一列的列标题
- Point pfor7_1 = new Point( pfor6_1.X + ColumnWidth2, recfor.Y );
- Point pfor7_2 = new Point( pfor6_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor7_1, pfor7_2 );//画第一表与第二列的界线
- string StrValue7 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["服务卡充值"].Value );
- sizef = g.MeasureString( StrValue7, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_8 = new Rectangle( pfor7_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor7_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue7, ft9, b, recfor2_8 );//画第一列的列标题
- Point pfor8_1 = new Point( pfor7_1.X + ColumnWidth2, recfor.Y );
- Point pfor8_2 = new Point( pfor7_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor8_1, pfor8_2 );//画第一表与第二列的界线
- string StrValue8 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["前期业绩"].Value );
- sizef = g.MeasureString( StrValue8, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_9 = new Rectangle( pfor8_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor8_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue8, ft9, b, recfor2_9 );//画第一列的列标题
- Point pfor9_1 = new Point( pfor8_1.X + ColumnWidth2, recfor.Y );
- Point pfor9_2 = new Point( pfor8_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor9_1, pfor9_2 );//画第一表与第二列的界线
- string StrValue9 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["后期业绩"].Value );
- sizef = g.MeasureString( StrValue9, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_10 = new Rectangle( pfor9_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor9_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue9, ft9, b, recfor2_10 );//画第一列的列标题
- Point pfor10_1 = new Point( pfor9_1.X + ColumnWidth2, recfor.Y );
- Point pfor10_2 = new Point( pfor9_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor10_1, pfor10_2 );//画第一表与第二列的界线
- string StrValue10 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总业绩"].Value );
- sizef = g.MeasureString( StrValue10, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_11 = new Rectangle( pfor10_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor10_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue10, ft9, b, recfor2_11 );//画第一列的列标题
- Point pfor11_1 = new Point( pfor10_1.X + ColumnWidth2, recfor.Y );
- Point pfor11_2 = new Point( pfor10_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor11_1, pfor11_2 );//画第一表与第二列的界线
- string StrValue11 = LYFZ.BLL.OtherCommonModel.RemoveLastExcessZero( dgvData.Rows[i].Cells["总支出"].Value );
- sizef = g.MeasureString( StrValue11, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_12 = new Rectangle( pfor11_1.X + ColumnWidth2 - FtWidth - LeftAdd, pfor11_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrValue11, ft9, b, recfor2_12 );//画第一列的列标题
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- Rectangle rec3 = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight * 2 );
- g.DrawRectangle( p, rec2 );//画标题矩形
- Rectangle rec3_1 = new Rectangle( rec3.X, rec3.Y + 5, TableWidth, rec3.Height - TopAdd * 2 );
- g.DrawString( StrText.Trim(), ft9, b, rec3_1 );//画第一列的列标题
- }
- #endregion
- #endregion
- #region 拍照明细
- /// <summary>
- /// 摄控本拍照客人——明细
- /// </summary>
- /// <returns></returns>
- public static void CameraControlBook_PhotographsGuestDetail_Print( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- ArrayList Alist = (ArrayList)htData["Alist"];
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft17 = new Font( "宋体", 17 );
- Font ft9 = new Font( "宋体", 9 );
- Font ft9b = new Font( "宋体", 9, FontStyle.Bold );
- Font ft8 = new Font( "宋体", 8 );
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 3;
- int TopAdd = 5;
- int RowHeight = 35;
- int RowContentHeight = 35;
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft17 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
- g.DrawString( DefaultPrintTitle, ft17, b, rec1 );
- int ColumnWidth1 = 0;
- int ColumnWidth2 = 0;
- int ColumnWidth4 = 0;
- int ColumnWidth5 = 0;
- int ColumnWidth6 = 0;
- int ColumnWidth7 = 0;
- int ColumnWidth8 = 0;
- int ColumnWidth9 = 0;
- int ColumnWidth3 = 0;
- if ( htData["Ver"].ToString().Trim() == "1" || htData["Ver"].ToString().Trim() == "-1" )
- {
- ColumnWidth1 = 60;
- ColumnWidth2 = 80;
- ColumnWidth4 = 70;
- ColumnWidth5 = 60;
- ColumnWidth6 = 60;
- ColumnWidth7 = 60;
- ColumnWidth8 = 80;
- ColumnWidth9 = 60;
- ColumnWidth3 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7 - ColumnWidth8 - ColumnWidth9;
- }
- else
- {
- ColumnWidth1 = 60;
- ColumnWidth2 = 80;
- ColumnWidth4 = 70;
- ColumnWidth5 = 60;
- ColumnWidth6 = 60;
- ColumnWidth7 = 60;
- ColumnWidth8 = 80;
- ColumnWidth3 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7 - ColumnWidth8;
- }
- #region 画列标题
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 10, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- Rectangle rec2_1 = new Rectangle( rec2.X + LeftAdd + 10, rec2.Y + TopAdd + 5, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客人" ), ft9b, b, rec2_1 );//画第一列的列标题
- Point p1_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
- Point p1_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- Rectangle rec2_2 = new Rectangle( p1_1.X + LeftAdd + 10, rec2_1.Y, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "电话" ), ft9b, b, rec2_2 );//画第一列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec2.Y );
- Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec2.Y + rec2.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
- Rectangle rec2_3 = new Rectangle( p2_1.X + LeftAdd + 30, rec2_1.Y, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄名称" ), ft9b, b, rec2_3 );//画第一列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec2.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec2.Y + rec2.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第一表与第二列的界线
- Rectangle rec2_4 = new Rectangle( p3_1.X + LeftAdd + 10, p3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 日期\r\n/时间" ), ft9b, b, rec2_4 );//画第一列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec2.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec2.Y + rec2.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第一表与第二列的界线
- Rectangle rec2_5 = new Rectangle( p4_1.X + LeftAdd + 5, rec2_4.Y, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影师\r\n/助理" ), ft9b, b, rec2_5 );//画第一列的列标题
- Point p5_1 = new Point( p4_1.X + ColumnWidth5, rec2.Y );
- Point p5_2 = new Point( p4_1.X + ColumnWidth5, rec2.Y + rec2.Height );
- g.DrawLine( p, p5_1, p5_2 );//画第一表与第二列的界线
- Rectangle rec2_6 = new Rectangle( p5_1.X + LeftAdd + 5, rec2_4.Y, ColumnWidth6, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆师\r\n/助理" ), ft9b, b, rec2_6 );//画第一列的列标题
- Point p6_1 = new Point( p5_1.X + ColumnWidth6, rec2.Y );
- Point p6_2 = new Point( p5_1.X + ColumnWidth6, rec2.Y + rec2.Height );
- g.DrawLine( p, p6_1, p6_2 );//画第一表与第二列的界线
- Rectangle rec2_7 = new Rectangle( p6_1.X + LeftAdd + 5, rec2_4.Y, ColumnWidth7, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服装师\r\n/服装数" ), ft9b, b, rec2_7 );//画第一列的列标题
- Point p7_1 = new Point( p6_1.X + ColumnWidth7, rec2.Y );
- Point p7_2 = new Point( p6_1.X + ColumnWidth7, rec2.Y + rec2.Height );
- g.DrawLine( p, p7_1, p7_2 );//画第一表与第二列的界线
- Rectangle rec2_8 = new Rectangle( p7_1.X + LeftAdd + 10, rec2_1.Y, ColumnWidth8, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门市" ), ft9b, b, rec2_8 );//画第一列的列标题
- if ( htData["Ver"].ToString().Trim() == "1" || htData["Ver"].ToString().Trim() == "-1" )
- {
- Point p8_1 = new Point( p7_1.X + ColumnWidth8, rec2.Y );
- Point p8_2 = new Point( p7_1.X + ColumnWidth8, rec2.Y + rec2.Height );
- g.DrawLine( p, p8_1, p8_2 );//画第一表与第二列的界线
- Rectangle rec2_9 = new Rectangle( p8_1.X + LeftAdd + 5, rec2_4.Y, ColumnWidth9, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导师\r\n/助理" ), ft9b, b, rec2_9 );//画第一列的列标题
- }
- #endregion
- #region 画行
- DataTable newTable = new DataTable();
- string StrWhere = "";
- for ( int i = 0; i < Alist.Count; i++ )
- {
- string[] StrArray = Alist[i].ToString().Trim().Split( '|' );
- StrWhere += "'" + StrArray[0].Trim() + "',";
- }
- if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
- {
- StrWhere = " Where Ordv_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookPhotographed_DetailPrint( StrWhere );
- newTable.PrimaryKey = new DataColumn[] { newTable.Columns["Ordv_ViceNumber"] };
- }
- int RowHeight2 = 34;
- int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
- int IntPoint_X = rec2.X;
- int IntPoint_Y = rec2.Y + rec2.Height;
- for ( int i = 0; i < Alist.Count; i++ )
- {
- if ( i >= 26 )
- {
- break;
- }
- string[] StrArray = Alist[i].ToString().Trim().Split( '|' );
- string StrColName = "Ordpg_ReservationPhotographyTime AS 拍摄时间,((case when Ordpg_SightsType = '0' then '内景:' else '外景:' end) + cast(Ordpg_ApparelQuantity AS varchar(10)) + '套') AS 服装数," +
- "Ordpg_ReservationPhotographyName AS 摄影师,Ordpg_ReservationPhotographyAssistant AS 摄影助理," +
- "Ordpg_ReservationMakeupArtist AS 化妆师,Ordpg_ReservationMakeupAssistant AS 化妆助理," +
- "Ordpg_ReservationBootDivision AS 引导师,Ordpg_ReservationBootDivisionAssistant AS 引导助理 ";
- DataTable ordSights = orbll.GetView_Custom( "tb_ErpOrdersPhotography", StrWhere: "Ordpg_ViceNumber = '" + StrArray[0].Trim() + "' And Ordpg_Sights = '" + StrArray[1].Trim() + "'", ShowColumnName: StrColName ).Tables[0];
- if ( ordSights.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "获取订单安排人员错误" ); return;
- }
- DataRow dtRow = newTable.Rows.Find( StrArray[0].Trim() );
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, RowHeight2 );
- g.DrawRectangle( p, recfor );//画标题矩形
- string StrName = dtRow["主客户姓名"].ToString().Trim().Replace( "/", "," );
- if ( dtRow["订单类型"].ToString().Trim() != "写真订单" )
- {
- StrName = dtRow["客户姓名"].ToString().Trim();
- }
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrName, ft8, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- string StrPhone = dtRow["主客户电话"].ToString().Trim().Replace( "/", "," );
- if ( dtRow["订单类型"].ToString().Trim() != "写真订单" )
- {
- StrPhone = dtRow["客户电话"].ToString().Trim();
- }
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone ), ft8, b, recfor2_2 );//画第一列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
- Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( StrArray[1].Trim(), ft8, b, recfor2_3 );//画第一列的列标题ord_tbl.Rows[0]["拍摄名称"].ToString().Trim()
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
- Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( LYFZ.BLL.OtherCommonModel.DateTimeToString( ordSights.Rows[0]["拍摄时间"] ), ft8, b, recfor2_4 );//画第一列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
- Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( ordSights.Rows[0]["摄影师"] ) + "\r\n" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( ordSights.Rows[0]["摄影助理"] ), ft8, b, recfor2_5 );//画第一列的列标题
- Point pfor5_1 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y );
- Point pfor5_2 = new Point( pfor4_1.X + ColumnWidth5, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor5_1, pfor5_2 );//画第一表与第二列的界线
- Rectangle recfor2_6 = new Rectangle( pfor5_1.X + LeftAdd, pfor5_1.Y + TopAdd, ColumnWidth6 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( ordSights.Rows[0]["化妆师"] ) + "\r\n" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( ordSights.Rows[0]["化妆助理"] ), ft8, b, recfor2_6 );//画第一列的列标题
- Point pfor6_1 = new Point( pfor5_1.X + ColumnWidth6, recfor.Y );
- Point pfor6_2 = new Point( pfor5_1.X + ColumnWidth6, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor6_1, pfor6_2 );//画第一表与第二列的界线
- Rectangle recfor2_7 = new Rectangle( pfor6_1.X + LeftAdd, pfor6_1.Y + TopAdd, ColumnWidth7 - (LeftAdd * 2), RowContentHeight2 );
- string StrClothingName = "";
- if ( !string.IsNullOrEmpty( dtRow["服装师"].ToString().Trim() ) )
- {
- StrClothingName += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRow["服装师"] );
- }
- if ( !string.IsNullOrEmpty( StrClothingName ) )
- {
- StrClothingName += "\r\n";
- }
- StrClothingName += ordSights.Rows[0]["服装数"].ToString().Trim();
- g.DrawString( StrClothingName, ft8, b, recfor2_7 );//画第一列的列标题
- Point pfor7_1 = new Point( pfor6_1.X + ColumnWidth7, recfor.Y );
- Point pfor7_2 = new Point( pfor6_1.X + ColumnWidth7, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor7_1, pfor7_2 );//画第一表与第二列的界线
- Rectangle recfor2_8 = new Rectangle( pfor7_1.X + LeftAdd, pfor7_1.Y + TopAdd, ColumnWidth8 - (LeftAdd * 2), RowContentHeight2 );
- string StrPan = dtRow["接单人"].ToString().Trim().Replace( ",", "\r\n" ).Trim();
- g.DrawString( StrPan, ft8, b, recfor2_8 );//画第一列的列标题
- if ( htData["Ver"].ToString().Trim() == "1" || htData["Ver"].ToString().Trim() == "-1" )
- {
- Point pfor8_1 = new Point( pfor7_1.X + ColumnWidth8, recfor.Y );
- Point pfor8_2 = new Point( pfor7_1.X + ColumnWidth8, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor8_1, pfor8_2 );//画第一表与第二列的界线
- Rectangle recfor2_9 = new Rectangle( pfor8_1.X + LeftAdd, pfor8_1.Y + TopAdd, ColumnWidth9 - (LeftAdd * 2), RowContentHeight2 );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( ordSights.Rows[0]["引导师"] ) + "\r\n" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( ordSights.Rows[0]["引导助理"] ), ft8, b, recfor2_9 );//画第一列的列标题
- }
- IntPoint_X = recfor.X;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- #endregion
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( StrValue, ft8 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width );
- Rectangle rec3 = new Rectangle( rec2.X + rec2.Width - StrWidth, IntPoint_Y + 3, StrWidth, StrHeigth );
- g.DrawString( StrValue, ft8, b, rec3 );//画消费法规
- }
- #endregion
- #region 拍照派工
- /// <summary>
- /// 摄控本拍照客人——派工
- /// </summary>
- /// <param name="objValue"></param>
- /// <param name="gg"></param>
- /// <param name="size"></param>
- /// <returns></returns>
- public static List<Image> CameraControlBook_PhotographsGuestDispatch_Print( object objValue, Graphics gg, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- ArrayList Alist = (ArrayList)htData["Alist"];
- string strDateTime = htData["StrDate"].ToString().Trim();
- Font ft24 = new Font( "宋体", 24, GraphicsUnit.Pixel );
- Font ft16 = new Font( "宋体", 16, GraphicsUnit.Pixel );
- Font ft14 = new Font( "宋体", 14, GraphicsUnit.Pixel );
- Pen p = GetPen;
- int LeftWidth = 30;
- int TopHeight = 50;
- int RowHeight = 35;
- int LeftAdd = 3;
- int TopAdd = 10;
- int RowContentHeight = RowHeight - TopAdd;
- List<Image> imglist = new List<Image>();
- int TableWidth = size.Width - LeftWidth * 2;
- int ColumnWidth1 = (TableWidth / 8);
- int ColumnWidth2 = (TableWidth / 2) - ColumnWidth1 - 50;
- int ColumnWidth3 = (TableWidth / 8);
- int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3;
- #region 获取数据
- string StrWhere = " Ordv_ViceNumber in (";
- string StrWhere2 = "";
- Hashtable htCount = new Hashtable();
- for ( int i = 0; i < Alist.Count; i++ )
- {
- string[] StrArray = Alist[i].ToString().Trim().Split( '|' );
- StrWhere += "'" + StrArray[0].Trim() + "',";
- StrWhere2 += " (Ordpg_ViceNumber = '" + StrArray[0].Trim() + "' And Ordpg_Sights = '" + StrArray[1].Trim() + "') or";
- htCount[StrArray[0].Trim()] = StrArray[0].Trim();
- }
- StrWhere = StrWhere.TrimEnd( ',' ) + ")";
- StrWhere2 = StrWhere2.TrimEnd( 'o', 'r' );
- string StrTable = " (SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationPhotographyName AS 人员编号,'摄影师' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationPhotographyName != '' " +
- " UNION ALL " +
- " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationPhotographyAssistant AS 人员编号,'摄影助理' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationPhotographyAssistant != '' " +
- " UNION ALL " +
- " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationMakeupArtist AS 人员编号,'化妆师' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationMakeupArtist != '' " +
- " UNION ALL " +
- " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationMakeupAssistant AS 人员编号,'化妆助理' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationMakeupAssistant != '' " +
- " UNION ALL " +
- " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationBootDivision AS 人员编号,'引导师' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationBootDivision != '' " +
- " UNION ALL " +
- " SELECT convert(datetime,convert(varchar(10),Ordpg_ReservationPhotographyTime,120)) AS 日期,Ordpg_ReservationBootDivisionAssistant AS 人员编号,'引导助理' AS 模板 FROM tb_ErpOrdersPhotography where Ordpg_ReservationBootDivisionAssistant != '' " +
- " ) AS tb" +
- " Left Join tb_ErpUser on User_EmployeeID = tb.人员编号 ";
- string StrTableName = "with t AS( " +
- "select Ordpg_ViceNumber,Ordpg_ApparelQuantity,Ordpg_SightsType,Ordpg_Sights,Ordpg_ReservationPhotographyTime," +
- "Ordpg_ReservationPhotographyName,Ordpg_ReservationPhotographyAssistant,Ordpg_ReservationMakeupArtist,Ordpg_ReservationBootDivisionAssistant," +
- "Ordpg_ReservationMakeupAssistant,Ordpg_ReservationBootDivision,Ordpg_OpenOrderSource,Ordpg_Remark " +
- "from tb_ErpOrdersPhotography " +
- "where " + StrWhere2 + " " +
- ") " +
- "select * from " +
- "( " +
- "select Ordv_Number," +
- "Ordv_ViceNumber," +
- "Ord_LovedStyle," +
- "CASE Ord_SinceOrderNumber WHEN '' THEN Ord_Number ELSE Ord_SinceOrderNumber END AS 订单号," +
- "dbo.fn_CheckOrderType(Ord_Type) AS 订单类型," +
- "Ord_SeriesPrice AS 套系金额," +
- "Cus_Name AS 客户姓名," +
- "Cus_Telephone AS 客户电话," +
- "M_Cus_Name AS 主客户姓名," +
- "M_Cus_Telephone AS 主客户电话," +
- "Ordv_ReservationClothingName AS 服装师," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(OrdPe_OrdersPerson) from tb_ErpOrdersPerson where OrdPe_OrderNumber=Ord_Number for xml path('')),1,1,'')) as 接单人," +
- "(case when Ord_Type = '1' then (Ordv_IntoBottomQuantity) else (case when Ordv_IntoBottomQuantityPackage > 0 then (Ordv_IntoBottomQuantityPackage) else (Ordv_IntoBottomQuantity + Ordv_IntoBottomQuantityPackage) end) end) AS 入底张数," +
- "Ordv_IntoRegisterQuantity AS 入册张数," +
- "(select sum(Ordpg_ApparelQuantity) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_SightsType = '0') AS 内景服装数," +
- "(select sum(Ordpg_ApparelQuantity) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_SightsType = '1') AS 外景服装数," +
- "(select stuff((select ',' + Ordpg_Sights from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_Sights!= '' for xml path('')),1,1,'')) as 拍摄名称," +
- "(select top 1 Ordpg_ReservationPhotographyTime from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_ReservationPhotographyTime is not null order by Ordpg_ReservationPhotographyTime ASC) AS 拍摄时间," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_ReservationPhotographyName) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_ReservationPhotographyName != '' group by Ordpg_ReservationPhotographyName for xml path('')),1,1,'')) as 摄影师," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_ReservationPhotographyAssistant) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_ReservationPhotographyAssistant != '' group by Ordpg_ReservationPhotographyAssistant for xml path('')),1,1,'')) as 摄影助理," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_ReservationMakeupArtist) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_ReservationMakeupArtist != '' group by Ordpg_ReservationMakeupArtist for xml path('')),1,1,'')) as 化妆师," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_ReservationMakeupAssistant) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_ReservationMakeupAssistant != '' group by Ordpg_ReservationMakeupAssistant for xml path('')),1,1,'')) as 化妆助理," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_ReservationBootDivision) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_ReservationBootDivision != '' group by Ordpg_ReservationBootDivision for xml path('')),1,1,'')) as 引导师," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_ReservationBootDivisionAssistant) from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_ReservationBootDivisionAssistant != '' group by Ordpg_ReservationBootDivisionAssistant for xml path('')),1,1,'')) as 引导助理," +
- "(select stuff((select ',' + Ordpg_Remark from t where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_Remark!= '' for xml path('')),1,1,'')) as 备注 " +
- "from dbo.tb_ErpOrder " +
- "Left Join dbo.tb_ErpOrderDigital On Ord_Number = Ordv_Number " +
- "Left Join tempTB_AggregationCustomer On Ord_Number = GP_OrderNumber " +
- ") AS tb where " + StrWhere + " " +
- "Order By Ordv_Number,Ordv_ViceNumber";
- DataTable tbSights = orbll.GetView_Custom( StrTableName ).Tables[0];
- tbSights.PrimaryKey = new DataColumn[] { tbSights.Columns["Ordv_ViceNumber"] };
- string ExecuteSql = ";" + orbll.GetView_CustomReturnExecuteSql( StrTable, StrWhere: LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "日期", strDateTime, strDateTime, ConnectWord: "" ), ShowColumnName: "count(人员编号) AS 数量,人员编号,tb_ErpUser.User_Name AS 人员,模板", StrGroupBy: "人员编号,User_Name,模板" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( StrTable, StrWhere: LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime( "日期", strDateTime, strDateTime, ConnectWord: "" ), ShowColumnName: "人员编号,tb_ErpUser.User_Name AS 人员", StrGroupBy: "人员编号,tb_ErpUser.User_Name" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpStyle", ShowColumnName: "ID, Style_Name" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl_Statistic = dtSet.Tables["ds"];
- DataTable tbl_Person = dtSet.Tables["ds1"];
- DataTable tblStyle = dtSet.Tables["ds2"];
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- string StrTab = "tb_ErpOrder Left Join tb_ErpOrderDigital on Ordv_Number = Ord_Number Left Join tempTB_AggregationCustomer on GP_OrderNumber = Ord_Number Left Join tb_ErpCustomerGroupMembers on tb_ErpCustomerGroupMembers.GM_CustomerGroupID = tempTB_AggregationCustomer.GP_CustomerGroupID Left Join tb_ErpCustomer on Cus_CustomerNumber = tb_ErpCustomerGroupMembers.GM_CustomerID";
- DataTable dtType = orbll.GetView_Custom( StrTab, StrWhere: StrWhere + " And Cus_Sex is not null And Ord_Type = '1' And Cus_Type = '儿童'", ShowColumnName: "Ord_Number,Ordv_ViceNumber,Ord_Type,Age_String,Cus_Sex" ).Tables[0];
- #endregion
- Bitmap panlImage = null;
- Graphics g = null;
- int ForCount = tbSights.Rows.Count + 1;
- for ( int i = 0; i < ForCount; i++ )
- {
- if ( (i % 2) == 0 )
- {
- TopHeight = 50;
- panlImage = new Bitmap( size.Width, size.Height );
- panlImage.SetResolution( gg.DpiX, gg.DpiY );
- g = Graphics.FromImage( panlImage );
- }
- if ( i < tbSights.Rows.Count )
- {
- #region 派工单
- #region 标题
- string recValue = DefaultPrintTitle;
- SizeF sizef = g.MeasureString( recValue, ft24 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rectitle = new Rectangle( (panlImage.Width / 2) - (StrWidth / 2), TopHeight, StrWidth, StrHeigth );
- g.DrawString( recValue, ft24, Brushes.Black, rectitle );
- #endregion
- #region 订单号
- recValue = "NO." + tbSights.Rows[i]["Ordv_Number"].ToString().Trim();// "NO.20151210001";
- sizef = g.MeasureString( recValue, ft16 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recNo = new Rectangle( panlImage.Width - StrWidth - LeftWidth, rectitle.Y + rectitle.Height, StrWidth, StrHeigth );
- g.DrawString( recValue, ft16, Brushes.Black, recNo );
- #endregion
- #region 第一行
- Rectangle recA = new Rectangle( LeftWidth, recNo.Y + recNo.Height, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recA );
- Rectangle recA_1 = new Rectangle( recA.X + LeftAdd, recA.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄时间" ), ft16, Brushes.Black, recA_1 );
- Point pA1_1 = new Point( recA.X + ColumnWidth1, recA.Y );
- Point pA1_2 = new Point( recA.X + ColumnWidth1, recA.Y + recA.Height );
- g.DrawLine( Pens.Black, pA1_1, pA1_2 );
- Rectangle recA_2 = new Rectangle( pA1_1.X + LeftAdd, pA1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.Command.Command_Validate.DateTimeToString2( tbSights.Rows[i]["拍摄时间"] ), ft16, Brushes.Black, recA_2 );
- Point pA2_1 = new Point( pA1_1.X + ColumnWidth2, recA.Y );
- Point pA2_2 = new Point( pA1_1.X + ColumnWidth2, recA.Y + recA.Height );
- g.DrawLine( Pens.Black, pA2_1, pA2_2 );
- Rectangle recA_3 = new Rectangle( pA2_1.X + LeftAdd, pA2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄名称" ), ft16, Brushes.Black, recA_3 );
- Point pA3_1 = new Point( pA2_1.X + ColumnWidth3, recA.Y );
- Point pA3_2 = new Point( pA2_1.X + ColumnWidth3, recA.Y + recA.Height );
- g.DrawLine( Pens.Black, pA3_1, pA3_2 );
- Rectangle recA_4 = new Rectangle( pA3_1.X + LeftAdd, pA3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["拍摄名称"].ToString().Trim() ), ft16, Brushes.Black, recA_4 );
- #endregion
- #region 第二行
- Rectangle recB = new Rectangle( LeftWidth, recA.Y + recA.Height, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recB );
- Rectangle recB_1 = new Rectangle( recB.X + LeftAdd, recB.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系金额" ), ft16, Brushes.Black, recB_1 );
- Point pB1_1 = new Point( recB.X + ColumnWidth1, recB.Y );
- Point pB1_2 = new Point( recB.X + ColumnWidth1, recB.Y + recB.Height );
- g.DrawLine( Pens.Black, pB1_1, pB1_2 );
- Rectangle recB_2 = new Rectangle( pB1_1.X + LeftAdd, pB1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( tbSights.Rows[i]["套系金额"].ToString().Trim(), ft16, Brushes.Black, recB_2 );
- Point pB2_1 = new Point( pB1_1.X + ColumnWidth2, recB.Y );
- Point pB2_2 = new Point( pB1_1.X + ColumnWidth2, recB.Y + recB.Height );
- g.DrawLine( Pens.Black, pB2_1, pB2_2 );
- Rectangle recB_3 = new Rectangle( pB2_1.X + LeftAdd, pB2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名" ), ft16, Brushes.Black, recB_3 );
- Point pB3_1 = new Point( pB2_1.X + ColumnWidth3, recB.Y );
- Point pB3_2 = new Point( pB2_1.X + ColumnWidth3, recB.Y + recB.Height );
- g.DrawLine( Pens.Black, pB3_1, pB3_2 );
- string StrName = tbSights.Rows[i]["主客户姓名"].ToString().Trim().Replace( "/", "," );
- if ( tbSights.Rows[i]["订单类型"].ToString().Trim() != "写真订单" )
- {
- StrName = tbSights.Rows[i]["客户姓名"].ToString().Trim();
- }
- Rectangle recB_4 = new Rectangle( pB3_1.X + LeftAdd, pB3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( StrName ), ft16, Brushes.Black, recB_4 );
- #endregion
- #region 第三行
- Rectangle recC = new Rectangle( LeftWidth, recB.Y + recB.Height, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recC );
- Rectangle recC_1 = new Rectangle( recC.X + LeftAdd, recC.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "接单人" ), ft16, Brushes.Black, recC_1 );
- Point pC1_1 = new Point( recC.X + ColumnWidth1, recC.Y );
- Point pC1_2 = new Point( recC.X + ColumnWidth1, recC.Y + recC.Height );
- g.DrawLine( Pens.Black, pC1_1, pC1_2 );
- Rectangle recC_2 = new Rectangle( pC1_1.X + LeftAdd, pC1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["接单人"].ToString().Trim() ), ft16, Brushes.Black, recC_2 );
- Point pC2_1 = new Point( pC1_1.X + ColumnWidth2, recC.Y );
- Point pC2_2 = new Point( pC1_1.X + ColumnWidth2, recC.Y + recC.Height );
- g.DrawLine( Pens.Black, pC2_1, pC2_2 );
- Rectangle recC_3 = new Rectangle( pC2_1.X + LeftAdd, pC2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话" ), ft16, Brushes.Black, recC_3 );
- Point pC3_1 = new Point( pC2_1.X + ColumnWidth3, recC.Y );
- Point pC3_2 = new Point( pC2_1.X + ColumnWidth3, recC.Y + recC.Height );
- g.DrawLine( Pens.Black, pC3_1, pC3_2 );
- string StrPhone = tbSights.Rows[i]["主客户电话"].ToString().Trim().Replace( "/", "," );
- if ( tbSights.Rows[i]["订单类型"].ToString().Trim() != "写真订单" )
- {
- StrPhone = tbSights.Rows[i]["客户电话"].ToString().Trim();
- }
- Rectangle recC_4 = new Rectangle( pC3_1.X + LeftAdd, pC3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone ), ft16, Brushes.Black, recC_4 );
- #endregion
- #region 第四行
- Rectangle recD = new Rectangle( LeftWidth, recC.Y + recC.Height, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recD );
- Rectangle recD_1 = new Rectangle( recA.X + LeftAdd, recD.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入册/入底" ), ft16, Brushes.Black, recD_1 );
- Point pD1_1 = new Point( recD.X + ColumnWidth1, recD.Y );
- Point pD1_2 = new Point( recD.X + ColumnWidth1, recD.Y + recD.Height );
- g.DrawLine( Pens.Black, pD1_1, pD1_2 );
- string strV = tbSights.Rows[i]["入底张数"].ToString().Trim();
- if ( strV == "-1" )
- {
- strV = "全送";
- }
- else if ( strV == "0" )
- {
- strV = "不送";
- }
- Rectangle recD_2 = new Rectangle( pD1_1.X + LeftAdd, pD1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( tbSights.Rows[i]["入册张数"].ToString().Trim() + "/" + strV, ft16, Brushes.Black, recD_2 );
- Point pD2_1 = new Point( pD1_1.X + ColumnWidth2, recD.Y );
- Point pD2_2 = new Point( pD1_1.X + ColumnWidth2, recD.Y + recD.Height );
- g.DrawLine( Pens.Black, pD2_1, pD2_2 );
- if ( tbSights.Rows[i]["订单类型"].ToString().Trim() == "儿童订单" )
- {
- Rectangle recD_3 = new Rectangle( pD2_1.X + LeftAdd, pD2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝宝情况" ), ft16, Brushes.Black, recD_3 );
- Point pD3_1 = new Point( pD2_1.X + ColumnWidth3, recD.Y );
- Point pD3_2 = new Point( pD2_1.X + ColumnWidth3, recD.Y + recD.Height );
- g.DrawLine( Pens.Black, pD3_1, pD3_2 );
- string StrText = "";
- if ( dtType.Rows.Count > 0 )
- {
- DataRow[] dtRowsType = dtType.Select( "Ordv_ViceNumber = '" + tbSights.Rows[i]["Ordv_ViceNumber"].ToString().Trim() + "'" );
- if ( dtRowsType.Length > 0 && dtRowsType[0]["Ord_Type"].ToString().Trim() == "1" )
- {
- StrText = "宝宝性别(";
- if ( Convert.ToBoolean( dtRowsType[0]["Cus_Sex"] ) )
- {
- StrText += "女";
- }
- else
- {
- StrText += "男";
- }
- StrText += ") 年龄(";
- if ( !string.IsNullOrEmpty( dtRowsType[0]["Age_String"].ToString().Trim() ) )
- {
- StrText += dtRowsType[0]["Age_String"].ToString().Trim() + ")";
- }
- else
- {
- StrText += "未知)";
- }
- }
- }
- Rectangle recD_4 = new Rectangle( pD3_1.X + LeftAdd, pD3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( StrText ), ft16, Brushes.Black, recD_4 );
- }
- #endregion
- #region 第五行
- Rectangle recE = new Rectangle( LeftWidth, recD.Y + recD.Height, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recE );
- Rectangle recE_1 = new Rectangle( recE.X + LeftAdd, recE.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影师" ), ft16, Brushes.Black, recE_1 );
- Point pE1_1 = new Point( recE.X + ColumnWidth1, recE.Y );
- Point pE1_2 = new Point( recE.X + ColumnWidth1, recE.Y + recE.Height );
- g.DrawLine( Pens.Black, pE1_1, pE1_2 );
- Rectangle recE_2 = new Rectangle( pE1_1.X + LeftAdd, pE1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["摄影师"].ToString().Trim() ), ft16, Brushes.Black, recE_2 );
- Point pE2_1 = new Point( pE1_1.X + ColumnWidth2, recE.Y );
- Point pE2_2 = new Point( pE1_1.X + ColumnWidth2, recE.Y + recE.Height );
- g.DrawLine( Pens.Black, pE2_1, pE2_2 );
- Rectangle recE_3 = new Rectangle( pE2_1.X + LeftAdd, pE2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影助理" ), ft16, Brushes.Black, recE_3 );
- Point pE3_1 = new Point( pE2_1.X + ColumnWidth3, recE.Y );
- Point pE3_2 = new Point( pE2_1.X + ColumnWidth3, recE.Y + recE.Height );
- g.DrawLine( Pens.Black, pE3_1, pE3_2 );
- Rectangle recE_4 = new Rectangle( pE3_1.X + LeftAdd, pE3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["摄影助理"].ToString().Trim() ), ft16, Brushes.Black, recE_4 );
- #endregion
- #region 第六行
- Rectangle recF = new Rectangle( LeftWidth, recE.Y + recE.Height, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recF );
- Rectangle recF_1 = new Rectangle( recF.X + LeftAdd, recF.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆师" ), ft16, Brushes.Black, recF_1 );
- Point pF1_1 = new Point( recF.X + ColumnWidth1, recF.Y );
- Point pF1_2 = new Point( recF.X + ColumnWidth1, recF.Y + recF.Height );
- g.DrawLine( Pens.Black, pF1_1, pF1_2 );
- Rectangle recF_2 = new Rectangle( pF1_1.X + LeftAdd, pF1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["化妆师"].ToString().Trim() ), ft16, Brushes.Black, recF_2 );
- Point pF2_1 = new Point( pF1_1.X + ColumnWidth2, recF.Y );
- Point pF2_2 = new Point( pF1_1.X + ColumnWidth2, recF.Y + recF.Height );
- g.DrawLine( Pens.Black, pF2_1, pF2_2 );
- Rectangle recF_3 = new Rectangle( pF2_1.X + LeftAdd, pF2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆助理" ), ft16, Brushes.Black, recF_3 );
- Point pF3_1 = new Point( pF2_1.X + ColumnWidth3, recF.Y );
- Point pF3_2 = new Point( pF2_1.X + ColumnWidth3, recF.Y + recF.Height );
- g.DrawLine( Pens.Black, pF3_1, pF3_2 );
- Rectangle recF_4 = new Rectangle( pF3_1.X + LeftAdd, pF3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["化妆助理"].ToString().Trim() ), ft16, Brushes.Black, recF_4 );
- #endregion
- #region 第七行
- int Rectangle_Y = recF.Y + recF.Height;
- if ( tbSights.Rows[i]["订单类型"].ToString().Trim() == "儿童订单" )
- {
- Rectangle recG = new Rectangle( LeftWidth, Rectangle_Y, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recG );
- Rectangle recG_1 = new Rectangle( recG.X + LeftAdd, recG.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导师" ), ft16, Brushes.Black, recG_1 );
- Point pG1_1 = new Point( recG.X + ColumnWidth1, recG.Y );
- Point pG1_2 = new Point( recG.X + ColumnWidth1, recG.Y + recG.Height );
- g.DrawLine( Pens.Black, pG1_1, pG1_2 );
- Rectangle recG_2 = new Rectangle( pG1_1.X + LeftAdd, pG1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["引导师"].ToString().Trim() ), ft16, Brushes.Black, recG_2 );
- Point pG2_1 = new Point( pG1_1.X + ColumnWidth2, recG.Y );
- Point pG2_2 = new Point( pG1_1.X + ColumnWidth2, recG.Y + recG.Height );
- g.DrawLine( Pens.Black, pG2_1, pG2_2 );
- Rectangle recG_3 = new Rectangle( pG2_1.X + LeftAdd, pG2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导助理" ), ft16, Brushes.Black, recG_3 );
- Point pG3_1 = new Point( pG2_1.X + ColumnWidth3, recG.Y );
- Point pG3_2 = new Point( pG2_1.X + ColumnWidth3, recG.Y + recG.Height );
- g.DrawLine( Pens.Black, pG3_1, pG3_2 );
- Rectangle recG_4 = new Rectangle( pG3_1.X + LeftAdd, pG3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["引导助理"].ToString().Trim() ), ft16, Brushes.Black, recG_4 );
- Rectangle_Y = recG.Y + recG.Height;
- }
- #endregion
- #region 第八行
- Rectangle recH = new Rectangle( LeftWidth, Rectangle_Y, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recH );
- Rectangle recH_1 = new Rectangle( recH.X + LeftAdd, recH.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服装师" ), ft16, Brushes.Black, recH_1 );
- Point pH1_1 = new Point( recH.X + ColumnWidth1, recH.Y );
- Point pH1_2 = new Point( recH.X + ColumnWidth1, recH.Y + recH.Height );
- g.DrawLine( Pens.Black, pH1_1, pH1_2 );
- Rectangle recH_2 = new Rectangle( pH1_1.X + LeftAdd, pH1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["服装师"].ToString().Trim() ), ft16, Brushes.Black, recH_2 );
- Point pH2_1 = new Point( pH1_1.X + ColumnWidth2, recH.Y );
- Point pH2_2 = new Point( pH1_1.X + ColumnWidth2, recH.Y + recH.Height );
- g.DrawLine( Pens.Black, pH2_1, pH2_2 );
- Rectangle recH_3 = new Rectangle( pH2_1.X + LeftAdd, pH2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服装套数" ), ft16, Brushes.Black, recH_3 );
- Point pH3_1 = new Point( pH2_1.X + ColumnWidth3, recH.Y );
- Point pH3_2 = new Point( pH2_1.X + ColumnWidth3, recH.Y + recH.Height );
- g.DrawLine( Pens.Black, pH3_1, pH3_2 );
- string SDS = "";
- if ( !string.IsNullOrEmpty( tbSights.Rows[i]["内景服装数"].ToString().Trim() ) )
- {
- SDS += "内景:" + tbSights.Rows[i]["内景服装数"].ToString().Trim() + "套 ";
- }
- if ( !string.IsNullOrEmpty( tbSights.Rows[i]["外景服装数"].ToString().Trim() ) )
- {
- SDS += "外景:" + tbSights.Rows[i]["外景服装数"].ToString().Trim() + "套";
- }
- Rectangle recH_4 = new Rectangle( pH3_1.X + LeftAdd, pH3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( SDS ), ft16, Brushes.Black, recH_4 );
- #endregion
- #region 第九行
- Rectangle recI = new Rectangle( LeftWidth, recH.Y + recH.Height, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recI );
- Rectangle recI_1 = new Rectangle( recI.X + LeftAdd, recI.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "喜爱格调" ), ft16, Brushes.Black, recI_1 );
- Point pI1_1 = new Point( recI.X + ColumnWidth1, recI.Y );
- Point pI1_2 = new Point( recI.X + ColumnWidth1, recI.Y + recI.Height );
- g.DrawLine( Pens.Black, pI1_1, pI1_2 );
- string[] OrdLovedStyle = tbSights.Rows[i]["Ord_LovedStyle"].ToString().Trim().Split( '|' );
- string StrLovedStyle = "";
- for ( int j = 0; j < OrdLovedStyle.Length; j++ )
- {
- if ( OrdLovedStyle[j].Trim() != "" )
- {
- string[] StrID = OrdLovedStyle[j].Trim().Split( '_' );
- DataRow dtRow = tblStyle.Rows.Find( StrID[1].Trim() );
- if ( dtRow != null )
- {
- StrLovedStyle += dtRow["Style_Name"] + ",";
- }
- }
- }
- Rectangle recI_2 = new Rectangle( pI1_1.X + LeftAdd, pI1_1.Y + TopAdd, TableWidth - ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( StrLovedStyle.TrimEnd( ',' ) ), ft16, Brushes.Black, recI_2 );
- #endregion
- #region 第十行
- Rectangle recJ = new Rectangle( LeftWidth, recI.Y + recI.Height, TableWidth, RowHeight * 2 );
- g.DrawRectangle( Pens.Black, recJ );
- Rectangle recJ_1 = new Rectangle( recJ.X + LeftAdd, recJ.Y + TopAdd, ColumnWidth1, recJ.Height - TopAdd * 2 );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "备注" ), ft16, Brushes.Black, recJ_1 );
- Point pJ1_1 = new Point( recJ.X + ColumnWidth1, recJ.Y );
- Point pJ1_2 = new Point( recJ.X + ColumnWidth1, recJ.Y + recJ.Height );
- g.DrawLine( Pens.Black, pJ1_1, pJ1_2 );
- Rectangle recJ_2 = new Rectangle( pJ1_1.X + LeftAdd, pJ1_1.Y + TopAdd, TableWidth - ColumnWidth1, recJ.Height - TopAdd * 2 );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( tbSights.Rows[i]["备注"].ToString().Trim() ), ft16, Brushes.Black, recJ_2 );
- #endregion
- TopHeight = recJ.Y + recJ.Height + 120;
- #endregion
- }
- else
- {
- #region 结尾统计
- if ( tbl_Statistic.Rows.Count > 0 )
- {
- string StrTitle = LYFZ.BLL.OtherCommonModel.FontConversion( "统计" ) + LYFZ.Command.Command_Validate.DateTimeToString( strDateTime );
- SizeF sizef = g.MeasureString( StrTitle, ft14 );
- int StrHeight = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recX1 = new Rectangle( LeftWidth, TopHeight, StrWidth, StrHeight );
- g.DrawString( StrTitle, ft14, Brushes.Black, recX1 );
- int IntPoint_Y = recX1.Y + recX1.Height;
- int ColumnsWith = 60;
- for ( int k = 0; k < tbl_Person.Rows.Count; k++ )
- {
- DataRow[] dtRow = tbl_Statistic.Select( "人员编号 = '" + tbl_Person.Rows[k]["人员编号"].ToString().Trim() + "'" );
- string StrString = "";
- for ( int j = 0; j < dtRow.Length; j++ )
- {
- StrString += dtRow[j]["模板"].ToString().Trim() + ":" + dtRow[j]["数量"].ToString().Trim() + "组;";
- }
- if ( (k % 2) == 0 )
- {
- Rectangle recX2 = new Rectangle( LeftWidth, IntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( Pens.Black, recX2 );
- Point pX2_1 = new Point( recX2.X + TableWidth / 2, recX2.Y );
- Point pX2_2 = new Point( recX2.X + TableWidth / 2, recX2.Y + recX2.Height );
- g.DrawLine( Pens.Black, pX2_1, pX2_2 );
- Rectangle recX2_1 = new Rectangle( recX2.X + LeftAdd, recX2.Y + TopAdd + 2, ColumnsWith, RowContentHeight );
- g.DrawString( tbl_Person.Rows[k]["人员"].ToString().Trim(), ft14, Brushes.Black, recX2_1 );
- Point pX3_1 = new Point( recX2.X + ColumnsWith, recX2.Y );
- Point pX3_2 = new Point( recX2.X + ColumnsWith, recX2.Y + recX2.Height );
- g.DrawLine( Pens.Black, pX3_1, pX3_2 );
- Rectangle recX3_1 = new Rectangle( pX3_1.X + LeftAdd, recX2_1.Y, TableWidth / 2 - (LeftAdd + ColumnsWith), RowContentHeight );
- g.DrawString( StrString, ft14, Brushes.Black, recX3_1 );
- IntPoint_Y = recX2.Y + recX2.Height;
- }
- else
- {
- Rectangle rec2_1 = new Rectangle( LeftWidth + (TableWidth / 2) + LeftAdd, IntPoint_Y - RowHeight + TopAdd + 2, ColumnWidth1, RowContentHeight );
- g.DrawString( tbl_Person.Rows[k]["人员"].ToString().Trim(), ft14, Brushes.Black, rec2_1 );
- Point pX3_1 = new Point( rec2_1.X + ColumnsWith, IntPoint_Y - RowHeight );
- Point pX3_2 = new Point( rec2_1.X + ColumnsWith, IntPoint_Y );
- g.DrawLine( Pens.Black, pX3_1, pX3_2 );
- Rectangle recX3_1 = new Rectangle( pX3_1.X + LeftAdd, rec2_1.Y, TableWidth / 2 - (LeftAdd + ColumnsWith), RowContentHeight );
- g.DrawString( StrString, ft14, Brushes.Black, recX3_1 );
- }
- }
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + PrintCurrentIndexPage + "/" + imglist.Count + 1;
- sizef = g.MeasureString( rec2Value, ft14 );
- StrHeight = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recX10 = new Rectangle( LeftWidth + TableWidth - StrWidth, IntPoint_Y + 3, StrWidth, StrHeight );
- g.DrawString( rec2Value, ft14, Brushes.Black, recX10 );
- }
- #endregion
- }
- if ( ((i % 2) > 0) || i == tbSights.Rows.Count )
- {
- imglist.Add( panlImage );
- }
- }
- return imglist;
- }
- #endregion
- #region 选片明细
- /// <summary>
- /// 摄控本选片客人——明细
- /// </summary>
- /// <returns></returns>
- public static void CameraControlBook_FilmSelectionDetail_Print( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- ArrayList Alist = (ArrayList)htData["Alist"];
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft8 = new Font( "宋体", 8 );
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 3;
- int TopAdd = 5;
- int RowHeight = 25;
- int RowContentHeight = RowHeight - (TopAdd * 2);
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int StrHeight = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
- int Unit = TableWidth / 10;
- int ColumnWidth1 = Unit * 4 - (Unit / 2 + (Unit / 4));
- int ColumnWidth2 = Unit * 2 - (Unit / 2);
- int ColumnWidth3 = Unit - (Unit / 4);
- int ColumnWidth5 = Unit + 20;
- int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客人/电话" );
- sizef = g.MeasureString( StrValue, ft10 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_1 = new Rectangle( rec2.X + (ColumnWidth1 - StrWidth) / 2, rec2.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_1 );//画第一列的列标题
- Point p1_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
- Point p1_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "选片时间" );
- sizef = g.MeasureString( StrValue, ft10 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_2 = new Rectangle( p1_1.X + (ColumnWidth2 - StrWidth) / 2, p1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_2 );//画第一列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec2.Y );
- Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec2.Y + rec2.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
- Rectangle rec2_3 = new Rectangle( p2_1.X + LeftAdd, p2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "选片人" ), ft10, b, rec2_3 );//画第一列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec2.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec2.Y + rec2.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第一表与第二列的界线
- Rectangle rec2_4 = new Rectangle( p3_1.X + (ColumnWidth4 - StrWidth) / 2, p3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" ), ft10, b, rec2_4 );//画第一列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec2.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec2.Y + rec2.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "门市" );
- sizef = g.MeasureString( StrValue, ft10 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_5 = new Rectangle( p4_1.X + (ColumnWidth5 - StrWidth) / 2, p4_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_5 );//画第一列的列标题
- DataTable newTable = new DataTable();
- string StrWhere = "";
- for ( int i = 0; i < Alist.Count; i++ )
- {
- StrWhere += "'" + Alist[i].ToString().Trim() + "',";
- }
- if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
- {
- StrWhere = " Where Ordv_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookFilmSelection_DetailPrint( StrWhere );
- newTable.PrimaryKey = new DataColumn[] { newTable.Columns["Ordv_ViceNumber"] };
- }
- int RowHeight2 = 20;
- int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
- int IntPoint_Y = rec2.Y + rec2.Height;
- for ( int i = 0; i < Alist.Count; i++ )
- {
- if ( i >= 46 )
- {
- break;
- }
- DataRow dtRow = newTable.Rows.Find( Alist[i].ToString().Trim() );
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
- g.DrawRectangle( p, recfor );//画标题矩形
- string StrName = dtRow["主客户姓名"].ToString().Trim().Replace( "/", "," );
- if ( dtRow["订单类型"].ToString().Equals( "1" ) )
- {
- StrName = dtRow["客户姓名"].ToString().Trim().Replace( "/", "," );
- }
- if ( StrName != "" )
- {
- string StrPhone = dtRow["主客户电话"].ToString().Trim().Replace( "/", "," );
- if ( StrPhone != "" )
- {
- StrName += "/" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
- }
- }
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1, RowContentHeight2 );
- g.DrawString( StrName, ft8, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2, RowContentHeight2 );
- g.DrawString( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRow["选片时间"] ), ft8, b, recfor2_2 );//画第一列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
- Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3, RowContentHeight2 );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRow["选片师"] ), ft8, b, recfor2_3 );//画第一列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
- Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4, RowContentHeight2 );
- g.DrawString( dtRow["套系名称"].ToString().Trim(), ft8, b, recfor2_4 );//画第一列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
- Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5, RowContentHeight2 );
- g.DrawString( dtRow["接单人"].ToString().Trim(), ft8, b, recfor2_5 );//画第一列的列标题
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( StrValue, ft8 );
- StrHeight = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width );
- Rectangle rec3 = new Rectangle( rec2.X + rec2.Width - StrWidth, IntPoint_Y + 3, StrWidth, StrHeight );
- g.DrawString( StrValue, ft8, b, rec3 );//画消费法规
- }
- #endregion
- #region 看设计明细
- /// <summary>
- /// 摄控本看设计客人——明细
- /// </summary>
- /// <returns></returns>
- public static void CameraControlBook_LookDesignDetail_Print( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- ArrayList Alist = (ArrayList)htData["Alist"];
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft8 = new Font( "宋体", 8 );
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 3;
- int TopAdd = 5;
- int RowHeight = 25;
- int RowContentHeight = RowHeight - (TopAdd * 2);
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int StrHeight = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
- int Unit = TableWidth / 10;
- int ColumnWidth1 = Unit * 4 - (Unit / 2 + (Unit / 4));
- int ColumnWidth2 = Unit * 2 - (Unit / 2);
- int ColumnWidth3 = Unit;
- int ColumnWidth5 = Unit * 2 - 30;
- int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth5;
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客人/电话" );
- sizef = g.MeasureString( StrValue, ft10 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_1 = new Rectangle( rec2.X + (ColumnWidth1 - StrWidth) / 2, rec2.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_1 );//画第一列的列标题
- Point p1_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
- Point p1_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "看版时间" );
- sizef = g.MeasureString( StrValue, ft10 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_2 = new Rectangle( p1_1.X + (ColumnWidth2 - StrWidth) / 2, p1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_2 );//画第一列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec2.Y );
- Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec2.Y + rec2.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
- Rectangle rec2_3 = new Rectangle( p2_1.X + LeftAdd, p2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "看版师" ), ft10, b, rec2_3 );//画第一列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec2.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec2.Y + rec2.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" );
- sizef = g.MeasureString( StrValue, ft10 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_4 = new Rectangle( p3_1.X + (ColumnWidth4 - StrWidth) / 2, p3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_4 );//画第一列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec2.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec2.Y + rec2.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第一表与第二列的界线
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "门市" );
- sizef = g.MeasureString( StrValue, ft10 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_5 = new Rectangle( p4_1.X + (ColumnWidth5 - StrWidth) / 2, p4_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( StrValue, ft10, b, rec2_5 );//画第一列的列标题
- DataTable newTable = new DataTable();
- string StrWhere = "";
- for ( int i = 0; i < Alist.Count; i++ )
- {
- StrWhere += "'" + Alist[i].ToString().Trim() + "',";
- }
- if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
- {
- StrWhere = " Where Ordv_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookLookDesign_DetailPrint( StrWhere );
- newTable.PrimaryKey = new DataColumn[] { newTable.Columns["Ordv_ViceNumber"] };
- }
- int RowHeight2 = 22;
- int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
- int IntPoint_Y = rec2.Y + rec2.Height;
- for ( int i = 0; i < Alist.Count; i++ )
- {
- if ( i >= 43 )
- {
- break;
- }
- DataRow dtRow = newTable.Rows.Find( Alist[i].ToString().Trim() );
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, TableWidth, RowHeight2 );
- g.DrawRectangle( p, recfor );//画标题矩形
- string StrName = dtRow["主客户姓名"].ToString().Trim().Replace( "/", "," );
- if ( StrName != "" )
- {
- string StrPhone = dtRow["主客户电话"].ToString().Trim().Replace( "/", "," );
- if ( StrPhone != "" )
- {
- StrName += "/" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
- }
- }
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1, RowContentHeight2 );
- g.DrawString( StrName, ft8, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2, RowContentHeight2 );
- g.DrawString( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRow["看版时间"] ), ft8, b, recfor2_2 );//画第一列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
- Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3, RowContentHeight2 );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRow["看版师"] ), ft8, b, recfor2_3 );//画第一列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
- Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4, RowContentHeight2 );
- g.DrawString( dtRow["套系名称"].ToString().Trim(), ft8, b, recfor2_4 );//画第一列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
- Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5, RowContentHeight2 );
- g.DrawString( dtRow["接单人"].ToString().Trim(), ft8, b, recfor2_5 );//画第一列的列标题
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( StrValue, ft8 );
- StrHeight = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3 = new Rectangle( rec2.X + rec2.Width - StrWidth, IntPoint_Y + 3, StrWidth, StrHeight );
- g.DrawString( StrValue, ft8, b, rec3 );//画消费法规
- }
- #endregion
- #region 取件明细
- /// <summary>
- /// 摄控本取件客人——明细
- /// </summary>
- /// <returns></returns>
- public static void CameraControlBook_TakePiecesDetail_Print( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- ArrayList Alist = (ArrayList)htData["Alist"];
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 11 );
- Font ft10 = new Font( "宋体", 8 );
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 3;
- int TopAdd = 5;
- int RowHeight = 25;
- int RowContentHeight = RowHeight - (TopAdd * 2);
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int StrHeight = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
- int Unit = TableWidth / 10;
- int ColumnWidth2 = Unit * 2 - (Unit / 2);
- int ColumnWidth3 = Unit + (Unit / 3);
- int ColumnWidth4 = Unit;
- int ColumnWidth5 = Unit * 2;
- int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- Rectangle rec2_1 = new Rectangle( rec2.X + LeftAdd, rec2.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客人/电话" ), ft11, b, rec2_1 );//画第一列的列标题
- Point p1_1 = new Point( rec2.X + ColumnWidth1, rec2.Y );
- Point p1_2 = new Point( rec2.X + ColumnWidth1, rec2.Y + rec2.Height );
- g.DrawLine( p, p1_1, p1_2 );//画第一表与第二列的界线
- Rectangle rec2_2 = new Rectangle( p1_1.X + LeftAdd, p1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "取件时间" ), ft11, b, rec2_2 );//画第一列的列标题
- Point p2_1 = new Point( p1_1.X + ColumnWidth2, rec2.Y );
- Point p2_2 = new Point( p1_1.X + ColumnWidth2, rec2.Y + rec2.Height );
- g.DrawLine( p, p2_1, p2_2 );//画第一表与第二列的界线
- Rectangle rec2_3 = new Rectangle( p2_1.X + LeftAdd, p2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "取件人" ), ft11, b, rec2_3 );//画第一列的列标题
- Point p3_1 = new Point( p2_1.X + ColumnWidth3, rec2.Y );
- Point p3_2 = new Point( p2_1.X + ColumnWidth3, rec2.Y + rec2.Height );
- g.DrawLine( p, p3_1, p3_2 );//画第一表与第二列的界线
- Rectangle rec2_4 = new Rectangle( p3_1.X + LeftAdd, p3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "是否完成" ), ft11, b, rec2_4 );//画第一列的列标题
- Point p4_1 = new Point( p3_1.X + ColumnWidth4, rec2.Y );
- Point p4_2 = new Point( p3_1.X + ColumnWidth4, rec2.Y + rec2.Height );
- g.DrawLine( p, p4_1, p4_2 );//画第一表与第二列的界线
- Rectangle rec2_5 = new Rectangle( p4_1.X + LeftAdd, p4_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门市" ), ft11, b, rec2_5 );//画第一列的列标题
- DataTable newTable = new DataTable();
- string StrWhere = "";
- for ( int i = 0; i < Alist.Count; i++ )
- {
- StrWhere += "'" + Alist[i].ToString().Trim() + "',";
- }
- if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
- {
- StrWhere = " Where Ordv_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookTotakePiece_DetailPrint( StrWhere );
- newTable.PrimaryKey = new DataColumn[] { newTable.Columns["Ordv_ViceNumber"] };
- }
- int RowHeight2 = 20;
- int RowContentHeight2 = RowHeight2 - (TopAdd * 2);
- int IntPoint_Y = rec2.Y + rec2.Height;
- for ( int i = 0; i < Alist.Count; i++ )
- {
- if ( i >= 47 )
- {
- break;
- }
- DataRow dtRow = newTable.Rows.Find( Alist[i].ToString().Trim() );
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, rec2.Width, RowHeight2 );
- g.DrawRectangle( p, recfor );//画标题矩形
- string StrName = dtRow["主客户姓名"].ToString().Trim().Replace( "/", "," );
- if ( StrName != "" )
- {
- string StrPhone = dtRow["主客户电话"].ToString().Trim().Replace( "/", "," );
- if ( StrPhone != "" )
- {
- StrName += "/" + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone );
- }
- }
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1, RowContentHeight2 );
- g.DrawString( StrName, ft10, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2, RowContentHeight2 );
- g.DrawString( htData["TakePieceDate"].ToString().Trim(), ft10, b, recfor2_2 );//画第一列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
- Rectangle recfor2_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3, RowContentHeight2 );
- g.DrawString( dtRow["取件人"].ToString().Trim(), ft10, b, recfor2_3 );//画第一列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
- Rectangle recfor2_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4, RowContentHeight2 );
- g.DrawString( dtRow["完成状态"].ToString().Trim(), ft10, b, recfor2_4 );//画第一列的列标题
- Point pfor4_1 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y );
- Point pfor4_2 = new Point( pfor3_1.X + ColumnWidth4, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor4_1, pfor4_2 );//画第一表与第二列的界线
- Rectangle recfor2_5 = new Rectangle( pfor4_1.X + LeftAdd, pfor4_1.Y + TopAdd, ColumnWidth5, RowContentHeight2 );
- g.DrawString( dtRow["接单人"].ToString().Trim(), ft10, b, recfor2_5 );//画第一列的列标题
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( StrValue, ft10 );
- StrHeight = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3 = new Rectangle( rec2.X + TableWidth - StrWidth, IntPoint_Y + 3, StrWidth, StrHeight );
- g.DrawString( StrValue, ft10, b, rec3 );//画消费法规
- }
- #endregion
- #region 婚庆明细
- /// <summary>
- /// 摄控本婚庆客人——明细
- /// 分页未完成
- /// </summary>
- /// <returns></returns>
- public static void CameraControlBook_WeddingDetail_Print( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- ArrayList Alist = (ArrayList)htData["Alist"];
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft16 = new Font( "宋体", 16 );
- Font ft11 = new Font( "宋体", 9 );
- Font ft9 = new Font( "宋体", 9 );
- int LeftWidth = 30;
- int LeftAdd = 3;
- int TopAdd = 5;
- int RowHeight = 22;
- int RowContentHeight = RowHeight - (TopAdd * 2);
- int TableWidth = size.Width - LeftWidth * 2;
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int StrHeight = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeight );
- g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
- int MUnit = TableWidth / 6;
- int MColumnWidth1 = MUnit - (MUnit / 3);
- int MColumnWidth2 = MUnit * 2;
- int MColumnWidth3 = MUnit - (MUnit / 3);
- int MColumnWidth4 = TableWidth - MColumnWidth1 - MColumnWidth2 - MColumnWidth3;
- DataTable newTable = new DataTable();
- string StrWhere = "";
- for ( int i = 0; i < Alist.Count; i++ )
- {
- StrWhere += "'" + Alist[i].ToString().Trim() + "',";
- }
- if ( !string.IsNullOrEmpty( StrWhere.Trim() ) )
- {
- StrWhere = " Where Ws_ViceNumber in (" + StrWhere.TrimEnd( ',' ) + ")";
- newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_CameraControlBookService_DetailPrint( StrWhere );
- }
- int MIntPoint_Y = rec1.Y + rec1.Height;
- for ( int j = 0; j < Alist.Count; j++ )
- {
- DataRow[] dtRows = newTable.Select( "Ws_ViceNumber = '" + Alist[j].ToString().Trim() + "'" );
- Rectangle rec2 = new Rectangle( LeftWidth, MIntPoint_Y, TableWidth, RowHeight );
- g.DrawRectangle( p, rec2 );//画标题矩形
- sizef = g.MeasureString( "客户姓名", ft11 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_1 = new Rectangle( (rec2.X + LeftAdd) + (MColumnWidth1 - StrWidth) - 10, rec2.Y + TopAdd, MColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名" ), ft11, b, rec2_1 );//画第一列的列标题
- Point p21_1 = new Point( rec2.X + MColumnWidth1, rec2.Y );
- Point p21_2 = new Point( rec2.X + MColumnWidth1, rec2.Y + rec2.Height );
- g.DrawLine( p, p21_1, p21_2 );//画第一表与第二列的界线
- Rectangle rec2_2 = new Rectangle( p21_1.X + LeftAdd, p21_1.Y + TopAdd, MColumnWidth2, RowContentHeight );
- g.DrawString( dtRows[0]["主客户姓名"].ToString().Trim().Replace( "/", "," ), ft11, b, rec2_2 );//画第一列的列标题
- Point p22_1 = new Point( p21_1.X + MColumnWidth2, rec2.Y );
- Point p22_2 = new Point( p21_1.X + MColumnWidth2, rec2.Y + rec2.Height );
- g.DrawLine( p, p22_1, p22_2 );//画第一表与第二列的界线
- sizef = g.MeasureString( "电话", ft11 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_3 = new Rectangle( (p22_1.X + LeftAdd) + (MColumnWidth3 - StrWidth) - 10, p22_1.Y + TopAdd, MColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "电话" ), ft11, b, rec2_3 );//画第一列的列标题
- Point p23_1 = new Point( p22_1.X + MColumnWidth3, rec2.Y );
- Point p23_2 = new Point( p22_1.X + MColumnWidth3, rec2.Y + rec2.Height );
- g.DrawLine( p, p23_1, p23_2 );//画第一表与第二列的界线
- Rectangle rec2_4 = new Rectangle( p23_1.X + LeftAdd, p23_1.Y + TopAdd, MColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( dtRows[0]["主客户电话"].ToString().Trim().Replace( "/", "," ) ), ft11, b, rec2_4 );//画第一列的列标题
- Point p24_1 = new Point( p23_1.X + MColumnWidth4, rec2.Y );
- Point p24_2 = new Point( p23_1.X + MColumnWidth4, rec2.Y + rec2.Height );
- g.DrawLine( p, p24_1, p24_2 );//画第一表与第二列的界线
- Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec3 );//画标题矩形
- sizef = g.MeasureString( "门市", ft11 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_1 = new Rectangle( (rec3.X + LeftAdd) + (MColumnWidth1 - StrWidth) - 10, rec3.Y + TopAdd, MColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门市" ), ft11, b, rec3_1 );//画第一列的列标题
- Point p31_1 = new Point( rec3.X + MColumnWidth1, rec3.Y );
- Point p31_2 = new Point( rec3.X + MColumnWidth1, rec3.Y + rec3.Height );
- g.DrawLine( p, p31_1, p31_2 );//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle( p31_1.X + LeftAdd, p31_1.Y + TopAdd, MColumnWidth2, RowContentHeight );
- g.DrawString( dtRows[0]["接单人"].ToString().Trim(), ft11, b, rec3_2 );//画第一列的列标题
- Point p32_1 = new Point( p31_1.X + MColumnWidth2, rec3.Y );
- Point p32_2 = new Point( p31_1.X + MColumnWidth2, rec3.Y + rec3.Height );
- g.DrawLine( p, p32_1, p32_2 );//画第一表与第二列的界线
- sizef = g.MeasureString( "套系名称", ft11 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_3 = new Rectangle( (p32_1.X + LeftAdd) + (MColumnWidth3 - StrWidth) - 10, p32_1.Y + TopAdd, MColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" ), ft11, b, rec3_3 );//画第一列的列标题
- Point p33_1 = new Point( p32_1.X + MColumnWidth3, rec3.Y );
- Point p33_2 = new Point( p32_1.X + MColumnWidth3, rec3.Y + rec3.Height );
- g.DrawLine( p, p33_1, p33_2 );//画第一表与第二列的界线
- Rectangle rec3_4 = new Rectangle( p33_1.X + LeftAdd, p33_1.Y + TopAdd, MColumnWidth4, RowContentHeight );
- g.DrawString( dtRows[0]["套系名称"].ToString().Trim(), ft11, b, rec3_4 );//画第一列的列标题
- Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, 3 );
- g.DrawRectangle( p, rec4 );//画标题矩形
- int Unit = TableWidth / 6;
- int ColumnWidth1 = Unit * 2 + 100;
- int ColumnWidth2 = Unit * 2 - 100;
- int ColumnWidth3 = Unit;
- int ColumnWidth4 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3;
- Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec5 );//画标题矩形
- sizef = g.MeasureString( "服务内容", ft11 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_1 = new Rectangle( rec5.X + (ColumnWidth1 - StrWidth) / 2, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务内容" ), ft11, b, rec5_1 );//画第一列的列标题
- Point p51_1 = new Point( rec5.X + ColumnWidth1, rec5.Y );
- Point p51_2 = new Point( rec5.X + ColumnWidth1, rec5.Y + rec5.Height );
- g.DrawLine( p, p51_1, p51_2 );//画第一表与第二列的界线
- sizef = g.MeasureString( "服务时间", ft11 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_2 = new Rectangle( p51_1.X + (ColumnWidth2 - StrWidth) / 2, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务时间" ), ft11, b, rec5_2 );//画第一列的列标题
- Point p52_1 = new Point( p51_1.X + ColumnWidth2, rec5.Y );
- Point p52_2 = new Point( p51_1.X + ColumnWidth2, rec5.Y + rec5.Height );
- g.DrawLine( p, p52_1, p52_2 );//画第一表与第二列的界线
- sizef = g.MeasureString( "服务人员1", ft11 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_3 = new Rectangle( p52_1.X + (ColumnWidth3 - StrWidth) / 2, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务人员1" ), ft11, b, rec5_3 );//画第一列的列标题
- Point p53_1 = new Point( p52_1.X + ColumnWidth3, rec5.Y );
- Point p53_2 = new Point( p52_1.X + ColumnWidth3, rec5.Y + rec5.Height );
- g.DrawLine( p, p53_1, p53_2 );//画第一表与第二列的界线
- sizef = g.MeasureString( "服务人员2", ft11 );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_4 = new Rectangle( p53_1.X + (ColumnWidth4 - StrWidth) / 2, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务人员2" ), ft11, b, rec5_4 );//画第一列的列标题
- int IntPoint_Y = rec5.Y + rec5.Height;
- for ( int i = 0; i < dtRows.Length; i++ )
- {
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, rec2.Width, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- Rectangle recfor3_1 = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( dtRows[i]["服务内容"].ToString().Trim(), ft9, b, recfor3_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor3_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.DateTimeToString( dtRows[i]["服务时间"] ), ft9, b, recfor3_2 );//画第一列的列标题
- Point pfor2_1 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y );
- Point pfor2_2 = new Point( pfor1_1.X + ColumnWidth2, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor2_1, pfor2_2 );//画第一表与第二列的界线
- Rectangle recfor3_3 = new Rectangle( pfor2_1.X + LeftAdd, pfor2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRows[i]["服务人员1"] ), ft9, b, recfor3_3 );//画第一列的列标题
- Point pfor3_1 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y );
- Point pfor3_2 = new Point( pfor2_1.X + ColumnWidth3, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor3_1, pfor3_2 );//画第一表与第二列的界线
- Rectangle recfor3_4 = new Rectangle( pfor3_1.X + LeftAdd, pfor3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( dtRows[i]["服务人员2"] ), ft9, b, recfor3_4 );//画第一列的列标题
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- MIntPoint_Y = IntPoint_Y + 3;
- }
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( StrValue, ft9 );
- StrHeight = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec6 = new Rectangle( TableWidth + LeftWidth - StrWidth, MIntPoint_Y, StrWidth, StrHeight );
- g.DrawString( StrValue, ft9, b, rec6 );//画消费法规
- }
- #endregion
- #region 选片缩略图
- /// <summary>
- /// 选片缩略图
- /// </summary>
- /// <returns></returns>
- public static void DoorCity_FilmSelectionThumbnail( object objValue, Graphics g, Size size )
- {
- PhotoSelectSystem.EventSelectPhotoPrint spmodel = ((PhotoSelectSystem.EventSelectPhotoPrint)objValue);
- string GetFileName = "Cus_Name AS 客户姓名,M_Cus_Name AS 主客户姓名";
- DataTable tbl = orbll.GetView_Custom( "tempTB_AggregationCustomer", ShowColumnName: GetFileName, StrWhere: "GP_OrderNumber ='" + spmodel.CurrentModel.Ord_Number + "'" ).Tables[0];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "订单错误!" ); return;
- }
- if ( tbl.Rows.Count > 0 )
- {
- if ( !IsHasMorePages )
- {
- if ( !GetImgList( spmodel ) )
- {
- MessageBoxCustom.Show( "此单未选片" ); return;
- }
- }
- ImageList Imglist = ImgSmallMapList;
- #region 把拿出的ImageList中的图片,按规则画到每一张图片上去
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int LeftWidth = 30;
- Font ft16 = new Font( "宋体", 16 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- int PerNumber = 42;
- int PageCount = Imglist.Images.Count / PerNumber;
- if ( Imglist.Images.Count % PerNumber > 0 )
- {
- PageCount++;
- }
- int TableWidth = size.Width - LeftWidth * 2;
- string StrName = tbl.Rows[0]["客户姓名"].ToString().Trim();
- SizeF sizef = g.MeasureString( StrName, ft16 );
- int StrHeight = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( LeftWidth, 50, (TableWidth / 4 * 3), StrHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客人:" ) + StrName + LYFZ.BLL.OtherCommonModel.FontConversion( " — 选片小图" ), ft16, b, rec1 );
- string PageValue = LYFZ.BLL.OtherCommonModel.FontConversion( "页:" ) + PrintCurrentIndexPage + "/" + PageCount;
- sizef = g.MeasureString( PageValue, ft9 );
- StrHeight = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1_1 = new Rectangle( rec1.X + TableWidth - StrWidth, rec1.Y + 2, StrWidth, StrHeight );
- g.DrawString( PageValue, ft9, b, rec1_1 );
- PageValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" );
- sizef = g.MeasureString( PageValue, ft9 );
- StrHeight = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1_2 = new Rectangle( rec1.X + TableWidth - StrWidth + 5, rec1.Y + StrHeight - 2, StrWidth, StrHeight );
- g.DrawString( PageValue, ft9, b, rec1_2 );
- g.DrawLine( p, rec1.X, rec1.Y + rec1.Height + 2, rec1.X + TableWidth, rec1.Y + rec1.Height + 2 );
- int i_Y = rec1.Y + rec1.Height + 5;
- int HeightAdd = 0;
- bool IsNextPage = false;
- //画行
- for ( int i = 1; i <= 6; i++ )
- {
- int l_H = 95;
- int j_X = rec1.X;
- //画列
- for ( int j = 0; j < 7; j++ )
- {
- if ( PrintForCount >= Imglist.Images.Count )
- {
- break;
- }
- Rectangle rec3 = new Rectangle( j_X, i_Y, l_H, l_H );
- g.DrawImage( Imglist.Images[PrintForCount], rec3 );
- HeightAdd = 65;
- Rectangle rec4 = new Rectangle( rec3.X, rec3.Y + rec3.Height + 3, rec3.Width, HeightAdd );
- g.DrawString( Imglist.Images.Keys[PrintForCount], ft9, b, rec4 );
- PrintForCount++;
- j_X += rec3.Width + 10;
- }
- i_Y += l_H + HeightAdd;
- if ( i == 6 && PrintForCount < Imglist.Images.Count )
- {
- PrintCurrentIndexPage++;
- IsNextPage = true;
- IsHasMorePages = true;
- return;
- }
- }
- if ( !IsNextPage )
- {
- IsHasMorePages = false;
- }
- #endregion
- }
- else
- {
- MessageBoxCustom.Show( "此单不存在" ); return;
- }
- }
- private static ImageList ImgSmallMapList;
- private static bool GetImgList( PhotoSelectSystem.EventSelectPhotoPrint spmodel )
- {
- List<LYFZ.PhotoSelectSystem.SelectPhotoInfo> list = spmodel.GetSeletedPhotoList();
- if ( list.Count > 0 )
- {
- #region 先把所有图片拿出来放到ImageList中去
- ImageList Imglist = new ImageList();
- Imglist.ImageSize = new Size( 256, 256 );
- Imglist.ColorDepth = ColorDepth.Depth32Bit;
- for ( int listCout = 0; listCout < list.Count; listCout++ )
- {
- string PhotoPath = list[listCout].SmallBmpFilePath.Trim();
- string OriginalPath = LYFZ.BLL.SelectPhotoHandling.SmallPathToOriginalPath( PhotoPath );//原图路径
- string bb = LYFZ.BLL.SelectPhotoHandling.ServerFileNameToOriginalName( BLL.SelectPhotoHandling.PhotoType.Original, System.IO.Path.GetFileName( OriginalPath ) );
- string PhotoName = GetPhotoInProductName( bb, spmodel.CurrentSelectPhotoInfo );
- System.IO.FileStream fs = new System.IO.FileStream( PhotoPath, System.IO.FileMode.Open, System.IO.FileAccess.Read );
- System.Drawing.Image.FromStream( fs );
- Imglist.Images.Add( PhotoName, System.Drawing.Image.FromStream( fs ) );
- }
- ImgSmallMapList = Imglist;
- return true;
- #endregion
- }
- MessageBoxCustom.Show( "此单未选片" ); return false;
- }
- static string GetPhotoInProductName( string photoName, LYFZ.BLL.ProductSelectedPhotoInfo productObj )
- {
- string productNames = photoName;
- foreach ( LYFZ.BLL.ProductSelectedInfo product in productObj.ProductSelectedList )
- {
- if ( product.CheckPhotoExist( photoName ) )
- {
- productNames += "/" + product.ProductName;
- }
- }
- return productNames;
- }
- #endregion
- #region 制作单明细
- /// <summary>
- /// 制作单明细
- /// </summary>
- /// <returns></returns>
- public static Bitmap DoorCity_MakeDetail(object objValue, Size size, Graphics g1, ref List<List<string>> pListData, ref Dictionary<string, List<int>> dicKeyList, int iPage = 0)
- {
- #region 获取资料
- Bitmap panlImage = null;
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int LeftWidth = 20;
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 20;
- int RowContentHeight = RowHeight - (TopAdd * 2);
- Font ft18 = new Font("宋体", 16);
- Font ft16 = new Font("宋体", 13);
- Font ft10 = new Font("宋体", 9);
- Font ft9 = new Font("宋体", 9);
- PhotoSelectSystem.EventSelectPhotoPrint spmodel = ((PhotoSelectSystem.EventSelectPhotoPrint)objValue);
- LYFZ.Model.Model_ErpOrder Mmdl = spmodel.CurrentModel;
- LYFZ.Model.Model_ErpOrderDigital modeDig = spmodel.CurrentDigModel;
- string StrTableName = "tb_ErpOrder LEFT JOIN tb_ErpOrderDigital ON Ord_Number = Ordv_Number left join tempTB_AggregationCustomer ON Ord_Number = GP_OrderNumber";
- string StrFildeName = "Ord_Number, Ord_Type, Cus_Name AS 客户姓名, Cus_Telephone AS 客户电话, M_Cus_Name AS 主客户姓名, M_Cus_Telephone AS 主客户电话, Ordv_ViceNumber, dbo.fn_CheckUserIDGetUserName(Ordv_FilmSelectionName) AS 选片人,dbo.fn_CheckUserIDGetUserName(Ordv_EarlyRepairName) AS 初修师, Ordv_FilmSelectionTime AS 选片日期," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(OrdPe_OrdersPerson) from tb_ErpOrdersPerson where OrdPe_OrderNumber = Ord_Number for xml path('')),1,1,'')) as 接单人,dbo.fn_CheckUserIDGetUserName(Ordv_ReservationLookDesignName) AS 看设计人, Ordv_ReservationLookDesignTime AS 看设计日期," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_Photographer) from tb_ErpOrdersPhotography where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_Photographer!= '' group by Ordpg_Photographer for xml path('')),1,1,'')) as 摄影师," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_MakeupArtist) from tb_ErpOrdersPhotography where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_MakeupArtist!= '' group by Ordpg_MakeupArtist for xml path('')),1,1,'')) as 化妆师," +
- "(select stuff((select ',' + dbo.fn_CheckUserIDGetUserName(Ordpg_BootDivision) from tb_ErpOrdersPhotography where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_BootDivision!= '' group by Ordpg_BootDivision for xml path('')),1,1,'')) as 引导师," +
- "(select top 1 dbo.fn_CheckDateTimeReturn_Date(dbo.fn_CheckDateTime(Ordpg_PhotographyTime)) from tb_ErpOrdersPhotography where Ordpg_ViceNumber = Ordv_ViceNumber and Ordpg_PhotographyTime is not null order by Ordpg_PhotographyTime DESC) AS 拍摄日期," +
- "(select top 1 dbo.fn_CheckDateTime(OPlist_ReservationTakeTime) from tb_ErpOrderProductList where OPlist_ViceNumber = Ordv_ViceNumber And OPlist_ReservationTakeTime is not null Order by OPlist_ReservationTakeTime ASC) AS 预约取件日期,dbo.fn_GetOrderArrears(Ord_Number) AS 欠款," +
- "(select top 1 dbo.fn_CheckDateTime(OPlist_PickupTime) from tb_ErpOrderProductList where OPlist_ViceNumber = Ordv_ViceNumber And OPlist_PickupTime is not null Order by OPlist_PickupTime ASC) AS 取件日期," +
- "(select top 1 dbo.fn_CheckUserIDGetUserName(OPlist_PickupName) from tb_ErpOrderProductList where OPlist_ViceNumber = Ordv_ViceNumber Order by OPlist_PickupTime ASC) AS 取件师";
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Name,Company_Telephone,Company_Address");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(StrTableName, StrWhere: "Ord_Number = '" + Mmdl.Ord_Number + "' and Ordv_ViceNumber = '" + modeDig.Ordv_ViceNumber + "'", ShowColumnName: StrFildeName);
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpOrdersPhotography", StrWhere: "Ordpg_ViceNumber = '" + modeDig.Ordv_ViceNumber + "'", ShowColumnName: "Ordpg_Sights");
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintProductionOrderUseApecialTemplate)
- {
- ExecuteSql += ";" + String.Format(@" select Pay_OrdNumber,[Plu_OrdNumber],Plu_OrdViceNumber,
- Pay_DividedShop,Pay_ViceNumber
- ,Pay_Category,Pay_TwoPinsCategory,Pay_AmountOf,Pay_PaymentDiscount,Pay_DiscountAmount,Pay_OpenSingle,Pay_ThePayee,Pay_PaymentMethod,Pay_CreateDatetime
- from [dbo].[tb_ErpPayment]
- left join [dbo].[tb_ErpPlusPickItems]
- on Pay_PlusPickNumber=Plu_Number
- where [Plu_SourceType]=1 and [Plu_OrdNumber]='{0}' order by Pay_CreateDatetime ", Mmdl.Ord_Number, modeDig.Ordv_ViceNumber);
- }
- DataSet dtSet = orbll.GetView_Custom(ExecuteSql);
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tb_ord = dtSet.Tables["ds1"];//订单
- DataTable tb_Sights = dtSet.Tables["ds2"];//拍摄名称
- if (tbl.Rows.Count <= 0)
- {
- MessageBoxCustom.Show("未设置影楼信息"); return null;
- }
- int top_TableWidth = size.Width - LeftWidth * 2 - 20;
- int top_ColumnWidth1 = 70;
- int top_ColumnWidth2 = 110;
- int top_ColumnWidth3 = 70;
- int top_ColumnWidth5 = 70;
- int top_ColumnWidth6 = 140;
- int top_ColumnWidth4 = top_TableWidth - top_ColumnWidth1 - top_ColumnWidth2 - top_ColumnWidth3 - top_ColumnWidth5 - top_ColumnWidth6;
- #endregion
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintProductionOrderUseApecialTemplate)
- {
- panlImage = GetSelectPhotoSpecialTemplate(dtSet, spmodel, size, g1, ref pListData, iPage, LeftWidth, LeftAdd, TopAdd, RowHeight, RowContentHeight, ref dicKeyList);
- }
- else
- {
- int sizeHeight = size.Height - 120;
- for (int k = 0; k < 2; k++)
- {
- panlImage = new Bitmap(size.Width, sizeHeight);
- Graphics g = g1;//Graphics.FromImage(panlImage);
- #region 基本资料
- string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion("制作单明细");
- SizeF sizef = g.MeasureString(rec2Value, ft18);
- int StrHeigth = Convert.ToInt32(sizef.Height);
- int StrWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle top_rec1 = new Rectangle((panlImage.Width - StrWidth) / 2, 30, StrWidth, StrHeigth);
- g.DrawString(rec2Value, ft18, b, top_rec1);
- #region 第一行
- Rectangle top_rec2 = new Rectangle(LeftWidth, top_rec1.Y + top_rec1.Height + 5, top_TableWidth, RowHeight);
- g.DrawRectangle(p, top_rec2);//画标题矩形
- Rectangle top_rec2_1 = new Rectangle(top_rec2.X + LeftAdd, top_rec2.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("订单号"), ft10, b, top_rec2_1);
- Point top_p21_1 = new Point(top_rec2.X + top_ColumnWidth1, top_rec2.Y);
- Point top_p21_2 = new Point(top_rec2.X + top_ColumnWidth1, top_rec2.Y + top_rec2.Height);
- g.DrawLine(p, top_p21_1, top_p21_2);
- string OrdNumber = "";
- if (spmodel.CurrentModel.Ord_SinceOrderNumber != "")
- {
- OrdNumber = spmodel.CurrentModel.Ord_SinceOrderNumber;
- }
- else
- {
- OrdNumber = spmodel.CurrentModel.Ord_Number;
- }
- Rectangle top_rec2_2 = new Rectangle(top_p21_1.X + LeftAdd, top_p21_1.Y + TopAdd, top_ColumnWidth2, RowContentHeight);
- g.DrawString(OrdNumber, ft10, b, top_rec2_2);
- Point top_p22_1 = new Point(top_rec2_2.X + top_ColumnWidth2, top_rec2.Y);
- Point top_p22_2 = new Point(top_rec2_2.X + top_ColumnWidth2, top_rec2.Y + top_rec2.Height);
- g.DrawLine(p, top_p22_1, top_p22_2);
- Rectangle top_rec2_3 = new Rectangle(top_p22_1.X + LeftAdd, top_p22_1.Y + TopAdd, top_ColumnWidth3 + top_ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称:") + spmodel.CurrentModel.Ord_SeriesName + LYFZ.BLL.OtherCommonModel.FontConversion(" 欠款:") + tb_ord.Rows[0]["欠款"].ToString(), ft10, b, top_rec2_3);
- }
- else
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称:") + spmodel.CurrentModel.Ord_SeriesName, ft10, b, top_rec2_3);
- }
- //Point top_p23_1 = new Point(top_rec2_3.X + top_ColumnWidth3, top_rec2.Y);
- //Point top_p23_2 = new Point(top_rec2_3.X + top_ColumnWidth3, top_rec2.Y + top_rec2.Height);
- //g.DrawLine(p, top_p23_1, top_p23_2);
- //Rectangle top_rec2_4 = new Rectangle(top_p23_1.X + LeftAdd, top_p23_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
- //g.DrawString(spmodel.CurrentModel.Ord_SeriesName, ft10, b, top_rec2_4);
- Point top_p24_1 = new Point(top_rec2_3.X + top_rec2_3.Width + LeftAdd, top_rec2.Y);
- Point top_p24_2 = new Point(top_rec2_3.X + top_rec2_3.Width + LeftAdd, top_rec2.Y + top_rec2.Height);
- g.DrawLine(p, top_p24_1, top_p24_2);
- Rectangle top_rec2_5 = new Rectangle(top_p24_1.X + LeftAdd, top_p24_1.Y + TopAdd, top_ColumnWidth5 + top_ColumnWidth6, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底加挑:") + spmodel.IntoBottomPickNumber + LYFZ.BLL.OtherCommonModel.FontConversion(" 入册加挑:") + spmodel.IntoRegisterPickNumber, ft10, b, top_rec2_5);
- //Point top_p25_1 = new Point(top_rec2_5.X + top_ColumnWidth5, top_rec2.Y);
- //Point top_p25_2 = new Point(top_rec2_5.X + top_ColumnWidth5, top_rec2.Y + top_rec2.Height);
- //g.DrawLine(p, top_p25_1, top_p25_2);
- //Rectangle top_rec2_6 = new Rectangle(top_p25_1.X + LeftAdd, top_p25_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
- //g.DrawString(spmodel.PlusPickSumCount.ToString().Trim(), ft10, b, top_rec2_6);
- #endregion
- #region 第二行
- Rectangle top_rec3 = new Rectangle(LeftWidth, top_rec2.Y + top_rec2.Height, top_TableWidth, RowHeight);
- g.DrawRectangle(p, top_rec3);//画标题矩形
- Rectangle top_rec3_1 = new Rectangle(top_rec3.X + LeftAdd, top_rec3.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名"), ft10, b, top_rec3_1);
- Point top_p31_1 = new Point(top_rec3.X + top_ColumnWidth1, top_rec3.Y);
- Point top_p31_2 = new Point(top_rec3.X + top_ColumnWidth1, top_rec3.Y + top_rec3.Height);
- g.DrawLine(p, top_p31_1, top_p31_2);
- string StrUserName = tb_ord.Rows[0]["客户姓名"].ToString().Trim();
- string StrPhone = tb_ord.Rows[0]["客户电话"].ToString().Trim();
- if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "2")
- {
- StrUserName = tb_ord.Rows[0]["主客户姓名"].ToString().Trim();
- StrPhone = tb_ord.Rows[0]["主客户电话"].ToString().Trim();
- }
- Rectangle top_rec3_2 = new Rectangle(top_p31_1.X + LeftAdd, top_p31_1.Y + TopAdd, top_ColumnWidth2, RowContentHeight);
- g.DrawString(StrUserName, ft10, b, top_rec3_2);
- Point top_p32_1 = new Point(top_rec3_2.X + top_ColumnWidth2, top_rec3.Y);
- Point top_p32_2 = new Point(top_rec3_2.X + top_ColumnWidth2, top_rec3.Y + top_rec3.Height);
- g.DrawLine(p, top_p32_1, top_p32_2);
- Rectangle top_rec3_3 = new Rectangle(top_p32_1.X + LeftAdd, top_p32_1.Y + TopAdd, top_ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户电话"), ft10, b, top_rec3_3);
- Point top_p33_1 = new Point(top_rec3_3.X + top_ColumnWidth3, top_rec3.Y);
- Point top_p33_2 = new Point(top_rec3_3.X + top_ColumnWidth3, top_rec3.Y + top_rec3.Height);
- g.DrawLine(p, top_p33_1, top_p33_2);
- Rectangle top_rec3_4 = new Rectangle(top_p33_1.X + LeftAdd, top_p33_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(StrPhone), ft10, b, top_rec3_4);
- Point top_p34_1 = new Point(top_rec3_4.X + top_ColumnWidth4, top_rec3.Y);
- Point top_p34_2 = new Point(top_rec3_4.X + top_ColumnWidth4, top_rec3.Y + top_rec3.Height);
- g.DrawLine(p, top_p34_1, top_p34_2);
- Rectangle top_rec3_5 = new Rectangle(top_p34_1.X + LeftAdd, top_p34_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("金额"), ft10, b, top_rec3_5);
- }
- else
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("加挑金额"), ft10, b, top_rec3_5);
- }
- Point top_p35_1 = new Point(top_rec3_5.X + top_ColumnWidth5, top_rec3.Y);
- Point top_p35_2 = new Point(top_rec3_5.X + top_ColumnWidth5, top_rec3.Y + top_rec3.Height);
- g.DrawLine(p, top_p35_1, top_p35_2);
- Rectangle top_rec3_6 = new Rectangle(top_p35_1.X + LeftAdd, top_p35_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- g.DrawString(spmodel.CurrentModel.Ord_SeriesPrice.ToString("n2").Trim(), ft10, b, top_rec3_6);
- }
- else
- {
- g.DrawString(spmodel.PlusPickAmount.ToString().Trim(), ft10, b, top_rec3_6);
- }
- #endregion
- #region 第三行
- Rectangle top_rec4 = new Rectangle(LeftWidth, top_rec3.Y + top_rec3.Height, top_TableWidth, RowHeight);
- g.DrawRectangle(p, top_rec4);//画标题矩形
- Rectangle top_rec4_1 = new Rectangle(top_rec4.X + LeftAdd, top_rec4.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft10, b, top_rec4_1);
- Point top_p41_1 = new Point(top_rec4.X + top_ColumnWidth1, top_rec4.Y);
- Point top_p41_2 = new Point(top_rec4.X + top_ColumnWidth1, top_rec4.Y + top_rec4.Height);
- g.DrawLine(p, top_p41_1, top_p41_2);
- Rectangle top_rec4_2 = new Rectangle(top_p41_1.X + LeftAdd, top_p41_1.Y + TopAdd, top_ColumnWidth2, RowContentHeight);
- g.DrawString(tb_ord.Rows[0]["摄影师"].ToString().Trim(), ft10, b, top_rec4_2);
- Point top_p42_1 = new Point(top_rec4_2.X + top_ColumnWidth2, top_rec4.Y);
- Point top_p42_2 = new Point(top_rec4_2.X + top_ColumnWidth2, top_rec4.Y + top_rec4.Height);
- g.DrawLine(p, top_p42_1, top_p42_2);
- Rectangle top_rec4_3 = new Rectangle(top_p42_1.X + LeftAdd, top_p42_1.Y + TopAdd, top_ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft10, b, top_rec4_3);
- Point top_p43_1 = new Point(top_rec4_3.X + top_ColumnWidth3, top_rec4.Y);
- Point top_p43_2 = new Point(top_rec4_3.X + top_ColumnWidth3, top_rec4.Y + top_rec4.Height);
- g.DrawLine(p, top_p43_1, top_p43_2);
- Rectangle top_rec4_4 = new Rectangle(top_p43_1.X + LeftAdd, top_p43_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
- g.DrawString(tb_ord.Rows[0]["接单人"].ToString().Trim(), ft10, b, top_rec4_4);
- Point top_p44_1 = new Point(top_rec4_4.X + top_ColumnWidth4, top_rec4.Y);
- Point top_p44_2 = new Point(top_rec4_4.X + top_ColumnWidth4, top_rec4.Y + top_rec4.Height);
- g.DrawLine(p, top_p44_1, top_p44_2);
- Rectangle top_rec4_5 = new Rectangle(top_p44_1.X + LeftAdd, top_p44_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约取件"), ft10, b, top_rec4_5);
- Point top_p45_1 = new Point(top_rec4_5.X + top_ColumnWidth5, top_rec4.Y);
- Point top_p45_2 = new Point(top_rec4_5.X + top_ColumnWidth5, top_rec4.Y + top_rec4.Height);
- g.DrawLine(p, top_p45_1, top_p45_2);
- Rectangle top_rec4_6 = new Rectangle(top_p45_1.X + LeftAdd, top_p45_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
- g.DrawString(LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["预约取件日期"]), ft10, b, top_rec4_6);
- #endregion
- #region 第四行
- Rectangle top_rec5 = new Rectangle(LeftWidth, top_rec4.Y + top_rec4.Height, top_TableWidth, RowHeight);
- g.DrawRectangle(p, top_rec5);//画标题矩形
- Rectangle top_rec5_1 = new Rectangle(top_rec5.X + LeftAdd, top_rec5.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄日期"), ft10, b, top_rec5_1);
- Point top_p51_1 = new Point(top_rec5.X + top_ColumnWidth1, top_rec5.Y);
- Point top_p51_2 = new Point(top_rec5.X + top_ColumnWidth1, top_rec5.Y + top_rec5.Height);
- g.DrawLine(p, top_p51_1, top_p51_2);
- Rectangle top_rec5_2 = new Rectangle(top_p51_1.X + LeftAdd, top_p51_1.Y + TopAdd, top_ColumnWidth2, RowContentHeight);
- g.DrawString(LYFZ.Command.Command_Validate.DateTimeToString(tb_ord.Rows[0]["拍摄日期"]), ft10, b, top_rec5_2);
- Point top_p52_1 = new Point(top_rec5_2.X + top_ColumnWidth2, top_rec5.Y);
- Point top_p52_2 = new Point(top_rec5_2.X + top_ColumnWidth2, top_rec5.Y + top_rec5.Height);
- g.DrawLine(p, top_p52_1, top_p52_2);
- Rectangle top_rec5_3 = new Rectangle(top_p52_1.X + LeftAdd, top_p52_1.Y + TopAdd, top_ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft10, b, top_rec5_3);
- Point top_p53_1 = new Point(top_rec5_3.X + top_ColumnWidth3, top_rec5.Y);
- Point top_p53_2 = new Point(top_rec5_3.X + top_ColumnWidth3, top_rec5.Y + top_rec5.Height);
- g.DrawLine(p, top_p53_1, top_p53_2);
- Rectangle top_rec5_4 = new Rectangle(top_p53_1.X + LeftAdd, top_p53_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
- g.DrawString(tb_ord.Rows[0]["化妆师"].ToString().Trim(), ft10, b, top_rec5_4);
- Point top_p54_1 = new Point(top_rec5_4.X + top_ColumnWidth4, top_rec5.Y);
- Point top_p54_2 = new Point(top_rec5_4.X + top_ColumnWidth4, top_rec5.Y + top_rec5.Height);
- g.DrawLine(p, top_p54_1, top_p54_2);
- string StrColumnName = "";
- string StrColumnValue = "";
- if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
- {
- Rectangle top_rec5_5 = new Rectangle(top_p54_1.X + LeftAdd, top_p54_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
- StrColumnName = LYFZ.BLL.OtherCommonModel.FontConversion("引导师");
- StrColumnValue = tb_ord.Rows[0]["引导师"].ToString().Trim();
- top_rec5_5.X -= (top_ColumnWidth6 + 20);
- g.DrawString(StrColumnName, ft10, b, top_rec5_5);
- Point top_p55_1 = new Point(top_rec5_5.X - LeftAdd, top_rec5.Y);
- Point top_p55_2 = new Point(top_rec5_5.X - LeftAdd, top_rec5.Y + top_rec5.Height);
- g.DrawLine(p, top_p55_1, top_p55_2);
- Rectangle top_rec5_6 = new Rectangle(top_p55_1.X + top_ColumnWidth5 + LeftAdd, top_p55_1.Y + TopAdd, top_ColumnWidth4, RowContentHeight);
- g.DrawString(StrColumnValue, ft10, b, top_rec5_6);
- top_p55_1 = new Point(top_rec5_6.X - LeftAdd, top_rec5.Y);
- top_p55_2 = new Point(top_rec5_6.X - LeftAdd, top_rec5.Y + top_rec5.Height);
- g.DrawLine(p, top_p55_1, top_p55_2);
- top_rec5_5 = new Rectangle(top_p54_1.X + LeftAdd, top_p54_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
- StrColumnName = LYFZ.BLL.OtherCommonModel.FontConversion("初修师");
- StrColumnValue = tb_ord.Rows[0]["初修师"].ToString().Trim();
- g.DrawString(StrColumnName, ft10, b, top_rec5_5);
- top_p55_1 = new Point(top_rec5_5.X + top_ColumnWidth5, top_rec5.Y);
- top_p55_2 = new Point(top_rec5_5.X + top_ColumnWidth5, top_rec5.Y + top_rec5.Height);
- g.DrawLine(p, top_p55_1, top_p55_2);
- top_rec5_6 = new Rectangle(top_p55_1.X + LeftAdd, top_p55_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
- g.DrawString(StrColumnValue, ft10, b, top_rec5_6);
- }
- else
- {
- Rectangle top_rec5_5 = new Rectangle(top_p54_1.X + LeftAdd, top_p54_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
- StrColumnName = LYFZ.BLL.OtherCommonModel.FontConversion("初修师");
- StrColumnValue = tb_ord.Rows[0]["初修师"].ToString().Trim();
- g.DrawString(StrColumnName, ft10, b, top_rec5_5);
- Point top_p55_1 = new Point(top_rec5_5.X + top_ColumnWidth5, top_rec5.Y);
- Point top_p55_2 = new Point(top_rec5_5.X + top_ColumnWidth5, top_rec5.Y + top_rec5.Height);
- g.DrawLine(p, top_p55_1, top_p55_2);
- Rectangle top_rec5_6 = new Rectangle(top_p55_1.X + LeftAdd, top_p55_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
- g.DrawString(StrColumnValue, ft10, b, top_rec5_6);
- }
- #endregion
- #region 第五行
- Rectangle top_rec6 = new Rectangle(LeftWidth, top_rec5.Y + top_rec5.Height, top_TableWidth, RowHeight);
- g.DrawRectangle(p, top_rec6);//画标题矩形
- Rectangle top_rec6_1 = new Rectangle(top_rec6.X + LeftAdd, top_rec6.Y + TopAdd, top_ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("统计"), ft10, b, top_rec6_1);
- Point top_p61_1 = new Point(top_rec6.X + top_ColumnWidth1, top_rec6.Y);
- Point top_p61_2 = new Point(top_rec6.X + top_ColumnWidth1, top_rec6.Y + top_rec6.Height);
- g.DrawLine(p, top_p61_1, top_p61_2);
- string StrStatistics = "";
- if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
- {
- //StrStatistics = LYFZ.BLL.OtherCommonModel.FontConversion("总拍摄张数") + spmodel.OrderTotalNumberShooting + LYFZ.BLL.OtherCommonModel.FontConversion("张 本次拍摄张数") + spmodel.ThisTakenNumberShooting + LYFZ.BLL.OtherCommonModel.FontConversion("张 选中总张数") + spmodel.PlusPickSumCount + LYFZ.BLL.OtherCommonModel.FontConversion("张 未选") + (spmodel.ThisTakenNumberShooting - spmodel.PlusPickSumCount) + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- StrStatistics = LYFZ.BLL.OtherCommonModel.FontConversion("本次拍摄张数") + spmodel.ThisTakenNumberShooting + LYFZ.BLL.OtherCommonModel.FontConversion("张 选中总张数") + spmodel.PlusPickSumCount + LYFZ.BLL.OtherCommonModel.FontConversion("张 未选") + (spmodel.ThisTakenNumberShooting - spmodel.PlusPickSumCount) + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- else
- {
- StrStatistics = LYFZ.BLL.OtherCommonModel.FontConversion("总张数") + spmodel.OrderTotalNumberShooting + LYFZ.BLL.OtherCommonModel.FontConversion("张 选中") + spmodel.PlusPickSumCount + LYFZ.BLL.OtherCommonModel.FontConversion("张 未选") + (spmodel.OrderTotalNumberShooting - spmodel.PlusPickSumCount) + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- Rectangle top_rec6_2 = new Rectangle(top_p61_1.X + LeftAdd, top_p61_1.Y + TopAdd, top_rec6.Width - top_ColumnWidth1 - top_ColumnWidth5 - top_ColumnWidth6, RowContentHeight);
- g.DrawString(StrStatistics, ft10, b, top_rec6_2);
- if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
- {
- Point top_p62_1 = new Point(top_p61_1.X + top_rec6_2.Width + 9, top_rec6.Y);
- Point top_p62_2 = new Point(top_p61_1.X + top_rec6_2.Width + 9, top_rec6.Y + top_rec6.Height);
- g.DrawLine(p, top_p62_1, top_p62_2);
- Rectangle top_rec7_1 = new Rectangle(top_p62_1.X + LeftAdd, top_p62_1.Y + TopAdd, top_ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄名称"), ft10, b, top_rec7_1);
- Point top_p71_1 = new Point(top_p62_1.X + top_ColumnWidth5 + 3, top_rec6.Y);
- Point top_p71_2 = new Point(top_p62_1.X + top_ColumnWidth5 + 3, top_rec6.Y + top_rec6.Height);
- g.DrawLine(p, top_p71_1, top_p71_2);
- Rectangle top_rec8_1 = new Rectangle(top_p71_1.X + LeftAdd, top_p71_1.Y + TopAdd, top_ColumnWidth6, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(tb_Sights.Rows[0]["Ordpg_Sights"].ToString().Trim()), ft10, b, top_rec8_1);
- }
- #endregion
- #endregion
- ///定位区域
- Rectangle Position_Rect = top_rec6;
- //表宽
- int mid_TableWidth = top_TableWidth;
- //列宽
- int mid_ColumnWidth1 = 110; //产品名
- int mid_ColumnWidth2 = 84; //等级/加急日期
- int mid_ColumnWidth3 = 30; //P数
- int mid_ColumnWidth4 = 30; //数量
- int mid_ColumnWidth5 = 90; //备注
- int mid_ColumnWidth6 = mid_TableWidth - mid_ColumnWidth1 - mid_ColumnWidth2 - mid_ColumnWidth3 - mid_ColumnWidth4 - mid_ColumnWidth5; //所选相片编号
- // LYFZ.EnumPublic.OrderType tempOrderType = (LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), Mmdl.Ord_Type);
- List<LYFZ.PhotoSelectSystem.SelectPrintProduction> SelectPrintList = new List<LYFZ.PhotoSelectSystem.SelectPrintProduction>();
- if (spmodel.SelectPrintList.Count > 0)
- {
- SelectPrintList = spmodel.SelectPrintList;
- }
- else
- {
- SelectPrintList.Add(new LYFZ.PhotoSelectSystem.SelectPrintProduction()
- {
- OrderDigital = spmodel.CurrentDigModel
- ,
- Photography = spmodel.CurrentSelectPhotoHandling.PhotoModel
- });
- }
- if (SelectPrintList.Count > 0)
- {
- foreach (LYFZ.PhotoSelectSystem.SelectPrintProduction selectItem in SelectPrintList)
- {
- string titleString = String.Format("指定制作");
- if (selectItem.Photography != null)
- {
- if (!String.IsNullOrWhiteSpace(selectItem.Photography.Ordpg_Sights))
- {
- titleString = String.Format("【{0}】指定制作", selectItem.Photography.Ordpg_Sights);
- }
- }
- #region 列标题
- string[] columnList = new string[6] { "产品名称", "等级/加急日", "P数", "数量", "备注", "所用照片" };
- int[] _ColumnWidthList = new int[6] { mid_ColumnWidth1, mid_ColumnWidth2, mid_ColumnWidth3, mid_ColumnWidth4, mid_ColumnWidth5, mid_ColumnWidth6 };
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- columnList = new string[5] { "产品名称", "P数", "数量", "备注", "所用照片" };
- _ColumnWidthList = new int[5] { mid_ColumnWidth1, mid_ColumnWidth3, mid_ColumnWidth4, mid_ColumnWidth5, mid_ColumnWidth6 + mid_ColumnWidth2 };
- }
- LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint = LYFZ.PhotoSelectSystem.frmSaveSelectPhotoInfo.GetStaticSelectPhotoPrint(Mmdl, selectItem.OrderDigital);
- if (pListData.Count == 0)
- {
- pListData = GetMakeDetailListData(g1, ft9, columnList, _ColumnWidthList, eventSelectPhotoPrint, eventSelectPhotoPrint.MakingProductList, PrintOtherData, new string[] { "选片师/日期", "取件师/日期", "二次看设计师/日期", "取件师/日期" },
- new DataRow[] { }, mid_TableWidth, ref dicKeyList, 740);
- }
- List<string> pData = pListData[iPage];
- if (pData.Count > 0||(pData.Count==0 &&(dicKeyList["[=入底]"].Contains(iPage + 1)|| dicKeyList["[=入册]"].Contains(iPage + 1) || dicKeyList["[=调修要求]"].Contains(iPage + 1))))
- {
- sizef = g.MeasureString(titleString, ft16);
- StrHeigth = Convert.ToInt32(sizef.Height);
- StrWidth = Convert.ToInt32(sizef.Width) + 1;
- Position_Rect = new Rectangle((mid_TableWidth - StrWidth) / 2, Position_Rect.Y + Position_Rect.Height + 7, StrWidth, StrHeigth);
- g.DrawString(titleString, ft16, b, Position_Rect);
- Position_Rect = new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height, mid_TableWidth, RowHeight);
- g.DrawRectangle(p, Position_Rect);//画标题矩形
- }
- Rectangle columnPosition_Rect = new Rectangle(Position_Rect.X, Position_Rect.Y, 0, Position_Rect.Height);
- if (pData.Count > 0)
- {
- for (int i = 0; i < columnList.Length; i++)
- {
- columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[i], columnPosition_Rect.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(columnList[i]), ft10, b
- , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, RowContentHeight));
- g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
- , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
- }
- }
- #endregion
- #region 输出产品列表和产品选片信息
- LYFZ.PhotoSelectSystem.MakingProduct IntoBottom_makingItem = new PhotoSelectSystem.MakingProduct();//入底
- LYFZ.PhotoSelectSystem.MakingProduct IntoBook_makingItem = new PhotoSelectSystem.MakingProduct();//入册
- foreach (string strMakingItem in pData)
- {
- LYFZ.PhotoSelectSystem.MakingProduct makingItem = Newtonsoft.Json.JsonConvert.DeserializeObject<LYFZ.PhotoSelectSystem.MakingProduct>(strMakingItem);
- LYFZ.Model.Model_ErpOrderProductList mProduct = makingItem.OrderProduct;
- if (makingItem.IsEndorBook)
- {
- if (mProduct.OPlist_ProdName.Trim() == "入底")
- {
- IntoBottom_makingItem = makingItem;
- }
- else if (mProduct.OPlist_ProdName.Trim() == "入册")
- {
- IntoBook_makingItem = makingItem;
- }
- continue;
- }
- string[] ValueList = new string[6] { "", "", "", "", "", "" };
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- ValueList = new string[5] { "", "", "", "", "" };
- }
- int lineHeight = GetLineHeight(eventSelectPhotoPrint, makingItem, mProduct, ft9, LeftAdd, _ColumnWidthList, g, ref ValueList);
- Position_Rect = new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height, mid_TableWidth, lineHeight + TopAdd * 2);
- g.DrawRectangle(p, Position_Rect);//画标题矩形
- columnPosition_Rect = new Rectangle(Position_Rect.X, Position_Rect.Y, 0, Position_Rect.Height);
- for (int j = 0; j < columnList.Length; j++)
- {
- columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[j], columnPosition_Rect.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(ValueList[j]), ft9, b
- , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, lineHeight));
- g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
- , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
- }
- }
- //if (dicKeyList.ContainsKey("[=入底入册]") && dicKeyList["[=入底入册]"].Contains(iPage + 1))
- //{
- //入底/入册/调修要求 "入底","入册",
- string[] subColumnList = new string[] { "入底", "入册", "调修要求" };
- for (int i = 0; i < subColumnList.Length; i++)
- {
- if (dicKeyList.ContainsKey("[="+ subColumnList[i] + "]") && dicKeyList["[=" + subColumnList[i] + "]"].Contains(iPage + 1))
- {
- int lineHeight = 0;
- string valueString = "-";
- int photoCount = 0;
- if (!string.IsNullOrEmpty(IntoBottom_makingItem.OrderProduct.OPlist_ProdName) && IntoBottom_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[i])
- {
- valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBottom_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
- valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- else if (!string.IsNullOrEmpty(IntoBook_makingItem.OrderProduct.OPlist_ProdName) && IntoBook_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[i])
- {
- valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBook_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
- valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- else if (subColumnList[i] == "调修要求")
- {
- valueString = eventSelectPhotoPrint.CustomerRequest + " " + eventSelectPhotoPrint.PhotoRequest;
- }
- lineHeight = Convert.ToInt32(g.MeasureString(valueString, ft9, mid_TableWidth - _ColumnWidthList[0] - LeftAdd * 2).Height) + 1;
- Position_Rect = new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height, mid_TableWidth, lineHeight + TopAdd * 2);
- g.DrawRectangle(p, Position_Rect);//画标题矩形
- columnPosition_Rect = new Rectangle(Position_Rect.X, Position_Rect.Y, 0, Position_Rect.Height);
- for (int j = 0; j < 2; j++)
- {
- string ContentText = "";
- if (j == 0)
- {
- ContentText = subColumnList[i];
- columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[0], columnPosition_Rect.Height);
- }
- else
- {
- columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, Position_Rect.Width - _ColumnWidthList[0], columnPosition_Rect.Height);
- ContentText = valueString;
- }
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(ContentText), ft10, b
- , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, lineHeight));
- g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
- , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
- }
- }
- }
- //}
- #endregion
- }
- }
- else
- {
- #region 指定制作
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("指定制作");
- sizef = g.MeasureString(rec2Value, ft16);
- StrHeigth = Convert.ToInt32(sizef.Height);
- StrWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle mid_rec1 = new Rectangle((top_TableWidth - StrWidth) / 2, top_rec6.Y + top_rec6.Height + 5, StrWidth, StrHeigth);
- g.DrawString(rec2Value, ft16, b, mid_rec1);
- #region 列标题
- Rectangle mid_rec2 = new Rectangle(LeftWidth, mid_rec1.Y + mid_rec1.Height, mid_TableWidth, RowHeight);
- g.DrawRectangle(p, mid_rec2);//画标题矩形
- Rectangle mid_rec2_1 = new Rectangle(mid_rec2.X + LeftAdd, mid_rec2.Y + TopAdd, mid_ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("产品名称"), ft10, b, mid_rec2_1);
- Point mid_p21_1 = new Point(mid_rec2.X + mid_ColumnWidth1, mid_rec2.Y);
- Point mid_p21_2 = new Point(mid_rec2.X + mid_ColumnWidth1, mid_rec2.Y + mid_rec2.Height);
- g.DrawLine(p, mid_p21_1, mid_p21_2);
- Rectangle mid_rec2_2 = new Rectangle(mid_p21_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth2, RowContentHeight);
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件日期"), ft10, b, mid_rec2_2);
- }
- else
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("等级/加急日"), ft10, b, mid_rec2_2);
- }
- Point mid_p22_1 = new Point(mid_rec2_2.X + mid_ColumnWidth2, mid_rec2.Y);
- Point mid_p22_2 = new Point(mid_rec2_2.X + mid_ColumnWidth2, mid_rec2.Y + mid_rec2.Height);
- g.DrawLine(p, mid_p22_1, mid_p22_2);
- Rectangle mid_rec2_3 = new Rectangle(mid_p22_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("P数"), ft10, b, mid_rec2_3);
- Point mid_p23_1 = new Point(mid_rec2_3.X + mid_ColumnWidth3, mid_rec2.Y);
- Point mid_p23_2 = new Point(mid_rec2_3.X + mid_ColumnWidth3, mid_rec2.Y + mid_rec2.Height);
- g.DrawLine(p, mid_p23_1, mid_p23_2);
- Rectangle mid_rec2_4 = new Rectangle(mid_p23_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("数量"), ft10, b, mid_rec2_4);
- Point mid_p24_1 = new Point(mid_rec2_4.X + mid_ColumnWidth4, mid_rec2.Y);
- Point mid_p24_2 = new Point(mid_rec2_4.X + mid_ColumnWidth4, mid_rec2.Y + mid_rec2.Height);
- g.DrawLine(p, mid_p24_1, mid_p24_2);
- Rectangle mid_rec2_5 = new Rectangle(mid_p24_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("备注"), ft10, b, mid_rec2_5);
- Point mid_p25_1 = new Point(mid_rec2_5.X + mid_ColumnWidth5, mid_rec2.Y);
- Point mid_p25_2 = new Point(mid_rec2_5.X + mid_ColumnWidth5, mid_rec2.Y + mid_rec2.Height);
- g.DrawLine(p, mid_p25_1, mid_p25_2);
- Rectangle mid_rec2_6 = new Rectangle(mid_p25_1.X + LeftAdd, mid_rec2_1.Y, mid_ColumnWidth6, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("所用照片"), ft10, b, mid_rec2_6);
- #endregion
- int IntoBookCount = 0;
- int IntoBottomCount = 0;
- // int TotalZhangCount = 0;
- string StrIntoBook = "";//入册
- string StrIntoBottom = "";//入底
- int mid_For_Y = mid_rec2.Y + mid_rec2.Height;
- #region 画内容
- int tempWidth = 0;
- if (pListData.Count == 0)
- {
- string[] columnList = new string[6] { "产品名称", "等级/加急日", "P数", "数量", "备注", "所用照片" };
- int[] _ColumnWidthList = new int[6] { mid_ColumnWidth1, mid_ColumnWidth2, mid_ColumnWidth3, mid_ColumnWidth4, mid_ColumnWidth5, mid_ColumnWidth6 };
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- columnList = new string[5] { "产品名称", "P数", "数量", "备注", "所用照片" };
- _ColumnWidthList = new int[5] { mid_ColumnWidth1, mid_ColumnWidth3, mid_ColumnWidth4, mid_ColumnWidth5, mid_ColumnWidth6 + mid_ColumnWidth2 };
- }
- pListData = GetMakeDetailListData(g1, ft9, columnList, _ColumnWidthList, spmodel, spmodel.MakingProductList, PrintOtherData,
- new string[] { "选片师/日期", "取件师/日期", "二次看设计师/日期", "取件师/日期" },
- new DataRow[] { }, mid_TableWidth, ref dicKeyList, 740);
- for (int it = 1; it < _ColumnWidthList.Length; it++)
- {
- tempWidth += _ColumnWidthList[it];
- }
- }
- //List<LYFZ.PhotoSelectSystem.MakingProduct> ptlist = ;
- //if (ptlist.Count > 0)
- //{
- List<string> pData = pListData[iPage];
- foreach (string strMakingItem in pData)
- {
- LYFZ.PhotoSelectSystem.MakingProduct mpdt = Newtonsoft.Json.JsonConvert.DeserializeObject<LYFZ.PhotoSelectSystem.MakingProduct>(strMakingItem);
- //LYFZ.PhotoSelectSystem.MakingProduct mpdt = ptlist[i];
- LYFZ.Model.Model_ErpOrderProductList mdl = mpdt.OrderProduct;
- if (mdl.OPlist_ProdName == "入册")
- {
- StrIntoBook += spmodel.GetSelectProductPhotoNameString(mdl.OPlist_UniquelyIdentity.ToString(), ref IntoBookCount) + ",";
- }
- else if (mdl.OPlist_ProdName == "入底")
- {
- StrIntoBottom += spmodel.GetSelectProductPhotoNameString(mdl.OPlist_UniquelyIdentity.ToString(), ref IntoBottomCount) + ",";
- }
- else
- {
- if (mpdt.IsEndorBook)
- {
- continue;
- }
- int ForRowContentHeight = 0;
- ForRowContentHeight = Convert.ToInt32(g.MeasureString(mdl.OPlist_ProdName, ft9, mid_ColumnWidth1 - LeftAdd * 2).Height) + 1; //产品名称
- sizef = g.MeasureString(mdl.OPlist_Remark, ft9, mid_ColumnWidth5 - LeftAdd * 2); //备注
- if (ForRowContentHeight < Convert.ToInt32(sizef.Height) + 1)
- {
- ForRowContentHeight = Convert.ToInt32(sizef.Height) + 1;
- }
- string StrIsExp = mdl.OPlist_IsExpedited ? LYFZ.BLL.OtherCommonModel.FontConversion("加急件") : LYFZ.BLL.OtherCommonModel.FontConversion("普通件");
- if (mdl.OPlist_ExpeditedTime.ToString().Trim() != "")
- {
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- StrIsExp = LYFZ.Command.Command_Validate.DateTimeToString(mdl.OPlist_ExpeditedTime);
- }
- else
- {
- StrIsExp += "\r\n" + LYFZ.Command.Command_Validate.DateTimeToString(mdl.OPlist_ExpeditedTime);
- }
- }
- sizef = g.MeasureString(StrIsExp, ft9, mid_ColumnWidth5 - LeftAdd * 2); //等级
- if (ForRowContentHeight < Convert.ToInt32(sizef.Height))
- {
- ForRowContentHeight = Convert.ToInt32(sizef.Height);
- }
- int photoCount = 0;
- string StrPhoto = spmodel.GetSelectProductPhotoNameString(mdl.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
- if (!string.IsNullOrEmpty(StrPhoto))
- {
- StrPhoto += LYFZ.BLL.OtherCommonModel.FontConversion(" 共" + photoCount + "张");
- }
- else
- {
- StrPhoto = "测试高";
- }
- // TotalZhangCount += photoCount;
- sizef = g.MeasureString(StrPhoto, ft9, mid_ColumnWidth6 - LeftAdd * 2);
- if (ForRowContentHeight < Convert.ToInt32(sizef.Height) + 1)
- {
- ForRowContentHeight = Convert.ToInt32(sizef.Height) + 1;
- }
- Rectangle mid_rec3 = new Rectangle(LeftWidth, mid_For_Y, mid_TableWidth, ForRowContentHeight + TopAdd);
- g.DrawRectangle(p, mid_rec3);//画标题矩形
- //产品名称
- Rectangle mid_rec3_1 = new Rectangle(mid_rec3.X + LeftAdd, mid_rec3.Y + TopAdd, mid_ColumnWidth1 - LeftAdd * 2, ForRowContentHeight);
- g.DrawString(mdl.OPlist_ProdName, ft9, b, mid_rec3_1);
- Point mid_p31_1 = new Point(mid_rec3.X + mid_ColumnWidth1, mid_rec3.Y);
- Point mid_p31_2 = new Point(mid_rec3.X + mid_ColumnWidth1, mid_rec3.Y + mid_rec3.Height);
- g.DrawLine(p, mid_p31_1, mid_p31_2);
- //等级
- Rectangle mid_rec3_2 = new Rectangle(mid_p31_1.X + LeftAdd, mid_p31_1.Y + TopAdd, mid_ColumnWidth2 - LeftAdd * 2, ForRowContentHeight);
- g.DrawString(StrIsExp, ft9, b, mid_rec3_2);
- Point mid_p32_1 = new Point(mid_rec3_2.X + mid_ColumnWidth2, mid_rec3.Y);
- Point mid_p32_2 = new Point(mid_rec3_2.X + mid_ColumnWidth2, mid_rec3.Y + mid_rec3.Height);
- g.DrawLine(p, mid_p32_1, mid_p32_2);
- //P 数
- Rectangle mid_rec3_3 = new Rectangle(mid_p32_1.X + LeftAdd, mid_p32_1.Y + TopAdd, mid_ColumnWidth3 - LeftAdd * 2, ForRowContentHeight);
- g.DrawString(mdl.OPlist_Batch.ToString().Trim(), ft9, b, mid_rec3_3);
- Point mid_p33_1 = new Point(mid_rec3_3.X + mid_ColumnWidth3, mid_rec3.Y);
- Point mid_p33_2 = new Point(mid_rec3_3.X + mid_ColumnWidth3, mid_rec3.Y + mid_rec3.Height);
- g.DrawLine(p, mid_p33_1, mid_p33_2);
- //数量
- Rectangle mid_rec3_4 = new Rectangle(mid_p33_1.X + LeftAdd, mid_p33_1.Y + TopAdd, mid_ColumnWidth4 - LeftAdd * 2, ForRowContentHeight);
- g.DrawString(mdl.OPlist_ProdQuantity.ToString().Trim(), ft9, b, mid_rec3_4);
- Point mid_p34_1 = new Point(mid_rec3_4.X + mid_ColumnWidth4, mid_rec3.Y);
- Point mid_p34_2 = new Point(mid_rec3_4.X + mid_ColumnWidth4, mid_rec3.Y + mid_rec3.Height);
- g.DrawLine(p, mid_p34_1, mid_p34_2);
- //备注
- Rectangle mid_rec3_5 = new Rectangle(mid_p34_1.X + LeftAdd, mid_p34_1.Y + TopAdd, mid_ColumnWidth5 - LeftAdd * 2, ForRowContentHeight);
- g.DrawString(mdl.OPlist_Remark, ft9, b, mid_rec3_5);
- Point mid_p35_1 = new Point(mid_rec3_5.X + mid_ColumnWidth5, mid_rec3.Y);
- Point mid_p35_2 = new Point(mid_rec3_5.X + mid_ColumnWidth5, mid_rec3.Y + mid_rec3.Height);
- g.DrawLine(p, mid_p35_1, mid_p35_2);
- //所用照片
- Rectangle mid_rec3_6 = new Rectangle(mid_p35_1.X + LeftAdd, mid_p35_1.Y + TopAdd, mid_ColumnWidth6 - LeftAdd * 2, ForRowContentHeight);
- g.DrawString(StrPhoto == "测试高" ? "" : StrPhoto, ft9, b, mid_rec3_6);
- mid_For_Y += mid_rec3.Height;
- }
- }
- //}
- #endregion
-
-
- Rectangle temp_mid_rec4A = new Rectangle(LeftWidth, mid_For_Y, tempWidth, 0);
-
- if (dicKeyList.ContainsKey("[=入册]") && dicKeyList["[=入册]"].Contains(iPage + 1))
- {
- #region 入册
- //入册
- int StrIntoBookHeigth = RowHeight;
- StrIntoBook = StrIntoBook.TrimEnd(',');
- if (StrIntoBook != "")
- {
- StrIntoBook += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + IntoBookCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- StrIntoBookHeigth = Convert.ToInt32(g.MeasureString(StrIntoBook, ft9, mid_TableWidth - mid_ColumnWidth1 - LeftAdd * 2 - LeftWidth).Height) + TopAdd;
- int ddd = StrIntoBookHeigth;
- string StrPhoto = "测试高";
- sizef = g.MeasureString(StrPhoto, ft9, mid_ColumnWidth6 - LeftAdd * 2);
- int TestHeigth = Convert.ToInt32(sizef.Height);
- int forIntCount = 0;
- while (ddd > TestHeigth)
- {
- ddd -= TestHeigth;
- forIntCount++;
- }
- StrIntoBookHeigth = StrIntoBookHeigth - ddd + TestHeigth;
- }
- Rectangle mid_rec4A = new Rectangle(LeftWidth, mid_For_Y, mid_TableWidth, StrIntoBookHeigth);
- g.DrawRectangle(p, mid_rec4A);//画标题矩形
- Rectangle mid_rec4A_1 = new Rectangle(mid_rec4A.X + LeftAdd, mid_rec4A.Y + TopAdd, mid_ColumnWidth1, StrIntoBookHeigth);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft10, b, mid_rec4A_1);
- Point mid_p4A1_1 = new Point(mid_rec4A.X + mid_ColumnWidth1, mid_rec4A.Y);
- Point mid_p4A1_2 = new Point(mid_rec4A.X + mid_ColumnWidth1, mid_rec4A.Y + mid_rec4A.Height);
- g.DrawLine(p, mid_p4A1_1, mid_p4A1_2);
- Rectangle mid_rec4A_2 = new Rectangle(mid_p4A1_1.X + LeftAdd, mid_p4A1_1.Y + TopAdd, mid_TableWidth - mid_p4A1_1.X - LeftAdd * 2, mid_rec4A_1.Height);
- g.DrawString(StrIntoBook, ft9, b, mid_rec4A_2);
- temp_mid_rec4A = mid_rec4A;
- #endregion
- }
- if (dicKeyList.ContainsKey("[=入底]") && dicKeyList["[=入底]"].Contains(iPage + 1))
- {
- #region 入底
- //入底
- int StrIntoBottomHeigth = RowHeight;
- if (StrIntoBottom.TrimEnd(',') != "")
- {
- StrIntoBottom += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + IntoBottomCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- StrIntoBottomHeigth = Convert.ToInt32(g.MeasureString(StrIntoBottom, ft9, tempWidth).Height) + TopAdd;
- int ddd = StrIntoBottomHeigth;
- string StrPhoto = "测试高";
- sizef = g.MeasureString(StrPhoto, ft9, mid_ColumnWidth6 - LeftAdd * 2);
- int TestHeigth = Convert.ToInt32(sizef.Height);
- int forIntCount = 0;
- while (ddd > TestHeigth)
- {
- ddd -= TestHeigth;
- forIntCount++;
- }
- StrIntoBottomHeigth = StrIntoBottomHeigth - ddd + TestHeigth;
- }
- Rectangle mid_rec4B = new Rectangle(temp_mid_rec4A.X, temp_mid_rec4A.Y + temp_mid_rec4A.Height, mid_TableWidth, StrIntoBottomHeigth);
- g.DrawRectangle(p, mid_rec4B);//画标题矩形
- temp_mid_rec4A = mid_rec4B;
- Rectangle mid_rec4B_1 = new Rectangle(mid_rec4B.X + LeftAdd, mid_rec4B.Y + TopAdd, mid_ColumnWidth1, StrIntoBottomHeigth);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft10, b, mid_rec4B_1);
- Point mid_p4B1_1 = new Point(mid_rec4B.X + mid_ColumnWidth1, mid_rec4B.Y);
- Point mid_p4B1_2 = new Point(mid_rec4B.X + mid_ColumnWidth1, mid_rec4B.Y + mid_rec4B.Height);
- g.DrawLine(p, mid_p4B1_1, mid_p4B1_2);
- Rectangle mid_rec4B_2 = new Rectangle(mid_p4B1_1.X + LeftAdd, mid_p4B1_1.Y + TopAdd, tempWidth, mid_rec4B_1.Height);
- g.DrawString(StrIntoBottom.TrimEnd(','), ft9, b, mid_rec4B_2);
- #endregion
- }
- if (dicKeyList.ContainsKey("[=调修要求]") && dicKeyList["[=调修要求]"].Contains(iPage + 1))
- {
- #region 调修要求
- int StrCustomerRequestHeigth = RowHeight;
- string StrCustomerRequest = spmodel.CustomerRequest + " " + spmodel.PhotoRequest;
- if (StrCustomerRequest.Trim() != "")
- {
- StrCustomerRequestHeigth = Convert.ToInt32(g.MeasureString(StrCustomerRequest, ft9, tempWidth).Height) + TopAdd;
- }
- Rectangle mid_rec4 = new Rectangle(temp_mid_rec4A.X, temp_mid_rec4A.Y + temp_mid_rec4A.Height, mid_TableWidth, StrCustomerRequestHeigth);
- g.DrawRectangle(p, mid_rec4);//画标题矩形
- Position_Rect = mid_rec4;
- Rectangle mid_rec4_1 = new Rectangle(mid_rec4.X + LeftAdd, mid_rec4.Y + TopAdd, mid_ColumnWidth1, mid_rec4.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("调修要求"), ft10, b, mid_rec4_1);
- Point mid_p41_1 = new Point(mid_rec4.X + mid_ColumnWidth1, mid_rec4.Y);
- Point mid_p41_2 = new Point(mid_rec4.X + mid_ColumnWidth1, mid_rec4.Y + mid_rec4.Height);
- g.DrawLine(p, mid_p41_1, mid_p41_2);
- Rectangle mid_rec4_2 = new Rectangle(mid_p41_1.X + LeftAdd, mid_p41_1.Y + TopAdd, tempWidth, mid_rec4_1.Height);
- g.DrawString(StrCustomerRequest.Trim(), ft9, b, mid_rec4_2);
- #endregion
- }
- #endregion
- }
- if (dicKeyList.ContainsKey("[=制作单说明]") || dicKeyList.ContainsKey("[=其他数据]") || dicKeyList.ContainsKey("[=付款信息]"))
- {
- #region 指定确定
- int end_TableWidth = top_TableWidth;
- int end_ColumnWidth1 = 120;
- int end_ColumnWidth2 = end_TableWidth / 2 - end_ColumnWidth1;
- int end_ColumnWidth3 = 130;
- int end_ColumnWidth4 = end_TableWidth / 2 - end_ColumnWidth1;
- #region 始
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("制作进度");
- sizef = g.MeasureString(rec2Value, ft16);
- StrHeigth = Convert.ToInt32(sizef.Height);
- StrWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle end_rec1 = new Rectangle((top_TableWidth - StrWidth) / 2, Position_Rect.Y + Position_Rect.Height + 5, StrWidth, StrHeigth);
- Rectangle end_rec1_1 = new Rectangle(LeftWidth, end_rec1.Y + end_rec1.Height, end_TableWidth, Convert.ToInt32(g.MeasureString(rec2Value, ft9, top_TableWidth).Height));
- if (dicKeyList.ContainsKey("[=制作单说明]") && dicKeyList["[=制作单说明]"].Contains(iPage + 1))
- {
- g.DrawString(rec2Value, ft16, b, end_rec1);
- string ProductionNotes = "";
- if (PrintOtherData.ContainsKey("制作单说明") && PrintOtherData["制作单说明"].ToString().Trim().Length > 0)
- {
- ProductionNotes = PrintOtherData["制作单说明"].ToString().Trim();
- }
- //else
- //{ ProductionNotes = tbl.Rows[0]["Company_ProductionNotes"].ToString().Trim().Replace("\n", "").Replace("\r", ""); }
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("申明:") + ProductionNotes;
- end_rec1_1 = new Rectangle(LeftWidth, end_rec1.Y + end_rec1.Height, end_TableWidth, Convert.ToInt32(g.MeasureString(rec2Value, ft9, top_TableWidth).Height));
- g.DrawString(rec2Value, ft9, b, end_rec1_1);
- }
- #endregion
- Rectangle end_rec5 = end_rec1_1;
- if (dicKeyList.ContainsKey("[=其他数据]") && dicKeyList["[=其他数据]"].Contains(iPage + 1))
- {
- #region 第一行
- int AddRowHeightToTwo = RowHeight / 2;
- Rectangle end_rec2 = new Rectangle(LeftWidth, end_rec1_1.Y + end_rec1_1.Height, end_TableWidth, RowHeight * 2 - 2);
- g.DrawRectangle(p, end_rec2);//画标题矩形
- Rectangle end_rec2_1 = new Rectangle(end_rec2.X + LeftAdd, end_rec2.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片师/日期"), ft10, b, end_rec2_1);
- Point end_p21_1 = new Point(end_rec2.X + end_ColumnWidth1, end_rec2.Y);
- Point end_p21_2 = new Point(end_rec2.X + end_ColumnWidth1, end_rec2.Y + end_rec2.Height);
- g.DrawLine(p, end_p21_1, end_p21_2);
- Rectangle end_rec2_2 = new Rectangle(end_p21_1.X + LeftAdd, end_p21_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth2, RowContentHeight);
- string StrValue1 = "";
- if (tb_ord.Rows[0]["选片人"].ToString().Trim() != "")
- {
- StrValue1 = (tb_ord.Rows[0]["选片人"].ToString().Trim() + " / " + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["选片日期"])).Trim('/');
- }
- g.DrawString(StrValue1, ft10, b, end_rec2_2);
- Point end_p22_1 = new Point(end_rec2_2.X + end_ColumnWidth2, end_rec2.Y);
- Point end_p22_2 = new Point(end_rec2_2.X + end_ColumnWidth2, end_rec2.Y + end_rec2.Height);
- g.DrawLine(p, end_p22_1, end_p22_2);
- Rectangle end_rec2_3 = new Rectangle(end_p22_1.X + LeftAdd, end_p22_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户选片签名/日期"), ft10, b, end_rec2_3);
- Point end_p23_1 = new Point(end_rec2_3.X + end_ColumnWidth3, end_rec2.Y);
- Point end_p23_2 = new Point(end_rec2_3.X + end_ColumnWidth3, end_rec2.Y + end_rec2.Height);
- g.DrawLine(p, end_p23_1, end_p23_2);
- Rectangle end_rec2_4 = new Rectangle(end_p23_1.X + LeftAdd, end_p23_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth4, RowContentHeight);
- g.DrawString("", ft10, b, end_rec2_4);
- #endregion
- #region 第二行
- Rectangle end_rec3 = new Rectangle(LeftWidth, end_rec2.Y + end_rec2.Height, end_TableWidth, RowHeight * 2 - 2);
- g.DrawRectangle(p, end_rec3);//画标题矩形
- Rectangle end_rec3_1 = new Rectangle(end_rec3.X + LeftAdd, end_rec3.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth1, RowContentHeight);
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件师/日期"), ft10, b, end_rec3_1);
- }
- else
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("看设计师/日期"), ft10, b, end_rec3_1);
- }
- Point end_p31_1 = new Point(end_rec3.X + end_ColumnWidth1, end_rec3.Y);
- Point end_p31_2 = new Point(end_rec3.X + end_ColumnWidth1, end_rec3.Y + end_rec3.Height);
- g.DrawLine(p, end_p31_1, end_p31_2);
- Rectangle end_rec3_2 = new Rectangle(end_p31_1.X + LeftAdd, end_p31_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth2, RowContentHeight);
- string StrValue2 = (tb_ord.Rows[0]["看设计人"].ToString().Trim() + "/" + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["看设计日期"])).Trim('/');
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
- {
- g.DrawString((tb_ord.Rows[0]["取件师"].ToString().Trim() + "/" + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["取件日期"])).Trim('/'), ft10, b, end_rec3_2);
- }
- else
- {
- g.DrawString(StrValue2, ft10, b, end_rec3_2);
- }
- Point end_p32_1 = new Point(end_rec3_2.X + end_ColumnWidth2, end_rec3.Y);
- Point end_p32_2 = new Point(end_rec3_2.X + end_ColumnWidth2, end_rec3.Y + end_rec3.Height);
- g.DrawLine(p, end_p32_1, end_p32_2);
- Rectangle end_rec3_3 = new Rectangle(end_p32_1.X + LeftAdd, end_p32_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth3, RowContentHeight);
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户取件签名/日期"), ft10, b, end_rec3_3);
- }
- else
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户看设计签名/日期"), ft10, b, end_rec3_3);
- }
- Point end_p33_1 = new Point(end_rec3_3.X + end_ColumnWidth3, end_rec3.Y);
- Point end_p33_2 = new Point(end_rec3_3.X + end_ColumnWidth3, end_rec3.Y + end_rec3.Height);
- g.DrawLine(p, end_p33_1, end_p33_2);
- Rectangle end_rec3_4 = new Rectangle(end_p33_1.X + LeftAdd, end_p33_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth4, RowContentHeight);
- g.DrawString("", ft10, b, end_rec3_4);
- #endregion
- end_rec5 = end_rec3;
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
- {
- #region 第三行
- Rectangle end_rec4 = new Rectangle(LeftWidth, end_rec3.Y + end_rec3.Height, end_TableWidth, RowHeight * 2 - 2);
- g.DrawRectangle(p, end_rec4);//画标题矩形
- Rectangle end_rec4_1 = new Rectangle(end_rec4.X + LeftAdd, end_rec4.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("二次看设计师/日期"), ft10, b, end_rec4_1);
- Point end_p41_1 = new Point(end_rec4.X + end_ColumnWidth1, end_rec4.Y);
- Point end_p41_2 = new Point(end_rec4.X + end_ColumnWidth1, end_rec4.Y + end_rec4.Height);
- g.DrawLine(p, end_p41_1, end_p41_2);
- Rectangle end_rec4_2 = new Rectangle(end_p41_1.X + LeftAdd, end_p41_1.Y + TopAdd, end_ColumnWidth2, RowContentHeight);
- g.DrawString("", ft10, b, end_rec4_2);
- Point end_p42_1 = new Point(end_rec4_2.X + end_ColumnWidth2, end_rec4.Y);
- Point end_p42_2 = new Point(end_rec4_2.X + end_ColumnWidth2, end_rec4.Y + end_rec4.Height);
- g.DrawLine(p, end_p42_1, end_p42_2);
- Rectangle end_rec4_3 = new Rectangle(end_p42_1.X + LeftAdd, end_p42_1.Y + TopAdd + 3, end_ColumnWidth3, RowContentHeight * 2 + 10);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户二次看设计签名\r\n/日期"), ft10, b, end_rec4_3);
- Point end_p43_1 = new Point(end_rec4_3.X + end_ColumnWidth3, end_rec4.Y);
- Point end_p43_2 = new Point(end_rec4_3.X + end_ColumnWidth3, end_rec4.Y + end_rec4.Height);
- g.DrawLine(p, end_p43_1, end_p43_2);
- Rectangle end_rec4_4 = new Rectangle(end_p43_1.X + LeftAdd, end_p43_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth4, RowContentHeight);
- g.DrawString("", ft10, b, end_rec4_4);
- #endregion
- #region 第四行
- end_rec5 = new Rectangle(LeftWidth, end_rec4.Y + end_rec4.Height, end_TableWidth, RowHeight * 2 - 2);
- g.DrawRectangle(p, end_rec5);//画标题矩形
- Rectangle end_rec5_1 = new Rectangle(end_rec5.X + LeftAdd, end_rec5.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件师/日期"), ft10, b, end_rec5_1);
- Point tend_p51_1 = new Point(end_rec5.X + end_ColumnWidth1, end_rec5.Y);
- Point end_p51_2 = new Point(end_rec5.X + end_ColumnWidth1, end_rec5.Y + end_rec5.Height);
- g.DrawLine(p, tend_p51_1, end_p51_2);
- Rectangle end_rec5_2 = new Rectangle(tend_p51_1.X + LeftAdd, tend_p51_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth2, RowContentHeight);
- g.DrawString((tb_ord.Rows[0]["取件师"].ToString().Trim() + "/" + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["取件日期"])).Trim('/'), ft10, b, end_rec5_2);
- Point end_p52_1 = new Point(end_rec5_2.X + end_ColumnWidth2, end_rec5.Y);
- Point end_p52_2 = new Point(end_rec5_2.X + end_ColumnWidth2, end_rec5.Y + end_rec5.Height);
- g.DrawLine(p, end_p52_1, end_p52_2);
- Rectangle end_rec5_3 = new Rectangle(end_p52_1.X + LeftAdd, end_p52_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户取件签名/日期"), ft10, b, end_rec5_3);
- Point end_p53_1 = new Point(end_rec5_3.X + end_ColumnWidth3, end_rec5.Y);
- Point end_p53_2 = new Point(end_rec5_3.X + end_ColumnWidth3, end_rec5.Y + end_rec5.Height);
- g.DrawLine(p, end_p53_1, end_p53_2);
- Rectangle end_rec5_4 = new Rectangle(end_p53_1.X + LeftAdd, end_p53_1.Y + TopAdd + AddRowHeightToTwo, end_ColumnWidth4, RowContentHeight);
- g.DrawString("", ft10, b, end_rec5_4);
- #endregion
- }
- }
- if (dicKeyList.ContainsKey("[=付款信息]") && dicKeyList["[=付款信息]"].Contains(iPage + 1))
- {
- #region 尾行
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- StrHeigth = Convert.ToInt32(sizef.Height);
- StrWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle end_rec6_1 = new Rectangle(end_TableWidth + LeftWidth - StrWidth, end_rec5.Y + end_rec5.Height + 3, StrWidth, StrHeigth);
- g.DrawString(rec2Value, ft9, b, end_rec6_1);
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- StrHeigth = Convert.ToInt32(sizef.Height);
- StrWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle end_rec6 = new Rectangle(LeftWidth, end_rec6_1.Y, end_TableWidth - end_rec6_1.Width - 50, StrHeigth);
- g.DrawString(rec2Value, ft9, b, end_rec6);
- g.DrawString(((iPage + 1) + "/" + pListData.Count), ft9, b, new Rectangle(LeftWidth, end_rec6.Y + end_rec6.Height + 5, top_TableWidth, RowHeight));
- #endregion
- }
- //if (k == 0)
- //{
- // if (sizeHeight < end_rec6.Y + end_rec6.Height)
- // {
- // sizeHeight = end_rec6.Y + end_rec6.Height;
- // }
- //}
- //else
- //{
- // break;
- //}
- #endregion
- g.DrawString(((iPage + 1) + "/" + pListData.Count), ft9, b, new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height + 5, top_TableWidth, RowHeight));
- }
- else
- {
- g.DrawString(((iPage + 1) + "/" + pListData.Count), ft9, b, new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height + 5, top_TableWidth, RowHeight));
- }
- }
- }
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- return null;
- }
- /// <summary>
- /// 数据分页集合处理(制作单)
- /// </summary>
- /// <param name="g1"></param>
- /// <param name="ft9"></param>
- /// <param name="mid_ColumnWidth1"></param>
- /// <param name="makingProducts"></param>
- /// <returns></returns>
- static List<List<string>> GetMakeDetailListData(Graphics g1,Font ft9, string[] columnList, int[] _ColumnWidthList, LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint, List<LYFZ.PhotoSelectSystem.MakingProduct> makingProducts,
- Hashtable PrintOtherData,string[] strOtherList, DataRow[] PaymentRows,int totalWidth , ref Dictionary<string, List<int>> dicKeyList, int setPageHiehgt=750)
- {
- #region 绑定数据
- List<List<string>> pListData = new List<List<string>>();
- List<string> tempListData = new List<string>();
-
- SizeF iSizef = new SizeF();
- float tempDataHight = 0;
- LYFZ.PhotoSelectSystem.MakingProduct IntoBottom_makingItem=null;
- LYFZ.PhotoSelectSystem.MakingProduct IntoBook_makingItem=null;
- for (int i = 0; i < makingProducts.Count; i++)
- {
- LYFZ.Model.Model_ErpOrderProductList mProduct = makingProducts[i].OrderProduct;
- if (i == 0)
- {
- pListData.Add(tempListData);
- }
- //iSizef = g1.MeasureString(mProduct.OPlist_ProdName.ToString().Trim(),
- // ft9, _ColumnWidthList[0]);
- if (makingProducts[i].IsEndorBook && (mProduct.OPlist_ProdName.Trim() == "入底" || mProduct.OPlist_ProdName.Trim() == "入册"))
- {
- //continue;
- }
- else
- {
- for (int keyIndex = 0; keyIndex < columnList.Length; keyIndex++)
- {
- SizeF tSizef = new SizeF();
- if (columnList[keyIndex] == "产品名称")
- {
- tSizef = g1.MeasureString(mProduct.OPlist_ProdName.ToString().Trim(), ft9, _ColumnWidthList[keyIndex]);
- }
- else if (columnList[keyIndex] == "等级/加急日")
- {
- tSizef = g1.MeasureString(mProduct.OPlist_IsExpedited ? LYFZ.BLL.OtherCommonModel.FontConversion("加急件") : LYFZ.BLL.OtherCommonModel.FontConversion("普通件"), ft9, _ColumnWidthList[keyIndex]);
- }
- else if (columnList[keyIndex] == "P数")
- {
- tSizef = g1.MeasureString(mProduct.OPlist_Batch.ToString(), ft9, _ColumnWidthList[keyIndex]);
- }
- else if (columnList[keyIndex] == "数量")
- {
- tSizef = g1.MeasureString(mProduct.OPlist_ProdQuantity.ToString(), ft9, _ColumnWidthList[keyIndex]);
- }
- else if (columnList[keyIndex] == "备注")
- {
- tSizef = g1.MeasureString(mProduct.OPlist_Remark.ToString(), ft9, _ColumnWidthList[keyIndex]);
- }
- else if (columnList[keyIndex] == "所用照片")
- {
- int photoCount = 0;
- string StrPhoto = eventSelectPhotoPrint.GetSelectProductPhotoNameString(mProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
- tSizef = g1.MeasureString(StrPhoto, ft9, _ColumnWidthList[keyIndex]);
- }
- if (tSizef.Height > iSizef.Height)
- {
- iSizef.Height = tSizef.Height;
- }
- }
- }
- iSizef.Height += 8;
- if (makingProducts[i].IsEndorBook)
- {
- if (mProduct.OPlist_ProdName.Trim() == "入底")
- {
- IntoBottom_makingItem = makingProducts[i];
- }
- else if (mProduct.OPlist_ProdName.Trim() == "入册")
- {
- IntoBook_makingItem = makingProducts[i];
- }
- //continue;
- }
-
- if (makingProducts[i].IsEndorBook&&(mProduct.OPlist_ProdName.Trim() == "入底"|| mProduct.OPlist_ProdName.Trim() == "入册"))
- {
-
- }
- else
- {
- tempDataHight += iSizef.Height;
- if (tempDataHight > setPageHiehgt)
- {
- tempListData = new List<string>();
- tempDataHight = iSizef.Height;
- pListData.Add(tempListData);
- }
- iSizef = new SizeF();
- tempListData.Add(Newtonsoft.Json.JsonConvert.SerializeObject(makingProducts[i]));
- }
-
- if (i == (makingProducts.Count - 1))
- {
- string[] subColumnList = new string[] { "入底", "入册", "调修要求" };
- for (int subColumnKeyIndex = 0; subColumnKeyIndex < subColumnList.Length; subColumnKeyIndex++)
- {
- string valueString = "-";
- int photoCount = 0;
- if (!string.IsNullOrEmpty(IntoBottom_makingItem.OrderProduct.OPlist_ProdName) && IntoBottom_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[subColumnKeyIndex])
- {
- valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBottom_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
- valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- else if (!string.IsNullOrEmpty(IntoBook_makingItem.OrderProduct.OPlist_ProdName) && IntoBook_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[subColumnKeyIndex])
- {
- valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBook_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
- valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- else if (subColumnList[subColumnKeyIndex] == "调修要求")
- {
- valueString = eventSelectPhotoPrint.CustomerRequest + " " + eventSelectPhotoPrint.PhotoRequest;
- }
- int tempColumnWidth = 0;
- for(int it =1;it< _ColumnWidthList.Length;it++)
- {
- tempColumnWidth += _ColumnWidthList[it];
- }
- iSizef = g1.MeasureString(valueString, ft9, tempColumnWidth);
- iSizef.Height += 8;
- tempDataHight += iSizef.Height;
- if ((tempDataHight) > setPageHiehgt)
- {
- tempListData = new List<string>();
- tempDataHight = iSizef.Height;
- pListData.Add(tempListData);
- }
- iSizef = new SizeF();
- if (subColumnList[subColumnKeyIndex]== "入底")
- {
- tempListData.Add(Newtonsoft.Json.JsonConvert.SerializeObject(IntoBottom_makingItem));
- }
- if (subColumnList[subColumnKeyIndex] == "入册")
- {
- tempListData.Add(Newtonsoft.Json.JsonConvert.SerializeObject(IntoBook_makingItem));
- }
- if (dicKeyList.ContainsKey("[="+ subColumnList[subColumnKeyIndex] + "]"))
- {
- List<int> intListData = dicKeyList["[=" + subColumnList[subColumnKeyIndex] + "]"];
- if (!intListData.Contains(pListData.Count))
- {
- intListData.Add(pListData.Count);
- }
- }
- else
- {
- List<int> intListData = new List<int>();
- intListData.Add(pListData.Count);
- dicKeyList.Add("[=" + subColumnList[subColumnKeyIndex] + "]", intListData);
- }
- }
-
- if (PrintOtherData.ContainsKey("制作单说明") && PrintOtherData["制作单说明"].ToString().Trim().Length > 0)
- {
- string ProductionNotes = PrintOtherData["制作单说明"].ToString().Trim();
- iSizef = (g1.MeasureString(ProductionNotes, ft9, totalWidth));
- iSizef.Height += 8;
- tempDataHight += iSizef.Height ;
- if ((tempDataHight) > setPageHiehgt)
- {
- tempListData = new List<string>();
- tempDataHight = iSizef.Height;
- pListData.Add(tempListData);
- }
- iSizef = new SizeF();
- //dicKeyList.Add("", pListData.Count);
- }
- if (dicKeyList.ContainsKey("[=制作单说明]"))
- {
- List<int> intListData = dicKeyList["[=制作单说明]"];
- if (!intListData.Contains(pListData.Count))
- {
- intListData.Add(pListData.Count);
- }
- }
- else
- {
- List<int> intListData = new List<int>();
- intListData.Add(pListData.Count);
- dicKeyList.Add("[=制作单说明]", intListData);
- }
- int tempSOL = 0;
- foreach(string str in strOtherList)
- {
- if (tempSOL >= 2)
- {
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideLookDesigner)
- {
- break;
- }
- }
- iSizef = (g1.MeasureString(str, ft9, totalWidth));
- iSizef.Height += 8;
- tempDataHight += iSizef.Height;
- if ((tempDataHight) > setPageHiehgt)
- {
- tempListData = new List<string>();
- tempDataHight = iSizef.Height;
- pListData.Add(tempListData);
- }
- iSizef = new SizeF();
- tempSOL++;
- }
- if (dicKeyList.ContainsKey("[=其他数据]"))
- {
- List<int> intListData = dicKeyList["[=其他数据]"];
- if (!intListData.Contains(pListData.Count))
- {
- intListData.Add(pListData.Count);
- }
- }
- else
- {
- List<int> intListData = new List<int>();
- intListData.Add(pListData.Count);
- dicKeyList.Add("[=其他数据]", intListData);
- }
- //dicKeyList.Add("[=其他数据]", pListData.Count);
- foreach (DataRow dr in PaymentRows)
- {
- iSizef = (g1.MeasureString("收款金额(元)", ft9, totalWidth));
- iSizef.Height += 8;
- tempDataHight += iSizef.Height;
- if ((tempDataHight) > setPageHiehgt)
- {
- tempListData = new List<string>();
- tempDataHight = iSizef.Height;
- pListData.Add(tempListData);
- }
- iSizef = new SizeF();
- }
- if (dicKeyList.ContainsKey("[=付款信息]"))
- {
- List<int> intListData = dicKeyList["[=付款信息]"];
- if (!intListData.Contains(pListData.Count))
- {
- intListData.Add(pListData.Count);
- }
- }
- else
- {
- List<int> intListData = new List<int>();
- intListData.Add(pListData.Count);
- dicKeyList.Add("[=付款信息]", intListData);
- }
- //dicKeyList.Add("[=付款信息]", pListData.Count);
- }
- }
- return pListData;
- #endregion
- }
- /// <summary>
- /// 获取行高
- /// </summary>
- /// <param name="eventSelectPhotoPrint"></param>
- /// <param name="makingItem"></param>
- /// <param name="mProduct"></param>
- /// <returns></returns>
- static int GetLineHeight(LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint, LYFZ.PhotoSelectSystem.MakingProduct makingItem, LYFZ.Model.Model_ErpOrderProductList mProduct, Font _font,int leftAdd, int[] _ColumnWidthList, Graphics g,ref string[] ValueList)
- {
- // new string[8] { "产品名称", "备注", "P数", "数量", "单价", "应收价", "实收价", "所用照片" };
- // ValueList = new string[6] { "", "", "", "", "", "" };
- int lineHeight = 0;
- ValueList[0] = mProduct.OPlist_ProdName;
- lineHeight = Convert.ToInt32(g.MeasureString(mProduct.OPlist_ProdName, _font, _ColumnWidthList[0] - leftAdd * 2).Height) + 1; //产品名称
- string StrIsExp = mProduct.OPlist_IsExpedited ? LYFZ.BLL.OtherCommonModel.FontConversion("加急件") : LYFZ.BLL.OtherCommonModel.FontConversion("普通件");
- if (mProduct.OPlist_ExpeditedTime.ToString().Trim() != "")
- {
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- StrIsExp = LYFZ.Command.Command_Validate.DateTimeToString(mProduct.OPlist_ExpeditedTime);
- }
- else
- {
- StrIsExp += "\r\n" + LYFZ.Command.Command_Validate.DateTimeToString(mProduct.OPlist_ExpeditedTime);
- }
- }
- ValueList[1] = StrIsExp;
- SizeF sizef = g.MeasureString(StrIsExp, _font, _ColumnWidthList[1] - leftAdd * 2); //等级
- if (lineHeight < Convert.ToInt32(sizef.Height))
- {
- lineHeight = Convert.ToInt32(sizef.Height);
- }
- if (ValueList.Length == 5)
- {
- ValueList[1] = mProduct.OPlist_Batch.ToString();
- ValueList[2] = mProduct.OPlist_ProdQuantity.ToString();
- ValueList[3] = mProduct.OPlist_Remark;
- }
- else
- {
- ValueList[2] = mProduct.OPlist_Batch.ToString();
- ValueList[3] = mProduct.OPlist_ProdQuantity.ToString();
- ValueList[4] = mProduct.OPlist_Remark;
- }
- sizef = g.MeasureString(mProduct.OPlist_Remark, _font, _ColumnWidthList[4] - leftAdd * 2); //备注
- if (lineHeight < Convert.ToInt32(sizef.Height) + 1)
- {
- lineHeight = Convert.ToInt32(sizef.Height) + 1;
- }
-
- int photoCount = 0;
- string StrPhoto = eventSelectPhotoPrint.GetSelectProductPhotoNameString(mProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
- if (!string.IsNullOrEmpty(StrPhoto))
- {
- StrPhoto += LYFZ.BLL.OtherCommonModel.FontConversion(" 共" + photoCount + "张");
- if (ValueList.Length == 5)
- {
- ValueList[4] = StrPhoto;
- }
- else
- {
- ValueList[5] = StrPhoto;
- }
- }
- else
- {
- StrPhoto = "测试高";
- }
- if (ValueList.Length == 5)
- {
- sizef = g.MeasureString(StrPhoto, _font, _ColumnWidthList[4] - leftAdd * 2);
- }
- else {
- sizef = g.MeasureString(StrPhoto, _font, _ColumnWidthList[5] - leftAdd * 2);
- }
-
- if (lineHeight < Convert.ToInt32(sizef.Height) + 1)
- {
- lineHeight = Convert.ToInt32(sizef.Height) + 1;
- }
- return lineHeight;
- }
- /// <summary>
- /// 获取行高
- /// </summary>
- /// <param name="eventSelectPhotoPrint"></param>
- /// <param name="makingItem"></param>
- /// <param name="mProduct"></param>
- /// <returns></returns>
- static int GetLineHeight2(LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint, LYFZ.PhotoSelectSystem.MakingProduct makingItem, LYFZ.Model.Model_ErpOrderProductList mProduct, Font _font, int leftAdd, int[] _ColumnWidthList, Graphics g, ref string[] ValueList)
- {
- // new string[8] { "产品名称", "备注", "P数", "数量", "单价", "应收价", "实收价", "所用照片" };
- ValueList = new string[8] { "", "", "", "", "", "", "", "" };
- int lineHeight = 0;
- ValueList[0] = mProduct.OPlist_ProdName;
- lineHeight = Convert.ToInt32(g.MeasureString(mProduct.OPlist_ProdName, _font, _ColumnWidthList[0] - leftAdd * 2).Height) + 1; //产品名称
- string StrIsExp = mProduct.OPlist_IsExpedited ? LYFZ.BLL.OtherCommonModel.FontConversion("加急件") : LYFZ.BLL.OtherCommonModel.FontConversion("普通件");
- if (mProduct.OPlist_ExpeditedTime.ToString().Trim() != "")
- {
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- StrIsExp = LYFZ.Command.Command_Validate.DateTimeToString(mProduct.OPlist_ExpeditedTime);
- }
- else {
- StrIsExp += "\r\n" + LYFZ.Command.Command_Validate.DateTimeToString(mProduct.OPlist_ExpeditedTime);
- }
-
- }
- ValueList[1] = StrIsExp;
- SizeF sizef = g.MeasureString(StrIsExp, _font, _ColumnWidthList[1] - leftAdd * 2); //等级
- /*if (lineHeight < Convert.ToInt32(sizef.Height))
- {
- lineHeight = Convert.ToInt32(sizef.Height);
- }*/
- ValueList[2] = mProduct.OPlist_Batch.ToString();
- ValueList[3] = mProduct.OPlist_ProdQuantity.ToString();
- ValueList[4] = mProduct.OPlist_ProdSoldPrice.ToString("n2");
- ValueList[5] = mProduct.OPlist_ReceivablePrice.ToString("n2");
- ValueList[6] = mProduct.OPlist_ActualPrice.ToString("n2");
- ValueList[1] = mProduct.OPlist_Remark;
- sizef = g.MeasureString(mProduct.OPlist_Remark, _font, _ColumnWidthList[1] - leftAdd * 2); //备注
- if (lineHeight < Convert.ToInt32(sizef.Height) + 1)
- {
- lineHeight = Convert.ToInt32(sizef.Height) + 1;
- }
- int photoCount = 0;
- string StrPhoto = eventSelectPhotoPrint.GetSelectProductPhotoNameString(mProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);//所用照片
- if (!string.IsNullOrEmpty(StrPhoto))
- {
- StrPhoto += LYFZ.BLL.OtherCommonModel.FontConversion(" 共" + photoCount + "张");
- ValueList[7] = StrPhoto;
- }
- else
- {
- StrPhoto = "测试高";
- }
- sizef = g.MeasureString(StrPhoto, _font, _ColumnWidthList[7] - leftAdd * 2);
- if (lineHeight < Convert.ToInt32(sizef.Height) + 1)
- {
- lineHeight = Convert.ToInt32(sizef.Height) + 1;
- }
- return lineHeight;
- }
- /// <summary>
- /// 打印特殊定制选片制作单(金色童年)
- /// </summary>
- /// <param name="dtSet"></param>
- /// <param name="spmodel"></param>
- /// <param name="size"></param>
- /// <param name="LeftWidth"></param>
- /// <param name="LeftAdd"></param>
- /// <param name="TopAdd"></param>
- /// <param name="RowHeight"></param>
- /// <param name="RowContentHeight"></param>
- /// <returns></returns>
- static Bitmap GetSelectPhotoSpecialTemplate(DataSet dtSet, PhotoSelectSystem.EventSelectPhotoPrint spmodel, Size size,Graphics g1 ,ref List<List<string>> pListData, int iPage,
- int LeftWidth, int LeftAdd, int TopAdd, int RowHeight, int RowContentHeight,ref Dictionary<string, List<int>> dicKeyList)
- {
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tb_ord = dtSet.Tables["ds1"];//订单
- DataTable tb_Sights = dtSet.Tables["ds2"];//拍摄名称
- DataTable tb_Payment = dtSet.Tables["ds3"];//收款记录
- int top_TableWidth = size.Width - LeftWidth * 2 - 20;
- int top_ColumnWidth1 = 70;
- int top_ColumnWidth2 = 110;
- int top_ColumnWidth3 = 70;
- int top_ColumnWidth5 = 70;
- int top_ColumnWidth6 = 140;
- int top_ColumnWidth4 = top_TableWidth - top_ColumnWidth1 - top_ColumnWidth2 - top_ColumnWidth3 - top_ColumnWidth5 - top_ColumnWidth6;
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font mainTitle16Font = new Font("宋体", 16);
- Font subTitle13Font = new Font("宋体", 13);
- Font tetxt9Font = new Font("宋体", 9);
- // Font ft9 = new Font("宋体", 9);
- Font title9Font = new Font("宋体", 9, FontStyle.Bold);
- int sizeHeight = size.Height - 120;
- Bitmap panlImage = null;
- //字符对齐格式
- StringFormat format = new StringFormat();
- format.Alignment = StringAlignment.Near;
- format.LineAlignment = StringAlignment.Center;
- StringFormat titleFormat = new StringFormat();
- titleFormat.Alignment = StringAlignment.Center;
- titleFormat.LineAlignment = StringAlignment.Center;
- //行定位
- Rectangle rowLocateRectangle = new Rectangle(LeftWidth, 0, top_TableWidth, RowHeight);
- //列定位
- Rectangle cellLocateRectangle = new Rectangle(LeftWidth, 0, top_TableWidth, RowHeight);
- //for (int z = 0; z < 2; z++)
- //{
- rowLocateRectangle = new Rectangle(LeftWidth, 30, top_TableWidth, RowHeight);
- cellLocateRectangle = new Rectangle(LeftWidth, 0, top_TableWidth, RowHeight);
- //panlImage = new Bitmap(size.Width, sizeHeight);
- Graphics g = g1;// Graphics.FromImage(panlImage);
- #region 画标题
- string rec2Value = tbl.Rows[0]["Company_Name"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion("制作单明细");
- SizeF sizef = g.MeasureString(rec2Value, mainTitle16Font);
- int StrHeigth = Convert.ToInt32(sizef.Height);
- int StrWidth = Convert.ToInt32(sizef.Width) + 1;
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, rowLocateRectangle.Width, StrHeigth);
- g.DrawString(String.Format("{0}", rec2Value), mainTitle16Font, b, rowLocateRectangle, titleFormat);
- #endregion
- #region 画第一行
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height+10, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);//画标题矩形
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("订单号")), title9Font, b, cellLocateRectangle, titleFormat);
- string OrdNumber = String.IsNullOrWhiteSpace(spmodel.CurrentModel.Ord_SinceOrderNumber) ? spmodel.CurrentModel.Ord_Number : spmodel.CurrentModel.Ord_SinceOrderNumber;
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", OrdNumber), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("套系名称")), title9Font, b, cellLocateRectangle, titleFormat);
- string taoXiNameString = "";
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- {
- taoXiNameString = spmodel.CurrentModel.Ord_SeriesName + LYFZ.BLL.OtherCommonModel.FontConversion(" 欠款:") + tb_ord.Rows[0]["欠款"].ToString();
- }
- else
- {
- taoXiNameString = spmodel.CurrentModel.Ord_SeriesName;
- }
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 270, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", taoXiNameString), tetxt9Font, b, cellLocateRectangle, format);
- string BottomAndListedString = String.Format("入底加挑:{0} 入册加挑:{1}", spmodel.IntoBottomPickNumber, spmodel.IntoRegisterPickNumber);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 180, cellLocateRectangle.Height);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- {
- g.DrawString(String.Format("{0}", BottomAndListedString), tetxt9Font, b, cellLocateRectangle, format);
- }
- #endregion
- #region 画第二行
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名")), title9Font, b, cellLocateRectangle, titleFormat);
- string StrUserName = tb_ord.Rows[0]["客户姓名"].ToString().Trim();
- string StrPhone = tb_ord.Rows[0]["客户电话"].ToString().Trim();
- if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "2")
- {
- StrUserName = tb_ord.Rows[0]["主客户姓名"].ToString().Trim();
- StrPhone = tb_ord.Rows[0]["主客户电话"].ToString().Trim();
- }
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", StrUserName), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("客户电话")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 270, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", StrPhone), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("是否加急")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion(spmodel.MakingProductList.Any(product => product.OrderProduct.OPlist_IsExpedited) ? "加急" : "")), tetxt9Font, b, cellLocateRectangle, format);
- #endregion
- #region 画第三行
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", tb_ord.Rows[0]["摄影师"].ToString().Trim()), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("门市")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 270, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", tb_ord.Rows[0]["接单人"].ToString().Trim()), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("预约取件")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
- g.DrawString(String.Format("{0}", LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["预约取件日期"])), tetxt9Font, b, cellLocateRectangle, format);
- #endregion
- #region 画第四行
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄日期")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 120, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.Command.Command_Validate.DateTimeToString(tb_ord.Rows[0]["拍摄日期"])), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("化妆师")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", tb_ord.Rows[0]["化妆师"].ToString().Trim()), tetxt9Font, b, cellLocateRectangle, format);
- string yingDaoShi = "";
- if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
- {
- yingDaoShi = tb_ord.Rows[0]["引导师"].ToString().Trim();
- }
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 70, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("引导师")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", yingDaoShi), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 76, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format("{0}", LYFZ.BLL.OtherCommonModel.FontConversion("初修师")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
- g.DrawString(String.Format("{0}", tb_ord.Rows[0]["初修师"].ToString().Trim()), tetxt9Font, b, cellLocateRectangle, format);
- #endregion
- #region 画第五行
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 76, rowLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("统计")), title9Font, b, cellLocateRectangle, titleFormat);
- string StrStatistics = "";
- if (tb_ord.Rows[0]["Ord_Type"].ToString().Trim() == "1")
- {
- StrStatistics = LYFZ.BLL.OtherCommonModel.FontConversion("本次【" + LYFZ.BLL.OtherCommonModel.FontConversion(tb_Sights.Rows[0]["Ordpg_Sights"].ToString().Trim()) + "】拍摄张数") + spmodel.ThisTakenNumberShooting + LYFZ.BLL.OtherCommonModel.FontConversion("张 选中总张数") + spmodel.PlusPickSumCount + LYFZ.BLL.OtherCommonModel.FontConversion("张 未选") + (spmodel.ThisTakenNumberShooting - spmodel.PlusPickSumCount) + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- else
- {
- StrStatistics = LYFZ.BLL.OtherCommonModel.FontConversion("总张数") + spmodel.OrderTotalNumberShooting + LYFZ.BLL.OtherCommonModel.FontConversion("张 选中") + spmodel.PlusPickSumCount + LYFZ.BLL.OtherCommonModel.FontConversion("张 未选") + (spmodel.OrderTotalNumberShooting - spmodel.PlusPickSumCount) + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 600, cellLocateRectangle.Height);
- g.DrawString(String.Format("{0}", StrStatistics), tetxt9Font, b, cellLocateRectangle, format);
- #endregion
- #region 产品列表
- List<LYFZ.PhotoSelectSystem.SelectPrintProduction> SelectPrintList = new List<LYFZ.PhotoSelectSystem.SelectPrintProduction>();
- if (spmodel.SelectPrintList.Count > 0)
- {
- SelectPrintList = spmodel.SelectPrintList;
- }
- else
- {
- SelectPrintList.Add(new LYFZ.PhotoSelectSystem.SelectPrintProduction()
- {
- OrderDigital = spmodel.CurrentDigModel
- ,
- Photography = spmodel.CurrentSelectPhotoHandling.PhotoModel
- });
- }
- decimal sumReceivablePrice = 0;
- decimal sumActualPrice = 0;
- foreach (LYFZ.PhotoSelectSystem.SelectPrintProduction selectItem in SelectPrintList)
- {
- string titleString = String.Format("指定制作");
- if (selectItem.Photography != null)
- {
- if (!String.IsNullOrWhiteSpace(selectItem.Photography.Ordpg_Sights))
- {
- titleString = String.Format("【{0}】指定制作", selectItem.Photography.Ordpg_Sights);
- }
- }
- sizef = g.MeasureString(titleString, subTitle13Font);
- StrHeigth = Convert.ToInt32(sizef.Height);
- StrWidth = Convert.ToInt32(sizef.Width) + 1;
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, StrHeigth + 10);
-
- #region 列标题
- string[] columnList = new string[8] { "产品名称", "备注", "P数", "数量", "单价", "应收价", "实收价", "所用照片" };
- int[] _ColumnWidthList = new int[8] { 100, 110, 45, 45, 60, 70, 70, 235 };
- LYFZ.PhotoSelectSystem.EventSelectPhotoPrint eventSelectPhotoPrint = LYFZ.PhotoSelectSystem.frmSaveSelectPhotoInfo.GetStaticSelectPhotoPrint(spmodel.CurrentModel, selectItem.OrderDigital);
- if (pListData.Count == 0)
- {
- pListData = GetMakeDetailListData(g1, tetxt9Font, columnList, _ColumnWidthList, eventSelectPhotoPrint, eventSelectPhotoPrint.MakingProductList, PrintOtherData,
- new string[] { "总应收", "选片师/选片日期" },
- tb_Payment.Select("Plu_OrdViceNumber='" + selectItem.OrderDigital.Ordv_ViceNumber + "'"), rowLocateRectangle.Width, ref dicKeyList, 680);
- }
- Rectangle columnPosition_Rect = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 0, rowLocateRectangle.Height);
- List<string> pData = pListData[iPage];
- if (pData.Count > 0)
- {
- g.DrawRectangle(p, rowLocateRectangle);
- g.DrawString(String.Format("{0}", titleString), subTitle13Font, b, rowLocateRectangle, titleFormat);
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);//画标题矩形
- columnPosition_Rect = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 0, rowLocateRectangle.Height);
- for (int i = 0; i < columnList.Length; i++)
- {
- columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[i], columnPosition_Rect.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(columnList[i]), title9Font, b
- , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, RowContentHeight));
- if (i < columnList.Length - 1)
- {
- g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
- , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
- }
- }
- }
- #endregion
- #region 输出产品列表和产品选片信息
-
- LYFZ.PhotoSelectSystem.MakingProduct IntoBottom_makingItem = new PhotoSelectSystem.MakingProduct();//入底
- LYFZ.PhotoSelectSystem.MakingProduct IntoBook_makingItem = new PhotoSelectSystem.MakingProduct();//入册
-
- foreach (string strMakingItem in pData)
- {
- LYFZ.PhotoSelectSystem.MakingProduct makingItem = Newtonsoft.Json.JsonConvert.DeserializeObject<LYFZ.PhotoSelectSystem.MakingProduct>(strMakingItem);
- LYFZ.Model.Model_ErpOrderProductList mProduct = makingItem.OrderProduct;
- if (makingItem.IsEndorBook)
- {
- if (mProduct.OPlist_ProdName.Trim() == "入底")
- {
- IntoBottom_makingItem = makingItem;
- }
- else if (mProduct.OPlist_ProdName.Trim() == "入册")
- {
- IntoBook_makingItem = makingItem;
- }
- continue;
- }
- sumReceivablePrice += mProduct.OPlist_ReceivablePrice;
- sumActualPrice += mProduct.OPlist_ActualPrice;
- string[] ValueList = new string[8] { "", "", "", "", "", "", "", "" };
- int lineHeight = GetLineHeight2(eventSelectPhotoPrint, makingItem, mProduct, tetxt9Font, LeftAdd, _ColumnWidthList, g, ref ValueList);
- if (lineHeight < RowHeight)
- {
- lineHeight = RowHeight;
- }
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, lineHeight);
- g.DrawRectangle(p, rowLocateRectangle);//画标题矩形
- columnPosition_Rect = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 0, rowLocateRectangle.Height);
- for (int j = 0; j < columnList.Length; j++)
- {
- columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[j], columnPosition_Rect.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(ValueList[j]), tetxt9Font, b
- , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, lineHeight));
- if (j < columnList.Length - 1)
- {
- g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
- , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
- }
- }
- }
- //if (pListData.Count - 1 == iPage)
- //{
- //入底/入册/调修要求 "入底","入册",
- string[] subColumnList = new string[] { "入底", "入册", "调修要求" };
- for (int i = 0; i < subColumnList.Length; i++)
- {
- if (dicKeyList.ContainsKey("[=" + subColumnList[i] + "]") && dicKeyList["[=" + subColumnList[i] + "]"].Contains(iPage + 1))
- {
- int lineHeight = 0;
- string valueString = "-";
- int photoCount = 0;
- if (!string.IsNullOrEmpty(IntoBottom_makingItem.OrderProduct.OPlist_ProdName) && IntoBottom_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[i])
- {
- valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBottom_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
- valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- else if (!string.IsNullOrEmpty(IntoBook_makingItem.OrderProduct.OPlist_ProdName) && IntoBook_makingItem.OrderProduct.OPlist_ProdName.Trim() == subColumnList[i])
- {
- valueString = eventSelectPhotoPrint.GetSelectProductPhotoNameString(IntoBook_makingItem.OrderProduct.OPlist_UniquelyIdentity.ToString(), ref photoCount);
- valueString += LYFZ.BLL.OtherCommonModel.FontConversion(" 共") + photoCount + LYFZ.BLL.OtherCommonModel.FontConversion("张");
- }
- else if (subColumnList[i] == "调修要求")
- {
- valueString = eventSelectPhotoPrint.CustomerRequest + " " + eventSelectPhotoPrint.PhotoRequest;
- }
- lineHeight = Convert.ToInt32(g.MeasureString(valueString, tetxt9Font, rowLocateRectangle.Width - _ColumnWidthList[0] - LeftAdd * 2).Height) + 2;
- if (lineHeight < RowHeight)
- {
- lineHeight = RowHeight;
- }
- // Position_Rect = new Rectangle(LeftWidth, Position_Rect.Y + Position_Rect.Height, mid_TableWidth, lineHeight + TopAdd * 2);
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, lineHeight);
- g.DrawRectangle(p, rowLocateRectangle);//画标题矩形
- columnPosition_Rect = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 0, rowLocateRectangle.Height);
- for (int j = 0; j < 2; j++)
- {
- string ContentText = "";
- if (j == 0)
- {
- ContentText = subColumnList[i];
- columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, _ColumnWidthList[0], columnPosition_Rect.Height);
- }
- else
- {
- columnPosition_Rect = new Rectangle(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y, rowLocateRectangle.Width - _ColumnWidthList[0], columnPosition_Rect.Height);
- ContentText = valueString;
- }
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(ContentText), tetxt9Font, b
- , new Rectangle(columnPosition_Rect.X + LeftAdd, columnPosition_Rect.Y + TopAdd, columnPosition_Rect.Width, lineHeight));
- if (j == 0)
- {
- g.DrawLine(p, new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y)
- , new Point(columnPosition_Rect.X + columnPosition_Rect.Width, columnPosition_Rect.Y + columnPosition_Rect.Height));
- }
- }
- }
- }
- #endregion
- // }
- }
- #endregion
- if (pListData.Count - 1 == iPage)
- {
- #region 申明内容
- string ProductionNotes = "";
- int tempRowHeight = RowHeight;
- if (PrintOtherData.ContainsKey("制作单说明") && PrintOtherData["制作单说明"].ToString().Trim().Length > 0)
- {
- ProductionNotes = PrintOtherData["制作单说明"].ToString().Trim();
- tempRowHeight = Convert.ToInt32(g.MeasureString(ProductionNotes, tetxt9Font, rowLocateRectangle.Width).Height);
- }
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, tempRowHeight + RowHeight);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, rowLocateRectangle.Width, rowLocateRectangle.Height);
- g.DrawString(String.Format("{0}", ProductionNotes), tetxt9Font, b, cellLocateRectangle, format);
- #endregion
- #region 尾部第一行
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 130, rowLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("总应收")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 130, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(" {0}", sumReceivablePrice.ToString("n2")), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 130, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("总实收")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 210, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(" {0}", sumActualPrice.ToString("n2")), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 80, cellLocateRectangle.Height);
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("客户签字")), title9Font, b, cellLocateRectangle, titleFormat);
- #endregion
- #region 尾部第二行
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 130, rowLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("选片师/选片日期")), title9Font, b, cellLocateRectangle, titleFormat);
- string StrValue1 = "";
- if (tb_ord.Rows[0]["选片人"].ToString().Trim() != "")
- {
- StrValue1 = (tb_ord.Rows[0]["选片人"].ToString().Trim() + " / " + LYFZ.Command.Command_Validate.DateTimeToString2(tb_ord.Rows[0]["选片日期"])).Trim('/');
- }
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 210 + 260, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(" {0}", StrValue1), tetxt9Font, b, cellLocateRectangle, format);
- #endregion
- #region 收款记录
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, rowLocateRectangle.Width, rowLocateRectangle.Height);
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("收款记录")), title9Font, b, cellLocateRectangle, titleFormat);
- foreach (LYFZ.PhotoSelectSystem.SelectPrintProduction selectItem in SelectPrintList)
- {
- DataRow[] PaymentRows = tb_Payment.Select("Plu_OrdViceNumber='" + selectItem.OrderDigital.Ordv_ViceNumber + "'");
- foreach (DataRow row in PaymentRows)
- {
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- g.DrawRectangle(p, rowLocateRectangle);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, 90, rowLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("收款金额(元)")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(" {0}", Convert.ToDecimal(row["Pay_AmountOf"]).ToString("n2")), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 90, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("支付方式")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 100, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(" {0}", GetClassCodeToCalssName(row["Pay_PaymentMethod"].ToString())), tetxt9Font, b, cellLocateRectangle, format);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 90, cellLocateRectangle.Height);
- g.DrawLine(p, new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y), new Point(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y + cellLocateRectangle.Height));
- g.DrawString(String.Format(LYFZ.BLL.OtherCommonModel.FontConversion("收款时间")), title9Font, b, cellLocateRectangle, titleFormat);
- cellLocateRectangle = new Rectangle(cellLocateRectangle.X + cellLocateRectangle.Width, cellLocateRectangle.Y, 210, cellLocateRectangle.Height);
- g.DrawString(String.Format(" {0}", Convert.ToDateTime(row["Pay_CreateDatetime"]).ToString("yyyy-MM-dd HH:mm:ss")), tetxt9Font, b, cellLocateRectangle, format);
- }
- }
- #endregion
- #region 地址
- rowLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y + rowLocateRectangle.Height, rowLocateRectangle.Width, RowHeight);
- cellLocateRectangle = new Rectangle(rowLocateRectangle.X, rowLocateRectangle.Y, rowLocateRectangle.Width, rowLocateRectangle.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(String.Format("地址:{0} 电话:{1}", tbl.Rows[0]["Company_Address"].ToString().Trim(), tbl.Rows[0]["Company_Telephone"].ToString().Trim())), tetxt9Font, b, cellLocateRectangle, format);
- #endregion
- g.DrawString(((iPage + 1) + "/" + pListData.Count), tetxt9Font, b, new Rectangle(LeftWidth, cellLocateRectangle.Y + cellLocateRectangle.Height + 5, top_TableWidth, RowHeight));
- }
- else
- {
- g.DrawString(((iPage + 1) + "/" + pListData.Count), tetxt9Font, b, new Rectangle(LeftWidth, rowLocateRectangle.Y + rowLocateRectangle.Height + 5, top_TableWidth, RowHeight));
- }
- //g.Dispose();
- //if (z == 0)
- //{
- // if (sizeHeight < rowLocateRectangle.Y + rowLocateRectangle.Height)
- // {
- // sizeHeight = rowLocateRectangle.Y + rowLocateRectangle.Height + 2;
- // }
- // else
- // {
- // break;
- // }
- //}
- //else
- //{
- // break;
- //}
- //}
-
- return null;
- }
- public static string GetClassCodeToCalssName(string classCode)
- {
- if (string.IsNullOrEmpty(classCode.Trim())) { return ""; }
- return LYFZ.BLL.WageStatisticsProcess.GetClassCodeToCalssName(classCode);
- }
- #endregion
- #region 加减乘除
- /// <summary>
- /// 加减乘除
- /// </summary>
- /// <param name="objValue"></param>
- /// <param name="g"></param>
- /// <param name="size"></param>
- /// <returns></returns>
- public static List<Image> DoorCity_AdditionSubtractionMultiplyDivide( object objValue, Graphics gg, Size size )
- {
- PhotoSelectSystem.EventCalculatedPrint e = (PhotoSelectSystem.EventCalculatedPrint)objValue;
- string StrSumText = e.SumText;// 合计
- List<string> OriginalProductList = e.ReserveProductList;// 原套系商品
- List<PhotoSelectSystem.PrintCalculatedItem> SelectedProductList = e.AddSelectedProductList;// 商品加选
- List<PhotoSelectSystem.PrintCalculatedItem> UpgradeProductList = e.UpgradeProductList;// 商品升级
- List<PhotoSelectSystem.PrintCalculatedItem> BatchProductList = e.AddBatchProductList;// 商品加P
- List<PhotoSelectSystem.PrintCalculatedItem> IntoRegisterIntoBottom = e.BookAndEndList;// 入底入册统计
- Font ft36 = new Font( "宋体", 18 );
- Font ft11 = new Font( "宋体", 11 );
- Font ft11b = new Font( "宋体", 11, FontStyle.Bold );
- Font ft11ic = new Font( "宋体", 11, FontStyle.Italic );
- Brush b = Brushes.Black;
- Brush bu = Brushes.Blue;
- Pen p = GetPen;
- int LeftWidth = 20;
- int RowHeight = 25;
- List<Image> imglist = new List<Image>();
- Bitmap panlImage = new Bitmap( size.Width - LeftWidth, size.Height );
- Graphics g = Graphics.FromImage( panlImage );
- int TableWidth = panlImage.Width - LeftWidth * 2 - 10;
- #region 标题
- string recValue = "加减乘除";
- SizeF sizef = g.MeasureString( recValue, ft36 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rectitle = new Rectangle( (panlImage.Width / 2) - (StrWidth / 2), 30, StrWidth, 50 );
- g.DrawString( recValue, ft36, Brushes.Black, rectitle );
- #endregion
- #region 合计
- recValue = "合计";
- sizef = g.MeasureString( recValue, ft11b );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recA = new Rectangle( LeftWidth, rectitle.Y + rectitle.Height, StrWidth, StrHeigth );
- g.DrawString( recValue, ft11b, b, recA );
- recValue = StrSumText.Trim();
- sizef = g.MeasureString( recValue, ft11ic );
- StrHeigth = Convert.ToInt32( sizef.Height );
- Rectangle recA1 = new Rectangle( recA.X, recA.Y + recA.Height, TableWidth, StrHeigth );
- g.DrawString( recValue.Trim(), ft11ic, Brushes.Red, recA1 );
- int rec_Y = recA1.Y + recA1.Height + RowHeight / 3;
- #endregion
- #region 产品加选统计
- if ( SelectedProductList.Count > 0 )
- {
- recValue = "产品加选统计";
- sizef = g.MeasureString( recValue, ft11b );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recB = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft11b, b, recB );
- rec_Y = recB.Y + recB.Height;
- for ( int i = 0; i < SelectedProductList.Count; i++ )
- {
- recValue = SelectedProductList[i].Value.ToString().Trim();
- sizef = g.MeasureString( recValue, ft11, TableWidth );
- StrHeigth = Convert.ToInt32( sizef.Height );
- Rectangle recB1 = new Rectangle( recB.X, rec_Y, TableWidth, StrHeigth );
- if ( !SelectedProductList[i].IsSum )
- {
- g.DrawString( recValue, ft11, b, recB1 );
- }
- else
- {
- g.DrawString( recValue, ft11ic, bu, recB1 );
- }
- rec_Y = recB1.Y + recB1.Height;
- }
- rec_Y += RowHeight / 3;
- }
- #endregion
- #region 产品升级统计
- if ( UpgradeProductList.Count > 0 )
- {
- recValue = "产品升级统计";
- sizef = g.MeasureString( recValue, ft11b );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recC = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft11b, b, recC );
- rec_Y = recC.Y + recC.Height;
- for ( int i = 0; i < UpgradeProductList.Count; i++ )
- {
- recValue = UpgradeProductList[i].Title.ToString().Trim();
- sizef = g.MeasureString( recValue, ft11, TableWidth );
- StrHeigth = Convert.ToInt32( sizef.Height );
- Rectangle recC1 = new Rectangle( recC.X, rec_Y, TableWidth, StrHeigth );
- g.DrawString( recValue.Trim(), ft11, b, recC1 );
- recValue = UpgradeProductList[i].Value.ToString().Trim();
- sizef = g.MeasureString( recValue, ft11, TableWidth );
- StrHeigth = Convert.ToInt32( sizef.Height );
- Rectangle recC2 = new Rectangle( recC1.X, recC1.Y + recC1.Height, TableWidth, StrHeigth );
- if ( !UpgradeProductList[i].IsSum )
- {
- g.DrawString( recValue, ft11, b, recC2 );
- }
- else
- {
- g.DrawString( recValue, ft11ic, bu, recC2 );
- }
- rec_Y = recC2.Y + recC2.Height;
- }
- rec_Y += RowHeight / 3;
- }
- #endregion
- #region 相册加P统计
- if ( BatchProductList.Count > 0 )
- {
- recValue = "相册加P统计";
- sizef = g.MeasureString( recValue, ft11b );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recD = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft11b, b, recD );
- rec_Y = recD.Y + recD.Height;
- for ( int i = 0; i < BatchProductList.Count; i++ )
- {
- recValue = BatchProductList[i].Title.ToString().Trim();
- sizef = g.MeasureString( recValue, ft11, TableWidth );
- StrHeigth = Convert.ToInt32( sizef.Height );
- Rectangle recD1 = new Rectangle( recD.X, rec_Y, TableWidth, StrHeigth );
- g.DrawString( recValue.Trim(), ft11, b, recD1 );
- recValue = BatchProductList[i].Value.ToString().Trim();
- sizef = g.MeasureString( recValue, ft11, TableWidth );
- StrHeigth = Convert.ToInt32( sizef.Height );
- Rectangle recD2 = new Rectangle( recD1.X, recD1.Y + recD1.Height, TableWidth, StrHeigth );
- if ( !BatchProductList[i].IsSum )
- {
- g.DrawString( recValue, ft11, b, recD2 );
- }
- else
- {
- g.DrawString( recValue, ft11ic, bu, recD2 );
- }
- rec_Y = recD2.Y + recD2.Height;
- }
- rec_Y += RowHeight / 3;
- }
- #endregion
- #region 入册、入底加挑统计
- if ( IntoRegisterIntoBottom.Count > 0 )
- {
- recValue = "入册、入底加挑统计";
- sizef = g.MeasureString( recValue, ft11b );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recE = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft11b, b, recE );
- rec_Y = recE.Y + recE.Height;
- for ( int i = 0; i < IntoRegisterIntoBottom.Count; i++ )
- {
- recValue = IntoRegisterIntoBottom[i].Value.ToString().Trim();
- sizef = g.MeasureString( recValue, ft11, TableWidth );
- StrHeigth = Convert.ToInt32( sizef.Height );
- Rectangle recE1 = new Rectangle( recE.X, rec_Y, TableWidth, StrHeigth );
- if ( !IntoRegisterIntoBottom[i].IsSum )
- {
- g.DrawString( recValue, ft11, b, recE1 );
- }
- else
- {
- g.DrawString( recValue, ft11ic, bu, recE1 );
- }
- rec_Y = recE1.Y + recE1.Height;
- }
- rec_Y += RowHeight / 3;
- }
- #endregion
- #region 原套系商品
- if ( OriginalProductList.Count > 0 )
- {
- recValue = "原套系商品";
- sizef = g.MeasureString( recValue, ft11b );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recF = new Rectangle( LeftWidth, rec_Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft11b, b, recF );
- rec_Y = recF.Y + recF.Height;
- for ( int i = 0; i < OriginalProductList.Count; i++ )
- {
- recValue = OriginalProductList[i].ToString().Trim();
- sizef = g.MeasureString( recValue, ft11, TableWidth );
- StrHeigth = Convert.ToInt32( sizef.Height );
- Rectangle recF1 = new Rectangle( recF.X, rec_Y, TableWidth, StrHeigth );
- g.DrawString( recValue, ft11, b, recF1 );
- rec_Y = recF1.Y + recF1.Height;
- }
- rec_Y += RowHeight / 3;
- }
- #endregion
- imglist.Add( panlImage );
- return imglist;
- }
- #endregion
- #region 预约单
- /// <summary>
- /// 预约单调用
- /// </summary>
- /// <param name="objValue"></param>
- /// <param name="e"></param>
- /// <param name="StrStyle"></param>
- public static Bitmap ReservationSingle(object objValue, Graphics g, Size size, EnumPublic.PrinterPaperType EnumPaperType,
- List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> ListViceNumber, ref List<List<string>> pListData, bool IsYuYueDan = true,int iPage=0)
- {
- try
- {
- Hashtable htData = (Hashtable)objValue;
- string StrNumber = htData["strNumber"].ToString().Trim();
- string StrOrdType = htData["strOrdType"].ToString().Trim();
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_URL,Company_Telephone,Company_UpdateDatetime");
- //ExecuteSql += ";with tUser as(select User_Name, User_Telephone, User_PhonePrint from tb_ErpUser where User_EmployeeID = (select top 1 OrdPe_OrdersPerson from tb_ErpOrdersPerson where OrdPe_Type = '0' and OrdPe_OrderNumber = '" + StrNumber + "')) ";
- ExecuteSql += ";"+orbll.GetView_CustomReturnExecuteSql("tb_ErpOrder",
- StrWhere: "Ord_Number = '" + StrNumber + "'",
- ShowColumnName:
- "Ord_Type," +
- "Ord_Number," +
- "Ord_HotelInfo," +
- "Ord_SinceOrderNumber," +
- "Ord_CustomerListID," +
- "Ord_SeriesName," +
- "Ord_SeriesPrice," +
- "Ord_Price," +
- "Ord_IntoBottom," +
- "Ord_IntoRegister," +
- "Ord_Remark," +
- "Ord_CreateDatetime," +
- "dbo.fn_GetOrderArrears(Ord_Number) AS Ord_OrderArrears, Ord_LovedStyle");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
- "tb_ErpOrderDigital",
- StrWhere: "Ordv_Number = '" + StrNumber + "' and Ordv_FilmSelectionTime != null",
- filedOrder: "Ordv_FilmSelectionTime DESC",
- ShowColumnName: "Ordv_FilmSelectionTime");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
- "tb_ErpOrdersPhotography",
- StrWhere: "Ordpg_Number = '" + StrNumber + "'",
- ShowColumnName:
- "Ordpg_Number," +
- "Ordpg_ViceNumber," +
- "Ordpg_Sights," +
- "Ordpg_PhotographyStatus," +
- "Ordpg_SightsType," +
- "Ordpg_ApparelQuantity," + // 服装套数;
- "Ordpg_Photographer," +
- "Ordpg_MakeupArtist," +
- "Ordpg_BootDivision," +
- "Ordpg_ReservationPhotographyTime," +
- "((case when Ordpg_SightsRemark != '' then '('+Ordpg_SightsRemark+')' else '' end) + (case when Ordpg_OpenOrderSource != '' then '(' + Ordpg_OpenOrderSource + ')' else '' end)) AS Ordpg_SightsRemark," +
- "Ordpg_OpenOrderRemark");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
- "tb_ErpOrderProductList",
- StrWhere: "OPlist_OrderNumber = '" + StrNumber + "' and OPlist_Type = '2'",
- filedOrder: " OPlist_PickupTime DESC",
- ShowColumnName: "OPlist_PickupTime");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
- "tb_ErpOrderProductList",
- StrWhere: "OPlist_OrderNumber = '" + StrNumber + (IsYuYueDan ? "' and (OPlist_Type = '1' or OPlist_Type = '0')" : "' and (OPlist_Type = '2' or OPlist_Type = '0')"),
- filedOrder: " OPlist_OrderByNumber ASC,ID ASC",
- ShowColumnName: "OPlist_ViceNumber,OPlist_ProdNumber,OPlist_ProdName + case when OPlist_Batch > 1 then ' P数:' + cast(OPlist_Batch as Nvarchar(50)) else '' end +' 数量:'+ cast(OPlist_ProdQuantity as Nvarchar(50)) + ' ' + case when OPlist_Unit is null then '' else OPlist_Unit + (case when OPlist_OpenOrderSource != '' then '(' + OPlist_OpenOrderSource + ')' else '' end) end AS ProdName");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("View_CustomerGroupAndCustomerGroupMembersAndErpCustomer", StrWhere: "GP_OrderNumber = '" + StrNumber + "' ", filedOrder: "", ShowColumnName: "Cus_CustomerNumber,Cus_Name,Cus_Sex,Cus_Sex_cs,Age_String,Cus_Telephone,Cus_IDNumber,Cus_Address,Cus_MicroSignal,Cus_QQ,Cus_DayForMarriage,Cus_DayForMarriageLunar,Cus_Birthday,Cus_BirthdayLunar,GM_Master,GM_ProtagonistCustomer");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpWeddingService", StrWhere: "Ws_Number = '" + StrNumber + "' and Ws_Type = '1'", filedOrder: "Ws_OrderByNumber ASC,ID ASC", ShowColumnName: "Ws_ViceNumber,Ws_ProdNumber,Ws_ProdName+ ' 数量:' + cast(Ws_ProdQuantity as Nvarchar(50)) + ' ' + (case when Ws_Unit is null then '' else Ws_Unit end) + (case when Ws_OpenOrderSource != '' then '(' + Ws_OpenOrderSource + ')' else '' end) AS ProdName");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpStyle", ShowColumnName: "ID, Style_Name");
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpPayment inner join tb_ErpSystemCategory on tb_ErpPayment.Pay_PaymentMethod=Sc_ClassCode ", StrWhere: "Pay_OrdNumber = '" + StrNumber + "'", ShowColumnName: "sum(Pay_AmountOf) as Pay_AmountOf,Sc_ClassName", StrGroupBy: "Sc_ClassName");
- // 多加列副订单号;
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql(
- "tb_ErpOrderDigital",
- StrWhere: "Ordv_Number = '" + StrNumber + "'",
- ShowColumnName: "Ordv_IntoRegisterQuantity,Ordv_IntoBottomQuantity,Ordv_ViceNumber",
- filedOrder: "Ordv_DigitalNumber");
- ExecuteSql += ";" +
- "select User_Name, User_Telephone, User_PhonePrint from tb_ErpUser where User_EmployeeID = (select top 1 OrdPe_OrdersPerson from tb_ErpOrdersPerson where OrdPe_Type = '0' and OrdPe_OrderNumber = '" + StrNumber + "')";
- DataSet dtSet = orbll.GetView_Custom(ExecuteSql);
- List<Bitmap> bitmapList = new List<Bitmap>();
-
- switch ((LYFZ.EnumPublic.OrderType)Enum.Parse(typeof(LYFZ.EnumPublic.OrderType), htData["strOrdType"].ToString().Trim()))
- {
- case EnumPublic.OrderType.婚纱订单:
- switch (EnumPaperType)
- {
- case EnumPublic.PrinterPaperType.A4纸:
- Wedding_OrderReport_Print(dtSet, g, size, ref pListData, iPage);
- if(pListData.Count-1> iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- //return bitmapList;
- break;
- case EnumPublic.PrinterPaperType.A4半页纸:
- Wedding_OrderReport_TwoEqualPrint(dtSet, g, size, ref pListData, iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- //return bitmapList;
- break;
- }
- break;
- case EnumPublic.OrderType.儿童订单:
- switch (EnumPaperType)
- {
- case EnumPublic.PrinterPaperType.A4纸:
- Child_OrderReport_Print(dtSet, g, size, ListViceNumber,ref pListData,iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- //return bitmapList;
- break;
- case EnumPublic.PrinterPaperType.A4半页纸:
- Child_OrderReport_TwoEqualPrint(dtSet, g, size, ListViceNumber, ref pListData, iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- //return bitmapList;
- break;
- }
- break;
- case EnumPublic.OrderType.写真订单:
- switch (EnumPaperType)
- {
- case EnumPublic.PrinterPaperType.A4纸:
- Portrait_OrderReport_Print(dtSet, g, size, ref pListData, iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- break;
- case EnumPublic.PrinterPaperType.A4半页纸:
- Portrait_OrderReport_TwoEqualPrint(dtSet, g, size, ref pListData, iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- break;
- }
- break;
- case EnumPublic.OrderType.服务订单:
- switch (EnumPaperType)
- {
- case EnumPublic.PrinterPaperType.A4纸:
- Service_OrderReport_Print(dtSet, g, size, ref pListData, iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- break;
- case EnumPublic.PrinterPaperType.A4半页纸:
- Service_OrderReport_TwoEqualPrint(dtSet, g, size, ref pListData, iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- break;
- }
- break;
- case EnumPublic.OrderType.婚庆订单:
- switch (EnumPaperType)
- {
- case EnumPublic.PrinterPaperType.A4纸:
- //List<Bitmap> webbingList = new List<Bitmap>();
- WeddingCelebration_OrderReport_Print(dtSet, g, size, ref pListData, iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- break;
- case EnumPublic.PrinterPaperType.A4半页纸:
- WeddingCelebration_OrderReport_TwoEqualPrint(dtSet, g, size, ref pListData, iPage);
- if (pListData.Count - 1 > iPage)
- {
- IsHasMorePages = true;
- }
- else
- {
- IsHasMorePages = false;
- }
- break;
- }
- break;
- }
- }
- catch (Exception ex)
- {
- MessageBoxCustom.Show(ex.Message);
- }
- return null;
- }
- static Bitmap CombineMultipImage(List<Bitmap> bitmapList)
- {
- if(bitmapList.Count>0)
- {
- if(bitmapList.Count==1)
- {
- return bitmapList[0];
- }
- else
- {
- Bitmap lengthBitmap = new Bitmap(bitmapList[0].Width, bitmapList[0].Height * bitmapList.Count);
- Graphics g = Graphics.FromImage(lengthBitmap);
- for(int i=0;i< bitmapList.Count;i++)
- {
- g.DrawImage(bitmapList[i], 0, (bitmapList[0].Height) * i );
- }
- //lengthBitmap.Save("E:\\bitmap1.bmp");
- return lengthBitmap;
- }
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 获取预约单打印标题
- /// </summary>
- /// <returns></returns>
- static string GetReservationSingleTitle( string StrValue )
- {
- if ( PrintOtherData.ContainsKey( StrValue ) )
- {
- return PrintOtherData[StrValue].ToString().Trim();
- }
- return "";
- }
- /// <summary>
- /// 获取预约单打印LOG标题
- /// </summary>
- /// <returns></returns>
- static string GetReservationSingleLOG( string StrLog )
- {
- if ( PrintOtherData.ContainsKey( "预约LOG" ) && PrintOtherData["预约LOG"].ToString().Trim().Length > 0 )
- {
- if ( PrintOtherData["预约LOG"].ToString().IndexOf( StrLog ) != -1 )
- {
- string[] strArray = PrintOtherData["预约LOG"].ToString().Trim().Split( '∥' );
- for ( int i = 0; i < strArray.Length; i++ )
- {
- if ( strArray[i].Trim() != "" )
- {
- string[] strArray2 = strArray[i].Trim().Split( '‖' );
- if ( strArray2[0].Trim() == StrLog )
- {
- StrLog = strArray2[1].Trim(); break;
- }
- }
- }
- }
- }
- else
- {
- StrLog = "";
- }
- return StrLog;
- }
- /// <summary>
- /// 获取预约单字体大小
- /// </summary>
- /// <param name="StrValue"></param>
- /// <returns></returns>
- static Font GetFontSize( string StrValue )
- {
- if ( PrintOtherData.ContainsKey( StrValue ) && PrintOtherData[StrValue].ToString().Trim().Length > 0 )
- {
- return new Font( "宋体", Convert.ToInt32( PrintOtherData[StrValue] ) );
- }
- return new Font( "宋体", 9 );
- }
- #region 婚纱
- /// <summary>
- /// 订单报表婚纱版(2-加身份证号)
- /// </summary>
- /// <returns></returns>
- private static void Wedding_OrderReport_Print(DataSet dtSet, Graphics g1, Size size, ref List<List<string>> pListData, int iPage)
- {
- int LeftWidth = 30;
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int TableWidth = size.Width - LeftWidth * 2;
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblOrder = dtSet.Tables["ds1"];//订单
- DataTable tblDigital = dtSet.Tables["ds2"];//数码
- DataTable tblSights = dtSet.Tables["ds3"];//景点
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];//订单商品
- DataTable tblService = dtSet.Tables["ds7"];//服务资料
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//主开单人信息
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- if (tbl.Rows.Count <= 0)
- {
- MessageBoxCustom.Show("未设置影楼信息"); return;
- }
- DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
- int IntoRegisterQuantit = 0;
- int IntoBottomQuantity = 0;
- for (int i = 0; i < tblIntoRB.Rows.Count; i++)
- {
- IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
- IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
- }
- if (pListData.Count == 0)
- {
- pListData = GetProductOrServiceListData(g1, TableWidth, tblProductList, tblService, tblSights);
- }
- #region 获取数据
- string MName = "";
- string MTelephone = "";
- string MIDNumber = "";
- string MMicroSignal = "";
- string MQQ = "";
- string WName = "";
- string WTelephone = "";
- string WIDNumber = "";
- string WMicroSignal = "";
- string WQQ = "";
- string DayForMarriage = "";
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (Convert.ToBoolean(tblClient.Rows[i]["Cus_Sex"]))
- {
- WName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- WTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- WIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- WMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- WQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
- {
- DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
- {
- DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
- }
- }
- }
- else
- {
- MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
- {
- DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
- {
- DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
- }
- }
- }
- }
- int InnerSights = 0;
- int OuterSights = 0;
- string StrSights = LYFZ.BLL.OtherCommonModel.FontConversion("景点:\r\n");
- string StrPhotoTime = "";
- string StrPhotographer = "";
- string StrMakeupArtist = "";
- for (int i = 0; i < tblSights.Rows.Count; i++)
- {
- if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
- {
- InnerSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
- {
- OuterSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- StrSights += (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- StrSights += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- StrSights += "\r\n";
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_Photographer"].ToString().Trim()))
- {
- StrPhotographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_Photographer"]);
- }
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim()))
- {
- StrMakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_MakeupArtist"]);
- }
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) != "")
- {
- if (StrPhotoTime == "")
- {
- StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- else if (Convert.ToDateTime(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(StrPhotoTime))
- {
- StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- }
- }
- string StrFilmSelectionTime = "";
- if (tblDigital.Rows.Count > 0)
- {
- StrFilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString(tblDigital.Rows[0]["Ordv_FilmSelectionTime"]);
- }
- #endregion
- #region 绑定数据
- Font ft17 = new Font("宋体", 17);
- Font ft12 = new Font("宋体", 12);
- Font ft9 = new Font("宋体", 9);
- //List<Bitmap> bitmapDataList = new List<Bitmap>();
- string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string StrValue = "NO." + StrRandom(strShowNumber);
- string strNumber = StrValue;
- var data = pListData[iPage];
- //Bitmap bitmap = new Bitmap(827, 1150);
- Graphics g = g1;//Graphics.FromImage(bitmap);
- #region LOG抬头
- int Rec1Height = 0;
- Rectangle rec1;
- Image imgLog = CachePhoto(PhotoLogType.Wedding, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约婚纱单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 120);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约婚纱单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- Rec1Height = 120 - rec1.Height;
- }
- #endregion
- int LeftAdd = 3;
- int TopAdd = 6;
- int RowHeight = 25;
- int RowContentHeight = 18;
- int Unit = TableWidth / 25;
- int ColumnWidth1 = Unit * 3;
- int ColumnWidth2 = Unit * 5;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 5;
- int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
- int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- #region 始行
- Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]), ft12, b, rec2);
- SizeF sizef = g.MeasureString(strNumber, ft12);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
- g.DrawString(strNumber, ft12, b, rec2_1);
- #endregion
- #region 左排
- #region 第一行
- Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("先生姓名"), ft12, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MName, ft12, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士姓名"), ft12, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(WName, ft12, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第四表与第五列的界线
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft12, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(WTelephone), ft12, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第四表与第五列的界线
- #endregion
- #region 第二、三行
- int rec5_Y = rec4.Y + rec4.Height;
- int rec9Height = 0;
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- {
- Rectangle rec4A = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight);
- g.DrawRectangle(p, rec4A);//画标题矩形
- Rectangle rec4A_1 = new Rectangle(rec4A.X + LeftAdd, rec4A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec4A_1);//画第一列的列标题
- Point p4A1_1 = new Point(rec4A.X + ColumnWidth1, rec4A.Y);
- Point p4A1_2 = new Point(rec4A.X + ColumnWidth1, rec4A.Y + rec4A.Height);
- g.DrawLine(p, p4A1_1, p4A1_2);//画第一表与第二列的界线
- Rectangle rec4A_2 = new Rectangle(p4A1_1.X + LeftAdd, p4A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MIDNumber, ft12, b, rec4A_2);//画第二列的列标题
- Point p4A2_1 = new Point(p4A1_1.X + ColumnWidth2, rec4A.Y);
- Point p4A2_2 = new Point(p4A1_1.X + ColumnWidth2, rec4A.Y + rec4A.Height);
- g.DrawLine(p, p4A2_1, p4A2_2);//画第二表与第三列的界线
- Rectangle rec4A_3 = new Rectangle(p4A2_1.X + LeftAdd, p4A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec4A_3);//画第三列的列标题
- Point p4A3_1 = new Point(p4A2_1.X + ColumnWidth3, rec4A.Y);
- Point p4A3_2 = new Point(p4A2_1.X + ColumnWidth3, rec4A.Y + rec4A.Height);
- g.DrawLine(p, p4A3_1, p4A3_2);//画第三表与第四列的界线
- Rectangle rec4A_4 = new Rectangle(p4A3_1.X + LeftAdd, p4A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(WIDNumber, ft12, b, rec4A_4);//画第四列的列标题
- Point p4A4_1 = new Point(p4A3_1.X + ColumnWidth4, rec4A.Y);
- Point p4A4_2 = new Point(p4A3_1.X + ColumnWidth4, rec4A.Y + rec4A.Height);
- g.DrawLine(p, p4A4_1, p4A4_2);//画第四表与第五列的界线
- rec5_Y = rec4A.Y + rec4A.Height;
- rec9Height = RowHeight;
- }
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec5_Y, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MMicroSignal, ft12, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
- Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_3);//画第三列的列标题
- Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
- Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
- g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
- Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(WMicroSignal, ft12, b, rec5_4);//画第四列的列标题
- Point p54_1 = new Point(p53_1.X + ColumnWidth4, rec5.Y);
- Point p54_2 = new Point(p53_1.X + ColumnWidth4, rec5.Y + rec5.Height);
- g.DrawLine(p, p54_1, p54_2);//画第四表与第五列的界线
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6);//画标题矩形
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString("QQ", ft12, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
- Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MQQ, ft12, b, rec6_2);//画第二列的列标题
- Point p62_1 = new Point(p61_1.X + ColumnWidth2, rec6.Y);
- Point p62_2 = new Point(p61_1.X + ColumnWidth2, rec6.Y + rec6.Height);
- g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString("QQ", ft12, b, rec6_3);//画第三列的列标题
- Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
- Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
- g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(WQQ, ft12, b, rec6_4);//画第四列的列标题
- Point p64_1 = new Point(p63_1.X + ColumnWidth4, rec6.Y);
- Point p64_2 = new Point(p63_1.X + ColumnWidth4, rec6.Y + rec6.Height);
- g.DrawLine(p, p64_1, p64_2);//画第四表与第五列的界线
- #endregion
- #region 第五行
- Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
- Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- if (StrIntoBottom == "0")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
- }
- else if (StrIntoBottom == "-1")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
- }
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(StrIntoBottom, ft12, b, rec7_2);//画第二列的列标题
- Point p72_1 = new Point(p71_1.X + ColumnWidth2, rec7.Y);
- Point p72_2 = new Point(p71_1.X + ColumnWidth2, rec7.Y + rec7.Height);
- g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
- Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd, p72_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec7_3);//画第三列的列标题
- Point p73_1 = new Point(p72_1.X + ColumnWidth3, rec7.Y);
- Point p73_2 = new Point(p72_1.X + ColumnWidth3, rec7.Y + rec7.Height);
- g.DrawLine(p, p73_1, p73_2);//画第三表与第四列的界线
- Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft12, b, rec7_4);//画第四列的列标题
- Point p74_1 = new Point(p73_1.X + ColumnWidth4, rec7.Y);
- Point p74_2 = new Point(p73_1.X + ColumnWidth4, rec7.Y + rec7.Height);
- g.DrawLine(p, p74_1, p74_2);//画第四表与第五列的界线
- #endregion
- #region 第六行
- Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec8);//画标题矩形
- Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd, rec8.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装数"), ft12, b, rec8_1);//画第一列的列标题
- Point p81_1 = new Point(rec8.X + ColumnWidth1, rec8.Y);
- Point p81_2 = new Point(rec8.X + ColumnWidth1, rec8.Y + rec8.Height);
- g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
- Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(InnerSights.ToString(), ft12, b, rec8_2);//画第二列的列标题
- Point p82_1 = new Point(p81_1.X + ColumnWidth2, rec8.Y);
- Point p82_2 = new Point(p81_1.X + ColumnWidth2, rec8.Y + rec8.Height);
- g.DrawLine(p, p82_1, p82_2);//画第二表与第三列的界线
- Rectangle rec8_3 = new Rectangle(p82_1.X + LeftAdd, p82_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装数"), ft12, b, rec8_3);//画第三列的列标题
- Point p83_1 = new Point(p82_1.X + ColumnWidth3, rec8.Y);
- Point p83_2 = new Point(p82_1.X + ColumnWidth3, rec8.Y + rec8.Height);
- g.DrawLine(p, p83_1, p83_2);//画第三表与第四列的界线
- Rectangle rec8_4 = new Rectangle(p83_1.X + LeftAdd, p83_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(OuterSights.ToString(), ft12, b, rec8_4);//画第四列的列标题
- Point p84_1 = new Point(p83_1.X + ColumnWidth4, rec8.Y);
- Point p84_2 = new Point(p83_1.X + ColumnWidth4, rec8.Y + rec8.Height);
- g.DrawLine(p, p84_1, p84_2);//画第四表与第五列的界线
- #endregion
- #region 第七行
- Rectangle rec8A = new Rectangle(rec8.X, rec8.Y + rec8.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec8A);//画标题矩形
- Rectangle rec8A_1 = new Rectangle(rec8A.X + LeftAdd, rec8A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("喜爱风格"), ft12, b, rec8A_1);//画第一列的列标题
- Point p8A1_1 = new Point(rec8A.X + ColumnWidth1, rec8A.Y);
- Point p8A1_2 = new Point(rec8A.X + ColumnWidth1, rec8A.Y + rec8A.Height);
- g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, rec8A.Width - rec8A_1.Width, RowContentHeight);
- string[] OrdLovedStyle = tblOrder.Rows[0]["Ord_LovedStyle"].ToString().Trim().Split('|');
- string StrLovedStyle = "";
- for (int i = 0; i < OrdLovedStyle.Length; i++)
- {
- if (OrdLovedStyle[i].Trim() != "")
- {
- string[] StrID = OrdLovedStyle[i].Trim().Split('_');
- DataRow dtRow = tblStyle.Rows.Find(StrID[1].Trim());
- if (dtRow != null)
- {
- StrLovedStyle += dtRow["Style_Name"] + ",";
- }
- }
- }
- g.DrawString(StrLovedStyle.TrimEnd(','), ft12, b, rec8A_2);//画第六列的列标题
- #endregion
- #region 第一列
- #region 第一行
- Rectangle rec9 = new Rectangle(rec8A.X, rec8A.Y + rec8A.Height, rec3.Width, 510 - RowHeight + Rec1Height - rec9Height);
- g.DrawRectangle(p, rec9);//画标题矩形
- float _infoHeight = 0;
- Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2);
- string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("详细内容:");
- SizeF infoSizef = g.MeasureString(StrProdName,
- GetFontSize("婚纱预约单内容详情字体大小"), rec9.Width);
- g.DrawString(StrProdName, GetFontSize("婚纱预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
- _infoHeight += infoSizef.Height;
- ///此处取单位在商品删除和下架时报错 需要修改
- //for (int i = 0; i < tblProductList.Rows.Count; i++)
- //{
- // if (i == 0)
- // {
- // PrintContentData("商品:", g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
- // }
- // string strName = tblProductList.Rows[i]["ProdName"].ToString().Trim();
- // PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
- //}
- //for (int i = 0; i < tblService.Rows.Count; i++)
- //{
- // if (i == 0)
- // {
- // PrintContentData("服务:", g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
- // }
- // string strName = tblService.Rows[i]["ProdName"].ToString().Trim();
- // PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
- //}
- foreach (string str in data)
- {
- string strName = str;
- PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
- }
- //g.DrawString(StrProdName + "\r\n\r\n" + StrSights, GetFontSize("婚纱预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
- //PrintContentData("\r\n\r\n" + StrSights, g, rec9, LeftAdd, TopAdd, b, "婚纱预约单内容详情字体大小", ref _infoHeight);
- #endregion
- #region 第二行
- SizeF disSizef = g.MeasureString(
- LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:")
- + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim()
- + "\r\n付款情况:" + strPaymentMsg,
- ft12, rec9.Width);
- int recHeight = 100;
- if (disSizef.Height > 100)
- {
- recHeight = Convert.ToInt32(disSizef.Height) + 1;
- }
- rec9.Y = rec9.Y - (recHeight - 100);
- Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec9.Width, recHeight);
- g.FillRectangle(new SolidBrush(Color.White), recA1);
- g.DrawRectangle(p, recA1);//画标题矩形
- Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width - LeftAdd * 2, recA1.Height - TopAdd * 2);
- string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim() ;
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- disInfo += "\r\n付款情况:" + strPaymentMsg;
- }
- g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
-
- #endregion
- #region 第三行
- Rectangle recA2 = new Rectangle(recA1.X, recA1.Y + recA1.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA2);//画标题矩形
- Rectangle recA2_1 = new Rectangle(recA2.X + LeftAdd, recA2.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft12, b, recA2_1);//画第一列的列标题
- Point pA21_1 = new Point(recA2.X + ColumnWidth1, recA2.Y);
- Point pA21_2 = new Point(recA2.X + ColumnWidth1, recA2.Y + recA2.Height);
- g.DrawLine(p, pA21_1, pA21_2);//画第一表与第二列的界线
- Rectangle recA2_2 = new Rectangle(pA21_1.X + LeftAdd, pA21_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(StrPhotographer, ft12, b, recA2_2);//画第二列的列标题
- Point pA22_1 = new Point(pA21_1.X + ColumnWidth2, recA2.Y);
- Point pA22_2 = new Point(pA21_1.X + ColumnWidth2, recA2.Y + recA2.Height);
- g.DrawLine(p, pA22_1, pA22_2);//画第二表与第三列的界线
- Rectangle recA2_3 = new Rectangle(pA22_1.X + LeftAdd, pA22_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft12, b, recA2_3);//画第三列的列标题
- Point pA23_1 = new Point(pA22_1.X + ColumnWidth3, recA2.Y);
- Point pA23_2 = new Point(pA22_1.X + ColumnWidth3, recA2.Y + recA2.Height);
- g.DrawLine(p, pA23_1, pA23_2);//画第三表与第四列的界线
- Rectangle recA2_4 = new Rectangle(pA23_1.X + LeftAdd, pA23_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(StrMakeupArtist.Trim(), ft12, b, recA2_4);//画第四列的列标题
- #endregion
- #region 第四行
- Rectangle recA3 = new Rectangle(recA2.X, recA2.Y + recA2.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA3);//画标题矩形
- Rectangle recA3_1 = new Rectangle(recA3.X + LeftAdd, recA3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄时间"), ft12, b, recA3_1);//画第一列的列标题
- Point pA31_1 = new Point(recA3.X + ColumnWidth1, recA3.Y);
- Point pA31_2 = new Point(recA3.X + ColumnWidth1, recA3.Y + recA3.Height);
- g.DrawLine(p, pA31_1, pA31_2);//画第一表与第二列的界线
- Rectangle recA3_2 = new Rectangle(pA31_1.X + LeftAdd, pA31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(StrPhotoTime, ft12, b, recA3_2);//画第二列的列标题
- Point pA32_1 = new Point(pA31_1.X + ColumnWidth2, recA3.Y);
- Point pA32_2 = new Point(pA31_1.X + ColumnWidth2, recA3.Y + recA3.Height);
- g.DrawLine(p, pA32_1, pA32_2);//画第二表与第三列的界线
- Rectangle recA3_3 = new Rectangle(pA32_1.X + LeftAdd, pA32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件日期"), ft12, b, recA3_3);//画第三列的列标题
- Point pA33_1 = new Point(recA3_3.X + recA3_3.Width - LeftAdd, recA3.Y);
- Point pA33_2 = new Point(pA33_1.X, recA3.Y + recA3.Height);
- g.DrawLine(p, pA33_1, pA33_2);//画第三表与第四列的界线
- string strPickupTime = "";
- if (tblPickupTime.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
- {
- strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
- }
- }
- Rectangle recA3_4 = new Rectangle(pA33_1.X + LeftAdd, pA33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- #endregion
- #endregion
- #region 第七行
- Rectangle recA4 = new Rectangle(recA3.X, recA3.Y + recA3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA4);//画标题矩形
- Rectangle recA4_1 = new Rectangle(recA4.X + LeftAdd, recA4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片日期"), ft12, b, recA4_1);//画第一列的列标题
- Point pA41_1 = new Point(recA4.X + ColumnWidth1, recA4.Y);
- Point pA41_2 = new Point(recA4.X + ColumnWidth1, recA4.Y + recA4.Height);
- g.DrawLine(p, pA41_1, pA41_2);//画第一表与第二列的界线
- Rectangle recA4_2 = new Rectangle(pA41_1.X + LeftAdd, pA41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(StrFilmSelectionTime, ft12, b, recA4_2);//画第二列的列标题
- Point pA42_1 = new Point(pA41_1.X + ColumnWidth2, recA4.Y);
- Point pA42_2 = new Point(pA41_1.X + ColumnWidth2, recA4.Y + recA4.Height);
- g.DrawLine(p, pA42_1, pA42_2);//画第二表与第三列的界线
- Rectangle recA4_3 = new Rectangle(pA42_1.X + LeftAdd, pA42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString("", ft12, b, recA4_3);//画第三列的列标题
- Point pA43_1 = new Point(pA42_1.X + ColumnWidth3, recA4.Y);
- Point pA43_2 = new Point(pA42_1.X + ColumnWidth3, recA4.Y + recA4.Height);
- g.DrawLine(p, pA43_1, pA43_2);//画第三表与第四列的界线
- Rectangle recA4_4 = new Rectangle(pA43_1.X + LeftAdd, pA43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString("", ft12, b, recA4_4);//画第四列的列标题
- Point pA44_1 = new Point(pA43_1.X + ColumnWidth4, recA4.Y);
- Point pA44_2 = new Point(pA43_1.X + ColumnWidth4, recA4.Y + recA4.Height);
- g.DrawLine(p, pA44_1, pA44_2);//画第四表与第五列的界线
- #endregion
- #endregion
- #region 右排
- #region 第一行
- Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
- g.DrawRectangle(p, Rrec3);//画标题矩形
- Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
- Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
- Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
- g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
- Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
- #endregion
- #region 第二行
- Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec4);//画标题矩形
- Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
- Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
- Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
- g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
- Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
- #endregion
- #region 第三行
- Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec5);//画标题矩形
- Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约定金"), ft12, b, Rrec5_5);//画第五列的列标题
- Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
- Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
- g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
- Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
- #endregion
- #region 第四行
- Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec6);//画标题矩形
- Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
- Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
- Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
- g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
- Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
- #endregion
- #region 第五行
- Rectangle Rrec7 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec7);//画标题矩形
- Rectangle Rrec7_5 = new Rectangle(Rrec7.X + LeftAdd, Rrec7.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("结婚日期"), ft12, b, Rrec7_5);//画第五列的列标题
- Point Rp75_1 = new Point(Rp65_1.X, Rrec7.Y);
- Point Rp75_2 = new Point(Rp65_1.X, Rrec7.Y + Rrec7.Height);
- g.DrawLine(p, Rp75_1, Rp75_2);//画第五表与第六列的界线
- Rectangle Rrec7_6 = new Rectangle(Rp75_1.X + LeftAdd, Rrec7_5.Y, ColumnWidth6, RowContentHeight);
- //e.Graphics.DrawString(DayForMarriage + "2015-05-05", ft9, b, Rrec7_6);//画第六列的列标题
- g.DrawString(DayForMarriage, ft12, b, Rrec7_6);//画第六列的列标题
- #endregion
- #region 第六行
- Rectangle Rrec8 = new Rectangle(Rrec7.X, Rrec7.Y + Rrec7.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec8);//画标题矩形
- Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft12, b, Rrec8_5);//画第五列的列标题
- Point Rp85_1 = new Point(Rp75_1.X, Rrec8.Y);
- Point Rp85_2 = new Point(Rp75_1.X, Rrec8.Y + Rrec8.Height);
- g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
- string strOrderPerson = "";
- Rectangle rec8_6 = new Rectangle(Rp85_1.X + LeftAdd, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
- #endregion
- #region 第一列
- Rectangle Rrec10 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA2.Y - Rrec8.Y);
- g.DrawRectangle(p, Rrec10);//画标题矩形
- StrValue = "";
- if (PrintOtherData.ContainsKey("婚纱预约单注意事项说明") && PrintOtherData["婚纱预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["婚纱预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
- Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("婚纱预约单注意事项字体大小"), minFontSize: 6);
- PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
- #endregion
- #region 顾客签字
- Rectangle RrecA5 = new Rectangle(Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2);
- g.DrawRectangle(p, RrecA5);//画标题矩形
- Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
- Point RpA51_1 = new Point(Rp75_1.X, RrecA5.Y);
- Point RpA51_2 = new Point(Rp75_1.X, RrecA5.Y + RrecA5.Height);
- g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
- #endregion
- #endregion
- #region 尾行
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA4.Y + recA4.Height + TopAdd, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, recA6_1);//画第一列的列标题
- Rectangle recA6 = new Rectangle(recA4.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
- Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("页:") + (iPage + 1) + "/" + pListData.Count;
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA8 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA7.Y + TopAdd, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, recA8);//画第一列的列标题
- #endregion
- //bitmap.Save("E:\\btn"+ bitmapDataList.Count+".bmp");
- //bitmapDataList.Add(bitmap);
- //size = new Size(size.Width, size.Height * pListData.Count);
- #endregion
- }
-
- /// <summary>
- /// 其他单获取服务商品详情数据
- /// </summary>
- /// <param name="g1"></param>
- /// <param name="TableWidth"></param>
- /// <param name="tblProductList"></param>
- /// <param name="tblService"></param>
- /// <param name="tblSights"></param>
- /// <returns></returns>
- static List<List<string>> GetProductOrServiceListData(Graphics g1,int TableWidth,DataTable tblProductList,
- DataTable tblService,DataTable tblSights,string fontmsg="婚纱预约单内容详情字体大小"
- ,bool bSign=true,float contentHeight= 460)
- {
- #region 绑定数据
- List<List<string>> pListData = new List<List<string>>();
- List<string> tempListData = new List<string>();
- float tempDataHight = 0;
- int Unit1 = TableWidth / 25;
- int ColumnWidth11 = Unit1 * 3;
- int ColumnWidth12 = Unit1 * 5;
- int ColumnWidth13 = Unit1 * 3;
- int ColumnWidth14 = Unit1 * 5;
- SizeF iSizef = new SizeF();
- for (int i = 0; i < tblProductList.Rows.Count; i++)
- {
- DataRow dr = tblProductList.Rows[i];
- //SizeF iSizef = new SizeF();
- if (i == 0)
- {
- iSizef = g1.MeasureString("商品:",
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > contentHeight)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add("商品:");
- }
- iSizef = g1.MeasureString(dr["ProdName"].ToString().Trim(),
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > contentHeight)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + dr["ProdName"].ToString().Trim());
- }
- for (int i = 0; i < tblService.Rows.Count; i++)
- {
- DataRow dr = tblService.Rows[i];
- if (i == 0)
- {
- iSizef = g1.MeasureString("服务:",
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > contentHeight)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add("服务:");
- }
- iSizef = g1.MeasureString(dr["ProdName"].ToString().Trim(),
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > contentHeight)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" "+dr["ProdName"].ToString().Trim());
- }
- iSizef = g1.MeasureString("\r\n",
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > contentHeight)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add("\r\n");
- if (bSign)
- {
- iSizef = g1.MeasureString(LYFZ.BLL.OtherCommonModel.FontConversion("景点:\r\n"),
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > contentHeight)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(LYFZ.BLL.OtherCommonModel.FontConversion("景点:\r\n"));
- for (int i = 0; i < tblSights.Rows.Count; i++)
- {
- string StrSights1 = "";
- StrSights1 += (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- StrSights1 += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- StrSights1 += "\r\n";
- iSizef = g1.MeasureString(StrSights1,
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > contentHeight)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + StrSights1);
- }
- }
- if (tempListData.Count > 0)
- {
- pListData.Add(tempListData);
- }
- return pListData;
- #endregion
- }
- #if IGNORE
- static void PrintContentData(string strName, Graphics g, Rectangle rec9, int LeftAdd, int TopAdd,Brush b ,string fontSizeText, ref float _infoHeight)
- {
- string info = "";
- string quantity = "";
- SizeF infoSizef;
- if (strName.LastIndexOf("数量") > -1)
- {
- List<string> infoList = new List<string>();
- info = strName.Substring(0, strName.LastIndexOf("数量"));
- quantity = strName.Replace(info, "");
- }
- else
- {
- info = strName;
- }
- if (string.IsNullOrEmpty(quantity))
- {
- Rectangle rec9_2 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd + (int)_infoHeight, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2);
- infoSizef = g.MeasureString(info,
- GetFontSize(fontSizeText), rec9.Width);
- g.DrawString(info, GetFontSize(fontSizeText), b, rec9_2);//画第一列的列标题
- _infoHeight += infoSizef.Height;
- }
- else
- {
- Rectangle rec9_2 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd + (int)_infoHeight, rec9.Width - LeftAdd * 2 - 100, rec9.Height - TopAdd * 2);
- infoSizef = g.MeasureString(info,
- GetFontSize(fontSizeText), rec9_2.Width);
- g.DrawString(info, GetFontSize(fontSizeText), b, rec9_2);//画第一列的列标题
- rec9_2 = new Rectangle(rec9.X + LeftAdd + rec9_2.Width, rec9.Y + TopAdd + (int)_infoHeight, 100, rec9.Height - TopAdd * 2);
- infoSizef = g.MeasureString(quantity,
- GetFontSize(fontSizeText), rec9_2.Width);
- g.DrawString(quantity, GetFontSize(fontSizeText), b, rec9_2);//画第一列的列标题
- _infoHeight += infoSizef.Height;
- }
- }
- #else
- /// <summary>
- ///
- /// </summary>
- /// <param name="strText">要打印的文本</param>
- /// <param name="g"></param>
- /// <param name="rcParent">容器区域(父区域),文本在显示的区域不能超过该区域范围</param>
- /// <param name="nLineSpace">行间距</param>
- /// <param name="nPageMargins">页边距</param>
- /// <param name="b"></param>
- /// <param name="fontSizeText">字号大小</param>
- /// <param name="_infoHeight">本次绘图前所有绘图结果的高度总和</param>
- static void PrintContentData( string strText, Graphics g, Rectangle rcParent, int nPageMargins, int nLineSpace, Brush b, string fontSizeText, ref float _infoHeight )
- {
- SizeF TextSize;
- int nIndex = -1;
- strText = strText.Replace(" Null"," ");
- // 商品名称, 商品匹数, 商品数量;
- string strCommodityName = strText, strCommodityPS = "", strCommodityQuantity = "";
- // 解析出商品名称, 商品匹数, 商品数量;
- if ( (nIndex = strText.LastIndexOf( "数量" )) != -1 )
- {
- strCommodityName = strText.Substring( 0, nIndex ).TrimEnd(); // 保留商品名前的空格;
- strCommodityQuantity = strText.Substring( nIndex ).Trim();
- if ( (nIndex = strCommodityName.LastIndexOf( "P数" )) != -1 )
- {
- strCommodityPS = strCommodityName.Substring( nIndex ).Trim();
- strCommodityName = strCommodityName.Substring( 0, nIndex ).TrimEnd();// 保留商品名前的空格;
- }
- if ( (nIndex = strCommodityQuantity.LastIndexOf( "(礼包)" )) != -1 )
- {
- strCommodityQuantity = strCommodityQuantity.Substring( 0, nIndex ).Trim();
- strCommodityName += "(礼包)";
- }
- }
- // 自动缩放时,不使用页边距;
- PrinterDrawMethod.AutoScaleNotMargion = false;
- if ( string.IsNullOrEmpty( strCommodityQuantity ) )
- {// 没有数量信息时, 则要打印的文本不是商品内容,而是其他普通文本;
- Rectangle rec9_2 = new Rectangle( rcParent.X + nPageMargins, rcParent.Y + nLineSpace + (int)_infoHeight, rcParent.Width - nPageMargins * 2, rcParent.Height - nLineSpace * 2 );
- Rectangle rcConfig = PrinterDrawMethod.ComputeTextCell( g, strText, rec9_2, GetFontSize( fontSizeText ) );
- rcConfig.Height = PrinterDrawMethod.DrawCellTextAutroScale( g, strText, rcConfig, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
- _infoHeight += rcConfig.Height;
- }
- else
- {// 有数量信息时, 一定是商品信息文本;
- int nWidth = (rcParent.Width - nPageMargins) / 20; // 分成20份, 13份商品名,3份p数,4份数量;
- // 打印商品名;
- Rectangle rec9_2 = new Rectangle( rcParent.X + nPageMargins, rcParent.Y + nLineSpace + (int)_infoHeight, nWidth * 13, rcParent.Height - nLineSpace * 2 );
- Rectangle rcConfig = PrinterDrawMethod.ComputeTextCell( g, strCommodityName, rec9_2, GetFontSize( fontSizeText ) );
- rcConfig.Height = PrinterDrawMethod.DrawCellTextAutroScale( g, strCommodityName, rcConfig, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
- if ( !string.IsNullOrEmpty( strCommodityPS ) )
- {// P数存在;
- // 打印P数;
- rec9_2 = new Rectangle( rcParent.X + nPageMargins + nWidth * 13, rcParent.Y + nLineSpace + (int)_infoHeight, nWidth * 3, rcParent.Height - nLineSpace * 2 );
- TextSize = g.MeasureString( strCommodityPS, GetFontSize( fontSizeText ), rec9_2.Width );
- PrinterDrawMethod.DrawCellTextAutroScale( g, strCommodityPS, rec9_2, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
- // 打印商品数量;
- rec9_2 = new Rectangle( rcParent.X + nPageMargins + nWidth * 16, rcParent.Y + nLineSpace + (int)_infoHeight, nWidth * 4, rcParent.Height - nLineSpace * 2 );
- TextSize = g.MeasureString( strCommodityQuantity, GetFontSize( fontSizeText ), rec9_2.Width );
- PrinterDrawMethod.DrawCellTextAutroScale( g, strCommodityQuantity, rec9_2, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
- }
- else
- {// 没有匹数;
- // 打印商品数量;
- rec9_2 = new Rectangle( rcParent.X + nPageMargins + nWidth * 16, rcParent.Y + nLineSpace + (int)_infoHeight, nWidth * 4, rcParent.Height - nLineSpace * 2 );
- TextSize = g.MeasureString( strCommodityQuantity, GetFontSize( fontSizeText ), rec9_2.Width );
- rcConfig.Height = PrinterDrawMethod.DrawCellTextAutroScale( g, strCommodityQuantity, rec9_2, GetFontSize( fontSizeText ), autoScale: true, showFrame: false, minFontSize: 5 );
- }
- _infoHeight += rcConfig.Height;
- }
- }
- #endif
- /// <summary>
- /// 婚纱二等份打印
- /// </summary>
- /// <param name="objValue"></param>
- private static void Wedding_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size, ref List<List<string>> pListData, int iPage)
- {
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblOrder = dtSet.Tables["ds1"];//订单
- DataTable tblDigital = dtSet.Tables["ds2"];//数码
- DataTable tblSights = dtSet.Tables["ds3"];//景点
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];//订单商品
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//服务资料
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
-
- DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
- int IntoRegisterQuantit = 0;
- int IntoBottomQuantity = 0;
- for (int i = 0; i < tblIntoRB.Rows.Count; i++)
- {
- IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
- IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
- }
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- if (pListData.Count == 0)
- {
- pListData = GetProductOrServiceHelfListData(g1, TableWidth, tblProductList, tblService, tblSights,disInfo: LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim());
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft17 = new Font("宋体", 17);
- Font ft13 = new Font("宋体", 13);
- Font ft10 = new Font("宋体", 10);
- Font ft9 = new Font("宋体", 9);
- #region 获取数据
- string MName = "";
- string MTelephone = "";
- string MIDNumber = "";
- string MMicroSignal = "";
- string MQQ = "";
- string WName = "";
- string WTelephone = "";
- string WIDNumber = "";
- string WMicroSignal = "";
- string WQQ = "";
- string DayForMarriage = "";
- string StrAdderss = "";
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (Convert.ToBoolean(tblClient.Rows[i]["Cus_Sex"]))
- {
- WName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- WTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- WIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- WMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- WQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
- {
- DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
- {
- DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
- }
- }
- if (tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "")
- {
- if (StrAdderss == "")
- {
- StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- else
- {
- MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
- {
- DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
- {
- DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
- }
- }
- if (tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "")
- {
- StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- int InnerSights = 0;
- int OuterSights = 0;
- string StrSights = LYFZ.BLL.OtherCommonModel.FontConversion("景点:");
- string StrPhotoTime = "";
- string StrPhotographer = "";
- string StrMakeupArtist = "";
- for (int i = 0; i < tblSights.Rows.Count; i++)
- {
- if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
- {
- InnerSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
- {
- OuterSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- StrSights += "\r\n" + (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- StrSights += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_Photographer"].ToString().Trim()))
- {
- StrPhotographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_Photographer"]);
- }
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim()))
- {
- StrMakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_MakeupArtist"]);
- }
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) != "")
- {
- if (StrPhotoTime == "")
- {
- StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- else if (Convert.ToDateTime(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(StrPhotoTime))
- {
- StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- }
- }
- string StrFilmSelectionTime = "";
- if (tblDigital.Rows.Count > 0)
- {
- StrFilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblDigital.Rows[0]["Ordv_FilmSelectionTime"]);
- }
- #endregion
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 20;
- int RowContentHeight = 18;
- int Unit = TableWidth / 32;
- int ColumnWidth1 = Unit * 3;
- int ColumnWidth2 = Unit * 4;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 4;
- int ColumnWidth5 = Unit * 2 - 4;
- int ColumnWidth6 = Unit * 3 + 4;
- int ColumnWidth7 = Unit * 3;
- int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
- string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom(StrValue);
- string strNumber = rec3Value;
- List<string> data = pListData[iPage];
- Bitmap bitmap = new Bitmap(827, 580);
- Graphics g = g1;
- string StrProdName = "";
- //for (int i = 0; i < tblProductList.Rows.Count; i++)
- //{
- // StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- //}
- //for (int i = 0; i < tblService.Rows.Count; i++)
- //{
- // StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- //}
- //StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
- foreach (string str in data)
- {
- StrProdName += (string.IsNullOrEmpty(StrProdName) ? " " : "\r\n ") + str;
- }
- //StrProdName += "\r\n付款方式:" + strPaymentMsg;
- #region 金色童年收据凭据
- Rectangle rec1;
- int Rec1Height = 0;
- int TopHeightCount = 0;
- Image imgLog = CachePhoto(PhotoLogType.Wedding, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约婚纱单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约婚纱单标题", ft17).Height);
- TopHeightCount = 3;
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约婚纱单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- }
- #endregion
- #region 开单日期;
- string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]);
- SizeF sizef = g.MeasureString(strOrderCreatedData, ft10);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
- g.DrawString(strOrderCreatedData, ft10, b, rec1A);
- #endregion
- #region NO.
- sizef = g.MeasureString(strNumber, ft10);
- rec1A = new Rectangle(rec1A.Right + 10, rec1A.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
- g.DrawString(strNumber, ft10, b, rec1A);
- #endregion
- #region 打印时间
- string StrPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印时间:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-dd HH:mm");
- sizef = g.MeasureString(StrPrintDate, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Y, FtWidth, FtHeight);
- g.DrawString(StrPrintDate, ft10, b, rec2);
- #endregion
- #region 第一行
- Rectangle rec3 = new Rectangle(LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("先生姓名");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 2, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MName, ft9, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 2, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("先生电话"), ft9, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft9, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
- Rectangle rec3_5 = new Rectangle(p34_1.X + LeftAdd * 2, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec3_5);//画第三列的列标题
- Point p35_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
- Point p35_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
- g.DrawLine(p, p35_1, p35_2);//画第三表与第四列的界线
- Rectangle rec3_6 = new Rectangle(p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- g.DrawString(OrdPrice, ft9, b, rec3_6);//画第四列的列标题
- Point p36_1 = new Point(p35_1.X + ColumnWidth6, rec3.Y);
- Point p36_2 = new Point(p35_1.X + ColumnWidth6, rec3.Y + rec3.Height);
- g.DrawLine(p, p36_1, p36_2);//画第二表与第三列的界线
- Rectangle rec3_7 = new Rectangle(p36_1.X + LeftAdd * 2, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec3_7);//画第三列的列标题
- Point p37_1 = new Point(p36_1.X + ColumnWidth7, rec3.Y);
- Point p37_2 = new Point(p36_1.X + ColumnWidth7, rec3.Y + rec3.Height);
- g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
- Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec3_8);//画第四列的列标题
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 2, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士姓名"), ft9, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(WName, ft9, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 2, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士电话"), ft9, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(WTelephone), ft9, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
- Rectangle rec4_5 = new Rectangle(p44_1.X + LeftAdd * 2, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_5);//画第三列的列标题
- }
- Point p45_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
- Point p45_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
- g.DrawLine(p, p45_1, p45_2);//画第三表与第四列的界线
- Rectangle rec4_6 = new Rectangle(p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- {
- g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6);//画第四列的列标题
- }
- Point p46_1 = new Point(p45_1.X + ColumnWidth6, rec4.Y);
- Point p46_2 = new Point(p45_1.X + ColumnWidth6, rec4.Y + rec4.Height);
- g.DrawLine(p, p46_1, p46_2);//画第二表与第三列的界线
- Rectangle rec4_7 = new Rectangle(p46_1.X + LeftAdd * 2, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("结婚日期"), ft9, b, rec4_7);//画第三列的列标题
- Point p47_1 = new Point(p46_1.X + ColumnWidth7, rec4.Y);
- Point p47_2 = new Point(p46_1.X + ColumnWidth7, rec4.Y + rec4.Height);
- g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
- Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(DayForMarriage, ft9, b, rec4_8);//画第四列的列标题
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 2, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
- Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd * 11, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec5_3);//画第一列的列标题
- Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
- Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
- g.DrawLine(p, p53_1, p53_2);//画第一表与第二列的界线
- Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft9, b, rec5_4);//画第二列的列标题
- Point p54_1 = new Point(p43_1.X + ColumnWidth4, rec5.Y);
- Point p54_2 = new Point(p43_1.X + ColumnWidth4, rec5.Y + rec5.Height);
- g.DrawLine(p, p54_1, p54_2);//画第二表与第三列的界线
- Rectangle rec5_5 = new Rectangle(p54_1.X + LeftAdd * 2, p54_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec5_5);//画第三列的列标题
- Point p55_1 = new Point(p54_1.X + ColumnWidth5, rec5.Y);
- Point p55_2 = new Point(p54_1.X + ColumnWidth5, rec5.Y + rec5.Height);
- g.DrawLine(p, p55_1, p55_2);//画第三表与第四列的界线
- string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- if (StrIntoBottom == "0")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
- }
- else if (StrIntoBottom == "-1")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
- }
- Rectangle rec5_6 = new Rectangle(p55_1.X + LeftAdd, p55_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(StrIntoBottom, ft9, b, rec5_6);//画第四列的列标题
- Point p56_1 = new Point(p55_1.X + ColumnWidth6, rec5.Y);
- Point p56_2 = new Point(p55_1.X + ColumnWidth6, rec5.Y + rec5.Height);
- g.DrawLine(p, p56_1, p56_2);//画第二表与第三列的界线
- Rectangle rec5_7 = new Rectangle(p56_1.X + LeftAdd * 11, p56_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft9, b, rec5_7);//画第三列的列标题
- Point p57_1 = new Point(p56_1.X + ColumnWidth7, rec5.Y);
- Point p57_2 = new Point(p56_1.X + ColumnWidth7, rec5.Y + rec5.Height);
- g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
- Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
- #endregion
- #region 第三四行
- //Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6 + ColumnWidth7, RowHeight);
- //g.DrawRectangle(p, rec5A);//画标题矩形
- //Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 11, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_1);//画第一列的列标题
- //Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
- //Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
- //g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
- //Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, rec5A.Width - ColumnWidth1, RowContentHeight);
- //g.DrawString(StrAdderss, ft9, b, rec5A_2);//画第二列的列标题
- Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5A);//画标题矩形
- Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装"), ft9, b, rec5A_1);//画第一列的列标题
- Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
- Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
- Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(InnerSights.ToString().Trim(), ft9, b, rec5A_2);//画第二列的列标题
- Point p5A2_1 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y);
- Point p5A2_2 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A2_1, p5A2_2);//画第二表与第三列的界线
- Rectangle rec5A_3 = new Rectangle(p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装"), ft9, b, rec5A_3);//画第一列的列标题
- Point p5A3_1 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y);
- Point p5A3_2 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A3_1, p5A3_2);//画第一表与第二列的界线
- Rectangle rec5A_4 = new Rectangle(p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(OuterSights.ToString().Trim(), ft9, b, rec5A_4);//画第二列的列标题
- Point p5A4_1 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y);
- Point p5A4_2 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A4_1, p5A4_2);//画第二表与第三列的界线
- Rectangle rec5A_5 = new Rectangle(p5A4_1.X + LeftAdd * 2, p5A4_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_5);//画第三列的列标题
- Point p5A5_1 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y);
- Point p5A5_2 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A5_1, p5A5_2);//画第三表与第四列的界线
- Rectangle rec5A_6 = new Rectangle(p5A5_1.X + LeftAdd, p5A5_1.Y + TopAdd, ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowContentHeight);
- g.DrawString(StrAdderss, ft9, b, rec5A_6);//画第四列的列标题
- //Point p5A6_1 = new Point(p5A5_1.X + ColumnWidth6, rec5A.Y);
- //Point p5A6_2 = new Point(p5A5_1.X + ColumnWidth6, rec5A.Y + rec5A.Height);
- //g.DrawLine(p, p5A6_1, p5A6_2);//画第二表与第三列的界线
- //Rectangle rec5A_7 = new Rectangle(p5A6_1.X + LeftAdd * 11, p5A6_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft9, b, rec5A_7);//画第三列的列标题
- //Point p5A7_1 = new Point(p5A6_1.X + ColumnWidth7, rec5A.Y);
- //Point p5A7_2 = new Point(p5A6_1.X + ColumnWidth7, rec5A.Y + rec5A.Height);
- //g.DrawLine(p, p5A7_1, p5A7_2);//画第三表与第四列的界线
- //Rectangle rec5A_8 = new Rectangle(p5A7_1.X + LeftAdd, p5A7_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- //g.DrawString(tblOrder.Rows[0]["OrdPe_OrdersPerson"].ToString().Trim(), ft9, b, rec5A_8);//画第四列的列标题
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle(rec5A.X, rec5A.Y + rec5A.Height, TableWidth - ColumnWidth8 - ColumnWidth7, 315 - Rec1Height - LeftWidth);
- g.DrawRectangle(p, rec6);//画标题矩形
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("套系内容");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height) + 1;
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
- g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
- Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, rec6.Width - rec6_1.Width - LeftAdd * 2, rec6.Height - TopAdd * 2);
- g.DrawString(StrProdName, GetFontSize("婚纱预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
- //Point p62_1 = new Point(p61_1.X + rec6_2.Width, rec6.Y);
- //Point p62_2 = new Point(p61_1.X + rec6_2.Width, rec6.Y + rec6.Height);
- //g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- Rectangle rec6A = new Rectangle(rec6.X + rec6.Width, rec5A.Y + rec5A.Height, ColumnWidth8 + ColumnWidth7, rec6.Height);
- g.DrawRectangle(p, rec6A);//画标题矩形
- sizef = g.MeasureString("注意事项", ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height) + 1;
- Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd * 2, rec6A.Y + (rec6A.Height - FtHeight) / 2, rec6_1.Width, rec6A.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec6A_1);//画第三列的列标题
- Point p6A1_1 = new Point(rec6A.X + rec6A_1.Width, rec6A.Y);
- Point p6A1_2 = new Point(rec6A.X + rec6A_1.Width, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p6A1_1, p6A1_2);//画第三表与第四列的界线
- StrValue = "";
- if (PrintOtherData.ContainsKey("婚纱预约单注意事项说明") && PrintOtherData["婚纱预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["婚纱预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth8 + ColumnWidth7 - rec6A_1.Width - LeftAdd * 2, rec6.Height - TopAdd * 2);
- g.DrawString(StrValue, GetFontSize("婚纱预约单注意事项字体大小"), b, rec6A_2);//画第四列的列标题
- #endregion
- #region 第六行
- //int SWidth = (p6A1_1.X - LeftWidth) / 6;
- int SWidth = (ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6 + ColumnWidth7) / 6;
- int Column1 = SWidth - 20;
- int Column2 = SWidth + 35;
- //Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, p6A1_1.X - LeftWidth, RowHeight);
- Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth1 / 3, RowHeight);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd * 3, rec7.Y + TopAdd, Column1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft9, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + rec7_1.Width, rec7.Y);
- Point p71_2 = new Point(rec7.X + rec7_1.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, Column2, RowContentHeight);
- g.DrawString(StrPhotographer, ft9, b, rec7_2);//画第六列的列标题
- Point p72_1 = new Point(p71_1.X + ColumnWidth2, rec7.Y);
- Point p72_2 = new Point(p71_1.X + ColumnWidth2, rec7.Y + rec7.Height);
- g.DrawLine(p, p72_1, p72_2);//画第一表与第二列的界线
- Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd, p72_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍照时间"), ft9, b, rec7_3);//画第一列的列标题
- Point p73_1 = new Point(p72_1.X + rec7_3.Width, rec7.Y);
- Point p73_2 = new Point(p72_1.X + rec7_3.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p73_1, p73_2);//画第一表与第二列的界线
- Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
- g.DrawString(StrPhotoTime, ft9, b, rec7_4);//画第六列的列标题
- Point p74_1 = new Point(p73_1.X + rec7_4.Width, rec7.Y);
- Point p74_2 = new Point(p73_1.X + rec7_4.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p74_1, p74_2);//画第一表与第二列的界线
- Rectangle rec7_5 = new Rectangle(p74_1.X + LeftAdd * 3, p74_1.Y + TopAdd, rec7_3.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft9, b, rec7_5);//画第一列的列标题
- Point p75_1 = new Point(p74_1.X + rec7_5.Width, rec7.Y);
- Point p75_2 = new Point(p74_1.X + rec7_5.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p75_1, p75_2);//画第一表与第二列的界线
- Rectangle rec7_6 = new Rectangle(p75_1.X + LeftAdd, p75_1.Y + TopAdd, rec7_4.Width, RowContentHeight);
- g.DrawString(StrMakeupArtist.Trim(), ft9, b, rec7_6);//画第六列的列标题
- #endregion
- #region 第七行
- Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec7.Width, RowHeight);
- g.DrawRectangle(p, rec8);//画标题矩形
- Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd * 3, rec8.Y + TopAdd, rec7_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("设计师"), ft9, b, rec8_1);//画第一列的列标题
- Point p81_1 = new Point(rec8.X + rec7_1.Width, rec8.Y);
- Point p81_2 = new Point(rec8.X + rec7_1.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
- Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
- g.DrawString("", ft9, b, rec8_2);//画第六列的列标题
- Point p82_1 = new Point(p81_1.X + ColumnWidth2, rec8.Y);
- Point p82_2 = new Point(p81_1.X + ColumnWidth2, rec8.Y + rec8.Height);
- g.DrawLine(p, p82_1, p82_2);//画第一表与第二列的界线
- Rectangle rec8_3 = new Rectangle(p82_1.X + LeftAdd, p82_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片时间"), ft9, b, rec8_3);//画第一列的列标题
- Point p83_1 = new Point(p82_1.X + rec8_3.Width, rec8.Y);
- Point p83_2 = new Point(p82_1.X + rec8_3.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p83_1, p83_2);//画第一表与第二列的界线
- Rectangle rec8_4 = new Rectangle(p83_1.X + LeftAdd, p83_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
- g.DrawString(StrFilmSelectionTime, ft9, b, rec8_4);//画第六列的列标题
- Point p84_1 = new Point(p83_1.X + rec8_4.Width, rec8.Y);
- Point p84_2 = new Point(p83_1.X + rec8_4.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p84_1, p84_2);//画第一表与第二列的界线
- Rectangle rec8_5 = new Rectangle(p84_1.X + LeftAdd, p84_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件时间"), ft9, b, rec8_5);//画第一列的列标题
- Point p85_1 = new Point(p84_1.X + rec8_5.Width, rec8.Y);
- Point p85_2 = new Point(p84_1.X + rec8_5.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p85_1, p85_2);//画第一表与第二列的界线
- string strPickupTime = "";
- if (tblPickupTime.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
- {
- strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
- }
- }
- Rectangle rec8_6 = new Rectangle(p85_1.X + LeftAdd, p85_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
- g.DrawString(strPickupTime, ft9, b, rec8_6);//画第六列的列标题
- #endregion
- #region 顾客签字
- Rectangle rec8A = new Rectangle(rec7.X, rec7.Y, TableWidth - (rec7.X - LeftWidth), rec7.Height + rec8.Height);
- g.DrawRectangle(p, rec8A);//画标题矩形
- Rectangle rec8A_1 = new Rectangle(rec7.X + rec7.Width + LeftAdd * 2, rec8A.Y + TopAdd * 3, Column1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8A_1);//画第一列的列标题
- Point p8A1_1 = new Point(rec8A_1.X + ColumnWidth7, rec8A.Y);
- Point p8A1_2 = new Point(rec8A_1.X + ColumnWidth7, rec8A.Y + rec8A.Height);
- g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, Column2, RowContentHeight);
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec7.X + LeftAdd * 3 + 5, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
- g.DrawLine(p, rec7.X, p8A1_1.Y, rec7.X, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X + Column1, p8A1_1.Y, rec7.X + Column1, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X + TableWidth, p8A1_1.Y, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X, p8A1_2.Y + rec8A_2.Height + 5, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- rec8A_2.Height += 10;
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec7.X + LeftAdd * 22, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
- }
- else
- {
- rec8A_2.Height = 0;
- }
- #endregion
- #region 尾行
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec8.Y + rec8.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9 = new Rectangle(rec8.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth + rec8A_2.Height, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
- #endregion
- //bitmapDataList.Add(bitmap);
- }
- /// <summary>
- /// 其他单获取服务商品详情数据
- /// </summary>
- /// <param name="g1"></param>
- /// <param name="TableWidth"></param>
- /// <param name="tblProductList"></param>
- /// <param name="tblService"></param>
- /// <param name="tblSights"></param>
- /// <returns></returns>
- static List<List<string>> GetProductOrServiceHelfListData(Graphics g1, int TableWidth, DataTable tblProductList, DataTable tblService, DataTable tblSights, string fontmsg = "婚纱预约单内容详情字体大小"
- , bool bSign = true, string disInfo = "")
- {
- #region 绑定数据
- List<List<string>> pListData = new List<List<string>>();
- List<string> tempListData = new List<string>();
- float tempDataHight = 0;
- int Unit1 = TableWidth / 25;
- int ColumnWidth11 = Unit1 * 3;
- int ColumnWidth12 = Unit1 * 5;
- int ColumnWidth13 = Unit1 * 3;
- int ColumnWidth14 = Unit1 * 5;
- SizeF iSizef = new SizeF();
- for (int i = 0; i < tblProductList.Rows.Count; i++)
- {
- DataRow dr = tblProductList.Rows[i];
- //SizeF iSizef = new SizeF();
- if (i == 0)
- {
- iSizef = g1.MeasureString("商品:",
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 280)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add("商品:");
- }
- iSizef = g1.MeasureString(dr["ProdName"].ToString().Trim(),
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 280)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + dr["ProdName"].ToString().Trim());
- }
- for (int i = 0; i < tblService.Rows.Count; i++)
- {
- DataRow dr = tblService.Rows[i];
- if (i == 0)
- {
- iSizef = g1.MeasureString("服务:",
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 280)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add("服务:");
- }
- iSizef = g1.MeasureString(dr["ProdName"].ToString().Trim(),
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 280)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + dr["ProdName"].ToString().Trim());
- }
- iSizef = g1.MeasureString("\r\n",
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 280)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add("\r\n");
- if (bSign)
- {
- iSizef = g1.MeasureString(LYFZ.BLL.OtherCommonModel.FontConversion("景点:"),
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 280)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(LYFZ.BLL.OtherCommonModel.FontConversion("景点:"));
- for (int i = 0; i < tblSights.Rows.Count; i++)
- {
- string StrSights1 = "";
- StrSights1 += (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- StrSights1 += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- //StrSights1 += "\r\n";
- iSizef = g1.MeasureString(StrSights1,
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 280)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + StrSights1);
- }
- }
- if (!string.IsNullOrEmpty(disInfo))
- {
- iSizef = g1.MeasureString(disInfo,
- GetFontSize(fontmsg), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 280)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + disInfo.Trim());
- }
- if (tempListData.Count > 0)
- {
- pListData.Add(tempListData);
- }
- return pListData;
- #endregion
- }
- #endregion
- #region 儿童
- /// <summary>
- /// 订单报表儿童版()
- /// </summary>
- /// <returns></returns>
- private static void Child_OrderReport_Print(DataSet dtSet, Graphics g1, Size size, List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot,
- ref List<List<string>> pListData, int iPage)
- {
- int LeftWidth = 30;
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int TableWidth = size.Width - LeftWidth * 2;
- DataTable tbl = dtSet.Tables["ds"];
- DataTable tbl_Order = dtSet.Tables["ds1"];
- DataTable tbl_Digital = dtSet.Tables["ds2"];
- DataTable tbl_Sights = dtSet.Tables["ds3"];
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//服务
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- //获取影楼信息
- if (tbl.Rows.Count <= 0)
- {
- MessageBoxCustom.Show("未设置影楼信息"); return;
- }
- DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
- Hashtable htDataA = new Hashtable();
- Hashtable htDataB = new Hashtable();
- Hashtable htDataC = new Hashtable();
- for (int i = 0; i < tblIntoRB.Rows.Count; i++)
- {
- if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) > 0)
- {// 送部分;
- htDataA[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- else if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) == 0)
- {// 不送;
- htDataB[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- else
- {// 全送;
- htDataC[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- }
- // 订单的入册总数;
- int IntoRegisterQuantit = 0;
- // 订单的入底总数;
- int IntoBottomQuantity = 0;
- string StrIntoBottomQuantity = "";
- bool IsSS = false;
- for (int i = 0; i < tblIntoRB.Rows.Count; i++)
- {
- #if IGNORE
- // 入册数量;
- IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
- // 入底数量;
- if ((htDataA.Count > 0 && htDataB.Count > 0) || (htDataA.Count > 0 && htDataC.Count > 0) || (htDataB.Count > 0 && htDataC.Count > 0))
- {
- if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) > 0)
- {
- StrIntoBottomQuantity += tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"].ToString().Trim() + ",";
- }
- else if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) == 0)
- {
- StrIntoBottomQuantity += "不送,";
- }
- else
- {
- StrIntoBottomQuantity += "全送,";
- }
- IsSS = true;
- }
- else
- {
- IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
- }
- #else
- if (listScenicSpot != null)
- {
- bool bViceExist = false;
- foreach (ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot)
- {
- if (scenic.strScenicName.Trim() == tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim())
- {
- bViceExist = true;
- break;
- }
- }
- if (!bViceExist)
- continue;
- }
- // 累加入册数量;
- IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
- // 本次入底数量;
- IntoBottomQuantity = Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
- if (IntoBottomQuantity > 0)
- StrIntoBottomQuantity += IntoBottomQuantity.ToString() + ",";
- else if (IntoBottomQuantity == 0)
- StrIntoBottomQuantity += "不送,";
- else
- StrIntoBottomQuantity += "全送,";
- #endif
- }
- if (pListData.Count == 0)
- {
- pListData = new List<List<string>>();
- pListData = GetChildProductOrServiceListData(g1, listScenicSpot, TableWidth, tblProductList, tblService, tbl_Sights, tblIntoRB);
- }
- #if IGNORE
- if (!IsSS)
- {
- if (IntoBottomQuantity > 0)
- {
- StrIntoBottomQuantity = IntoBottomQuantity.ToString();
- }
- else if (IntoBottomQuantity == 0)
- {
- StrIntoBottomQuantity = "不送";
- }
- else
- {
- StrIntoBottomQuantity = "全送";
- }
- }
- #endif
- StrIntoBottomQuantity = StrIntoBottomQuantity.TrimEnd(',');
- #region 获取数据
- string PName = "";
- string PTelephone = "";
- string PIDNumber = "";
- string PMicroSignal = "";
- string PQQ = "";
- string PAddress = "";
- string RName = "";
- string RBirthday = "";
- string RSex = "";
- string RAgeString = "";
- string PMemberCardNumber = "";
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0")
- {
- PName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- PTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- PIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- PMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- PQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- PAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- DataTable tblMember = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + tblClient.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_CradNumber").Tables[0];
- if (tblMember.Rows.Count > 0)
- {
- PMemberCardNumber = tblMember.Rows[0]["Mc_CradNumber"].ToString();
- }
- }
- else if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "0" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1")
- {
- RName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- RSex = tblClient.Rows[i]["Cus_Sex_cs"].ToString().Trim();
- RAgeString = tblClient.Rows[i]["Age_String"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_Birthday"], "yyyy-MM-dd", tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1") != "")
- {
- RBirthday = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_Birthday"], "yyyy-MM-dd", tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1");
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1")
- {
- RBirthday += LYFZ.BLL.OtherCommonModel.FontConversion("(农历)");
- }
- }
- }
- }
- int InnerSights = 0;
- int OuterSights = 0;
- string Photographer = "";
- string MakeupArtist = "";
- string PhotographyTime = "";
- string BootDivision = "";
- for (int i = 0; i < tbl_Sights.Rows.Count; i++)
- {
- if (tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
- {
- OuterSights += Convert.ToInt32(tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- else if (tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
- {
- InnerSights += Convert.ToInt32(tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- if (tbl_Sights.Rows[i]["Ordpg_Photographer"].ToString().Trim() != "")
- {
- Photographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_Photographer"]);
- }
- if (tbl_Sights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim() != "")
- {
- MakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_MakeupArtist"]);
- }
- if (tbl_Sights.Rows[i]["Ordpg_BootDivision"].ToString().Trim() != "")
- {
- BootDivision = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_BootDivision"]);
- }
- if (!string.IsNullOrEmpty(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString()))
- {
- if (PhotographyTime != "")
- {
- if (Convert.ToDateTime(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(PhotographyTime))
- {
- PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- }
- else
- {
- PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- }
- }
- string FilmSelectionTime = "";
- if (tbl_Digital.Rows.Count > 0)
- {
- FilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString(tbl_Digital.Rows[0]["Ordv_FilmSelectionTime"]);
- }
- #endregion
- Font ft17 = new Font("宋体", 17);
- Font ft12 = new Font("宋体", 12);
- Font ft9 = new Font("宋体", 9);
- string StrValue = tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tbl_Order.Rows[0]["Ord_Number"].ToString().Trim();
- StrValue = "NO." + StrRandom(StrValue);
- string strNumber = StrValue;
- List<string> dataList = pListData[iPage];
- //{
- //Bitmap bitmap = new Bitmap(827, 1150);
- Graphics g = g1;//Graphics.FromImage(bitmap);
- #region LOG抬头
- int Rec1Height = 0;
- Rectangle rec1;
- Image imgLog = CachePhoto(PhotoLogType.Child, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约儿童单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 120);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约儿童单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- Rec1Height = 120 - rec1.Height;
- }
- #endregion
- int LeftAdd = 3;
- int TopAdd = 6;
- int RowHeight = 25;
- int RowContentHeight = 18;
- int Unit = TableWidth / 25;
- int ColumnWidth1 = Unit * 3;
- int ColumnWidth2 = Unit * 5;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 5;
- int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
- int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- #region 始行
- Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tbl_Order.Rows[0]["Ord_CreateDateTime"], "yyyy-MM-dd HH:mm"), ft12, b, rec2);
- //string StrValue = tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tbl_Order.Rows[0]["Ord_Number"].ToString().Trim();
- //StrValue = "NO." + StrRandom(StrValue);
- SizeF sizef = g.MeasureString(strNumber, ft12);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
- g.DrawString(strNumber, ft12, b, rec2_1);
- #endregion
- #region 左排
- #region 第一行
- Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("宝贝姓名"), ft12, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(RName, ft12, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("家长姓名"), ft12, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(PName, ft12, b, rec3_4);//画第四列的列标题
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("宝贝生日"), ft12, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(RBirthday, ft12, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(PTelephone), ft12, b, rec4_4);//画第四列的列标题
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("性别"), ft12, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(RSex, ft12, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p41_1.X, rec5.Y);
- Point p52_2 = new Point(p41_1.X, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5A_1 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("年龄"), ft12, b, rec5A_1);//画第一列的列标题
- Point p51A_1 = new Point(p52_1.X + ColumnWidth1 / 2, rec5.Y);
- Point p51A_2 = new Point(p52_1.X + ColumnWidth1 / 2, rec5.Y + rec5.Height);
- g.DrawLine(p, p51A_1, p51A_2);//画第一表与第二列的界线
- Rectangle rec5A_2 = new Rectangle(p51A_1.X + LeftAdd, p51A_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(RAgeString, ft12, b, rec5A_2);//画第二列的列标题
- Point p52A_1 = new Point(p42_1.X, rec5.Y);
- Point p52A_2 = new Point(p42_1.X, rec5.Y + rec5.Height);
- g.DrawLine(p, p52A_1, p52A_2);//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle(p52A_1.X + LeftAdd, p52A_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_3);//画第三列的列标题
- Point p53_1 = new Point(p52A_1.X + ColumnWidth3, rec5.Y);
- Point p53_2 = new Point(p52A_1.X + ColumnWidth3, rec5.Y + rec5.Height);
- g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
- Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(PMicroSignal, ft12, b, rec5_4);//画第四列的列标题
- #endregion
- #region 第四行
- int rec5_Y = rec4.Y + rec4.Height;
- int rec9Height = 0;
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- {
- Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6);//画标题矩形
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
- Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft12, b, rec6_2);//画第二列的列标题
- Point p62_1 = new Point(p61_1.X + ColumnWidth2, rec6.Y);
- Point p62_2 = new Point(p61_1.X + ColumnWidth2, rec6.Y + rec6.Height);
- g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString("QQ", ft12, b, rec6_3);//画第三列的列标题
- Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
- Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
- g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(PQQ, ft12, b, rec6_4);//画第四列的列标题
- Rectangle rec6A = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6A);//画标题矩形
- Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec6A_1);//画第一列的列标题
- Point p6A1_1 = new Point(rec6A.X + ColumnWidth1, rec6A.Y);
- Point p6A1_2 = new Point(rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p6A1_1, p6A1_2);//画第一表与第二列的界线
- Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, p6A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(StrIntoBottomQuantity, ft12, b, rec6A_2);//画第二列的列标题
- Point p6A2_1 = new Point(p6A1_1.X + ColumnWidth2, rec6A.Y);
- Point p6A2_2 = new Point(p6A1_1.X + ColumnWidth2, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p6A2_1, p6A2_2);//画第二表与第三列的界线
- Rectangle rec6A_3 = new Rectangle(p6A2_1.X + LeftAdd, p6A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec6A_3);//画第三列的列标题
- Point p6A3_1 = new Point(p6A2_1.X + ColumnWidth3, rec6A.Y);
- Point p6A3_2 = new Point(p6A2_1.X + ColumnWidth3, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p6A3_1, p6A3_2);//画第三表与第四列的界线
- Rectangle rec6A_4 = new Rectangle(p6A3_1.X + LeftAdd, p6A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(PIDNumber, ft12, b, rec6A_4);//画第四列的列标题
- rec5_Y = rec6A.Y + rec6A.Height;
- rec9Height = RowHeight;
- }
- else
- {
- //Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- //g.DrawRectangle(p, rec6);//画标题矩形
- //Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec6_1);//画第一列的列标题
- //Point p61_1 = new Point(p51_1.X, rec6.Y);
- //Point p61_2 = new Point(p51_1.X, rec6.Y + rec6.Height);
- //g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- //Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- //g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft9, b, rec6_2);//画第二列的列标题
- //Point p62_1 = new Point(p52_1.X, rec6.Y);
- //Point p62_2 = new Point(p52_1.X, rec6.Y + rec6.Height);
- //g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- //Rectangle rec6A_1 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth1, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec6A_1);//画第一列的列标题
- //Point p61A_1 = new Point(p51A_1.X, rec6.Y);
- //Point p61A_2 = new Point(p51A_1.X, rec6.Y + rec6.Height);
- //g.DrawLine(p, p61A_1, p61A_2);//画第一表与第二列的界线
- //string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- //if (StrIntoBottom == "0")
- //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送"); }
- //else if (StrIntoBottom == "-1")
- //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送"); }
- //Rectangle rec6A_2 = new Rectangle(p61A_1.X + LeftAdd, p61A_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- //g.DrawString(StrIntoBottom, ft9, b, rec6A_2);//画第二列的列标题
- //Point p62A_1 = new Point(p52A_1.X, rec6.Y);
- //Point p62A_2 = new Point(p52A_1.X, rec6.Y + rec6.Height);
- //g.DrawLine(p, p62A_1, p62A_2);//画第二表与第三列的界线
- //Rectangle rec6_3 = new Rectangle(p62A_1.X + LeftAdd, p62A_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- //g.DrawString("QQ", ft9, b, rec6_3);//画第三列的列标题
- //Point p63_1 = new Point(p62A_1.X + ColumnWidth3, rec6.Y);
- //Point p63_2 = new Point(p62A_1.X + ColumnWidth3, rec6.Y + rec6.Height);
- //g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- //Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- //g.DrawString(PQQ, ft9, b, rec6_4);//画第四列的列标题
- //rec5_Y = rec6.Y + rec6.Height;
- Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6);//画标题矩形
- //Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("性别"), ft9, b, rec5_1);//画第一列的列标题
- //Point p51_1 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y);
- //Point p51_2 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y + rec5.Height);
- //g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
- Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft12, b, rec6_2);//画第二列的列标题
- Point p62_1 = new Point(p52_1.X + ColumnWidth2, rec6.Y);
- Point p62_2 = new Point(p52_1.X + ColumnWidth2, rec6.Y + rec6.Height);
- g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString("QQ", ft12, b, rec6_3);//画第三列的列标题
- Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
- Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
- g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(PQQ, ft12, b, rec6_4);//画第四列的列标题
- Rectangle rec6A = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6A);//画标题矩形
- Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec6A_1);//画第一列的列标题
- Point p61A_1 = new Point(rec6A.X + ColumnWidth1, rec6A.Y);
- Point p61A_2 = new Point(rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p61A_1, p61A_2);//画第一表与第二列的界线
- //string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- //if (StrIntoBottom == "0")
- //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送"); }
- //else if (StrIntoBottom == "-1")
- //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送"); }
- Rectangle rec6A_2 = new Rectangle(p61A_1.X + LeftAdd, p61A_1.Y + TopAdd, ColumnWidth2 * 3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(StrIntoBottomQuantity, ft12, b, rec6A_2);//画第二列的列标题
- Point p62A_1 = new Point(p61A_1.X, rec6A.Y);
- Point p62A_2 = new Point(p61A_1.X, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p62A_1, p62A_2);//画第二表与第三列的界线
- rec5_Y = rec6A.Y + rec6A.Height;
- }
- #endregion
- #region 第五行
- Rectangle rec7 = new Rectangle(rec3.X, rec5_Y, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装数"), ft12, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
- Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(InnerSights.ToString(), ft12, b, rec7_2);//画第二列的列标题
- Point p72_1 = new Point(p71_1.X + ColumnWidth2, rec7.Y);
- Point p72_2 = new Point(p71_1.X + ColumnWidth2, rec7.Y + rec7.Height);
- g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
- Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd, p72_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装数"), ft12, b, rec7_3);//画第三列的列标题
- Point p73_1 = new Point(p72_1.X + ColumnWidth3, rec7.Y);
- Point p73_2 = new Point(p72_1.X + ColumnWidth3, rec7.Y + rec7.Height);
- g.DrawLine(p, p73_1, p73_2);//画第三表与第四列的界线
- Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(OuterSights.ToString(), ft12, b, rec7_4);//画第四列的列标题
- #endregion
- #region 第六行
- Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec8);//画标题矩形
- Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd, rec8.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("家庭地址"), ft12, b, rec8_1);//画第一列的列标题
- Point p81_1 = new Point(rec8.X + ColumnWidth1, rec8.Y);
- Point p81_2 = new Point(rec8.X + ColumnWidth1, rec8.Y + rec8.Height);
- g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
- Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, rec8.Width - rec8_1.Width, RowContentHeight);
- g.DrawString(PAddress, ft12, b, rec8_2);//画第六列的列标题
- #endregion
- #region 第七行
- Rectangle rec8A = new Rectangle(rec8.X, rec8.Y + rec8.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec8A);//画标题矩形
- Rectangle rec8A_1 = new Rectangle(rec8A.X + LeftAdd, rec8A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("喜爱风格"), ft12, b, rec8A_1);//画第一列的列标题
- Point p81A_1 = new Point(rec8A.X + ColumnWidth1, rec8A.Y);
- Point p81A_2 = new Point(rec8A.X + ColumnWidth1, rec8A.Y + rec8A.Height);
- g.DrawLine(p, p81A_1, p81A_2);//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle(p81A_1.X + LeftAdd, p81A_1.Y + TopAdd, rec8.Width - rec8A_1.Width, RowContentHeight);
- string[] OrdLovedStyle = tbl_Order.Rows[0]["Ord_LovedStyle"].ToString().Trim().Split('|');
- string StrLovedStyle = "";
- for (int i = 0; i < OrdLovedStyle.Length; i++)
- {
- if (OrdLovedStyle[i].Trim() != "")
- {
- string[] StrID = OrdLovedStyle[i].Trim().Split('_');
- DataRow dtRow = tblStyle.Rows.Find(StrID[1].Trim());
- if (dtRow != null)
- {
- StrLovedStyle += dtRow["Style_Name"] + ",";
- }
- }
- }
- g.DrawString(StrLovedStyle.TrimEnd(','), ft12, b, rec8A_2);//画第二列的列标题
- #endregion
- #region 第一列
- #region 第一行
- Rectangle rec9 = new Rectangle(rec8A.X, rec8A.Y + rec8A.Height, rec3.Width, 510 - RowHeight * 2 + Rec1Height - rec9Height);//1515
- g.DrawRectangle(p, rec9);//画标题矩形
- string strSights = "";
- float _infoHeight = 0;
- string orderType = Convert.ToString(tbl_Order.Rows[0]["Ord_Type"]);
- string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("详细内容:\r\n" + strSights);
- Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2);
- PrintContentData("详细内容:", g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- #region old数据详情
- //int nIndex = 0;
- // 遍历成长次数;
- //for ( int i = 0; i < tbl_Sights.Rows.Count; i++ )
- // {
- // strSights = "";
- // // 订单的入册总数;
- // IntoRegisterQuantit = 0;
- // // 订单的入底总数;
- // IntoBottomQuantity = 0;
- // StrIntoBottomQuantity = "0";
- // if ( listScenicSpot != null )
- // {
- // bool bViceExist = false;
- // foreach ( ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot )
- // {
- // if ( scenic.strScenicName.Trim() == tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim() )
- // {
- // bViceExist = true;
- // // 订单的入册总数;
- // IntoRegisterQuantit = Convert.ToInt32( tblIntoRB.Select( "Ordv_ViceNumber = '" + scenic.strViceNumber + "'" )[0][0].ToString() );
- // // 订单的入底总数;
- // IntoBottomQuantity = Convert.ToInt32( tblIntoRB.Select( "Ordv_ViceNumber = '" + scenic.strViceNumber + "'" )[0][1].ToString() );
- // if ( IntoBottomQuantity > 0 )
- // StrIntoBottomQuantity = IntoBottomQuantity.ToString();
- // else if ( IntoBottomQuantity == 0 )
- // StrIntoBottomQuantity = "不送";
- // else
- // StrIntoBottomQuantity = "全送";
- // break;
- // }
- // }
- // if ( !bViceExist )
- // continue;
- // }
- // nIndex++;
- // if ( i > 0 )
- // {
- // strSights += "";
- // }
- // // 景点名称或成长名称;
- // strSights += (nIndex) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- // string FuZhuangString = "";
- // if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- // FuZhuangString = String.Format("服装:{0}套", tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim());
- // string RuDiRuCheString = "";
- // if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- // RuDiRuCheString = String.Format("入册:{0}, 入底:{1}", IntoRegisterQuantit, StrIntoBottomQuantity);
- // if (!String.IsNullOrWhiteSpace(FuZhuangString) && !String.IsNullOrWhiteSpace(RuDiRuCheString))
- // {
- // strSights += string.Format("【{0},{1}】", RuDiRuCheString, FuZhuangString);
- // }
- // else if (!String.IsNullOrWhiteSpace(FuZhuangString)){
- // strSights += string.Format("【{0}】", FuZhuangString);
- // }
- // else if (!String.IsNullOrWhiteSpace(RuDiRuCheString))
- // {
- // strSights += string.Format("【{0}】", RuDiRuCheString);
- // }
- // // strSights += string.Format( "【入册:{0}, 入底:{1}, 服装:{2}套】", IntoRegisterQuantit, StrIntoBottomQuantity, tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim() );
- // // 景点备注或成长备注;
- // if ( !string.IsNullOrEmpty( orderType ) && orderType != "1" )
- // {
- // if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim() ) )
- // {
- // strSights += " " + tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- // }
- // }
- // else
- // {
- // if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim() ) )
- // {
- // strSights += " " + tbl_Sights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
- // }
- // }
- // PrintContentData( strSights, g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
- // // 该成长次的商品记录;
- // DataRow[] dtRowsA = tblProductList.Select( "OPlist_ViceNumber = '" + tbl_Sights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'" );
- // if ( dtRowsA.Length > 0 )
- // {
- // //strSights += "\r\n商品:";
- // PrintContentData( " 商品:", g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
- // for ( int j = 0; j < dtRowsA.Length; j++ )
- // {
- // PrintContentData( " " + dtRowsA[j]["ProdName"].ToString().Trim(), g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
- // //strSights += dtRowsA[j]["ProdName"].ToString().Trim();
- // }
- // }
- // // 该成长次的服务记录;
- // DataRow[] dtRowsB = tblService.Select( "Ws_ViceNumber = '" + tbl_Sights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'" );
- // if ( dtRowsB.Length > 0 )
- // {
- // //strSights += "\r\n服务:";
- // PrintContentData( " 服务:", g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
- // for ( int j = 0; j < dtRowsB.Length; j++ )
- // {
- // /* if (j > 0)
- // { strSights += "\r\n"; }
- // strSights += dtRowsB[j]["ProdName"].ToString().Trim();*/
- // PrintContentData( " " + dtRowsB[j]["ProdName"].ToString().Trim(), g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight );
- // }
- // }
- //}
- #endregion
- foreach (string str in dataList)
- {
- string strName = str;
- PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- }
- //g.DrawString(StrProdName, GetFontSize("儿童预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
- #endregion
- #region 第二行
- Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec3.Width, 100);
- g.DrawRectangle(p, recA1);//画标题矩形
- Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width, recA1.Height - TopAdd * 2);
- string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tbl_Order.Rows[0]["Ord_Remark"].ToString().Trim();
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- disInfo += "\r\n付款:" + strPaymentMsg;
- }
- g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
- #endregion
- #region 第三行
- Rectangle recA2 = new Rectangle(recA1.X, recA1.Y + recA1.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA2);//画标题矩形
- Rectangle recA2_1 = new Rectangle(recA2.X + LeftAdd, recA2.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft12, b, recA2_1);//画第一列的列标题
- Point pA21_1 = new Point(recA2.X + ColumnWidth1, recA2.Y);
- Point pA21_2 = new Point(recA2.X + ColumnWidth1, recA2.Y + recA2.Height);
- g.DrawLine(p, pA21_1, pA21_2);//画第一表与第二列的界线
- Rectangle recA2_2 = new Rectangle(pA21_1.X + LeftAdd, pA21_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(Photographer, ft12, b, recA2_2);//画第二列的列标题
- Point pA22_1 = new Point(pA21_1.X + ColumnWidth2, recA2.Y);
- Point pA22_2 = new Point(pA21_1.X + ColumnWidth2, recA2.Y + recA2.Height);
- g.DrawLine(p, pA22_1, pA22_2);//画第二表与第三列的界线
- Rectangle recA2_3 = new Rectangle(pA22_1.X + LeftAdd, pA22_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft12, b, recA2_3);//画第三列的列标题
- Point pA23_1 = new Point(pA22_1.X + ColumnWidth3, recA2.Y);
- Point pA23_2 = new Point(pA22_1.X + ColumnWidth3, recA2.Y + recA2.Height);
- g.DrawLine(p, pA23_1, pA23_2);//画第三表与第四列的界线
- Rectangle recA2_4 = new Rectangle(pA23_1.X + LeftAdd, pA23_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(MakeupArtist.Trim(), ft12, b, recA2_4);//画第四列的列标题
- //Point pA24_1 = new Point(pA23_1.X + ColumnWidth4, recA2.Y);
- //Point pA24_2 = new Point(pA23_1.X + ColumnWidth4, recA2.Y + recA2.Height);
- //g.DrawLine(p, pA24_1, pA24_2);//画第四表与第五列的界线
- #endregion
- #region 第四行
- Rectangle recA3 = new Rectangle(recA2.X, recA2.Y + recA2.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA3);//画标题矩形
- Rectangle recA3_1 = new Rectangle(recA3.X + LeftAdd, recA3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄时间"), ft12, b, recA3_1);//画第一列的列标题
- Point pA31_1 = new Point(recA3.X + ColumnWidth1, recA3.Y);
- Point pA31_2 = new Point(recA3.X + ColumnWidth1, recA3.Y + recA3.Height);
- g.DrawLine(p, pA31_1, pA31_2);//画第一表与第二列的界线
- Rectangle recA3_2 = new Rectangle(pA31_1.X + LeftAdd, pA31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(PhotographyTime, ft12, b, recA3_2);//画第二列的列标题
- Point pA32_1 = new Point(pA31_1.X + ColumnWidth2, recA3.Y);
- Point pA32_2 = new Point(pA31_1.X + ColumnWidth2, recA3.Y + recA3.Height);
- g.DrawLine(p, pA32_1, pA32_2);//画第二表与第三列的界线
- Rectangle recA3_3 = new Rectangle(pA32_1.X + LeftAdd, pA32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件日期"), ft12, b, recA3_3);//画第三列的列标题
- Point pA33_1 = new Point(pA32_1.X + ColumnWidth3, recA3.Y);
- Point pA33_2 = new Point(pA32_1.X + ColumnWidth3, recA3.Y + recA3.Height);
- g.DrawLine(p, pA33_1, pA33_2);//画第三表与第四列的界线
- string strPickupTime = "";
- if (tblPickupTime.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
- {
- strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
- }
- }
- Rectangle recA3_4 = new Rectangle(pA33_1.X + LeftAdd, pA33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(strPickupTime, ft12, b, recA3_4);//画第四列的列标题
- Point pA34_1 = new Point(pA33_1.X + ColumnWidth4, recA3.Y);
- Point pA34_2 = new Point(pA33_1.X + ColumnWidth4, recA3.Y + recA3.Height);
- g.DrawLine(p, pA34_1, pA34_2);//画第四表与第五列的界线
- #endregion
- #endregion
- #region 第七行
- Rectangle recA4 = new Rectangle(recA3.X, recA3.Y + recA3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA4);//画标题矩形
- Rectangle recA4_1 = new Rectangle(recA4.X + LeftAdd, recA4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片日期"), ft12, b, recA4_1);//画第一列的列标题
- Point pA41_1 = new Point(recA4.X + ColumnWidth1, recA4.Y);
- Point pA41_2 = new Point(recA4.X + ColumnWidth1, recA4.Y + recA4.Height);
- g.DrawLine(p, pA41_1, pA41_2);//画第一表与第二列的界线
- Rectangle recA4_2 = new Rectangle(pA41_1.X + LeftAdd, pA41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(FilmSelectionTime, ft12, b, recA4_2);//画第二列的列标题
- Point pA42_1 = new Point(pA41_1.X + ColumnWidth2, recA4.Y);
- Point pA42_2 = new Point(pA41_1.X + ColumnWidth2, recA4.Y + recA4.Height);
- g.DrawLine(p, pA42_1, pA42_2);//画第二表与第三列的界线
- Rectangle recA4_3 = new Rectangle(pA42_1.X + LeftAdd, pA42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("引导师"), ft12, b, recA4_3);//画第三列的列标题
- Point pA43_1 = new Point(pA42_1.X + ColumnWidth3, recA4.Y);
- Point pA43_2 = new Point(pA42_1.X + ColumnWidth3, recA4.Y + recA4.Height);
- g.DrawLine(p, pA43_1, pA43_2);//画第三表与第四列的界线
- Rectangle recA4_4 = new Rectangle(pA43_1.X + LeftAdd, pA43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(BootDivision, ft12, b, recA4_4);//画第四列的列标题
- #endregion
- #endregion
- #region 右排
- #region 第一行
- Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
- g.DrawRectangle(p, Rrec3);//画标题矩形
- Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
- Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
- Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
- g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
- Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tbl_Order.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
- #endregion
- #region 第二行
- Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec4);//画标题矩形
- Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
- Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
- Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
- g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
- Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tbl_Order.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
- #endregion
- #region 第三行
- Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec5);//画标题矩形
- Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft12, b, Rrec5_5);//画第五列的列标题
- Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
- Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
- g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
- Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
- #endregion
- #region 第四行
- Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec6);//画标题矩形
- Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
- Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
- Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
- g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
- Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(tbl_Order.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
- #endregion
- #region 第六行: 门市姓名和电话;
- Rectangle Rrec8 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec8);//画标题矩形
- Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft12, b, Rrec8_5);//画第五列的列标题
- Point Rp85_1 = new Point(Rp65_1.X, Rrec8.Y);
- Point Rp85_2 = new Point(Rp65_1.X, Rrec8.Y + Rrec8.Height);
- g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
- string strOrderPerson = "";
- Rectangle rec8_6 = new Rectangle(Rp85_1.X, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
- #endregion
- #region 第七行: 顾客会员卡号;
- Rectangle rcRow7 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, rcRow7);
- Rectangle rcRow7Cell1 = new Rectangle(rcRow7.X + LeftAdd, rcRow7.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("会员卡"), ft12, b, rcRow7Cell1);
- Point ptRow7CellTop = new Point(Rp85_1.X, rcRow7.Y);
- Point ptRow7CellBottom = new Point(Rp85_1.X, rcRow7.Y + rcRow7.Height);
- g.DrawLine(p, ptRow7CellTop, ptRow7CellBottom);
- Rectangle rcRow7Cell2 = new Rectangle(ptRow7CellTop.X, rcRow7Cell1.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(PMemberCardNumber, ft12, b, rcRow7Cell2);
- #endregion
- #region 第一列
- Rectangle Rrec10 = new Rectangle(rcRow7.X, rcRow7.Y + rcRow7.Height, Rrec3.Width, recA2.Y - rcRow7.Y);
- g.DrawRectangle(p, Rrec10);//画标题矩形
- StrValue = "";
- if (PrintOtherData.ContainsKey("儿童预约单注意事项说明") && PrintOtherData["儿童预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["儿童预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
- Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("儿童预约单注意事项字体大小"), minFontSize: 6);
- PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
- #endregion
- #region 顾客签字
- Rectangle RrecA5 = new Rectangle(Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2);
- g.DrawRectangle(p, RrecA5);//画标题矩形
- Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
- Point RpA51_1 = new Point(Rp65_1.X, RrecA5.Y);
- Point RpA51_2 = new Point(Rp65_1.X, RrecA5.Y + RrecA5.Height);
- g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
- #endregion
- #endregion
- #region 尾行
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA4.Y + recA4.Height + TopAdd, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, recA6_1);//画第一列的列标题
- Rectangle recA6 = new Rectangle(recA4.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
- Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("页:") + (iPage + 1) + "/" + pListData.Count;
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA8 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA7.Y + recA7.Height - TopAdd, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, recA8);//画第一列的列标题
- #endregion
- //bitmapDataList.Add(bitmap);
- }
- /// <summary>
- /// 获取儿童单的商品服务详情列表
- /// </summary>
- /// <param name="g1"></param>
- /// <param name="TableWidth"></param>
- /// <param name="tblProductList"></param>
- /// <param name="tblService"></param>
- /// <param name="tblSights"></param>
- /// <returns></returns>
- static List<List<string>> GetChildProductOrServiceListData(Graphics g1, List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot,
- int TableWidth, DataTable tblProductList, DataTable tblService, DataTable tblSights,DataTable tblIntoRB)
- {
- List<List<string>> pListData = new List<List<string>>();
- List<string> tempListData = new List<string>();
- float tempDataHight = 0;
- int Unit1 = TableWidth / 25;
- int ColumnWidth11 = Unit1 * 3;
- int ColumnWidth12 = Unit1 * 5;
- int ColumnWidth13 = Unit1 * 3;
- int ColumnWidth14 = Unit1 * 5;
- SizeF iSizef = new SizeF();
- int nIndex = 0;
- string strSights = "";
- int IntoRegisterQuantit = 0;
- int IntoBottomQuantity = 0;
- string StrIntoBottomQuantity = "";
- // 遍历成长次数;
- for (int i = 0; i < tblSights.Rows.Count; i++)
- {
- strSights = "";
- // 订单的入册总数;
- IntoRegisterQuantit = 0;
- // 订单的入底总数;
- IntoBottomQuantity = 0;
- StrIntoBottomQuantity = "0";
- if (listScenicSpot != null)
- {
- bool bViceExist = false;
- foreach (ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot)
- {
- if (scenic.strScenicName.Trim() == tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim())
- {
- bViceExist = true;
- // 订单的入册总数;
- IntoRegisterQuantit = Convert.ToInt32(tblIntoRB.Select("Ordv_ViceNumber = '" + scenic.strViceNumber + "'")[0][0].ToString());
- // 订单的入底总数;
- IntoBottomQuantity = Convert.ToInt32(tblIntoRB.Select("Ordv_ViceNumber = '" + scenic.strViceNumber + "'")[0][1].ToString());
- if (IntoBottomQuantity > 0)
- StrIntoBottomQuantity = IntoBottomQuantity.ToString();
- else if (IntoBottomQuantity == 0)
- StrIntoBottomQuantity = "不送";
- else
- StrIntoBottomQuantity = "全送";
- break;
- }
- }
- if (!bViceExist)
- continue;
- }
- nIndex++;
- if (i > 0)
- {
- strSights += "";
- }
- // 景点名称或成长名称;
- strSights += (nIndex) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- string FuZhuangString = "";
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- FuZhuangString = String.Format("服装:{0}套", tblSights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim());
- string RuDiRuCheString = "";
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- RuDiRuCheString = String.Format("入册:{0}, 入底:{1}", IntoRegisterQuantit, StrIntoBottomQuantity);
- if (!String.IsNullOrWhiteSpace(FuZhuangString) && !String.IsNullOrWhiteSpace(RuDiRuCheString))
- {
- strSights += string.Format("【{0},{1}】", RuDiRuCheString, FuZhuangString);
- }
- else if (!String.IsNullOrWhiteSpace(FuZhuangString))
- {
- strSights += string.Format("【{0}】", FuZhuangString);
- }
- else if (!String.IsNullOrWhiteSpace(RuDiRuCheString))
- {
- strSights += string.Format("【{0}】", RuDiRuCheString);
- }
- // strSights += string.Format( "【入册:{0}, 入底:{1}, 服装:{2}套】", IntoRegisterQuantit, StrIntoBottomQuantity, tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim() );
- // 景点备注或成长备注;
- //if (!string.IsNullOrEmpty(orderType) && orderType != "1")
- //{
- // if (!string.IsNullOrEmpty(tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim()))
- // {
- // strSights += " " + tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- // }
- //}
- //else
- //{
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim()))
- {
- strSights += " " + tblSights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
- }
- //}
- iSizef = g1.MeasureString(strSights,
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 440)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(strSights);
- //PrintContentData(strSights, g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- // 该成长次的商品记录;
- DataRow[] dtRowsA = tblProductList.Select("OPlist_ViceNumber = '" + tblSights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'");
- if (dtRowsA.Length > 0)
- {
- //strSights += "\r\n商品:";
- //PrintContentData(" 商品:", g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- iSizef = g1.MeasureString(" 商品:",
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 440)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" 商品:");
- for (int j = 0; j < dtRowsA.Length; j++)
- {
- //PrintContentData(" " + dtRowsA[j]["ProdName"].ToString().Trim(), g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- iSizef = g1.MeasureString(" " + dtRowsA[j]["ProdName"].ToString().Trim(),
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 440)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + dtRowsA[j]["ProdName"].ToString().Trim());
- //strSights += dtRowsA[j]["ProdName"].ToString().Trim();
- }
- }
- // 该成长次的服务记录;
- DataRow[] dtRowsB = tblService.Select("Ws_ViceNumber = '" + tblSights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'");
- if (dtRowsB.Length > 0)
- {
- //strSights += "\r\n服务:";
- //PrintContentData(" 服务:", g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- iSizef = g1.MeasureString("\r\n 服务:",
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 440)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add("\r\n 服务:");
- for (int j = 0; j < dtRowsB.Length; j++)
- {
- /* if (j > 0)
- { strSights += "\r\n"; }
- strSights += dtRowsB[j]["ProdName"].ToString().Trim();*/
- //PrintContentData(" " + dtRowsB[j]["ProdName"].ToString().Trim(), g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- iSizef = g1.MeasureString(" " + dtRowsB[j]["ProdName"].ToString().Trim(),
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 440)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + dtRowsB[j]["ProdName"].ToString().Trim());
- }
- }
- }
- if(tempListData.Count>0)
- {
- pListData.Add(tempListData);
- }
- return pListData;
- }
- static List<List<string>> GetChildProductOrServiceHalfListData(Graphics g1, List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot,
- int TableWidth, DataTable tblProductList, DataTable tblService, DataTable tblSights, DataTable tblIntoRB,string disInfo="")
- {
- List<List<string>> pListData = new List<List<string>>();
- List<string> tempListData = new List<string>();
- float tempDataHight = 0;
- int Unit1 = TableWidth / 25;
- int ColumnWidth11 = Unit1 * 3;
- int ColumnWidth12 = Unit1 * 5;
- int ColumnWidth13 = Unit1 * 3;
- int ColumnWidth14 = Unit1 * 5;
- SizeF iSizef = new SizeF();
- int nIndex = 0;
- string strSights = "";
- int IntoRegisterQuantit = 0;
- int IntoBottomQuantity = 0;
- string StrIntoBottomQuantity = "";
- // 遍历成长次数;
- for (int i = 0; i < tblSights.Rows.Count; i++)
- {
- strSights = "";
- // 订单的入册总数;
- IntoRegisterQuantit = 0;
- // 订单的入底总数;
- IntoBottomQuantity = 0;
- StrIntoBottomQuantity = "0";
- if (listScenicSpot != null)
- {
- bool bViceExist = false;
- foreach (ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot)
- {
- if (scenic.strScenicName.Trim() == tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim())
- {
- bViceExist = true;
- // 订单的入册总数;
- IntoRegisterQuantit = Convert.ToInt32(tblIntoRB.Select("Ordv_ViceNumber = '" + scenic.strViceNumber + "'")[0][0].ToString());
- // 订单的入底总数;
- IntoBottomQuantity = Convert.ToInt32(tblIntoRB.Select("Ordv_ViceNumber = '" + scenic.strViceNumber + "'")[0][1].ToString());
- if (IntoBottomQuantity > 0)
- StrIntoBottomQuantity = IntoBottomQuantity.ToString();
- else if (IntoBottomQuantity == 0)
- StrIntoBottomQuantity = "不送";
- else
- StrIntoBottomQuantity = "全送";
- break;
- }
- }
- if (!bViceExist)
- continue;
- }
- nIndex++;
- if (i > 0)
- {
- strSights += "";
- }
- // 景点名称或成长名称;
- strSights += (nIndex) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- string FuZhuangString = "";
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- FuZhuangString = String.Format("服装:{0}套", tblSights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim());
- string RuDiRuCheString = "";
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- RuDiRuCheString = String.Format("入册:{0}, 入底:{1}", IntoRegisterQuantit, StrIntoBottomQuantity);
- if (!String.IsNullOrWhiteSpace(FuZhuangString) && !String.IsNullOrWhiteSpace(RuDiRuCheString))
- {
- strSights += string.Format("【{0},{1}】", RuDiRuCheString, FuZhuangString);
- }
- else if (!String.IsNullOrWhiteSpace(FuZhuangString))
- {
- strSights += string.Format("【{0}】", FuZhuangString);
- }
- else if (!String.IsNullOrWhiteSpace(RuDiRuCheString))
- {
- strSights += string.Format("【{0}】", RuDiRuCheString);
- }
- // strSights += string.Format( "【入册:{0}, 入底:{1}, 服装:{2}套】", IntoRegisterQuantit, StrIntoBottomQuantity, tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim() );
- // 景点备注或成长备注;
- //if (!string.IsNullOrEmpty(orderType) && orderType != "1")
- //{
- // if (!string.IsNullOrEmpty(tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim()))
- // {
- // strSights += " " + tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- // }
- //}
- //else
- //{
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim()))
- {
- strSights += " " + tblSights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
- }
- //}
- iSizef = g1.MeasureString(strSights,
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 290)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(strSights);
- //PrintContentData(strSights, g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- // 该成长次的商品记录;
- DataRow[] dtRowsA = tblProductList.Select("OPlist_ViceNumber = '" + tblSights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'");
- if (dtRowsA.Length > 0)
- {
- //strSights += "\r\n商品:";
- //PrintContentData(" 商品:", g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- iSizef = g1.MeasureString(" 商品:",
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 290)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" 商品:");
- for (int j = 0; j < dtRowsA.Length; j++)
- {
- //PrintContentData(" " + dtRowsA[j]["ProdName"].ToString().Trim(), g, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- iSizef = g1.MeasureString(" " + dtRowsA[j]["ProdName"].ToString().Trim(),
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 290)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + dtRowsA[j]["ProdName"].ToString().Trim());
- //strSights += dtRowsA[j]["ProdName"].ToString().Trim();
- }
- }
- // 该成长次的服务记录;
- DataRow[] dtRowsB = tblService.Select("Ws_ViceNumber = '" + tblSights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'");
- if (dtRowsB.Length > 0)
- {
- //strSights += "\r\n服务:";
- //PrintContentData(" 服务:", g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- iSizef = g1.MeasureString("\r\n 服务:",
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 290)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add("\r\n 服务:");
- for (int j = 0; j < dtRowsB.Length; j++)
- {
- /* if (j > 0)
- { strSights += "\r\n"; }
- strSights += dtRowsB[j]["ProdName"].ToString().Trim();*/
- //PrintContentData(" " + dtRowsB[j]["ProdName"].ToString().Trim(), g1, rec9, LeftAdd, TopAdd, b, "儿童预约单内容详情字体大小", ref _infoHeight);
- iSizef = g1.MeasureString(" " + dtRowsB[j]["ProdName"].ToString().Trim(),
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 290)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + dtRowsB[j]["ProdName"].ToString().Trim());
- }
- }
- }
- if (!string.IsNullOrEmpty(disInfo))
- {
- iSizef = g1.MeasureString(" " + disInfo,
- GetFontSize("儿童预约单内容详情字体大小"), ColumnWidth11 + ColumnWidth12 + ColumnWidth13 + ColumnWidth14);
- tempDataHight += iSizef.Height;
- if (tempDataHight > 290)
- {
- pListData.Add(tempListData);
- tempListData = new List<string>();
- tempDataHight = 0;
- }
- tempListData.Add(" " + disInfo);
- }
- if (tempListData.Count > 0)
- {
- pListData.Add(tempListData);
- }
- return pListData;
- }
- /// <summary>
- /// 儿童二等份打印
- /// </summary>
- /// <param name="objValue"></param>
- /// 18-09-20 修改 杨
- private static void Child_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size, List<ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2> listScenicSpot
- , ref List<List<string>> pListData, int iPage)
- {
- DataTable tbl = dtSet.Tables["ds"];
- DataTable tbl_Order = dtSet.Tables["ds1"];
- DataTable tbl_Digital = dtSet.Tables["ds2"];
- DataTable tbl_Sights = dtSet.Tables["ds3"];
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//服务
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
- Hashtable htDataA = new Hashtable();
- Hashtable htDataB = new Hashtable();
- Hashtable htDataC = new Hashtable();
- for (int i = 0; i < tblIntoRB.Rows.Count; i++)
- {
- if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) > 0)
- {// 送部分;
- htDataA[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- else if (Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]) == 0)
- {// 不送;
- htDataB[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- else
- {// 全送;
- htDataC[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- }
- string IntoRegisterQuantitString = "";
- // 订单的入册总数;
- int IntoRegisterQuantit = 0;
- // 订单的入底总数;
- int IntoBottomQuantity = 0;
- string StrIntoBottomQuantity = "";
- bool IsSS = false;
- for (int i = 0; i < tblIntoRB.Rows.Count; i++)
- {
- if (listScenicSpot != null)
- {
- bool bViceExist = false;
- foreach (ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot)
- {
- if (scenic.strScenicName.Trim() == tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim())
- {
- bViceExist = true;
- break;
- }
- }
- if (!bViceExist)
- continue;
- }
- // 累加入册数量;
- IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
- // 本次入底数量;
- IntoBottomQuantity = Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
- if (IntoBottomQuantity > 0)
- StrIntoBottomQuantity += IntoBottomQuantity.ToString() + ",";
- else if (IntoBottomQuantity == 0)
- StrIntoBottomQuantity += "不送,";
- else
- StrIntoBottomQuantity += "全送,";
- }
- IntoRegisterQuantitString = IntoRegisterQuantit.ToString();
- StrIntoBottomQuantity = StrIntoBottomQuantity.TrimEnd(',');
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft17 = new Font("宋体", 17);
- Font ft13 = new Font("宋体", 13);
- Font ft10 = new Font("宋体", 10);
- Font ft9 = new Font("宋体", 9);
- #region 获取数据
- string PName = "";
- string PTelephone = "";
- string PMicroSignal = "";
- string PMemberCardNumber = "";
- string RName = "";
- string RBirthday = "";
- string RSex = "";
- string RAgeString = "";
- string StrAdderss = "";
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0")
- {
- PName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- PTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- PMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- DataTable tblMember = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + tblClient.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_CradNumber").Tables[0];
- if (tblMember.Rows.Count > 0)
- {
- PMemberCardNumber = tblMember.Rows[0]["Mc_CradNumber"].ToString();
- }
- if (tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "")
- {
- if (StrAdderss == "")
- {
- StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- else if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "0" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1")
- {
- RName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- RSex = tblClient.Rows[i]["Cus_Sex_cs"].ToString().Trim();
- RAgeString = tblClient.Rows[i]["Age_String"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_Birthday"], "yyyy-MM-dd", tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1") != "")
- {
- RBirthday = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_Birthday"], "yyyy-MM-dd", tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1");
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1")
- {
- RBirthday += LYFZ.BLL.OtherCommonModel.FontConversion("(农历)");
- }
- }
- if (tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "")
- {
- StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- int InnerSights = 0;
- int OuterSights = 0;
- string Photographer = "";
- string MakeupArtist = "";
- string PhotographyTime = "";
- string BootDivision = "";
- for (int i = 0; i < tbl_Sights.Rows.Count; i++)
- {
- if (tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
- {
- OuterSights += Convert.ToInt32(tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- else if (tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
- {
- InnerSights += Convert.ToInt32(tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- if (tbl_Sights.Rows[i]["Ordpg_Photographer"].ToString().Trim() != "")
- {
- Photographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_Photographer"]);
- }
- if (tbl_Sights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim() != "")
- {
- MakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_MakeupArtist"]);
- }
- if (tbl_Sights.Rows[i]["Ordpg_BootDivision"].ToString().Trim() != "")
- {
- BootDivision = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tbl_Sights.Rows[i]["Ordpg_BootDivision"]);
- }
- if (!string.IsNullOrEmpty(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString()))
- {
- if (PhotographyTime != "")
- {
- if (Convert.ToDateTime(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(PhotographyTime))
- {
- PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString2(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- }
- else
- {
- PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString2(tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- }
- }
- string FilmSelectionTime = "";
- if (tbl_Digital.Rows.Count > 0)
- {
- FilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString2(tbl_Digital.Rows[0]["Ordv_FilmSelectionTime"]);
- }
- int nIndex = 1;
- string strSights = "";
- string orderType = Convert.ToString(tbl_Order.Rows[0]["Ord_Type"]);
- string strIntoBottomQuantity = "";
- // 遍历成长阶段;
- //for ( int i = 0; i < tbl_Sights.Rows.Count; i++ )
- //{
- // #region 按选择阶段来打印;
- // // 订单的入册总数;
- // IntoRegisterQuantit = 0;
- // // 订单的入底总数;
- // IntoBottomQuantity = 0;
- // strIntoBottomQuantity = "0";
- // if ( listScenicSpot != null )
- // {
- // bool bViceExist = false;
- // foreach ( ReportPrint.SetSmallForm.PrintPreviewSmallForm.ScenicSpot2 scenic in listScenicSpot )
- // {
- // if ( scenic.strScenicName.Trim() == tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim() )
- // {
- // bViceExist = true;
- // // 订单的入册总数;
- // IntoRegisterQuantit = Convert.ToInt32( tblIntoRB.Select( "Ordv_ViceNumber = '" + scenic.strViceNumber + "'" )[0][0].ToString() );
- // // 订单的入底总数;
- // IntoBottomQuantity = Convert.ToInt32( tblIntoRB.Select( "Ordv_ViceNumber = '" + scenic.strViceNumber + "'" )[0][1].ToString() );
- // if ( IntoBottomQuantity > 0 )
- // strIntoBottomQuantity = IntoBottomQuantity.ToString();
- // else if ( IntoBottomQuantity == 0 )
- // strIntoBottomQuantity = "不送";
- // else
- // strIntoBottomQuantity = "全送";
- // break;
- // }
- // }
- // if ( !bViceExist )
- // continue;
- // }
- // #endregion
- // if ( i > 0 )
- // {
- // strSights += "\r\n";
- // }
- // // 景点名称或成长名称;
- // strSights += (nIndex++) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- // string FuZhuangString = "";
- // if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- // FuZhuangString = String.Format("服装:{0}套", tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim());
- // string RuDiRuCheString = "";
- // if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- // RuDiRuCheString = String.Format("入册:{0}, 入底:{1}", IntoRegisterQuantit, strIntoBottomQuantity);
- // if (!String.IsNullOrWhiteSpace(FuZhuangString) && !String.IsNullOrWhiteSpace(RuDiRuCheString))
- // {
- // strSights += string.Format("【{0},{1}】", RuDiRuCheString, FuZhuangString);
- // }
- // else if (!String.IsNullOrWhiteSpace(FuZhuangString))
- // {
- // strSights += string.Format("【{0}】", FuZhuangString);
- // }
- // else if (!String.IsNullOrWhiteSpace(RuDiRuCheString))
- // {
- // strSights += string.Format("【{0}】", RuDiRuCheString);
- // }
- // // strSights += string.Format( "【入册:{0}, 入底:{1}, 服装:{2}套】", IntoRegisterQuantit, strIntoBottomQuantity, tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"].ToString().Trim() );
- // //strSights += (nIndex++) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- // // 景点备注或成长备注;
- // if ( !string.IsNullOrEmpty( orderType ) && orderType != "1" )
- // {
- // if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim() ) )
- // {
- // strSights += " " + tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- // }
- // }
- // else
- // {
- // if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim() ) )
- // {
- // strSights += " " + tbl_Sights.Rows[i]["Ordpg_OpenOrderRemark"].ToString().Trim();
- // }
- // }
- // DataRow[] dtRowsA = tblProductList.Select( "OPlist_ViceNumber = '" + tbl_Sights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'" );
- // if ( dtRowsA.Length > 0 )
- // {
- // strSights += "\r\n商品:";
- // for ( int j = 0; j < dtRowsA.Length; j++ )
- // {
- // if ( j > 0 )
- // {
- // strSights += "\r\n";
- // }
- // strSights += dtRowsA[j]["ProdName"].ToString().Trim();
- // }
- // }
- // DataRow[] dtRowsB = tblService.Select( "Ws_ViceNumber = '" + tbl_Sights.Rows[i]["Ordpg_ViceNumber"].ToString().Trim() + "'" );
- // if ( dtRowsB.Length > 0 )
- // {
- // strSights += "\r\n服务:";
- // for ( int j = 0; j < dtRowsB.Length; j++ )
- // {
- // if ( j > 0 )
- // {
- // strSights += "\r\n";
- // }
- // strSights += dtRowsB[j]["ProdName"].ToString().Trim();
- // }
- // }
- //}
- //strSights += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tbl_Order.Rows[0]["Ord_Remark"].ToString();
- //strSights = strSights.Replace("Null\r\n", "\r\n");
- if (pListData.Count == 0)
- {
- pListData = new List<List<string>>();
- pListData = GetChildProductOrServiceHalfListData(g1, listScenicSpot, TableWidth, tblProductList, tblService, tbl_Sights, tblIntoRB, LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tbl_Order.Rows[0]["Ord_Remark"].ToString());
- }
- #endregion
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 20;
- int RowContentHeight = 18;
- int Unit = TableWidth / 32;
- int ColumnWidth1 = Unit * 3;
- int ColumnWidth2 = Unit * 4;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 4;
- int ColumnWidth5 = Unit * 2;
- int ColumnWidth6 = Unit * 4;
- int ColumnWidth7 = Unit * 3;
- int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
- string StrValue = tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tbl_Order.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom(StrValue);
- string strNumber = rec3Value;
- List<string> dataList = pListData[iPage];
- strSights = "";
- foreach (string str in dataList)
- {
- if (strSights != "")
- {
- strSights += "\r\n";
- }
- strSights += str;
- }
- //Bitmap bitmap = new Bitmap(827, 1150);
- Graphics g = g1;//Graphics.FromImage(bitmap);
- #region 金色童年收据凭据
- Rectangle rec1;
- int Rec1Height = 0;
- int TopHeightCount = 0;
- Image imgLog = CachePhoto(PhotoLogType.Child, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约儿童单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约儿童单标题", ft17).Height);
- TopHeightCount = 3;
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约儿童单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- }
- #endregion
- #region 家长、联系
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion("家长姓名:") + PName + LYFZ.BLL.OtherCommonModel.FontConversion(" 联系电话:") + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(PTelephone);
- SizeF sizef = g.MeasureString(StrAddress, ft10);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);//(panlImage.Width / 2) - (FtWidth / 2), rec2.Y + rec2.Height
- g.DrawString(StrAddress, ft10, b, rec2);
- #endregion
- #region 开单日期;
- string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tbl_Order.Rows[0]["Ord_CreateDatetime"]);
- sizef = g.MeasureString(strOrderCreatedData, ft10);
- Rectangle rec1A = new Rectangle(rec2.Right + 10, rec2.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
- g.DrawString(strOrderCreatedData, ft10, b, rec1A);
- #endregion
- #region NO.
- sizef = g.MeasureString(strNumber, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- rec1A = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Top, FtWidth, Convert.ToInt32(sizef.Height));
- g.DrawString(strNumber, ft10, b, rec1A);
- #endregion
- #region 第一行
- Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, TableWidth, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("宝贝姓名");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 3, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(RName, ft9, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 3, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("性别"), ft9, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(RSex, ft9, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
- Rectangle rec3_5 = new Rectangle(p34_1.X + LeftAdd * 3, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("年龄"), ft9, b, rec3_5);//画第三列的列标题
- Point p35_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
- Point p35_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
- g.DrawLine(p, p35_1, p35_2);//画第三表与第四列的界线
- Rectangle rec3_6 = new Rectangle(p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- g.DrawString(RAgeString, ft9, b, rec3_6);//画第四列的列标题
- Point p36_1 = new Point(p35_1.X + ColumnWidth6, rec3.Y);
- Point p36_2 = new Point(p35_1.X + ColumnWidth6, rec3.Y + rec3.Height);
- g.DrawLine(p, p36_1, p36_2);//画第二表与第三列的界线
- Rectangle rec3_7 = new Rectangle(p36_1.X + LeftAdd * 3, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("宝贝生日"), ft9, b, rec3_7);//画第三列的列标题
- Point p37_1 = new Point(p36_1.X + ColumnWidth7, rec3.Y);
- Point p37_2 = new Point(p36_1.X + ColumnWidth7, rec3.Y + rec3.Height);
- g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
- Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(RBirthday, ft9, b, rec3_8);//画第四列的列标题
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 3, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(tbl_Order.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 3, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(OrdPrice, ft9, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
- Rectangle rec4_5 = new Rectangle(p44_1.X + LeftAdd * 3, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_5);//画第三列的列标题
- Point p45_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
- Point p45_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
- g.DrawLine(p, p45_1, p45_2);//画第三表与第四列的界线
- Rectangle rec4_6 = new Rectangle(p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(tbl_Order.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6);//画第四列的列标题
- Point p46_1 = new Point(p45_1.X + ColumnWidth6, rec4.Y);
- Point p46_2 = new Point(p45_1.X + ColumnWidth6, rec4.Y + rec4.Height);
- g.DrawLine(p, p46_1, p46_2);//画第二表与第三列的界线
- Rectangle rec4_7 = new Rectangle(p46_1.X + LeftAdd * 3, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec4_7);//画第三列的列标题
- Point p47_1 = new Point(p46_1.X + ColumnWidth7, rec4.Y);
- Point p47_2 = new Point(p46_1.X + ColumnWidth7, rec4.Y + rec4.Height);
- g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
- Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(tbl_Order.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec4_8);//画第四列的列标题
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 3, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("会员卡号"), ft9, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(PMemberCardNumber, ft9, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
- Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd * 3, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec5_3);//画第一列的列标题
- Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
- Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
- g.DrawLine(p, p53_1, p53_2);//画第一表与第二列的界线
- Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(IntoRegisterQuantitString.ToString().Trim(), ft9, b, rec5_4);//画第二列的列标题
- Point p54_1 = new Point(p43_1.X + ColumnWidth4, rec5.Y);
- Point p54_2 = new Point(p43_1.X + ColumnWidth4, rec5.Y + rec5.Height);
- g.DrawLine(p, p54_1, p54_2);//画第二表与第三列的界线
- Rectangle rec5_5 = new Rectangle(p54_1.X + LeftAdd * 3, p54_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec5_5);//画第三列的列标题
- Point p55_1 = new Point(p54_1.X + ColumnWidth5, rec5.Y);
- Point p55_2 = new Point(p54_1.X + ColumnWidth5, rec5.Y + rec5.Height);
- g.DrawLine(p, p55_1, p55_2);//画第三表与第四列的界线
- Rectangle rec5_6 = new Rectangle(p55_1.X + LeftAdd, p55_1.Y + TopAdd, ColumnWidth6, RowContentHeight - 6);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(StrIntoBottomQuantity, ft9, b, rec5_6);//画第四列的列标题
- Point p56_1 = new Point(p55_1.X + ColumnWidth6, rec5.Y);
- Point p56_2 = new Point(p55_1.X + ColumnWidth6, rec5.Y + rec5.Height);
- g.DrawLine(p, p56_1, p56_2);//画第二表与第三列的界线
- Rectangle rec5_7 = new Rectangle(p56_1.X + LeftAdd * 7, p56_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门 市"), ft9, b, rec5_7);//画第三列的列标题
- Point p57_1 = new Point(p56_1.X + ColumnWidth7, rec5.Y);
- Point p57_2 = new Point(p56_1.X + ColumnWidth7, rec5.Y + rec5.Height);
- g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
- Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
- #endregion
- #region 第三四行
- Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5A);//画标题矩形
- Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装"), ft9, b, rec5A_1);//画第一列的列标题
- Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
- Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
- Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(InnerSights.ToString().Trim(), ft9, b, rec5A_2);//画第二列的列标题
- Point p5A2_1 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y);
- Point p5A2_2 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A2_1, p5A2_2);//画第二表与第三列的界线
- Rectangle rec5A_3 = new Rectangle(p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装"), ft9, b, rec5A_3);//画第一列的列标题
- Point p5A3_1 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y);
- Point p5A3_2 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A3_1, p5A3_2);//画第一表与第二列的界线
- Rectangle rec5A_4 = new Rectangle(p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(OuterSights.ToString().Trim(), ft9, b, rec5A_4);//画第二列的列标题
- Point p5A4_1 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y);
- Point p5A4_2 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A4_1, p5A4_2);//画第二表与第三列的界线
- Rectangle rec5A_5 = new Rectangle(p5A4_1.X + LeftAdd * 3, p5A4_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_5);//画第三列的列标题
- Point p5A5_1 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y);
- Point p5A5_2 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A5_1, p5A5_2);//画第三表与第四列的界线
- Rectangle rec5A_6 = new Rectangle(p5A5_1.X + LeftAdd, p5A5_1.Y + TopAdd, ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowContentHeight);
- g.DrawString(StrAdderss, ft9, b, rec5A_6);//画第四列的列标题
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle(rec5A.X, rec5A.Y + rec5A.Height, TableWidth, 315 - Rec1Height - LeftWidth);
- g.DrawRectangle(p, rec6);//画标题矩形
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("套系内容");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height) + 1;
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
- g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
- Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, TableWidth - ColumnWidth8 - ColumnWidth7 - (ColumnWidth1 / 2) - rec6_1.Width, rec6.Height - TopAdd * 2);
- g.DrawString(strSights, GetFontSize("儿童预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
- Point p62_1 = new Point(p61_1.X + rec6_2.Width, rec6.Y);
- Point p62_2 = new Point(p61_1.X + rec6_2.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- StrValue = "";
- if (PrintOtherData.ContainsKey("儿童预约单注意事项说明") && PrintOtherData["儿童预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["儿童预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec6_3 = new Rectangle(rec6_2.X + rec6_2.Width + LeftAdd, rec6_1.Y, rec6_1.Width, rec6_1.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec6_3);//画第三列的列标题
- Point p63_1 = new Point(p62_1.X + rec6_3.Width, rec6.Y);
- Point p63_2 = new Point(p62_1.X + rec6_3.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth8 + ColumnWidth7 + (ColumnWidth1 / 2) - rec6_3.Width, rec6.Height - TopAdd * 2);
- g.DrawString(StrValue, GetFontSize("儿童预约单注意事项字体大小"), b, rec6_4);//画第四列的列标题
- #endregion
- #region 第六行
- int SWidth = TableWidth / 8;
- Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, TableWidth, RowHeight);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd * 4, rec7.Y + TopAdd, SWidth - SWidth / 3 + 5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft9, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + rec7_1.Width, rec7.Y);
- Point p71_2 = new Point(rec7.X + rec7_1.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, SWidth, RowContentHeight);
- g.DrawString(Photographer, ft9, b, rec7_2);//画第六列的列标题
- Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
- Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p72_1, p72_2);//画第一表与第二列的界线
- Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd * 4, p72_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft9, b, rec7_3);//画第一列的列标题
- Point p73_1 = new Point(p72_1.X + rec7_3.Width, rec7.Y);
- Point p73_2 = new Point(p72_1.X + rec7_3.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p73_1, p73_2);//画第一表与第二列的界线
- Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
- g.DrawString(MakeupArtist.Trim(), ft9, b, rec7_4);//画第六列的列标题
- Point p74_1 = new Point(p73_1.X + rec7_4.Width, rec7.Y);
- Point p74_2 = new Point(p73_1.X + rec7_4.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p74_1, p74_2);//画第一表与第二列的界线
- Rectangle rec7_5 = new Rectangle(p74_1.X + LeftAdd * 2, p74_1.Y + TopAdd, rec7_3.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍照时间"), ft9, b, rec7_5);//画第一列的列标题
- Point p75_1 = new Point(p74_1.X + rec7_5.Width, rec7.Y);
- Point p75_2 = new Point(p74_1.X + rec7_5.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p75_1, p75_2);//画第一表与第二列的界线
- Rectangle rec7_6 = new Rectangle(p75_1.X + LeftAdd, p75_1.Y + TopAdd, rec7_4.Width + 30, RowContentHeight);
- g.DrawString(PhotographyTime.Trim(), ft9, b, rec7_6);//画第六列的列标题
- Point p76_1 = new Point(p75_1.X + rec7_6.Width, rec7.Y);
- Point p76_2 = new Point(p75_1.X + rec7_6.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p76_1, p76_2);//画第一表与第二列的界线
- Rectangle rec7_7 = new Rectangle(p76_1.X + LeftAdd * 2, p76_1.Y + TopAdd, rec7_5.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片时间"), ft9, b, rec7_7);//画第一列的列标题
- Point p77_1 = new Point(p76_1.X + rec7_7.Width, rec7.Y);
- Point p77_2 = new Point(p76_1.X + rec7_7.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p77_1, p77_2);//画第一表与第二列的界线
- Rectangle rec7_8 = new Rectangle(p77_1.X + LeftAdd, p77_1.Y + TopAdd, rec7_6.Width, RowContentHeight);
- g.DrawString(FilmSelectionTime, ft9, b, rec7_2);//画第六列的列标题
- #endregion
- #region 第七行
- Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, TableWidth, RowHeight);
- g.DrawRectangle(p, rec8);//画标题矩形
- Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd * 4, rec8.Y + TopAdd, rec7_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("引导师"), ft9, b, rec8_1);//画第一列的列标题
- Point p81_1 = new Point(rec8.X + rec7_1.Width, rec8.Y);
- Point p81_2 = new Point(rec8.X + rec7_1.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
- Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, SWidth, RowContentHeight);
- g.DrawString(BootDivision, ft9, b, rec8_2);//画第六列的列标题
- Point p82_1 = new Point(p81_1.X + rec8_2.Width, rec8.Y);
- Point p82_2 = new Point(p81_1.X + rec8_2.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p82_1, p82_2);//画第一表与第二列的界线
- Rectangle rec8_3 = new Rectangle(p82_1.X + LeftAdd * 4, p82_1.Y + TopAdd, rec8_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("设计师"), ft9, b, rec8_3);//画第一列的列标题
- Point p83_1 = new Point(p82_1.X + rec8_3.Width, rec8.Y);
- Point p83_2 = new Point(p82_1.X + rec8_3.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p83_1, p83_2);//画第一表与第二列的界线
- Rectangle rec8_4 = new Rectangle(p83_1.X + LeftAdd, p83_1.Y + TopAdd, rec8_2.Width, RowContentHeight);
- g.DrawString("", ft9, b, rec8_4);//画第六列的列标题
- Point p84_1 = new Point(p83_1.X + rec8_4.Width, rec8.Y);
- Point p84_2 = new Point(p83_1.X + rec8_4.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p84_1, p84_2);//画第一表与第二列的界线
- Rectangle rec8_5 = new Rectangle(p84_1.X + LeftAdd * 2, p84_1.Y + TopAdd, rec8_3.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件时间"), ft9, b, rec8_5);//画第一列的列标题
- Point p85_1 = new Point(p84_1.X + rec8_5.Width, rec8.Y);
- Point p85_2 = new Point(p84_1.X + rec8_5.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p85_1, p85_2);//画第一表与第二列的界线
- string strPickupTime = "";
- if (tblPickupTime.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
- {
- strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
- }
- }
- Rectangle rec8_6 = new Rectangle(p85_1.X + LeftAdd, p85_1.Y + TopAdd, rec8_4.Width + 30, RowContentHeight);
- g.DrawString(strPickupTime, ft9, b, rec8_6);//画第六列的列标题
- Point p86_1 = new Point(p85_1.X + rec8_6.Width, rec8.Y);
- Point p86_2 = new Point(p85_1.X + rec8_6.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p86_1, p86_2);//画第一表与第二列的界线
- Rectangle rec8_7 = new Rectangle(p86_1.X + LeftAdd * 2, p86_1.Y + TopAdd, rec8_5.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8_7);//画第一列的列标题
- Point p87_1 = new Point(p86_1.X + rec8_7.Width, rec8.Y);
- Point p87_2 = new Point(p86_1.X + rec8_7.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p87_1, p87_2);//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle(p87_1.X + LeftAdd, p87_1.Y + TopAdd, rec8_6.Width, RowContentHeight);
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec7.X + LeftAdd * 3 + 8, rec8A_2.Y + TopAdd * 5 + 2);//画第一列的列标题
- g.DrawLine(p, rec7.X, p87_1.Y, rec7.X, p87_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X + ColumnWidth1 - 1, p87_1.Y, rec7.X + ColumnWidth1 - 1, p87_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X + TableWidth, p87_1.Y, rec7.X + TableWidth, p87_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X, p87_2.Y + rec8A_2.Height + 5, rec7.X + TableWidth, p87_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- rec8A_2.Height += 10;
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec7.X + LeftAdd * 22 + 2, rec8A_2.Y + TopAdd * 5 + 2);//画第一列的列标题
- }
- else
- {
- rec8A_2.Height = 0;
- }
- #endregion
- #region 尾行
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec8.Y + rec8.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9 = new Rectangle(rec8.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
- #endregion
- //bitmapDataList.Add(bitmap);
- }
- /// <summary>
- /// 订单报表儿童版()
- /// </summary>
- /// <returns></returns>
- private static void Child_OrderReport_Print_Back( DataSet dtSet, Graphics g, Size size )
- {
- int LeftWidth = 30;
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int TableWidth = size.Width - LeftWidth * 2;
- DataTable tbl = dtSet.Tables["ds"];
- DataTable tbl_Order = dtSet.Tables["ds1"];
- DataTable tbl_Digital = dtSet.Tables["ds2"];
- DataTable tbl_Sights = dtSet.Tables["ds3"];
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//服务
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单主接单人
- string OrdPrice = "0.00";
- if ( tblPayment.Rows.Count > 0 )
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- //获取影楼信息
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
- Hashtable htDataA = new Hashtable();
- Hashtable htDataB = new Hashtable();
- Hashtable htDataC = new Hashtable();
- for ( int i = 0; i < tblIntoRB.Rows.Count; i++ )
- {
- if ( Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] ) > 0 )
- {
- htDataA[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- else if ( Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] ) == 0 )
- {
- htDataB[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- else
- {
- htDataC[tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]] = tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"];
- }
- }
- int IntoRegisterQuantit = 0;
- int IntoBottomQuantity = 0;
- string StrIntoBottomQuantity = "";
- bool IsSS = false;
- for ( int i = 0; i < tblIntoRB.Rows.Count; i++ )
- {
- IntoRegisterQuantit += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"] );
- if ( tblIntoRB.Rows.Count > 0 )
- {
- if ( (htDataA.Count > 0 && htDataB.Count > 0) || (htDataA.Count > 0 && htDataC.Count > 0) || (htDataB.Count > 0 && htDataC.Count > 0) )
- {
- if ( Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] ) > 0 )
- {
- StrIntoBottomQuantity += tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"].ToString().Trim() + ",";
- }
- else if ( Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] ) == 0 )
- {
- StrIntoBottomQuantity += "不送,";
- }
- else
- {
- StrIntoBottomQuantity += "全送,";
- }
- IsSS = true;
- }
- else
- {
- IntoBottomQuantity += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] );
- }
- }
- else
- {
- IntoBottomQuantity += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] );
- }
- }
- if ( !IsSS )
- {
- if ( IntoBottomQuantity > 0 )
- {
- StrIntoBottomQuantity = IntoBottomQuantity.ToString();
- }
- else if ( IntoBottomQuantity == 0 )
- {
- StrIntoBottomQuantity = "不送";
- }
- else
- {
- StrIntoBottomQuantity = "全送";
- }
- }
- StrIntoBottomQuantity = StrIntoBottomQuantity.TrimEnd( ',' );
- #region 获取数据
- string PName = "";
- string PTelephone = "";
- string PIDNumber = "";
- string PMicroSignal = "";
- string PQQ = "";
- string PAddress = "";
- string RName = "";
- string RBirthday = "";
- string RSex = "";
- string RAgeString = "";
- for ( int i = 0; i < tblClient.Rows.Count; i++ )
- {
- if ( tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0" )
- {
- PName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- PTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- PIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- PMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- PQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- PAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- else if ( tblClient.Rows[i]["GM_Master"].ToString().Trim() == "0" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" )
- {
- RName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- RSex = tblClient.Rows[i]["Cus_Sex_cs"].ToString().Trim();
- RAgeString = tblClient.Rows[i]["Age_String"].ToString().Trim();
- if ( LYFZ.Command.Command_Validate.DateTimeToString( tblClient.Rows[i]["Cus_Birthday"] ) != "" )
- {
- RBirthday = LYFZ.Command.Command_Validate.DateTimeToString( tblClient.Rows[i]["Cus_Birthday"] );
- if ( !string.IsNullOrEmpty( tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() ) && tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1" )
- {
- RBirthday += LYFZ.BLL.OtherCommonModel.FontConversion( "(农历)" );
- }
- }
- }
- }
- int InnerSights = 0;
- int OuterSights = 0;
- string strSights = LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄名称:\r\n" );
- string Photographer = "";
- string MakeupArtist = "";
- string PhotographyTime = "";
- string BootDivision = "";
- for ( int i = 0; i < tbl_Sights.Rows.Count; i++ )
- {
- if ( tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1" )
- {
- OuterSights += Convert.ToInt32( tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"] );
- }
- else if ( tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0" )
- {
- InnerSights += Convert.ToInt32( tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"] );
- }
- strSights += (i + 1) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- strSights += tbl_Sights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- strSights += "\r\n";
- if ( tbl_Sights.Rows[i]["Ordpg_Photographer"].ToString().Trim() != "" )
- {
- Photographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_Photographer"] );
- }
- if ( tbl_Sights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim() != "" )
- {
- MakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_MakeupArtist"] );
- }
- if ( tbl_Sights.Rows[i]["Ordpg_BootDivision"].ToString().Trim() != "" )
- {
- BootDivision = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_BootDivision"] );
- }
- if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString() ) )
- {
- if ( PhotographyTime != "" )
- {
- if ( Convert.ToDateTime( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] ) < Convert.ToDateTime( PhotographyTime ) )
- {
- PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] );
- }
- }
- else
- {
- PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] );
- }
- }
- }
- string FilmSelectionTime = "";
- if ( tbl_Digital.Rows.Count > 0 )
- {
- FilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Digital.Rows[0]["Ordv_FilmSelectionTime"] );
- }
- #endregion
- Font ft17 = new Font( "宋体", 17 );
- Font ft12 = new Font( "宋体", 12 );
- Font ft9 = new Font( "宋体", 9 );
- #region LOG抬头
- int Rec1Height = 0;
- Rectangle rec1;
- Image imgLog = CachePhoto( PhotoLogType.Child, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG( "预约儿童单LOG" ) );
- if ( imgLog != null )
- {
- rec1 = new Rectangle( LeftWidth, 50, TableWidth, 120 );
- Rectangle srcRec1 = new Rectangle( 0, 0, imgLog.Width, imgLog.Height );
- g.DrawImage( imgLog, rec1, srcRec1, GraphicsUnit.Pixel );
- }
- else
- {
- string StrTitle = GetReservationSingleTitle( "预约儿童单标题" );
- SizeF srcsizef = g.MeasureString( StrTitle, ft17 );
- int srcFtWidth = Convert.ToInt32( srcsizef.Width );
- int srcFtHeight = Convert.ToInt32( srcsizef.Height );
- rec1 = new Rectangle( size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight );
- g.DrawString( StrTitle, ft17, b, rec1 );
- Rec1Height = 120 - rec1.Height;
- }
- #endregion
- int LeftAdd = 3;
- int TopAdd = 6;
- int RowHeight = 25;
- int RowContentHeight = 18;
- int Unit = TableWidth / 25;
- int ColumnWidth1 = Unit * 3;
- int ColumnWidth2 = Unit * 5;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 5;
- int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
- int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- #region 始行
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "开单日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( tbl_Order.Rows[0]["Ord_CreateDateTime"], "yyyy-MM-dd HH:mm" ), ft12, b, rec2 );
- string StrValue = tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tbl_Order.Rows[0]["Ord_Number"].ToString().Trim();
- StrValue = "NO." + StrRandom( StrValue );
- SizeF sizef = g.MeasureString( StrValue, ft12 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_1 = new Rectangle( TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight );
- g.DrawString( StrValue, ft12, b, rec2_1 );
- #endregion
- #region 左排
- #region 第一行
- Rectangle rec3 = new Rectangle( rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight );
- g.DrawRectangle( p, rec3 );//画标题矩形
- Rectangle rec3_1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝姓名" ), ft12, b, rec3_1 );//画第一列的列标题
- Point p31_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
- Point p31_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
- g.DrawLine( p, p31_1, p31_2 );//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle( p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( RName, ft12, b, rec3_2 );//画第二列的列标题
- Point p32_1 = new Point( p31_1.X + ColumnWidth2, rec3.Y );
- Point p32_2 = new Point( p31_1.X + ColumnWidth2, rec3.Y + rec3.Height );
- g.DrawLine( p, p32_1, p32_2 );//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle( p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "家长姓名" ), ft12, b, rec3_3 );//画第三列的列标题
- Point p33_1 = new Point( p32_1.X + ColumnWidth3, rec3.Y );
- Point p33_2 = new Point( p32_1.X + ColumnWidth3, rec3.Y + rec3.Height );
- g.DrawLine( p, p33_1, p33_2 );//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle( p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( PName, ft12, b, rec3_4 );//画第四列的列标题
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle( rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec4 );//画标题矩形
- Rectangle rec4_1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝生日" ), ft12, b, rec4_1 );//画第一列的列标题
- Point p41_1 = new Point( rec4.X + ColumnWidth1, rec4.Y );
- Point p41_2 = new Point( rec4.X + ColumnWidth1, rec4.Y + rec4.Height );
- g.DrawLine( p, p41_1, p41_2 );//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle( p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( RBirthday, ft12, b, rec4_2 );//画第二列的列标题
- Point p42_1 = new Point( p41_1.X + ColumnWidth2, rec4.Y );
- Point p42_2 = new Point( p41_1.X + ColumnWidth2, rec4.Y + rec4.Height );
- g.DrawLine( p, p42_1, p42_2 );//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle( p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话" ), ft12, b, rec4_3 );//画第三列的列标题
- Point p43_1 = new Point( p42_1.X + ColumnWidth3, rec4.Y );
- Point p43_2 = new Point( p42_1.X + ColumnWidth3, rec4.Y + rec4.Height );
- g.DrawLine( p, p43_1, p43_2 );//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle( p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( PTelephone ), ft12, b, rec4_4 );//画第四列的列标题
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec5 );//画标题矩形
- Rectangle rec5_1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "性别" ), ft12, b, rec5_1 );//画第一列的列标题
- Point p51_1 = new Point( rec5.X + ColumnWidth1 / 2, rec5.Y );
- Point p51_2 = new Point( rec5.X + ColumnWidth1 / 2, rec5.Y + rec5.Height );
- g.DrawLine( p, p51_1, p51_2 );//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle( p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( RSex, ft12, b, rec5_2 );//画第二列的列标题
- Point p52_1 = new Point( p41_1.X, rec5.Y );
- Point p52_2 = new Point( p41_1.X, rec5.Y + rec5.Height );
- g.DrawLine( p, p52_1, p52_2 );//画第二表与第三列的界线
- Rectangle rec5A_1 = new Rectangle( p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "年龄" ), ft12, b, rec5A_1 );//画第一列的列标题
- Point p51A_1 = new Point( p52_1.X + ColumnWidth1 / 2, rec5.Y );
- Point p51A_2 = new Point( p52_1.X + ColumnWidth1 / 2, rec5.Y + rec5.Height );
- g.DrawLine( p, p51A_1, p51A_2 );//画第一表与第二列的界线
- Rectangle rec5A_2 = new Rectangle( p51A_1.X + LeftAdd, p51A_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( RAgeString, ft12, b, rec5A_2 );//画第二列的列标题
- Point p52A_1 = new Point( p42_1.X, rec5.Y );
- Point p52A_2 = new Point( p42_1.X, rec5.Y + rec5.Height );
- g.DrawLine( p, p52A_1, p52A_2 );//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle( p52A_1.X + LeftAdd, p52A_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "微信" ), ft12, b, rec5_3 );//画第三列的列标题
- Point p53_1 = new Point( p52A_1.X + ColumnWidth3, rec5.Y );
- Point p53_2 = new Point( p52A_1.X + ColumnWidth3, rec5.Y + rec5.Height );
- g.DrawLine( p, p53_1, p53_2 );//画第三表与第四列的界线
- Rectangle rec5_4 = new Rectangle( p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( PMicroSignal, ft12, b, rec5_4 );//画第四列的列标题
- #endregion
- #region 第四行
- int rec5_Y = rec4.Y + rec4.Height;
- int rec9Height = 0;
- if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber )
- {
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec6 );//画标题矩形
- Rectangle rec6_1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入册" ), ft12, b, rec6_1 );//画第一列的列标题
- Point p61_1 = new Point( rec6.X + ColumnWidth1, rec6.Y );
- Point p61_2 = new Point( rec6.X + ColumnWidth1, rec6.Y + rec6.Height );
- g.DrawLine( p, p61_1, p61_2 );//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle( p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( IntoRegisterQuantit.ToString().Trim(), ft12, b, rec6_2 );//画第二列的列标题
- Point p62_1 = new Point( p61_1.X + ColumnWidth2, rec6.Y );
- Point p62_2 = new Point( p61_1.X + ColumnWidth2, rec6.Y + rec6.Height );
- g.DrawLine( p, p62_1, p62_2 );//画第二表与第三列的界线
- Rectangle rec6_3 = new Rectangle( p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( "QQ", ft12, b, rec6_3 );//画第三列的列标题
- Point p63_1 = new Point( p62_1.X + ColumnWidth3, rec6.Y );
- Point p63_2 = new Point( p62_1.X + ColumnWidth3, rec6.Y + rec6.Height );
- g.DrawLine( p, p63_1, p63_2 );//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle( p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( PQQ, ft12, b, rec6_4 );//画第四列的列标题
- Rectangle rec6A = new Rectangle( rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec6A );//画标题矩形
- Rectangle rec6A_1 = new Rectangle( rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入底" ), ft12, b, rec6A_1 );//画第一列的列标题
- Point p6A1_1 = new Point( rec6A.X + ColumnWidth1, rec6A.Y );
- Point p6A1_2 = new Point( rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height );
- g.DrawLine( p, p6A1_1, p6A1_2 );//画第一表与第二列的界线
- Rectangle rec6A_2 = new Rectangle( p6A1_1.X + LeftAdd, p6A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- if ( StrIntoBottom == "0" )
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion( "不送" );
- }
- else if ( StrIntoBottom == "-1" )
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion( "全送" );
- }
- g.DrawString( StrIntoBottom, ft12, b, rec6A_2 );//画第二列的列标题
- Point p6A2_1 = new Point( p6A1_1.X + ColumnWidth2, rec6A.Y );
- Point p6A2_2 = new Point( p6A1_1.X + ColumnWidth2, rec6A.Y + rec6A.Height );
- g.DrawLine( p, p6A2_1, p6A2_2 );//画第二表与第三列的界线
- Rectangle rec6A_3 = new Rectangle( p6A2_1.X + LeftAdd, p6A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "身份证号" ), ft12, b, rec6A_3 );//画第三列的列标题
- Point p6A3_1 = new Point( p6A2_1.X + ColumnWidth3, rec6A.Y );
- Point p6A3_2 = new Point( p6A2_1.X + ColumnWidth3, rec6A.Y + rec6A.Height );
- g.DrawLine( p, p6A3_1, p6A3_2 );//画第三表与第四列的界线
- Rectangle rec6A_4 = new Rectangle( p6A3_1.X + LeftAdd, p6A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( PIDNumber, ft12, b, rec6A_4 );//画第四列的列标题
- rec5_Y = rec6A.Y + rec6A.Height;
- rec9Height = RowHeight;
- }
- else
- {
- //Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- //g.DrawRectangle(p, rec6);//画标题矩形
- //Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec6_1);//画第一列的列标题
- //Point p61_1 = new Point(p51_1.X, rec6.Y);
- //Point p61_2 = new Point(p51_1.X, rec6.Y + rec6.Height);
- //g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- //Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- //g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft9, b, rec6_2);//画第二列的列标题
- //Point p62_1 = new Point(p52_1.X, rec6.Y);
- //Point p62_2 = new Point(p52_1.X, rec6.Y + rec6.Height);
- //g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- //Rectangle rec6A_1 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth1, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec6A_1);//画第一列的列标题
- //Point p61A_1 = new Point(p51A_1.X, rec6.Y);
- //Point p61A_2 = new Point(p51A_1.X, rec6.Y + rec6.Height);
- //g.DrawLine(p, p61A_1, p61A_2);//画第一表与第二列的界线
- //string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- //if (StrIntoBottom == "0")
- //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送"); }
- //else if (StrIntoBottom == "-1")
- //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送"); }
- //Rectangle rec6A_2 = new Rectangle(p61A_1.X + LeftAdd, p61A_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- //g.DrawString(StrIntoBottom, ft9, b, rec6A_2);//画第二列的列标题
- //Point p62A_1 = new Point(p52A_1.X, rec6.Y);
- //Point p62A_2 = new Point(p52A_1.X, rec6.Y + rec6.Height);
- //g.DrawLine(p, p62A_1, p62A_2);//画第二表与第三列的界线
- //Rectangle rec6_3 = new Rectangle(p62A_1.X + LeftAdd, p62A_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- //g.DrawString("QQ", ft9, b, rec6_3);//画第三列的列标题
- //Point p63_1 = new Point(p62A_1.X + ColumnWidth3, rec6.Y);
- //Point p63_2 = new Point(p62A_1.X + ColumnWidth3, rec6.Y + rec6.Height);
- //g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- //Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- //g.DrawString(PQQ, ft9, b, rec6_4);//画第四列的列标题
- //rec5_Y = rec6.Y + rec6.Height;
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec6 );//画标题矩形
- //Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("性别"), ft9, b, rec5_1);//画第一列的列标题
- //Point p51_1 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y);
- //Point p51_2 = new Point(rec5.X + ColumnWidth1 / 2, rec5.Y + rec5.Height);
- //g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec6_1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入册" ), ft12, b, rec6_1 );//画第一列的列标题
- Point p61_1 = new Point( rec6.X + ColumnWidth1, rec6.Y );
- Point p61_2 = new Point( rec6.X + ColumnWidth1, rec6.Y + rec6.Height );
- g.DrawLine( p, p61_1, p61_2 );//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle( p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( IntoRegisterQuantit.ToString().Trim(), ft12, b, rec6_2 );//画第二列的列标题
- Point p62_1 = new Point( p52_1.X + ColumnWidth2, rec6.Y );
- Point p62_2 = new Point( p52_1.X + ColumnWidth2, rec6.Y + rec6.Height );
- g.DrawLine( p, p62_1, p62_2 );//画第二表与第三列的界线
- Rectangle rec6_3 = new Rectangle( p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( "QQ", ft12, b, rec6_3 );//画第三列的列标题
- Point p63_1 = new Point( p62_1.X + ColumnWidth3, rec6.Y );
- Point p63_2 = new Point( p62_1.X + ColumnWidth3, rec6.Y + rec6.Height );
- g.DrawLine( p, p63_1, p63_2 );//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle( p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( PQQ, ft12, b, rec6_4 );//画第四列的列标题
- Rectangle rec6A = new Rectangle( rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec6A );//画标题矩形
- Rectangle rec6A_1 = new Rectangle( rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入底" ), ft12, b, rec6A_1 );//画第一列的列标题
- Point p61A_1 = new Point( rec6A.X + ColumnWidth1, rec6A.Y );
- Point p61A_2 = new Point( rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height );
- g.DrawLine( p, p61A_1, p61A_2 );//画第一表与第二列的界线
- //string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- //if (StrIntoBottom == "0")
- //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送"); }
- //else if (StrIntoBottom == "-1")
- //{ StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送"); }
- Rectangle rec6A_2 = new Rectangle( p61A_1.X + LeftAdd, p61A_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( StrIntoBottomQuantity, ft12, b, rec6A_2 );//画第二列的列标题
- Point p62A_1 = new Point( p61A_1.X, rec6A.Y );
- Point p62A_2 = new Point( p61A_1.X, rec6A.Y + rec6A.Height );
- g.DrawLine( p, p62A_1, p62A_2 );//画第二表与第三列的界线
- rec5_Y = rec6A.Y + rec6A.Height;
- }
- #endregion
- #region 第五行
- Rectangle rec7 = new Rectangle( rec3.X, rec5_Y, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec7 );//画标题矩形
- Rectangle rec7_1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "内景服装数" ), ft12, b, rec7_1 );//画第一列的列标题
- Point p71_1 = new Point( rec7.X + ColumnWidth1, rec7.Y );
- Point p71_2 = new Point( rec7.X + ColumnWidth1, rec7.Y + rec7.Height );
- g.DrawLine( p, p71_1, p71_2 );//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle( p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( InnerSights.ToString(), ft12, b, rec7_2 );//画第二列的列标题
- Point p72_1 = new Point( p71_1.X + ColumnWidth2, rec7.Y );
- Point p72_2 = new Point( p71_1.X + ColumnWidth2, rec7.Y + rec7.Height );
- g.DrawLine( p, p72_1, p72_2 );//画第二表与第三列的界线
- Rectangle rec7_3 = new Rectangle( p72_1.X + LeftAdd, p72_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "外景服装数" ), ft12, b, rec7_3 );//画第三列的列标题
- Point p73_1 = new Point( p72_1.X + ColumnWidth3, rec7.Y );
- Point p73_2 = new Point( p72_1.X + ColumnWidth3, rec7.Y + rec7.Height );
- g.DrawLine( p, p73_1, p73_2 );//画第三表与第四列的界线
- Rectangle rec7_4 = new Rectangle( p73_1.X + LeftAdd, p73_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( OuterSights.ToString(), ft12, b, rec7_4 );//画第四列的列标题
- #endregion
- #region 第六行
- Rectangle rec8 = new Rectangle( rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec8 );//画标题矩形
- Rectangle rec8_1 = new Rectangle( rec8.X + LeftAdd, rec8.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "家庭地址" ), ft12, b, rec8_1 );//画第一列的列标题
- Point p81_1 = new Point( rec8.X + ColumnWidth1, rec8.Y );
- Point p81_2 = new Point( rec8.X + ColumnWidth1, rec8.Y + rec8.Height );
- g.DrawLine( p, p81_1, p81_2 );//画第一表与第二列的界线
- Rectangle rec8_2 = new Rectangle( p81_1.X + LeftAdd, p81_1.Y + TopAdd, rec8.Width - rec8_1.Width, RowContentHeight );
- g.DrawString( PAddress, ft12, b, rec8_2 );//画第六列的列标题
- #endregion
- #region 第七行
- Rectangle rec8A = new Rectangle( rec8.X, rec8.Y + rec8.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec8A );//画标题矩形
- Rectangle rec8A_1 = new Rectangle( rec8A.X + LeftAdd, rec8A.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "喜爱风格" ), ft12, b, rec8A_1 );//画第一列的列标题
- Point p81A_1 = new Point( rec8A.X + ColumnWidth1, rec8A.Y );
- Point p81A_2 = new Point( rec8A.X + ColumnWidth1, rec8A.Y + rec8A.Height );
- g.DrawLine( p, p81A_1, p81A_2 );//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle( p81A_1.X + LeftAdd, p81A_1.Y + TopAdd, rec8.Width - rec8A_1.Width, RowContentHeight );
- string[] OrdLovedStyle = tbl_Order.Rows[0]["Ord_LovedStyle"].ToString().Trim().Split( '|' );
- string StrLovedStyle = "";
- for ( int i = 0; i < OrdLovedStyle.Length; i++ )
- {
- if ( OrdLovedStyle[i].Trim() != "" )
- {
- string[] StrID = OrdLovedStyle[i].Trim().Split( '_' );
- DataRow dtRow = tblStyle.Rows.Find( StrID[1].Trim() );
- if ( dtRow != null )
- {
- StrLovedStyle += dtRow["Style_Name"] + ",";
- }
- }
- }
- g.DrawString( StrLovedStyle.TrimEnd( ',' ), ft12, b, rec8A_2 );//画第二列的列标题
- #endregion
- #region 第一列
- #region 第一行
- Rectangle rec9 = new Rectangle( rec8A.X, rec8A.Y + rec8A.Height, rec3.Width, 510 - RowHeight * 2 + Rec1Height - rec9Height );//1515
- g.DrawRectangle( p, rec9 );//画标题矩形
- string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion( "详细内容:" );
- for ( int i = 0; i < tblProductList.Rows.Count; i++ )
- {
- StrProdName += "\r\n" + tblProductList.Rows[i]["ProdName"].ToString().Trim();
- }
- for ( int i = 0; i < tblService.Rows.Count; i++ )
- {
- StrProdName += "\r\n" + tblService.Rows[i]["ProdName"].ToString().Trim();
- }
- Rectangle rec9_1 = new Rectangle( rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2 );
- g.DrawString( StrProdName + "\r\n\r\n" + strSights, GetFontSize( "儿童预约单内容详情字体大小" ), b, rec9_1 );//画第一列的列标题
- #endregion
- #region 第二行
- Rectangle recA1 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec3.Width, 100 );
- g.DrawRectangle( p, recA1 );//画标题矩形
- Rectangle recA1_1 = new Rectangle( recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width, recA1.Height - TopAdd * 2 );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "订单备注:" ) + tbl_Order.Rows[0]["Ord_Remark"].ToString().Trim(), ft12, b, recA1_1 );//画第一列的列标题
- #endregion
- #region 第三行
- Rectangle recA2 = new Rectangle( recA1.X, recA1.Y + recA1.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, recA2 );//画标题矩形
- Rectangle recA2_1 = new Rectangle( recA2.X + LeftAdd, recA2.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影师" ), ft12, b, recA2_1 );//画第一列的列标题
- Point pA21_1 = new Point( recA2.X + ColumnWidth1, recA2.Y );
- Point pA21_2 = new Point( recA2.X + ColumnWidth1, recA2.Y + recA2.Height );
- g.DrawLine( p, pA21_1, pA21_2 );//画第一表与第二列的界线
- Rectangle recA2_2 = new Rectangle( pA21_1.X + LeftAdd, pA21_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( Photographer, ft12, b, recA2_2 );//画第二列的列标题
- Point pA22_1 = new Point( pA21_1.X + ColumnWidth2, recA2.Y );
- Point pA22_2 = new Point( pA21_1.X + ColumnWidth2, recA2.Y + recA2.Height );
- g.DrawLine( p, pA22_1, pA22_2 );//画第二表与第三列的界线
- Rectangle recA2_3 = new Rectangle( pA22_1.X + LeftAdd, pA22_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆师" ), ft12, b, recA2_3 );//画第三列的列标题
- Point pA23_1 = new Point( pA22_1.X + ColumnWidth3, recA2.Y );
- Point pA23_2 = new Point( pA22_1.X + ColumnWidth3, recA2.Y + recA2.Height );
- g.DrawLine( p, pA23_1, pA23_2 );//画第三表与第四列的界线
- Rectangle recA2_4 = new Rectangle( pA23_1.X + LeftAdd, pA23_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( MakeupArtist.Trim(), ft12, b, recA2_4 );//画第四列的列标题
- //Point pA24_1 = new Point(pA23_1.X + ColumnWidth4, recA2.Y);
- //Point pA24_2 = new Point(pA23_1.X + ColumnWidth4, recA2.Y + recA2.Height);
- //g.DrawLine(p, pA24_1, pA24_2);//画第四表与第五列的界线
- #endregion
- #region 第四行
- Rectangle recA3 = new Rectangle( recA2.X, recA2.Y + recA2.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, recA3 );//画标题矩形
- Rectangle recA3_1 = new Rectangle( recA3.X + LeftAdd, recA3.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍摄时间" ), ft12, b, recA3_1 );//画第一列的列标题
- Point pA31_1 = new Point( recA3.X + ColumnWidth1, recA3.Y );
- Point pA31_2 = new Point( recA3.X + ColumnWidth1, recA3.Y + recA3.Height );
- g.DrawLine( p, pA31_1, pA31_2 );//画第一表与第二列的界线
- Rectangle recA3_2 = new Rectangle( pA31_1.X + LeftAdd, pA31_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( PhotographyTime, ft12, b, recA3_2 );//画第二列的列标题
- Point pA32_1 = new Point( pA31_1.X + ColumnWidth2, recA3.Y );
- Point pA32_2 = new Point( pA31_1.X + ColumnWidth2, recA3.Y + recA3.Height );
- g.DrawLine( p, pA32_1, pA32_2 );//画第二表与第三列的界线
- Rectangle recA3_3 = new Rectangle( pA32_1.X + LeftAdd, pA32_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "取件日期" ), ft12, b, recA3_3 );//画第三列的列标题
- Point pA33_1 = new Point( pA32_1.X + ColumnWidth3, recA3.Y );
- Point pA33_2 = new Point( pA32_1.X + ColumnWidth3, recA3.Y + recA3.Height );
- g.DrawLine( p, pA33_1, pA33_2 );//画第三表与第四列的界线
- string strPickupTime = "";
- if ( tblPickupTime.Rows.Count > 0 )
- {
- if ( !string.IsNullOrEmpty( tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim() ) )
- {
- strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString( tblPickupTime.Rows[0]["OPlist_PickupTime"] );
- }
- }
- Rectangle recA3_4 = new Rectangle( pA33_1.X + LeftAdd, pA33_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( strPickupTime, ft12, b, recA2_4 );//画第四列的列标题
- Point pA34_1 = new Point( pA33_1.X + ColumnWidth4, recA3.Y );
- Point pA34_2 = new Point( pA33_1.X + ColumnWidth4, recA3.Y + recA3.Height );
- g.DrawLine( p, pA34_1, pA34_2 );//画第四表与第五列的界线
- #endregion
- #endregion
- #region 第七行
- Rectangle recA4 = new Rectangle( recA3.X, recA3.Y + recA3.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, recA4 );//画标题矩形
- Rectangle recA4_1 = new Rectangle( recA4.X + LeftAdd, recA4.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "选片日期" ), ft12, b, recA4_1 );//画第一列的列标题
- Point pA41_1 = new Point( recA4.X + ColumnWidth1, recA4.Y );
- Point pA41_2 = new Point( recA4.X + ColumnWidth1, recA4.Y + recA4.Height );
- g.DrawLine( p, pA41_1, pA41_2 );//画第一表与第二列的界线
- Rectangle recA4_2 = new Rectangle( pA41_1.X + LeftAdd, pA41_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( FilmSelectionTime, ft12, b, recA4_2 );//画第二列的列标题
- Point pA42_1 = new Point( pA41_1.X + ColumnWidth2, recA4.Y );
- Point pA42_2 = new Point( pA41_1.X + ColumnWidth2, recA4.Y + recA4.Height );
- g.DrawLine( p, pA42_1, pA42_2 );//画第二表与第三列的界线
- Rectangle recA4_3 = new Rectangle( pA42_1.X + LeftAdd, pA42_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导师" ), ft12, b, recA4_3 );//画第三列的列标题
- Point pA43_1 = new Point( pA42_1.X + ColumnWidth3, recA4.Y );
- Point pA43_2 = new Point( pA42_1.X + ColumnWidth3, recA4.Y + recA4.Height );
- g.DrawLine( p, pA43_1, pA43_2 );//画第三表与第四列的界线
- Rectangle recA4_4 = new Rectangle( pA43_1.X + LeftAdd, pA43_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( BootDivision, ft12, b, recA4_4 );//画第四列的列标题
- #endregion
- #endregion
- #region 右排
- #region 第一行
- Rectangle Rrec3 = new Rectangle( rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight );
- g.DrawRectangle( p, Rrec3 );//画标题矩形
- Rectangle Rrec3_5 = new Rectangle( Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" ), ft12, b, Rrec3_5 );//画第五列的列标题
- Point Rp35_1 = new Point( Rrec3.X + ColumnWidth5, Rrec3.Y );
- Point Rp35_2 = new Point( Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height );
- g.DrawLine( p, Rp35_1, Rp35_2 );//画第五表与第六列的界线
- Rectangle Rrec3_6 = new Rectangle( Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight );
- g.DrawString( tbl_Order.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6 );//画第六列的列标题
- #endregion
- #region 第二行
- Rectangle Rrec4 = new Rectangle( Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight );
- g.DrawRectangle( p, Rrec4 );//画标题矩形
- Rectangle Rrec4_5 = new Rectangle( Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系金额" ), ft12, b, Rrec4_5 );//画第五列的列标题
- Point Rp45_1 = new Point( Rp35_1.X, Rrec4.Y );
- Point Rp45_2 = new Point( Rp35_1.X, Rrec4.Y + Rrec4.Height );
- g.DrawLine( p, Rp45_1, Rp45_2 );//画第五表与第六列的界线
- Rectangle Rrec4_6 = new Rectangle( Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight );
- g.DrawString( tbl_Order.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6 );//画第六列的列标题
- #endregion
- #region 第三行
- Rectangle Rrec5 = new Rectangle( Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight );
- g.DrawRectangle( p, Rrec5 );//画标题矩形
- Rectangle Rrec5_5 = new Rectangle( Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "定金" ), ft12, b, Rrec5_5 );//画第五列的列标题
- Point Rp55_1 = new Point( Rp45_1.X, Rrec5.Y );
- Point Rp55_2 = new Point( Rp45_1.X, Rrec5.Y + Rrec5.Height );
- g.DrawLine( p, Rp55_1, Rp55_2 );//画第五表与第六列的界线
- Rectangle Rrec5_6 = new Rectangle( Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight );
- g.DrawString( OrdPrice, ft12, b, Rrec5_6 );//画第六列的列标题
- #endregion
- #region 第四行
- Rectangle Rrec6 = new Rectangle( Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight );
- g.DrawRectangle( p, Rrec6 );//画标题矩形
- Rectangle Rrec6_5 = new Rectangle( Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "余款金额" ), ft12, b, Rrec6_5 );//画第五列的列标题
- Point Rp65_1 = new Point( Rp55_1.X, Rrec6.Y );
- Point Rp65_2 = new Point( Rp55_1.X, Rrec6.Y + Rrec6.Height );
- g.DrawLine( p, Rp65_1, Rp65_2 );//画第五表与第六列的界线
- Rectangle Rrec6_6 = new Rectangle( Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight );
- g.DrawString( tbl_Order.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6 );//画第六列的列标题
- #endregion
- #region 第六行
- Rectangle Rrec8 = new Rectangle( Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight );
- g.DrawRectangle( p, Rrec8 );//画标题矩形
- Rectangle Rrec8_5 = new Rectangle( Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门市" ), ft12, b, Rrec8_5 );//画第五列的列标题
- Point Rp85_1 = new Point( Rp65_1.X, Rrec8.Y );
- Point Rp85_2 = new Point( Rp65_1.X, Rrec8.Y + Rrec8.Height );
- g.DrawLine( p, Rp85_1, Rp85_2 );//画第五表与第六列的界线
- Rectangle rec8_6 = new Rectangle( Rp85_1.X, Rrec8_5.Y, ColumnWidth6, RowContentHeight );
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString( strOrderPerson, ft12, b, rec8_6 );//画第六列的列标题
- #endregion
- #region 第一列
- Rectangle Rrec10 = new Rectangle( Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA2.Y - Rrec8.Y );
- g.DrawRectangle( p, Rrec10 );//画标题矩形
- StrValue = "";
- if ( PrintOtherData.ContainsKey( "儿童预约单注意事项说明" ) && PrintOtherData["儿童预约单注意事项说明"].ToString().Trim().Length > 0 )
- {
- StrValue = PrintOtherData["儿童预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec10_1 = new Rectangle( Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2 );
- Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont( g, LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:\r\n" ) + StrValue, rec10_1, GetFontSize( "儿童预约单注意事项字体大小" ), minFontSize: 6 );
- PrinterDrawMethod.DrawCellTextAutroWrap( g, LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:\r\n" ) + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false );
- #endregion
- #region 顾客签字
- Rectangle RrecA5 = new Rectangle( Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2 );
- g.DrawRectangle( p, RrecA5 );//画标题矩形
- Rectangle RrecA5_1 = new Rectangle( RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字" ), ft12, b, RrecA5_1 );//画第五列的列标题
- Point RpA51_1 = new Point( Rp65_1.X, RrecA5.Y );
- Point RpA51_2 = new Point( Rp65_1.X, RrecA5.Y + RrecA5.Height );
- g.DrawLine( p, RpA51_1, RpA51_2 );//画第四表与第五列的界线
- #endregion
- #endregion
- #region 尾行
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "网址:" ) + tbl.Rows[0]["Company_URL"].ToString().Trim();
- sizef = g.MeasureString( rec2Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recA6_1 = new Rectangle( TableWidth + LeftWidth - FtWidth, recA4.Y + recA4.Height + TopAdd, FtWidth, FtHeight );
- g.DrawString( rec2Value, ft9, b, recA6_1 );//画第一列的列标题
- Rectangle recA6 = new Rectangle( recA4.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6 );//画第一列的列标题
- Rectangle recA7 = new Rectangle( recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7 );//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "页:" ) + "1/1";
- sizef = g.MeasureString( rec2Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recA8 = new Rectangle( TableWidth + LeftWidth - FtWidth, recA7.Y + recA7.Height - TopAdd, FtWidth, FtHeight );
- g.DrawString( rec2Value, ft9, b, recA8 );//画第一列的列标题
- #endregion
- }
- /// <summary>
- /// 儿童二等份打印
- /// </summary>
- /// <param name="objValue"></param>
- private static void Child_OrderReport_TwoEqualPrint_Back( DataSet dtSet, Graphics g, Size size )
- {
- DataTable tbl = dtSet.Tables["ds"];
- DataTable tbl_Order = dtSet.Tables["ds1"];
- DataTable tbl_Digital = dtSet.Tables["ds2"];
- DataTable tbl_Sights = dtSet.Tables["ds3"];
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//服务
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- if ( tblPayment.Rows.Count > 0 )
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
- int IntoRegisterQuantit = 0;
- int IntoBottomQuantity = 0;
- for ( int i = 0; i < tblIntoRB.Rows.Count; i++ )
- {
- IntoRegisterQuantit += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"] );
- IntoBottomQuantity += Convert.ToInt32( tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"] );
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft17 = new Font( "宋体", 17 );
- Font ft13 = new Font( "宋体", 13 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- #region 获取数据
- string PName = "";
- string PTelephone = "";
- string PMicroSignal = "";
- string PMemberCardNumber = "";
- string RName = "";
- string RBirthday = "";
- string RSex = "";
- string RAgeString = "";
- string StrAdderss = "";
- for ( int i = 0; i < tblClient.Rows.Count; i++ )
- {
- if ( tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0" )
- {
- PName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- PTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- PMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- DataTable tblMember = orbll.GetView_Custom( "tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + tblClient.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_CradNumber" ).Tables[0];
- if ( tblMember.Rows.Count > 0 )
- {
- PMemberCardNumber = tblMember.Rows[0]["Mc_CradNumber"].ToString();
- }
- if ( tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "" )
- {
- if ( StrAdderss == "" )
- {
- StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- else if ( tblClient.Rows[i]["GM_Master"].ToString().Trim() == "0" && tblClient.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" )
- {
- RName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- RSex = tblClient.Rows[i]["Cus_Sex_cs"].ToString().Trim();
- RAgeString = tblClient.Rows[i]["Age_String"].ToString().Trim();
- if ( LYFZ.Command.Command_Validate.DateTimeToString( tblClient.Rows[i]["Cus_Birthday"] ) != "" )
- {
- RBirthday = LYFZ.Command.Command_Validate.DateTimeToString( tblClient.Rows[i]["Cus_Birthday"] );
- if ( !string.IsNullOrEmpty( tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() ) && tblClient.Rows[i]["Cus_BirthdayLunar"].ToString().Trim() == "1" )
- {
- RBirthday += LYFZ.BLL.OtherCommonModel.FontConversion( "(农历)" );
- }
- }
- if ( tblClient.Rows[i]["Cus_Address"].ToString().Trim() != "" )
- {
- StrAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- int InnerSights = 0;
- int OuterSights = 0;
- string strSights = "";
- string Photographer = "";
- string MakeupArtist = "";
- string PhotographyTime = "";
- string BootDivision = "";
- for ( int i = 0; i < tbl_Sights.Rows.Count; i++ )
- {
- if ( tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1" )
- {
- OuterSights += Convert.ToInt32( tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"] );
- }
- else if ( tbl_Sights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0" )
- {
- InnerSights += Convert.ToInt32( tbl_Sights.Rows[i]["Ordpg_ApparelQuantity"] );
- }
- strSights += (i + 1) + "." + tbl_Sights.Rows[i]["Ordpg_Sights"].ToString().Trim() + " ";
- if ( tbl_Sights.Rows[i]["Ordpg_Photographer"].ToString().Trim() != "" )
- {
- Photographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_Photographer"] );
- }
- if ( tbl_Sights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim() != "" )
- {
- MakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_MakeupArtist"] );
- }
- if ( tbl_Sights.Rows[i]["Ordpg_BootDivision"].ToString().Trim() != "" )
- {
- BootDivision = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName( tbl_Sights.Rows[i]["Ordpg_BootDivision"] );
- }
- if ( !string.IsNullOrEmpty( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"].ToString() ) )
- {
- if ( PhotographyTime != "" )
- {
- if ( Convert.ToDateTime( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] ) < Convert.ToDateTime( PhotographyTime ) )
- {
- PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString2( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] );
- }
- }
- else
- {
- PhotographyTime = LYFZ.Command.Command_Validate.DateTimeToString2( tbl_Sights.Rows[i]["Ordpg_ReservationPhotographyTime"] );
- }
- }
- }
- string FilmSelectionTime = "";
- if ( tbl_Digital.Rows.Count > 0 )
- {
- FilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString2( tbl_Digital.Rows[0]["Ordv_FilmSelectionTime"] );
- }
- string StrProdName = "";
- for ( int i = 0; i < tblProductList.Rows.Count; i++ )
- {
- StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- }
- for ( int i = 0; i < tblService.Rows.Count; i++ )
- {
- StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- }
- StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tbl_Order.Rows[0]["Ord_Remark"].ToString().Trim();
- #endregion
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 20;
- int RowContentHeight = 18;
- int Unit = TableWidth / 32;
- int ColumnWidth1 = Unit * 3;
- int ColumnWidth2 = Unit * 4;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 4;
- int ColumnWidth5 = Unit * 2;
- int ColumnWidth6 = Unit * 4;
- int ColumnWidth7 = Unit * 3;
- int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
- #region 金色童年收据凭据
- Rectangle rec1;
- int Rec1Height = 0;
- int TopHeightCount = 0;
- Image imgLog = CachePhoto( PhotoLogType.Child, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG( "预约儿童单LOG" ) );
- if ( imgLog != null )
- {
- rec1 = new Rectangle( LeftWidth, 50, TableWidth, 80 );
- Rectangle srcRec1 = new Rectangle( 0, 0, imgLog.Width, imgLog.Height );
- g.DrawImage( imgLog, rec1, srcRec1, GraphicsUnit.Pixel );
- Rec1Height = rec1.Height - Convert.ToInt32( g.MeasureString( "预约儿童单标题", ft17 ).Height );
- TopHeightCount = 3;
- }
- else
- {
- string StrTitle = GetReservationSingleTitle( "预约儿童单标题" );
- SizeF srcsizef = g.MeasureString( StrTitle, ft17 );
- int srcFtWidth = Convert.ToInt32( srcsizef.Width );
- int srcFtHeight = Convert.ToInt32( srcsizef.Height );
- rec1 = new Rectangle( size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight );
- g.DrawString( StrTitle, ft17, b, rec1 );
- }
- #endregion
- #region 家长、联系
- string StrAddress = LYFZ.BLL.OtherCommonModel.FontConversion( "家长姓名:" ) + PName + LYFZ.BLL.OtherCommonModel.FontConversion( " 联系电话:" ) + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( PTelephone );
- SizeF sizef = g.MeasureString( StrAddress, ft10 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight );//(panlImage.Width / 2) - (FtWidth / 2), rec2.Y + rec2.Height
- g.DrawString( StrAddress, ft10, b, rec2 );
- #endregion
- #region 打印时间
- string StrValue = tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tbl_Order.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom( StrValue );
- sizef = g.MeasureString( rec3Value, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2A = new Rectangle( TableWidth + LeftWidth - FtWidth, rec2.Y, FtWidth, FtHeight );
- g.DrawString( rec3Value, ft10, b, rec2A );
- #endregion
- #region 第一行
- Rectangle rec3 = new Rectangle( rec2.X, rec2.Y + rec2.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec3 );//画标题矩形
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝姓名" );
- sizef = g.MeasureString( rec2Value, ft17 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec3_1 = new Rectangle( rec3.X + LeftAdd * 3, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( rec2Value, ft9, b, rec3_1 );//画第一列的列标题
- Point p31_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
- Point p31_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
- g.DrawLine( p, p31_1, p31_2 );//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle( p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( RName, ft9, b, rec3_2 );//画第二列的列标题
- Point p32_1 = new Point( p31_1.X + ColumnWidth2, rec3.Y );
- Point p32_2 = new Point( p31_1.X + ColumnWidth2, rec3.Y + rec3.Height );
- g.DrawLine( p, p32_1, p32_2 );//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle( p32_1.X + LeftAdd * 3, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "性别" ), ft9, b, rec3_3 );//画第三列的列标题
- Point p33_1 = new Point( p32_1.X + ColumnWidth3, rec3.Y );
- Point p33_2 = new Point( p32_1.X + ColumnWidth3, rec3.Y + rec3.Height );
- g.DrawLine( p, p33_1, p33_2 );//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle( p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( RSex, ft9, b, rec3_4 );//画第四列的列标题
- Point p34_1 = new Point( p33_1.X + ColumnWidth4, rec3.Y );
- Point p34_2 = new Point( p33_1.X + ColumnWidth4, rec3.Y + rec3.Height );
- g.DrawLine( p, p34_1, p34_2 );//画第二表与第三列的界线
- Rectangle rec3_5 = new Rectangle( p34_1.X + LeftAdd * 3, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "年龄" ), ft9, b, rec3_5 );//画第三列的列标题
- Point p35_1 = new Point( p34_1.X + ColumnWidth5, rec3.Y );
- Point p35_2 = new Point( p34_1.X + ColumnWidth5, rec3.Y + rec3.Height );
- g.DrawLine( p, p35_1, p35_2 );//画第三表与第四列的界线
- Rectangle rec3_6 = new Rectangle( p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight );
- g.DrawString( RAgeString, ft9, b, rec3_6 );//画第四列的列标题
- Point p36_1 = new Point( p35_1.X + ColumnWidth6, rec3.Y );
- Point p36_2 = new Point( p35_1.X + ColumnWidth6, rec3.Y + rec3.Height );
- g.DrawLine( p, p36_1, p36_2 );//画第二表与第三列的界线
- Rectangle rec3_7 = new Rectangle( p36_1.X + LeftAdd * 3, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝生日" ), ft9, b, rec3_7 );//画第三列的列标题
- Point p37_1 = new Point( p36_1.X + ColumnWidth7, rec3.Y );
- Point p37_2 = new Point( p36_1.X + ColumnWidth7, rec3.Y + rec3.Height );
- g.DrawLine( p, p37_1, p37_2 );//画第三表与第四列的界线
- Rectangle rec3_8 = new Rectangle( p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight );
- g.DrawString( RBirthday, ft9, b, rec3_8 );//画第四列的列标题
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle( rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec4 );//画标题矩形
- Rectangle rec4_1 = new Rectangle( rec4.X + LeftAdd * 3, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系金额" ), ft9, b, rec4_1 );//画第一列的列标题
- Point p41_1 = new Point( rec4.X + ColumnWidth1, rec4.Y );
- Point p41_2 = new Point( rec4.X + ColumnWidth1, rec4.Y + rec4.Height );
- g.DrawLine( p, p41_1, p41_2 );//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle( p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( tbl_Order.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec4_2 );//画第二列的列标题
- Point p42_1 = new Point( p41_1.X + ColumnWidth2, rec4.Y );
- Point p42_2 = new Point( p41_1.X + ColumnWidth2, rec4.Y + rec4.Height );
- g.DrawLine( p, p42_1, p42_2 );//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle( p42_1.X + LeftAdd * 3, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "定金" ), ft9, b, rec4_3 );//画第三列的列标题
- Point p43_1 = new Point( p42_1.X + ColumnWidth3, rec4.Y );
- Point p43_2 = new Point( p42_1.X + ColumnWidth3, rec4.Y + rec4.Height );
- g.DrawLine( p, p43_1, p43_2 );//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle( p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( OrdPrice, ft9, b, rec4_4 );//画第四列的列标题
- Point p44_1 = new Point( p43_1.X + ColumnWidth4, rec4.Y );
- Point p44_2 = new Point( p43_1.X + ColumnWidth4, rec4.Y + rec4.Height );
- g.DrawLine( p, p44_1, p44_2 );//画第二表与第三列的界线
- Rectangle rec4_5 = new Rectangle( p44_1.X + LeftAdd * 3, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "欠款" ), ft9, b, rec4_5 );//画第三列的列标题
- Point p45_1 = new Point( p44_1.X + ColumnWidth5, rec4.Y );
- Point p45_2 = new Point( p44_1.X + ColumnWidth5, rec4.Y + rec4.Height );
- g.DrawLine( p, p45_1, p45_2 );//画第三表与第四列的界线
- Rectangle rec4_6 = new Rectangle( p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight );
- g.DrawString( tbl_Order.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6 );//画第四列的列标题
- Point p46_1 = new Point( p45_1.X + ColumnWidth6, rec4.Y );
- Point p46_2 = new Point( p45_1.X + ColumnWidth6, rec4.Y + rec4.Height );
- g.DrawLine( p, p46_1, p46_2 );//画第二表与第三列的界线
- Rectangle rec4_7 = new Rectangle( p46_1.X + LeftAdd * 3, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "套系名称" ), ft9, b, rec4_7 );//画第三列的列标题
- Point p47_1 = new Point( p46_1.X + ColumnWidth7, rec4.Y );
- Point p47_2 = new Point( p46_1.X + ColumnWidth7, rec4.Y + rec4.Height );
- g.DrawLine( p, p47_1, p47_2 );//画第三表与第四列的界线
- Rectangle rec4_8 = new Rectangle( p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight );
- g.DrawString( tbl_Order.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec4_8 );//画第四列的列标题
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec5 );//画标题矩形
- Rectangle rec5_1 = new Rectangle( rec5.X + LeftAdd * 3, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号" ), ft9, b, rec5_1 );//画第一列的列标题
- Point p51_1 = new Point( rec5.X + ColumnWidth1, rec5.Y );
- Point p51_2 = new Point( rec5.X + ColumnWidth1, rec5.Y + rec5.Height );
- g.DrawLine( p, p51_1, p51_2 );//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle( p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( PMemberCardNumber, ft9, b, rec5_2 );//画第二列的列标题
- Point p52_1 = new Point( p51_1.X + ColumnWidth2, rec5.Y );
- Point p52_2 = new Point( p51_1.X + ColumnWidth2, rec5.Y + rec5.Height );
- g.DrawLine( p, p52_1, p52_2 );//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle( p52_1.X + LeftAdd * 3, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入册" ), ft9, b, rec5_3 );//画第一列的列标题
- Point p53_1 = new Point( p52_1.X + ColumnWidth3, rec5.Y );
- Point p53_2 = new Point( p52_1.X + ColumnWidth3, rec5.Y + rec5.Height );
- g.DrawLine( p, p53_1, p53_2 );//画第一表与第二列的界线
- Rectangle rec5_4 = new Rectangle( p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( IntoRegisterQuantit.ToString().Trim(), ft9, b, rec5_4 );//画第二列的列标题
- Point p54_1 = new Point( p43_1.X + ColumnWidth4, rec5.Y );
- Point p54_2 = new Point( p43_1.X + ColumnWidth4, rec5.Y + rec5.Height );
- g.DrawLine( p, p54_1, p54_2 );//画第二表与第三列的界线
- Rectangle rec5_5 = new Rectangle( p54_1.X + LeftAdd * 3, p54_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "入底" ), ft9, b, rec5_5 );//画第三列的列标题
- Point p55_1 = new Point( p54_1.X + ColumnWidth5, rec5.Y );
- Point p55_2 = new Point( p54_1.X + ColumnWidth5, rec5.Y + rec5.Height );
- g.DrawLine( p, p55_1, p55_2 );//画第三表与第四列的界线
- string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- if ( StrIntoBottom == "0" )
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion( "不送" );
- }
- else if ( StrIntoBottom == "-1" )
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion( "全送" );
- }
- Rectangle rec5_6 = new Rectangle( p55_1.X + LeftAdd, p55_1.Y + TopAdd, ColumnWidth6, RowContentHeight );
- g.DrawString( StrIntoBottom, ft9, b, rec5_6 );//画第四列的列标题
- Point p56_1 = new Point( p55_1.X + ColumnWidth6, rec5.Y );
- Point p56_2 = new Point( p55_1.X + ColumnWidth6, rec5.Y + rec5.Height );
- g.DrawLine( p, p56_1, p56_2 );//画第二表与第三列的界线
- Rectangle rec5_7 = new Rectangle( p56_1.X + LeftAdd * 7, p56_1.Y + TopAdd, ColumnWidth7, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "门 市" ), ft9, b, rec5_7 );//画第三列的列标题
- Point p57_1 = new Point( p56_1.X + ColumnWidth7, rec5.Y );
- Point p57_2 = new Point( p56_1.X + ColumnWidth7, rec5.Y + rec5.Height );
- g.DrawLine( p, p57_1, p57_2 );//画第三表与第四列的界线
- Rectangle rec5_8 = new Rectangle( p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight );
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString( strOrderPerson, ft9, b, rec5_8 );//画第四列的列标题
- #endregion
- #region 第三四行
- Rectangle rec5A = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight );
- g.DrawRectangle( p, rec5A );//画标题矩形
- Rectangle rec5A_1 = new Rectangle( rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "内景服装" ), ft9, b, rec5A_1 );//画第一列的列标题
- Point p5A1_1 = new Point( rec5A.X + ColumnWidth1, rec5A.Y );
- Point p5A1_2 = new Point( rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height );
- g.DrawLine( p, p5A1_1, p5A1_2 );//画第一表与第二列的界线
- Rectangle rec5A_2 = new Rectangle( p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight );
- g.DrawString( InnerSights.ToString().Trim(), ft9, b, rec5A_2 );//画第二列的列标题
- Point p5A2_1 = new Point( p5A1_1.X + ColumnWidth2, rec5A.Y );
- Point p5A2_2 = new Point( p5A1_1.X + ColumnWidth2, rec5A.Y + rec5A.Height );
- g.DrawLine( p, p5A2_1, p5A2_2 );//画第二表与第三列的界线
- Rectangle rec5A_3 = new Rectangle( p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "外景服装" ), ft9, b, rec5A_3 );//画第一列的列标题
- Point p5A3_1 = new Point( p5A2_1.X + ColumnWidth3, rec5A.Y );
- Point p5A3_2 = new Point( p5A2_1.X + ColumnWidth3, rec5A.Y + rec5A.Height );
- g.DrawLine( p, p5A3_1, p5A3_2 );//画第一表与第二列的界线
- Rectangle rec5A_4 = new Rectangle( p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight );
- g.DrawString( OuterSights.ToString().Trim(), ft9, b, rec5A_4 );//画第二列的列标题
- Point p5A4_1 = new Point( p5A3_1.X + ColumnWidth4, rec5A.Y );
- Point p5A4_2 = new Point( p5A3_1.X + ColumnWidth4, rec5A.Y + rec5A.Height );
- g.DrawLine( p, p5A4_1, p5A4_2 );//画第二表与第三列的界线
- Rectangle rec5A_5 = new Rectangle( p5A4_1.X + LeftAdd * 3, p5A4_1.Y + TopAdd, ColumnWidth5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "地址" ), ft9, b, rec5A_5 );//画第三列的列标题
- Point p5A5_1 = new Point( p5A4_1.X + ColumnWidth5, rec5A.Y );
- Point p5A5_2 = new Point( p5A4_1.X + ColumnWidth5, rec5A.Y + rec5A.Height );
- g.DrawLine( p, p5A5_1, p5A5_2 );//画第三表与第四列的界线
- Rectangle rec5A_6 = new Rectangle( p5A5_1.X + LeftAdd, p5A5_1.Y + TopAdd, ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowContentHeight );
- g.DrawString( StrAdderss, ft9, b, rec5A_6 );//画第四列的列标题
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle( rec5A.X, rec5A.Y + rec5A.Height, TableWidth, 315 - Rec1Height - LeftWidth );
- g.DrawRectangle( p, rec6 );//画标题矩形
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "套系内容" );
- sizef = g.MeasureString( rec2Value, ft17 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height ) + 1;
- Rectangle rec6_1 = new Rectangle( rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4 );
- g.DrawString( rec2Value, ft13, b, rec6_1 );//画第一列的列标题
- Point p61_1 = new Point( rec6.X + rec6_1.Width, rec6.Y );
- Point p61_2 = new Point( rec6.X + rec6_1.Width, rec6.Y + rec6.Height );
- g.DrawLine( p, p61_1, p61_2 );//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle( p61_1.X + LeftAdd, p61_1.Y + TopAdd, TableWidth - ColumnWidth8 - ColumnWidth7 - (ColumnWidth1 / 2) - rec6_1.Width, rec6.Height - TopAdd * 2 );
- g.DrawString( StrProdName, GetFontSize( "儿童预约单内容详情字体大小" ), b, rec6_2 );//画第二列的列标题
- Point p62_1 = new Point( p61_1.X + rec6_2.Width, rec6.Y );
- Point p62_2 = new Point( p61_1.X + rec6_2.Width, rec6.Y + rec6.Height );
- g.DrawLine( p, p62_1, p62_2 );//画第二表与第三列的界线
- StrValue = "";
- if ( PrintOtherData.ContainsKey( "儿童预约单注意事项说明" ) && PrintOtherData["儿童预约单注意事项说明"].ToString().Trim().Length > 0 )
- {
- StrValue = PrintOtherData["儿童预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec6_3 = new Rectangle( rec6_2.X + rec6_2.Width + LeftAdd, rec6_1.Y, rec6_1.Width, rec6_1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项" ), ft13, b, rec6_3 );//画第三列的列标题
- Point p63_1 = new Point( p62_1.X + rec6_3.Width, rec6.Y );
- Point p63_2 = new Point( p62_1.X + rec6_3.Width, rec6.Y + rec6.Height );
- g.DrawLine( p, p63_1, p63_2 );//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle( p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth8 + ColumnWidth7 + (ColumnWidth1 / 2) - rec6_3.Width, rec6.Height - TopAdd * 2 );
- g.DrawString( StrValue, GetFontSize( "儿童预约单注意事项字体大小" ), b, rec6_4 );//画第四列的列标题
- #endregion
- #region 第六行
- int SWidth = TableWidth / 8;
- Rectangle rec7 = new Rectangle( rec6.X, rec6.Y + rec6.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec7 );//画标题矩形
- Rectangle rec7_1 = new Rectangle( rec7.X + LeftAdd * 4, rec7.Y + TopAdd, SWidth - SWidth / 3 + 5, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "摄影师" ), ft9, b, rec7_1 );//画第一列的列标题
- Point p71_1 = new Point( rec7.X + rec7_1.Width, rec7.Y );
- Point p71_2 = new Point( rec7.X + rec7_1.Width, rec7.Y + rec7.Height );
- g.DrawLine( p, p71_1, p71_2 );//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle( p71_1.X + LeftAdd, p71_1.Y + TopAdd, SWidth, RowContentHeight );
- g.DrawString( Photographer, ft9, b, rec7_2 );//画第六列的列标题
- Point p72_1 = new Point( p71_1.X + rec7_2.Width, rec7.Y );
- Point p72_2 = new Point( p71_1.X + rec7_2.Width, rec7.Y + rec7.Height );
- g.DrawLine( p, p72_1, p72_2 );//画第一表与第二列的界线
- Rectangle rec7_3 = new Rectangle( p72_1.X + LeftAdd * 4, p72_1.Y + TopAdd, rec7_1.Width, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "化妆师" ), ft9, b, rec7_3 );//画第一列的列标题
- Point p73_1 = new Point( p72_1.X + rec7_3.Width, rec7.Y );
- Point p73_2 = new Point( p72_1.X + rec7_3.Width, rec7.Y + rec7.Height );
- g.DrawLine( p, p73_1, p73_2 );//画第一表与第二列的界线
- Rectangle rec7_4 = new Rectangle( p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7_2.Width, RowContentHeight );
- g.DrawString( MakeupArtist.Trim(), ft9, b, rec7_4 );//画第六列的列标题
- Point p74_1 = new Point( p73_1.X + rec7_4.Width, rec7.Y );
- Point p74_2 = new Point( p73_1.X + rec7_4.Width, rec7.Y + rec7.Height );
- g.DrawLine( p, p74_1, p74_2 );//画第一表与第二列的界线
- Rectangle rec7_5 = new Rectangle( p74_1.X + LeftAdd * 2, p74_1.Y + TopAdd, rec7_3.Width, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "拍照时间" ), ft9, b, rec7_5 );//画第一列的列标题
- Point p75_1 = new Point( p74_1.X + rec7_5.Width, rec7.Y );
- Point p75_2 = new Point( p74_1.X + rec7_5.Width, rec7.Y + rec7.Height );
- g.DrawLine( p, p75_1, p75_2 );//画第一表与第二列的界线
- Rectangle rec7_6 = new Rectangle( p75_1.X + LeftAdd, p75_1.Y + TopAdd, rec7_4.Width + 30, RowContentHeight );
- g.DrawString( PhotographyTime.Trim(), ft9, b, rec7_6 );//画第六列的列标题
- Point p76_1 = new Point( p75_1.X + rec7_6.Width, rec7.Y );
- Point p76_2 = new Point( p75_1.X + rec7_6.Width, rec7.Y + rec7.Height );
- g.DrawLine( p, p76_1, p76_2 );//画第一表与第二列的界线
- Rectangle rec7_7 = new Rectangle( p76_1.X + LeftAdd * 2, p76_1.Y + TopAdd, rec7_5.Width, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "选片时间" ), ft9, b, rec7_7 );//画第一列的列标题
- Point p77_1 = new Point( p76_1.X + rec7_7.Width, rec7.Y );
- Point p77_2 = new Point( p76_1.X + rec7_7.Width, rec7.Y + rec7.Height );
- g.DrawLine( p, p77_1, p77_2 );//画第一表与第二列的界线
- Rectangle rec7_8 = new Rectangle( p77_1.X + LeftAdd, p77_1.Y + TopAdd, rec7_6.Width, RowContentHeight );
- g.DrawString( FilmSelectionTime, ft9, b, rec7_2 );//画第六列的列标题
- #endregion
- #region 第七行
- Rectangle rec8 = new Rectangle( rec7.X, rec7.Y + rec7.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec8 );//画标题矩形
- Rectangle rec8_1 = new Rectangle( rec8.X + LeftAdd * 4, rec8.Y + TopAdd, rec7_1.Width, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "引导师" ), ft9, b, rec8_1 );//画第一列的列标题
- Point p81_1 = new Point( rec8.X + rec7_1.Width, rec8.Y );
- Point p81_2 = new Point( rec8.X + rec7_1.Width, rec8.Y + rec8.Height );
- g.DrawLine( p, p81_1, p81_2 );//画第一表与第二列的界线
- Rectangle rec8_2 = new Rectangle( p81_1.X + LeftAdd, p81_1.Y + TopAdd, SWidth, RowContentHeight );
- g.DrawString( BootDivision, ft9, b, rec8_2 );//画第六列的列标题
- Point p82_1 = new Point( p81_1.X + rec8_2.Width, rec8.Y );
- Point p82_2 = new Point( p81_1.X + rec8_2.Width, rec8.Y + rec8.Height );
- g.DrawLine( p, p82_1, p82_2 );//画第一表与第二列的界线
- Rectangle rec8_3 = new Rectangle( p82_1.X + LeftAdd * 4, p82_1.Y + TopAdd, rec8_1.Width, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "设计师" ), ft9, b, rec8_3 );//画第一列的列标题
- Point p83_1 = new Point( p82_1.X + rec8_3.Width, rec8.Y );
- Point p83_2 = new Point( p82_1.X + rec8_3.Width, rec8.Y + rec8.Height );
- g.DrawLine( p, p83_1, p83_2 );//画第一表与第二列的界线
- Rectangle rec8_4 = new Rectangle( p83_1.X + LeftAdd, p83_1.Y + TopAdd, rec8_2.Width, RowContentHeight );
- g.DrawString( "", ft9, b, rec8_4 );//画第六列的列标题
- Point p84_1 = new Point( p83_1.X + rec8_4.Width, rec8.Y );
- Point p84_2 = new Point( p83_1.X + rec8_4.Width, rec8.Y + rec8.Height );
- g.DrawLine( p, p84_1, p84_2 );//画第一表与第二列的界线
- Rectangle rec8_5 = new Rectangle( p84_1.X + LeftAdd * 2, p84_1.Y + TopAdd, rec8_3.Width, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "取件时间" ), ft9, b, rec8_5 );//画第一列的列标题
- Point p85_1 = new Point( p84_1.X + rec8_5.Width, rec8.Y );
- Point p85_2 = new Point( p84_1.X + rec8_5.Width, rec8.Y + rec8.Height );
- g.DrawLine( p, p85_1, p85_2 );//画第一表与第二列的界线
- string strPickupTime = "";
- if ( tblPickupTime.Rows.Count > 0 )
- {
- if ( !string.IsNullOrEmpty( tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim() ) )
- {
- strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString( tblPickupTime.Rows[0]["OPlist_PickupTime"] );
- }
- }
- Rectangle rec8_6 = new Rectangle( p85_1.X + LeftAdd, p85_1.Y + TopAdd, rec8_4.Width + 30, RowContentHeight );
- g.DrawString( strPickupTime, ft9, b, rec8_6 );//画第六列的列标题
- Point p86_1 = new Point( p85_1.X + rec8_6.Width, rec8.Y );
- Point p86_2 = new Point( p85_1.X + rec8_6.Width, rec8.Y + rec8.Height );
- g.DrawLine( p, p86_1, p86_2 );//画第一表与第二列的界线
- Rectangle rec8_7 = new Rectangle( p86_1.X + LeftAdd * 2, p86_1.Y + TopAdd, rec8_5.Width, RowContentHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "顾客签字" ), ft9, b, rec8_7 );//画第一列的列标题
- Point p87_1 = new Point( p86_1.X + rec8_7.Width, rec8.Y );
- Point p87_2 = new Point( p86_1.X + rec8_7.Width, rec8.Y + rec8.Height );
- g.DrawLine( p, p87_1, p87_2 );//画第一表与第二列的界线
- Rectangle rec8_8 = new Rectangle( p87_1.X + LeftAdd, p87_1.Y + TopAdd, rec8_6.Width, RowContentHeight );
- g.DrawString( "", ft9, b, rec8_2 );//画第六列的列标题
- #endregion
- #region 尾行
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "电话:" ) + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- sizef = g.MeasureString( rec2Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec9_1 = new Rectangle( TableWidth + LeftWidth - FtWidth, rec8.Y + rec8.Height + TopAdd, FtWidth, FtHeight );
- g.DrawString( rec2Value, ft9, b, rec9_1 );//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion( "地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( rec2Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec9 = new Rectangle( rec8.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight );
- g.DrawString( rec2Value, ft9, b, rec9 );//画第一列的列标题
- #endregion
- }
- #endregion
- #region 写真
- /// <summary>
- /// 订单报表写真版()
- /// </summary>
- /// <returns></returns>
- private static void Portrait_OrderReport_Print(DataSet dtSet, Graphics g1, Size size
- , ref List<List<string>> pListData, int iPage)
- {
- int LeftWidth = 30;
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int TableWidth = size.Width - LeftWidth * 2;
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblOrder = dtSet.Tables["ds1"];//订单
- DataTable tblDigital = dtSet.Tables["ds2"];//数码
- DataTable tblSights = dtSet.Tables["ds3"];//景点
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];//取件时间
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//客户资料
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- if (tbl.Rows.Count <= 0)
- {
- MessageBoxCustom.Show("未设置影楼信息"); return;
- }
- DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
- int IntoRegisterQuantit = 0;
- int IntoBottomQuantity = 0;
- for (int i = 0; i < tblIntoRB.Rows.Count; i++)
- {
- IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
- IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
- }
- ///付款方式集合
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- if (pListData.Count == 0)
- {
- pListData = GetProductOrServiceListData(g1, TableWidth, tblProductList, tblService, tblSights, "写真预约单内容详情字体大小",true,460);
- }
- #region 获取数据
- string MName = "";
- string MTelephone = "";
- string MIDNumber = "";
- string MMicroSignal = "";
- string MQQ = "";
- string MAddress = "";
- if (tblClient.Rows.Count > 0)
- {
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1")
- {
- MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- int InnerSights = 0;
- int OuterSights = 0;
- string strSights = LYFZ.BLL.OtherCommonModel.FontConversion("景点:\r\n");
- string StrPhotoTime = "";
- string StrPhotographer = "";
- string StrMakeupArtist = "";
- for (int i = 0; i < tblSights.Rows.Count; i++)
- {
- if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
- {
- InnerSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
- {
- OuterSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- strSights += (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- strSights += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- strSights += "\r\n";
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_Photographer"].ToString().Trim()))
- {
- StrPhotographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_Photographer"]);
- }
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim()))
- {
- StrMakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_MakeupArtist"]);
- }
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) != "")
- {
- if (StrPhotoTime == "")
- {
- StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- else if (Convert.ToDateTime(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(StrPhotoTime))
- {
- StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- }
- }
- string StrFilmSelectionTime = "";
- if (tblDigital.Rows.Count > 0)
- {
- StrFilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString(tblDigital.Rows[0]["Ordv_FilmSelectionTime"]);
- }
- #endregion
- Font ft17 = new Font("宋体", 17);
- Font ft12 = new Font("宋体", 12);
- Font ft9 = new Font("宋体", 9);
- string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string StrValue = "NO." + StrRandom(strShowNumber);
- string strNumber = StrValue;
- List<string> data = pListData[iPage];
- Bitmap bitmap = new Bitmap(827, 1150);
- Graphics g = g1;//Graphics.FromImage(bitmap);
- #region LOG抬头
- int Rec1Height = 0;
- Rectangle rec1;
- Image imgLog = CachePhoto(PhotoLogType.Portrait, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约写真单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 120);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约写真单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- Rec1Height = 120 - rec1.Height;
- }
- #endregion
- int LeftAdd = 3;
- int TopAdd = 6;
- int RowHeight = 25;
- int RowContentHeight = 18;
- int Unit = TableWidth / 25;
- int ColumnWidth1 = Unit * 3 - Unit / 2 + 15;
- int ColumnWidth2 = Unit * 5;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 5;
- int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
- int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- #region 始行
- Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]), ft12, b, rec2);
- //string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- //string StrValue = "NO." + StrRandom(strShowNumber);
- SizeF sizef = g.MeasureString(strNumber, ft12);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
- g.DrawString(strNumber, ft12, b, rec2_1);
- #endregion
- #region 左排
- #region 第一行
- Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名"), ft12, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MName, ft12, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- if (StrIntoBottom == "0")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
- }
- else if (StrIntoBottom == "-1")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
- }
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(StrIntoBottom, ft12, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第四表与第五列的界线
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft12, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft12, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第四表与第五列的界线
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MMicroSignal, ft12, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
- Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装数"), ft12, b, rec5_3);//画第三列的列标题
- Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
- Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
- g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
- Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(InnerSights.ToString(), ft12, b, rec5_4);//画第四列的列标题
- Point p54_1 = new Point(p53_1.X + ColumnWidth4, rec5.Y);
- Point p54_2 = new Point(p53_1.X + ColumnWidth4, rec5.Y + rec5.Height);
- g.DrawLine(p, p54_1, p54_2);//画第四表与第五列的界线
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6);//画标题矩形
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString("QQ", ft12, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
- Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MQQ, ft12, b, rec6_2);//画第二列的列标题
- Point p62_1 = new Point(p61_1.X + ColumnWidth2, rec6.Y);
- Point p62_2 = new Point(p61_1.X + ColumnWidth2, rec6.Y + rec6.Height);
- g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装数"), ft12, b, rec6_3);//画第三列的列标题
- Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
- Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
- g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(OuterSights.ToString(), ft12, b, rec6_4);//画第四列的列标题
- Point p64_1 = new Point(p63_1.X + ColumnWidth4, rec6.Y);
- Point p64_2 = new Point(p63_1.X + ColumnWidth4, rec6.Y + rec6.Height);
- g.DrawLine(p, p64_1, p64_2);//画第四表与第五列的界线
- #endregion
- #region 第四、五行
- int rec7_Y = rec6.Y + rec6.Height;
- int rec9Height = 0;
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- {
- Rectangle rec6A = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6A);//画标题矩形
- Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec6A_1);//画第一列的列标题
- Point p6A1_1 = new Point(rec6A.X + ColumnWidth1, rec6A.Y);
- Point p6A1_2 = new Point(rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p6A1_1, p6A1_2);//画第一表与第二列的界线
- Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, p6A1_1.Y + TopAdd, rec3.Width - ColumnWidth1, RowContentHeight);
- g.DrawString(MIDNumber, ft12, b, rec6A_2);//画第二列的列标题
- rec7_Y = rec6A.Y + rec6A.Height;
- rec9Height = RowHeight;
- }
- #endregion
- #region 第五行
- Rectangle rec7 = new Rectangle(rec6.X, rec7_Y, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft12, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
- Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
- g.DrawString(MAddress, ft12, b, rec7_2);//画第二列的列标题
- Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
- Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
- #endregion
- #region 第七行
- Rectangle rec8A = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec8A);//画标题矩形
- Rectangle rec8A_1 = new Rectangle(rec8A.X + LeftAdd, rec8A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("喜爱风格"), ft12, b, rec8A_1);//画第一列的列标题
- Point p8A1_1 = new Point(rec8A.X + ColumnWidth1, rec8A.Y);
- Point p8A1_2 = new Point(rec8A.X + ColumnWidth1, rec8A.Y + rec8A.Height);
- g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, rec8A.Width - rec8A_1.Width, RowContentHeight);
- string[] OrdLovedStyle = tblOrder.Rows[0]["Ord_LovedStyle"].ToString().Trim().Split('|');
- string StrLovedStyle = "";
- for (int i = 0; i < OrdLovedStyle.Length; i++)
- {
- if (OrdLovedStyle[i].Trim() != "")
- {
- string[] StrID = OrdLovedStyle[i].Trim().Split('_');
- DataRow dtRow = tblStyle.Rows.Find(StrID[1].Trim());
- if (dtRow != null)
- {
- StrLovedStyle += dtRow["Style_Name"] + ",";
- }
- }
- }
- g.DrawString(StrLovedStyle.TrimEnd(','), ft12, b, rec8A_2);//画第六列的列标题
- #endregion
- #region 第一列
- #region 第一行
- Rectangle rec9 = new Rectangle(rec8A.X, rec8A.Y + rec8A.Height, rec3.Width, 535 - RowHeight + Rec1Height - rec9Height);
- g.DrawRectangle(p, rec9);//画标题矩形
- /*string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("详细内容:");
- for (int i = 0; i < tblProductList.Rows.Count; i++)
- { StrProdName += "\r\n" + tblProductList.Rows[i]["ProdName"].ToString().Trim(); }
- for (int i = 0; i < tblService.Rows.Count; i++)
- { StrProdName += "\r\n" + tblService.Rows[i]["ProdName"].ToString().Trim(); }
- Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width, rec9.Height - TopAdd * 2);
- g.DrawString(StrProdName + "\r\n\r\n" + strSights, GetFontSize("写真预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题*/
- float _infoHeight = 0;
- Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, rec9.Height - TopAdd * 2);
- string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("详细内容:");
- SizeF infoSizef = g.MeasureString(StrProdName,
- GetFontSize("写真预约单内容详情字体大小"), rec9.Width);
- g.DrawString(StrProdName, GetFontSize("写真预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
- _infoHeight += infoSizef.Height;
- ///此处取单位在商品删除和下架时报错 需要修改
- //for (int i = 0; i < tblProductList.Rows.Count; i++)
- //{
- // if (i == 0)
- // {
- // PrintContentData("商品:", g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
- // }
- // string strName = tblProductList.Rows[i]["ProdName"].ToString().Trim();
- // PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
- //}
- //for (int i = 0; i < tblService.Rows.Count; i++)
- //{
- // if (i == 0)
- // {
- // PrintContentData("服务:", g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
- // }
- // string strName = tblService.Rows[i]["ProdName"].ToString().Trim();
- // PrintContentData(" " + strName, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
- //}
- ////g.DrawString(StrProdName + "\r\n\r\n" + StrSights, GetFontSize("婚纱预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
- //PrintContentData("\r\n\r\n" + strSights, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
- foreach (string str in data)
- {
- PrintContentData(" " + str, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
- }
- #endregion
- #region 第二行
- Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec3.Width, 100);
- g.DrawRectangle(p, recA1);//画标题矩形
- Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width, recA1.Height - TopAdd * 2);
- string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim() ;
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- disInfo += "\r\n付款:" + strPaymentMsg;
- }
- g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
- #endregion
- #region 第三行
- Rectangle recA2 = new Rectangle(recA1.X, recA1.Y + recA1.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA2);//画标题矩形
- Rectangle recA2_1 = new Rectangle(recA2.X + LeftAdd, recA2.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft12, b, recA2_1);//画第一列的列标题
- Point pA21_1 = new Point(recA2.X + ColumnWidth1, recA2.Y);
- Point pA21_2 = new Point(recA2.X + ColumnWidth1, recA2.Y + recA2.Height);
- g.DrawLine(p, pA21_1, pA21_2);//画第一表与第二列的界线
- Rectangle recA2_2 = new Rectangle(pA21_1.X + LeftAdd, pA21_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(StrPhotographer, ft12, b, recA2_2);//画第二列的列标题
- Point pA22_1 = new Point(pA21_1.X + ColumnWidth2, recA2.Y);
- Point pA22_2 = new Point(pA21_1.X + ColumnWidth2, recA2.Y + recA2.Height);
- g.DrawLine(p, pA22_1, pA22_2);//画第二表与第三列的界线
- Rectangle recA2_3 = new Rectangle(pA22_1.X + LeftAdd, pA22_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft12, b, recA2_3);//画第三列的列标题
- Point pA23_1 = new Point(pA22_1.X + ColumnWidth3, recA2.Y);
- Point pA23_2 = new Point(pA22_1.X + ColumnWidth3, recA2.Y + recA2.Height);
- g.DrawLine(p, pA23_1, pA23_2);//画第三表与第四列的界线
- Rectangle recA2_4 = new Rectangle(pA23_1.X + LeftAdd, pA23_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(StrMakeupArtist.Trim(), ft12, b, recA2_4);//画第四列的列标题
- Point pA24_1 = new Point(pA23_1.X + ColumnWidth4, recA2.Y);
- Point pA24_2 = new Point(pA23_1.X + ColumnWidth4, recA2.Y + recA2.Height);
- g.DrawLine(p, pA24_1, pA24_2);//画第四表与第五列的界线
- #endregion
- #region 第四行
- Rectangle recA3 = new Rectangle(recA2.X, recA2.Y + recA2.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA3);//画标题矩形
- Rectangle recA3_1 = new Rectangle(recA3.X + LeftAdd, recA3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍摄时间"), ft12, b, recA3_1);//画第一列的列标题
- Point pA31_1 = new Point(recA3.X + ColumnWidth1, recA3.Y);
- Point pA31_2 = new Point(recA3.X + ColumnWidth1, recA3.Y + recA3.Height);
- g.DrawLine(p, pA31_1, pA31_2);//画第一表与第二列的界线
- Rectangle recA3_2 = new Rectangle(pA31_1.X + LeftAdd, pA31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(StrPhotoTime, ft12, b, recA3_2);//画第二列的列标题
- Point pA32_1 = new Point(pA31_1.X + ColumnWidth2, recA3.Y);
- Point pA32_2 = new Point(pA31_1.X + ColumnWidth2, recA3.Y + recA3.Height);
- g.DrawLine(p, pA32_1, pA32_2);//画第二表与第三列的界线
- Rectangle recA3_3 = new Rectangle(pA32_1.X + LeftAdd, pA32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件日期"), ft12, b, recA3_3);//画第三列的列标题
- Point pA33_1 = new Point(pA32_1.X + ColumnWidth3, recA3.Y);
- Point pA33_2 = new Point(pA32_1.X + ColumnWidth3, recA3.Y + recA3.Height);
- g.DrawLine(p, pA33_1, pA33_2);//画第三表与第四列的界线
- string strPickupTime = "";
- if (tblPickupTime.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
- {
- strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
- }
- }
- Rectangle recA3_4 = new Rectangle(pA33_1.X + LeftAdd, pA33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(strPickupTime, ft12, b, recA2_4);//画第四列的列标题
- #endregion
- #endregion
- #region 第七行
- Rectangle recA4 = new Rectangle(recA3.X, recA3.Y + recA3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, recA4);//画标题矩形
- Rectangle recA4_1 = new Rectangle(recA4.X + LeftAdd, recA4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片日期"), ft12, b, recA4_1);//画第一列的列标题
- Point pA41_1 = new Point(recA4.X + ColumnWidth1, recA4.Y);
- Point pA41_2 = new Point(recA4.X + ColumnWidth1, recA4.Y + recA4.Height);
- g.DrawLine(p, pA41_1, pA41_2);//画第一表与第二列的界线
- Rectangle recA4_2 = new Rectangle(pA41_1.X + LeftAdd, pA41_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
- g.DrawString(StrFilmSelectionTime, ft12, b, recA4_2);//画第二列的列标题
- #endregion
- #endregion
- #region 右排
- #region 第一行
- Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
- g.DrawRectangle(p, Rrec3);//画标题矩形
- Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
- Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
- Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
- g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
- Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
- #endregion
- #region 第二行
- Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec4);//画标题矩形
- Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
- Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
- Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
- g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
- Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
- #endregion
- #region 第三行
- Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec5);//画标题矩形
- Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约定金"), ft12, b, Rrec5_5);//画第五列的列标题
- Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
- Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
- g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
- Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
- #endregion
- #region 第四行
- Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec6);//画标题矩形
- Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
- Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
- Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
- g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
- Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
- #endregion
- #region 第六行
- Rectangle Rrec8 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec8);//画标题矩形
- Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft12, b, Rrec8_5);//画第五列的列标题
- Point Rp85_1 = new Point(Rp65_1.X, Rrec8.Y);
- Point Rp85_2 = new Point(Rp65_1.X, Rrec8.Y + Rrec8.Height);
- g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
- Rectangle rec8_6 = new Rectangle(Rp85_1.X, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
- #endregion
- #region 第一列
- Rectangle Rrec10 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA2.Y - Rrec8.Y);
- g.DrawRectangle(p, Rrec10);//画标题矩形
- StrValue = "";
- if (PrintOtherData.ContainsKey("写真预约单注意事项说明") && PrintOtherData["写真预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["写真预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
- Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("写真预约单注意事项字体大小"), minFontSize: 6);
- PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
- #endregion
- #region 顾客签字
- Rectangle RrecA5 = new Rectangle(Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2);
- g.DrawRectangle(p, RrecA5);//画标题矩形
- Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
- Point RpA51_1 = new Point(Rp65_1.X, RrecA5.Y);
- Point RpA51_2 = new Point(Rp65_1.X, RrecA5.Y + RrecA5.Height);
- g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
- #endregion
- #endregion
- #region 尾行
- string rec2Value = "网址:" + tbl.Rows[0]["Company_URL"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA4.Y + recA4.Height + TopAdd, FtWidth, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim(), ft9, b, recA6_1);//画第一列的列标题
- Rectangle recA6 = new Rectangle(recA4.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
- Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("页:") + (iPage + 1) + "/" + pListData.Count;
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA8 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA7.Y + recA7.Height - TopAdd, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, recA8);//画第一列的列标题
- #endregion
- // bitmapList.Add(bitmap);
- }
- /// <summary>
- /// 写真二等份打印
- /// </summary>
- /// <param name="objValue"></param>
- private static void Portrait_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size
- , ref List<List<string>> pListData, int iPage)
- {
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblOrder = dtSet.Tables["ds1"];//订单
- DataTable tblDigital = dtSet.Tables["ds2"];//数码
- DataTable tblSights = dtSet.Tables["ds3"];//景点
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];//取件时间
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//客户资料
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- DataTable tblIntoRB = dtSet.Tables["ds10"];//订单定金
- int IntoRegisterQuantit = 0;
- int IntoBottomQuantity = 0;
- for (int i = 0; i < tblIntoRB.Rows.Count; i++)
- {
- IntoRegisterQuantit += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoRegisterQuantity"]);
- IntoBottomQuantity += Convert.ToInt32(tblIntoRB.Rows[i]["Ordv_IntoBottomQuantity"]);
- }
- ///获取付款方式集合
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft17 = new Font("宋体", 17);
- Font ft13 = new Font("宋体", 13);
- Font ft10 = new Font("宋体", 10);
- Font ft9 = new Font("宋体", 9);
- #region 获取数据
- string MName = "";
- string MTelephone = "";
- string MIDNumber = "";
- string MMicroSignal = "";
- string PMemberCardNumber = "";
- string MQQ = "";
- string MAddress = "";
- if (tblClient.Rows.Count > 0)
- {
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1")
- {
- MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- DataTable tblMember = orbll.GetView_Custom("tb_ErpMemberCard", StrWhere: "Mc_CustomerNumber = '" + tblClient.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Mc_CradNumber").Tables[0];
- if (tblMember.Rows.Count > 0)
- {
- PMemberCardNumber = tblMember.Rows[0]["Mc_CradNumber"].ToString();
- }
- }
- }
- }
- int InnerSights = 0;
- int OuterSights = 0;
- string strSights = LYFZ.BLL.OtherCommonModel.FontConversion("拍摄名称:");
- string StrPhotoTime = "";
- string StrPhotographer = "";
- string StrMakeupArtist = "";
- for (int i = 0; i < tblSights.Rows.Count; i++)
- {
- if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "0")
- {
- InnerSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- if (tblSights.Rows[i]["Ordpg_SightsType"].ToString().Trim() == "1")
- {
- OuterSights += Convert.ToInt32(tblSights.Rows[i]["Ordpg_ApparelQuantity"]);
- }
- strSights += "\r\n" + (i + 1) + "." + tblSights.Rows[i]["Ordpg_Sights"].ToString().Trim();
- strSights += tblSights.Rows[i]["Ordpg_SightsRemark"].ToString().Trim();
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_Photographer"].ToString().Trim()))
- {
- StrPhotographer = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_Photographer"]);
- }
- if (!string.IsNullOrEmpty(tblSights.Rows[i]["Ordpg_MakeupArtist"].ToString().Trim()))
- {
- StrMakeupArtist = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetUserName(tblSights.Rows[i]["Ordpg_MakeupArtist"]);
- }
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) != "")
- {
- if (StrPhotoTime == "")
- {
- StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- else if (Convert.ToDateTime(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]) < Convert.ToDateTime(StrPhotoTime))
- {
- StrPhotoTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblSights.Rows[i]["Ordpg_ReservationPhotographyTime"]);
- }
- }
- }
- string StrFilmSelectionTime = "";
- if (tblDigital.Rows.Count > 0)
- {
- StrFilmSelectionTime = LYFZ.Command.Command_Validate.DateTimeToString2(tblDigital.Rows[0]["Ordv_FilmSelectionTime"]);
- }
- string StrProdName = "";
- //for ( int i = 0; i < tblProductList.Rows.Count; i++ )
- //{
- // StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- //}
- //for ( int i = 0; i < tblService.Rows.Count; i++ )
- //{
- // StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- //}
- //StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
- #endregion
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 20;
- int RowContentHeight = 18;
- int Unit = TableWidth / 32;
- int ColumnWidth1 = Unit * 3;
- int ColumnWidth2 = Unit * 4;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 4;
- int ColumnWidth5 = Unit * 3;
- int ColumnWidth6 = Unit * 4;
- int ColumnWidth7 = Unit * 3;
- int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
- if (pListData.Count == 0)
- {
- pListData = GetProductOrServiceHelfListData(g1, TableWidth, tblProductList, tblService, tblSights,disInfo: LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim());
- }
- string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom(StrValue);
- string strNumber = rec3Value;
- List<string> data = pListData[iPage];
- Bitmap bitmap = new Bitmap(827, 580);
- Graphics g = g1;//Graphics.FromImage(bitmap);
- foreach (string str in data)
- {
- if (!string.IsNullOrEmpty(StrProdName))
- {
- StrProdName += "\r\n";
- }
- StrProdName += str;
- }
- #region 金色童年收据凭据
- Rectangle rec1;
- int Rec1Height = 0;
- int TopHeightCount = 0;
- Image imgLog = CachePhoto(PhotoLogType.Portrait, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约写真单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约写真单标题", ft17).Height);
- TopHeightCount = 3;
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约写真单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- }
- #endregion
- #region 开单日期;
- string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]);
- SizeF sizef = g.MeasureString(strOrderCreatedData, ft10);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
- g.DrawString(strOrderCreatedData, ft10, b, rec1A);
- #endregion
- #region NO.
- sizef = g.MeasureString(strNumber, ft10);
- rec1A = new Rectangle(rec1A.Right + 10, rec1A.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
- g.DrawString(strNumber, ft10, b, rec1A);
- #endregion
- /*#region NO.
- string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom(StrValue);
- SizeF sizef = g.MeasureString(rec3Value, ft10);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
- g.DrawString(rec3Value, ft10, b, rec1A);
- #endregion*/
- #region 打印时间
- string StrPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印时间:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-dd HH:mm");
- sizef = g.MeasureString(StrPrintDate, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Y, FtWidth, FtHeight);
- g.DrawString(StrPrintDate, ft10, b, rec2);
- #endregion
- #region 第一行
- Rectangle rec3 = new Rectangle(LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 2, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MName, ft9, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 2, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话"), ft9, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft9, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
- Rectangle rec3_5 = new Rectangle(p34_1.X + LeftAdd * 2, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec3_5);//画第三列的列标题
- Point p35_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
- Point p35_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
- g.DrawLine(p, p35_1, p35_2);//画第三表与第四列的界线
- Rectangle rec3_6 = new Rectangle(p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- g.DrawString(OrdPrice, ft9, b, rec3_6);//画第四列的列标题
- Point p36_1 = new Point(p35_1.X + ColumnWidth6, rec3.Y);
- Point p36_2 = new Point(p35_1.X + ColumnWidth6, rec3.Y + rec3.Height);
- g.DrawLine(p, p36_1, p36_2);//画第二表与第三列的界线
- Rectangle rec3_7 = new Rectangle(p36_1.X + LeftAdd * 2, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec3_7);//画第三列的列标题
- Point p37_1 = new Point(p36_1.X + ColumnWidth7, rec3.Y);
- Point p37_2 = new Point(p36_1.X + ColumnWidth7, rec3.Y + rec3.Height);
- g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
- Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec3_8);//画第四列的列标题
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 2, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft9, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(IntoRegisterQuantit.ToString().Trim(), ft9, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 2, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft9, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- string StrIntoBottom = IntoBottomQuantity.ToString().Trim();
- if (StrIntoBottom == "0")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
- }
- else if (StrIntoBottom == "-1")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
- }
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideBottomAndListed)
- g.DrawString(StrIntoBottom, ft9, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
- Rectangle rec4_5 = new Rectangle(p44_1.X + LeftAdd * 2, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_5);//画第三列的列标题
- Point p45_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
- Point p45_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
- g.DrawLine(p, p45_1, p45_2);//画第三表与第四列的界线
- Rectangle rec4_6 = new Rectangle(p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideArrears)
- g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6);//画第四列的列标题
- Point p46_1 = new Point(p45_1.X + ColumnWidth6, rec4.Y);
- Point p46_2 = new Point(p45_1.X + ColumnWidth6, rec4.Y + rec4.Height);
- g.DrawLine(p, p46_1, p46_2);//画第二表与第三列的界线
- Rectangle rec4_7 = new Rectangle(p46_1.X + LeftAdd * 2, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec4_7);//画第三列的列标题
- Point p47_1 = new Point(p46_1.X + ColumnWidth7, rec4.Y);
- Point p47_2 = new Point(p46_1.X + ColumnWidth7, rec4.Y + rec4.Height);
- g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
- Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec4_8);//画第四列的列标题
- #endregion
- #region 第三行
- //Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
- //g.DrawRectangle(p, rec5);//画标题矩形
- //Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 12 - 1, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5_1);//画第一列的列标题
- //Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- //Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- //g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- //Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6, RowContentHeight);
- //g.DrawString(MAddress, ft9, b, rec5_2);//画第二列的列标题
- //Point p52_1 = new Point(p51_1.X + rec5_2.Width, rec5.Y);
- //Point p52_2 = new Point(p51_1.X + rec5_2.Width, rec5.Y + rec5.Height);
- //g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- //Rectangle rec5_7 = new Rectangle(p52_1.X + LeftAdd * 7, p52_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门 市"), ft9, b, rec5_7);//画第三列的列标题
- //Point p57_1 = new Point(p52_1.X + ColumnWidth7, rec5.Y);
- //Point p57_2 = new Point(p52_1.X + ColumnWidth7, rec5.Y + rec5.Height);
- //g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
- //Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- //g.DrawString(tblOrder.Rows[0]["OrdPe_OrdersPerson"].ToString(), ft9, b, rec5_8);//画第四列的列标题
- Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 2, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("内景服装"), ft9, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + rec5_1.Width, rec5.Y);
- Point p51_2 = new Point(rec5.X + rec5_1.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(InnerSights.ToString(), ft9, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + rec5_2.Width, rec5.Y);
- Point p52_2 = new Point(p51_1.X + rec5_2.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd * 2, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装"), ft9, b, rec5_3);//画第一列的列标题
- Point p53_1 = new Point(p52_1.X + rec5_3.Width, rec5.Y);
- Point p53_2 = new Point(p52_1.X + rec5_3.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p53_1, p53_2);//画第一表与第二列的界线
- Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- if (!LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintHideClothingCount)
- g.DrawString(OuterSights.ToString(), ft9, b, rec5_4);//画第二列的列标题
- Point p54_1 = new Point(p53_1.X + rec5_4.Width, rec5.Y);
- Point p54_2 = new Point(p53_1.X + rec5_4.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p54_1, p54_2);//画第二表与第三列的界线
- Rectangle rec5_5 = new Rectangle(p54_1.X + LeftAdd * 2, p54_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("会员卡号"), ft9, b, rec5_5);//画第一列的列标题
- Point p55_1 = new Point(p54_1.X + rec5_5.Width, rec5.Y);
- Point p55_2 = new Point(p54_1.X + rec5_5.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p55_1, p55_2);//画第一表与第二列的界线
- Rectangle rec5_6 = new Rectangle(p55_1.X + LeftAdd, p55_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- g.DrawString(PMemberCardNumber, ft9, b, rec5_6);//画第二列的列标题
- Point p56_1 = new Point(p55_1.X + rec5_6.Width, rec5.Y);
- Point p56_2 = new Point(p55_1.X + rec5_6.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p56_1, p56_2);//画第二表与第三列的界线
- Rectangle rec5_7 = new Rectangle(p56_1.X + LeftAdd * 4, p56_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门 市"), ft9, b, rec5_7);//画第三列的列标题
- Point p57_1 = new Point(p56_1.X + rec5_7.Width, rec5.Y);
- Point p57_2 = new Point(p56_1.X + rec5_7.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
- Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
- #endregion
- #region 第三四行
- Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5A);//画标题矩形
- Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_1);//画第一列的列标题
- Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
- Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
- Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, TableWidth - ColumnWidth1, RowContentHeight);
- g.DrawString(MAddress.ToString().Trim(), ft9, b, rec5A_2);//画第二列的列标题
- //Point p5A2_1 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y);
- //Point p5A2_2 = new Point(p5A1_1.X + ColumnWidth2, rec5A.Y + rec5A.Height);
- //g.DrawLine(p, p5A2_1, p5A2_2);//画第二表与第三列的界线
- //Rectangle rec5A_3 = new Rectangle(p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("外景服装"), ft9, b, rec5A_3);//画第一列的列标题
- //Point p5A3_1 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y);
- //Point p5A3_2 = new Point(p5A2_1.X + ColumnWidth3, rec5A.Y + rec5A.Height);
- //g.DrawLine(p, p5A3_1, p5A3_2);//画第一表与第二列的界线
- //Rectangle rec5A_4 = new Rectangle(p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- //g.DrawString(OuterSights.ToString().Trim(), ft9, b, rec5A_4);//画第二列的列标题
- //Point p5A4_1 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y);
- //Point p5A4_2 = new Point(p5A3_1.X + ColumnWidth4, rec5A.Y + rec5A.Height);
- //g.DrawLine(p, p5A4_1, p5A4_2);//画第二表与第三列的界线
- //Rectangle rec5A_5 = new Rectangle(p5A4_1.X + LeftAdd * 2, p5A4_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- //g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5A_5);//画第三列的列标题
- //Point p5A5_1 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y);
- //Point p5A5_2 = new Point(p5A4_1.X + ColumnWidth5, rec5A.Y + rec5A.Height);
- //g.DrawLine(p, p5A5_1, p5A5_2);//画第三表与第四列的界线
- //Rectangle rec5A_6 = new Rectangle(p5A5_1.X + LeftAdd, p5A5_1.Y + TopAdd, ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowContentHeight);
- //g.DrawString(MAddress, ft9, b, rec5A_6);//画第四列的列标题
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle(rec5A.X, rec5A.Y + rec5A.Height, TableWidth, 315 - Rec1Height - LeftWidth);
- g.DrawRectangle(p, rec6);//画标题矩形
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("套系内容");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height) + 1;
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
- g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
- Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, TableWidth - ColumnWidth8 - ColumnWidth7 - (ColumnWidth1 / 2) - rec6_1.Width, rec6.Height - TopAdd * 2);
- g.DrawString(StrProdName, GetFontSize("写真预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
- Point p62_1 = new Point(p61_1.X + rec6_2.Width, rec6.Y);
- Point p62_2 = new Point(p61_1.X + rec6_2.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- Rectangle rec6_3 = new Rectangle(rec6_2.X + rec6_2.Width + LeftAdd, rec6_1.Y, rec6_1.Width, rec6_1.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec6_3);//画第三列的列标题
- Point p63_1 = new Point(p62_1.X + rec6_3.Width, rec6.Y);
- Point p63_2 = new Point(p62_1.X + rec6_3.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- StrValue = "";
- if (PrintOtherData.ContainsKey("写真预约单注意事项说明") && PrintOtherData["写真预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["写真预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth8 + ColumnWidth7 + (ColumnWidth1 / 2) - rec6_3.Width, rec6.Height - TopAdd * 2);
- g.DrawString(StrValue, GetFontSize("写真预约单注意事项字体大小"), b, rec6_4);//画第四列的列标题
- #endregion
- #region 第六行
- int SWidth = TableWidth / 8;
- int Column1 = SWidth - SWidth / 3 + 5;
- int Column2 = SWidth + SWidth / 3;
- Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, TableWidth - Column1 - Column2, RowHeight);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd * 2, rec7.Y + TopAdd, Column1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("摄影师"), ft9, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + rec7_1.Width, rec7.Y);
- Point p71_2 = new Point(rec7.X + rec7_1.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, Column2, RowContentHeight);
- g.DrawString(StrPhotographer, ft9, b, rec7_2);//画第六列的列标题
- Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
- Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p72_1, p72_2);//画第一表与第二列的界线
- Rectangle rec7_3 = new Rectangle(p72_1.X + LeftAdd * 2, p72_1.Y + TopAdd, rec7_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("化妆师"), ft9, b, rec7_3);//画第一列的列标题
- Point p73_1 = new Point(p72_1.X + rec7_3.Width, rec7.Y);
- Point p73_2 = new Point(p72_1.X + rec7_3.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p73_1, p73_2);//画第一表与第二列的界线
- Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7_2.Width - 15, RowContentHeight);
- g.DrawString(StrMakeupArtist.Trim(), ft9, b, rec7_4);//画第六列的列标题
- Point p74_1 = new Point(p73_1.X + rec7_4.Width, rec7.Y);
- Point p74_2 = new Point(p73_1.X + rec7_4.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p74_1, p74_2);//画第一表与第二列的界线
- Rectangle rec7_5 = new Rectangle(p74_1.X + LeftAdd * 2, p74_1.Y + TopAdd, rec7_3.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("拍照时间"), ft9, b, rec7_5);//画第一列的列标题
- Point p75_1 = new Point(p74_1.X + rec7_5.Width, rec7.Y);
- Point p75_2 = new Point(p74_1.X + rec7_5.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p75_1, p75_2);//画第一表与第二列的界线
- Rectangle rec7_6 = new Rectangle(p75_1.X + LeftAdd, p75_1.Y + TopAdd, rec7_4.Width + 15, RowContentHeight);
- g.DrawString(StrPhotoTime.Trim(), ft9, b, rec7_6);//画第六列的列标题
- #endregion
- #region 第七行
- Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec7.Width, RowHeight);
- g.DrawRectangle(p, rec8);//画标题矩形
- Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd * 2, rec8.Y + TopAdd, rec7_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("选片时间"), ft9, b, rec8_1);//画第一列的列标题
- Point p81_1 = new Point(rec8.X + rec7_1.Width, rec8.Y);
- Point p81_2 = new Point(rec8.X + rec7_1.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
- Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, SWidth + SWidth / 3, RowContentHeight);
- g.DrawString(StrFilmSelectionTime, ft9, b, rec8_2);//画第六列的列标题
- Point p82_1 = new Point(p81_1.X + rec8_2.Width, rec8.Y);
- Point p82_2 = new Point(p81_1.X + rec8_2.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p82_1, p82_2);//画第一表与第二列的界线
- Rectangle rec8_3 = new Rectangle(p82_1.X + LeftAdd * 2, p82_1.Y + TopAdd, rec8_1.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("设计师"), ft9, b, rec8_3);//画第一列的列标题
- Point p83_1 = new Point(p82_1.X + rec8_3.Width, rec8.Y);
- Point p83_2 = new Point(p82_1.X + rec8_3.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p83_1, p83_2);//画第一表与第二列的界线
- Rectangle rec8_4 = new Rectangle(p83_1.X + LeftAdd, p83_1.Y + TopAdd, rec8_2.Width - 15, RowContentHeight);
- g.DrawString("", ft9, b, rec8_4);//画第六列的列标题
- Point p84_1 = new Point(p83_1.X + rec8_4.Width, rec8.Y);
- Point p84_2 = new Point(p83_1.X + rec8_4.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p84_1, p84_2);//画第一表与第二列的界线
- Rectangle rec8_5 = new Rectangle(p84_1.X + LeftAdd * 2, p84_1.Y + TopAdd, rec8_3.Width, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("取件时间"), ft9, b, rec8_5);//画第一列的列标题
- Point p85_1 = new Point(p84_1.X + rec8_5.Width, rec8.Y);
- Point p85_2 = new Point(p84_1.X + rec8_5.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p85_1, p85_2);//画第一表与第二列的界线
- string strPickupTime = "";
- if (tblPickupTime.Rows.Count > 0)
- {
- if (!string.IsNullOrEmpty(tblPickupTime.Rows[0]["OPlist_PickupTime"].ToString().Trim()))
- {
- strPickupTime = LYFZ.Command.Command_Validate.DateTimeToString(tblPickupTime.Rows[0]["OPlist_PickupTime"]);
- }
- }
- Rectangle rec8_6 = new Rectangle(p85_1.X + LeftAdd, p85_1.Y + TopAdd, rec8_4.Width + 15, RowContentHeight);
- g.DrawString(strPickupTime, ft9, b, rec8_6);//画第六列的列标题
- #endregion
- #region 顾客签字
- Rectangle rec8A = new Rectangle(rec7.X + rec7.Width, rec7.Y, Column1 + Column2, rec7.Height + rec8.Height);
- g.DrawRectangle(p, rec8A);//画标题矩形
- Rectangle rec8A_1 = new Rectangle(rec7.X + rec7.Width + LeftAdd * 2, rec8A.Y + TopAdd * 3, Column1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8A_1);//画第一列的列标题
- Point p8A1_1 = new Point(rec8A.X + Column1, rec8A.Y);
- Point p8A1_2 = new Point(rec8A.X + Column1, rec8A.Y + rec8A.Height);
- g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, Column2, RowContentHeight);
- //g.DrawString("", ft9, b, rec8A_2);//画第六列的列标题
- //Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, Column2, RowContentHeight);
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec7.X + LeftAdd * 3 + 5, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
- g.DrawLine(p, rec7.X, p8A1_1.Y, rec7.X, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X + Column1, p8A1_1.Y, rec7.X + Column1, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X + TableWidth, p8A1_1.Y, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X, p8A1_2.Y + rec8A_2.Height + 5, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- rec8A_2.Height += 10;
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec7.X + LeftAdd * 22, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
- }
- else
- {
- rec8A_2.Height = 0;
- }
- #endregion
- #region 尾行
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec8.Y + rec8.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9 = new Rectangle(rec8.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
- #endregion
- //bitmapList.Add(bitmap);
- }
- #endregion
- #region 婚庆
- /// <summary>
- /// 订单报表婚庆版(2-加身份证号)_备份
- /// </summary>
- /// <returns></returns>
- private static void WeddingCelebration_OrderReport_Print(DataSet dtSet, Graphics g1, Size size
- , ref List<List<string>> pListData, int iPage)
- {
- int LeftWidth = 20;
- Brush b = Brushes.Black;
- Bitmap panlImage = null;
- Pen p = GetPen;
- int TableWidth = size.Width - LeftWidth * 2 - 20;
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblOrder = dtSet.Tables["ds1"];//订单
- DataTable tblDigital = dtSet.Tables["ds2"];//数码
- DataTable tblSights = dtSet.Tables["ds3"];//景点
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];//订单商品
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//服务资料
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单主接单人
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- if (tbl.Rows.Count <= 0)
- {
- MessageBoxCustom.Show("未设置影楼信息"); return;
- }
- ///付款方式集合
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- if (pListData.Count == 0)
- {
- pListData = GetProductOrServiceListData(g1, TableWidth, tblProductList, tblService, tblSights, "婚庆预约单内容详情字体大小",true,700);
- }
- #region 获取数据
- string MName = "";
- string MTelephone = "";
- string MIDNumber = "";
- string MMicroSignal = "";
- string MQQ = "";
- string MAddress = "";
- string WName = "";
- string WTelephone = "";
- string WIDNumber = "";
- string WMicroSignal = "";
- string WQQ = "";
- string WAddress = "";
- string DayForMarriage = "";
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (Convert.ToBoolean(tblClient.Rows[i]["Cus_Sex"]))
- {
- WName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- WTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- WIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- WMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- WQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- WAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
- {
- DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
- {
- DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
- }
- }
- }
- else
- {
- MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
- {
- DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
- {
- DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
- }
- }
- }
- }
- #endregion
- Font ft17 = new Font("宋体", 17);
- Font ft12 = new Font("宋体", 12);
- Font ft9 = new Font("宋体", 9);
- int sizeHeight = size.Height - 120;
- panlImage = new Bitmap(827, 1150);
- Graphics g = g1;//Graphics.FromImage( panlImage );
- #region LOG抬头
- int Rec1Height = 0;
- Rectangle rec1;
- Image imgLog = CachePhoto(PhotoLogType.Wedding, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约婚庆单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 0, TableWidth, 120);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约婚庆单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 0, srcFtWidth + 1, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- Rec1Height = 120 - rec1.Height;
- }
- #endregion
- int LeftAdd = 3;
- int TopAdd = 6;
- int RowHeight = 25;
- int RowContentHeight = 18;
- int Unit = TableWidth / 25;
- int ColumnWidth1 = Unit * 3 - Unit / 5;
- int ColumnWidth2 = Unit * 5 + Unit / 5;
- int ColumnWidth3 = Unit * 3 - Unit / 5;
- int ColumnWidth4 = Unit * 5 + Unit / 5;
- int ColumnWidth5 = Unit * 3 - Unit / 5;
- int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- #region 始行
- Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]), ft12, b, rec2);
- string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string StrValue = "NO." + StrRandom(strShowNumber);
- SizeF sizef = g.MeasureString(StrValue, ft12);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
- g.DrawString(StrValue, ft12, b, rec2_1);
- #endregion
- #region 左排
- #region 第一行
- Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("先生姓名"), ft12, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MName, ft12, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士姓名"), ft12, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(WName, ft12, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第四表与第五列的界线
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft12, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(WTelephone), ft12, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第四表与第五列的界线
- #endregion
- #region 第二、三行
- int rec5_Y = rec4.Y + rec4.Height;
- int rec9Height = 0;
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- {
- Rectangle rec4A = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight);
- g.DrawRectangle(p, rec4A);//画标题矩形
- Rectangle rec4A_1 = new Rectangle(rec4A.X + LeftAdd, rec4A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec4A_1);//画第一列的列标题
- Point p4A1_1 = new Point(rec4A.X + ColumnWidth1, rec4A.Y);
- Point p4A1_2 = new Point(rec4A.X + ColumnWidth1, rec4A.Y + rec4A.Height);
- g.DrawLine(p, p4A1_1, p4A1_2);//画第一表与第二列的界线
- Rectangle rec4A_2 = new Rectangle(p4A1_1.X + LeftAdd, p4A1_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MIDNumber, ft12, b, rec4A_2);//画第二列的列标题
- Point p4A2_1 = new Point(p4A1_1.X + ColumnWidth2, rec4A.Y);
- Point p4A2_2 = new Point(p4A1_1.X + ColumnWidth2, rec4A.Y + rec4A.Height);
- g.DrawLine(p, p4A2_1, p4A2_2);//画第二表与第三列的界线
- Rectangle rec4A_3 = new Rectangle(p4A2_1.X + LeftAdd, p4A2_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec4A_3);//画第三列的列标题
- Point p4A3_1 = new Point(p4A2_1.X + ColumnWidth3, rec4A.Y);
- Point p4A3_2 = new Point(p4A2_1.X + ColumnWidth3, rec4A.Y + rec4A.Height);
- g.DrawLine(p, p4A3_1, p4A3_2);//画第三表与第四列的界线
- Rectangle rec4A_4 = new Rectangle(p4A3_1.X + LeftAdd, p4A3_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(WIDNumber, ft12, b, rec4A_4);//画第四列的列标题
- Point p4A4_1 = new Point(p4A3_1.X + ColumnWidth4, rec4A.Y);
- Point p4A4_2 = new Point(p4A3_1.X + ColumnWidth4, rec4A.Y + rec4A.Height);
- g.DrawLine(p, p4A4_1, p4A4_2);//画第四表与第五列的界线
- rec5_Y = rec4A.Y + rec4A.Height;
- rec9Height = RowHeight;
- }
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec5_Y, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MMicroSignal, ft12, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
- Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_3);//画第三列的列标题
- Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
- Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
- g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
- Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(WMicroSignal, ft12, b, rec5_4);//画第四列的列标题
- Point p54_1 = new Point(p53_1.X + ColumnWidth4, rec5.Y);
- Point p54_2 = new Point(p53_1.X + ColumnWidth4, rec5.Y + rec5.Height);
- g.DrawLine(p, p54_1, p54_2);//画第四表与第五列的界线
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6);//画标题矩形
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd, rec6.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString("QQ", ft12, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + ColumnWidth1, rec6.Y);
- Point p61_2 = new Point(rec6.X + ColumnWidth1, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MQQ, ft12, b, rec6_2);//画第二列的列标题
- Point p62_1 = new Point(p61_1.X + ColumnWidth2, rec6.Y);
- Point p62_2 = new Point(p61_1.X + ColumnWidth2, rec6.Y + rec6.Height);
- g.DrawLine(p, p62_1, p62_2);//画第二表与第三列的界线
- Rectangle rec6_3 = new Rectangle(p62_1.X + LeftAdd, p62_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString("QQ", ft12, b, rec6_3);//画第三列的列标题
- Point p63_1 = new Point(p62_1.X + ColumnWidth3, rec6.Y);
- Point p63_2 = new Point(p62_1.X + ColumnWidth3, rec6.Y + rec6.Height);
- g.DrawLine(p, p63_1, p63_2);//画第三表与第四列的界线
- Rectangle rec6_4 = new Rectangle(p63_1.X + LeftAdd, p63_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(WQQ, ft12, b, rec6_4);//画第四列的列标题
- Point p64_1 = new Point(p63_1.X + ColumnWidth4, rec6.Y);
- Point p64_2 = new Point(p63_1.X + ColumnWidth4, rec6.Y + rec6.Height);
- g.DrawLine(p, p64_1, p64_2);//画第四表与第五列的界线
- #endregion
- #region 第五行
- Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("男宾地址"), ft12, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
- Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
- g.DrawString(MAddress, ft12, b, rec7_2);//画第二列的列标题
- Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
- Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
- #endregion
- #region 第六行
- Rectangle rec8 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec8);//画标题矩形
- Rectangle rec8_1 = new Rectangle(rec8.X + LeftAdd, rec8.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女宾地址"), ft12, b, rec8_1);//画第一列的列标题
- Point p81_1 = new Point(rec8.X + ColumnWidth1, rec8.Y);
- Point p81_2 = new Point(rec8.X + ColumnWidth1, rec8.Y + rec8.Height);
- g.DrawLine(p, p81_1, p81_2);//画第一表与第二列的界线
- Rectangle rec8_2 = new Rectangle(p81_1.X + LeftAdd, p81_1.Y + TopAdd, rec7_2.Width, RowContentHeight);
- g.DrawString(WAddress, ft12, b, rec8_2);//画第二列的列标题
- Point p82_1 = new Point(p81_1.X + rec7_2.Width, rec8.Y);
- Point p82_2 = new Point(p81_1.X + rec7_2.Width, rec8.Y + rec8.Height);
- g.DrawLine(p, p82_1, p82_2);//画第二表与第三列的界线
- #endregion
- #region 第一列
- #region 第一行
- //string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion( "商品详细:" );
- //string StrServiceName = LYFZ.BLL.OtherCommonModel.FontConversion( "服务详细:" );
- ////此处取单位在商品删除和下架时报错 需要修改
- //for ( int i = 0; i < tblProductList.Rows.Count; i++ )
- //{
- // StrProdName += "\r\n" + tblProductList.Rows[i]["ProdName"].ToString().Trim();
- //}
- //for ( int i = 0; i < tblService.Rows.Count; i++ )
- //{
- // StrServiceName += "\r\n" + tblService.Rows[i]["ProdName"].ToString().Trim();
- //}
- string StrContent = "";
- foreach (string str in pListData[iPage])
- {
- //PrintContentData(" " + str, g, rec9, LeftAdd, TopAdd, b, "写真预约单内容详情字体大小", ref _infoHeight);
- StrContent += "\r\n " + str;
- }
- int ContentFtHeight = Convert.ToInt32(g.MeasureString(StrContent, GetFontSize("婚庆预约单内容详情字体大小"), rec3.Width).Height + 1);
- int FixedHeight = 430 + RowHeight + Rec1Height - rec9Height;
- if (FixedHeight > ContentFtHeight)
- {
- ContentFtHeight = FixedHeight;
- }
- Rectangle rec9 = new Rectangle(rec8.X, rec8.Y + rec8.Height, rec3.Width, ContentFtHeight + TopAdd * 2);
- g.DrawRectangle(p, rec9);//画标题矩形
- Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width - LeftAdd * 2, ContentFtHeight);
- g.DrawString(StrContent, GetFontSize("婚庆预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
- #endregion
- #region 第二行
- Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec9.Width, 100);
- g.DrawRectangle(p, recA1);//画标题矩形
- Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width - LeftAdd * 2, recA1.Height - TopAdd * 2);
- string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- disInfo += "\r\n付款:" + strPaymentMsg;
- }
- g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
- #endregion
- #region 第三行
- Rectangle recA2 = new Rectangle(recA1.X, recA1.Y + recA1.Height, rec3.Width + ColumnWidth5, RowHeight * 2);
- g.DrawRectangle(p, recA2);//画标题矩形
- Rectangle recA2_1 = new Rectangle(recA2.X + LeftAdd, recA2.Y + RowContentHeight, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("酒店信息"), ft12, b, recA2_1);//画第一列的列标题
- Point pA21_1 = new Point(recA2.X + ColumnWidth1, recA2.Y);
- Point pA21_2 = new Point(recA2.X + ColumnWidth1, recA2.Y + recA2.Height);
- g.DrawLine(p, pA21_1, pA21_2);//画第一表与第二列的界线
- int recA2_2Width = recA2.Width - recA2_1.Width - LeftAdd * 2;
- int FtHeightA = Convert.ToInt32(g.MeasureString("酒店信息", ft12, recA2_2Width).Height);
- int FtHeightB = Convert.ToInt32(g.MeasureString(tblOrder.Rows[0]["Ord_HotelInfo"].ToString().Trim(), ft12, recA2_2Width).Height);
- int recA2_2Y = recA2_1.Y;
- int recA2Height = recA2.Height - TopAdd * 2;
- int recA2_2Count = FtHeightB / FtHeightA;
- if ((FtHeightB % FtHeightA) > 0)
- {
- recA2_2Count++;
- }
- if (recA2_2Count == 2)
- {
- recA2_2Y = pA21_1.Y + RowHeight - FtHeightA + TopAdd;
- }
- else if (recA2_2Count >= 3)
- {
- recA2_2Y = pA21_1.Y + 2;
- recA2Height = recA2.Height - TopAdd;
- }
- Rectangle recA2_2 = new Rectangle(pA21_1.X + LeftAdd, recA2_2Y, recA2_2Width, recA2Height);
- g.DrawString(tblOrder.Rows[0]["Ord_HotelInfo"].ToString().Trim(), ft12, b, recA2_2);//画第二列的列标题
- #endregion
- #endregion
- #endregion
- #region 右排
- #region 第一行
- Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
- g.DrawRectangle(p, Rrec3);//画标题矩形
- Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
- Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
- Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
- g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
- Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
- #endregion
- #region 第二行
- Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec4);//画标题矩形
- Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
- Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
- Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
- g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
- Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
- #endregion
- #region 第三行
- Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec5);//画标题矩形
- Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约定金"), ft12, b, Rrec5_5);//画第五列的列标题
- Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
- Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
- g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
- Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
- #endregion
- #region 第四行
- Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec6);//画标题矩形
- Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
- Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
- Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
- g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
- Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
- #endregion
- #region 第五行
- Rectangle Rrec7 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec7);//画标题矩形
- Rectangle Rrec7_5 = new Rectangle(Rrec7.X + LeftAdd, Rrec7.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("结婚日期"), ft12, b, Rrec7_5);//画第五列的列标题
- Point Rp75_1 = new Point(Rp65_1.X, Rrec7.Y);
- Point Rp75_2 = new Point(Rp65_1.X, Rrec7.Y + Rrec7.Height);
- g.DrawLine(p, Rp75_1, Rp75_2);//画第五表与第六列的界线
- Rectangle Rrec7_6 = new Rectangle(Rp75_1.X + LeftAdd, Rrec7_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(DayForMarriage, ft12, b, Rrec7_6);//画第六列的列标题
- #endregion
- #region 第六行
- Rectangle Rrec8 = new Rectangle(Rrec7.X, Rrec7.Y + Rrec7.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec8);//画标题矩形
- Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("婚礼顾问"), ft12, b, Rrec8_5);//画第五列的列标题
- Point Rp85_1 = new Point(Rp75_1.X, Rrec8.Y);
- Point Rp85_2 = new Point(Rp75_1.X, Rrec8.Y + Rrec8.Height);
- g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
- Rectangle rec8_6 = new Rectangle(Rp85_1.X + LeftAdd, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
- #endregion
- #region 第一列
- Rectangle Rrec10 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA2.Y - Rrec8.Y - RowHeight);
- g.DrawRectangle(p, Rrec10);//画标题矩形
- StrValue = "";
- if (PrintOtherData.ContainsKey("婚庆预约单注意事项说明") && PrintOtherData["婚庆预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["婚庆预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
- Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("婚庆预约单注意事项字体大小"), minFontSize: 6);
- PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
- #endregion
- #region 顾客签字
- Rectangle RrecA5 = new Rectangle(Rp75_1.X, Rrec10.Y + Rrec10.Height, ColumnWidth6, RowHeight * 2);
- g.DrawRectangle(p, RrecA5);//画标题矩形
- Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
- Point RpA51_1 = new Point(Rp75_1.X + ColumnWidth5, RrecA5.Y);
- Point RpA51_2 = new Point(Rp75_1.X + ColumnWidth5, RrecA5.Y + RrecA5.Height);
- g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
- #endregion
- #endregion
- #region 尾行
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA2.Y + recA2.Height + TopAdd, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, recA6_1);//画第一列的列标题
- Rectangle recA6 = new Rectangle(recA2.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
- Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
- #endregion
- //if ( l == 0 )
- //{
- // if ( sizeHeight < recA7.Y + recA7.Height )
- // {
- // sizeHeight = recA7.Y + recA7.Height;
- // }
- //}
- //else
- //{
- // break;
- //}
- //bitmapList.Add(panlImage);
- //return panlImage;
- }
- /// <summary>
- /// 婚庆二等份打印
- /// </summary>
- /// <param name="objValue"></param>
- private static void WeddingCelebration_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size
- , ref List<List<string>> pListData, int iPage)
- {
- List<Image> imglist = new List<Image>();
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblOrder = dtSet.Tables["ds1"];//订单
- DataTable tblDigital = dtSet.Tables["ds2"];//数码
- DataTable tblSights = dtSet.Tables["ds3"];//景点
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];//订单商品
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//服务资料
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- ///付款方式集合
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft17 = new Font("宋体", 17);
- Font ft13 = new Font("宋体", 13);
- Font ft10 = new Font("宋体", 10);
- Font ft9 = new Font("宋体", 9);
- #region 获取数据
- string MName = "";
- string MTelephone = "";
- string MIDNumber = "";
- string MMicroSignal = "";
- string MQQ = "";
- string MAdderss = "";
- string WName = "";
- string WTelephone = "";
- string WIDNumber = "";
- string WMicroSignal = "";
- string WQQ = "";
- string WAdderss = "";
- string DayForMarriage = "";
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (Convert.ToBoolean(tblClient.Rows[i]["Cus_Sex"]))
- {
- WName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- WTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- WIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- WMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- WQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
- {
- DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
- {
- DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
- }
- }
- WAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- else
- {
- MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- if (LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]) != "")
- {
- DayForMarriage = LYFZ.Command.Command_Validate.DateTimeToString(tblClient.Rows[i]["Cus_DayForMarriage"]);
- if (!string.IsNullOrEmpty(tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim()) && tblClient.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1")
- {
- DayForMarriage += LYFZ.BLL.OtherCommonModel.FontConversion(" (农历)");
- }
- }
- MAdderss = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- string StrProdName = "";
- //for ( int i = 0; i < tblProductList.Rows.Count; i++ )
- //{
- // StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- //}
- //for ( int i = 0; i < tblService.Rows.Count; i++ )
- //{
- // StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- //}
- //StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
- #endregion
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 20;
- int RowContentHeight = 18;
- int Unit = TableWidth / 32;
- int ColumnWidth1 = Unit * 3;
- int ColumnWidth2 = Unit * 4;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 4;
- int ColumnWidth5 = Unit * 2 - 4;
- int ColumnWidth6 = Unit * 3 + 4;
- int ColumnWidth7 = Unit * 3;
- int ColumnWidth8 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7;
- if (pListData.Count == 0)
- {
- pListData = GetProductOrServiceHelfListData(g1, TableWidth, tblProductList, tblService, tblSights,disInfo: LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim());
- }
- string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom(StrValue);
- string striNumber = rec3Value;
- List<string> data = pListData[iPage];
- Bitmap bitmap = new Bitmap(827, 580);
- Graphics g = g1;//Graphics.FromImage(bitmap);
- StrProdName = "";
- foreach (string str in data)
- {
- if (!string.IsNullOrEmpty(StrProdName))
- {
- StrProdName += "\r\n";
- }
- StrProdName += str;
- }
- #region 金色童年收据凭据
- Rectangle rec1;
- int Rec1Height = 0;
- int TopHeightCount = 0;
- Image imgLog = CachePhoto(PhotoLogType.Wedding, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约婚庆单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约婚庆单标题", ft17).Height);
- TopHeightCount = 3;
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约婚庆单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- }
- #endregion
- #region 开单日期;
- string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]);
- SizeF sizef = g.MeasureString(strOrderCreatedData, ft10);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
- g.DrawString(strOrderCreatedData, ft10, b, rec1A);
- #endregion
- #region NO.
- sizef = g.MeasureString(striNumber, ft10);
- rec1A = new Rectangle(rec1A.Right + 10, rec1A.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
- g.DrawString(striNumber, ft10, b, rec1A);
- #endregion
- /* #region NO.
- string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom(StrValue);
- SizeF sizef = g.MeasureString(rec3Value, ft10);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
- g.DrawString(rec3Value, ft10, b, rec1A);
- #endregion*/
- #region 打印时间
- string StrPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印时间:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-dd HH:mm");
- sizef = g.MeasureString(StrPrintDate, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Y, FtWidth, FtHeight);
- g.DrawString(StrPrintDate, ft10, b, rec2);
- #endregion
- #region 第一行
- Rectangle rec3 = new Rectangle(LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("先生姓名");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 2, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MName, ft9, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 2, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("先生电话"), ft9, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft9, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
- Rectangle rec3_5 = new Rectangle(p34_1.X + LeftAdd * 2, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec3_5);//画第三列的列标题
- Point p35_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
- Point p35_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
- g.DrawLine(p, p35_1, p35_2);//画第三表与第四列的界线
- Rectangle rec3_6 = new Rectangle(p35_1.X + LeftAdd, p35_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- g.DrawString(OrdPrice, ft9, b, rec3_6);//画第四列的列标题
- Point p36_1 = new Point(p35_1.X + ColumnWidth6, rec3.Y);
- Point p36_2 = new Point(p35_1.X + ColumnWidth6, rec3.Y + rec3.Height);
- g.DrawLine(p, p36_1, p36_2);//画第二表与第三列的界线
- Rectangle rec3_7 = new Rectangle(p36_1.X + LeftAdd * 2, p36_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec3_7);//画第三列的列标题
- Point p37_1 = new Point(p36_1.X + ColumnWidth7, rec3.Y);
- Point p37_2 = new Point(p36_1.X + ColumnWidth7, rec3.Y + rec3.Height);
- g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
- Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec3_8);//画第四列的列标题
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 2, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士姓名"), ft9, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(WName, ft9, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 2, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女士电话"), ft9, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(WTelephone), ft9, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
- Rectangle rec4_5 = new Rectangle(p44_1.X + LeftAdd * 2, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_5);//画第三列的列标题
- Point p45_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
- Point p45_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
- g.DrawLine(p, p45_1, p45_2);//画第三表与第四列的界线
- Rectangle rec4_6 = new Rectangle(p45_1.X + LeftAdd, p45_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_6);//画第四列的列标题
- Point p46_1 = new Point(p45_1.X + ColumnWidth6, rec4.Y);
- Point p46_2 = new Point(p45_1.X + ColumnWidth6, rec4.Y + rec4.Height);
- g.DrawLine(p, p46_1, p46_2);//画第二表与第三列的界线
- Rectangle rec4_7 = new Rectangle(p46_1.X + LeftAdd * 2, p46_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec4_7);//画第三列的列标题
- Point p47_1 = new Point(p46_1.X + ColumnWidth7, rec4.Y);
- Point p47_2 = new Point(p46_1.X + ColumnWidth7, rec4.Y + rec4.Height);
- g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
- Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec4_8);//画第四列的列标题
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4 + ColumnWidth5 + ColumnWidth6 + ColumnWidth7 + ColumnWidth8, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 2, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("男宾地址"), ft9, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, rec5.Width - ColumnWidth1 - ColumnWidth7 - ColumnWidth8, RowContentHeight);
- g.DrawString(MAdderss, ft9, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + rec5_2.Width, rec5.Y);
- Point p52_2 = new Point(p51_1.X + rec5_2.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_7 = new Rectangle(p52_1.X + LeftAdd * 2, p52_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("礼服顾问"), ft9, b, rec5_7);//画第三列的列标题
- Point p57_1 = new Point(p52_1.X + ColumnWidth7, rec5.Y);
- Point p57_2 = new Point(p52_1.X + ColumnWidth7, rec5.Y + rec5.Height);
- g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
- Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
- #endregion
- #region 第三四行
- Rectangle rec5A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight);
- g.DrawRectangle(p, rec5A);//画标题矩形
- Rectangle rec5A_1 = new Rectangle(rec5A.X + LeftAdd * 2, rec5A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("女宾地址"), ft9, b, rec5A_1);//画第一列的列标题
- Point p5A1_1 = new Point(rec5A.X + ColumnWidth1, rec5A.Y);
- Point p5A1_2 = new Point(rec5A.X + ColumnWidth1, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A1_1, p5A1_2);//画第一表与第二列的界线
- Rectangle rec5A_2 = new Rectangle(p5A1_1.X + LeftAdd, p5A1_1.Y + TopAdd, rec5_2.Width, RowContentHeight);
- g.DrawString(WAdderss, ft9, b, rec5A_2);//画第二列的列标题
- Point p5A2_1 = new Point(p5A1_1.X + rec5A_2.Width, rec5A.Y);
- Point p5A2_2 = new Point(p5A1_1.X + rec5A_2.Width, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A2_1, p5A2_2);//画第二表与第三列的界线
- Rectangle rec5A_3 = new Rectangle(p5A2_1.X + LeftAdd * 2, p5A2_1.Y + TopAdd, ColumnWidth7, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("结婚日期"), ft9, b, rec5A_3);//画第三列的列标题
- Point p5A3_1 = new Point(p5A2_1.X + ColumnWidth7, rec5A.Y);
- Point p5A3_2 = new Point(p5A2_1.X + ColumnWidth7, rec5A.Y + rec5A.Height);
- g.DrawLine(p, p5A3_1, p5A3_2);//画第三表与第四列的界线
- Rectangle rec5A_4 = new Rectangle(p5A3_1.X + LeftAdd, p5A3_1.Y + TopAdd, ColumnWidth8, RowContentHeight);
- g.DrawString(DayForMarriage, ft9, b, rec5A_4);//画第四列的列标题
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle(rec5A.X, rec5A.Y + rec5A.Height, TableWidth - ColumnWidth8, 310 - Rec1Height - LeftWidth);
- g.DrawRectangle(p, rec6);//画标题矩形
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("内容详情");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height) + 1;
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
- g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
- Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, rec6.Width - rec6_1.Width - LeftAdd * 2, rec6.Height - TopAdd * 2);
- g.DrawString(StrProdName, GetFontSize("婚庆预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
- Rectangle rec6A = new Rectangle(rec6.X + rec6.Width, rec6.Y, ColumnWidth8, rec6.Height);
- g.DrawRectangle(p, rec6A);//画标题矩形
- sizef = g.MeasureString("注意事项", ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height) + 1;
- Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd * 2, rec6_1.Y, rec6_1.Width, rec6A.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec6A_1);//画第三列的列标题
- Point p6A1_1 = new Point(rec6A.X + rec6A_1.Width, rec6A.Y);
- Point p6A1_2 = new Point(rec6A.X + rec6A_1.Width, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p6A1_1, p6A1_2);//画第三表与第四列的界线
- StrValue = "";
- if (PrintOtherData.ContainsKey("婚庆预约单注意事项说明") && PrintOtherData["婚庆预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["婚庆预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth8 - rec6A_1.Width - LeftAdd * 2, rec6.Height - TopAdd * 2);
- g.DrawString(StrValue, GetFontSize("婚庆预约单注意事项字体大小"), b, rec6A_2);//画第四列的列标题
- #endregion
- #region 第六行
- int SWidth = (p6A1_1.X - LeftWidth) / 6;
- int Column1 = SWidth - 20;
- int Column2 = SWidth + 20;
- Rectangle rec7 = new Rectangle(rec6.X, rec6.Y + rec6.Height, p6A1_1.X - LeftWidth, RowHeight * 2 + 5);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd * 2, rec7.Y + TopAdd * 3 + 3, Column1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("酒店信息"), ft9, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + rec7_1.Width, rec7.Y);
- Point p71_2 = new Point(rec7.X + rec7_1.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- int recA2_2Width = rec7.Width - Column1 - LeftAdd * 2;
- int FtHeightA = Convert.ToInt32(g.MeasureString("酒店信息", ft9, recA2_2Width).Height);
- int FtHeightB = Convert.ToInt32(g.MeasureString(tblOrder.Rows[0]["Ord_HotelInfo"].ToString().Trim(), ft9, recA2_2Width).Height);
- int recA2_2Y = rec7_1.Y;
- int recA2Height = rec7.Height - TopAdd * 2;
- int recA2_2Count = FtHeightB / FtHeightA;
- if ((FtHeightB % FtHeightA) > 0)
- {
- recA2_2Count++;
- }
- if (recA2_2Count == 2)
- {
- recA2_2Y = rec7.Y + RowHeight - FtHeightA + TopAdd;
- }
- else if (recA2_2Count >= 3)
- {
- recA2_2Y = p71_1.Y + 2;
- recA2Height = rec7.Height - TopAdd;
- }
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, recA2_2Y, recA2_2Width, recA2Height);
- g.DrawString(tblOrder.Rows[0]["Ord_HotelInfo"].ToString().Trim(), ft9, b, rec7_2);//画第六列的列标题
- #endregion
- #region 顾客签字
- Rectangle rec8A = new Rectangle(p6A1_1.X, rec7.Y, TableWidth - (p6A1_1.X - LeftWidth), rec7.Height);
- g.DrawRectangle(p, rec8A);//画标题矩形
- Rectangle rec8A_1 = new Rectangle(rec7.X + rec7.Width + LeftAdd * 2, rec7_1.Y, Column1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8A_1);//画第一列的列标题
- Point p8A1_1 = new Point(rec8A.X + Column1, rec8A.Y);
- Point p8A1_2 = new Point(rec8A.X + Column1, rec8A.Y + rec8A.Height);
- g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, Column2, RowContentHeight);
- //g.DrawString( "", ft9, b, rec8A_2 );//画第六列的列标题
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec7.X + LeftAdd * 3 + 5, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
- g.DrawLine(p, rec7.X, p8A1_1.Y, rec7.X, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X + Column1, p8A1_1.Y, rec7.X + Column1, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X + TableWidth, p8A1_1.Y, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec7.X, p8A1_2.Y + rec8A_2.Height + 5, rec7.X + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- rec8A_2.Height += 10;
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec7.X + LeftAdd * 22, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
- }
- else
- {
- rec8A_2.Height = 0;
- }
- #endregion
- #region 尾行
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec7.Y + rec7.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9 = new Rectangle(rec7.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
- #endregion
- //bitmapList.Add(bitmap);
- }
- #endregion
- #region 服务
- /// <summary>
- /// 订单报表服务版()
- /// </summary>
- /// <returns></returns>
- private static void Service_OrderReport_Print(DataSet dtSet, Graphics g1, Size size
- , ref List<List<string>> pListData, int iPage)
- {
- int LeftWidth = 30;
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int TableWidth = size.Width - LeftWidth * 2;
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblOrder = dtSet.Tables["ds1"];//订单
- DataTable tblDigital = dtSet.Tables["ds2"];//数码
- DataTable tblSights = dtSet.Tables["ds3"];//景点
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];//取件时间
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//客户资料
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- if (tbl.Rows.Count <= 0)
- {
- MessageBoxCustom.Show("未设置影楼信息"); return;
- }
- ///付款方式集合
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- if (pListData.Count == 0)
- {
- pListData = GetProductOrServiceListData(g1, TableWidth, tblProductList, tblService, tblSights, "服务预约单内容详情字体大小", false,630);
- }
- #region 获取数据
- string MName = "";
- string MTelephone = "";
- string MIDNumber = "";
- string MMicroSignal = "";
- string MQQ = "";
- string MAddress = "";
- if (tblClient.Rows.Count > 0)
- {
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1")
- {
- MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- #endregion
- Font ft17 = new Font("宋体", 17);
- Font ft12 = new Font("宋体", 12);
- Font ft9 = new Font("宋体", 9);
- List<string> data = pListData[iPage];
- //Bitmap bitmap = new Bitmap(827, 1150);
- Graphics g = g1;//Graphics.FromImage(bitmap);
- #region LOG抬头
- int Rec1Height = 0;
- Rectangle rec1;
- Image imgLog = CachePhoto(PhotoLogType.Portrait, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约服务单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 120);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约服务单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- Rec1Height = 120 - rec1.Height;
- }
- #endregion
- int LeftAdd = 3;
- int TopAdd = 6;
- int RowHeight = 25;
- int RowContentHeight = 18;
- int Unit = TableWidth / 25;
- int ColumnWidth1 = Unit * 3 - Unit / 2 + 15;
- int ColumnWidth2 = Unit * 5;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 5;
- int ColumnWidth5 = Unit * 3 - Unit / 2 + 15;
- int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- #region 始行
- Rectangle rec2 = new Rectangle(LeftWidth, rec1.Y + rec1.Height + 10, 1000, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]), ft12, b, rec2);
- string strShowNumber = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string StrValue = "NO." + StrRandom(strShowNumber);
- SizeF sizef = g.MeasureString(StrValue, ft12);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2_1 = new Rectangle(TableWidth + LeftWidth + LeftAdd - FtWidth, rec2.Y, FtWidth, RowContentHeight);
- g.DrawString(StrValue, ft12, b, rec2_1);
- #endregion
- #region 左排
- #region 第一行
- Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, ColumnWidth1 + ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名"), ft12, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MName, ft12, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入底"), ft12, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- string StrIntoBottom = tblOrder.Rows[0]["Ord_IntoBottom"].ToString().Trim();
- if (StrIntoBottom == "0")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("不送");
- }
- else if (StrIntoBottom == "-1")
- {
- StrIntoBottom = LYFZ.BLL.OtherCommonModel.FontConversion("全送");
- }
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(StrIntoBottom, ft12, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第四表与第五列的界线
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("联系电话"), ft12, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MTelephone, ft12, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("入册"), ft12, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_IntoRegister"].ToString().Trim(), ft12, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第四表与第五列的界线
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("微信"), ft12, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MMicroSignal, ft12, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + ColumnWidth2, rec5.Y);
- Point p52_2 = new Point(p51_1.X + ColumnWidth2, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_3 = new Rectangle(p52_1.X + LeftAdd, p52_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString("QQ", ft12, b, rec5_3);//画第三列的列标题
- Point p53_1 = new Point(p52_1.X + ColumnWidth3, rec5.Y);
- Point p53_2 = new Point(p52_1.X + ColumnWidth3, rec5.Y + rec5.Height);
- g.DrawLine(p, p53_1, p53_2);//画第三表与第四列的界线
- Rectangle rec5_4 = new Rectangle(p53_1.X + LeftAdd, p53_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(MQQ, ft12, b, rec5_4);//画第四列的列标题
- Point p54_1 = new Point(p53_1.X + ColumnWidth4, rec5.Y);
- Point p54_2 = new Point(p53_1.X + ColumnWidth4, rec5.Y + rec5.Height);
- g.DrawLine(p, p54_1, p54_2);//画第四表与第五列的界线
- #endregion
- #region 第四、五行
- int rec7_Y = rec5.Y + rec5.Height;
- int rec9Height = 0;
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.EnabledIDNumber)
- {
- Rectangle rec6A = new Rectangle(rec5.X, rec5.Y + rec5.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec6A);//画标题矩形
- Rectangle rec6A_1 = new Rectangle(rec6A.X + LeftAdd, rec6A.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("身份证号"), ft12, b, rec6A_1);//画第一列的列标题
- Point p6A1_1 = new Point(rec6A.X + ColumnWidth1, rec6A.Y);
- Point p6A1_2 = new Point(rec6A.X + ColumnWidth1, rec6A.Y + rec6A.Height);
- g.DrawLine(p, p6A1_1, p6A1_2);//画第一表与第二列的界线
- Rectangle rec6A_2 = new Rectangle(p6A1_1.X + LeftAdd, p6A1_1.Y + TopAdd, rec3.Width - ColumnWidth1, RowContentHeight);
- g.DrawString(MIDNumber, ft12, b, rec6A_2);//画第二列的列标题
- rec7_Y = rec6A.Y + rec6A.Height;
- rec9Height = RowHeight;
- }
- #endregion
- #region 第五行
- Rectangle rec7 = new Rectangle(rec5.X, rec7_Y, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_1 = new Rectangle(rec7.X + LeftAdd, rec7.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft12, b, rec7_1);//画第一列的列标题
- Point p71_1 = new Point(rec7.X + ColumnWidth1, rec7.Y);
- Point p71_2 = new Point(rec7.X + ColumnWidth1, rec7.Y + rec7.Height);
- g.DrawLine(p, p71_1, p71_2);//画第一表与第二列的界线
- Rectangle rec7_2 = new Rectangle(p71_1.X + LeftAdd, p71_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
- g.DrawString(MAddress, ft12, b, rec7_2);//画第二列的列标题
- Point p72_1 = new Point(p71_1.X + rec7_2.Width, rec7.Y);
- Point p72_2 = new Point(p71_1.X + rec7_2.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p72_1, p72_2);//画第二表与第三列的界线
- #endregion
- #region 第一列
- #region 第一行
- Rectangle rec9 = new Rectangle(rec7.X, rec7.Y + rec7.Height, rec3.Width, 635 + Rec1Height - rec9Height);
- g.DrawRectangle(p, rec9);//画标题矩形
- string StrProdName = LYFZ.BLL.OtherCommonModel.FontConversion("服务内容:");
- //for (int i = 0; i < tblProductList.Rows.Count; i++)
- //{
- // StrProdName += "\r\n" + tblProductList.Rows[i]["ProdName"].ToString().Trim();
- //}
- //for (int i = 0; i < tblService.Rows.Count; i++)
- //{
- // StrProdName += "\r\n" + tblService.Rows[i]["ProdName"].ToString().Trim();
- //}
- Rectangle rec9_1 = new Rectangle(rec9.X + LeftAdd, rec9.Y + TopAdd, rec9.Width, rec9.Height - TopAdd * 2);
- //g.DrawString(StrProdName, GetFontSize("服务预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
- foreach (string str in data)
- {
- //PrintContentData(" " + str, g, rec9, LeftAdd, TopAdd, b, "服务预约单内容详情字体大小", ref _infoHeight);
- StrProdName += "\r\n " + str;
- }
- g.DrawString(StrProdName, GetFontSize("服务预约单内容详情字体大小"), b, rec9_1);//画第一列的列标题
- #endregion
- #region 第二行
- Rectangle recA1 = new Rectangle(rec9.X, rec9.Y + rec9.Height, rec3.Width, 100);
- g.DrawRectangle(p, recA1);//画标题矩形
- Rectangle recA1_1 = new Rectangle(recA1.X + LeftAdd, recA1.Y + TopAdd, recA1.Width, recA1.Height - TopAdd * 2);
- string disInfo = LYFZ.BLL.OtherCommonModel.FontConversion("订单备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- disInfo += "\r\n付款:" + strPaymentMsg;
- }
- g.DrawString(disInfo, ft12, b, recA1_1);//画第一列的列标题
- #endregion
- #endregion
- #endregion
- #region 右排
- #region 第一行
- Rectangle Rrec3 = new Rectangle(rec3.X + rec3.Width, rec3.Y, ColumnWidth5 + ColumnWidth6, RowHeight);
- g.DrawRectangle(p, Rrec3);//画标题矩形
- Rectangle Rrec3_5 = new Rectangle(Rrec3.X + LeftAdd, Rrec3.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft12, b, Rrec3_5);//画第五列的列标题
- Point Rp35_1 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y);
- Point Rp35_2 = new Point(Rrec3.X + ColumnWidth5, Rrec3.Y + Rrec3.Height);
- g.DrawLine(p, Rp35_1, Rp35_2);//画第五表与第六列的界线
- Rectangle Rrec3_6 = new Rectangle(Rp35_1.X + LeftAdd, Rrec3_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft12, b, Rrec3_6);//画第六列的列标题
- #endregion
- #region 第二行
- Rectangle Rrec4 = new Rectangle(Rrec3.X, Rrec3.Y + Rrec3.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec4);//画标题矩形
- Rectangle Rrec4_5 = new Rectangle(Rrec4.X + LeftAdd, Rrec4.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft12, b, Rrec4_5);//画第五列的列标题
- Point Rp45_1 = new Point(Rp35_1.X, Rrec4.Y);
- Point Rp45_2 = new Point(Rp35_1.X, Rrec4.Y + Rrec4.Height);
- g.DrawLine(p, Rp45_1, Rp45_2);//画第五表与第六列的界线
- Rectangle Rrec4_6 = new Rectangle(Rp45_1.X + LeftAdd, Rrec4_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft12, b, Rrec4_6);//画第六列的列标题
- #endregion
- #region 第三行
- Rectangle Rrec5 = new Rectangle(Rrec4.X, Rrec4.Y + Rrec4.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec5);//画标题矩形
- Rectangle Rrec5_5 = new Rectangle(Rrec5.X + LeftAdd, Rrec5.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("预约定金"), ft12, b, Rrec5_5);//画第五列的列标题
- Point Rp55_1 = new Point(Rp45_1.X, Rrec5.Y);
- Point Rp55_2 = new Point(Rp45_1.X, Rrec5.Y + Rrec5.Height);
- g.DrawLine(p, Rp55_1, Rp55_2);//画第五表与第六列的界线
- Rectangle Rrec5_6 = new Rectangle(Rp55_1.X + LeftAdd, Rrec5_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(OrdPrice, ft12, b, Rrec5_6);//画第六列的列标题
- #endregion
- #region 第四行
- Rectangle Rrec6 = new Rectangle(Rrec5.X, Rrec5.Y + Rrec5.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec6);//画标题矩形
- Rectangle Rrec6_5 = new Rectangle(Rrec6.X + LeftAdd, Rrec6.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("余款金额"), ft12, b, Rrec6_5);//画第五列的列标题
- Point Rp65_1 = new Point(Rp55_1.X, Rrec6.Y);
- Point Rp65_2 = new Point(Rp55_1.X, Rrec6.Y + Rrec6.Height);
- g.DrawLine(p, Rp65_1, Rp65_2);//画第五表与第六列的界线
- Rectangle Rrec6_6 = new Rectangle(Rp65_1.X + LeftAdd, Rrec6_5.Y, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft12, b, Rrec6_6);//画第六列的列标题
- #endregion
- #region 第六行
- Rectangle Rrec8 = new Rectangle(Rrec6.X, Rrec6.Y + Rrec6.Height, Rrec3.Width, RowHeight);
- g.DrawRectangle(p, Rrec8);//画标题矩形
- Rectangle Rrec8_5 = new Rectangle(Rrec8.X + LeftAdd, Rrec8.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门市"), ft12, b, Rrec8_5);//画第五列的列标题
- Point Rp85_1 = new Point(Rp65_1.X, Rrec8.Y);
- Point Rp85_2 = new Point(Rp65_1.X, Rrec8.Y + Rrec8.Height);
- g.DrawLine(p, Rp85_1, Rp85_2);//画第五表与第六列的界线
- Rectangle rec8_6 = new Rectangle(Rp85_1.X, Rrec8_5.Y, ColumnWidth6, RowContentHeight);
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft12, b, rec8_6);//画第六列的列标题
- #endregion
- #region 第一列
- Rectangle Rrec10 = new Rectangle(Rrec8.X, Rrec8.Y + Rrec8.Height, Rrec3.Width, recA1.Y + recA1.Height - Rrec8.Y - RowHeight * 3);
- g.DrawRectangle(p, Rrec10);//画标题矩形
- StrValue = "";
- if (PrintOtherData.ContainsKey("服务预约单注意事项说明") && PrintOtherData["服务预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["服务预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec10_1 = new Rectangle(Rrec10.X + LeftAdd, Rrec10.Y + TopAdd, Rrec10.Width - LeftAdd * 2, Rrec10.Height - TopAdd * 2);
- Font scaleFont = PrinterDrawMethod.ComputeAutoScaleFont(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, GetFontSize("服务预约单注意事项字体大小"), minFontSize: 6);
- PrinterDrawMethod.DrawCellTextAutroWrap(g, LYFZ.BLL.OtherCommonModel.FontConversion("注意事项:\r\n") + StrValue, rec10_1, scaleFont, autoWrap: true, nWrapLineSpace: 1, showFrame: false);
- #endregion
- #region 顾客签字
- Rectangle RrecA5 = new Rectangle(Rrec10.X, Rrec10.Y + Rrec10.Height, Rrec3.Width, RowHeight * 2);
- g.DrawRectangle(p, RrecA5);//画标题矩形
- Rectangle RrecA5_1 = new Rectangle(RrecA5.X + LeftAdd, RrecA5.Y + RowContentHeight, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft12, b, RrecA5_1);//画第五列的列标题
- Point RpA51_1 = new Point(Rp65_1.X, RrecA5.Y);
- Point RpA51_2 = new Point(Rp65_1.X, RrecA5.Y + RrecA5.Height);
- g.DrawLine(p, RpA51_1, RpA51_2);//画第四表与第五列的界线
- #endregion
- #endregion
- #region 尾行
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("网址:") + tbl.Rows[0]["Company_URL"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA6_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA1.Y + recA1.Height + TopAdd, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, recA6_1);//画第一列的列标题
- Rectangle recA6 = new Rectangle(recA1.X, recA6_1.Y, TableWidth - recA6_1.Width - 50, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim(), ft9, b, recA6);//画第一列的列标题
- Rectangle recA7 = new Rectangle(recA6.X, recA6.Y + recA6.Height, recA6.Width, FtHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, recA7);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("页:") + "" + (iPage + 1) + "/" + pListData.Count;
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle recA8 = new Rectangle(TableWidth + LeftWidth - FtWidth, recA7.Y + recA7.Height - TopAdd, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, recA8);//画第一列的列标题
- #endregion
- //bitmapList.Add(bitmap);
- }
- /// <summary>
- /// 服务二等份打印
- /// </summary>
- /// <param name="objValue"></param>
- private static void Service_OrderReport_TwoEqualPrint(DataSet dtSet, Graphics g1, Size size
- , ref List<List<string>> pListData, int iPage)
- {
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tblOrder = dtSet.Tables["ds1"];//订单
- DataTable tblDigital = dtSet.Tables["ds2"];//数码
- DataTable tblSights = dtSet.Tables["ds3"];//景点
- DataTable tblPickupTime = dtSet.Tables["ds4"];//取件时间
- DataTable tblProductList = dtSet.Tables["ds5"];//取件时间
- DataTable tblClient = dtSet.Tables["ds6"];//客户资料
- DataTable tblService = dtSet.Tables["ds7"];//客户资料
- DataTable tblStyle = dtSet.Tables["ds8"];//喜爱风格
- DataTable tblPayment = dtSet.Tables["ds9"];//订单定金
- DataTable tblUser = dtSet.Tables["ds11"];//订单定金
- string OrdPrice = "0.00";
- if (tblPayment.Rows.Count > 0)
- {
- OrdPrice = tblPayment.Rows[0]["Pay_AmountOf"].ToString().Trim();
- }
- tblStyle.PrimaryKey = new DataColumn[] { tblStyle.Columns["ID"] };
- ///付款方式集合
- string strPaymentMsg = "";
- foreach (DataRow dr in tblPayment.Rows)
- {
- if (!string.IsNullOrEmpty(strPaymentMsg))
- {
- strPaymentMsg += " ";
- }
- strPaymentMsg += dr["Sc_ClassName"] + ":" + dr["Pay_AmountOf"];
- }
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft17 = new Font("宋体", 17);
- Font ft13 = new Font("宋体", 13);
- Font ft10 = new Font("宋体", 10);
- Font ft9 = new Font("宋体", 9);
- #region 获取数据
- string MName = "";
- string MTelephone = "";
- string MIDNumber = "";
- string MMicroSignal = "";
- string MQQ = "";
- string MAddress = "";
- if (tblClient.Rows.Count > 0)
- {
- for (int i = 0; i < tblClient.Rows.Count; i++)
- {
- if (tblClient.Rows[i]["GM_Master"].ToString().Trim() == "1")
- {
- MName = tblClient.Rows[i]["Cus_Name"].ToString().Trim();
- MTelephone = tblClient.Rows[i]["Cus_Telephone"].ToString().Trim();
- MIDNumber = tblClient.Rows[i]["Cus_IDNumber"].ToString().Trim();
- MMicroSignal = tblClient.Rows[i]["Cus_MicroSignal"].ToString().Trim();
- MQQ = tblClient.Rows[i]["Cus_QQ"].ToString().Trim();
- MAddress = tblClient.Rows[i]["Cus_Address"].ToString().Trim();
- }
- }
- }
- string StrProdName = "";
- //for ( int i = 0; i < tblProductList.Rows.Count; i++ )
- //{
- // StrProdName += tblProductList.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- //}
- //for ( int i = 0; i < tblService.Rows.Count; i++ )
- //{
- // StrProdName += tblService.Rows[i]["ProdName"].ToString().Trim() + "\r\n";
- //}
- //StrProdName += LYFZ.BLL.OtherCommonModel.FontConversion( "\r\n备注:" ) + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim();
- #endregion
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 20;
- int RowContentHeight = 18;
- int Unit = TableWidth / 30;
- int ColumnWidth1 = 66;// Unit * 3;
- int ColumnWidth2 = Unit * 6;
- int ColumnWidth3 = Unit * 3;
- int ColumnWidth4 = Unit * 6;
- int ColumnWidth5 = 66;// Unit * 3;
- int ColumnWidth6 = TableWidth - ColumnWidth1 - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- if (pListData.Count == 0)
- {
- pListData = GetProductOrServiceHelfListData(g1, TableWidth, tblProductList, tblService, tblSights,disInfo: LYFZ.BLL.OtherCommonModel.FontConversion("\r\n备注:") + tblOrder.Rows[0]["Ord_Remark"].ToString().Trim());
- }
- string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom(StrValue);
- string striNumber = rec3Value;
- List<string> data = pListData[iPage];
- Bitmap bitmap = new Bitmap(827, 580);
- Graphics g = g1;//Graphics.FromImage(bitmap);
- StrProdName = "";
- foreach (string str in data)
- {
- if (!string.IsNullOrEmpty(StrProdName))
- {
- StrProdName += "\r\n";
- }
- StrProdName += str;
- }
- #region 金色童年收据凭据
- Rectangle rec1;
- int Rec1Height = 0;
- int TopHeightCount = 0;
- Image imgLog = CachePhoto(PhotoLogType.Portrait, tbl.Rows[0]["Company_UpdateDatetime"], GetReservationSingleLOG("预约服务单LOG"));
- if (imgLog != null)
- {
- rec1 = new Rectangle(LeftWidth, 50, TableWidth, 80);
- Rectangle srcRec1 = new Rectangle(0, 0, imgLog.Width, imgLog.Height);
- g.DrawImage(imgLog, rec1, srcRec1, GraphicsUnit.Pixel);
- Rec1Height = rec1.Height - Convert.ToInt32(g.MeasureString("预约服务单标题", ft17).Height);
- TopHeightCount = 3;
- }
- else
- {
- string StrTitle = GetReservationSingleTitle("预约服务单标题");
- SizeF srcsizef = g.MeasureString(StrTitle, ft17);
- int srcFtWidth = Convert.ToInt32(srcsizef.Width);
- int srcFtHeight = Convert.ToInt32(srcsizef.Height);
- rec1 = new Rectangle(size.Width / 2 - srcFtWidth / 2, 50, srcFtWidth + 5, srcFtHeight);
- g.DrawString(StrTitle, ft17, b, rec1);
- }
- #endregion
- #region 开单日期;
- string strOrderCreatedData = LYFZ.BLL.OtherCommonModel.FontConversion("开单日期:") + LYFZ.Command.Command_Validate.DateTimeToString(tblOrder.Rows[0]["Ord_CreateDatetime"]);
- SizeF sizef = g.MeasureString(strOrderCreatedData, ft10);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
- g.DrawString(strOrderCreatedData, ft10, b, rec1A);
- #endregion
- #region NO.
- sizef = g.MeasureString(striNumber, ft10);
- rec1A = new Rectangle(rec1A.Right + 10, rec1A.Top, Convert.ToInt32(sizef.Width) + 1, Convert.ToInt32(sizef.Height));
- g.DrawString(striNumber, ft10, b, rec1A);
- #endregion
- /* #region NO.
- string StrValue = tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() != "" ? tblOrder.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim() : tblOrder.Rows[0]["Ord_Number"].ToString().Trim();
- string rec3Value = "NO." + StrRandom(StrValue);
- SizeF sizef = g.MeasureString(rec3Value, ft10);
- int FtWidth = Convert.ToInt32(sizef.Width) + 1;
- int FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec1A = new Rectangle(LeftWidth, rec1.Y + rec1.Height + TopHeightCount, FtWidth, FtHeight);
- g.DrawString(rec3Value, ft10, b, rec1A);
- #endregion*/
- #region 打印时间
- string StrPrintDate = LYFZ.BLL.OtherCommonModel.FontConversion("打印时间:") + LYFZ.Command.Command_Validate.DateTimeToString(SDateTime.Now, "yyyy-MM-dd HH:mm");
- sizef = g.MeasureString(StrPrintDate, ft10);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec2 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec1A.Y, FtWidth, FtHeight);
- g.DrawString(StrPrintDate, ft10, b, rec2);
- #endregion
- #region 第一行
- Rectangle rec3 = new Rectangle(LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight);
- g.DrawRectangle(p, rec3);//画标题矩形
- string rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("客户姓名");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec3_1 = new Rectangle(rec3.X + LeftAdd * 3, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(rec2Value, ft9, b, rec3_1);//画第一列的列标题
- Point p31_1 = new Point(rec3.X + ColumnWidth1, rec3.Y);
- Point p31_2 = new Point(rec3.X + ColumnWidth1, rec3.Y + rec3.Height);
- g.DrawLine(p, p31_1, p31_2);//画第一表与第二列的界线
- Rectangle rec3_2 = new Rectangle(p31_1.X + LeftAdd, p31_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(MName, ft9, b, rec3_2);//画第二列的列标题
- Point p32_1 = new Point(p31_1.X + ColumnWidth2, rec3.Y);
- Point p32_2 = new Point(p31_1.X + ColumnWidth2, rec3.Y + rec3.Height);
- g.DrawLine(p, p32_1, p32_2);//画第二表与第三列的界线
- Rectangle rec3_3 = new Rectangle(p32_1.X + LeftAdd * 12 - 1, p32_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("电话"), ft9, b, rec3_3);//画第三列的列标题
- Point p33_1 = new Point(p32_1.X + ColumnWidth3, rec3.Y);
- Point p33_2 = new Point(p32_1.X + ColumnWidth3, rec3.Y + rec3.Height);
- g.DrawLine(p, p33_1, p33_2);//画第三表与第四列的界线
- Rectangle rec3_4 = new Rectangle(p33_1.X + LeftAdd, p33_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(MTelephone), ft9, b, rec3_4);//画第四列的列标题
- Point p34_1 = new Point(p33_1.X + ColumnWidth4, rec3.Y);
- Point p34_2 = new Point(p33_1.X + ColumnWidth4, rec3.Y + rec3.Height);
- g.DrawLine(p, p34_1, p34_2);//画第二表与第三列的界线
- Rectangle rec3_7 = new Rectangle(p34_1.X + LeftAdd * 3, p34_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系金额"), ft9, b, rec3_7);//画第三列的列标题
- Point p37_1 = new Point(p34_1.X + ColumnWidth5, rec3.Y);
- Point p37_2 = new Point(p34_1.X + ColumnWidth5, rec3.Y + rec3.Height);
- g.DrawLine(p, p37_1, p37_2);//画第三表与第四列的界线
- Rectangle rec3_8 = new Rectangle(p37_1.X + LeftAdd, p37_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesPrice"].ToString().Trim(), ft9, b, rec3_8);//画第四列的列标题
- #endregion
- #region 第二行
- Rectangle rec4 = new Rectangle(rec3.X, rec3.Y + rec3.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec4);//画标题矩形
- Rectangle rec4_1 = new Rectangle(rec4.X + LeftAdd * 12 - 1, rec4.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("定金"), ft9, b, rec4_1);//画第一列的列标题
- Point p41_1 = new Point(rec4.X + ColumnWidth1, rec4.Y);
- Point p41_2 = new Point(rec4.X + ColumnWidth1, rec4.Y + rec4.Height);
- g.DrawLine(p, p41_1, p41_2);//画第一表与第二列的界线
- Rectangle rec4_2 = new Rectangle(p41_1.X + LeftAdd, p41_1.Y + TopAdd, ColumnWidth2, RowContentHeight);
- g.DrawString(OrdPrice, ft9, b, rec4_2);//画第二列的列标题
- Point p42_1 = new Point(p41_1.X + ColumnWidth2, rec4.Y);
- Point p42_2 = new Point(p41_1.X + ColumnWidth2, rec4.Y + rec4.Height);
- g.DrawLine(p, p42_1, p42_2);//画第二表与第三列的界线
- Rectangle rec4_3 = new Rectangle(p42_1.X + LeftAdd * 12 - 1, p42_1.Y + TopAdd, ColumnWidth3, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("欠款"), ft9, b, rec4_3);//画第三列的列标题
- Point p43_1 = new Point(p42_1.X + ColumnWidth3, rec4.Y);
- Point p43_2 = new Point(p42_1.X + ColumnWidth3, rec4.Y + rec4.Height);
- g.DrawLine(p, p43_1, p43_2);//画第三表与第四列的界线
- Rectangle rec4_4 = new Rectangle(p43_1.X + LeftAdd, p43_1.Y + TopAdd, ColumnWidth4, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_OrderArrears"].ToString().Trim(), ft9, b, rec4_4);//画第四列的列标题
- Point p44_1 = new Point(p43_1.X + ColumnWidth4, rec4.Y);
- Point p44_2 = new Point(p43_1.X + ColumnWidth4, rec4.Y + rec4.Height);
- g.DrawLine(p, p44_1, p44_2);//画第二表与第三列的界线
- Rectangle rec4_7 = new Rectangle(p44_1.X + LeftAdd * 3, p44_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("套系名称"), ft9, b, rec4_7);//画第三列的列标题
- Point p47_1 = new Point(p44_1.X + ColumnWidth5, rec4.Y);
- Point p47_2 = new Point(p44_1.X + ColumnWidth5, rec4.Y + rec4.Height);
- g.DrawLine(p, p47_1, p47_2);//画第三表与第四列的界线
- Rectangle rec4_8 = new Rectangle(p47_1.X + LeftAdd, p47_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- g.DrawString(tblOrder.Rows[0]["Ord_SeriesName"].ToString().Trim(), ft9, b, rec4_8);//画第四列的列标题
- #endregion
- #region 第三行
- Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec3.Width, RowHeight);
- g.DrawRectangle(p, rec5);//画标题矩形
- Rectangle rec5_1 = new Rectangle(rec5.X + LeftAdd * 12 - 1, rec5.Y + TopAdd, ColumnWidth1, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("地址"), ft9, b, rec5_1);//画第一列的列标题
- Point p51_1 = new Point(rec5.X + ColumnWidth1, rec5.Y);
- Point p51_2 = new Point(rec5.X + ColumnWidth1, rec5.Y + rec5.Height);
- g.DrawLine(p, p51_1, p51_2);//画第一表与第二列的界线
- Rectangle rec5_2 = new Rectangle(p51_1.X + LeftAdd, p51_1.Y + TopAdd, ColumnWidth2 + ColumnWidth3 + ColumnWidth4, RowContentHeight);
- g.DrawString(MAddress, ft9, b, rec5_2);//画第二列的列标题
- Point p52_1 = new Point(p51_1.X + rec5_2.Width, rec5.Y);
- Point p52_2 = new Point(p51_1.X + rec5_2.Width, rec5.Y + rec5.Height);
- g.DrawLine(p, p52_1, p52_2);//画第二表与第三列的界线
- Rectangle rec5_7 = new Rectangle(p52_1.X + LeftAdd * 7, p52_1.Y + TopAdd, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("门 市"), ft9, b, rec5_7);//画第三列的列标题
- Point p57_1 = new Point(p52_1.X + ColumnWidth5, rec5.Y);
- Point p57_2 = new Point(p52_1.X + ColumnWidth5, rec5.Y + rec5.Height);
- g.DrawLine(p, p57_1, p57_2);//画第三表与第四列的界线
- Rectangle rec5_8 = new Rectangle(p57_1.X + LeftAdd, p57_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- string strOrderPerson = "";
- if (tblUser.Rows.Count > 0)
- {
- if (Convert.ToBoolean(tblUser.Rows[0]["User_PhonePrint"]) == true)
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tblUser.Rows[0]["User_Telephone"].ToString();
- else
- strOrderPerson = tblUser.Rows[0]["User_Name"].ToString() + " " + tbl.Rows[0]["Company_Telephone"].ToString();
- }
- g.DrawString(strOrderPerson, ft9, b, rec5_8);//画第四列的列标题
- #endregion
- #region 第四行
- Rectangle rec6 = new Rectangle(rec5.X, rec5.Y + rec5.Height, TableWidth - ColumnWidth5 - ColumnWidth6, 375 - Rec1Height - LeftWidth);
- g.DrawRectangle(p, rec6);//画标题矩形
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("服务内容");
- sizef = g.MeasureString(rec2Value, ft17);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height) + 1;
- Rectangle rec6_1 = new Rectangle(rec6.X + LeftAdd * 2, rec6.Y + (rec6.Height / 2 - FtHeight * 2), ColumnWidth1 / 2, FtHeight * 4);
- g.DrawString(rec2Value, ft13, b, rec6_1);//画第一列的列标题
- Point p61_1 = new Point(rec6.X + rec6_1.Width, rec6.Y);
- Point p61_2 = new Point(rec6.X + rec6_1.Width, rec6.Y + rec6.Height);
- g.DrawLine(p, p61_1, p61_2);//画第一表与第二列的界线
- Rectangle rec6_2 = new Rectangle(p61_1.X + LeftAdd, p61_1.Y + TopAdd, TableWidth - ColumnWidth6 - rec6_1.Width, rec6.Height - TopAdd * 2);
- g.DrawString(StrProdName, GetFontSize("服务预约单内容详情字体大小"), b, rec6_2);//画第二列的列标题
- Rectangle rec7 = new Rectangle(rec6.X + rec6.Width, rec6.Y, ColumnWidth5 + ColumnWidth6, rec6.Height - RowHeight * 2);
- g.DrawRectangle(p, rec7);//画标题矩形
- Rectangle rec7_3 = new Rectangle(rec7.X + LeftAdd, rec7.Y + (rec7.Height / 2 - FtHeight * 2), rec6_1.Width, rec7.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("注意事项"), ft13, b, rec7_3);//画第三列的列标题
- Point p73_1 = new Point(rec7.X + rec7_3.Width, rec7.Y);
- Point p73_2 = new Point(rec7.X + rec7_3.Width, rec7.Y + rec7.Height);
- g.DrawLine(p, p73_1, p73_2);//画第三表与第四列的界线
- StrValue = "";
- if (PrintOtherData.ContainsKey("服务预约单注意事项说明") && PrintOtherData["服务预约单注意事项说明"].ToString().Trim().Length > 0)
- {
- StrValue = PrintOtherData["服务预约单注意事项说明"].ToString().Trim();
- }
- Rectangle rec7_4 = new Rectangle(p73_1.X + LeftAdd, p73_1.Y + TopAdd, rec7.Width - rec7_3.Width - LeftAdd * 2, rec7.Height - TopAdd * 2);
- g.DrawString(StrValue, GetFontSize("服务预约单注意事项字体大小"), b, rec7_4);//画第四列的列标题
- #endregion
- #region 顾客签字
- Rectangle rec8A = new Rectangle(rec7.X, rec7.Y + rec7.Height, ColumnWidth5 + ColumnWidth6, RowHeight * 2);
- g.DrawRectangle(p, rec8A);//画标题矩形
- Rectangle rec8A_1 = new Rectangle(rec6.X + rec6.Width + LeftAdd * 2, rec8A.Y + TopAdd * 3, ColumnWidth5, RowContentHeight);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("顾客签字"), ft9, b, rec8A_1);//画第一列的列标题
- Point p8A1_1 = new Point(rec8A.X + ColumnWidth5, rec8A.Y);
- Point p8A1_2 = new Point(rec8A.X + ColumnWidth5, rec8A.Y + rec8A.Height);
- g.DrawLine(p, p8A1_1, p8A1_2);//画第一表与第二列的界线
- Rectangle rec8A_2 = new Rectangle(p8A1_1.X + LeftAdd, p8A1_1.Y + TopAdd, ColumnWidth6, RowContentHeight);
- //g.DrawString("", ft9, b, rec8A_2);//画第六列的列标题
- if (LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.PrintOrderShowPayment)
- {
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("收款"), ft9, b, rec6_1.X + LeftAdd * 3 + 5 - 6, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
- g.DrawLine(p, rec6_1.X - 6, p8A1_1.Y, rec6_1.X - 6, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec6_1.X - 6 + ColumnWidth1, p8A1_1.Y + RowContentHeight * 2 + 5, rec6_1.X - 6 + ColumnWidth1, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec6_1.X - 6 + TableWidth, p8A1_1.Y, rec6_1.X - 6 + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- g.DrawLine(p, rec6_1.X - 6, p8A1_2.Y + rec8A_2.Height + 5, rec6_1.X - 6 + TableWidth, p8A1_2.Y + rec8A_2.Height + 5);//画第六列的列标题
- rec8A_2.Height += 10;
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(strPaymentMsg), ft9, b, rec6_1.X + LeftAdd * 22, p8A1_2.Y + TopAdd + 2);//画第一列的列标题
- }
- else
- {
- rec8A_2.Height = 0;
- }
- #endregion
- #region 尾行
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("电话:") + tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9_1 = new Rectangle(TableWidth + LeftWidth - FtWidth, rec6.Y + rec6.Height + TopAdd + rec8A_2.Height, FtWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9_1);//画第一列的列标题
- rec2Value = LYFZ.BLL.OtherCommonModel.FontConversion("地址:") + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString(rec2Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle rec9 = new Rectangle(rec6.X, rec9_1.Y, TableWidth - rec9_1.Width - LeftWidth, FtHeight);
- g.DrawString(rec2Value, ft9, b, rec9);//画第一列的列标题
- #endregion
- //bitmapList.Add(bitmap);
- }
- #endregion
- /// <summary>
- /// 缓存图片
- /// </summary>
- /// <returns></returns>
- static Image CachePhoto( PhotoLogType phototype, object StrUpdateDate, string SingleLOG = "" )
- {
- if ( phototype == PhotoLogType.DimensionalCode )
- {
- string strUpdateTime = LYFZ.Command.Command_Validate.DateTimeToString( StrUpdateDate, "yyyyMMddHHmmss" );
- string PhotoLogPath = LYFZ.WinAPI.CustomPublicMethod.GetFullDirectoryPath( LYFZ.WinAPI.CustomPublicMethod.BasePath ) + @"Temp\StorePhotoLog\";
- string PhotoLogName = phototype.ToString().Trim() + "_" + strUpdateTime + ".jpg";
- string PhotoLogAllPath = PhotoLogPath + PhotoLogName;
- if ( !System.IO.Directory.Exists( PhotoLogPath ) )
- {
- try { System.IO.Directory.CreateDirectory( PhotoLogPath ); }
- catch ( Exception e )
- {
- MessageBoxCustom.Show( "创建打印的图片文件夹失败“" + PhotoLogPath + "”!原因:" + e.Message.ToString() ); return null;
- }
- }
- else
- {
- string[] StrFilePath = System.IO.Directory.GetFiles( PhotoLogPath );
- for ( int i = 0; i < StrFilePath.Length; i++ )
- {
- if ( PhotoLogAllPath.ToLower() != StrFilePath[i].Trim().ToLower() )
- {
- try
- {
- if ( System.IO.File.Exists( StrFilePath[i].Trim() ) )
- {
- System.IO.File.Delete( StrFilePath[i].Trim() );
- }
- }
- catch { }
- }
- }
- }
- bool Istrue = true;
- if ( System.IO.File.Exists( PhotoLogAllPath ) )
- {
- string[] OldPhotoName = System.IO.Path.GetFileNameWithoutExtension( PhotoLogAllPath ).Trim().Split( '_' );
- if ( OldPhotoName[1].Trim() == strUpdateTime )
- {
- Istrue = false;
- }
- }
- Image PhotoImg = null;
- if ( Istrue )
- {
- string strColumnsName = "";
- switch ( phototype )
- {
- case PhotoLogType.Portrait:
- strColumnsName = "Company_PortraitLOG";
- break;
- case PhotoLogType.Wedding:
- strColumnsName = "Company_WeddingSingleLOG";
- break;
- case PhotoLogType.Child:
- strColumnsName = "Company_ChildSingleLOG";
- break;
- case PhotoLogType.Service:
- strColumnsName = "Company_ServiceLOG";
- break;
- case PhotoLogType.DimensionalCode:
- strColumnsName = "Company_DimensionalCode";
- break;
- }
- DataTable tb = new BLL.BLL_ErpOrder().GetView_Custom( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID() + "'", ShowColumnName: strColumnsName ).Tables[0];
- if ( tb.Rows[0][strColumnsName].ToString().Trim() != "" )
- {
- Bitmap bmp = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte( tb.Rows[0][strColumnsName].ToString() ) );
- // System.Drawing.Image img = (Bitmap)bmp;
- PhotoImg = new System.Drawing.Bitmap( bmp );
- bmp.Dispose();
- // img.Dispose();
- PhotoImg.Save( PhotoLogAllPath );
- }
- //else
- //{ MessageBoxCustom.Show("本店信息未设置图片"); }
- }
- else
- {
- System.IO.FileStream fs = new System.IO.FileStream( PhotoLogAllPath, System.IO.FileMode.Open, System.IO.FileAccess.Read );
- Bitmap bmp = (Bitmap)System.Drawing.Bitmap.FromStream( fs );
- PhotoImg = new System.Drawing.Bitmap( bmp );
- bmp.Dispose();
- fs.Close();
- }
- return PhotoImg;
- }
- else
- {
- return LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte( SingleLOG ) );
- }
- //if (!string.IsNullOrEmpty(SingleLOG))
- //{ return LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte(SingleLOG)); }
- //else
- //{
- // return null;
- // //string strUpdateTime = LYFZ.Command.Command_Validate.DateTimeToString(StrUpdateDate, "yyyyMMddHHmmss");
- // //string PhotoLogPath = LYFZ.WinAPI.CustomPublicMethod.GetFullDirectoryPath(LYFZ.WinAPI.CustomPublicMethod.BasePath) + @"Temp\StorePhotoLog\";
- // //string PhotoLogName = phototype.ToString().Trim() + "_" + strUpdateTime + ".jpg";
- // //string PhotoLogAllPath = PhotoLogPath + PhotoLogName;
- // //if (!System.IO.Directory.Exists(PhotoLogPath))
- // //{
- // // try { System.IO.Directory.CreateDirectory(PhotoLogPath); }
- // // catch
- // // { MessageBoxCustom.Show("创建预约单文件夹失败"); return null; }
- // //}
- // //else
- // //{
- // // string[] StrFilePath = System.IO.Directory.GetFiles(PhotoLogPath);
- // // for (int i = 0; i < StrFilePath.Length; i++)
- // // {
- // // if (System.IO.File.Exists(StrFilePath[i].Trim()))
- // // { System.IO.File.Delete(StrFilePath[i].Trim()); }
- // // }
- // //}
- // //bool Istrue = true;
- // //if (System.IO.File.Exists(PhotoLogAllPath))
- // //{
- // // string[] OldPhotoName = System.IO.Path.GetFileNameWithoutExtension(PhotoLogAllPath).Trim().Split('_');
- // // if (OldPhotoName[1].Trim() == strUpdateTime)
- // // { Istrue = false; }
- // //}
- // //Image PhotoImg = null;
- // //if (Istrue)
- // //{
- // // string strColumnsName = "";
- // // switch (phototype)
- // // {
- // // case PhotoLogType.Portrait:
- // // strColumnsName = "Company_PortraitLOG";
- // // break;
- // // case PhotoLogType.Wedding:
- // // strColumnsName = "Company_WeddingSingleLOG";
- // // break;
- // // case PhotoLogType.Child:
- // // strColumnsName = "Company_ChildSingleLOG";
- // // break;
- // // case PhotoLogType.Service:
- // // strColumnsName = "Company_ServiceLOG";
- // // break;
- // // case PhotoLogType.DimensionalCode:
- // // strColumnsName = "Company_DimensionalCode";
- // // break;
- // // }
- // // DataTable tb = new BLL.BLL_ErpOrder().GetView_Custom("tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetLocalCompanyInfoID() + "'", ShowColumnName: strColumnsName).Tables[0];
- // // if (tb.Rows[0][strColumnsName].ToString().Trim() != "")
- // // {
- // // Bitmap bmp = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetImage(LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.StringToByte(tb.Rows[0][strColumnsName].ToString()));
- // // System.Drawing.Image img = (Bitmap)bmp;
- // // PhotoImg = new System.Drawing.Bitmap(img);
- // // img.Dispose();
- // // PhotoImg.Save(PhotoLogAllPath);
- // // }
- // // //else
- // // //{ MessageBoxCustom.Show("本店信息未设置图片"); }
- // //}
- // //else
- // //{
- // // System.IO.FileStream fs = new System.IO.FileStream(PhotoLogAllPath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
- // // PhotoImg = System.Drawing.Image.FromStream(fs);
- // // fs.Close();
- // //}
- // //return PhotoImg;
- //}
- }
- /// <summary>
- /// 相片类型
- /// </summary>
- private enum PhotoLogType
- {
- /// <summary>
- /// 二维码
- /// </summary>
- DimensionalCode = -1,
- /// <summary>
- /// 婚纱
- /// </summary>
- Wedding = 0,
- /// <summary>
- /// 儿童
- /// </summary>
- Child = 1,
- /// <summary>
- /// 写真
- /// </summary>
- Portrait = 2,
- /// <summary>
- /// 服务
- /// </summary>
- Service = 3,
- /// <summary>
- /// 小票婚纱
- /// </summary>
- SmallTicketWedding = 4,
- /// <summary>
- /// 小票儿童
- /// </summary>
- SmallTicketChild = 5,
- /// <summary>
- /// 小票写真
- /// </summary>
- SmallTicketPortrait = 6
- }
- #endregion
- #region 礼服管理
- /// <summary>
- /// 礼服管理——出租清单打印
- /// </summary>
- /// <returns></returns>
- public static void Dresses_RentalGownsList_Print( object objValue, Graphics g, Size size )
- {
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpDressSaleRentalOrder", StrWhere: "Dsro_Number = '" + objValue.ToString().Trim() + "'" );
- ExecuteSql += ";select Dsrd_DressNumber,Dsfm_DressCustomNumber,Dsrd_DressName,Dsrd_SaleRentalQuantity from tb_ErpDressSaleRentalDetail Left Join tb_ErpDressFrom on Dsfm_DressNumber = Dsrd_DressNumber where Dsrd_Number = '" + objValue.ToString().Trim() + "'";
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tbl_order = dtSet.Tables["ds1"];
- DataTable tbl_Detail = dtSet.Tables["ds2"];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息!" ); return;
- }
- if ( tbl_order.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "订单" + objValue.ToString().Trim() + "不存在!" ); return;
- }
-
- DataTable tbl_Cus = orbll.GetView_Custom( "tb_ErpCustomer", StrWhere: " Cus_CustomerNumber in ('" + tbl_order.Rows[0]["Dsro_CustomerNumber"].ToString_s().Replace(",","','") + "') ", ShowColumnName: "Cus_Name,Cus_Telephone,Cus_DayForMarriage,Cus_Address" ).Tables[0];
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft18 = new Font( "宋体", 18 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- Font ft8 = new Font( "宋体", 8 );
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- int LeftAdd = 3;
- int TopAdd = 6;
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( size.Width / 2 - StrWidth / 2, 50, StrWidth, StrHeigth );
- g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
- string SinglePerson = "接单人:" + LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( tbl_order.Rows[0]["Dsro_CreateName"].ToString_s() ); //2017-03-30 刘工添加
- string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( SinglePerson + " " + "出租单号:" ) + objValue.ToString().Trim();
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 15 - StrHeigth, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2 );
- Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, 50 );
- g.DrawRectangle( p, rec3 );//画标题矩形
- #region 第一行
- #region 姓名
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_A1 );
- recValue = tbl_Cus.Rows[0]["Cus_Name"].ToString().Trim();
- Rectangle rec3_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3.Y + TopAdd, rec3_A1.X + rec3_A1.Width + 85, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_A2 );
- g.DrawLine( p, new Point( rec3_A1.X + rec3_A1.Width, rec3_A1.Y + rec3_A1.Height - 4 ), new Point( rec3_A2.Width, rec3_A1.Y + rec3_A1.Height - 4 ) );
- #endregion
- #region 电话
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_B1 = new Rectangle( rec3_A2.X + rec3_A2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_B1 );
- recValue = tbl_Cus.Rows[0]["Cus_Telephone"].ToString().Trim();
- Rectangle rec3_B2 = new Rectangle( rec3_B1.X + rec3_B1.Width, rec3.Y + TopAdd, rec3_B1.X + rec3_B1.Width + 85, StrHeigth );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( recValue ), ft10, b, rec3_B2 );
- g.DrawLine( p, new Point( rec3_B1.X + rec3_B1.Width, rec3_B1.Y + rec3_B1.Height - 4 ), new Point( rec3_B2.Width, rec3_B1.Y + rec3_B1.Height - 4 ) );
- #endregion
- #region 租金
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "应交租金:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_C1 = new Rectangle( rec3_B2.X + rec3_B2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_C1 );
- recValue = tbl_order.Rows[0]["Dsro_Amount"].ToString().Trim();
- Rectangle rec3_C2 = new Rectangle( rec3_C1.X + rec3_C1.Width, rec3.Y + TopAdd, rec3_C1.X + rec3_C1.Width + 90, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_C2 );
- g.DrawLine( p, new Point( rec3_C1.X + rec3_C1.Width, rec3_C1.Y + rec3_C1.Height - 4 ), new Point( rec3_C2.Width, rec3_C1.Y + rec3_C1.Height - 4 ) );
- #endregion
- #region 押金
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "应交押金:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_D1 = new Rectangle( rec3_C2.X + rec3_C2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_D1 );
- recValue = tbl_order.Rows[0]["Dsro_MortgageAmount"].ToString().Trim();
- Rectangle rec3_D2 = new Rectangle( rec3_D1.X + rec3_D1.Width, rec3.Y + TopAdd, rec3_D1.X + rec3_D1.Width + 90, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_D2 );
- g.DrawLine( p, new Point( rec3_D1.X + rec3_D1.Width, rec3_D1.Y + rec3_D1.Height - 4 ), new Point( rec3_D2.Width, rec3_D1.Y + rec3_D1.Height - 4 ) );
- #endregion
- #endregion
- #region 第二行
- #region 结婚日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "结婚日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_E1 = new Rectangle( rec3.X + LeftAdd, rec3_A2.Y + rec3_A2.Height + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_E1 );
- if ( tbl_Cus.Rows[0]["Cus_DayForMarriage"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_Cus.Rows[0]["Cus_DayForMarriage"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_E2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3_E1.Y, rec3_A1.X + rec3_A1.Width + 100, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_E2 );
- g.DrawLine( p, new Point( rec3_A1.X + rec3_A1.Width, rec3_E1.Y + rec3_E1.Height - 4 ), new Point( rec3_A2.Width, rec3_E1.Y + rec3_E1.Height - 4 ) );
- #endregion
- #region 预定日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "预定日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_F1 = new Rectangle( rec3_B1.X, rec3_E1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_F1 );
- if ( tbl_order.Rows[0]["Dsro_CreateDateTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_CreateDateTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_F2 = new Rectangle( rec3_F1.X + rec3_F1.Width, rec3_E2.Y, rec3_B2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_F2 );
- g.DrawLine( p, new Point( rec3_F1.X + rec3_F1.Width, rec3_F1.Y + rec3_F1.Height - 4 ), new Point( rec3_F2.Width, rec3_F1.Y + rec3_F1.Height - 4 ) );
- #endregion
- #region 取衣日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "取衣日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_G1 = new Rectangle( rec3_C1.X, rec3_F1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_G1 );
- if ( tbl_order.Rows[0]["Dsro_TakeDressTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_TakeDressTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_G2 = new Rectangle( rec3_G1.X + rec3_G1.Width, rec3_E2.Y, rec3_C2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_G2 );
- g.DrawLine( p, new Point( rec3_G1.X + rec3_G1.Width, rec3_G1.Y + rec3_G1.Height - 4 ), new Point( rec3_G2.Width, rec3_G1.Y + rec3_G1.Height - 4 ) );
- #endregion
- #region 归还日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "归还日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_H1 = new Rectangle( rec3_D1.X, rec3_G1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_H1 );
- if ( tbl_order.Rows[0]["Dsro_ReservationBackTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_ReservationBackTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_H2 = new Rectangle( rec3_H1.X + rec3_H1.Width, rec3_E2.Y, rec3_D2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_H2 );
- g.DrawLine( p, new Point( rec3_H1.X + rec3_H1.Width, rec3_H1.Y + rec3_H1.Height - 4 ), new Point( rec3_H2.Width, rec3_H1.Y + rec3_H1.Height - 4 ) );
- #endregion
- #endregion
- #region 服务项
- string recValue3 = "";
- for ( int i = 0; i < tbl_Detail.Rows.Count; i++ )
- {
- recValue3 += LYFZ.BLL.OtherCommonModel.FontConversion( "编号:" ) + tbl_Detail.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 名称:" ) + tbl_Detail.Rows[i]["Dsrd_DressName"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 数量:" ) + tbl_Detail.Rows[i]["Dsrd_SaleRentalQuantity"].ToString().Trim() + "\r\n";
- }
- sizef = g.MeasureString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10 );
- int StrHeigth3 = 0;
- int rec4Height = 0;
- if ( tbl_Detail.Rows.Count > 11 )
- {
- StrHeigth3 = Convert.ToInt32( sizef.Height );
- rec4Height = StrHeigth3 + TopAdd;
- }
- else
- {
- StrHeigth3 = StrHeigth;
- rec4Height = 140;
- }
- int StrWidth3 = Convert.ToInt32( sizef.Width ) + 5;
- Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, rec4Height );
- g.DrawRectangle( p, rec4 );//画标题矩形
- #region 服务项目
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "服务项目:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec4_A1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec4_A1 );
- #endregion
- #region 项目内容
- Rectangle rec4_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec4.Y + TopAdd, TableWidth - rec4_A1.Width - LeftAdd, rec4Height - TopAdd * 2 );
- g.DrawString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10, b, rec4_A2 );
- #endregion
- #endregion
- #region 备注
- recValue = "测试:";
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, StrHeigth * 2 + TopAdd );
- g.DrawRectangle( p, rec5 );//画标题矩形
- #region 备注
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_A1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec5_A1 );
- #endregion
- #region 项目内容
- //int IntCout = 3;
- recValue = tbl_order.Rows[0]["Dsro_Remark"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec5.Y + TopAdd, rec4_A2.Width, StrHeigth * 2 );
- g.DrawString( recValue, ft10, b, rec5_A2 );
- #endregion
- #endregion
- #region 注意事项
- string recValue2 = "";
- if ( PrintOtherData.ContainsKey( "礼服单说明" ) && PrintOtherData["礼服单说明"].ToString().Trim().Length > 0 )
- {
- recValue2 = PrintOtherData["礼服单说明"].ToString().Trim();
- sizef = g.MeasureString( recValue2, ft8 );
- sizef.Height = 128;
- }
- else
- {
- sizef = g.MeasureString( "测试", ft8 );
- sizef.Height = 128;
- }
- int StrHeigth2 = Convert.ToInt32( sizef.Height );
- int StrWidth2 = Convert.ToInt32( sizef.Width ) + 5;
- Rectangle rec6 = new Rectangle( LeftWidth, rec5.Y + rec5.Height, TableWidth, StrHeigth2 + (TopAdd * 3) / 2 );
- g.DrawRectangle( p, rec6 );//画标题矩形
- #region 事项说明
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:" );
- sizef = g.MeasureString( recValue, ft8 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec6_A1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft8, b, rec6_A1 );
- Rectangle rec6_A2 = new Rectangle( rec6_A1.X + rec6_A1.Width, rec6.Y + TopAdd, rec4_A2.Width, StrHeigth2 );
- g.DrawString( recValue2, ft8, b, rec6_A2 );
- #endregion
- #endregion
- #region 尾
- Rectangle rec7 = new Rectangle( LeftWidth, rec6.Y + rec6.Height, TableWidth, 55 );
- g.DrawRectangle( p, rec7 );//画标题矩形
- #region 第一行
- #region 本店电话
- string StrPhone = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店电话:" ) + StrPhone;
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_B1 = new Rectangle( TableWidth + LeftWidth - 20 - StrWidth, rec7.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_B1 );
- g.DrawLine( p, new Point( TableWidth + LeftWidth - (Convert.ToInt32( g.MeasureString( StrPhone, ft10 ).Width ) + 1) - 20, rec7_B1.Y + rec7_B1.Height - 4 ), new Point( TableWidth + LeftWidth - 20, rec7_B1.Y + rec7_B1.Height - 4 ) );
- #endregion
- #region 本店地址
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_A1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, TableWidth - LeftWidth - rec7_B1.Width - 20, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_A1 );
- g.DrawLine( p, new Point( rec7_A1.X + LeftWidth + 50, rec7_A1.Y + rec7_A1.Height - 3 ), new Point( TableWidth - rec7_B1.Width - 20, rec7_A1.Y + rec7_A1.Height - 3 ) );
- #endregion
- #endregion
- #region 第二行
- #region 客户地址
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户地址:" ) + tbl_Cus.Rows[0]["Cus_Address"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_E1 = new Rectangle( rec7_A1.X, rec7_B1.Y + rec7_B1.Height + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_E1 );
- g.DrawLine( p, new Point( rec7_A1.X + LeftWidth + 50, rec7_E1.Y + rec7_E1.Height - 4 ), new Point( TableWidth - rec7_B1.Width - 20, rec7_E1.Y + rec7_E1.Height - 4 ) );
- #endregion
- #region 客户签名
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户签名:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_F1 = new Rectangle( rec7_B1.X, rec7_E1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_F1 );
- g.DrawLine( p, new Point( TableWidth + LeftWidth - (Convert.ToInt32( g.MeasureString( StrPhone, ft10 ).Width ) + 1) - 20, rec7_F1.Y + rec7_F1.Height - 4 ), new Point( TableWidth + LeftWidth - 20, rec7_F1.Y + rec7_F1.Height - 4 ) );
- #endregion
- #endregion
- #endregion
- }
- /// <summary>
- /// 礼服管理——出租清单A4打印
- /// </summary>
- /// <returns></returns>
- public static void Dresses_RentalGownsList_A4Print( object objValue, Graphics g, Size size )
- {
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpDressSaleRentalOrder", StrWhere: "Dsro_Number = '" + objValue.ToString().Trim() + "'" );
- ExecuteSql += ";select Dsrd_DressNumber,Dsfm_DressCustomNumber,Dsrd_DressName,Dsrd_SaleRentalQuantity from tb_ErpDressSaleRentalDetail Left Join tb_ErpDressFrom on Dsfm_DressNumber = Dsrd_DressNumber where Dsrd_Number = '" + objValue.ToString().Trim() + "'";
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tbl_order = dtSet.Tables["ds1"];
- DataTable tbl_Detail = dtSet.Tables["ds2"];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息!" ); return;
- }
- if ( tbl_order.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "订单" + objValue.ToString().Trim() + "不存在!" ); return;
- }
- DataTable tbl_Cus = orbll.GetView_Custom( "tb_ErpCustomer", StrWhere: " Cus_CustomerNumber in ('" + tbl_order.Rows[0]["Dsro_CustomerNumber"].ToString_s().Replace(",", "','") + "') ", ShowColumnName: "Cus_Name,Cus_Telephone,Cus_DayForMarriage,Cus_Address" ).Tables[0];
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft18 = new Font( "宋体", 18 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- Font ft8 = new Font( "宋体", 8 );
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- int LeftAdd = 3;
- int TopAdd = 10;
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( size.Width / 2 - StrWidth / 2, 50, StrWidth, StrHeigth );
- g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
- string SinglePerson = "接单人:" + LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( tbl_order.Rows[0]["Dsro_CreateName"].ToString_s() ); //2017-03-30 刘工添加
- string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( SinglePerson + " " + "出租单号:" ) + objValue.ToString().Trim();
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 15 - StrHeigth, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2 );
- Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height + 5, TableWidth, 60 );
- g.DrawRectangle( p, rec3 );//画标题矩形
- #region 第一行
- #region 姓名
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_A1 );
- recValue = tbl_Cus.Rows[0]["Cus_Name"].ToString().Trim();
- Rectangle rec3_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3.Y + TopAdd, rec3_A1.X + rec3_A1.Width + 85, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_A2 );
- g.DrawLine( p, new Point( rec3_A1.X + rec3_A1.Width, rec3_A1.Y + rec3_A1.Height - 4 ), new Point( rec3_A2.Width, rec3_A1.Y + rec3_A1.Height - 4 ) );
- #endregion
- #region 电话
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_B1 = new Rectangle( rec3_A2.X + rec3_A2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_B1 );
- recValue = tbl_Cus.Rows[0]["Cus_Telephone"].ToString().Trim();
- Rectangle rec3_B2 = new Rectangle( rec3_B1.X + rec3_B1.Width, rec3.Y + TopAdd, rec3_B1.X + rec3_B1.Width + 85, StrHeigth );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( recValue ), ft10, b, rec3_B2 );
- g.DrawLine( p, new Point( rec3_B1.X + rec3_B1.Width, rec3_B1.Y + rec3_B1.Height - 4 ), new Point( rec3_B2.Width, rec3_B1.Y + rec3_B1.Height - 4 ) );
- #endregion
- #region 租金
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "应交租金:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_C1 = new Rectangle( rec3_B2.X + rec3_B2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_C1 );
- recValue = tbl_order.Rows[0]["Dsro_Amount"].ToString().Trim();
- Rectangle rec3_C2 = new Rectangle( rec3_C1.X + rec3_C1.Width, rec3.Y + TopAdd, rec3_C1.X + rec3_C1.Width + 90, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_C2 );
- g.DrawLine( p, new Point( rec3_C1.X + rec3_C1.Width, rec3_C1.Y + rec3_C1.Height - 4 ), new Point( rec3_C2.Width, rec3_C1.Y + rec3_C1.Height - 4 ) );
- #endregion
- #region 押金
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "应交押金:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_D1 = new Rectangle( rec3_C2.X + rec3_C2.Y + 5, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_D1 );
- recValue = tbl_order.Rows[0]["Dsro_MortgageAmount"].ToString().Trim();
- Rectangle rec3_D2 = new Rectangle( rec3_D1.X + rec3_D1.Width, rec3.Y + TopAdd, rec3_D1.X + rec3_D1.Width + 90, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_D2 );
- g.DrawLine( p, new Point( rec3_D1.X + rec3_D1.Width, rec3_D1.Y + rec3_D1.Height - 4 ), new Point( rec3_D2.Width, rec3_D1.Y + rec3_D1.Height - 4 ) );
- #endregion
- #endregion
- #region 第二行
- #region 结婚日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "结婚日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_E1 = new Rectangle( rec3.X + LeftAdd, rec3_A2.Y + rec3_A2.Height + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_E1 );
- if ( tbl_Cus.Rows[0]["Cus_DayForMarriage"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_Cus.Rows[0]["Cus_DayForMarriage"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_E2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3_E1.Y, rec3_A1.X + rec3_A1.Width + 100, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_E2 );
- g.DrawLine( p, new Point( rec3_A1.X + rec3_A1.Width, rec3_E1.Y + rec3_E1.Height - 4 ), new Point( rec3_A2.Width, rec3_E1.Y + rec3_E1.Height - 4 ) );
- #endregion
- #region 预定日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "预定日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_F1 = new Rectangle( rec3_B1.X, rec3_E1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_F1 );
- if ( tbl_order.Rows[0]["Dsro_CreateDateTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_CreateDateTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_F2 = new Rectangle( rec3_F1.X + rec3_F1.Width, rec3_E2.Y, rec3_B2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_F2 );
- g.DrawLine( p, new Point( rec3_F1.X + rec3_F1.Width, rec3_F1.Y + rec3_F1.Height - 4 ), new Point( rec3_F2.Width, rec3_F1.Y + rec3_F1.Height - 4 ) );
- #endregion
- #region 取衣日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "取衣日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_G1 = new Rectangle( rec3_C1.X, rec3_F1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_G1 );
- if ( tbl_order.Rows[0]["Dsro_TakeDressTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_TakeDressTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_G2 = new Rectangle( rec3_G1.X + rec3_G1.Width, rec3_E2.Y, rec3_C2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_G2 );
- g.DrawLine( p, new Point( rec3_G1.X + rec3_G1.Width, rec3_G1.Y + rec3_G1.Height - 4 ), new Point( rec3_G2.Width, rec3_G1.Y + rec3_G1.Height - 4 ) );
- #endregion
- #region 归还日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "归还日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_H1 = new Rectangle( rec3_D1.X, rec3_G1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_H1 );
- if ( tbl_order.Rows[0]["Dsro_ReservationBackTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_ReservationBackTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_H2 = new Rectangle( rec3_H1.X + rec3_H1.Width, rec3_E2.Y, rec3_D2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_H2 );
- g.DrawLine( p, new Point( rec3_H1.X + rec3_H1.Width, rec3_H1.Y + rec3_H1.Height - 4 ), new Point( rec3_H2.Width, rec3_H1.Y + rec3_H1.Height - 4 ) );
- #endregion
- #endregion
- #region 服务项
- string recValue3 = "";
- for ( int i = 0; i < tbl_Detail.Rows.Count; i++ )
- {
- recValue3 += LYFZ.BLL.OtherCommonModel.FontConversion( "编号:" ) + tbl_Detail.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 名称:" ) + tbl_Detail.Rows[i]["Dsrd_DressName"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 数量:" ) + tbl_Detail.Rows[i]["Dsrd_SaleRentalQuantity"].ToString().Trim() + "\r\n";
- }
- sizef = g.MeasureString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10 );
- int StrHeigth3 = 0;
- int rec4Height = 0;
- if ( tbl_Detail.Rows.Count > 30 )
- {
- StrHeigth3 = Convert.ToInt32( sizef.Height );
- rec4Height = StrHeigth3 + TopAdd;
- if ( rec4Height < 400 )
- {
- rec4Height = 400;
- }
- }
- else
- {
- StrHeigth3 = StrHeigth;
- rec4Height = 400;
- }
- int StrWidth3 = Convert.ToInt32( sizef.Width ) + 5;
- Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, rec4Height );
- g.DrawRectangle( p, rec4 );//画标题矩形
- #region 服务项目
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "服务项目:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec4_A1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec4_A1 );
- #endregion
- #region 项目内容
- Rectangle rec4_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec4.Y + TopAdd, TableWidth - rec4_A1.Width - LeftAdd, rec4Height - TopAdd * 2 );
- g.DrawString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10, b, rec4_A2 );
- #endregion
- #endregion
- #region 备注
- recValue = "测试:";
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, StrHeigth * 3 + TopAdd );
- g.DrawRectangle( p, rec5 );//画标题矩形
- #region 备注
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_A1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec5_A1 );
- #endregion
- #region 项目内容
- //int IntCout = 3;
- recValue = tbl_order.Rows[0]["Dsro_Remark"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec5.Y + TopAdd, rec4_A2.Width, StrHeigth * 3 );
- g.DrawString( recValue, ft10, b, rec5_A2 );
- #endregion
- #endregion
- #region 注意事项
- string recValue2 = "";
- if ( PrintOtherData.ContainsKey( "礼服单说明" ) && PrintOtherData["礼服单说明"].ToString().Trim().Length > 0 )
- {
- recValue2 = PrintOtherData["礼服单说明"].ToString().Trim();
- sizef = g.MeasureString( recValue2, ft10 );
- sizef.Height = 280;
- }
- else
- {
- sizef = g.MeasureString( "测试", ft10 );
- sizef.Height = 280;
- }
- int StrHeigth2 = Convert.ToInt32( sizef.Height );
- int StrWidth2 = Convert.ToInt32( sizef.Width ) + 5;
- Rectangle rec6 = new Rectangle( LeftWidth, rec5.Y + rec5.Height, TableWidth, StrHeigth2 + (TopAdd * 3) / 2 );
- g.DrawRectangle( p, rec6 );//画标题矩形
- #region 事项说明
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec6_A1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec6_A1 );
- Rectangle rec6_A2 = new Rectangle( rec6_A1.X + rec6_A1.Width, rec6.Y + TopAdd, rec4_A2.Width, StrHeigth2 );
- g.DrawString( recValue2, ft10, b, rec6_A2 );
- #endregion
- #endregion
- #region 尾
- Rectangle rec7 = new Rectangle( LeftWidth, rec6.Y + rec6.Height, TableWidth, 65 );
- g.DrawRectangle( p, rec7 );//画标题矩形
- #region 第一行
- #region 本店电话
- string StrPhone = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店电话:" ) + StrPhone;
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_B1 = new Rectangle( TableWidth + LeftWidth - 20 - StrWidth, rec7.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_B1 );
- g.DrawLine( p, new Point( TableWidth + LeftWidth - (Convert.ToInt32( g.MeasureString( StrPhone, ft10 ).Width ) + 1) - 20, rec7_B1.Y + rec7_B1.Height - 4 ), new Point( TableWidth + LeftWidth - 20, rec7_B1.Y + rec7_B1.Height - 4 ) );
- #endregion
- #region 本店地址
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_A1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, TableWidth - LeftWidth - rec7_B1.Width - 20, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_A1 );
- g.DrawLine( p, new Point( rec7_A1.X + LeftWidth + 50, rec7_A1.Y + rec7_A1.Height - 3 ), new Point( TableWidth - rec7_B1.Width - 20, rec7_A1.Y + rec7_A1.Height - 3 ) );
- #endregion
- #endregion
- #region 第二行
- #region 客户地址
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户地址:" ) + tbl_Cus.Rows[0]["Cus_Address"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_E1 = new Rectangle( rec7_A1.X, rec7_B1.Y + rec7_B1.Height + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_E1 );
- g.DrawLine( p, new Point( rec7_A1.X + LeftWidth + 50, rec7_E1.Y + rec7_E1.Height - 4 ), new Point( TableWidth - rec7_B1.Width - 20, rec7_E1.Y + rec7_E1.Height - 4 ) );
- #endregion
- #region 客户签名
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户签名:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_F1 = new Rectangle( rec7_B1.X, rec7_E1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_F1 );
- g.DrawLine( p, new Point( TableWidth + LeftWidth - (Convert.ToInt32( g.MeasureString( StrPhone, ft10 ).Width ) + 1) - 20, rec7_F1.Y + rec7_F1.Height - 4 ), new Point( TableWidth + LeftWidth - 20, rec7_F1.Y + rec7_F1.Height - 4 ) );
- #endregion
- #endregion
- #endregion
- }
- /// <summary>
- /// 礼服管理——出售清单A4打印
- /// </summary>
- /// <returns></returns>
- public static void Dresses_SoldGownsList_A4Print( object objValue, Graphics g, Size size )
- {
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpDressSaleRentalOrder", StrWhere: "Dsro_Number = '" + objValue.ToString().Trim() + "'" );
- ExecuteSql += ";select Dsrd_DressNumber,Dsfm_DressCustomNumber,Dsrd_DressName,Dsrd_SaleRentalQuantity from tb_ErpDressSaleRentalDetail Left Join tb_ErpDressFrom on Dsfm_DressNumber = Dsrd_DressNumber where Dsrd_Number = '" + objValue.ToString().Trim() + "'";
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tbl_order = dtSet.Tables["ds1"];
- DataTable tbl_Detail = dtSet.Tables["ds2"];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tbl_order.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "订单" + objValue.ToString().Trim() + "不存在" ); return;
- }
- DataTable tbl_Cus = orbll.GetView_Custom( "tb_ErpCustomer", StrWhere: " Cus_CustomerNumber in ('" + tbl_order.Rows[0]["Dsro_CustomerNumber"].ToString_s().Replace(",", "','") + "') ", ShowColumnName: "Cus_Name,Cus_Telephone,Cus_DayForMarriage,Cus_Address" ).Tables[0];
- Font ft18 = new Font( "宋体", 18 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- int LeftAdd = 3;
- int TopAdd = 10;
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( size.Width / 2 - StrWidth / 2, 50, StrWidth, StrHeigth );
- g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
- string SinglePerson = "接单人:" + LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( tbl_order.Rows[0]["Dsro_CreateName"].ToString_s() ); //2017-03-30 刘工添加
- string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( SinglePerson + " " + "出售单号:" ) + objValue.ToString().Trim();
- // string recValue = LYFZ.BLL.OtherCommonModel.FontConversion("出售单号:") + objValue.ToString().Trim();
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 15 - StrHeigth, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2 );
- Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, 60 );
- g.DrawRectangle( p, rec3 );//画标题矩形
- #region 第一行
- #region 姓名
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_A1 );
- recValue = tbl_Cus.Rows[0]["Cus_Name"].ToString().Trim();
- Rectangle rec3_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3.Y + TopAdd, rec3_A1.X + rec3_A1.Width + 100, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_A2 );
- g.DrawLine( p, new Point( rec3_A1.X + rec3_A1.Width, rec3_A1.Y + rec3_A1.Height - 4 ), new Point( rec3_A2.Width, rec3_A1.Y + rec3_A1.Height - 4 ) );
- #endregion
- #region 电话
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_B1 = new Rectangle( rec3_A2.X + rec3_A2.Y + 80, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_B1 );
- recValue = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl_Cus.Rows[0]["Cus_Telephone"] );
- Rectangle rec3_B2 = new Rectangle( rec3_B1.X + rec3_B1.Width, rec3.Y + TopAdd, rec3_B1.X + rec3_B1.Width + 100, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_B2 );
- g.DrawLine( p, new Point( rec3_B1.X + rec3_B1.Width, rec3_B1.Y + rec3_B1.Height - 4 ), new Point( rec3_B2.Width, rec3_B1.Y + rec3_B1.Height - 4 ) );
- #endregion
- #region 租金
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "出售金额:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_C1 = new Rectangle( rec3_B2.X + rec3_B2.Y + 80, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_C1 );
- recValue = tbl_order.Rows[0]["Dsro_Amount"].ToString().Trim();
- Rectangle rec3_C2 = new Rectangle( rec3_C1.X + rec3_C1.Width, rec3.Y + TopAdd, rec3_C1.X + rec3_C1.Width + 100, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_C2 );
- g.DrawLine( p, new Point( rec3_C1.X + rec3_C1.Width, rec3_C1.Y + rec3_C1.Height - 5 ), new Point( rec3_C2.Width, rec3_C1.Y + rec3_C1.Height - 5 ) );
- #endregion
- #endregion
- #region 第二行
- #region 结婚日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "结婚日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_E1 = new Rectangle( rec3.X + LeftAdd, rec3_A2.Y + rec3_A2.Height + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_E1 );
- if ( tbl_Cus.Rows[0]["Cus_DayForMarriage"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_Cus.Rows[0]["Cus_DayForMarriage"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_E2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3_E1.Y, rec3_A1.X + rec3_A1.Width + 250, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_E2 );
- g.DrawLine( p, new Point( rec3_A1.X + rec3_A1.Width, rec3_E1.Y + rec3_E1.Height - 5 ), new Point( rec3_A2.Width, rec3_E1.Y + rec3_E1.Height - 5 ) );
- #endregion
- #region 预定日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "预定日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_F1 = new Rectangle( rec3_B1.X, rec3_E1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_F1 );
- if ( tbl_order.Rows[0]["Dsro_CreateDateTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_CreateDateTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_F2 = new Rectangle( rec3_F1.X + rec3_F1.Width, rec3_E2.Y, rec3_B2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_F2 );
- g.DrawLine( p, new Point( rec3_F1.X + rec3_F1.Width, rec3_F1.Y + rec3_F1.Height - 5 ), new Point( rec3_F2.Width, rec3_F1.Y + rec3_F1.Height - 5 ) );
- #endregion
- #region 取衣日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "取衣日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_G1 = new Rectangle( rec3_C1.X, rec3_F1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_G1 );
- if ( tbl_order.Rows[0]["Dsro_TakeDressTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_TakeDressTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_G2 = new Rectangle( rec3_G1.X + rec3_G1.Width, rec3_E2.Y, rec3_C2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_G2 );
- g.DrawLine( p, new Point( rec3_G1.X + rec3_G1.Width, rec3_G1.Y + rec3_G1.Height - 5 ), new Point( rec3_G2.Width, rec3_G1.Y + rec3_G1.Height - 5 ) );
- #endregion
- #endregion
- #region 服务项
- string recValue3 = "";
- for ( int i = 0; i < tbl_Detail.Rows.Count; i++ )
- {
- recValue3 += LYFZ.BLL.OtherCommonModel.FontConversion( "编号:" ) + tbl_Detail.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 名称:" ) + tbl_Detail.Rows[i]["Dsrd_DressName"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 数量:" ) + tbl_Detail.Rows[i]["Dsrd_SaleRentalQuantity"].ToString().Trim() + "\r\n";
- }
- sizef = g.MeasureString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10 );
- int StrHeigth3 = 0;
- int rec4Height = 0;
- if ( tbl_Detail.Rows.Count > 13 )
- {
- StrHeigth3 = Convert.ToInt32( sizef.Height );
- rec4Height = StrHeigth3 + TopAdd;
- if ( rec4Height < 400 )
- {
- rec4Height = 400;
- }
- }
- else
- {
- StrHeigth3 = StrHeigth;
- rec4Height = 400;
- }
- int StrWidth3 = Convert.ToInt32( sizef.Width ) + 5;
- Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, rec4Height );
- g.DrawRectangle( p, rec4 );//画标题矩形
- #region 服务项目
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "服务项目:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec4_A1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec4_A1 );
- #endregion
- #region 项目内容
- Rectangle rec4_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec4.Y + TopAdd, TableWidth - rec4_A1.Width - LeftAdd, rec4Height );
- g.DrawString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10, b, rec4_A2 );
- #endregion
- #endregion
- #region 备注
- recValue = "测试:";
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, StrHeigth * 2 + TopAdd );
- g.DrawRectangle( p, rec5 );//画标题矩形
- #region 备注
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_A1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec5_A1 );
- #endregion
- #region 项目内容
- recValue = tbl_order.Rows[0]["Dsro_Remark"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec5.Y + TopAdd, rec4_A2.Width, StrHeigth * 2 );
- g.DrawString( recValue, ft10, b, rec5_A2 );
- #endregion
- #endregion
- #region 注意事项
- string recValue2 = "";
- if ( PrintOtherData.ContainsKey( "礼服单说明" ) && PrintOtherData["礼服单说明"].ToString().Trim().Length > 0 )
- {
- recValue2 = PrintOtherData["礼服单说明"].ToString().Trim();
- sizef = g.MeasureString( recValue2, ft10 );
- sizef.Height = 280;
- }
- else
- {
- sizef = g.MeasureString( "测试", ft10 );
- sizef.Height = 280;
- }
- int StrHeigth2 = Convert.ToInt32( sizef.Height );
- int StrWidth2 = Convert.ToInt32( sizef.Width ) + 5;
- Rectangle rec6 = new Rectangle( LeftWidth, rec5.Y + rec5.Height, TableWidth, StrHeigth2 + (TopAdd * 3) / 2 );
- g.DrawRectangle( p, rec6 );//画标题矩形
- #region 事项说明
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec6_A1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec6_A1 );
- Rectangle rec6_A2 = new Rectangle( rec6_A1.X + rec6_A1.Width, rec6.Y + TopAdd, rec4_A2.Width, StrHeigth2 );
- g.DrawString( recValue2, ft10, b, rec6_A2 );
- #endregion
- #endregion
- #region 尾
- Rectangle rec7 = new Rectangle( LeftWidth, rec6.Y + rec6.Height, TableWidth, 65 );
- g.DrawRectangle( p, rec7 );//画标题矩形
- #region 第一行
- #region 本店电话
- string StrPhone = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店电话:" ) + StrPhone;
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_B1 = new Rectangle( TableWidth + LeftWidth - 20 - StrWidth, rec7.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_B1 );
- g.DrawLine( p, new Point( TableWidth + LeftWidth - (Convert.ToInt32( g.MeasureString( StrPhone, ft10 ).Width ) + 1) - 20, rec7_B1.Y + rec7_B1.Height - 4 ), new Point( TableWidth + LeftWidth - 20, rec7_B1.Y + rec7_B1.Height - 4 ) );
- #endregion
- #region 本店地址
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_A1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, TableWidth - LeftWidth - rec7_B1.Width - 20, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_A1 );
- g.DrawLine( p, new Point( rec7_A1.X + LeftWidth + 50, rec7_A1.Y + rec7_A1.Height - 3 ), new Point( TableWidth - rec7_B1.Width - 20, rec7_A1.Y + rec7_A1.Height - 3 ) );
- #endregion
- #endregion
- #region 第二行
- #region 客户地址
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户地址:" ) + tbl_Cus.Rows[0]["Cus_Address"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_E1 = new Rectangle( rec7_A1.X, rec7_B1.Y + rec7_B1.Height + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_E1 );
- g.DrawLine( p, new Point( rec7_A1.X + LeftWidth + 50, rec7_E1.Y + rec7_E1.Height - 4 ), new Point( TableWidth - rec7_B1.Width - 20, rec7_E1.Y + rec7_E1.Height - 4 ) );
- #endregion
- #region 客户签名
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户签名:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_F1 = new Rectangle( rec7_B1.X, rec7_E1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_F1 );
- g.DrawLine( p, new Point( TableWidth + LeftWidth - (Convert.ToInt32( g.MeasureString( StrPhone, ft10 ).Width ) + 1) - 20, rec7_F1.Y + rec7_F1.Height - 4 ), new Point( TableWidth + LeftWidth - 20, rec7_F1.Y + rec7_F1.Height - 4 ) );
- #endregion
- #endregion
- #endregion
- }
- /// <summary>
- /// 礼服管理——出售清单打印
- /// </summary>
- /// <returns></returns>
- public static void Dresses_SoldGownsList_Print( object objValue, Graphics g, Size size )
- {
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Address,Company_Telephone" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpDressSaleRentalOrder", StrWhere: "Dsro_Number = '" + objValue.ToString().Trim() + "'" );
- ExecuteSql += ";select Dsrd_DressNumber,Dsfm_DressCustomNumber,Dsrd_DressName,Dsrd_SaleRentalQuantity from tb_ErpDressSaleRentalDetail Left Join tb_ErpDressFrom on Dsfm_DressNumber = Dsrd_DressNumber where Dsrd_Number = '" + objValue.ToString().Trim() + "'";
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl = dtSet.Tables["ds"];//获取影楼信息
- DataTable tbl_order = dtSet.Tables["ds1"];
- DataTable tbl_Detail = dtSet.Tables["ds2"];
- if ( tbl.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tbl_order.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "订单" + objValue.ToString().Trim() + "不存在" ); return;
- }
- DataTable tbl_Cus = orbll.GetView_Custom( "tb_ErpCustomer", StrWhere: "Cus_CustomerNumber in ('" + tbl_order.Rows[0]["Dsro_CustomerNumber"].ToString_s().Replace(",", "','") + "') ", ShowColumnName: "Cus_Name,Cus_Telephone,Cus_DayForMarriage,Cus_Address" ).Tables[0];
- Font ft18 = new Font( "宋体", 18 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 + 30;
- int LeftAdd = 3;
- int TopAdd = 6;
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( size.Width / 2 - StrWidth / 2, 50, StrWidth, StrHeigth );
- g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
- string SinglePerson = "接单人:" + LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName( tbl_order.Rows[0]["Dsro_CreateName"].ToString_s() ); //2017-03-30 刘工添加
- string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( SinglePerson + " " + "出售单号:" ) + objValue.ToString().Trim();
- // string recValue = LYFZ.BLL.OtherCommonModel.FontConversion("出售单号:") + objValue.ToString().Trim();
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 15 - StrHeigth, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2 );
- Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, 50 );
- g.DrawRectangle( p, rec3 );//画标题矩形
- #region 第一行
- #region 姓名
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A1 = new Rectangle( rec3.X + LeftAdd, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_A1 );
- recValue = tbl_Cus.Rows[0]["Cus_Name"].ToString().Trim();
- Rectangle rec3_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3.Y + TopAdd, rec3_A1.X + rec3_A1.Width + 100, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_A2 );
- g.DrawLine( p, new Point( rec3_A1.X + rec3_A1.Width, rec3_A1.Y + rec3_A1.Height - 4 ), new Point( rec3_A2.Width, rec3_A1.Y + rec3_A1.Height - 4 ) );
- #endregion
- #region 电话
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户电话:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_B1 = new Rectangle( rec3_A2.X + rec3_A2.Y + 80, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_B1 );
- recValue = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl_Cus.Rows[0]["Cus_Telephone"] );
- Rectangle rec3_B2 = new Rectangle( rec3_B1.X + rec3_B1.Width, rec3.Y + TopAdd, rec3_B1.X + rec3_B1.Width + 100, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_B2 );
- g.DrawLine( p, new Point( rec3_B1.X + rec3_B1.Width, rec3_B1.Y + rec3_B1.Height - 4 ), new Point( rec3_B2.Width, rec3_B1.Y + rec3_B1.Height - 4 ) );
- #endregion
- #region 租金
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "出售金额:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_C1 = new Rectangle( rec3_B2.X + rec3_B2.Y + 80, rec3.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_C1 );
- recValue = tbl_order.Rows[0]["Dsro_Amount"].ToString().Trim();
- Rectangle rec3_C2 = new Rectangle( rec3_C1.X + rec3_C1.Width, rec3.Y + TopAdd, rec3_C1.X + rec3_C1.Width + 100, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_C2 );
- g.DrawLine( p, new Point( rec3_C1.X + rec3_C1.Width, rec3_C1.Y + rec3_C1.Height - 5 ), new Point( rec3_C2.Width, rec3_C1.Y + rec3_C1.Height - 5 ) );
- #endregion
- #endregion
- #region 第二行
- #region 结婚日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "结婚日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_E1 = new Rectangle( rec3.X + LeftAdd, rec3_A2.Y + rec3_A2.Height + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_E1 );
- if ( tbl_Cus.Rows[0]["Cus_DayForMarriage"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_Cus.Rows[0]["Cus_DayForMarriage"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_E2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec3_E1.Y, rec3_A1.X + rec3_A1.Width + 250, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_E2 );
- g.DrawLine( p, new Point( rec3_A1.X + rec3_A1.Width, rec3_E1.Y + rec3_E1.Height - 5 ), new Point( rec3_A2.Width, rec3_E1.Y + rec3_E1.Height - 5 ) );
- #endregion
- #region 预定日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "预定日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_F1 = new Rectangle( rec3_B1.X, rec3_E1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_F1 );
- if ( tbl_order.Rows[0]["Dsro_CreateDateTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_CreateDateTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_F2 = new Rectangle( rec3_F1.X + rec3_F1.Width, rec3_E2.Y, rec3_B2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_F2 );
- g.DrawLine( p, new Point( rec3_F1.X + rec3_F1.Width, rec3_F1.Y + rec3_F1.Height - 5 ), new Point( rec3_F2.Width, rec3_F1.Y + rec3_F1.Height - 5 ) );
- #endregion
- #region 取衣日期
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "取衣日期:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_G1 = new Rectangle( rec3_C1.X, rec3_F1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_G1 );
- if ( tbl_order.Rows[0]["Dsro_TakeDressTime"].ToString().Trim() != "" )
- {
- recValue = Convert.ToDateTime( tbl_order.Rows[0]["Dsro_TakeDressTime"] ).ToString( "yyyy-MM-dd" );
- }
- else { recValue = ""; }
- Rectangle rec3_G2 = new Rectangle( rec3_G1.X + rec3_G1.Width, rec3_E2.Y, rec3_C2.Width, StrHeigth );
- g.DrawString( recValue, ft10, b, rec3_G2 );
- g.DrawLine( p, new Point( rec3_G1.X + rec3_G1.Width, rec3_G1.Y + rec3_G1.Height - 5 ), new Point( rec3_G2.Width, rec3_G1.Y + rec3_G1.Height - 5 ) );
- #endregion
- #endregion
- #region 服务项
- string recValue3 = "";
- for ( int i = 0; i < tbl_Detail.Rows.Count; i++ )
- {
- recValue3 += LYFZ.BLL.OtherCommonModel.FontConversion( "编号:" ) + tbl_Detail.Rows[i]["Dsfm_DressCustomNumber"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 名称:" ) + tbl_Detail.Rows[i]["Dsrd_DressName"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 数量:" ) + tbl_Detail.Rows[i]["Dsrd_SaleRentalQuantity"].ToString().Trim() + "\r\n";
- }
- sizef = g.MeasureString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10 );
- int StrHeigth3 = 0;
- int rec4Height = 0;
- if ( tbl_Detail.Rows.Count > 13 )
- {
- StrHeigth3 = Convert.ToInt32( sizef.Height );
- rec4Height = StrHeigth3 + TopAdd;
- }
- else
- {
- StrHeigth3 = StrHeigth;
- rec4Height = 236;
- }
- int StrWidth3 = Convert.ToInt32( sizef.Width ) + 5;
- Rectangle rec4 = new Rectangle( LeftWidth, rec3.Y + rec3.Height, TableWidth, rec4Height );
- g.DrawRectangle( p, rec4 );//画标题矩形
- #region 服务项目
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "服务项目:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec4_A1 = new Rectangle( rec4.X + LeftAdd, rec4.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec4_A1 );
- #endregion
- #region 项目内容
- Rectangle rec4_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec4.Y + TopAdd, TableWidth - rec4_A1.Width - LeftAdd, rec4Height );
- g.DrawString( recValue3.TrimEnd( 'n', '/', 'r', '/' ), ft10, b, rec4_A2 );
- #endregion
- #endregion
- #region 备注
- recValue = "测试:";
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5 = new Rectangle( LeftWidth, rec4.Y + rec4.Height, TableWidth, StrHeigth * 2 + TopAdd );
- g.DrawRectangle( p, rec5 );//画标题矩形
- #region 备注
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_A1 = new Rectangle( rec5.X + LeftAdd, rec5.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec5_A1 );
- #endregion
- #region 项目内容
- recValue = tbl_order.Rows[0]["Dsro_Remark"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5_A2 = new Rectangle( rec3_A1.X + rec3_A1.Width, rec5.Y + TopAdd, rec4_A2.Width, StrHeigth * 2 );
- g.DrawString( recValue, ft10, b, rec5_A2 );
- #endregion
- #endregion
- #region 注意事项
- string recValue2 = "";
- if ( PrintOtherData.ContainsKey( "礼服单说明" ) && PrintOtherData["礼服单说明"].ToString().Trim().Length > 0 )
- {
- recValue2 = PrintOtherData["礼服单说明"].ToString().Trim();
- sizef = g.MeasureString( recValue2, ft10 );
- }
- else
- {
- sizef = g.MeasureString( "测试", ft10 );
- }
- int StrHeigth2 = Convert.ToInt32( sizef.Height );
- int StrWidth2 = Convert.ToInt32( sizef.Width ) + 5;
- Rectangle rec6 = new Rectangle( LeftWidth, rec5.Y + rec5.Height, TableWidth, StrHeigth2 + (TopAdd * 3) / 2 );
- g.DrawRectangle( p, rec6 );//画标题矩形
- #region 事项说明
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "注意事项:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec6_A1 = new Rectangle( rec6.X + LeftAdd, rec6.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec6_A1 );
- Rectangle rec6_A2 = new Rectangle( rec6_A1.X + rec6_A1.Width, rec6.Y + TopAdd, rec4_A2.Width, StrHeigth2 );
- g.DrawString( recValue2, ft10, b, rec6_A2 );
- #endregion
- #endregion
- #region 尾
- Rectangle rec7 = new Rectangle( LeftWidth, rec6.Y + rec6.Height, TableWidth, 55 );
- g.DrawRectangle( p, rec7 );//画标题矩形
- #region 第一行
- #region 本店电话
- string StrPhone = tbl.Rows[0]["Company_Telephone"].ToString().Trim();
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店电话:" ) + StrPhone;
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_B1 = new Rectangle( TableWidth + LeftWidth - 20 - StrWidth, rec7.Y + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_B1 );
- g.DrawLine( p, new Point( TableWidth + LeftWidth - (Convert.ToInt32( g.MeasureString( StrPhone, ft10 ).Width ) + 1) - 20, rec7_B1.Y + rec7_B1.Height - 4 ), new Point( TableWidth + LeftWidth - 20, rec7_B1.Y + rec7_B1.Height - 4 ) );
- #endregion
- #region 本店地址
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "本店地址:" ) + tbl.Rows[0]["Company_Address"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_A1 = new Rectangle( rec7.X + LeftAdd, rec7.Y + TopAdd, TableWidth - LeftWidth - rec7_B1.Width - 20, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_A1 );
- g.DrawLine( p, new Point( rec7_A1.X + LeftWidth + 50, rec7_A1.Y + rec7_A1.Height - 3 ), new Point( TableWidth - rec7_B1.Width - 20, rec7_A1.Y + rec7_A1.Height - 3 ) );
- #endregion
- #endregion
- #region 第二行
- #region 客户地址
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户地址:" ) + tbl_Cus.Rows[0]["Cus_Address"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_E1 = new Rectangle( rec7_A1.X, rec7_B1.Y + rec7_B1.Height + TopAdd, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_E1 );
- g.DrawLine( p, new Point( rec7_A1.X + LeftWidth + 50, rec7_E1.Y + rec7_E1.Height - 4 ), new Point( TableWidth - rec7_B1.Width - 20, rec7_E1.Y + rec7_E1.Height - 4 ) );
- #endregion
- #region 客户签名
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "客户签名:" );
- sizef = g.MeasureString( recValue, ft10 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec7_F1 = new Rectangle( rec7_B1.X, rec7_E1.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft10, b, rec7_F1 );
- g.DrawLine( p, new Point( TableWidth + LeftWidth - (Convert.ToInt32( g.MeasureString( StrPhone, ft10 ).Width ) + 1) - 20, rec7_F1.Y + rec7_F1.Height - 4 ), new Point( TableWidth + LeftWidth - 20, rec7_F1.Y + rec7_F1.Height - 4 ) );
- #endregion
- #endregion
- #endregion
- }
- #endregion
- #region 库存管理
- /// <summary>
- /// 库存管理——采购申请单
- /// </summary>
- /// <returns></returns>
- public static void InventoryManagement_PurchaseRequisition_Print( object OrdNumber, Graphics g, Size size )
- {
- DataTable dtorder = orbll.GetView_Custom( "tb_ErpPurchaseOrder Left Join tb_ErpUser on User_EmployeeID = Pord_RequisitionName", StrWhere: "Pord_PurchaseNumber = '" + OrdNumber.ToString().Trim() + "'", ShowColumnName: "Pord_PurchaseNumber,User_Name,dbo.fn_CheckDateTime(Pord_RequisitionTime) AS Pord_RequisitionTime" ).Tables[0];
- string StrTableName = "tb_ErpPurchaseProduct Left Join tb_ErpProduct on Prod_Number = Ppt_ProductNumber Left Join tb_ErpSystemCategory on Sc_ClassCode = Ppt_ProductCategory";
- string StrColumnName = "Prod_Name,Sc_ClassName,Ppt_PurchaseQuantity,Ppt_PurchaseStatus,dbo.fn_CheckDateTime(Ppt_PurchaseTime) AS Ppt_PurchaseTime";
- DataTable dtoroduct = orbll.GetView_Custom( StrTableName, StrWhere: "Ppt_PurchaseNumber = '" + OrdNumber.ToString().Trim() + "'", ShowColumnName: StrColumnName ).Tables[0];
- Font ft18 = new Font( "宋体", 18 );
- Font ft11 = new Font( "宋体", 11 );
- Font ft9 = new Font( "宋体", 9 );
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 3;
- int TopAdd = 5;
- int RowHeight = 25;
- int RowContentHeight = 18;
- #region 头
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
- g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
- string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购单号:" ) + dtorder.Rows[0]["Pord_PurchaseNumber"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 10, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2 );
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "申请人:" ) + dtorder.Rows[0]["User_Name"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_A1 = new Rectangle( TableWidth / 2 - StrWidth / 2, rec2.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2_A1 );
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "申请时间:" ) + dtorder.Rows[0]["Pord_RequisitionTime"].ToString().Trim() + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_A2 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec2.Y, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2_A2 );
- #endregion
- #region 列标题
- Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec3 );//画标题矩形
- int ColumnWidth2 = TableWidth / 11;
- int ColumnWidth3 = TableWidth / 5;
- int ColumnWidth4 = TableWidth / 8;
- int ColumnWidth5 = TableWidth / 5 - 20;
- int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5;
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品名称" );
- sizef = g.MeasureString( recValue, ft11 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A1 = new Rectangle( ColumnWidth1 / 2 - StrWidth / 2 + rec2.X, rec3.Y + TopAdd, ColumnWidth1, RowContentHeight );
- g.DrawString( recValue, ft11, b, rec3_A1 );//画第一列的列标题
- Point pA1_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
- Point pA1_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
- g.DrawLine( p, pA1_1, pA1_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "数量" );
- sizef = g.MeasureString( recValue, ft11 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A2 = new Rectangle( ColumnWidth2 / 2 - StrWidth / 2 + pA1_1.X, rec3_A1.Y, ColumnWidth2, rec3_A1.Height );
- g.DrawString( recValue, ft11, b, rec3_A2 );//画第一列的列标题
- Point pA2_1 = new Point( pA1_1.X + ColumnWidth2, rec3.Y );
- Point pA2_2 = new Point( pA1_1.X + ColumnWidth2, rec3.Y + rec3.Height );
- g.DrawLine( p, pA2_1, pA2_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品类别" );
- sizef = g.MeasureString( recValue, ft11 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A3 = new Rectangle( ColumnWidth3 / 2 - StrWidth / 2 + pA2_1.X, rec3_A1.Y, ColumnWidth3, rec3_A1.Height );
- g.DrawString( recValue, ft11, b, rec3_A3 );//画第一列的列标题
- Point pA3_1 = new Point( pA2_1.X + ColumnWidth3, rec3.Y );
- Point pA3_2 = new Point( pA2_1.X + ColumnWidth3, rec3.Y + rec3.Height );
- g.DrawLine( p, pA3_1, pA3_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购状态" );
- sizef = g.MeasureString( recValue, ft11 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A4 = new Rectangle( ColumnWidth4 / 2 - StrWidth / 2 + pA3_1.X, rec3_A1.Y, ColumnWidth4, rec3_A1.Height );
- g.DrawString( recValue, ft11, b, rec3_A4 );//画第一列的列标题
- Point pA4_1 = new Point( pA3_1.X + ColumnWidth4, rec3.Y );
- Point pA4_2 = new Point( pA3_1.X + ColumnWidth4, rec3.Y + rec3.Height );
- g.DrawLine( p, pA4_1, pA4_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购时间" );
- sizef = g.MeasureString( recValue, ft11 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A5 = new Rectangle( ColumnWidth5 / 2 - StrWidth / 2 + pA4_1.X, rec3_A1.Y, ColumnWidth5, rec3_A1.Height );
- g.DrawString( recValue, ft11, b, rec3_A5 );//画第一列的列标题
- #endregion
- #region 画内容
- int ForRowHeight = 22;
- int ForRowContentHeight = RowHeight - (TopAdd * 2);
- int IntPoint_X = rec3.X;
- int IntPoint_Y = rec3.Y + rec3.Height;
- for ( int i = 0; i < dtoroduct.Rows.Count; i++ )
- {
- if ( i >= 44 )
- {
- break;
- }
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, ForRowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- Rectangle recforA = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dtoroduct.Rows[i]["Prod_Name"].ToString().Trim(), ft9, b, recforA );//画第一列的列标题
- Point pforA_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pforA_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pforA_1, pforA_2 );//画第一表与第二列的界线
- Rectangle recforB = new Rectangle( pforA_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dtoroduct.Rows[i]["Ppt_PurchaseQuantity"].ToString().Trim(), ft9, b, recforB );//画第一列的列标题
- Point pforB_1 = new Point( pA2_2.X, recfor.Y );
- Point pforB_2 = new Point( pA2_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforB_1, pforB_2 );//画第一表与第二列的界线
- Rectangle recforC = new Rectangle( pforB_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dtoroduct.Rows[i]["Sc_ClassName"].ToString().Trim(), ft9, b, recforC );//画第一列的列标题
- Point pforC_1 = new Point( pA3_2.X, recfor.Y );
- Point pforC_2 = new Point( pA3_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforC_1, pforC_2 );//画第一表与第二列的界线
- Rectangle recforD = new Rectangle( pforC_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( Enum.GetName( typeof( LYFZ.EnumPublic.Ppt_PurchaseStatus ), Convert.ToInt32( dtoroduct.Rows[i]["Ppt_PurchaseStatus"] ) ), ft9, b, recforD );//画第一列的列标题
- Point pforD_1 = new Point( pA4_2.X, recfor.Y );
- Point pforD_2 = new Point( pA4_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforD_1, pforD_2 );//画第一表与第二列的界线
- Rectangle recforE = new Rectangle( pforD_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( LYFZ.Command.Command_Validate.DateTimeToString2( dtoroduct.Rows[i]["Ppt_PurchaseTime"] ), ft9, b, recforE );//画第一列的列标题
- IntPoint_Y += recfor.Height;
- }
- #endregion
- }
- /// <summary>
- /// 库存管理——库存采购单
- /// </summary>
- /// <returns></returns>
- public static void InventoryManagement_PurchaseOrder_Print( object OrdNumber, Graphics g, Size size )
- {
- Font ft18 = new Font( "宋体", 18 );
- Font ft9 = new Font( "宋体", 9 );
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 3;
- int TopAdd = 5;
- int RowHeight = 25;
- int RowContentHeight = 18;
- string StrTableName = "tb_ErpPurchaseProduct Left Join tb_ErpProduct on Prod_Number = Ppt_ProductNumber Left Join tb_ErpSystemCategory on Sc_ClassCode = Ppt_ProductCategory";
- string StrColumnName = "Prod_Number,Prod_Name,Prod_Class,Sc_ClassName,Ppt_PurchaseQuantity,Ppt_PurchaseStatus,Ppt_PurchasePerson,Ppt_Remark,Prod_Thumbnail," +
- "case when Ppt_PurchaseStatus = '3' then case when Prod_CostPrice > 0 then Prod_CostPrice else Ppt_PurchasePrice end else Ppt_PurchasePrice end Ppt_PurchasePrice," +
- "case when Ppt_PurchaseStatus = '3' then Prod_Vendor else Ppt_PurchaseVendor end AS Ppt_PurchaseVendor,dbo.fn_CheckDateTime(Ppt_PurchaseTime) AS Ppt_PurchaseTime";
- DataTable dt = orbll.GetView_Custom( StrTableName, StrWhere: "Ppt_PurchaseNumber = '" + OrdNumber + "'", ShowColumnName: StrColumnName ).Tables[0];
- #region 头
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft18 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
- g.DrawString( DefaultPrintTitle, ft18, b, rec1 );
- string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购单号:" ) + OrdNumber;
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2 );
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_A1 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2_A1 );
- #endregion
- #region 列标题
- Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight );
- g.DrawRectangle( p, rec3 );//画标题矩形
- int ColumnWidth2 = TableWidth / 16;
- int ColumnWidth3 = TableWidth / 8;
- int ColumnWidth4 = TableWidth / 10;
- int ColumnWidth5 = TableWidth / 6;
- int ColumnWidth6 = TableWidth / 12;
- int ColumnWidth7 = TableWidth / 14 + 10;
- int ColumnWidth8 = TableWidth / 7 + 15;
- int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7 - ColumnWidth8;
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品名称" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A1 = new Rectangle( ColumnWidth1 / 2 - StrWidth / 2 + rec2.X, rec3.Y + TopAdd + 2, ColumnWidth1, RowContentHeight );
- g.DrawString( recValue, ft9, b, rec3_A1 );//画第一列的列标题
- Point pA1_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
- Point pA1_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
- g.DrawLine( p, pA1_1, pA1_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "数量" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A2 = new Rectangle( ColumnWidth2 / 2 - StrWidth / 2 + pA1_1.X, rec3_A1.Y, ColumnWidth2, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A2 );//画第一列的列标题
- Point pA2_1 = new Point( pA1_1.X + ColumnWidth2, rec3.Y );
- Point pA2_2 = new Point( pA1_1.X + ColumnWidth2, rec3.Y + rec3.Height );
- g.DrawLine( p, pA2_1, pA2_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品类别" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A3 = new Rectangle( ColumnWidth3 / 2 - StrWidth / 2 + pA2_1.X, rec3_A1.Y, ColumnWidth3, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A3 );//画第一列的列标题
- Point pA3_1 = new Point( pA2_1.X + ColumnWidth3, rec3.Y );
- Point pA3_2 = new Point( pA2_1.X + ColumnWidth3, rec3.Y + rec3.Height );
- g.DrawLine( p, pA3_1, pA3_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品单价" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A4 = new Rectangle( ColumnWidth4 / 2 - StrWidth / 2 + pA3_1.X, rec3_A1.Y, ColumnWidth4, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A4 );//画第一列的列标题
- Point pA4_1 = new Point( pA3_1.X + ColumnWidth4, rec3.Y );
- Point pA4_2 = new Point( pA3_1.X + ColumnWidth4, rec3.Y + rec3.Height );
- g.DrawLine( p, pA4_1, pA4_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品厂商" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A5 = new Rectangle( ColumnWidth5 / 2 - StrWidth / 2 + pA4_1.X, rec3_A1.Y, ColumnWidth5, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A5 );//画第一列的列标题
- Point pA5_1 = new Point( pA4_1.X + ColumnWidth5, rec3.Y );
- Point pA5_2 = new Point( pA4_1.X + ColumnWidth5, rec3.Y + rec3.Height );
- g.DrawLine( p, pA5_1, pA5_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购状态" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A6 = new Rectangle( ColumnWidth6 / 2 - StrWidth / 2 + pA5_1.X, rec3_A1.Y, ColumnWidth6, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A6 );//画第一列的列标题
- Point pA6_1 = new Point( pA5_1.X + ColumnWidth6, rec3.Y );
- Point pA6_2 = new Point( pA5_1.X + ColumnWidth6, rec3.Y + rec3.Height );
- g.DrawLine( p, pA6_1, pA6_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购人" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A7 = new Rectangle( ColumnWidth7 / 2 - StrWidth / 2 + pA6_1.X, rec3_A1.Y, ColumnWidth7, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A7 );//画第一列的列标题
- Point pA7_1 = new Point( pA6_1.X + ColumnWidth7, rec3.Y );
- Point pA7_2 = new Point( pA6_1.X + ColumnWidth7, rec3.Y + rec3.Height );
- g.DrawLine( p, pA7_1, pA7_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购时间" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A8 = new Rectangle( ColumnWidth8 / 2 - StrWidth / 2 + pA7_1.X, rec3_A1.Y, ColumnWidth8, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A8 );//画第一列的列标题
- #endregion
- #region 画内容
- int ForRowHeight = 22;
- int ForRowContentHeight = RowHeight - (TopAdd * 2);
- int IntPoint_X = rec3.X;
- int IntPoint_Y = rec3.Y + rec3.Height;
- for ( int i = 0; i < dt.Rows.Count; i++ )
- {
- if ( i >= 44 )
- {
- break;
- }
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, ForRowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- Rectangle recforA = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["Prod_Name"].ToString().Trim(), ft9, b, recforA );//画第一列的列标题
- Point pforA_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pforA_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pforA_1, pforA_2 );//画第一表与第二列的界线
- recValue = dt.Rows[i]["Ppt_PurchaseQuantity"].ToString().Trim();
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recforB = new Rectangle( pforA_1.X + ColumnWidth2 - StrWidth - LeftAdd * 3, recfor.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( recValue, ft9, b, recforB );//画第一列的列标题
- Point pforB_1 = new Point( pA2_2.X, recfor.Y );
- Point pforB_2 = new Point( pA2_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforB_1, pforB_2 );//画第一表与第二列的界线
- Rectangle recforC = new Rectangle( pforB_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["Sc_ClassName"].ToString().Trim(), ft9, b, recforC );//画第一列的列标题
- Point pforC_1 = new Point( pA3_2.X, recfor.Y );
- Point pforC_2 = new Point( pA3_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforC_1, pforC_2 );//画第一表与第二列的界线
- recValue = Convert.ToDecimal( dt.Rows[i]["Ppt_PurchasePrice"] ).ToString( "0.00" ).Trim();
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recforD = new Rectangle( pforC_1.X + ColumnWidth4 - StrWidth - LeftAdd, recfor.Y + TopAdd, ColumnWidth4 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( recValue, ft9, b, recforD );//画第一列的列标题
- Point pforD_1 = new Point( pA4_2.X, recfor.Y );
- Point pforD_2 = new Point( pA4_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforD_1, pforD_2 );//画第一表与第二列的界线
- Rectangle recforE = new Rectangle( pforD_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth5 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["Ppt_PurchaseVendor"].ToString().Trim(), ft9, b, recforE );//画第一列的列标题
- Point pforE_1 = new Point( pA5_2.X, recfor.Y );
- Point pforE_2 = new Point( pA5_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforE_1, pforE_2 );//画第一表与第二列的界线
- Rectangle recforF = new Rectangle( pforE_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth6 - LeftAdd, ForRowContentHeight );
- g.DrawString( Enum.GetName( typeof( LYFZ.EnumPublic.Ppt_PurchaseStatus ), Convert.ToInt32( dt.Rows[i]["Ppt_PurchaseStatus"] ) ), ft9, b, recforF );//画第一列的列标题
- Point pforF_1 = new Point( pA6_2.X, recfor.Y );
- Point pforF_2 = new Point( pA6_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforF_1, pforF_2 );//画第一表与第二列的界线
- Rectangle recforG = new Rectangle( pforF_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth7 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["Ppt_PurchasePerson"].ToString().Trim(), ft9, b, recforG );//画第一列的列标题
- Point pforG_1 = new Point( pA7_2.X, recfor.Y );
- Point pforG_2 = new Point( pA7_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforG_1, pforG_2 );//画第一表与第二列的界线
- Rectangle recforH = new Rectangle( pforG_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth8 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["Ppt_PurchaseTime"].ToString().Trim(), ft9, b, recforH );//画第一列的列标题
- IntPoint_Y += recfor.Height;
- }
- #endregion
- }
- /// <summary>
- /// 库存管理——库存验收单
- /// </summary>
- /// <returns></returns>
- public static void InventoryManagement_PurchasingAcceptance_Print( object OrdNumber, Graphics g, Size size )
- {
- Font ft16 = new Font( "宋体", 14 );
- Font ft9 = new Font( "宋体", 9 );
- Brush b = Brushes.Black;
- Pen p = GetPen;
- int LeftWidth = 30;
- int TableWidth = size.Width - LeftWidth * 2;
- int LeftAdd = 3;
- int TopAdd = 4;
- int RowHeight = 26;
- int RowContentHeight = 26;
- string StrTableName = "tb_ErpPurchaseProduct Left Join tb_ErpProduct on Prod_Number = Ppt_ProductNumber Left Join tb_ErpSystemCategory on Sc_ClassCode = Ppt_ProductCategory ";
- string StrColumnName = "Prod_Name AS 商品名称,Sc_ClassName AS 商品类别,Ppt_PurchaseQuantity AS 采购数量,Ppt_PurchasePrice AS 采购单价,Ppt_PurchaseVendor AS 商品厂商,Ppt_PurchaseStatus AS 采购状态," +
- "dbo.fn_CheckUserIDGetUserName(Ppt_PurchasePerson) AS 采购人,Ppt_AcceptanceQuantity AS 验收数量,dbo.fn_CheckDateTime(Ppt_PurchaseTime) AS 采购时间";
- DataTable dt = orbll.GetView_Custom( StrTableName, StrWhere: "Ppt_PurchaseNumber = '" + OrdNumber + "'", ShowColumnName: StrColumnName ).Tables[0];
- #region 头
- //金色童年收据凭据
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft16 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
- g.DrawString( DefaultPrintTitle, ft16, b, rec1 );
- string recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购单号:" ) + OrdNumber;
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2 = new Rectangle( LeftWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2 );
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + "1/1";
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec2_A1 = new Rectangle( TableWidth + LeftWidth - StrWidth, rec1.Y + rec1.Height + 3, StrWidth, StrHeigth );
- g.DrawString( recValue, ft9, b, rec2_A1 );
- #endregion
- #region 列标题
- Rectangle rec3 = new Rectangle( LeftWidth, rec2.Y + rec2.Height, TableWidth, RowHeight + 10 );
- g.DrawRectangle( p, rec3 );//画标题矩形
- int ColumnWidth2 = 30;
- int ColumnWidth3 = TableWidth / 10;
- int ColumnWidth4 = 65;
- int ColumnWidth5 = TableWidth / 8;
- int ColumnWidth6 = 50;
- int ColumnWidth7 = TableWidth / 12;
- int ColumnWidth8 = 50;
- int ColumnWidth9 = 115;
- int ColumnWidth1 = TableWidth - ColumnWidth2 - ColumnWidth3 - ColumnWidth4 - ColumnWidth5 - ColumnWidth6 - ColumnWidth7 - ColumnWidth8 - ColumnWidth9;
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品名称" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A1 = new Rectangle( ColumnWidth1 / 2 - StrWidth / 2 + rec2.X, rec3.Y + ((rec3.Height / 2) - (StrHeigth / 2)), ColumnWidth1, RowContentHeight );
- g.DrawString( recValue, ft9, b, rec3_A1 );//画第一列的列标题
- Point pA1_1 = new Point( rec3.X + ColumnWidth1, rec3.Y );
- Point pA1_2 = new Point( rec3.X + ColumnWidth1, rec3.Y + rec3.Height );
- g.DrawLine( p, pA1_1, pA1_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "数\r\n量" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A2 = new Rectangle( ColumnWidth2 / 2 - StrWidth / 2 + pA1_1.X, rec3_A1.Y - TopAdd, ColumnWidth2, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A2 );//画第一列的列标题
- Point pA2_1 = new Point( pA1_1.X + ColumnWidth2, rec3.Y );
- Point pA2_2 = new Point( pA1_1.X + ColumnWidth2, rec3.Y + rec3.Height );
- g.DrawLine( p, pA2_1, pA2_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品类别" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A3 = new Rectangle( ColumnWidth3 / 2 - StrWidth / 2 + pA2_1.X, rec3_A1.Y, ColumnWidth3, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A3 );//画第一列的列标题
- Point pA3_1 = new Point( pA2_1.X + ColumnWidth3, rec3.Y );
- Point pA3_2 = new Point( pA2_1.X + ColumnWidth3, rec3.Y + rec3.Height );
- g.DrawLine( p, pA3_1, pA3_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购\r\n单价" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A4 = new Rectangle( ColumnWidth4 / 2 - StrWidth / 2 + pA3_1.X, rec3.Y + TopAdd, ColumnWidth4, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A4 );//画第一列的列标题
- Point pA4_1 = new Point( pA3_1.X + ColumnWidth4, rec3.Y );
- Point pA4_2 = new Point( pA3_1.X + ColumnWidth4, rec3.Y + rec3.Height );
- g.DrawLine( p, pA4_1, pA4_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "商品厂商" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A5 = new Rectangle( ColumnWidth5 / 2 - StrWidth / 2 + pA4_1.X, rec3_A1.Y, ColumnWidth5, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A5 );//画第一列的列标题
- Point pA5_1 = new Point( pA4_1.X + ColumnWidth5, rec3.Y );
- Point pA5_2 = new Point( pA4_1.X + ColumnWidth5, rec3.Y + rec3.Height );
- g.DrawLine( p, pA5_1, pA5_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购\r\n状态" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A6 = new Rectangle( ColumnWidth6 / 2 - StrWidth / 2 + pA5_1.X, rec3.Y + TopAdd, ColumnWidth6, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A6 );//画第一列的列标题
- Point pA6_1 = new Point( pA5_1.X + ColumnWidth6, rec3.Y );
- Point pA6_2 = new Point( pA5_1.X + ColumnWidth6, rec3.Y + rec3.Height );
- g.DrawLine( p, pA6_1, pA6_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购人" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A7 = new Rectangle( ColumnWidth7 / 2 - StrWidth / 2 + pA6_1.X, rec3_A1.Y, ColumnWidth7, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A7 );//画第一列的列标题
- Point pA7_1 = new Point( pA6_1.X + ColumnWidth7, rec3.Y );
- Point pA7_2 = new Point( pA6_1.X + ColumnWidth7, rec3.Y + rec3.Height );
- g.DrawLine( p, pA7_1, pA7_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "验收\r\n数量" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A8 = new Rectangle( ColumnWidth8 / 2 - StrWidth / 2 + pA7_1.X, rec3.Y + TopAdd, ColumnWidth8, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A8 );//画第一列的列标题
- Point pA8_1 = new Point( pA7_1.X + ColumnWidth8, rec3.Y );
- Point pA8_2 = new Point( pA7_1.X + ColumnWidth8, rec3.Y + rec3.Height );
- g.DrawLine( p, pA8_1, pA8_2 );//画第一表与第二列的界线
- recValue = LYFZ.BLL.OtherCommonModel.FontConversion( "采购时间" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec3_A9 = new Rectangle( ColumnWidth9 / 2 - StrWidth / 2 + pA8_1.X, rec3_A1.Y, ColumnWidth9, rec3_A1.Height );
- g.DrawString( recValue, ft9, b, rec3_A9 );//画第一列的列标题
- #endregion
- #region 画内容
- int ForRowHeight = 20;
- int ForRowContentHeight = ForRowHeight - (TopAdd * 2);
- int IntPoint_X = rec3.X;
- int IntPoint_Y = rec3.Y + rec3.Height;
- for ( int i = 0; i < dt.Rows.Count; i++ )
- {
- if ( i >= 48 )
- {
- break;
- }
- Rectangle recfor = new Rectangle( IntPoint_X, IntPoint_Y, TableWidth, ForRowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- Rectangle recforA = new Rectangle( recfor.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth1 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["商品名称"].ToString().Trim(), ft9, b, recforA );//画第一列的列标题
- Point pforA_1 = new Point( recfor.X + ColumnWidth1, recfor.Y );
- Point pforA_2 = new Point( recfor.X + ColumnWidth1, recfor.Y + recfor.Height );
- g.DrawLine( p, pforA_1, pforA_2 );//画第一表与第二列的界线
- Rectangle recforB = new Rectangle( pforA_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth2 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["采购数量"].ToString().Trim(), ft9, b, recforB );//画第一列的列标题
- Point pforB_1 = new Point( pA2_2.X, recfor.Y );
- Point pforB_2 = new Point( pA2_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforB_1, pforB_2 );//画第一表与第二列的界线
- Rectangle recforC = new Rectangle( pforB_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth3 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["商品类别"].ToString().Trim(), ft9, b, recforC );//画第一列的列标题
- Point pforC_1 = new Point( pA3_2.X, recfor.Y );
- Point pforC_2 = new Point( pA3_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforC_1, pforC_2 );//画第一表与第二列的界线
- recValue = Convert.ToDecimal( dt.Rows[i]["采购单价"] ).ToString( "0.00" );
- sizef = g.MeasureString( recValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recforD = new Rectangle( pforC_1.X + ColumnWidth4 - StrWidth - LeftAdd, recfor.Y + TopAdd, ColumnWidth4 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( recValue, ft9, b, recforD );//画第一列的列标题
- Point pforD_1 = new Point( pA4_2.X, recfor.Y );
- Point pforD_2 = new Point( pA4_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforD_1, pforD_2 );//画第一表与第二列的界线
- Rectangle recforE = new Rectangle( pforD_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth5 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["商品厂商"].ToString().Trim(), ft9, b, recforE );//画第一列的列标题
- Point pforE_1 = new Point( pA5_2.X, recfor.Y );
- Point pforE_2 = new Point( pA5_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforE_1, pforE_2 );//画第一表与第二列的界线
- Rectangle recforF = new Rectangle( pforE_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth6 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( Enum.GetName( typeof( LYFZ.EnumPublic.Ppt_PurchaseStatus ), Convert.ToInt32( dt.Rows[i]["采购状态"] ) ), ft9, b, recforF );//画第一列的列标题
- Point pforF_1 = new Point( pA6_2.X, recfor.Y );
- Point pforF_2 = new Point( pA6_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforF_1, pforF_2 );//画第一表与第二列的界线
- Rectangle recforG = new Rectangle( pforF_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth7 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["采购人"].ToString().Trim(), ft9, b, recforG );//画第一列的列标题
- Point pforG_1 = new Point( pA7_2.X, recfor.Y );
- Point pforG_2 = new Point( pA7_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforG_1, pforG_2 );//画第一表与第二列的界线
- Rectangle recforH = new Rectangle( pforG_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth8 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["验收数量"].ToString().Trim(), ft9, b, recforH );//画第一列的列标题
- Point pforH_1 = new Point( pA8_2.X, recfor.Y );
- Point pforH_2 = new Point( pA8_2.X, recfor.Y + recfor.Height );
- g.DrawLine( p, pforH_1, pforH_2 );//画第一表与第二列的界线
- Rectangle recforI = new Rectangle( pforH_1.X + LeftAdd, recfor.Y + TopAdd, ColumnWidth9 - (LeftAdd * 2), ForRowContentHeight );
- g.DrawString( dt.Rows[i]["采购时间"].ToString().Trim(), ft9, b, recforI );//画第一列的列标题
- IntPoint_Y += recfor.Height;
- }
- #endregion
- }
- #endregion
- #region 考勤统计
- /// <summary>
- /// 月统计
- /// </summary>
- /// <param name="dgvData">数据列表</param>
- /// <param name="StrOrd_Number">数据总汇:</param>
- public static void SchedulingMonthlyStatistics( object objValue, Graphics g, Size size )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- int time1 = Convert.ToInt32( htData["time1"] );
- int time2 = Convert.ToInt32( htData["time2"] );
- int chk = Convert.ToInt32( htData["chk"] );
- Brush b = Brushes.Black;
- Pen p = GetPen;
- Font ft18 = new Font( "宋体", 18 );
- Font ft10 = new Font( "宋体", 10 );
- Font ft9 = new Font( "宋体", 9 );
- int LeftWidth = 50;
- int TableWidth = size.Width - LeftWidth * 2 - 20;
- int LeftAdd = 2;
- int TopAdd = 7;
- int RowHeight = 27;
- int RowContentHeight = RowHeight - (TopAdd * 2);
- int ColumnWidth1 = (TableWidth - 30) / 4 + 10;
- #region 打印多少页
- int PageRows = 2;//每页多少人
- int PageCount = dgvData.SelectedRows.Count / PageRows;
- if ( dgvData.SelectedRows.Count % PageRows > 0 )
- {
- PageCount++;
- }
- #endregion
- string StrName = time1 + "-" + time2 + "月";
- if ( htData["chk"].ToString().Trim() == "1" )
- {
- string[] StrArray = dgvData.Columns[6].HeaderText.Trim().Replace( "\r\n", "_" ).Split( '_' );
- string[] StrArray2 = dgvData.Columns[dgvData.Columns.Count - 1].HeaderText.Trim().Replace( "\r\n", "_" ).Split( '_' );
- StrName = time1 + "-" + StrArray[1].Replace( "月", "-" ).Replace( "日", "" ).Trim() + "至" + time1 + "-" + StrArray2[1].Replace( "月", "-" ).Replace( "日", "" ).Trim();
- }
- StrName += LYFZ.BLL.OtherCommonModel.FontConversion( "考勤报表" );
- SizeF sizef = g.MeasureString( StrName, ft18 );
- int StrHeigth = Convert.ToInt32( sizef.Height );
- int StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1_2 = new Rectangle( (size.Width - StrWidth) / 2, 50, StrWidth, StrHeigth );
- g.DrawString( StrName, ft18, b, rec1_2 );
- string StrValue = LYFZ.BLL.OtherCommonModel.FontConversion( "制表:" ) + LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name + LYFZ.BLL.OtherCommonModel.FontConversion( " 日期:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd" ) + LYFZ.BLL.OtherCommonModel.FontConversion( " 页:" ) + PrintCurrentIndexPage + "/" + PageCount;
- sizef = g.MeasureString( StrValue, ft9 );
- StrHeigth = Convert.ToInt32( sizef.Height );
- StrWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec1_1 = new Rectangle( TableWidth + LeftWidth - StrWidth + 30, rec1_2.Y + rec1_2.Height + 5, StrWidth, StrHeigth );
- g.DrawString( StrValue, ft9, b, rec1_1 );//画消费法规
- bool IsNextPage = false;
- int forintCount = 0;
- int forLeftWidth = 0;
- for ( int j = 0; j < dgvData.SelectedRows.Count; j++ )
- {
- if ( PrintForCount >= dgvData.SelectedRows.Count || forintCount == 2 )
- {
- break;
- }
- if ( forintCount == 0 )
- {
- forLeftWidth = LeftWidth;
- forintCount++;
- }
- else if ( forintCount == 1 )
- {
- forLeftWidth += ColumnWidth1 * 2 + 20;
- forintCount++;
- }
- else if ( forintCount == 2 )
- {
- forLeftWidth += ColumnWidth1 * 2 + 20;
- forintCount++;
- }
- #region 画列标题
- Rectangle rec2 = new Rectangle( forLeftWidth, rec1_1.Y + rec1_1.Height + 5, ColumnWidth1 * 2, 60 );
- g.DrawRectangle( p, rec2 );//画标题矩形
- Rectangle rec2_2 = new Rectangle( rec2.X + LeftAdd * 2, rec2.Y + TopAdd, ColumnWidth1 * 2 - LeftAdd, 55 );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "姓名:" + dgvData.SelectedRows[PrintForCount].Cells[1].Value.ToString().Trim() + "\r\n迟到:" + dgvData.SelectedRows[PrintForCount].Cells[2].Value.ToString().Trim() + "\r\n早退:" + dgvData.SelectedRows[PrintForCount].Cells[3].Value.ToString().Trim() + " 旷工:" + dgvData.SelectedRows[PrintForCount].Cells[4].Value.ToString().Trim() ), ft10, b, rec2_2 );//画第一列的列标题
- #endregion
- #region 画行
- int IntPoint_Y = rec2.Y + rec2.Height;
- int intDay = 1;
- for ( int i = 0; i < dgvData.Columns.Count; i++ )
- {
- if ( i == 0 )
- {
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, ColumnWidth1 * 2, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd + 10, recfor.Y + TopAdd, ColumnWidth1 - 120 - (LeftAdd * 2), RowContentHeight );
- g.DrawString( "日期", ft9, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1 - 120, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1 - 120, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth1 + 120 - (LeftAdd * 2), RowContentHeight );
- g.DrawString( " 考勤记录", ft9, b, recfor2_2 );//画第一列的列标题
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- if ( i > 5 && dgvData.Columns[i].Visible )
- {
- string[] StrArray = dgvData.Columns[i].HeaderText.Trim().Replace( "\r\n", "_" ).Split( '_' );
- string StrTitle = StrArray[0].Trim();
- if ( htData["chk"].ToString().Trim() == "1" )
- {
- StrTitle = StrArray[1].Trim().Replace( "月", "-" ).Replace( "日", "" );
- }
- Rectangle recfor = new Rectangle( rec2.X, IntPoint_Y, ColumnWidth1 * 2, RowHeight );
- g.DrawRectangle( p, recfor );//画标题矩形
- Rectangle recfor2_1 = new Rectangle( recfor.X + LeftAdd + 3, recfor.Y + TopAdd, ColumnWidth1 - 120 - (LeftAdd * 2), RowContentHeight );
- g.DrawString( StrTitle, ft9, b, recfor2_1 );//画第一列的列标题
- Point pfor1_1 = new Point( recfor.X + ColumnWidth1 - 120, recfor.Y );
- Point pfor1_2 = new Point( recfor.X + ColumnWidth1 - 120, recfor.Y + recfor.Height );
- g.DrawLine( p, pfor1_1, pfor1_2 );//画第一表与第二列的界线
- sizef = g.MeasureString( dgvData.SelectedRows[PrintForCount].Cells[i].Value.ToString().Trim(), ft9 );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle recfor2_2 = new Rectangle( pfor1_1.X + LeftAdd, pfor1_1.Y + TopAdd, ColumnWidth1 + 120 - (LeftAdd * 2), RowContentHeight );
- g.DrawString( dgvData.SelectedRows[PrintForCount].Cells[i].Value.ToString().Trim(), ft9, b, recfor2_2 );//画第一列的列标题
- intDay++;
- IntPoint_Y = recfor.Y + recfor.Height;
- }
- }
- #endregion
- PrintForCount++;
- }
- if ( PrintForCount < dgvData.SelectedRows.Count )
- {
- PrintCurrentIndexPage++;
- IsNextPage = true;
- IsHasMorePages = true;
- return;
- }
- if ( !IsNextPage )
- {
- IsHasMorePages = false;
- }
- }
- #endregion
- #region 热敏小票打印
- /// <summary>
- /// 小票打印订单收款
- /// </summary>
- public static void SmallTicket_OrderPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- List<string> usNumber = new List<string>();
- for ( int i = 0; i < dgvData.SelectedRows.Count; i++ )
- {
- DataRow dr = dgvData.SelectedRows[i].Tag as DataRow;
- if ( dr != null )
- {
- if ( !string.IsNullOrEmpty( Convert.ToString( dr["Pay_McNumber"] ) ) )
- {
- usNumber.Add( Convert.ToString( dr["Pay_McNumber"] ) );
- }
- }
- }
- string memberDisInfo = "";
- BLL.BLL_ErpMemberCard bllMember = new BLL.BLL_ErpMemberCard();
- DataTable tableMember = bllMember.GetList( " Mc_Number in ('" + string.Join( "','", usNumber.ToArray() ) + "') " ).Tables[0];
- /*for(int i=0;i<tableMember.Rows.Count;i++)
- {
- memberDisInfo += "[会员卡" + tableMember.Rows[i]["MC_CradNumber"] + " 的余额:" + tableMember.Rows[i]["mc_money"] + "]";
- }*/
- string StrNumber = htData["strNumber"].ToString().Trim();
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpOrder", StrWhere: "Ord_Number = '" + StrNumber + "' ", ShowColumnName: "case when Ord_SinceOrderNumber != '' then Ord_SinceOrderNumber else Ord_Number end Ord_SinceOrderNumber,Ord_SeriesPrice,Ord_Type" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- //获取影楼信息
- DataTable tbl_Info = dtSet.Tables["ds"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- DataTable tbl_Order = dtSet.Tables["ds1"];
- Brush b = Brushes.Black;
- Pen p = new Pen( b, float.Parse( "0.5" ) );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 10, 10 };
- string StrFont = "宋体";
- Font ft17 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft12 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft12 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft17, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft17, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "流程单号:" );
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft12, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( tbl_Order.Rows[0]["Ord_SinceOrderNumber"].ToString().Trim(), ft12, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第二行 积分卡号
- //Rectangle rec3 = new Rectangle(rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight);
- //g.DrawString("积分卡号:", ft9, b, rec3);
- //Rectangle rec3A = new Rectangle(rec3.X + rec3.Width, rec3.Y - ContentHeight, TableWidth - rec3.Width, rec3.Height);
- //g.DrawString(tbl2.Rows[0]["Mc_CradNumber"].ToString().Trim(), ft9, b, rec3A);
- //Point rec3A_1 = new Point(rec3A.X, rec3A.Y + rec3A.Height - Underline);
- //Point rec3A_2 = new Point(rec3A.X + rec3A.Width, rec3A_1.Y);
- //g.DrawLine(p, rec3A_1, rec3A_2);
- #endregion
- int IntPoint_Y = 0;
- Hashtable htClient = GetClientInfo( StrNumber, tbl_Order.Rows[0]["Ord_Type"].ToString().Trim() );
- if ( htClient == null )
- {
- MessageBoxCustom.Show( "获取客户信息无数据!" ); return;
- }
- if ( tbl_Order.Rows[0]["Ord_Type"].ToString().Trim() == "0" )
- {
- #region 婚纱客户
- #region 第三行 主联系人姓名、性别
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft12, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - TableWidth / 3 - rec4.Width - 5, rec4.Height );
- g.DrawString( htClient["StrManName"].ToString(), ft12, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "性别:" );
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec4B = new Rectangle( rec4A.X + rec4A.Width + 5, rec4.Y, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft12, b, rec4B );
- Rectangle rec4C = new Rectangle( rec4B.X + rec4B.Width, rec4A.Y, FtWidth / 2, rec4B.Height );
- g.DrawString( htClient["StrManSex"].ToString(), ft12, b, rec4C );
- Point rec4C_1 = new Point( rec4C.X, rec4A_1.Y );
- Point rec4C_2 = new Point( TableWidth, rec4C_1.Y );
- g.DrawLine( p, rec4C_1, rec4C_2 );
- #endregion
- #region 第四行 主联系人电话
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft12, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htClient["StrManPhone"] ), ft12, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 副联系人姓名、性别
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft12, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - TableWidth / 3 - rec6.Width - 5, rec6.Height );
- g.DrawString( htClient["StrWoManName"].ToString(), ft12, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "性别:" );
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec6B = new Rectangle( rec6A.X + rec6A.Width + 5, rec6A.Y, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft12, b, rec6B );
- Rectangle rec6C = new Rectangle( rec6B.X + rec6B.Width, rec6A.Y, FtWidth / 2, rec6B.Height );
- g.DrawString( htClient["StrWoManSex"].ToString(), ft12, b, rec6C );
- Point rec6C_1 = new Point( rec6C.X, rec6A_1.Y );
- Point rec6C_2 = new Point( TableWidth, rec6C_1.Y );
- g.DrawLine( p, rec6C_1, rec6C_2 );
- #endregion
- #region 第六行 客户婚期
- Rectangle rec7 = new Rectangle( rec6.X, rec6.Y + rec6.Height, rec6.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 婚 期:" ), ft12, b, rec7 );
- Rectangle rec7A = new Rectangle( rec7.X + rec7.Width, rec7.Y - ContentHeight, TableWidth - rec7.Width, rec7.Height );
- g.DrawString( htClient["StrManMarriage"].ToString(), ft12, b, rec7A );
- Point rec7A_1 = new Point( rec7A.X, rec7A.Y + rec7A.Height - Underline );
- Point rec7A_2 = new Point( rec7A.X + rec7A.Width, rec7A_1.Y );
- g.DrawLine( p, rec7A_1, rec7A_2 );
- #endregion
- IntPoint_Y = rec7A_1.Y + rec7.Height / 3;
- #endregion
- }
- else if ( tbl_Order.Rows[0]["Ord_Type"].ToString().Trim() == "1" )
- {
- #region 儿童客户
- #region 第三行 宝贝姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "宝贝姓名:" ), ft12, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( htClient["StrChildName"].ToString(), ft12, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别、年龄
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "性 别:" );
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft12, b, rec5 );
- rec1Value = "性别";
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width );
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, FtWidth, rec5.Height );
- g.DrawString( htClient["StrChildSex"].ToString(), ft12, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- rec1Value = "年龄:";
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- Rectangle rec5B = new Rectangle( rec5A.X + rec5A.Width + 10, rec5.Y, FtWidth, rec5.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "年龄:" ), ft12, b, rec5B );
- Rectangle rec5C = new Rectangle( rec5B.X + rec5B.Width, rec5B.Y - ContentHeight, TableWidth - rec5B.X, rec5.Height );
- g.DrawString( htClient["StrChildRAgeString"].ToString(), ft12, b, rec5C );
- Point rec5C_1 = new Point( rec5C.X, rec5B.Y + rec5C.Height - Underline );
- Point rec5C_2 = new Point( rec5C.X + rec5C.Width, rec5C_1.Y );
- g.DrawLine( p, rec5C_1, rec5C_2 );
- #endregion
- #region 第五行 家长姓名
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "家长姓名:" ), ft12, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( htClient["StrParentName"].ToString(), ft12, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #region 第六行 联系电话
- Rectangle rec7 = new Rectangle( rec6.X, rec6.Y + rec6.Height, rec6.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft12, b, rec7 );
- Rectangle rec7A = new Rectangle( rec7.X + rec7.Width, rec7.Y - ContentHeight, TableWidth - rec7.Width, rec7.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htClient["StrParentPhone"] ), ft12, b, rec7A );
- Point rec7A_1 = new Point( rec7A.X, rec7A.Y + rec7A.Height - Underline );
- Point rec7A_2 = new Point( rec7A.X + rec7A.Width, rec7A_1.Y );
- g.DrawLine( p, rec7A_1, rec7A_2 );
- #endregion
- IntPoint_Y = rec7A_1.Y + rec7.Height / 3;
- #endregion
- }
- else
- {
- #region 写真客户
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft12, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( htClient["StrMainName"].ToString(), ft12, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft12, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( htClient["StrMainSex"].ToString(), ft12, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft12, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htClient["StrMainPhone"] ), ft12, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- IntPoint_Y = rec6A_1.Y + rec6.Height / 3;
- #endregion
- }
- #endregion
- Point rec7B_1 = new Point( 0, IntPoint_Y + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- decimal ActualAmount = 0;//实付金额
- decimal ActualOrd_Amount = 0;//实付订单金额
- decimal Actualsale_Amount = 0;//实付二销金额
- IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- decimal DiscountAmount = 0;
- for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
- {
- DataRow dr = dgvData.SelectedRows[i].Tag as DataRow;
- string tempMemberDisInfo = "";
- if ( dr != null )
- {
- DataRow[] memberDataRows = tableMember.Select( " Mc_Number = '" + dr["Pay_McNumber"] + "'" );
- if ( memberDataRows.Length > 0 )
- {
- if ( LYFZ.BLL.BLL_SystemGlobalSetting.SysTemGlobalSetMoel.MemberBalance )
- {
- tempMemberDisInfo += "[会员卡" + memberDataRows[0]["MC_CradNumber"] + " 的余额:" + memberDataRows[0]["mc_money"] + "]";
- }
- }
- }
- if ( !string.IsNullOrEmpty( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value.ToString().Trim() ) )
- {
- if ( Convert.ToDecimal( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value ) > 0 )
- {
- DiscountAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value );
- }
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft12, b, recFor1 );
- string StrCategory = dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim() != "" ? dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim() : dgvData.SelectedRows[i].Cells["Pay_Category"].Value.ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft12, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft12, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim(), ft12, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft12, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value.ToString().Trim(), ft12, b, recFor3A );
- Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 门 市:" ), ft12, b, recFor4 );
- Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim(), ft12, b, recFor4A );
- Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft12, b, recFor5 );
- Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim(), ft12, b, recFor5A );
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["Pay_Remark"].Value.ToString().Trim() + tempMemberDisInfo;
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double fordbHeight = sizef.Height;
- int forRowCount = FtWidth / TableWidth;
- forRowCount++;
- double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
- Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft12, b, recFor6 );
- IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
- string StrProjectName = dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim();
- if ( StrProjectName.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.全款.ToString() || StrProjectName.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.后期收款.ToString() ||
- StrProjectName.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.预约补款.ToString() || StrProjectName.Trim() == LYFZ.EnumPublic.PaymentCategoryEnum.预约收款.ToString() )
- {
- ActualOrd_Amount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
- }
- else
- {
- Actualsale_Amount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
- }
- }
- #endregion
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- ActualAmount = (ActualOrd_Amount + Actualsale_Amount);
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft12, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( htData["CopeAmount"].ToString().Trim(), ft12, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft12, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( (ActualAmount - DiscountAmount).ToString(), ft12, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十二行 欠款
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft12, b, rec11 );
- Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
- g.DrawString( htData["Arrear"].ToString().Trim(), ft12, b, rec11A );
- Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
- Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
- g.DrawLine( p, rec11A_1, rec11A_2 );
- #endregion
- #region 优惠
- int rec11A_1_Y = rec11A_1.Y + rec11.Height / 2;
- if ( DiscountAmount > 0 )
- {
- Rectangle rec11A1_0 = new Rectangle( rec11.X, rec11.Y + rec11.Height, rec11.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 优 惠:" ), ft12, b, rec11A1_0 );
- Rectangle rec11A1_1 = new Rectangle( rec11A1_0.X + rec11A1_0.Width, rec11A1_0.Y - ContentHeight, TableWidth - rec11A1_0.Width, rec11A1_0.Height );
- g.DrawString( DiscountAmount.ToString().Trim(), ft12, b, rec11A1_1 );
- Point rec11A_11 = new Point( rec11A1_1.X, rec11A1_1.Y + rec11A1_1.Height - Underline );
- Point rec11A_21 = new Point( rec11A1_1.X + rec11A1_1.Width, rec11A_11.Y );
- g.DrawLine( p, rec11A_11, rec11A_21 );
- rec11A_1_Y = rec11A_11.Y + rec11.Height / 2;
- }
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec11.X, rec11A_1_Y, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft12, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft12, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft12, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft12, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft12, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft12 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft12, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印其他二销收款
- /// </summary>
- public static void SmallTicket_OtherTwoSalesPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string strText = htData["strText"].ToString().Trim();
- string[] ObjStr = strText.Split( '|' );
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "tb_ErpTwoSalesOrder", StrWhere: "Tsorder_Number = '" + ObjStr[0].Trim() + "'" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl_Info = dtSet.Tables["ds"];//获取影楼信息
- DataTable tbl2 = dtSet.Tables["ds1"]; //获取订单信息
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tbl2.Rows.Count == 0 )
- {
- MessageBoxCustom.Show( "订单不存在" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "流程单号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( ObjStr[0].Trim(), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- string StrSex = ""; //性别
- string StrName = "";// 客户姓名
- string StrPhone = "";// 联系电话
- if ( tbl2.Rows[0]["Tsorder_CustomerName"].ToString().Trim() != "" )
- {
- StrName = tbl2.Rows[0]["Tsorder_CustomerName"].ToString().Trim();
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- if ( tbl2.Rows[0]["Tsorder_Telephone"].ToString().Trim() != "" )
- {
- StrPhone = tbl2.Rows[0]["Tsorder_Telephone"].ToString().Trim();
- }
- }
- else
- {
- DataTable tblClient = orbll.GetView_Custom( "tb_ErpCustomer", StrWhere: "Cus_CustomerNumber = '" + tbl2.Rows[0]["Tsorder_CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Cus_Sex,Cus_Name,Cus_Telephone" ).Tables[0];
- if ( tblClient.Rows.Count > 0 )
- {
- StrName = tblClient.Rows[0]["Cus_Name"].ToString().Trim();
- sizef = g.MeasureString( StrName, ft10 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- StrPhone = tblClient.Rows[0]["Cus_Telephone"].ToString().Trim();
- StrSex = LYFZ.Command.Command_Validate.GetChinaSex( tblClient.Rows[0]["Cus_Sex"] );
- }
- }
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( StrName, ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( StrSex, ft9, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( StrPhone ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- int IntPoint_Y = rec6A_1.Y + rec6.Height / 3;
- #endregion
- Point rec7B_1 = new Point( 0, IntPoint_Y + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- decimal DiscountAmount = 0;
- for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
- {
- if ( !string.IsNullOrEmpty( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value.ToString().Trim() ) )
- {
- if ( Convert.ToDecimal( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value ) > 0 )
- {
- DiscountAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["DiscountAmount"].Value );
- }
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- string StrCategory = dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim() != "" ? dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim() : dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value.ToString().Trim(), ft9, b, recFor3A );
- Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 门 市:" ), ft9, b, recFor4 );
- Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim(), ft9, b, recFor4A );
- Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
- Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim(), ft9, b, recFor5A );
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["Pay_Remark"].Value.ToString().Trim();
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double fordbHeight = sizef.Height;
- int forRowCount = FtWidth / TableWidth;
- forRowCount++;
- double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
- Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, recFor6 );
- IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
- }
- #endregion
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( ObjStr[1].Trim(), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( ObjStr[2].Trim(), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十二行 欠款
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
- Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
- g.DrawString( ObjStr[3].Trim(), ft9, b, rec11A );
- Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
- Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
- g.DrawLine( p, rec11A_1, rec11A_2 );
- #endregion
- #region 优惠
- int rec11A_1_Y = rec11A_1.Y + rec11.Height / 2;
- if ( DiscountAmount > 0 )
- {
- Rectangle rec11A1_0 = new Rectangle( rec11.X, rec11.Y + rec11.Height, rec11.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 优 惠:" ), ft9, b, rec11A1_0 );
- Rectangle rec11A1_1 = new Rectangle( rec11A1_0.X + rec11A1_0.Width, rec11A1_0.Y - ContentHeight, TableWidth - rec11A1_0.Width, rec11A1_0.Height );
- g.DrawString( DiscountAmount.ToString().Trim(), ft9, b, rec11A1_1 );
- Point rec11A_11 = new Point( rec11A1_1.X, rec11A1_1.Y + rec11A1_1.Height - Underline );
- Point rec11A_21 = new Point( rec11A1_1.X + rec11A1_1.Width, rec11A_11.Y );
- g.DrawLine( p, rec11A_11, rec11A_21 );
- rec11A_1_Y = rec11A_11.Y + rec11.Height / 2;
- }
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec11.X, rec11A_1_Y, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印店面、现金支出
- /// </summary>
- public static void SmallTicket_CashOutlayPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- //获取影楼信息
- DataTable tbl_Info = dtSet.Tables["ds"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 第一行 支付人
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "流程单号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 支付人:" ), ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( dgvData.SelectedRows[0].Cells["取款人"].Value.ToString().Trim(), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- int IntPoint_Y = rec2A_1.Y + rec2.Height / 3;
- Point rec7B_1 = new Point( 0, IntPoint_Y + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- decimal ActualAmount = 0;//实付金额
- #region 第八行 产品
- IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
- {
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- string StrCategory = dgvData.SelectedRows[i].Cells["费用项目"].Value.ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["费用金额"].Value.ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["录单人"].Value.ToString().Trim(), ft9, b, recFor3A );
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["支出说明"].Value.ToString().Trim();
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double fordbHeight = sizef.Height;
- int forRowCount = FtWidth / TableWidth;
- forRowCount++;
- double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
- Rectangle recFor6 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, recFor6 );
- IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
- ActualAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["费用金额"].Value );
- }
- #endregion
- decimal CopeAmount = ActualAmount;//总额
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 总 额:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( CopeAmount.ToString(), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 实 付:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( ActualAmount.ToString(), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec10.X, rec10.Y + rec10.Height + rec10.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支款确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印其它收入收款
- /// </summary>
- public static void SmallTicket_OtherIncomePayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- //获取影楼信息
- DataTable tbl_Info = dtSet.Tables["ds"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 第一行 支付人
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "流程单号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 支付人:" ), ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( dgvData.SelectedRows[0].Cells["付款人"].Value.ToString().Trim(), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- int IntPoint_Y = rec2A_1.Y + rec2.Height / 3;
- Point rec7B_1 = new Point( 0, IntPoint_Y + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- decimal ActualAmount = 0;//实付金额
- #region 第八行 产品
- IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
- {
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- string StrCategory = dgvData.SelectedRows[i].Cells["项目名称"].Value.ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["项目金额"].Value.ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["录单人"].Value.ToString().Trim(), ft9, b, recFor3A );
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["项目说明"].Value.ToString().Trim();
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double fordbHeight = sizef.Height;
- int forRowCount = FtWidth / TableWidth;
- forRowCount++;
- double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
- Rectangle recFor6 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, recFor6 );
- IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
- ActualAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["项目金额"].Value );
- }
- #endregion
- decimal CopeAmount = ActualAmount;//总额
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( CopeAmount.ToString(), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( ActualAmount.ToString(), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十二行 欠款
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
- Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
- g.DrawString( "0", ft9, b, rec11A );
- Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
- Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
- g.DrawLine( p, rec11A_1, rec11A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + rec11.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印礼服出租收款
- /// </summary>
- public static void SmallTicket_GownsPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl_Info = dtSet.Tables["ds"]; //获取影楼信息
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 单 号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( StrRandom( htData["ordNumber"].ToString().Trim() ), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( htData["CustomerName"].ToString().Trim(), ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- //Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight);
- //g.DrawString(" 性 别:", ft9, b, rec5);
- //Rectangle rec5A = new Rectangle(rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height);
- //g.DrawString(htClient["StrMainSex"].ToString(), ft9, b, rec5A);
- //Point rec5A_1 = new Point(rec5A.X, rec5A.Y + rec5A.Height - Underline);
- //Point rec5A_2 = new Point(rec5A.X + rec5A.Width, rec5A_1.Y);
- //g.DrawLine(p, rec5A_1, rec5A_2);
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htData["Telephone"] ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #endregion
- Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- decimal CopeAmount = 0;//租金
- decimal MortgageAmount = 0;//押金
- int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
- {
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- string StrCategory = dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value.ToString().Trim(), ft9, b, recFor3A );
- Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收款时间:" ), ft9, b, recFor4 );
- Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_CreateDatetime"].Value.ToString().Trim(), ft9, b, recFor4A );
- Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
- Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim(), ft9, b, recFor5A );
- #region 2017-03-30 刘工添加 接单人
- Rectangle recFor5_1 = new Rectangle( recFor4.X, recFor5.Y + recFor5.Height, recFor1.Width, recFor5.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 接单人:" ), ft9, b, recFor5_1 );
- Rectangle recFor5A_1 = new Rectangle( recFor4A.X, recFor5_1.Y, recFor5_1.Width, recFor5_1.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim(), ft9, b, recFor5A_1 );
- recFor5 = recFor5_1;
- recFor5A = recFor5A_1;
- #endregion
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款说明: " ) + dgvData.SelectedRows[i].Cells["Pay_Remark"].Value.ToString().Trim();
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double fordbHeight = sizef.Height;
- int forRowCount = FtWidth / TableWidth;
- forRowCount++;
- double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
- Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, recFor6 );
- IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
- if ( dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim() == "押金" )
- {
- MortgageAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
- }
- else if ( dgvData.SelectedRows[i].Cells["type"].Value.ToString().Trim() == "租金" )
- {
- CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
- }
- }
- #endregion
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( (Convert.ToDecimal( htData["StrCope"] ) + Convert.ToDecimal( htData["StrDetain"] )).ToString(), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( (MortgageAmount + CopeAmount).ToString( "0.00" ).ToString(), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十二行 欠款
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
- Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
- g.DrawString( (Convert.ToDecimal( htData["StrCope"] ) - CopeAmount).ToString( "0.00" ), ft9, b, rec11A );
- Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
- Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
- g.DrawLine( p, rec11A_1, rec11A_2 );
- #endregion
- #region 第十二行 租金
- Rectangle rec11_A = new Rectangle( rec11.X, rec11.Y + rec11.Height, rec11.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 租 金:" ), ft9, b, rec11_A );
- Rectangle rec11A_A = new Rectangle( rec11_A.X + rec11_A.Width, rec11_A.Y - ContentHeight, TableWidth - rec11_A.Width, rec11_A.Height );
- g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec11A_A );
- Point rec11A_A_1 = new Point( rec11A_A.X, rec11A_A.Y + rec11A_A.Height - Underline );
- Point rec11A_A_2 = new Point( rec11A_A.X + rec11A_A.Width, rec11A_A_1.Y );
- g.DrawLine( p, rec11A_A_1, rec11A_A_2 );
- #endregion
- #region 第十二行 押金
- Rectangle rec11_B = new Rectangle( rec11_A.X, rec11_A.Y + rec11_A.Height, rec11_A.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 押 金:" ), ft9, b, rec11_B );
- Rectangle rec11B_A = new Rectangle( rec11_B.X + rec11_B.Width, rec11_B.Y - ContentHeight, TableWidth - rec11_B.Width, rec11_B.Height );
- g.DrawString( MortgageAmount.ToString( "0.00" ), ft9, b, rec11B_A );
- Point rec11B_A_1 = new Point( rec11B_A.X, rec11B_A.Y + rec11B_A.Height - Underline );
- Point rec11B_A_2 = new Point( rec11B_A.X + rec11B_A.Width, rec11B_A_1.Y );
- g.DrawLine( p, rec11B_A_1, rec11B_A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec11_B.X, rec11_B.Y + rec11_B.Height + rec11_B.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印礼服出售收款
- /// </summary>
- public static void SmallTicket_SoldPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- //获取影楼信息
- DataTable tbl_Info = dtSet.Tables["ds"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 单 号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( StrRandom( htData["ordNumber"].ToString().Trim() ), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( htData["CustomerName"].ToString().Trim(), ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- //Rectangle rec5 = new Rectangle(rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight);
- //g.DrawString(" 性 别:", ft9, b, rec5);
- //Rectangle rec5A = new Rectangle(rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height);
- //g.DrawString(htClient["StrMainSex"].ToString(), ft9, b, rec5A);
- //Point rec5A_1 = new Point(rec5A.X, rec5A.Y + rec5A.Height - Underline);
- //Point rec5A_2 = new Point(rec5A.X + rec5A.Width, rec5A_1.Y);
- //g.DrawLine(p, rec5A_1, rec5A_2);
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( htData["Telephone"] ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #endregion
- Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- decimal CopeAmount = 0;//应付金额
- //decimal ActualAmount = 0;//实付金额
- int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
- {
- CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value );
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- string StrCategory = dgvData.SelectedRows[i].Cells["Pay_ReceivableProject"].Value.ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_PaymentMethod"].Value.ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_AmountOf"].Value.ToString().Trim(), ft9, b, recFor3A );
- Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "收款时间:" ), ft9, b, recFor4 );
- Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_CreateDatetime"].Value.ToString().Trim(), ft9, b, recFor4A );
- Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
- Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_ThePayee"].Value.ToString().Trim(), ft9, b, recFor5A );
- #region 2017-03-30 刘工添加 接单人
- Rectangle recFor5_1 = new Rectangle( recFor4.X, recFor5.Y + recFor5.Height, recFor1.Width, recFor5.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 接单人:" ), ft9, b, recFor5_1 );
- Rectangle recFor5A_1 = new Rectangle( recFor4A.X, recFor5_1.Y, recFor5_1.Width, recFor5_1.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["Pay_OpenSingle"].Value.ToString().Trim(), ft9, b, recFor5A_1 );
- recFor5 = recFor5_1;
- recFor5A = recFor5A_1;
- #endregion
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 说 明: " ) + dgvData.SelectedRows[i].Cells["Pay_Remark"].Value.ToString().Trim();
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double fordbHeight = sizef.Height;
- int forRowCount = FtWidth / TableWidth;
- forRowCount++;
- double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
- Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, recFor6 );
- IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
- }
- #endregion
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( (Convert.ToDecimal( htData["StrCope"] ) + Convert.ToDecimal( htData["StrDetain"] )).ToString( "0.00" ), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十二行 欠款
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
- Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
- g.DrawString( (Convert.ToDecimal( htData["StrCope"] ) - CopeAmount).ToString( "0.00" ), ft9, b, rec11A );
- Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
- Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
- g.DrawLine( p, rec11A_1, rec11A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + rec11.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印礼服出租退押金
- /// </summary>
- public static void SmallTicket_SoldRefundPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEc dgvData = (DataGridViewEc)htData["dgvData"];
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
- ExecuteSql += orbll.GetView_CustomReturnExecuteSql( "tb_ErpCustomer", StrWhere: "Cus_CustomerNumber = '" + htData["CustomerNumber"].ToString().Trim() + "'", ShowColumnName: "Cus_Name,Cus_Sex,Cus_Telephone" );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- //获取影楼信息
- DataTable tbl_Info = dtSet.Tables["ds"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- DataTable tblorder = dtSet.Tables["ds1"];
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 单 号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( StrRandom( htData["DressOrderNumber"].ToString().Trim() ), ft9, b, rec2A );//dgvData.Rows[0].Cells["Dsro_Number"].Value.ToString().Trim()
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( tblorder.Rows[0]["Cus_Name"].ToString().Trim(), ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( LYFZ.Command.Command_Validate.GetChinaSex( tblorder.Rows[0]["Cus_Sex"] ), ft9, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblorder.Rows[0]["Cus_Telephone"] ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #endregion
- Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- decimal CopeAmount = 0;//应付金额
- int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- for ( int i = dgvData.SelectedRows.Count - 1; i >= 0; i-- )
- {
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor1 );
- string StrCategory = dgvData.SelectedRows[i].Cells["金额"].Value.ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 类 型:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["退款类型"].Value.ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "交易时间:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( LYFZ.Command.Command_Validate.DateTimeToString( dgvData.SelectedRows[i].Cells["录入时间"].Value, "yyyy-MM-dd HH:mm" ), ft9, b, recFor3A );
- Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor4 );
- Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
- g.DrawString( dgvData.SelectedRows[i].Cells["退款人"].Value.ToString().Trim(), ft9, b, recFor4A );
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + dgvData.SelectedRows[i].Cells["退款备注"].Value.ToString().Trim();
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double fordbHeight = sizef.Height;
- int forRowCount = FtWidth / TableWidth;
- forRowCount++;
- double forNewRowHeight = (fordbHeight * float.Parse( forRowCount.ToString() ));
- Rectangle recFor6 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, TableWidth, Convert.ToInt32( forNewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, recFor6 );
- IntPoint_Y = recFor6.Y + recFor6.Height + RowHeight / 2;
- CopeAmount += Convert.ToDecimal( dgvData.SelectedRows[i].Cells["金额"].Value );
- }
- #endregion
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 原押金
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 原押金:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( Convert.ToDecimal( htData["DepositAmount"] ).ToString( "0.00" ), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 已退
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 已 退:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十二行 未退
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 未 退:" ), ft9, b, rec11 );
- Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
- g.DrawString( Convert.ToDecimal( htData["NotRefundAmount"] ).ToString( "0.00" ), ft9, b, rec11A );
- Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
- Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
- g.DrawLine( p, rec11A_1, rec11A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + rec11.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印会员充值收款
- /// </summary>
- public static void SmallTicket_MemberRechargePayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- //Hashtable htData = (Hashtable)objValue;
- Hashtable htDataObj = (Hashtable)objValue;
- List<dynamic> dyObjList = htDataObj["PrintDataList"] as List<dynamic>;
- DataGridViewEx dgvData = (DataGridViewEx)htDataObj["dgvData"];
- string ExecuteSql = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo", StrWhere: "Company_DividedShop = '" + StrDividedShop + "'", ShowColumnName: "Company_Telephone" );
- ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql( "BView_MemberMain_GoldMember", StrWhere: "Mc_Number = '" + htDataObj["McNumber"] + "' " );
- DataSet dtSet = orbll.GetView_Custom( ExecuteSql );
- DataTable tbl_Info = dtSet.Tables["ds"];//获取影楼信息
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- DataTable tbl2 = dtSet.Tables["ds1"];
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( tbl2.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( tbl2.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( tbl2.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #endregion
- Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- IDictionary<string, object> htData = null;
- Rectangle tempRecFor = new Rectangle(rec2.X, rec7B_1.Y + RowHeight / 2, FtWidth, rec2.Height);
- Rectangle recFor5 = new Rectangle();
- string RechargeType = "";
- decimal totalPaymentAmount = 0;
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion("收款项目:");
- sizef = g.MeasureString(rec1Value, ft9);
- FtWidth = Convert.ToInt32(sizef.Width) + 1;
- FtHeight = Convert.ToInt32(sizef.Height);
- Rectangle disRecFor1= new Rectangle(tempRecFor.X, tempRecFor.Y, tempRecFor.Width, tempRecFor.Height);
- Rectangle valRecFor1 = new Rectangle(disRecFor1.Width, disRecFor1.Y, TableWidth - FtWidth, disRecFor1.Height);
- foreach (dynamic dyObj in dyObjList)
- {
- htData = dyObj;
- RechargeType = htData["RechargeType"].ToString_s();
-
- g.DrawString(rec1Value, ft9, b, disRecFor1);
- g.DrawString(htData["PaymentItem"].ToString().Trim().Split('(')[0], ft9, b, valRecFor1);
- disRecFor1 = new Rectangle(disRecFor1.X, disRecFor1.Y + disRecFor1.Height, disRecFor1.Width, disRecFor1.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion("支付方式:"), ft9, b, disRecFor1);
- valRecFor1 = new Rectangle(valRecFor1.X, disRecFor1.Y, valRecFor1.Width, disRecFor1.Height);
- g.DrawString(htData["PaymentMethod"].ToString().Trim(), ft9, b, valRecFor1);
- disRecFor1 = new Rectangle(disRecFor1.X, disRecFor1.Y + disRecFor1.Height, disRecFor1.Width, disRecFor1.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(" 金 额:"), ft9, b, disRecFor1);
- valRecFor1 = new Rectangle(valRecFor1.X, disRecFor1.Y, valRecFor1.Width, valRecFor1.Height);
- g.DrawString(htData["PaymentAmount"].ToString().Trim(), ft9, b, valRecFor1);
- totalPaymentAmount += Convert.ToDecimal(htData["PaymentAmount"].ToString());
- disRecFor1 = new Rectangle(disRecFor1.X, disRecFor1.Y + disRecFor1.Height, disRecFor1.Width, disRecFor1.Height);
- g.DrawString(LYFZ.BLL.OtherCommonModel.FontConversion(" 收 银:"), ft9, b, disRecFor1);
- valRecFor1 = new Rectangle(valRecFor1.X, disRecFor1.Y, valRecFor1.Width, valRecFor1.Height);
- g.DrawString(htData["PaymentPeople"].ToString().Trim(), ft9, b, valRecFor1);
- if(dyObjList.Count-1!= dyObjList.IndexOf(dyObj))
- {
- disRecFor1 = new Rectangle(disRecFor1.X, disRecFor1.Y + disRecFor1.Height + 5, disRecFor1.Width, disRecFor1.Height);
- valRecFor1 = new Rectangle(valRecFor1.X, valRecFor1.Y + valRecFor1.Height + 5, valRecFor1.Width, valRecFor1.Height);
- }
-
- }
- #endregion
- recFor5 = new Rectangle(valRecFor1.X, valRecFor1.Y, valRecFor1.Width, valRecFor1.Height);
- Point rec8_1 = new Point( rec2.X, recFor5.Y + recFor5.Height + RowHeight / 2 );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- decimal totalValue = 0;
- decimal totalSerAmoun = 0;
- if(RechargeType.Equals("会员充值定金"))
- {
- totalValue = Convert.ToDecimal(htData["TotalRechargeAmoun"]);
- totalSerAmoun = Convert.ToDecimal(htData["TotalSerAmoun"]);
- }
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- if (RechargeType.Equals( "会员充值定金" ) )
- {
- g.DrawString( totalSerAmoun.ToString().Trim(), ft9, b, rec9A );
- }
- else
- {
- g.DrawString(totalPaymentAmount.ToString().Trim(), ft9, b, rec9A );
- }
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- if (RechargeType.Equals( "会员充值定金" ) )
- {
- g.DrawString( totalValue.ToString().Trim(), ft9, b, rec10A );
- }
- else
- {
- g.DrawString(totalPaymentAmount.ToString().Trim(), ft9, b, rec10A );
- }
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- if (RechargeType.Equals( "会员充值定金" ) && (totalValue - totalPaymentAmount) > 0 )
- {
- PaymentExplain += "【已缴纳金额(定金):" + (totalValue - totalPaymentAmount) + "】";
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec10.X, rec10.Y + rec10.Height + rec10.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印新摄会收款
- /// </summary>
- public static void SmallTicket_PhotographerPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string strNumber = htData["strNumber"].ToString().Trim();
- string strMyNumber = htData["strMyNumber"].ToString().Trim();
- string ExecuteSql = "select Company_Telephone from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
- ExecuteSql += "select 会员卡号,姓名,性别,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + strNumber + "' ;";
- ExecuteSql += "select Mcpm_GradeName,Mcpm_UpgradeAoumnt,dbo.fn_CheckUserIDGetUserName(Mcpm_CreateName) AS Mcpm_CreateName,dbo.fn_CheckUserIDGetUserName(Mcpm_PaymentName) AS Mcpm_PaymentName,(select Sc_ClassName from tb_ErpSystemCategory where Sc_ClassCode = Mcpm_PaymentMethod) AS Mcpm_PaymentMethod from tb_ErpMemberCardPhotographerMain where Mcpm_MyNumber = '" + strMyNumber + "';";
- ExecuteSql += "select Mcpv_GiftName from tb_ErpMemberCardPhotographerVice where Mcpv_MyNumber = '" + strMyNumber + "';";
- DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
- DataTable tbl_Info = dsData.Tables["ds"];
- DataTable tbl2 = dsData.Tables["ds1"];
- DataTable tbl3 = dsData.Tables["ds2"];
- DataTable tbl4 = dsData.Tables["ds3"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tbl2.Rows.Count == 0 )
- {
- MessageBoxCustom.Show( "会员卡号不存在" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( tbl2.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( tbl2.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( tbl2.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #endregion
- Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- decimal CopeAmount = 0;//应付金额
- decimal ActualAmount = 0;//实付金额
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, rec7B_1.Y + RowHeight / 2, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- string StrCategory = tbl3.Rows[0]["Mcpm_GradeName"].ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( tbl3.Rows[0]["Mcpm_PaymentMethod"].ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"].ToString().Trim(), ft9, b, recFor3A );
- Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 门 市:" ), ft9, b, recFor4 );
- Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
- g.DrawString( tbl3.Rows[0]["Mcpm_CreateName"].ToString().Trim(), ft9, b, recFor4A );
- Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
- Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
- g.DrawString( tbl3.Rows[0]["Mcpm_PaymentName"].ToString().Trim(), ft9, b, recFor5A );
- Rectangle recFor6 = new Rectangle( recFor5.X, recFor5.Y + recFor5.Height, recFor5.Width, recFor5.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "赠品详情:" ), ft9, b, recFor6 );
- rec1Value = "";
- for ( int j = 0; j < tbl4.Rows.Count; j++ )
- {
- rec1Value += (j + 1) + "." + tbl4.Rows[j]["Mcpv_GiftName"].ToString().Trim() + "\r\n";
- }
- int forNewRowHeight = recFor5.Height;
- if ( rec1Value != "" )
- {
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double fordbHeight = sizef.Height;
- int forRowCount = FtWidth / TableWidth;
- forRowCount++;
- forNewRowHeight = Convert.ToInt32( fordbHeight * float.Parse( forRowCount.ToString() ) ) + 1;
- }
- Rectangle recFor6A = new Rectangle( recFor6.Width / 4, recFor6.Y + recFor6.Height, TableWidth - recFor6.Width / 4, forNewRowHeight );
- g.DrawString( rec1Value, ft9, b, recFor6A );
- CopeAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] );
- ActualAmount = Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] );
- #endregion
- Point rec8_1 = new Point( rec2.X, recFor6A.Y + recFor6A.Height + RowHeight / 2 );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "应付金额:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "实付金额:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( ActualAmount.ToString( "0.00" ), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec10.X, rec10.Y + rec10.Height + rec10.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印新摄会返还款
- /// </summary>
- public static void SmallTicket_PhotographerRefundPayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- DataGridViewEx dgvData = (DataGridViewEx)htData["dgvData"];
- string strNumber = htData["strNumber"].ToString().Trim();
- string strMyNumber = htData["strMyNumber"].ToString().Trim();
- string ExecuteSql = "select Company_Telephone from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
- ExecuteSql += "select 会员卡号,姓名,性别,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + strNumber + "' ;";
- ExecuteSql += "select Mcpm_GradeName,Mcpm_OKBackAoumnt,dbo.fn_CheckUserIDGetUserName(Mcpm_JingShouRen) AS Mcpm_JingShouRen,Mcpm_BackAoumnt,Mcpm_UpgradeAoumnt from tb_ErpMemberCardPhotographerMain where Mcpm_MyNumber = '" + strMyNumber + "';";
- DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
- DataTable tbl_Info = dsData.Tables["ds"];
- DataTable tbl2 = dsData.Tables["ds1"];
- DataTable tbl3 = dsData.Tables["ds2"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tbl2.Rows.Count == 0 )
- {
- MessageBoxCustom.Show( "会员卡号不存在" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( tbl2.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( tbl2.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( tbl2.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tbl2.Rows[0]["电话"] ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #endregion
- Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, rec7B_1.Y + RowHeight / 2, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- string StrCategory = tbl3.Rows[0]["Mcpm_GradeName"].ToString().Trim();//收款项目
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( StrCategory, ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( "现金", ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( tbl3.Rows[0]["Mcpm_OKBackAoumnt"].ToString().Trim(), ft9, b, recFor3A );
- Rectangle recFor5 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor5 );
- Rectangle recFor5A = new Rectangle( recFor3A.X, recFor5.Y, recFor3A.Width, recFor5.Height );
- g.DrawString( tbl3.Rows[0]["Mcpm_JingShouRen"].ToString().Trim(), ft9, b, recFor5A );
- #endregion
- Point rec8_1 = new Point( rec2.X, recFor5.Y + recFor5.Height + RowHeight / 2 );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 应 还:" ), ft9, b, rec9 );
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( tbl3.Rows[0]["Mcpm_BackAoumnt"].ToString().Trim(), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 实 还:" ), ft9, b, rec10 );
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( Convert.ToDecimal( tbl3.Rows[0]["Mcpm_UpgradeAoumnt"] ).ToString( "0.00" ), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec10.X, rec10.Y + rec10.Height + rec10.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印服务充值收款
- /// </summary>
- public static void SmallTicket_MemberServicePayment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- string ExecuteSql = "select Company_Telephone from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
- ExecuteSql += "select 会员卡号,姓名,性别,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + htData["strMcNumber"] + "' ;";
- ExecuteSql += "select Mcpt_PaymentNumber,Mcpt_Number,Mcpt_PaymentType,Mcpt_PaymentAmount,(select Sc_ClassName from tb_ErpSystemCategory where Sc_ClassCode = Mcpt_PaymentMethod) AS Mcpt_PaymentMethod,Mcpt_PaymentBank,Mcpt_PackageClass,Mcpt_PaymentRemark,Mcpt_PackagePrice,Mcpt_Discount,Mcpt_CreateDatetime,dbo.fn_CheckUserIDGetUserName(Mcpt_CreateName) AS Mcpt_CreateName from tb_ErpMemberCardPayment where Mcpt_PaymentNumber = '" + htData["strNumber"] + "';";
- ExecuteSql += "select Mcpcd_PaymentNumber,Mcpcd_ServiceNumber,Mcpcd_ServiceContent,Mcpcd_Count,Mcpcd_SalePrice from tb_ErpMemberCardPaymentContentDetail where Mcpcd_PaymentNumber = '" + htData["strNumber"] + "' ;";
- DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
- DataTable tbl_Info = dsData.Tables["ds"];
- DataTable tblA = dsData.Tables["ds1"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tblA.Rows.Count == 0 )
- {
- MessageBoxCustom.Show( "会员卡号不存在" ); return;
- }
- DataTable tblB = dsData.Tables["ds2"];
- DataTable tblC = dsData.Tables["ds3"];
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( tblA.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( tblA.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( tblA.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblA.Rows[0]["电话"] ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #endregion
- Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- decimal CopeAmount = 0;//应付金额
- int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- for ( int i = 0; i < tblC.Rows.Count; i++ )
- {
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "收款项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( tblC.Rows[i]["Mcpcd_ServiceContent"].ToString().Trim(), ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "支付方式:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( tblB.Rows[0]["Mcpt_PaymentMethod"].ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 金 额:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( tblC.Rows[i]["Mcpcd_SalePrice"].ToString().Trim(), ft9, b, recFor3A );
- Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 次 数:" ), ft9, b, recFor4 );
- Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
- g.DrawString( tblC.Rows[i]["Mcpcd_Count"].ToString().Trim(), ft9, b, recFor4A );
- Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 收 银:" ), ft9, b, recFor5 );
- Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
- g.DrawString( tblB.Rows[0]["Mcpt_CreateName"].ToString().Trim(), ft9, b, recFor5A );
- IntPoint_Y = recFor5.Y + recFor5.Height + RowHeight / 2;
- CopeAmount += Convert.ToDecimal( tblC.Rows[i]["Mcpcd_SalePrice"] ) * Convert.ToDecimal( tblC.Rows[i]["Mcpcd_Count"] );
- }
- #endregion
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十行 应付金额
- Rectangle rec9 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 应 付:" ), ft9, b, rec9 );
- if ( !string.IsNullOrEmpty( tblB.Rows[0]["Mcpt_PackagePrice"].ToString() ) )
- {
- if ( Convert.ToDecimal( tblB.Rows[0]["Mcpt_PackagePrice"] ) > 0 )
- {
- CopeAmount = Convert.ToDecimal( tblB.Rows[0]["Mcpt_PackagePrice"] );
- }
- }
- Rectangle rec9A = new Rectangle( rec9.X + rec9.Width, rec9.Y - ContentHeight, TableWidth - rec9.Width, rec9.Height );
- g.DrawString( CopeAmount.ToString( "0.00" ), ft9, b, rec9A );
- Point rec9A_1 = new Point( rec9A.X, rec9A.Y + rec9A.Height - Underline );
- Point rec9A_2 = new Point( rec9A.X + rec9A.Width, rec9A_1.Y );
- g.DrawLine( p, rec9A_1, rec9A_2 );
- #endregion
- #region 第十一行 实付金额
- Rectangle rec10 = new Rectangle( rec9.X, rec9.Y + rec9.Height, rec9.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 总付款:" ), ft9, b, rec10 );
- decimal totalAmount = 0;
- foreach ( DataRow dr in tblB.Rows )
- {
- totalAmount += Convert.ToDecimal( dr["Mcpt_PaymentAmount"] );
- }
- decimal ActualOrd_Amount = totalAmount;
- Rectangle rec10A = new Rectangle( rec10.X + rec10.Width, rec10.Y - ContentHeight, TableWidth - rec10.Width, rec10.Height );
- g.DrawString( ActualOrd_Amount.ToString( "0.00" ), ft9, b, rec10A );
- Point rec10A_1 = new Point( rec10A.X, rec10A.Y + rec10A.Height - Underline );
- Point rec10A_2 = new Point( rec10A.X + rec10A.Width, rec10A_1.Y );
- g.DrawLine( p, rec10A_1, rec10A_2 );
- #endregion
- #region 第十二行 欠款
- Rectangle rec11 = new Rectangle( rec10.X, rec10.Y + rec10.Height, rec10.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 欠 款:" ), ft9, b, rec11 );
- decimal MSAoumnt = CopeAmount - ActualOrd_Amount;
- if ( Convert.ToDecimal( tblB.Rows[0]["Mcpt_Discount"] ) > 0 )
- {
- MSAoumnt -= (CopeAmount - Convert.ToDecimal( tblB.Rows[0]["Mcpt_Discount"] ) / 10 * CopeAmount);
- }
- Rectangle rec11A = new Rectangle( rec11.X + rec11.Width, rec11.Y - ContentHeight, TableWidth - rec11.Width, rec11.Height );
- g.DrawString( MSAoumnt.ToString( "0.00" ), ft9, b, rec11A );
- Point rec11A_1 = new Point( rec11A.X, rec11A.Y + rec11A.Height - Underline );
- Point rec11A_2 = new Point( rec11A.X + rec11A.Width, rec11A_1.Y );
- g.DrawLine( p, rec11A_1, rec11A_2 );
- #endregion
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec11.X, rec11.Y + rec11.Height + rec11.Height / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- /// <summary>
- /// 小票打印服务消费
- /// </summary>
- public static void SmallTicket_MemberServiceUse( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- Hashtable htData = (Hashtable)objValue;
- List<Hashtable> hlist = (List<Hashtable>)htData["hlist"];
- string ExecuteSql = "select Company_Telephone from dbo.tb_ErpCompanyInfo where Company_DividedShop = '" + StrDividedShop + "';";
- ExecuteSql += "select 会员卡号,姓名,性别,电话 from BView_MemberMain_GoldMember where Mc_Number = '" + htData["strNumber"] + "' ;";
- DataSet dsData = new BLL.BLL_ErpOrder().GetView_Custom( ExecuteSql );
- DataTable tbl_Info = dsData.Tables["ds"];
- DataTable tblA = dsData.Tables["ds1"];
- if ( tbl_Info.Rows.Count <= 0 )
- {
- MessageBoxCustom.Show( "未设置影楼信息" ); return;
- }
- if ( tblA.Rows.Count == 0 )
- {
- MessageBoxCustom.Show( "会员卡号不存在" ); return;
- }
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width;
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- string StrSmallTicketSerialNumber = "";
- for ( int l = 0; l < PrintPageCount; l++ )
- {
- #region 收款标题
- SizeF sizef = g.MeasureString( DefaultPrintTitle, ft10, TableWidth );
- int FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- int FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec1 = new Rectangle( TableWidth / 2 - FtWidth / 2, StartRows_Y, TableWidth, FtHeight );
- g.DrawString( DefaultPrintTitle, ft10, b, rec1 );
- #endregion
- #region 客户资料
- #region 第一行 流程单号
- string rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "会员卡号:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec2 = new Rectangle( 0, rec1.Y + rec1.Height + 5, FtWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec2 );
- Rectangle rec2A = new Rectangle( rec2.X + rec2.Width, rec2.Y - ContentHeight, TableWidth - rec2.Width, rec2.Height );
- g.DrawString( tblA.Rows[0]["会员卡号"].ToString().Trim(), ft9, b, rec2A );
- Point rec2A_1 = new Point( rec2A.X, rec2A.Y + rec2A.Height - Underline );
- Point rec2A_2 = new Point( rec2A.X + rec2A.Width, rec2A_1.Y );
- g.DrawLine( p, rec2A_1, rec2A_2 );
- #endregion
- #region 第三行 主联系人姓名
- Rectangle rec4 = new Rectangle( rec2.X, rec2.Y + rec2.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户姓名:" ), ft9, b, rec4 );
- Rectangle rec4A = new Rectangle( rec4.X + rec4.Width, rec4.Y - ContentHeight, TableWidth - rec4.Width, rec4.Height );
- g.DrawString( tblA.Rows[0]["姓名"].ToString().Trim(), ft9, b, rec4A );
- Point rec4A_1 = new Point( rec4A.X, rec4A.Y + rec4A.Height - Underline );
- Point rec4A_2 = new Point( rec4A.X + rec4A.Width, rec4A_1.Y );
- g.DrawLine( p, rec4A_1, rec4A_2 );
- #endregion
- #region 第四行 性别
- Rectangle rec5 = new Rectangle( rec4.X, rec4.Y + rec4.Height, rec4.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 性 别:" ), ft9, b, rec5 );
- Rectangle rec5A = new Rectangle( rec5.X + rec5.Width, rec5.Y - ContentHeight, TableWidth - rec5.Width, rec5.Height );
- g.DrawString( tblA.Rows[0]["性别"].ToString().Trim(), ft9, b, rec5A );
- Point rec5A_1 = new Point( rec5A.X, rec5A.Y + rec5A.Height - Underline );
- Point rec5A_2 = new Point( rec5A.X + rec5A.Width, rec5A_1.Y );
- g.DrawLine( p, rec5A_1, rec5A_2 );
- #endregion
- #region 第五行 联系电话
- Rectangle rec6 = new Rectangle( rec5.X, rec5.Y + rec5.Height, rec5.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "联系电话:" ), ft9, b, rec6 );
- Rectangle rec6A = new Rectangle( rec6.X + rec6.Width, rec6.Y - ContentHeight, TableWidth - rec6.Width, rec6.Height );
- g.DrawString( LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls( tblA.Rows[0]["电话"] ), ft9, b, rec6A );
- Point rec6A_1 = new Point( rec6A.X, rec6A.Y + rec6A.Height - Underline );
- Point rec6A_2 = new Point( rec6A.X + rec6A.Width, rec6A_1.Y );
- g.DrawLine( p, rec6A_1, rec6A_2 );
- #endregion
- #endregion
- Point rec7B_1 = new Point( 0, rec6A_1.Y + rec6.Height / 3 + RowHeight / 2 );
- Point rec7B_2 = new Point( TableWidth, rec7B_1.Y );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #region 第八行 产品
- int IntPoint_Y = rec7B_1.Y + RowHeight / 2;
- for ( int i = 0; i < hlist.Count; i++ )
- {
- Hashtable htData2 = (Hashtable)hlist[i];
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "消费项目:" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle recFor1 = new Rectangle( rec2.X, IntPoint_Y, FtWidth, rec2.Height );
- g.DrawString( rec1Value, ft9, b, recFor1 );
- Rectangle recFor1A = new Rectangle( recFor1.Width, recFor1.Y, TableWidth - FtWidth, recFor1.Height );
- g.DrawString( htData2["ItemName"].ToString().Trim(), ft9, b, recFor1A );
- Rectangle recFor2 = new Rectangle( recFor1.X, recFor1.Y + recFor1.Height, recFor1.Width, recFor1.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "消费次数:" ), ft9, b, recFor2 );
- Rectangle recFor2A = new Rectangle( recFor1A.X, recFor2.Y, recFor1A.Width, recFor2.Height );
- g.DrawString( htData2["UseCount"].ToString().Trim(), ft9, b, recFor2A );
- Rectangle recFor3 = new Rectangle( recFor2.X, recFor2.Y + recFor2.Height, recFor1.Width, recFor2A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "剩余次数:" ), ft9, b, recFor3 );
- Rectangle recFor3A = new Rectangle( recFor1A.X, recFor3.Y, recFor2A.Width, recFor3.Height );
- g.DrawString( htData2["UseAfterCount"].ToString().Trim(), ft9, b, recFor3A );
- Rectangle recFor4 = new Rectangle( recFor3.X, recFor3.Y + recFor3.Height, recFor1.Width, recFor3A.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "消费时间:" ), ft9, b, recFor4 );
- Rectangle recFor4A = new Rectangle( recFor3A.X, recFor4.Y, recFor3A.Width, recFor4.Height );
- g.DrawString( htData2["UseTime"].ToString().Trim(), ft9, b, recFor4A );
- Rectangle recFor5 = new Rectangle( recFor4.X, recFor4.Y + recFor4.Height, recFor1.Width, recFor4.Height );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 经手人:" ), ft9, b, recFor5 );
- Rectangle recFor5A = new Rectangle( recFor4A.X, recFor5.Y, recFor4A.Width, recFor5.Height );
- g.DrawString( htData2["JingShouRen"].ToString().Trim(), ft9, b, recFor5A );
- IntPoint_Y = recFor5.Y + recFor5.Height + RowHeight / 2;
- }
- #endregion
- Point rec8_1 = new Point( rec2.X, IntPoint_Y );
- Point rec8_2 = new Point( TableWidth, rec8_1.Y );
- g.DrawLine( pen, rec8_1, rec8_2 );
- #region 第十三行 备注
- string PaymentExplain = "";
- if ( PrintOtherData.ContainsKey( "收款单说明" ) && PrintOtherData["收款单说明"].ToString().Trim().Length > 0 )
- {
- PaymentExplain = PrintOtherData["收款单说明"].ToString().Trim();
- }
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( " 备 注: " ) + PaymentExplain;
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- double dbHeight = sizef.Height;
- int RowCount = FtWidth / TableWidth;
- RowCount++;
- double NewRowHeight = (dbHeight * float.Parse( RowCount.ToString() ));
- Rectangle rec12 = new Rectangle( rec2.X, rec8_1.Y + RowHeight / 2, TableWidth + 7, Convert.ToInt32( NewRowHeight ) + 1 );
- g.DrawString( rec1Value, ft9, b, rec12 );
- #endregion
- #region 第十四行 服务电话
- Rectangle rec13 = new Rectangle( rec12.X, rec12.Y + rec12.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "服务电话:" ) + tbl_Info.Rows[0]["Company_Telephone"].ToString().Trim(), ft9, b, rec13 );
- #endregion
- #region 第十五行 客户确认
- Rectangle rec14 = new Rectangle( rec13.X, rec13.Y + rec13.Height + rec13.Height, rec2.Width, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "客户确认" ), ft9, b, rec14 );
- Point rec14_1 = new Point( rec14.Width, rec14.Y + rec14.Height + rec14.Height / 2 );
- Point rec14_2 = new Point( TableWidth, rec14_1.Y );
- g.DrawLine( p, rec14_1, rec14_2 );
- #endregion
- #region 第十六行 打印时间
- Rectangle rec15 = new Rectangle( rec14.X, rec14.Y + rec14.Height + rec14.Height, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( "打印时间:" ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy-MM-dd HH:mm:ss" ), ft9, b, rec15 );
- int TopHeight = rec15.Y + rec15.Height;
- //if (IsPrintSerialNo && PrintPageCount > 1)
- if ( IsPrintSerialNo )
- {
- if ( l == 0 )
- {
- StrSmallTicketSerialNumber = GetSmallTicketSerialNumber();
- }
- if ( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition )
- {
- StrSmallTicketSerialNumber = PrintReceiptSerial( LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.CurrentCompanyInfoID );
- }
- Rectangle rec16 = new Rectangle( rec15.X, TopHeight, TableWidth, RowHeight );
- g.DrawString( LYFZ.BLL.OtherCommonModel.FontConversion( " 流水号:SNO" ) + StrSmallTicketSerialNumber, ft9, b, rec16 );
- TopHeight += rec15.Height;
- }
- #endregion
- #region 尾
- rec1Value = LYFZ.BLL.OtherCommonModel.FontConversion( "谢谢惠顾!" );
- sizef = g.MeasureString( rec1Value, ft9 );
- FtWidth = Convert.ToInt32( sizef.Width ) + 1;
- FtHeight = Convert.ToInt32( sizef.Height );
- Rectangle rec17 = new Rectangle( TableWidth / 2 - FtWidth / 2, TopHeight + rec15.Height / 2, TableWidth, RowHeight );
- g.DrawString( rec1Value, ft9, b, rec17 );
- #endregion
- StartRows_Y = rec17.Y + rec17.X + RowHeight * 2;
- }
- }
- public static void SmallTicket_StaffRewardAndPunishment( object objValue, Graphics g, Size size, bool IsPrintSerialNo )
- {
- int nLastY = -1;
- // 解析要打印的数据;
- Hashtable hashtable = (Hashtable)objValue;
- DataGridViewRow dgvr = (DataGridViewRow)hashtable["CurrentRow"];
- // 画刷;
- Brush b = Brushes.Black;
- Pen p = new Pen( b, 1 );
- Pen pen = new Pen( b, 1 );
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
- pen.DashPattern = new float[] { 5, 5 };
- string StrFont = "宋体";
- Font ft10 = new Font( StrFont, 17, GraphicsUnit.Pixel );
- Font ft9 = new Font( StrFont, 12, GraphicsUnit.Pixel );
- Font ft5 = new Font( StrFont, 5, GraphicsUnit.Pixel );
- int Underline = 3;
- int ContentHeight = 2;
- int TableWidth = size.Width - 5 * 2;/* 5做为边距值 */
- int RowHeight = Convert.ToInt32( g.MeasureString( "调试行高", ft9 ).Height );
- int StartRows_Y = 0;
- // 获取影楼店信息;
- string strQuery = orbll.GetView_CustomReturnExecuteSql( "tb_ErpCompanyInfo",
- StrWhere: "Company_DividedShop = '" + StrDividedShop + "'",
- ShowColumnName: "Company_Address, Company_Telephone, Company_UpdateDatetime" );
- DataSet dtCompany = orbll.GetView_Custom( strQuery );
- DataTable tbl = dtCompany.Tables["ds"];
- #region 打印票据标题
- Rectangle rcConfig = PrinterDrawMethod.ComputeTextCell( g, DefaultPrintTitle, new Rectangle( size.Width / 4, 5, size.Width / 2, 60 ), ft10 );
- g.DrawString( DefaultPrintTitle, ft10, b, rcConfig );
- #endregion
- #region 相关人员;
- string strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "相关人员:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 5, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- strValue = dgvr.Cells["相关人员"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 奖罚类型;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "奖罚类型:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- strValue = dgvr.Cells["奖罚类型"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 执行方式;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "执行方式:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- strValue = dgvr.Cells["是否执行"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 虚线;
- Point rec7B_1 = new Point( 0, rcConfig.Bottom + 2 );
- Point rec7B_2 = new Point( TableWidth, rcConfig.Bottom + 2 );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #endregion
- #region 金额;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "金 额:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 6, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- strValue = dgvr.Cells["奖罚金额"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 录单人员;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "录单人员:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- strValue = dgvr.Cells["录单人"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 执行日期;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "执行日期:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- strValue = dgvr.Cells["执行日期"].Value.ToString();
- rcConfig = new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 备注;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "备 注:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 2, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- // 备注内容;
- strValue = dgvr.Cells["备注"].Value.ToString();
- rcConfig = PrinterDrawMethod.ComputeTextCell( g, strValue, new Rectangle( rcConfig.X + rcConfig.Width, rcConfig.Y, TableWidth - rcConfig.Width, RowHeight ), ft9 );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 虚线;
- rec7B_1 = new Point( 0, rcConfig.Bottom + 2 );
- rec7B_2 = new Point( TableWidth, rcConfig.Bottom + 2 );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #endregion
- #region 领导审批;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "领导审批:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 10, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 相关人员签字;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "相关人员签字:" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 10, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 打印日期;
- strValue = LYFZ.BLL.OtherCommonModel.FontConversion( "打印日期: " ) + LYFZ.Command.Command_Validate.DateTimeToString( SDateTime.Now, "yyyy年MM月dd日" );
- rcConfig = new Rectangle( 0, rcConfig.Bottom + 10, (int)g.MeasureString( strValue, ft9 ).Width + 2, RowHeight );
- g.DrawString( strValue, ft9, b, rcConfig );
- #endregion
- #region 虚线;
- rec7B_1 = new Point( 0, rcConfig.Bottom + 2 );
- rec7B_2 = new Point( TableWidth, rcConfig.Bottom + 2 );
- g.DrawLine( pen, rec7B_1, rec7B_2 );
- #endregion
- }
- /// <summary>
- /// 获取订单客户资料
- /// </summary>
- /// <param name="StrNumber">订单号</param>
- /// <param name="StrOrderType">订单类型</param>
- static Hashtable GetClientInfo( string StrNumber, string StrOrderType )
- {
- Hashtable htData = new Hashtable();
- htData["StrChildName"] = "";
- htData["StrChildSex"] = "";
- htData["StrChildRAgeString"] = "";
- htData["StrParentName"] = "";
- htData["StrParentSex"] = "";
- htData["StrParentPhone"] = "";
- htData["StrManName"] = "";
- htData["StrManSex"] = "";
- htData["StrManPhone"] = "";
- htData["StrManMarriage"] = "";
- htData["StrWoManName"] = "";
- htData["StrWoManSex"] = "";
- htData["StrWoManPhone"] = "";
- htData["StrMainName"] = "";
- htData["StrMainPhone"] = "";
- htData["StrMainSex"] = "";
- DataTable tbl_Client = GetClientData( StrNumber );
- if ( tbl_Client.Rows.Count > 0 )
- {
- if ( StrOrderType.Trim() == "0" )
- {
- #region 婚纱
- for ( int i = 0; i < tbl_Client.Rows.Count; i++ )
- {
- if ( i == 0 )
- {
- htData["StrManName"] = tbl_Client.Rows[i]["Cus_Name"].ToString().Trim();
- htData["StrManSex"] = tbl_Client.Rows[i]["Cus_Sex_cs"].ToString().Trim();
- htData["StrManPhone"] = tbl_Client.Rows[i]["Cus_Telephone"].ToString().Trim();
- if ( LYFZ.Command.Command_Validate.DateTimeToString( tbl_Client.Rows[i]["Cus_DayForMarriage"] ) != "" )
- {
- htData["StrManMarriage"] = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Client.Rows[i]["Cus_DayForMarriage"] );
- if ( !string.IsNullOrEmpty( tbl_Client.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() ) && tbl_Client.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1" )
- {
- htData["StrManMarriage"] += " (农历)";
- }
- }
- }
- else if ( i == 1 )
- {
- htData["StrWoManName"] = tbl_Client.Rows[i]["Cus_Name"].ToString().Trim();
- htData["StrWoManSex"] = tbl_Client.Rows[i]["Cus_Sex_cs"].ToString().Trim();
- htData["StrWoManPhone"] = tbl_Client.Rows[i]["Cus_Telephone"].ToString().Trim();
- if ( LYFZ.Command.Command_Validate.DateTimeToString( tbl_Client.Rows[i]["Cus_DayForMarriage"] ) != "" )
- {
- htData["StrManMarriage"] = LYFZ.Command.Command_Validate.DateTimeToString( tbl_Client.Rows[i]["Cus_DayForMarriage"] );
- if ( !string.IsNullOrEmpty( tbl_Client.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() ) && tbl_Client.Rows[i]["Cus_DayForMarriageLunar"].ToString().Trim() == "1" )
- {
- htData["StrManMarriage"] += " (农历)";
- }
- }
- }
- }
- #endregion
- }
- else if ( StrOrderType.Trim() == "1" )
- {
- #region 儿童
- for ( int i = 0; i < tbl_Client.Rows.Count; i++ )
- {
- if ( tbl_Client.Rows[i]["GM_Master"].ToString().Trim() == "1" && tbl_Client.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "0" )
- {
- htData["StrParentName"] = tbl_Client.Rows[i]["Cus_Name"].ToString().Trim();
- htData["StrParentPhone"] = tbl_Client.Rows[i]["Cus_Telephone"].ToString().Trim();
- htData["StrParentSex"] = tbl_Client.Rows[i]["Cus_Sex_cs"].ToString().Trim();
- }
- else if ( tbl_Client.Rows[i]["GM_Master"].ToString().Trim() == "0" && tbl_Client.Rows[i]["GM_ProtagonistCustomer"].ToString().Trim() == "1" )
- {
- htData["StrChildName"] = tbl_Client.Rows[i]["Cus_Name"].ToString().Trim();
- htData["StrChildSex"] = tbl_Client.Rows[i]["Cus_Sex_cs"].ToString().Trim();
- htData["StrChildRAgeString"] = tbl_Client.Rows[i]["Age_String"].ToString().Trim();
- }
- }
- #endregion
- }
- else if ( StrOrderType.Trim() == "2" || StrOrderType.Trim() == "3" || StrOrderType.Trim() == "4" )
- {
- #region 写真、其他
- if ( tbl_Client.Rows.Count > 0 )
- {
- htData["StrMainName"] = tbl_Client.Rows[0]["Cus_Name"].ToString().Trim();
- htData["StrMainPhone"] = tbl_Client.Rows[0]["Cus_Telephone"].ToString().Trim();
- htData["StrMainSex"] = tbl_Client.Rows[0]["Cus_Sex_cs"].ToString().Trim();
- }
- #endregion
- }
- return htData;
- }
- else
- {
- MessageBoxCustom.Show( "获取订单客户资料失败!" ); return null;
- }
- }
- /// <summary>
- /// 获取客户数据
- /// </summary>
- /// <param name="StrNumber"></param>
- /// <returns></returns>
- private static DataTable GetClientData( string StrNumber )
- {
- DataSet dtSet = orbll.GetView_Custom( orbll.GetView_CustomReturnExecuteSql( "View_CustomerGroupAndCustomerGroupMembersAndErpCustomer", StrWhere: "GP_OrderNumber = '" + StrNumber + "' ", filedOrder: "GM_Master DESC", ShowColumnName: "Cus_Sex,Cus_Sex_cs,Age_String,Cus_Name,Cus_Telephone,Cus_MicroSignal,Cus_QQ,Cus_Address,Cus_Birthday,Cus_BirthdayLunar,Cus_DayForMarriage,Cus_DayForMarriageLunar,GM_Master,GM_ProtagonistCustomer" ) );
- return dtSet.Tables["ds"];
- }
- /// <summary>
- /// 获取小票流水号
- /// </summary>
- /// <returns></returns>
- private static string GetSmallTicketSerialNumber()
- {
- LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
- LYFZ.Model.Model_ErpSystemConfigure model = sgbll.GetModel( "Sconfig_Code", "SmallTicketSerialNumber" );
- if ( model.ID <= 0 )
- {
- model = new Model.Model_ErpSystemConfigure();
- model.Sconfig_Code = "SmallTicketSerialNumber";
- model.Sconfig_Name = "小票收款打印流水号";
- model.Sconfig_Value = "0000001";
- model.Sconfig_IsEnabled = true;
- model.Sconfig_Remark = "小票收款单打印时候的序号(每张的号码重覆,每打一张这里垒加一)";
- model.Sconfig_Type = "";
- model.Sconfig_Order = 1;
- model.Sconfig_CreateDatetime = SDateTime.Now;
- model.Sconfig_CreateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- sgbll.Add( model );
- }
- else
- {
- model.Sconfig_Value = (Convert.ToInt32( model.Sconfig_Value ) + 1).ToString( "d7" );
- model.Sconfig_CreateDatetime = SDateTime.Now;
- model.Sconfig_CreateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- sgbll.Update( model );
- }
- return model.Sconfig_Value;
- }
- #endregion
- }
- }
|